src
stringlengths
721
1.04M
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', url(r'^$', 'bookshelf.views.home_page', name='home'), url(r'^list-books/$', 'bookshelf.views.list_books', n...
# -*- 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 dashboard.models.functional_use import FunctionalUseToRawChem from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render, reverse, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from django.db.models impor...
# -*- coding: utf-8 -*- # Copyright (c) 2013 Ole Krause-Sparmann # 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 # -*- coding: u...
"""modelo_flechas Revision ID: 036 Revises: 035 Create Date: 2014-10-18 10:15:27.483639 """ # revision identifiers, used by Alembic. revision = '036' down_revision = '035' import inspect import imp import os from alembic import op def upgrade(): utils_path = os.path.join(os.path.dirname(os.path.abspath(inspect...
""" Transmission script of the range test. author Jonathan Munoz (jonathan.munoz@inria.fr), January 2017 """ import time import logging import threading import sys import sched import Queue import json from datetime import datetime as dt import datetime import socket from threading import Timer import at86rf215_defs...
""" This file contains all the precedures called from the GraphsTab There are several ways to graph stuff. Much of what is in this files draws to a ttk canvas, in this case self.graphCanvas. The other way is to use matplotlib. Index: (alphabetical) cocaineModel() OK cumulativeRecord() OK eventRecord...
from django.db import models from ckeditor.fields import RichTextField from solo.models import SingletonModel from phonenumber_field import modelfields as phonenumber_models from foti.models import Foto from opere.models import Opera from scritti.models import Scritto class Profile(SingletonModel): name = mod...
# -*- coding: utf-8 -*- # Python3.4* from sys import stdin, stdout, argv from Bot import Planner from Bot.Game.Game import Game from Bot.Parser import Parser class Bot: def __init__(self, strategy, params): self.game = Game() self._parser = Parser(self.game) self._planner =...
"""Module for preprocessing Cornell dialog data. """ import os import pickle import nltk from tqdm import tqdm class Preprocessor: """Class for parsing and preprocessing dialogs. """ def __init__(self, config): self._config = config self._lines, self._token2id, self._id2token = self._prep...
# -*- coding: utf-8 -*- # # 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 #...
# -*- coding: utf-8 -*- import sys import random import unittest from datetime import datetime import pytest from aerospike import exception as e from aerospike_helpers.operations import bitwise_operations from aerospike_helpers import cdt_ctx from aerospike_helpers.operations import list_operations from aerospike_he...
import warnings from enum import Enum, EnumMeta from types import DynamicClassAttribute class EChoiceMeta(EnumMeta): """ Used to override some methods. See Also -------- https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#restrictions-with-multiple-metaclasses """ ...
import matplotlib.pyplot as plt import numpy as np from lms_code.analysis.run_bem import get_slip_magnitude import lms_code.lib.rep2 as rep2 import lms_code.plots.plot_all as lms_plot def main(): lms_plot.setup() fig = plt.figure() which_model = 'all_details' bem_soln = rep2.load('bem_' + which_model)...
from typing import List, Optional import pandas as pd import requests from bs4 import BeautifulSoup, Comment, PageElement, ResultSet from . import cache from .utils import most_recent_season def get_soup(year: int) -> BeautifulSoup: url = f'http://www.baseball-reference.com/leagues/MLB/{year}-standings.shtml' ...
# coding: utf8 # Copyright 2013-2015 Vincent Jacques <vincent@vincent-jacques.net> import unittest import MockMockMock class ExpectationSequenceTestCase(unittest.TestCase): def setUp(self): super(ExpectationSequenceTestCase, self).setUp() self.mocks = MockMockMock.Engine() self.mock = s...
import json import os from datetime import datetime from unittest import TestCase from xml.etree import ElementTree import ddt import mock import pytz from freezegun import freeze_time from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xblock.runtime import Runtime from xblock.validati...
# coding: utf-8 # Copyright 2013 The Font Bakery 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 re...
import asyncio import asyncio.streams from .client_exceptions import (ClientOSError, ClientPayloadError, ClientResponseError, ServerDisconnectedError) from .http import HttpResponseParser, StreamWriter from .streams import EMPTY_PAYLOAD, DataQueue class ResponseHandler(DataQueue, asyn...
from __future__ import unicode_literals from django_markup.filter import MarkupFilter class RstMarkupFilter(MarkupFilter): """ Converts a reStructuredText string to HTML. If the pygments library is installed you can use a special `sourcecode` directive to highlight portions of your text. Example: ...
from os import listdir, remove from os.path import isfile, join import numpy as np import cv2 from cv2 import __version__ cv_ver = __version__.split('.') NEW_OCV = True if int(cv_ver[0]) < 3: NEW_OCV = False import cv2.cv as cv mypath = '/media/hayden/UStorage/DATASETS/VIDEO/TENNIS/BBS/imgtest/' try: rem...
# A Magento 2 module generator library # Copyright (C) 2016 Derrick Heesbeen # Copyright (C) 2016 Maikel Martens Changed add API and refactor code # # This file is part of Mage2Gen. # # Mage2Gen is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
"""The kodi component.""" import logging from pykodi import CannotConnectError, InvalidAuthError, Kodi, get_kodi_connection from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_SSL, CONF_USERNAME, EVENT_HOMEASSISTANT_...
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils def offset_gaussian(): # Connect to a pre-existing cluster insurance = h2o.import_file(pyunit_utils.locate("smalldata/glm_test/insurance.csv")) insurance["offset"] = insurance["Holders"].log() gbm = h2o.gbm(x...
#!/usr/bin/env python """ More elaborate example trying to retrieve as much data as possible from a Trimble Copernicus II GPS. It shows how to a) Establish a connection to the GPS. b) Send request packets to the GPS. c) Read report packets from the GPS and extract data. Includes code inspired and co-written by Danie...
# Chris Bugg # 10/1/14 # NOTE: Runs on Python 2.7.6 # UPDATE: # 10/10/14 # -> Now runs with 8 sub-processes using # the [a-z] alphabet import hashlib from time import time from multiprocessing import Process, Pipe, Lock import os class DemoCrack(): algorithm = "sha256" origHash = '...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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 later version. T...
# encoding: utf-8 # module PyQt4.QtCore # from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import sip as __sip from .QState import QState class QStateMachine(QState): """ QStateMachine(QObject parent=None) """ def addDefaultAnimation(se...
from collections import namedtuple from datetime import date from django import forms from django.contrib.auth import get_user_model from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from core.models import SiteConfiguration from maps.widgets import MapboxGlWidget from...
#!/usr/bin/env python #Copyright (c) 2016 Ramnatthan Alagappan #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, modif...
from datetime import datetime import json import os import gzip class Logger: def __init__(self): pass def callback(self, character, *args, **kwargs): raise NotImplementedError class Debugger: def callback(self, character, *args, **kwargs): print("Received: character='%s', arg...
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright 2015 Esri # 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.apac...
""" Metrics used to evaluate recommendations. Shamelessly copied from bwhite's gist: https://gist.github.com/bwhite/3726239 """ import numpy as np def reciprocal_rank(r): """Score is reciprocal of the rank of the first relevant item First element is 'rank 1'. Relevance is binary (nonzero is relev...
# -*- 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 o...
import re from django.conf import settings from django.contrib.auth.models import User from couchdbkit.resource import ResourceNotFound from corehq import toggles, privileges from dimagi.utils.couch.database import get_db from django.core.cache import cache from django_prbac.exceptions import PermissionDenied from d...
""" Like :mod:`telepot.delegate`, this module has a bunch of seeder factories and delegator factories. .. autofunction:: per_chat_id .. autofunction:: per_chat_id_in .. autofunction:: per_chat_id_except .. autofunction:: per_from_id .. autofunction:: per_from_id_in .. autofunction:: per_from_id_except .. autofunction:...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, now, get_gravatar from frappe import throw, msgprint, _ from frappe.auth import _update_password from frappe.desk.notifications imp...
#! /usr/bin/env python import rospy import time from sub_trajectory.msg import ThrusterStatus from geometry_msgs.msg import Wrench from std_msgs.msg import Header import numpy as np def rosToArray(msg): #Convert a ros message with 1-4 dimensions into a numpy array return np.array([getattr(msg, key) for key in ("...
#!/usr/bin/env python # (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """Tests saving and loading to HDF5 format.""" import tempfile import pytest import numpy as np import tbmodels KWARGS = [ dict(), dict(pos=None, dim=3), dict(uc=3 * np.eye(3))...
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.core.exceptions import ValidationError from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger fr...
# -*- coding: utf-8 -*- """ ################################################ Plataforma ActivUFRJ ################################################ :Author: *Núcleo de Computação Eletrônica (NCE/UFRJ)* :Contact: carlo@nce.ufrj.br :Date: $Date: 2009-2010 $ :Status: This is a "work in progress" :Revision: $Revision: 0.0...
# -*- coding: utf-8 -*- import sys import os import random import datetime import pkg_resources import subprocess from .nvidia_devices_info import get_devices_info from xml.etree import ElementTree import nkf def get_python_version(): v = sys.version_info return str(v[0]) + '.' + str(v[1]) + '.' + str(v[2]) ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # Copyright 2012, Red Hat, 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:/...
import random def trie(tr, path): cur = tr for x in path: if x not in cur: cur[x] = {} cur = cur[x] if len(path) > 0: cur['_'] = True def trie_find(tr, path): cur = tr for x in path: if x not in cur: return False cur = cur[x] if len(path) == 0: return True r...
from nose.tools import * import builder.automate as ba from pywinauto import WindowNotFoundError, application def test_exe(): exe = ba.exe("/") assert exe.split('.')[1] == 'exe' @raises(WindowNotFoundError) def test_connect_not_running(): ba.connect() def test_connect(): ba.start(ba.exe(ba.default...
# -*- coding: utf-8 -*- import os import urlparse import markupsafe from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from django.db import models from framework.auth import Auth from github3 import GitHubError from osf.models.external impo...
''' Created on Feb 21, 2013 @author: Administrator ''' from collections import defaultdict from math import log def readDataFromFile(filename='decision_tree_example.txt'): with open(filename, 'rt') as f: data = [] for line in f: data.append(line.strip().split('\t')) return ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-17 13:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('aklub', '0039_auto_20161221_1256'), ] operations =...
from __future__ import division, print_function, absolute_import from numpy.testing import assert_equal, assert_allclose from scipy._lib._numpy_compat import suppress_warnings import scipy.constants as sc def test_convert_temperature(): assert_equal(sc.convert_temperature(32, 'f', 'Celsius'), 0) assert_equal...
# Copyright (c) 2017, CNRS-LAAS # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the f...
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Ion Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the functionality of all CLI commands. """ from test_framework.test_framework import BitcoinTestFrame...
import io import json import requests from os import curdir, sep from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from cgi import parse_header, parse_multipart, FieldStorage from PIL import Image STACK_URL = 'http://127.0.0.1:8000' class RequestHandler(BaseHTTPRequestHandler): def crop(self, x, ...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
# # (c) 2017 Red Hat Inc. # # 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. # # Ansible is d...
""" Fetch two OID branches ++++++++++++++++++++++ Send a series of SNMP GETNEXT requests using the following options: * with SNMPv2c, community 'public' * over IPv4/UDP * to an Agent at demo.snmplabs.com:161 * for two OIDs in string form * stop when response OIDs leave the scopes of initial OIDs Functionally similar...
# -*- coding: utf-8 -*- # # Copyright (c) 2013-2016 NORDUnet A/S # Copyright (c) 2019 SUNET # 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 r...
# Copyright 2015 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...
#Задача №10,Вариант 6 #Напишите программу "Генератор персонажей" для игры.Пользователю должно быть предоставлено 30 пунктов,которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и возвращ...
"""List the commits between this branch and another.""" import os from enum import Enum from . import upstream from utils import directories, execute, git, messages class DetailsOption(Enum): LOG = 1, INVERSE_LOG = 2, DIFF = 3, STAT = 4, COUNT = 4 class ColorOption(Enum): ALWAYS = 1, ...
"""Abstract base class representing a particular version of an API spoken by a WSGI application. """ import abc from reporting_api.common.authapp import KeystoneApplication import six @six.add_metaclass(abc.ABCMeta) class APIVersion(KeystoneApplication): """Abstract base class representing a particular version o...
# -*- coding: utf-8 -*- """ Display system uptime. Configuration parameters: format: display format for this module (default 'up {days} days {hours} hours {minutes} minutes') Format placeholders: {decades} decades {years} years {weeks} weeks {days} days {hours} hours {minu...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
# -*- coding: utf-8 -*- import os import time import re import urllib import urllib2 import cookielib import base64 import mimetools import itertools import xbmc import xbmcgui import xbmcvfs RE = { 'content-disposition': re.compile('attachment;\sfilename="*([^"\s]+)"|\s') } # ################################ #...
# RedSqaure # pcd8544.device handler # LCD matrix used in the original Nokia 3310 phones # Copyright (c) 2017 full phat products # import threading import sos #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # init: # def init(): global lcd try: import pcd8544lib as lcd ...
#!/usr/bin/env python import inspect from paranoia.base.paranoia_agent import ParanoiaAgent, ParanoiaError __all__ = ['get_event_base', 'EventError', 'Event', 'InstantiateEvent' ,'SetPropertyEvent', 'NewAddressEvent', 'NewShiftEvent', 'NewSizeEvent' ,'SetValueEvent', 'DeclareSubregionEvent', 'M...
import json import re from bs4 import BeautifulSoup from model.Transport.Walk import Walk from model.Transport.PublicTransport import PublicTransport from model.Transport.Drive import Drive from model.Transport.Bicycle import Bicycle from model.Possibilities import Possibilities from webservice_caller.TransportAPICalle...
from classes.Parser import Parser from classes.Paracrypt import Paracrypt from threading import Thread import urllib2 import time import random class Interfacer: def __init__(self, ip, port, username, password, verbose_level, zones_identifier, area_identifier, ses_identifier, status_identifier, states_identifier, ...
if __name__ == "__main__": import sys sys.path.append("./") """This module supports watching for ink-changes on a whiteboard.""" from Utils import Logger from Utils.ForegroundFilter import ForegroundFilter from Utils.ImageUtils import captureImage from Utils.ImageUtils import changeExposure from Utils.ImageUtil...
#!/usr/bin/env python # -*- coding: utf-8 -*- from ST7735 import ST7735 class Graphic: def __init__(self, pst7735): self._st7735 = pst7735 def drawline(self, x0p, y0p, x1p, y1p, color): if (x0p >= self._st7735.width) or (y0p >= self._st7735.height): print " drawline x0, y0 Range ...
import os.path from lxml import etree from datetime import * import time from elasticsearch import Elasticsearch import glob import json import re from urllib.parse import urlparse import platform import kassis_config def json2es(): es = Elasticsearch() es.indices.create(index='my-index', ignore=400) es.in...
from ajenti.ui import * from ajenti.com import implements from ajenti.api import * from ajenti.utils import * from backend import * class FirewallPlugin(CategoryPlugin): text = 'Firewall' icon = '/dl/iptables/icon.png' folder = 'system' platform = ['debian', 'arch', 'opensuse'] defactions = ['AC...
#! /usr/bin/python # coding=utf-8 import sys import iniParser import datetime if len(sys.argv) <= 1: print >> sys.stderr, "Usage: %s headOfRedisVariableNames [prefIniFileName [hardIniFileName]]" sys.exit(-1) if len(sys.argv) > 1: head = sys.argv[1] if len(sys.argv) > 2: pref_ini = sys.argv[2] else: ...
""" WSGI config for box_management project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICA...
""" Copyright 2016, Michael DeHaan <michael.dehaan@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
import unittest import os import json from carson.slack.client import SlackClient class SlackClientTest(unittest.TestCase): MOCK_API_KEY = "123abc" TEST_CONTENT = "totes content tho" def mock_slack_api_call(self, url, json): self.assertEqual(url, 'https://hooks.slack.com/services/123abc') ...
#!/usr/bin/env python ################################################################################ # Copyright (C) 2014, 2015 GenAP, McGill University and Genome Quebec Innovation Centre # # This file is part of MUGQIC Pipelines. # # MUGQIC Pipelines is free software: you can redistribute it and/or modify # it und...
# integrate the equations of motion of a pendulum, w/o the small angle # approximation import numpy import pylab import math # global parameters g = 9.81 # gravitational acceleration [m/s] L = 9.81 # length of pendulum [m] class pendulumHistory: """ simple container to store the pendulum history """ ...
import pyparsing as pp import re import copy class prman_AlfParser: def __init__(self): self.keywords = ['Job', 'Task', 'RemoteCmd'] def parseFile(self, fileText): commands = self.__parseCommandStructure(fileText, 0, isStart = True) #print(commands) textureCmds, Cmds, frames ...
#!/usr/bin/python # # anaconda: The Red Hat Linux Installation program # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
import unittest import os import re from nose.plugins.attrib import attr from jnpr.junos.device import Device from jnpr.junos.rpcmeta import _RpcMetaExec from jnpr.junos.facts.swver import version_info from ncclient.manager import Manager, make_device_handler from ncclient.transport import SSHSession from jnpr.junos.e...
# -*- 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...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, tools, _ from odoo.addons import decimal_precision as dp from odoo.tools import pycompat from odoo.tools.translate import html_translate class ProductStyle(models.Model): _name...
from datetime import timedelta from dateutil.relativedelta import relativedelta from django.utils import timezone from rest_framework import status from rest_framework.test import APITestCase from karrot.base.base_models import CustomDateTimeTZRange from karrot.conversations.models import ConversationNotificationStatu...
import itertools import random from pathlib import Path from configparser import ConfigParser import newick from csvw.dsv import reader from appdirs import user_data_dir from beastling.fileio.datareaders import iterlocations import beastling.clocks.random as random_clock import beastling.models.geo as geo from beas...
#!/usr/bin/env python3 # Based on echobot2.py import logging from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from modules.gifsapm import GifsApmHandler from modules.estraviz import EstravizHandler from modules.dice import DiceHandler ######################## # LOGGING ##################...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# Copyright 2018 The Lucid 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 applicable l...
#!/usr/bin/env python def heapsort(ary, strategy = 'up'): swaps = 0 def swap(i,j): nonlocal swaps swaps += 1 ary[i], ary[j] = ary[j], ary[i] lst = len(ary) def siftup(pos): while pos: if ary[pos] < ary[pos//2]: swap(pos,pos//2) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
"""todo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
import numpy as np import theano from theano import tensor as tt from pymc3.distributions.dist_math import rho2sd from pymc3.theanof import change_flags from .opvi import node_property, collect_shared_to_list from . import opvi __all__ = [ 'Formula', 'PlanarFlow', 'LocFlow', 'ScaleFlow' ] class Form...
#!/usr/bin/env python # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Evaluate peaks of coverage from a kmer coverage file (e.g. Graph2-stats.txt)''' import sys import math # Define functions def num(s): '''Take a string representing and convert it to a number. Return a float or int as appropriate. An exception is raised...
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
XXXXXXXXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXX X XXXXXX XXXXXXXXXX XXXXX XXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX...
#!/usr/bin/env python # encoding: utf-8 ''' monitor.collector -- shortdesc monitor.collector is a description It defines classes_and_methods @author: Yi @copyright: 2016 MY. All rights reserved. ''' import ConfigParser import socket, time, string, logging import MySQLdb from encode import Encode logging.basi...
# generators.py ################################################################### utility ### import collections import itertools import operator import diskio def _iterableize(obj_or_iterable): """provides iterable for [obj OR iterable(obj)]""" if (isinstance(obj_or_iterable, collections.Iterable) and ...
from graphserver.graphdb import GraphDatabase from graphserver.ext.osm.osmdb import OSMDB from graphserver.core import State, WalkOptions, Graph, Street, Combination, EdgePayload, ContractionHierarchy import sys def make_native_ch(basename): gdb = GraphDatabase( basename+".gdb" ) gg = gdb.incarnate() ...
# -*- 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/env python # -*- coding: latin-1 -*- from collections import deque, defaultdict import itertools import time import invariants import pddl import timers class BalanceChecker(object): def __init__(self, task, reachable_action_params): self.predicates_to_add_actions = defaultdict(set) ...