content
stringlengths
5
1.05M
import pandas as pd import os os.chdir("/home/jana/Documents/PhD/CompBio/TestingGBLUP/") blupSol = pd.read_csv('renumbered_Solutions', header=None, sep='\s+', names=['renID', 'ID', 'Solution']) AlphaPed = pd.read_table("PedigreeAndGeneticValues_cat.txt", sep=" ") AlphaSelPed = AlphaPed.loc[:, ['...
# -*- coding: utf-8 -*- # Copyright 2017-2019 ControlScan, Inc. # # This file is part of Cyphon Engine. # # Cyphon Engine 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, version 3 of the License. # # Cyphon En...
""" Script to upload water quality data into influxdb. # Data quality checks: ===================================================== ## Data quality issues handled by the ingestion script: 1. `TIME` values set to `:` are replaced by empty string. 2. rows without `DATE` are dropped. 3. cell values "NA" and "ND" changed ...
import csv import os import pandas from datetime import datetime from BlackBoxAuditing.model_factories import SVM, DecisionTree, NeuralNetwork from BlackBoxAuditing.model_factories.SKLearnModelVisitor import SKLearnModelVisitor from BlackBoxAuditing.loggers import vprint from BlackBoxAuditing.GradientFeatureAuditor i...
"""Resource module for login resources.""" import json from aiohttp import web from user_service.services import ( LoginService, UnknownUserException, WrongPasswordException, ) class LoginView(web.View): """Class representing login resource.""" async def post(self) -> web.Respons...
""" Imports all submodules """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals #__version__ = '1.3.1' import dcCustom.data import dcCustom.feat import dcCustom.hyper #import deepchem.metalearning import dcCustom.metrics import dcCustom.model...
import requests from bs4 import BeautifulSoup import pandas as pd from selenium import webdriver #to handle news source's dynamic website import datetime import time from google_trans_new import google_translator from statistics import mean from nltk.sentiment.vader import SentimentIntensityAnalyzer import ...
# Copyright (C) 2018 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Contains WithRelationshipCreatedHandler mixin. Used to handle relationship created event. """ from ggrc.models import relationship from ggrc.services import signals class WithRelationshipCreatedHandler...
#!/usr/bin/env python3 import rospy import math from week2.srv import trajectory,trajectoryResponse from week2.msg import FloatList def generate_trajectory(request): #x: float,y: float,theta: float,v: float,w:float): x = request.x y = request.y theta = request.theta v = request.v w = request.w ...
#!/usr/bin/env python # coding=utf-8 # # Copyright 2012 F2E.im # Do have a faith in what you're doing. # Make your life a story worth telling. # cat /etc/mime.types # application/octet-stream crx import sys reload(sys) sys.setdefaultencoding("utf8") import os.path import re import memcache import torndb import to...
from unittest.mock import Mock, patch from django.test import TestCase from data_refinery_common import utils class UtilsTestCase(TestCase): @patch('data_refinery_common.utils.get_env_variable') @patch('data_refinery_common.utils.requests.get') def test_get_worker_id_cloud(self, mock_get, mock_get_env_var...
from rest_framework.pagination import LimitOffsetPagination class LimitedOffsetPagination(LimitOffsetPagination): max_limit = 100
from epubconv.epubconv import convertEPUB, config import asyncio import websockets import os from threading import Timer, Thread settings = config.load() async def api(websocket, path): file_path = f'./temp/{await websocket.recv()}.epub' result = await convertEPUB(file_path, lambda x:websocket.send(x)) if...
from .core import FaceDetector
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
from psutil import Process # импорт из библиотеки psutil класса для получения значений занятой памяти процесса from os import getpid # импорт из библиотеки os метода для получения идентификатора текущего процесса def memory_func(func): """ декоратор для замера памяти занимаемой функцией в оперативной памяти...
from django.utils.functional import SimpleLazyObject from django.utils.deprecation import MiddlewareMixin from .utils import get_jwt_value_from_cookies, check_payload, check_user def get_user(request): if not hasattr(request, '_cached_user'): session_id = get_jwt_value_from_cookies(request.COOKIES) ...
import struct import redis from Jumpscale import j from redis import ResponseError from ..ZDBClientBase import ZDBClientBase from ..ZDBAdminClientBase import ZDBAdminClientBase MODE = "seq" class ZDBClientSeqMode(ZDBClientBase): def _key_encode(self, key): if key is None: key = "" e...
from mock import MagicMock, patch from tests.app.app_context_test_case import AppContextTestCase from app.templating.summary.question import Question from app.data_model.answer_store import AnswerStore, Answer from app.utilities.schema import load_schema_from_params class TestQuestion(AppContextTestCase): # pylint:...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
#!/usr/bin/env python import unittest import numpy as np import pandas as pd from __init__ import * # testing __init__ functions class LambTest(unittest.TestCase): """Test lambdata_joshdsolis functions""" # def test_checknulls(self): # df = pd.DataFrame(np.ones(100)) # self.assertEqual(check_nu...
"""1359. Count All Valid Pickup and Delivery Options https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options/ """ class Solution: def countOrders(self, n: int) -> int: if n == 1: return 1 mode = int(1e9 + 7) ans = 1 for i in range(2, n + 1): ...
from .main import main from .text_formatter import skim
""" .. currentmodule:: neet.boolean .. testsetup:: sensitivity from neet.boolean.examples import c_elegans, s_pombe """ import copy import numpy as np import numpy.linalg as linalg import math import itertools as itt class SensitivityMixin(object): """ SensitivityMixin provides methods for sensitivity a...
# Generated by Django 2.2.5 on 2019-09-05 00:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('challenge', '0003_challenge_image'), ] operations = [ migrations.AddField( model_name='release', name='version', ...
#!/usr/bin/env python3 import retrieve_author_ppn as autppn import retrieve_references as refs import zot_helpers as pyzot from itertools import islice researchers = autppn.constructOutput('test.csv') autppn.writeCsv('out.csv', researchers) for researcher in researchers: ppn = researcher['ppn'] creator_name...
""" *************************************************************************** OshLanduse.py --------------------- Date : Nov 2020 Copyright : (C) 2020 by Ong See Hai Email : ongseehai at gmail dot com ******************************************************...
SECRET_KEY = 'abc123' TEMPLATE_DIRS = ( 'jsinclude/templates' ) TEMPLATE_DEBUG = False JSINCLUDE_STATIC_PATH = 'static/test/path'
#!/usr/bin/env python # -*- coding:utf-8 -*- # Power by Zongsheng Yue 2020-09-23 10:23:45 import cv2 import argparse import numpy as np from pathlib import Path from scipy.io import savemat from math import ceil parser = argparse.ArgumentParser() parser.add_argument('--ntu_path', type=str, default='/ssd1t/NTURain/ori...
pkgname = "elftoolchain" _commit = "f7e9afc6f9ad0d84ea73b4659c5d6d13275d2306" pkgver = "0.7.1_svn20210623" pkgrel = 0 build_style = "makefile" makedepends = ["libarchive-devel"] make_build_args = [ "WITH_ADDITIONAL_DOCUMENTATION=no", "WITH_TESTS=no", "MANTARGET=man" ] # work around all sorts of bmake weirdness ...
import torch import torch.nn as nn import numpy as np from models import ModelBuilder from torch.autograd import Variable import torch.optim as optim import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader from dataset import TrainDataset import os import nibabel as nib import argparse from utils i...
#!/usr/bin/env python # coding: utf-8 import os import csv import re def get_plain_content_simple(verdict, date, file_num): try: content = '' title = re.search("^\S、\S*(?:上訴|原告).{0,6}(?:主張|意旨)\S*(?:︰|:)", verdict, re.M).group(0) number_list = ['一', '二' ,'三', '四', '五'] i...
# reduce把一个函数作用在一个序列[x1, x2, x3, ...]上,这个函数必须接收两个参数,reduce把结果继续和序列的下一个元素做累积计算 #效里如 reduce(f, [x1, x2, x3, x4]) = f(f(f(x1, x2), x3), x4) from functools import reduce def add(x,y): return x + y res = reduce(add, [1,3,5,7,9]) print(res) #练习:编写一个prod()函数,可以接受一个list并利用reduce()求积 print('---------------------------...
#!/usr/bin/env python # ======================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF l...
from typing import Tuple, List import torch import torch.nn as nn from torch import Tensor from lstm_cell_stack.lstm_cell_stack import LSTMCellStack from lstm_stack.lstm_stack import LSTMStack class LSTMAutoencoder(nn.Module): """ Implementation of the model described in 'Unsupervised Learning of Video ...
import datetime import json import random import re import time import requests import schedule from login import http_build_query, timestamp, login from setup import download_json storage = {} def run(): from requests.exceptions import RequestException retries = 5 print('-' * 60) print('[ OK ]...
# Copyright 2018 The Texar 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 ...
import json import datetime import os import sys import boto3 sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "./libs")) # Allow for packaged libs to be included import urllib3 import requests ENVIRONMENT = os.environ['ENV'] AWS_LAMBDA_FUNCTION_NAME = os.environ['AWS_LAMBDA_FUNCTION_NAME']...
from distutils.core import setup from Cython.Build import cythonize setup( name='func1.pyx', ext_modules=cythonize("func1.pyx") )
# Copyright 2018 AT&T Intellectual Property. All other 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...
""" Gets all gene item in wikidata, where a gene item is an item with an entrez ID, filtering those with no sitelinks and no items linking to them Gets all genes in mygene (from the latest mongo dump) Gets those wd genes that are no longer in mygene, and the proteins they encode (if exists) Propose for deletion on: ...
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware import logging import logging.config import os from fastapi.responses import JSONResponse from fastapi import HTTPException from infrastructure.routes import ( course_router, course_media_router, course_user_router, course_ra...
import json import time from .simple import Base class Frontend(Base): def testEcho(self): ws = self.websock() self.addCleanup(ws.http.close) ws.connect_only() ws.client_send_only("ZEROGW:echo:text1") ws.client_got("ZEROGW:echo:text1") def testTime(self): ws =...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn from libs.utils import bbox_transform from utils.order_points import re_order class LossRSDet(nn.Module): def __init__(self, cfgs, device): ...
# coding=utf-8 # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import json import time import typing from typing import Any, List, Optional import attr import cattr import timestring import yaml from attr import attrib, attrs @attrs(auto_attribs=True) class SparkApplication(object): st...
""" Support for functionality to have conversations with Home Assistant. For more details about this component, please refer to the documentation at https://home-assistant.io/components/conversation/ """ import logging import re import voluptuous as vol from homeassistant import core from homeassistant.components im...
#Import packages import pandas as pd import numpy as np from SyntheticControlMethods import Synth, DiffSynth #Import data data_dir = "https://raw.githubusercontent.com/OscarEngelbrektson/SyntheticControlMethods/master/examples/datasets/" df = pd.read_csv(data_dir + "smoking_data" + ".csv") #Fit Differenced Synthetic...
from itertools import combinations, combinations_with_replacement T2 = lambda n: (n * (n+1)) / 2 T3 = lambda n: (n * (n+1) * (n+2)) / 6 mappings = {'2i': lambda D, i, j: T2(D-1) - (T2(D-i-1) - (j-i-1)), '2p': lambda D, i, j: T2(D) - (T2(D-i) - (j-i)), '3i': lambda D, i, j, k: T3(D-2) - (T3(D-i...
from django.apps import AppConfig class PersonsConfig(AppConfig): name = 'danibraz.persons' verbose_name = 'Pessoas'
from piestats.web.player_names import remove_redundant_player_names def test_remove_redundant_player_names(): assert remove_redundant_player_names(['foobar']) == ['foobar'] assert remove_redundant_player_names(['foobar', 'foofoo']) == ['foobar', 'foofoo'] assert remove_redundant_player_names(['foobar', 'Major']...
from typing import List class Solution: def numPairsDivisibleBy60(self, time: List[int]) -> int: result = 0 count = [0] * 60 n = len(time) for i in range(n): pos = time[i] % 60 result += count[(60 - pos) % 60] count[pos] += 1 return resul...
import random import threading def calculate_average() -> None: numbers = [random.randint(0, 100) for _ in range(10)] average = sum(numbers) / len(numbers) print(f"Wynik mojego działania to: {average}") def run_example() -> None: for _ in range(10): threading.Thread(target=calculate_average...
from imouto.web import RequestHandler, Application class Redirect_1(RequestHandler): async def get(self): self.redirect('/2') class Redirect_2(RequestHandler): async def get(self): self.write('redirect successful') app = Application([ (r'/1', Redirect_1), (r'/2', Redirect_2) ]) a...
#coding:utf-8 from django.contrib import admin from models import Comment # Register your models here. class CommentAdmin(admin.ModelAdmin): list_display = ("block", "article", "comment", "owner", "status", "create_time", "update_time") search_fields = ("content",) list_filter = ("block", ) admin.site.register(C...
class DriverConfigurationError(AttributeError): pass class UnsupportedImageProduct(KeyError): pass
import urllib.request as urllib2 from urllib.parse import quote_plus from bs4 import BeautifulSoup from models.SplitTextManager import CharSplit from models.Common import Common import re # Unoficial dict.cc client class Dict(object): @classmethod def Check(cls, word, from_language = 'de', to_language = 'en'):...
class PMod: """ --- PMod算法 --- 对不规整列表进行均匀采样的算法之一,对原表长度a和样本容量b进行取模等操作, 具体采样方法如下: 定义方法 + M(a, b, flag): + + a / b = d ... r1 + + a / d = a’ ... r2 + + b’ = a’ - b + + if r1 == r2 : # 此时 b’恒等于0 + + + END + + else: + + + M(a’, b’, -flag) """ def...
# -*- coding: utf-8 -*- # 快速排序 def quicksort(arr): if len(arr) < 2: # 基线条件 return arr else: # 递归条件 # 基准值 pivot = arr[0] # 比基准值小的元素 less = [i for i in arr[1:] if i <= pivot] # 比基准值大的元素 greater = [i for i in arr[1:] if i > p...
# richard -- video index system # Copyright (C) 2012, 2013 richard contributors. See AUTHORS. # # 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 License, or # (at ...
from cs50 import get_string from sys import argv from sys import exit if len(argv) == 2: k = int(argv[1]) else: print("Usage: python caesar.py k") exit(1) msg = get_string("plaintext: ") print("ciphertext: ", end="") for c in msg: if c.isalpha(): if c.islower(): print(chr(((o...
import OLink from inputLink import inputLink class RectDia: def __init__(self,tab): self.points=[] for x in tab: self.points.append(self.point(x[0],x[1],0,0)) self.isOriented=0 class point:############ NOT immutable def __init__(self,x,y,isO,ori): ...
from django.test import TestCase from django.http import QueryDict from maintenance import views from django.contrib.auth.models import User from django.test import Client import user_variables as uv import requests, json from dynatrace.requests.request_handler import no_ssl_verification class ViewsTests(TestCa...
import sys import utils from parameters import * from sagan_models import Generator, Discriminator from tester import Tester if __name__ == '__main__': config = get_parameters() config.command = 'python ' + ' '.join(sys.argv) print(config) tester = Tester(config) tester.test()
from datetime import datetime from api import s3util from api.utils import get_ext, random_id from fileupload.models import PODFile from team.models import ManualBooking, LrNumber MIMEANY = '*/*' MIMEJSON = 'application/json' MIMETEXT = 'text/plain' def response_mimetype(request): """response_mimetype -- Return...
import unittest import grpc import example_python.app_02_grpc.proto.greeter_pb2 as greeter_pb2 import example_python.app_02_grpc.proto.greeter_pb2_grpc as greeter_pb2_grpc from .main import GreeterServer class GreeterTest(unittest.TestCase): server = None client = None @classmethod def setUpClass(c...
from rest_framework import serializers from core.models import EventType class EventTypeSerializer(serializers.ModelSerializer): """ Сериализатор Типа события """ class Meta: model = EventType fields = ('id', 'name', 'description') class EventTypeChoiceSerializer(serializers.ModelS...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-19 01:32 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion def copy_form_submission_orgs_to_application(apps, schema_editor): db_alias = schema_editor.c...
from setuptools import setup, find_packages print(find_packages()) setup( name="xenaPython", version="1.0.14", packages=find_packages(), include_package_data=True, author = '@jingchunzhu, @acthp', author_email = 'craft@soe.ucsc.com', description = 'XENA python API', url = 'https://github...
"""Defines WebotsSimObject Class ---------------------------------------------------------------------------------------------------------- This file is part of Sim-ATAV project and licensed under MIT license. Copyright (c) 2018 Cumhur Erkan Tuncali, Georgios Fainekos, Danil Prokhorov, Hisahiro Ito, James Kapinski. For...
import hashlib class MinimalBlock(): def __init__(self, index, timestamp, data, previous_hash): self.index = index self.timestamp = timestamp self.data = data self.previous_hash = previous_hash self.hash = self.hashing() def hashing(self): key = hashlib.sha256()...
from xbmcswift2 import Plugin from resources.lib import rsa plugin = Plugin() @plugin.route('/') def index(): items = [{ 'label': plugin.get_string(30000), 'path': plugin.url_for('rsa_videos', page_no=1) }, { 'label': plugin.get_string(30001), 'path': plugin.url_for('rsa_anim...
from django.shortcuts import redirect def redirect_view(request): response = redirect("https://kdsp-web.herokuapp.com/") return response
import logging from helper.logger import get_logger from api import LOG_FORMAT, LOG_NAME, LOG_LEVEL from api.requestvars import g logging.getLogger().handlers.clear() uvi_error = logging.getLogger("uvicorn.error") uvi_access = logging.getLogger("uvicorn.access") uvi_error.handlers.clear() uvi_access.handlers.clear() ...
name = input() age = int(input()) town = input() salary = float(input()) ageRange = "teen" if age < 18 else "adult" if age < 70 else "elder" salaryRange = "low" if salary < 500 else "medium" if salary < 2000 else "high" print(f'Name: {name}') print(f'Age: {age}') print(f'Town: {town}') print(f'Salary: ${salary:.2f}') ...
from .mDbgHelp import *;
# -*- coding: utf-8 -*- # (C) Copyright IBM Corp. 2021. # # 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...
from julia import Dojo as dojo import numpy as np import torch class TorchStep(torch.autograd.Function): @staticmethod def forward(ctx, env, state, input): if type(state) is np.ndarray: state = torch.tensor(state) if type(input) is np.ndarray: input = torch.tensor(input) # step dojo.step(env, state.nu...
T = int(input()) for _ in range(T): n = int(input()) List = [] for _ in range(n): List.append(list(map(int, input().split()))) for i in reversed(range(0, n-1)): for j in range(0,i+1): List[i][j] += max(List[i+1][j], List[i+1][j+1]) print(List[0][0])
from abc import ABC, abstractmethod import OpenGL.GL as gl from color import Color from interfaces import IColorable, IMovable, IAnimation class Entity: """ Simple entity that knows its position only """ def __init__(self, x: int, y: int): self.x = x self.y = y def __repr__(self): ...
# Generated by Django 2.0.1 on 2018-11-06 13:06 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("invitations", "0004_invitation_sent_at"), ] operations = [ migrations.AlterField( model_name="i...
SERVER_NAME = "localhost:5005"
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Input: HOST_LIST = "host_list" NAME = "name" PORT_LIST_ID = "port_list_id" class Output: MESSAGE = "message" SUCCESS = "success" TARGET_ID = "target_id" class CreateTargetInput(komand.Input): schema = json....
# theory MPD client # Copyright (C) 2008 Ryan Roemmich <ralfonso@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
""" Login page """ import requests from bs4 import BeautifulSoup try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin URL = 'https://login.yahoo.com' DESKTOP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1)\ AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0...
# -------------- # Importing header files import numpy as np import warnings warnings.filterwarnings('ignore') #New record new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] #Reading file data = np.genfromtxt(path, delimiter=",", skip_header=1) print(data.shape) census=np.concatenate((data,new_record),axis=0)...
""" ************** SparseGraph 6 ************** Read graphs in graph6 and sparse6 format. Format ------ "graph6 and sparse6 are formats for storing undirected graphs in a compact manner, using only printable ASCII characters. Files in these formats have text type and contain one line per graph." http://cs...
from odoo import SUPERUSER_ID, api from odoo.tools.sql import column_exists def migrate(cr, version=None): env = api.Environment(cr, SUPERUSER_ID, {}) if column_exists(cr, "product_template", "purchase_request"): _migrate_purchase_request_to_property(env) def _migrate_purchase_request_to_property(en...
# -*- coding: utf-8 -*- """ Module implementing alignment estimators on ndarrays """ import numpy as np import scipy from scipy.spatial.distance import cdist from scipy import linalg from scipy.sparse import diags import sklearn from sklearn.base import BaseEstimator, TransformerMixin from scipy.optimize import linear...
import os from pathlib import Path from nuclear import * from nuclear.utils.files import script_real_path from nuclear import shell from tests.asserts import MockIO def test_bash_install_twice(): app_name = 'nuclear_test_dupa123' with MockIO('--install-bash', 'nuclear_test_dupa123') as mockio: CliBu...
import argparse import time from collections import defaultdict import cupy as cp import cudf import pandas as pd import rmm import gpugwas.io as gwasio import gpugwas.filter as gwasfilter import gpugwas.algorithms as algos import gpugwas.dataprep as dp import gpugwas.runner as runner from gpugwas.vizb import show_q...
import abc import sys from time import sleep from typing import Optional import click from afancontrol.arduino import ( DEFAULT_BAUDRATE, ArduinoConnection, ArduinoName, ArduinoPin, ArduinoPWMFan, ) from afancontrol.pwmfan import ( BasePWMFan, FanInputDevice, FanValue, LinuxPWMFan,...
def dp(left, right): if not cache[left][right] is None: return cache[left][right] if left == right: cache[left][right] = board[left] return cache[left][right] elif (right - left) == 1: if board[left] > board[right]: diff = board[left] - board[right] else:...
""" Constants module. This module contains any values that are widely used across the framework, utilities, or tests that will predominantly remain unchanged. In the event values here have to be changed it should be under careful review and with consideration of the entire project. """ import os # Directories TOP_D...
# -*- coding: utf-8 -*- from ..campos import Campo, CampoData, CampoFixo, CampoNumerico from ..registros import Registro class Registro0000(Registro): """ ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DA PESSOA FÍSICA """ campos = [ CampoFixo(1, 'REG', '0000'), Campo(2, 'NOME_ESC', 'LCD...
def remove_duplicates(from_list): """ The function list() will convert an item to a list. The function set() will convert an item to a set. A set is similar to a list, but all values must be unique. Converting a list to a set removes all duplicate values. We then convert i...
import hashlib import time import pymongo from rest_framework.response import Response from rest_framework.views import APIView from RestapiManage.restapi.models import Project from RestapiManage.restapi.serializer import ManyProject class ProjectView(APIView): server = '39.99.214.102' mongo_password = 'Aa123...
""" Main application and routing logic for TWoff """ from flask import Flask, request, render_template from .models import DB, User, Tweet from decouple import config from .functions import adduser, add_or_update_user from .predicted import predict_user def create_app(): """ create + config Flask app obj """ ...
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ from flask import current_app from flask import url_for import time import pytest from lti import ToolConsumer from hxlti.consumer.models import Consumer from hxlti.user.models import User from .factories import Cons...
from .settings import * import os import json DEBUG = True # sqlite3 # DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.sqlite3', # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # } # } # postgresql DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql',...