content
stringlengths
5
1.05M
import wmath import random import time def get_random_list2d(n): molecule = [[random.randint(-50, 50) for _i in range(n)] for _j in range(n)] denominator = [[random.randint(1, 100) for _k in range(n)] for _l in range(n)] fraction = [[wmath.Fraction([molecule[_m][_n], denominator[_m][_n]]) for _m in range(...
# -*- coding:utf-8 -*- import argparse import sys from nsnqtlib.servers import serverlist from nsnqtlib.db import mongodb from nsnqtlib.utils import WindQuote from nsnqtlib.db.fields import * from nsnqtlib.config import DB_SERVER,DB_PORT,USER,PWD,AUTHDBNAME from nsnqtlib.servers.serverlist import LOCAL_SERVER_IP,MONGO...
# This file is part of the GBI project. # Copyright (C) 2012 Omniscale GmbH & Co. KG <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/licens...
"""TITILER_STACK Configs.""" from typing import Dict, List, Optional import pydantic class StackSettings(pydantic.BaseSettings): """Application settings""" name: str = "titiler-sentinel2-digitaltwin" stage: str = "production" owner: Optional[str] client: Optional[str] additional_env: Dict...
input = """ pacifist(X) :- quaker(X), not militarist(X). militarist(X) :- republican(X), not pacifist(X). republican(nixon). quaker(nixon). """ output = """ pacifist(X) :- quaker(X), not militarist(X). militarist(X) :- republican(X), not pacifist(X). republican(nixon). quaker(nixon). """
import pymei import sys import os import solr import uuid from pymei.Import import convert from pymei.Helpers import flatten solrconn = solr.SolrConnection("http://132.206.14.42:8080/liber-search") idcache = {} systemcache = {} def findbyID(llist, mid): """ Returns the object in llist that has the given id. Use...
import requests import datetime import random import time import logging import coloredlogs import verboselogs from etc.scrap.db_wordlist import lista_wordlists def logando_wordlist(tipo, mensagem): """ Generates the log message/Gera a mensagem de log. :param tipo: Set the log type/Seta o tipo de log ...
# Copyright (c) 2018 Graphcore Ltd. All rights reserved. # Test for basic importing import pytest def test_import(): # the core library import popart # and some utility python functions. import popart.writer assert ('SGD' in dir(popart))
import os import numpy as np import pandas as pd import networkx as nx import matplotlib.pyplot as plt import InterruptionAnalysis as ia readpath = './data/edgedir-sim' data = pd.read_csv('./data/timeseries.csv', index_col = 0) votedata = pd.read_csv('./data/vote-data.csv') votedata.set_index('pID', inplace = True) ...
from pydap.client import open_url from netcdftime import utime import numpy as np import urllib from giscube.config import MEDIA_ROOT, MEDIA_URL def opendap_metadata(opendap_url): response = urllib.urlopen(opendap_url + ".das") return response.read() def load(url, frm, name): if url.split(".")[-1] != "gz...
import torch import torch.nn as nn from torch.nn.parameter import Parameter from torch.nn import functional as F from torch.nn import init as init from torch.nn.modules.module import Module from torch.autograd import Variable from torch.autograd.function import Function import numpy as np import scipy from scipy.lin...
import os import uuid import glob from collections import OrderedDict from mikula.implementation.images import is_image, get_image_info from mikula.implementation.md import render_markdown, DEFAULT_ERROR, DEFAULT_PAGE_META from mikula.implementation.hypertext import render_hypertext from mikula.implementation import se...
from django.contrib import admin from .models import Attachment, Report class AttachmentIline(admin.TabularInline): model = Attachment class AttachmentAdmin(admin.ModelAdmin): list_display = ('id', 'report', 'attachment') list_filter = ('report',) admin.site.register(Attachment, AttachmentAdmin) cl...
from setuptools import setup def readme(): with open('README.rst') as f: return f.read() setup(name='oeis', version='0.1', description='OEIS utilities and sequence generation', long_description=readme(), classifiers=[ 'Programming Language :: Python :: 2.7.3', ]...
import pytest from unittest import mock from company.data import CompaniesHouseClient, CompaniesHouseException @mock.patch('company.data.requests.get') def test_bad_response_raises_exception(mocked_get): mocked_get.return_value = mock.Mock(ok=False) with pytest.raises(CompaniesHouseException): Compani...
import pytest from acondbs import create_app from acondbs.db.ops import define_tables from acondbs.db.sa import sa from acondbs.models import ( GitHubToken, GitHubUser, AccountAdmin ) ##__________________________________________________________________|| @pytest.fixture def app_empty(): database_...
from keystoneclient import access from tests import utils from tests import client_fixtures UNSCOPED_TOKEN = client_fixtures.UNSCOPED_TOKEN PROJECT_SCOPED_TOKEN = client_fixtures.PROJECT_SCOPED_TOKEN class AccessInfoTest(utils.TestCase): def test_building_unscoped_accessinfo(self): auth_ref = access.Acce...
import matplotlib.pyplot as plt import numpy as np import urllib SDSS_File = '/Users/compastro/jenkins/SDSS_4363+3_z+0.04.csv' SDSS_Data = np.genfromtxt(SDSS_File,skip_header=2, delimiter = ',',dtype=float,unpack=True) NII_6583 = SDSS_Data[28,:] Ha_6562 = SDSS_Data[27,:] OIII_5006 = SDSS_Data[20,:] Hb_4861 = SDSS_Data[...
# Generated by Django 2.2.17 on 2021-02-18 16:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stocking', '0010_auto_20201124_1646'), ] operations = [ migrations.AlterField( model_name='hatchery', name='hatcher...
from .masking import *
# --- Do not remove these libs --- from freqtrade.strategy.interface import IStrategy from pandas import DataFrame import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib # -------------------------------- class AdxSmas(IStrategy): """ author@: Gert Wohlgemuth converted from:...
# -*- coding: utf-8 -*- import KBEngine; from KBEDebug import *; class Food(KBEngine.Entity): def __init__(self): KBEngine.Entity.__init__(self); INFO_MSG("Cell Food init ..."); def onDestroy(self): INFO_MSG("Cell::Food::onDestroy ... name = %s id = %i " % (self.className,self.id)) ...
salario = 3450.45 despesas = 2456.2 percentual_Comprometimento = (2456.2 / 3450.45)*100 print(" {0:.1f}% do salário é comprometido com despesas".format(percentual_Comprometimento))
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp> # # 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, version 3 of th...
""" Simple messaging methods for better console output formatting """ import os import sys def tab_print( s: str, new_line: bool = True ) -> None: """ Adds an intent to s before printing it. If new_line = False, the line will not have a carriage return after printing. :param s: String to print :...
from pizzapy import Customer, StoreLocator, Menu, Order, CreditCard import requests customer = Customer("Saul", "Tobias", "email@email.com", "7138150697", "4823 Bayou Ln, Rosharon, TX, 77583") service = 'Carryout' print(customer) try: myLocalDominos = StoreLocator.find_closest_store_to_customer(customer, service...
import numpy from echidna.core.config import GlobalFitConfig from echidna.fit.fit_results import FitResults import echidna.output as output from echidna.errors.custom_errors import LimitError, CompatibilityError from echidna.limit import summary from echidna.output import store import logging import collections impor...
def test_list_status_of_jobs(dictcursor, job_id, other_job_id): dictcursor.execute( "update jobs set status = 'error' where id = uuid_to_bin(%s, 1)", other_job_id ) dictcursor.execute("call list_status_of_jobs()") out = dictcursor.fetchall() assert out == [ {"job_id": job_id, "status...
""" MIT License Copyright (c) 2021 UltronRoBo 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, di...
""" Tests for EC2 instance lookup. """ import boto3 from moto import mock_ec2 import cjob.ec2 as ec2 from tests.utils import create_test_instance @mock_ec2 def test_get_instances__with_no_instances(): client = boto3.client("ec2", region_name="ap-southeast-2") instances = ec2.get_instances(client) assert ...
#!/usr/bin/env python3 # -*- 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 Licen...
""" This is a new continuum fitting Example 3 compared to what used to be up here on github. I swapped out the old one for this one because this one probably represents a more typical case for most people, and it's a somewhat simpler system to model, so the chains converge faster. For reference, I can run this script o...
import compas import compas_rhino print(compas.__version__)
from visualizers.base_visualizer import AbstractVisualizer import markdown from mdutils.mdutils import MdUtils from mdutils.tools.Header import Header from pathlib import Path from io import BytesIO import yaml import os import json from utils.utils import get_project_root class MarkdownSummaryVisualizer(AbstractVisu...
# Generated by Django 3.0.4 on 2020-07-10 14:01 from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('users', '0014_auto_20200710_1401'), ('auth', '0001_initial'), ] operations = [ migratio...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: second/protos/preprocess.proto import sys from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symb...
from django.urls import path from .views import * from .import views app_name = 'clients' urlpatterns = [ # PAGINA MEUS CLIENTES path('meus-clientes/', views.meusClientes, name="clients-list"), # PAGINA ONBOARDING path('onboarding/', views.onBording, name="clients-onboarding"), # PAGINA ONBOARDING path('...
from django.db import models # Create your models here. class ESGModel(models.Model): uid = models.CharField(max_length=100, null=True) data = models.CharField(max_length=100) def __str__(self): return self.uid
""" Given a filename create a dataframe """ from pyspark.sql import SQLContext def filename_to_object(filename, context): """ Given a filename create a defoe.books.archive.Archive. If an error arises during its creation this is caught and returned as a string. :param filename: filename :type...
r""" Functionality for dealing with affine maps :math:`\Phi : \mathbb{R}^m \to \mathbb{R}^n` with .. math:: \Phi(x) = Ax + b, where :math:`A \in \mathbb{R}^{n \times m}, b \in \mathbb{R}^n`. """ import numbers import numpy as np def create_affine_map(a, b, multiple_arguments=False): r""" Generate the affi...
from .json import JSONDriver try: from .mongo import MongoDriver except ImportError: pass try: from .postgresql import PostgreSQLDriver except ImportError: pass try: from .redis import RedisDriver except ImportError: pass
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup(name='pack', version='0.1', description='test packaging', long_description=long_description, url='https://github.com/snans666/pack', author='snans666', author_email='a@b.c', ...
"""example.py - example plugin for ChatOps.""" import logging import requests from catops import CatParser, ArgumentParserError LOGGER = logging.getLogger('slack_logger') def ping(argv, params): """Check is working.""" text = '@{} Meow!'.format(params.get('user_name', ['CatOps'])[0]) return text def n...
##!/usr/bin/env python #from enum import Enum #import subprocess, os, shutil, time, logging, sys, errno ## set up logging #logger = logging.getLogger(os.path.basename(sys.argv[0])) #logger.setLevel(logging.INFO) #console_handler = logging.StreamHandler() #console_handler.setFormatter(logging.Formatter('%(levelname)s:...
from django.shortcuts import render from django.views import generic # Create your views here. class IndexView(generic.ListView): template_name = 'dashboard/index.html' def get_queryset(self): """ Return an empty context object for index view. """ index_context_object = [] ...
#!/usr/bin/env python3 import unittest from . import DoozerRunnerTestCase import koji import logging from doozerlib import image, exectools, model from doozerlib import brew class TestSanity(DoozerRunnerTestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def setUp(se...
#!/usr/bin/env python3 import numpy as np import trusd def test_wf_matrix(): ex_0_0_3 = np.array([[1., 0., 0., 0.],[0., 1., 0., 0.],[0., 0., 1., 0.],[0., 0., 0., 1.]]) ex_005_5_3 = np.array([[1., 0.57065153, 0.24147056, 0.],[0., 0.06579579, 0.06206989, 0.],[0., 0.06860101, 0.06579337, 0.],[0., 0.29495167, 0.630666...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
from .waypoints import WaypointsCmd
''' This module will test the columns.MemIDColumn class ''' import unittest from .mock_MemIDColumn import MemIDColumn from clubadmin.database.columns import DatabaseValueError class TestMemIDColumn(unittest.TestCase): def test_check(self): mid = MemIDColumn() self.assertTrue(mid._check(None)) self.asser...
import os import sys import re import glob import h5py import numpy as np import scipy import re import pickle import psutil from time import time import argparse try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from astropy.table import Table, vstack ...
# 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/. import json import os import sys import collections import writeMakefile def extractLines(fp): lines = [] watc...
num = int(input()) saida = [] for n in range(num): a, b, c = input().split() a = float(a) b = float(b) c = float(c) media = (a * 2 + b * 3 + c * 5) / 10 saida.append(media) for i in range(num): print(f'{saida[i]:.1f}')
#!/usr/bin/env python3 # coding: utf-8 import os import sys import time import json import requests url_keys = ['avatar_url', 'url', 'html_url', 'followers_url', 'following_url', 'gists_url', 'starred_url', 'subscriptions_url', ...
from django.conf.urls import url from django.views.generic.base import TemplateView import whatisit.apps.wordfish.views as report_views import whatisit.apps.wordfish.tests as test_views import whatisit.apps.wordfish.export as data_views urlpatterns = [ # Reports url(r'^collections/reports$', report_views.view...
from django.contrib.auth import get_user_model from django.test import TestCase from blog.forms import ArticleForm, CommentForm from blog.models import Article User = get_user_model() class ArticleFormTest(TestCase): form_data = { 'title': 'Blog Post One', 'image': 'http://www.example.com/exampl...
import argparse import logging import os import colorlog from . import conf def _set_parser(): parser = argparse.ArgumentParser(description='Authentic Execution SGX') parser.add_argument('-l', '--loglevel', nargs='?', default=conf.DEFAULT_LOG_LEVEL, type=__log_level) parser.add_ar...
#!/usr/bin/python import simple_test simple_test.test("test2", ["-i", "10", "-s", "hello", "goodbye", "-ABC", ])
from yowsup.layers.protocol_contacts.protocolentities.iq_sync_get import GetSyncIqProtocolEntity from yowsup.structs.protocolentity import ProtocolEntityTest import unittest entity = GetSyncIqProtocolEntity(["12345678", "8764543121"]) class GetSyncIqProtocolEntityTest(ProtocolEntityTest, unittest.TestCase): def s...
class Utils: @staticmethod def add(x,y): return x+y
''' Given a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. Note: You are not allowed to use any built-in exponent function or operator, such as pow(x, 0.5) or x ** 0.5. ''' ...
import discord import importlib import aiocron import os from discord import embeds from scraper import buscarEmpleos client = discord.Client() @aiocron.crontab('00 23 * * *') #anotación para que ejecute diariamente async def buscar_laburo(): print('We have logged in as {0.user}'.format(client)) dictJobs=b...
"""Functions and procedures used to draw and interact with a rotation button.""" from functools import partial from typing import Any, Dict, List import pygame from component.rotate_disk import rotate_disk_from_cylinder_in_place from gui_parameters import BUTTON_BG_COLOR, BUTTON_FG_COLOR # Type aliases ButtonData =...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain ...
import csv import requests from bs4 import BeautifulSoup import csv import re import pandas as pd import datetime import os today=datetime.date.today() url2=[] model=[] specs=[] company=[] country=[] display_list = [] memory_list = [] processor_list = [] camera_list = [] battery_list = [] thickness_l...
# # 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...
from .action_network import * from .members import *
""" Candidates ---------- """ import sys from math import ceil from math import floor from typing import Optional from typing import Set from typing import Tuple from typing import Union import numpy as np from anndata import AnnData # type: ignore import metacells.parameters as pr import metacells.utilities as ut ...
class ClassToBeImported(object): pass
worksheet = "JFlab.ca Lab Member Information" import pandas as pd import csv import gspread from oauth2client.service_account import ServiceAccountCredentials WORKBOOK = "JFlab.ca Lab Member Information" def download_data(credentials_path): """Download data using the Google Sheets API""" scope = [ "...
from abaqusConstants import * from .ContactProperty import ContactProperty class CavityRadiationProp(ContactProperty): """The CavityRadiationProp object is an interaction property that defines emissivity as a function of temperature and field variables. The CavityRadiationProp object is derived from the ...
#!/usr/bin/env python """ See the file "LICENSE" for the full license governing this code. Copyright 2011-2021 Ken Farmer """ #adjust pylint for pytest oddities: #pylint: disable=missing-docstring #pylint: disable=unused-argument #pylint: disable=attribute-defined-outside-init #pylint: disable=protected-access #pyl...
class Solution(object): def maxAreaOfIsland(self, grid): """ :type grid: List[List[int]] :rtype: int """ if( not grid or len(grid[0])==0 ): return 0 self.count = 0 self.max_count = 0 n = len(grid) m = len(grid[0]) def recursion(i,j): if(0<=i<n and 0<=j<m and grid[i][j]==1): self.count +=...
import socket from pathlib import Path from sys import path, argv path.insert(1, './tools') import common, encrypt from holistic import normalize_features from multiprocessing import Queue, Process, Manager import threading from ctypes import c_char_p from queue import Empty import atexit from math import ceil impor...
import numpy as np from scipy import stats def qqplot(data, dist=stats.distributions.norm, binom_n=None): """ qqplot of the quantiles of x versus the ppf of a distribution. Parameters ---------- data : array-like 1d data array dist : scipy.stats.distribution or string Compare x...
#!/usr/bin/env python3 from PIL import Image, ImageFilter, ImageColor from pprint import pprint from sys import argv from math import * from numpy import linspace from matplotlib import pyplot as plt def getpixels(img): w, h = img.size data = img.getdata() return [[data[x + y * w] for x in range(w)] for y in rang...
import os import json import jsonpickle from http.server import BaseHTTPRequestHandler from urllib import parse from plexapi.library import ShowSection from plexapi.myplex import MyPlexAccount from plexapi.server import PlexServer from plexapi.video import Episode from typing import Any import requests # get from dic...
import logging from slack_bolt import BoltRequest from slack_bolt.listener.listener_start_handler import ( CustomListenerStartHandler, ) class TestListenerStartHandler: def test_handler(self): result = {"called": False} def f(): result["called"] = True handler = CustomLi...
#!/usr/bin/python3 # Copyright (c) 2020 Angel Delgado Panadero # 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, co...
import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.webdriver import Options from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from ...
import requests from _sha256 import sha256 class MGCallback: class CallbackFields: TYPE = "type" STATUS = "status" ERROR_MESSAGE = "errorMessage" ENDPOINT_ID = "endpointID" PROCESSOR_TRANSACTION_ID = "processorTransactionID" ORDER_ID = "orderID" MERCHANT_ORD...
from onegov.winterthur.forms.mission_report import MissionReportForm from onegov.winterthur.forms.mission_report import MissionReportVehicleForm __all__ = ('MissionReportForm', 'MissionReportVehicleForm')
# # @lc app=leetcode.cn id=17 lang=python3 # # [17] letter-combinations-of-a-phone-number # None # @lc code=end
from typing import Tuple from didyprog.reference.local import operators import numpy as np def viterbi_value(theta: np.ndarray, operator: str = 'hardmax') \ -> float: """ Viterbi operator. :param theta: _numpy.ndarray, shape = (T, S, S), Holds the potentials of the linear chain CRF ...
import sys import time pid = int(sys.argv[1]) timeout = int(sys.argv[2]) percent = int(sys.argv[3]) print('Starting Process: %d' % pid) end = time.time() + float(timeout) # X minutes from now percentage = float(percent)/100 while time.time() < end: start = time.time() while time.time() - start < percentage:...
from rest_framework.response import Response from rest_framework import status, generics from rest_framework.views import APIView from .models import * from .serializer import * from .resources.api_requests import ApiRequests class ChannelDetailsView(APIView): """This get return details about a specific channel""...
#!/usr/bin/python25.6 """ Purpose: Plot seasonal bias in precipitation rate using CRU observations and RegCM4.7 output Period: 1980-1989 Used variables: pre (CRU; mm/month) and pr (RegCM; kg/m2/s) Author: S. STRADA Date: Sept. 27, 2018 """ # REFERENCES: # Read NetCDF file # http://ww...
"""Gear node for use in geometry attribute of Shapes""" from vrml import cache from OpenGLContext.arrays import * from OpenGL.arrays import vbo from OpenGL.GL import * from OpenGL.GLUT import glutSolidTeapot, glutWireTeapot from vrml.vrml97 import nodetypes from vrml import node, field, fieldtypes from OpenGLContext im...
"""Utils to check the samplers and compatibility with scikit-learn""" # Adapated from scikit-learn # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: MIT from __future__ import division import sys import traceback from collections import Counter import pytest import numpy as np from scipy import sp...
load("//spm/private/modulemap_parser:declarations.bzl", "declarations") load(":test_helpers.bzl", "do_failing_parse_test", "do_parse_test") load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") def _parse_test(ctx): env = unittest.begin(ctx) do_parse_test( env, "module with umbrella d...
#CUDA_VISIBLE_DEVICES=X python train.py --cuda --outpath ./outputs from __future__ import print_function import argparse import os import numpy as np from PIL import Image import torch from torch.utils import data import torch.backends.cudnn as cudnn import torch.optim as optim from torch import nn import torchvision.u...
import unittest import postcode class TestAA9APostCode(unittest.TestCase): def test_aa9a(self): self.assertTrue(postcode.is_valid('EC1A 1BB')) # The following central London single-digit districts have been further divided # by inserting a letter after the digit and before the space: # EC1–EC4...
# set_registry_in_current_user_as_string( # key_relative_to_root=r"SOFTWARE\Microsoft\Clipboard", # key="hello", # value="world" # ) res = delete_registry_from_current_user( key_relative_to_root=r"SOFTWARE\Microsoft\Clipboard", key="hello", ) echo(res)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Proppy Core ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # from .props import Property from threading import Lock class MetaProppy(ty...
import sys import pandas as pd from collections import defaultdict def preproc(glist): ens_list = set([]) with open(glist) as f: for line in f: ens = line.split(",")[1].strip() ens_list.add(ens) return ens_list def filter_by_gene(matrix, ens_genes): with open('filtered_...
""" Notes Web App Copyright (C) 2019 DesmondTan """ ########### # Imports # ########### from functools import wraps from flask import redirect, session ############# # Functions # ############# def login_required(f): @wraps(f) def wrap(*args, **kwargs): try: if not session['username']:...
#!/usr/bin/python2.4 # # Copyright 2011 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 require...
"""Test matrix game""" import itertools import json import random import numpy as np import numpy.random as rand import pytest from gameanalysis import gamegen from gameanalysis import matgame from gameanalysis import paygame from gameanalysis import rsgame from gameanalysis import utils def full_game(role_names, r...
import rdkit from rdkit.Chem import Descriptors from rdkit.Chem import MolFromSmiles, MolToSmiles from rdkit.Chem import rdmolops import sascorer import numpy as np import sys lg = rdkit.RDLogger.logger() lg.setLevel(rdkit.RDLogger.CRITICAL) smiles = [] for line in sys.stdin: smiles.append(line.strip()) targe...
"""Custom User model. User --- m:1 --- Tenant (users and administrators) """ # Copyright 2015 Solinea, 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/l...