src
stringlengths
721
1.04M
import sys import os #import httplib2 from time import sleep from threading import Thread from selenium import webdriver from apiclient.discovery import build from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client.tools import argparser, run_flow from PyQt5 i...
# http://github.com/timestocome import numpy as np import pandas as pd import matplotlib.pyplot as plt # look for signature patterns before very high or low return days # meh, the month before tends to have more extreme returns # and more of them are lower than average, (like an earthquake?) # but there isn't a ...
import datetime from rt_utils.image_helper import get_contours_coords from rt_utils.utils import ROIData, SOPClassUID import numpy as np from pydicom.uid import generate_uid from pydicom.dataset import Dataset, FileDataset, FileMetaDataset from pydicom.sequence import Sequence from pydicom.uid import ImplicitVRLittleEn...
""" The file_comparison module exists to easily compare the contents of two files. The functionality of this module is currently limited to CSV files. """ import csv from file_comparison_exceptions import ( UnsupportedFileType, FileDoesNotExist, PermissionDeniedOnFile) from os import unsetenv SUPPORTED_FILE_T...
# # Copyright (c) 2015 Midokura SARL, 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 ...
import math import unittest import bot.coroutine.join from collections import deque from datetime import datetime, timedelta from unittest.mock import PropertyMock, patch from bot.data import Channel from bot.coroutine.connection import ConnectionHandler class TestJoinManager(unittest.TestCase): def setUp(sel...
from datetime import datetime from datetime import timedelta from ott.utils import json_utils import logging log = logging.getLogger(__file__) class Fares(object): def __init__(self, fare_url, fare_timeout_mins=1440): """ """ log.info("create an instance of {0}".format(self.__class__.__...
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from decimal import Decimal from ..model import ModelView, ModelSQL, fields from ..transaction import Transaction from ..cache import Cache from ..pool import Pool __all__ = [...
# -*- encoding: utf-8 from sqlalchemy.testing import eq_, engines, pickleable import datetime import os from sqlalchemy import Table, Column, MetaData, Float, \ Integer, String, Boolean, TIMESTAMP, Sequence, Numeric, select, \ Date, Time, DateTime, DefaultClause, PickleType, text, Text, \ UnicodeText, Large...
# Copyright (c) 2013 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .exceptions import BundleError, ItemDependencyError, NoSuchItem from .items import Item from .items.actions import Action from .utils.text import bold, mark_for_translation as _ from .utils.ui import io class DummyItem(object): bundle = None ...
import collections import os import six from chainer import reporter as reporter_module from chainer.training import extension as extension_module from chainer.training import trigger as trigger_module class _ExtensionEntry(object): def __init__(self, extension, priority, trigger, invoke_before_training): ...
# -*- coding: utf-8 -*- # @Author: Gillett Hernandez # @Date: 2017-12-11 19:30:19 # @Last Modified by: Gillett Hernandez # @Last Modified time: 2017-12-16 17:49:47 from euler_funcs import ContinuedFraction, solve_pell, analyze_triplets, sconvergents, lag, is_square, timed from euler_funcs import timed, construct, ...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://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, eith...
import importlib import logging import click import click_log import six from .loader import load_blueprint from .exceptions import ValidationError, YAMLError, BackendError logger = logging.getLogger('populous') click_log.basic_config(logger) def get_blueprint(files, **kwargs): try: return load_bluepri...
import torch from torch.autograd import Variable import heapq # Based on torch.utils.trainer.Trainer code. # Allows multiple inputs to the model, not all need to be Tensors. class Trainer(object): def __init__(self, model, criterion, optimizer, dataset, cuda=False): self.model = model self.crite...
# Copyright 2012 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """This module defines Isolate Server frontend url handlers.""" import collections import datetime import json import logging import webapp2 im...
# engine/interfaces.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Define core interfaces used by the engine system.""" from .. import util, eve...
# -*- coding: utf-8 -*- import collections import itertools from savate.sources import StreamSource from savate.flv import FLVHeader, FLVTag, FLVAudioData, FLVVideoData class FLVSource(StreamSource): # Initial burst duration, in milliseconds BURST_DURATION = 5 * 1000 def __init__(self, sock, server, a...
# -*- encoding: utf-8 -*- from ceilometer.openstack.common import log from ceilometer.openstack.common import timeutils from ceilometer.central import plugin from ceilometer import sample from ceilometer import neutron_client class LbaasInBytesPollster(plugin.CentralPollster): LOG = log.getLogger(__name__ + '....
# # Copyright 2010-2011 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 ...
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
# -*- coding: utf-8 -*- # # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SignalFrame(object): def setupUi(self, SignalFrame): SignalFrame.setObjectName("SignalFrame") SignalFrame.resize(1057, 509) sizePolicy = QtWidgets.QSizePo...
#!/usr/bin/env python # Copyright 2017 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...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
import pytest from nicedjango.utils import divide_model_def, model_label, queryset_from_def from tests.a1.models import A from tests.a2 import models as a2 from tests.a3.models import Book DIVIDE_RESULTS = ( (A, A, ''), ('a1-a', A, ''), ('a', A, ''), ('a1-a.foo.bar', A, 'foo.bar'), ('a.foo.bar', A...
from django import test as unittest from sqlagg.columns import SimpleColumn, SumColumn from sqlagg.filters import EQFilter from corehq.apps.reports.sqlreport import SqlData, DatabaseColumn, AggregateColumn from .sql_fixture import load_data from .sql_reports import combine_indicator DOMAIN = "test" format_string = "%...
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2015 Karkus476 <karkus476@yahoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
from __future__ import division import os import unittest import numpy as np from astropy.table import Table, Column from desisim.templates import ELG, LRG, QSO, BGS, STAR, STD, MWS_STAR, WD, SIMQSO from desisim import lya_mock_p1d as lyamock desimodel_data_available = 'DESIMODEL' in os.environ desi_templates_availab...
#!/usr/bin/env python """ convolution with correctness checks This example is mostly the same as the Convolution example. The only difference is that a naive kernel is used to compute a reference output. This reference output is used to check the correctness of every kernel before it is benchmarked. This is done usin...
import random, cmd, sys class randgame(cmd.Cmd): intro = "this is randgame" prompt = "randgame # " players = ["asdf", "foo"] turn = 0 rounds = 0 active = False settings = {"no_two" : 0, "voice" : 0} def do_f(self, arg): print self.last_player def do_set(self, arg): 'set settings. see \"list settings\" f...
#Problem J4: Arrival Time departure_time = input() split_departure = list(departure_time) #The time of departure, split into a list. #Split the list departure_hour = split_departure[0:2] departure_minute = split_departure[3:5] #Change the split list to integers. departure_hour = int("".join(departure_hour)) departur...
from __future__ import print_function import os import re import shutil from ...workspace_factory import workspace_factory from ....utils import in_temporary_directory from ....utils import assert_cmd_success from ....utils import assert_cmd_failure from ....utils import assert_files_exist from ....utils import catk...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import arro...
# Copyright 2018 The TensorFlow Probability 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 o...
# Copyright (C) 2013 David Rusk # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribu...
# 1st Activation Function: tanh # 2nd Activation Function: sigmoid # Loss Function: Mean Squared Error Loss # Train Algorithm: Batch Gradient Descent # Bias terms are used. # force the result of divisions to be float numbers from __future__ import division # I/O Libraries from os import listdir from os.path import is...
import os # panel options # 'PNL_A70','PNL_N35', 'PNL_T35' , 'PNL_X35' RT_USING_LCD_TYPE = 'PNL_T35' # toolchains options ARCH = 'arm' CPU = 's3c24x0' TextBase = '0x30000000' CROSS_TOOL = 'keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' ...
"""Support for RFXtrx lights.""" import logging import RFXtrx as rfxtrxmod import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, Light, ) from homeassistant.const import CONF_NAME from homeassistant.helpers import config_validation ...
from __future__ import print_function, division from sympy.core import S, sympify, diff, oo from sympy.core.function import Function, ArgumentIndexError from sympy.core.relational import Eq from sympy.core.logic import fuzzy_not from sympy.polys.polyerrors import PolynomialError from sympy.functions.elementary.complex...
#!/usr/bin/env python3 import numpy as np import pandas as pd df1 = pd.DataFrame({'employee': ['Bob', 'Jake', 'Lisa', 'Sue'], 'group': ['Accounting', 'Engineering', 'Engineering', 'HR']}) df2 = pd.DataFrame({'employee': ['Lisa', 'Bob', 'Jake', 'Sue'], 'hire_date': [2004, 2008, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com> # # This code is distributed under the terms and conditions # from the MIT License (MIT). """ Utilities for streaming from several file-like data storages: S3 / HDFS / standard filesystem / compressed files..., us...
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate plt.ion() f0 = 1e-4 u0 = 1.0 R0 = 40e3 # radius vmax = -1.0 # m/s def v1(rr): v = -vmax*rr/R0*np.exp(-0.5*(rr/R0)**2) # v = -vmax*np.tanh(rr/R0)/(np.cosh(rr/R0))**2/(np.tanh(1.0)/(np.cosh(1.0))...
# -*- coding: utf8 -*- # # Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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 # Licen...
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2019 khalim19 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.utils import shuffle np.random.seed(0) tf.set_random_seed(1234) def inference(x, keep_prob, n_in, n_hiddens, n_out): def weight_variable(shape)...
import os import re import six from collections import defaultdict from geodata.graph.topsort import topsort this_dir = os.path.realpath(os.path.dirname(__file__)) DEFAULT_SCRIPT_PATH = os.path.join(this_dir, 'fetch_osm_address_data.sh') valid_key_regex = re.compile('VALID_(.*?)_KEYS="(.*)"') variable_regex = re.c...
from django.db import models from django.conf import settings from datetime import date, datetime, timedelta import json from django.core.serializers.json import DjangoJSONEncoder CAMPUSES = ( (1, u'PO'), (2, u'SC'), (3, u'CMC'), (4, u'HM'), (5, u'PZ'), (6, u'CGU'), (7, u'CU'), (8, u'KS'), (-1, u'?')) CAMPUSES_FUL...
from __future__ import print_function import warnings import sys import traceback import inspect import pickle import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from skle...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2001 Andrés Marzal Varo # Copyright (C) 2001-2002 J. David Ibáñez <jdavid@itaapy.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundati...
# Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestStockLocation(TransactionCase): def setUp(self): super(TestStockLoca...
"""Test the Transaction models.""" from unittest.mock import patch import pytest from ceraon.models.transactions import Transaction @pytest.mark.usefixtures('db') class TestTransaction: """Transaction tests.""" def test_get_by_id(self, meal, host, guest): """Get Transaction by id.""" transa...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
__author__ = 'andrucuna' # variables - placeholders for important values # used to avoid recomputing values and to # give values names that help reader understand code # valid variable names - consists of letters, numbers, underscore (_) # starts with letter or underscore # case sensitive (capitalization matters) #...
# Copyright 2011 Omniscale (http://omniscale.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 o...
"""Contains the speech segment class.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from data_utils.audio import AudioSegment class SpeechSegment(AudioSegment): """Speech segment abstraction, a subclass of AudioSegment, with an additional tran...
# Joint copyright: # - Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
import api import collections import math #load corenlp if not loaded if not (api.corenlp): api.getcorenlp() corenlp = api.corenlp #ignore these POS IGNORE = {'DT','.',',','\''} #weights given to POS #POS not in this are given default value of 1 POSWGHT = {'RB': 0.7,\ 'RBR':0.7,\ 'RBS':0.7,...
try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET def element_to_string(element): return ET.tostring(element).replace("\r", "").replace("\n", "").replace("\t", "") class StdVisitor: def out(self, path, op, content): print("\t\t\t".join(["".join([e.tag for e in...
#!/usr/bin/env python import os, sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit(0) with open('README.rst', 'r') as f: long_description = f.read() # Dynamically calculate the version based on swingtime.VERSION. version = __import__('struti...
#!/usr/bin/python3 """ Create a network and inject scanner agents. """ from ipaddress import ip_interface import logging from pathlib import Path from signal import signal, SIGINT, SIGTERM import subprocess import sys from threading import Thread from time import sleep from typing import Sequence import libvirt impor...
""" Django settings for gettingstarted project, on Heroku. Fore more info, see: https://github.com/heroku/heroku-django-template For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/s...
unused_columns = { 'pdb': [ 'keywords' ], 'pdb_pfamA_reg': [ 'auto_pdb_reg', 'pdb_start_icode', 'pdb_end_icode', 'seq_start', 'seq_end', 'hex_color' ], 'pfamA': [ 'previous_id', 'author', 'deposited_by', 'seed_so...
#!/usr/bin/python from ldaptor.protocols import pureldap """ RFC2254: filter = "(" filtercomp ")" filtercomp = and / or / not / item and = "&" filterlist or = "|" filterlist not = "!" filter filterlist = 1*filter item = simple /...
#!/usr/bin/env python """ ____ _____ _ _ _ | _ \ _ |_ _|__ _ __ / \ _ __ __ _| |_ _ ___(_)___ | |_) | | | || |/ __| '_ \ / _ \ | '_ \ / _` | | | | / __| / __| | __/| |_| || | (__| | | |/ ___ \| | | | (_| | | |_| \__ \ \__ \ |_| \__, ||_|\___|_| |_/_/...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Service.code' db.add_column(u'clinics_service', 'code', ...
# -*- coding: utf-8 -*- from .base import SparkBase, SparkProperty from .time import SparkTime class SparkWebhook(SparkBase): ''' Cisco Spark Webhook Model :param session: SparkSession object :type session: `SparkSession` :param \**kwargs: All standard Spark API properties for a Webhook...
# code for python reference dipole vector field controller # these functions require stuff #from mathFuns import * from numpy import * from math import * class refVec: # define the constructor def __init__(self, q_0, controller_flag): # Initialize controller state self.phi_prev = None sel...
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API # Add python-bitcoinrpc to module search path: import os import sys sy...
import sys import pandas as pd import numpy as np import itertools from sklearn.preprocessing import RobustScaler from sklearn.linear_model import SGDClassifier from evaluate_model import evaluate_model dataset = sys.argv[1] pipeline_components = [RobustScaler, SGDClassifier] pipeline_parameters = {} loss_values = [...
# This file automatically finds all the .ptw files in a given directory and # converts them to a numpy array for reseach purposes. It bypasses the need of # a proprietary software like ALTAIR to extract and read the data. ''' Before running this file perform 'pip install pyradi' Please run the test file before running...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # seriesly - XBMC Plugin # Conector para netutv # http://blog.tvalacarta.info/plugin-xbmc/seriesly/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core import scrapert...
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
import doctest import json from django.contrib.auth.models import User from django.test import TestCase from django_comments_xtd.models import XtdComment from wagtail.wagtailcore.models import Page from .models import (BlogPage, BlogTag, BlogPageTag, BlogIndexPage, BlogCategory, BlogCategoryBlog...
numStr = ('''37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 2...
''' Evaluates Ackermann function Adopted from here: http://www.eprg.org/computerphile/recursion.htm Usage: python Ackermann.py <brute|cache> <m> <n> Where <brute|cache> specifies whether to enable the cache <m> is the first parameter of the Ackermann function <n> is the second paramete...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.water_heaters_and_thermal_storage import ThermalStorageIceDetailed log = logging.getLogger(__name__) class TestThermalStorageIceDetailed(unittest.TestCase): def setUp(self)...
# -*- coding: UTF8 -*- import os import types import tempfile from lib import env from lib.env import debug from lib.erl import application as app, auth, acl from TestSuite import * from mqttcli import MqttClient from nyamuk.event import * from twisted.internet import defer class Acl(TestSuite): def __init__(s...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests the engine.""" import unittest try: from guppy import hpy except ImportError: hpy = None from dfvfs.helpers import fake_file_system_builder from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.path import factory as path_spec_factory from dfvfs.path...
# -*- coding: utf-8 -*- from pywechat.services.basic import Basic class ShakeService(Basic): """This class is an implement of the Wechat service of shaking. All request's urls come from the official documents. Link: https://mp.weixin.qq.com/wiki/home/index.html """ def bind_page( s...
# -*- coding: utf-8 -*- """ Django settings for Gentle Docs 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/ """ from __future__ import absolute_import, unicode...
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------- # Directory handling # ----------------------------------------------------------------------- # $Id$ # # Notes: # Todo: # # ----------------------------------------------------------------------- # Freevo - A Home Th...
# # # 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...
from flask import Blueprint, render_template, request, redirect, url_for, flash from organise.models import Todo from organise import db todos = Blueprint('todos', __name__, template_folder='/../templates') @todos.route('/') def index(): all_todos = Todo.query.order_by(Todo.id.desc()).all() return render_temp...
import json import os import datetime from django.test import SimpleTestCase, TestCase from corehq.apps.userreports.models import DataSourceConfiguration from corehq.apps.userreports.sql import IndicatorSqlAdapter, create_engine from corehq.apps.userreports.sql.connection import connection_manager DOC_ID = 'repeat-id...
# 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 u...
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Zhijiang Yao, Jie Dong and Dongsheng Cao # All rights reserved. # This file is part of the PyBioMed. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the PyBioMed source tree. """ #####...
import re import abc from typing import Any, Sized from functools import singledispatch import amino def snake_case(name: str) -> str: s1 = re.sub('([^_])([A-Z][a-z]+)', r'\1_\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() @singledispatch def decode(value: Any) -> Any: return value ...
#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import sys import os.path import copy path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/")) sys.path.append(os.path.join(path_to_script, ...
# Copyright 2018 The TensorFlow Probability 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 o...
#!/usr/bin/python # -*- coding: utf-8 -*- from Configuration import Configuration from Exemple import * from math import log from operator import itemgetter class Attributs: _file_url = None _config = None list_attributs = None list_exemples = None def __init__(self, file_ur...
from itertools import cycle from bl.ugen import W from bl.arp import ChordPatternArp, OrderedArp, RandomArp, ArpMap from bl.scheduler import clock from bl.orchestra.midi import ChordPlayer from tutor.complib import piano_f pattern = [3, 3, [3, 1], 1, 2, 1, 2, 1, [3, 2, 1, 0, 4], 0, 1, 2, 3, 4, 3, 2, [3, ...
# -*- coding: utf-8 -*- import jbxapi import json from joe_parser import JoeParser misperrors = {'error': 'Error'} inputSource = ['link'] moduleinfo = {'version': '0.2', 'author': 'Christian Studer', 'description': 'Query Joe Sandbox API with a report URL to get the parsed data.', 'module...
import json import os stats_json_file = os.getcwd() + "/stats/command_stats.json" def get_stats_file(): try: with open(stats_json_file, "r", encoding="utf-8", errors="replace") as f: json_file = json.load(f) except FileNotFoundError: json_file = {"global": {}, "servers": {}, "user...
""" B2 Conan Generator This is a generator for conanbuildinfo.jam files declaring all conan dependencies as B2 project and library targets. This generates multiple tagged build info source files, each containing a single variant as specified by the user's conan install profile in addition to the central generic one th...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# BEGIN ALL #!/usr/bin/env python import rospy from smach import State,StateMachine from time import sleep class Drive(State): def __init__(self, distance): State.__init__(self, outcomes=['success']) self.distance = distance def execute(self, userdata): print 'Driving', self.distanc...
# This file is part of HamsiManager. # # Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com> # # Hamsi Manager 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 yo...