text
stringlengths
475
200k
from __future__ import unicode_literals import frappe from frappe import _ import json from frappe.utils import cstr, cint, nowdate, flt from erpnext.erpnext_integrations.utils import validate_webhooks_request from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice from erpnex...
import xml.etree.ElementTree as ET import trep from math import sin, cos, pi import numpy as np from numpy.linalg import norm def transform(xyz, rpy): r = rpy[0]; p = rpy[1]; y = rpy[2]; return np.array([[cos(y)*cos(p), cos(y)*sin(p)*sin(r)+sin(y)*cos(r), -cos(y)*sin(p)*cos(r)+sin(y)*sin(r)], ...
# -*- coding: utf-8 -*- """ flaskbb.auth.forms ~~~~~~~~~~~~~~~~~~~~ It provides the forms that are needed for the auth views. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ from datetime import datetime from flask_wtf import Form, RecaptchaField from wt...
#!/usr/bin/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 required b...
# !/usr/bin/python import sys from PyQt4.QtGui import * from PyQt4.QtCore import * class TreeWidget(QMainWindow): def __init__(self,parent=None): QWidget.__init__(self,parent) self.setWindowTitle('TreeWidget') self.tree = QTreeWidget() self.tree.setColumnCount(3) self.tree.se...
# -*- coding: utf-8 -*- # # This file is part of JSONAlchemy. # Copyright (C) 2014, 2015 CERN. # # JSONAlchemy 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 opt...
''' Harvester for the MAXWELL for the SHARE project Example API call: http://www.maxwell.vrac.puc-rio.br/DC_Todos.php?verb=ListRecords&metadataPrefix=oai_dc ''' from __future__ import unicode_literals from scrapi.base import OAIHarvester from scrapi.base import helpers def oai_process_pcurio(*args): identifier...
import json import os from datetime import datetime import gzip import shutil import csv try: from redis import Redis, ConnectionError except ImportError: print "Redis is not Installed" exit() __version__ = "0.99.1" class Logist(object): def __init__(self, redis_address="localhost", redis_port=6379,...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
from flask import Flask, render_template, redirect, url_for, request from flask import flash, session from flask.ext.wtf import Form from wtforms import TextField, BooleanField, PasswordField, validators app = Flask(__name__) app.debug = True app.jinja_env.add_extension('jinja2.ext.loopcontrols') app.config.update( ...
# Copyright (C) 2001-2007 by the Free Software Foundation, 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. # # Th...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2016 Christoph Reiter # # 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 late...
# -*- coding: utf-8 -*- ''' Manage Kubernetes .. versionadded:: 2016.3.0 .. code-block:: yaml kube_label_1: k8s.label_present: - name: mylabel - value: myvalue - node: myothernodename - apiserver: http://mykubeapiserer:8080 kube_label_2: k8s.label_absent: ...
#!/usr/bin/env python3 # -*- coding: utf-8, vim: expandtab:ts=4 -*- ############################################################################### # Copyright (c) 2015 Móréh, Tamás # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Lesser Public License v...
from math import ceil import pytest from scipy.stats import norm, randint import numpy as np from sklearn.datasets import make_classification from sklearn.dummy import DummyClassifier from sklearn.experimental import enable_halving_search_cv # noqa from sklearn.model_selection import HalvingGridSearchCV from sklearn...
# Copyright (C) 2012 Tim Radvan # # This file is part of Kurt. # # Kurt 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 # later version. # # Kurt...
import os import sys from setuptools import setup from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'readme.md')).read() CHANGES = open(os.path.join(here, 'changes.txt')).read() except: README = '' CHANGES = '' requires = [ ...
""" Optimization of the CADRE MDP. """ from __future__ import print_function import unittest import os import pickle import numpy as np from openmdao.api import Problem, Group, ParallelGroup, ExplicitComponent, IndepVarComp, \ pyOptSparseDriver from openmdao.utils.assert_utils import assert_rel_error from CADR...
from importlib import import_module from django import template from django.conf import settings from django.template.loader import render_to_string register = template.Library() CUSTOM_FIELD_RENDERER = getattr(settings, 'DAB_FIELD_RENDERER', False) @register.simple_tag(takes_context=True) def render_with_templa...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
import hashlib import time from Plugin import PluginManager from Peer import Peer from util import helper from Crypt import CryptRsa allow_reload = False # No source reload supported in this plugin time_full_announced = {} # Tracker address: Last announced all site to tracker connection_pool = {} # Tracker address...
from toolchain import Recipe, shprint from os.path import join, exists import sh class FFMpegRecipe(Recipe): version = "2.6.3" url = "http://www.ffmpeg.org/releases/ffmpeg-{version}.tar.bz2" include_per_arch = True include_dir = "dist/include" optional_depends = ["openssl"] libraries = [ ...
""" Copyright (c) 2016-2017 The Nirdizati Project. This file is part of "Nirdizati". "Nirdizati" 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 lat...
"""Parallel testing, supporting arbitrary collection ordering The Workflow ------------ - Master py.test process starts up, inspects config to decide how many slave to start, if at all - env['parallel_base_urls'] is inspected first - py.test config.option.appliances and the related --appliance cmdline flag are u...
# -*- coding: utf-8 -*- import os import sys import _pytest._code import py import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR class TestGeneralUsage: def test_config_error(self, testdir): testdir.makeconftest(""" def pytest_configure(config): import...
#!/usr/bin/env python import cv2 import sys import time import random import argparse from Host.game import Game from Host.board import Board from Host.boardDisplayService import BoardDisplayService from Host.arbitrator import Arbitrator from Host.userConnector import UserC...
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import sys, te...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'builder.ui' # # Created: Mon May 22 10:30:45 2017 # by: pyside-uic 0.2.15 running on PySide 1.2.4 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_pandapower(object): def setupUi(s...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from __future__ import unicode_literals import mock import unittest import sys from oauthlib.oauth1 import SIGNATURE_TYPE_QUERY, SIGNATURE_TYPE_BODY from oauthlib.oauth1 import SIGNATURE_RSA, SIGNATURE_PLAINTEXT from requests_oauthlib import OAuth1Session try: from StringIO import StringIO except ImportError: ...
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright [2010] [Anso Labs, 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- import xml.etree.cElementTree as etree from ..lib import createXmlNode class header(object): def __init__(self): self.__clear() def __clear(self): self.n = "" self.hp = "" self.s = "" self.dc = "" self.ds = ""...
""" Part of the floatcanvas.Utilities package. This module contains assorted GUI-related utilities that can be used with FloatCanvas So far, they are: RubberBandBox: used to draw a RubberBand Box on the screen """ import numpy as np import wx from wx.lib.floatcanvas import FloatCanvas, GUIMode class RubberBand...
## Taken from http://code.activestate.com/recipes/134892/ ## Brought to Github for better versioning / editing / updating ## Returns a string (as input() or raw_input() ) ## Use: # import getch # c = getch.getch() # # https://gist.github.com/tigerhawkvok/9542594 class _Getch: """Gets a single character from standa...
#!/usr/bin/env python """ module documentation goes here """ import sys from telesphorus.helpers import parsing from telesphorus.helpers import path_utils PATH_DELIMITER = '->' full_paths_dict = {} def main(argv=sys.argv): """ Identify missing abstration of frequently occuring patterns and print them. ...
# Copyright 2015 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. # This script compares the gtest test list for two different builds. # # Usage: # compare_test_lists.py <build_dir_1> <build_dir_2> <binary_name> # # For e...
from __future__ import absolute_import from celery.utils.log import get_task_logger from celery.signals import after_setup_task_logger from gwaportalpipeline.celery import celery from gwaportalpipeline.common import * from pygwas import pygwas import tempfile import os import logging import ConfigParser import shu...
""" SeqString formatter """ class SeqStringFormatter(object): """Formatter for sequence strings""" def __init__(self, theme): """Creates a new SeqStringFormatter instance""" import os from cats.styles.sequence import SequenceFormatter # Load sequence formatter self.seq_f...
from ..pair_counters import SimulationBoxPairCount, SurveyDataPairCount from .estimators import LandySzalayEstimator, NaturalEstimator, WedgeBinnedStatistic from nbodykit import CurrentMPIComm from nbodykit.binned_statistic import BinnedStatistic import numpy import warnings import logging class BasePairCount2PCF(obj...
# smartmirror.py # requirements # requests, feedparser, traceback, Pillow from Tkinter import * import locale import threading import time import locale import requests import json import traceback import feedparser import serial import subprocess #checks if camera connected from time import sleep #from serial import ...
# -*- coding: utf-8 -*- """ Created on 06/04/2015 @author: david """ import logging from os import system from os.path import exists from flight.driving.sysfs_writer import SysfsWriter class Motor(object): """ Controls a single motor """ KEY_PWM_ID = "pwmId" KEY_PIN_ID = "pinId" ...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <[EMAIL]> # # This file is part of Weblate <http://weblate.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...
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='moltin', version='1.0.1b1', description='Moltin Python SDK...
import coalib.bearlib.aspects from coalib.bearlib.aspects.meta import isaspect, issubaspect class AspectList(list): """ List-derived container to hold aspects. """ def __init__(self, seq=()): """ Initialize a new AspectList. >>> from .Metadata import CommitMessage >>>...
""" Functions for accessing and displaying courses within the courseware. """ from datetime import datetime from collections import defaultdict from fs.errors import ResourceNotFoundError import logging from path import Path as path import pytz from django.http import Http404 from django.conf import settings from edx...
## begin license ## # # "Meresco Oai" are components to build Oai repositories, based on # "Meresco Core" and "Meresco Components". # # Copyright (C) 2012 Nederlands Instituut voor Beeld en Geluid http://www.beeldengeluid.nl # Copyright (C) 2012-2013, 2018 Seecr (Seek You Too B.V.) https://seecr.nl # Copyright (C) 2013...
# HoneyPy Copyright (C) 2013-2017 foospidy # https://github.com/foospidy/HoneyPy # See LICENSE for details # HoneyPy logstash logger import sys import hashlib import socket import json from twisted.python import log #pika==0.10.0 import pika # prevent creation of compiled bytecode files sys.dont_write_bytecode = Tru...
# 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...
from describe.mock.utils import TWO_OPS_FULL, ONE_OPS, NIL, get_args_str from describe.mock.expectations import Invoke, AttributeCatcher, Expectation, ExpectationBuilderFactory, ExpectationList, ExpectationSet from describe.mock.registry import Registry, RegistryError __all__ = ['Mock', 'verify_mock'] class MockErr...
from google.appengine.ext import ndb import logging import os from heroes import fields from heroes.models import Base from heroes.events.models import Event # for photos from google.appengine.api import images import cloudstorage from google.appengine.api import app_identity class Squad(Base): # TEAM IS PARENT ...
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", ...
from tikon.ecs.árb_mód import Parám from ._plntll_ec import EcuaciónDepred class A(Parám): nombre = 'a' líms = (0, 1) inter = ['presa', 'huésped'] unids = 'presa depredador -1 ha -1' class B(Parám): nombre = 'b' líms = (0, None) inter = ['presa', 'huésped'] unids = 'presa ha -1' c...
from srtools import sam import postgresql class PostgresAlignment(sam.Alignment): """An illumina alignment using data stored as a postgres database. The data file is a pg locator for the db. """ def read_generator(self): with postgresql.open(self.data_file) as db: command = "SELEC...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2017, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must reta...
__author__ = 'spersinger' import sys import unittest import os.path import time import base64 import json import time from should_dsl import should, should_not from dateutil.parser import parse sys.path.append(os.path.join(os.path.dirname(__file__), "../..")) from fernet.verifier import Verifier, Token class TestV...
# -*- 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...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """Installer""" __author__ = "Zacharias El Banna" from sys import argv, stdout, path as syspath from json import load,dump,dumps from os import remove, chmod, listdir, path as ospath from subprocess import check_call pkgdir = ospath.abspath(ospath.dirname(__file__)) basedir =...
# coding: utf-8 import unittest import os import logging from sqlalchemy.engine.reflection import Inspector from niamoto.testing import set_test_path set_test_path() from niamoto import log log.STREAM_LOGGING_LEVEL = logging.CRITICAL log.FILE_LOGGING_LEVEL = logging.DEBUG from niamoto.conf import settings, NIAMO...
import time import numpy as np import tkinter as tk from PIL import ImageTk, Image PhotoImage = ImageTk.PhotoImage UNIT = 50 # pixels HEIGHT = 5 # grid height WIDTH = 5 # grid width np.random.seed(1) class Env(tk.Tk): def __init__(self): super(Env, self).__init__() self.action_space = ['u', '...
# -*- coding: utf-8 -*- import pickle, re import xbmcup.app, xbmcup.system, xbmcup.net from defines import * class Auth: def __init__(self): self.success = 'AUTH_OK' self.cookie_file = xbmcup.system.fs('sandbox://'+COOKIE_FILE) self.login = xbmcup.app.setting['username'] self.passw...
# Based on local.py (c) 2012, Michael DeHaan <[EMAIL]> # and chroot.py (c) 2013, Maykel Moya <[EMAIL]> # and jail.py (c) 2013, Michael Scherer <[EMAIL]> # (c) 2015, Dagobert Michelsen <[EMAIL]> # (c) 2015, Toshio Kuratomi <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistr...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Stream(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "treemap" _path_str = "treemap.stream" _valid_props = {"maxpoints", "token"} # maxpoints...
# (c) 2012-2014, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible 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 later version. ...
# 3 4 5 triangle inscribed in a square. # j k # ._______.______. # | s /-_ | # | p / 3-_ s| m # | / -_| # | /4 -| # | / 5 _-` | # | / _-` | n # | / _-` | # |/_-___________| # l # # find p # # # Rational Trig view, quadrance, which is like distances squar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # from docx import Document from itertools import groupby from operator import itemgetter from xml.dom.minidom import parse import sys import re import os import shutil import glob import tempfile import operator import argparse import pdb import string import zipfile ...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2015 ARM 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 ...
#!/usr/bin/env python3 # from numba import jit from ctypes import byref from ransac_detector.ransac_detector_ctypes import Ball_t import lamp import processor import math import numpy as np import matplotlib.pyplot as plt import struct import logging import subprocess #import cv2 from detector import Detector, RansacDe...
class Solution(object): def fractionAddition(self, expression): """ :type expression: str :rtype: str """ if not expression: return '0/1' numerator, denominator = 0, 1 if expression[0] != '-': expression = '+' + expression expression = exp...
__author__ = 'Thomas Rueckstiess, [EMAIL]' from pybrain.utilities import abstractMethod from pybrain.structure.modules import Table, Module, TanhLayer, LinearLayer, BiasUnit from pybrain.structure.connections import FullConnection from pybrain.structure.networks import FeedForwardNetwork from pybrain.structure.paramet...
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2001-2006 James Henstridge # # tinderbox.py: build logic for a non-interactive reporting build # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
# ---------- Scene - Mars ----------- # # ----------------------------------- # -------- Imports -------- import app.config as config from app.scene import SceneLayer from app.vector import Vector from game.scene.scrolling import VerticalScrollingScene, HorizontalScrollingScene from game.scene.timing import TimingSc...
#!/usr/bin/env python3 from statsSend.urbanCodeDeploy.urbanCodeDeployApplication import UrbanCodeDeployApplication from statsSend.urbanCodeDeploy.urbanCodeDeployApplicationProcessRequest import UrbanCodeDeployApplicationProcessRequest class UrbanCodeDeployTag: def __init__(self, session, name): self.sessi...
# Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
class Recipe(object): """ This class provides a Recipe for an Order. It is a list (or dictionary) of tuples (str machineName, int timeAtMachine). """ def __init__(self): """ recipe is a list (or dictionary) that contains the tuples of time information for the Recipe. """ self.recipe = [] def indexO...
import copy import datetime import unittest from db.hockeydb import HockeyPlayerDB from league.hockey import HockeyLeague from league.rules import HockeyRules from sitescraper.nhl.cbssportsdotcom import NhlCbsSportsDotComSraper from sitescraper.nhl.scottcullen import ScottCullenScraper class ArrudaCupHockeyRules(Ho...
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# coding=utf-8 # Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. 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...
# -*- coding: utf-8 -*- """ sphinx.ext.extlinks ~~~~~~~~~~~~~~~~~~~ Extension to save typing and prevent hard-coding of base URLs in the reST files. This adds a new config value called ``extlinks`` that is created like this:: extlinks = {'exmpl': ('http://example.com/%s.html', prefix), ......
# -*- coding: utf-8 -*- ''' Created on Apr 8, 2015 @author: 0_o -- null_null (nu11.nu11 [at] yahoo.com) Oh, and it is n-u-one-one.n-u-one-one, no l's... Wonder how the guys at packet storm could get this wrong :( # vim: set tabstop=2 shiftwidth=2 smarttab expandtab # vim: retab ''' __updated__ = "2...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ast import base64 import datetime import logging import psycopg2 import smtplib import threading import re from collections import defaultdict from odoo import _, api, fields, models from odoo import tools from ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Inspect results from `astropy.vo.validator.validate`.""" from __future__ import absolute_import, division, print_function, unicode_literals # STDLIB import sys # LOCAL from ..client.vos_catalog import get_remote_catalog_db from ...utils.decorators imp...
# -*- coding: utf-8 -*- from resources.lib.gui.gui import cGui from resources.lib.gui.guiElement import cGuiElement from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.parser import cParser from resources.lib import logger from resources.lib.handler.ParameterHandler import ParameterHandl...
# ==================================================================== # 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...
""" Tab completion for our interpreter prompt. """ from stem.interpreter import uses_settings try: # added in python 3.2 from functools import lru_cache except ImportError: from stem.util.lru_cache import lru_cache @uses_settings def _get_commands(controller, config): """ Provides commands recognized by t...
# some python functions import math # area of pollygon def pollygon_area(n,s): denom = math.tan(math.pi/n) numer = 1.0/4.0 * (n * (s ** 2.0)) area = numer / denom return area print pollygon_area(7.0,3.0) def project_to_distance(point_x, point_y, distance): dist_to_origin = math.sqrt(point_x ** 2 ...
import numpy as np def recalls(hist): # true positive rate # TP / (TP + FN) ret = [] trues = sum(hist['trues']) all_trues = trues for i in range(len(hist['probs'])): ret.append(trues * 1.0 / all_trues if all_trues != 0 else None) trues -= hist['trues'][i] return ret def f...
#!/usr/bin/env python # encoding: utf-8 from collections import OrderedDict import sys, os import waflib from waflib.Configure import conf _board_classes = {} _board = None class BoardMeta(type): def __init__(cls, name, bases, dct): super(BoardMeta, cls).__init__(name, bases, dct) if 'abstract'...
# Copyright 2010-2014 Google # Licensed under the Apache License, Version 2.0 (the "License") """Traveling Salesman Sample. This is a sample using the routing library python wrapper to solve a Traveling Salesman Problem. The description of the problem can be found here: http://en.wikipedia.org/wiki/Travell...
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Bil...
# ================================================== # AddUniqueRowID.py # -------------------------------------------------- # Built for ArcGIS 10.1 # -------------------------------------------------- # Adds a new field of unique row numbers to a table # ================================================== # IMPORTS ...
#author: James Henstridge <[EMAIL]> #adapted to _mysql by Andy Dustman <[EMAIL]> #under no circumstances should you bug James about this!!! """This is a class that implements an interface to mySQL databases, conforming to the API published by the Python db-sig at http://www.python.org/sigs/db-sig/DatabaseAPI.html It ...
#!/usr/bin/env python ''' File: Communicator.py Author: Samuel Barrett Description: some classes for socket communication Created: 2010-11-07 Modified: 2010-11-07 ''' import socket, sys, time import cPickle as pickle defaultPort = 5557 class TimeoutError(Exception): def __init__(self, *args): self.value = ar...
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para mega.co.nz # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ import re from core import logger from core import scr...
__all__ = ('language', 'stemmer') from .danish_stemmer import DanishStemmer from .dutch_stemmer import DutchStemmer from .english_stemmer import EnglishStemmer from .finnish_stemmer import FinnishStemmer from .french_stemmer import FrenchStemmer from .german_stemmer import GermanStemmer from .hungarian_stemmer import ...
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <[EMAIL]> # # This program is free software; you can redistribute it and/or # modify it un...
# 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...
# Author: Nic Wolfe <[EMAIL]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 ...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ from webnotes.utils import load_json, cstr, flt, now_datetime, cint from webnotes.model.doc import a...
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...