content stringlengths 5 1.05M |
|---|
import dstoolm4.writer as dw
import pdb
class simmodule(object):
name = 'dstoolm'
def parse_species(p,r):
ss = []
for l in r:
s,i = l.split(':')
ss.append((s.strip(),float(i)))
return ss
def parse_reactions(p,r):
reg = lambda x : (int(x[:x.find(... |
# The public user user_read has read access to all collections
# The password is stored in cleartext, this is intentional
connection_string = "mongodb+srv://user_read:uJqr3atnL8zErBW1@gtb-cluster.rwqi3.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"
# The credentials for a user with write acces are stored... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_mixing_lists_and_none():
def add(a, b):
outer = []
for ai, bi in zip(a, b):
if ai is None or... |
#!/bin/env python3
'''
'''
# 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 ... |
import ctypes as _ctypes
import ctypes.util as _ctypes_util
from sparse_dot_mkl._mkl_interface._structs import sparse_matrix_t, matrix_descr, MKL_Complex8, MKL_Complex16
# Load mkl_spblas through the libmkl_rt common interface
_libmkl = None
try:
_so_file = _ctypes_util.find_library('mkl_rt')
if _so_file is ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import quantecon as qe
import requests
import string
"""
Description: Voter analysis for Index Coop DAO Decision Gate 2 Governance Votes
Prereqs:
- Download Snapshot vote reports either manually or using snapshot_report_download.py script
... |
import sgrna_modeler.models as sg
import sgrna_modeler.datasets as da
from scipy import stats
import pandas as pd
import os
if __name__ == '__main__':
models = [sg.SklearnSgrnaModel(), sg.KerasSgrnaModel()]
train_datum = [da.load_doench_2016_train(), da.load_meyers_2017_train(), da.load_kim_2019_train()]
t... |
from django.contrib import admin
from accounts.models import AppUser
# Register your models here.
admin.site.register(AppUser)
|
"""
perception.py
Code for modelling option and outcome perceptions.
"""
from base_types import Certainty, Valence, Salience
from packable import pack, unpack
class Percept:
"""
Base class for all percepts, modelling general player perceptions of options
& outcomes (relative to player goals). A percept applie... |
from discord_webhooks import DiscordWebhooks
class discord_data:
url = None
name = None
class Message:
header = ""
content = ""
user = ""
footer = ""
color = 0xc8702a
url = None
class Discord:
def __init__(self,config,webhook):
self.data = discord_data()
self.data.... |
from pyrogram import Client, filters
from pyrogram.types import Message
from config import prefix
from localization import use_chat_lang
from utils import commands
from consts import http
@Client.on_message(filters.command("cat", prefix))
@use_chat_lang()
async def cat(c: Client, m: Message, strings):
r = await ... |
import unittest
import pyomo.environ # although is not used direktly, is needee by pyomo
from pyomo.opt.base import SolverFactory
from rivus.main.rivus import read_excel, create_model
from rivus.main.rivus import get_timeseries, get_constants
from rivus.utils.prerun import setup_solver
from rivus.gridder.create_grid i... |
from chemutils.rdkitutils import molBlockToRdkitMol, \
inchiToRdkitMol, \
pdbBlockToRdkitMol, \
rdkitMolToInchi
from chemutils.rdkitutils import rdkitMolToMolFrags
from chemutils.obabelutils import obConvert
def xyzToMo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
connection_state.py
-------------------
TxTrader ConnectionState
Copyright (c) 2015 Reliance Systems Inc. <mkrueger@rstms.net>
Licensed under the MIT license. See LICENSE for details.
"""
from enum import Enum, auto
class AutoName(Enum):
def _gene... |
import datetime
import unittest.case
from requests import HTTPError
import entities
from utils.base import BaseTestCase
class _CheckValidatorContext(unittest.case._AssertRaisesContext):
def __init__(self, field_name, func, test_case):
super().__init__(HTTPError, test_case)
self.field_name = field_... |
import heapq
class MutableHeapElement(object):
def __init__(self, element, key=None, removed=False):
self.element = element
self.removed = removed
if key is None:
self.key = self.element
else:
self.key = key
def __lt__(self, other):
return self.k... |
import time
from ProxyPool.settings import VALID_STATUS_CODES, TEST_URL, BATCH_TEST_SIZE
from ProxyPool.db import RedisClient
import aiohttp
import asyncio
from aiohttp import ClientError
from aiohttp.client_exceptions import ClientConnectionError
from asyncio import TimeoutError
class Tester(object):
def __init_... |
"""Tests for pad.context"""
import logging
import unittest
try:
from unittest.mock import patch, Mock, MagicMock, mock_open
except ImportError:
from mock import patch, Mock, MagicMock, mock_open
import oa.errors
import oa.context
class TestContext(unittest.TestCase):
def setUp(self):
unittest.T... |
class PyDuinoCoinException(Exception):
pass |
from django.conf import settings
def show_welcome_banner(request):
return {
"first_time_user": request.session.get("first_time_user", True)
}
def commit_hash(request):
return {'commit_hash': settings.COMMIT_HASH}
|
# coding: utf-8
"""
"""
import flask
import flask_login
import json
from flask_babel import _
from . import frontend
from .. import logic
from ..logic.object_permissions import Permissions
from ..logic.security_tokens import verify_token
from ..logic.languages import get_languages, get_language, get_language_by_lang... |
from typing import List
from pydantic import BaseModel
from signal_block.one.events.main import handle_intersect
from utils.types import EventActionEnum
from utils.utils import (
format_signal_block_request,
format_signal_block_response,
validate_payload,
)
from .exceptions import SignalBlockOneInvalidIn... |
# Copyright 2019 Verizon Media
#
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2021, CS GROUP - France, http://www.c-s.fr
#
# This file is part of EODAG project
# https://www.github.com/CS-SI/EODAG
#
# 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... |
"""
brutal.memodb: Memoization of coflowhronous functions to a database file.
"""
def _everything():
# Useful in debugging to leave temporary files/dirs in tact after
# brutal exits so they may be autopsied.
DONT_REMOVE_TEMPS = False
import binascii
import builtins
import pickle
import hashlib
import o... |
#!/usr/bin/python3
from colorsys import hsv_to_rgb
from time import sleep
from sense_hat import SenseHat
# Imports for executing the script a given number of seconds (5s)
# - See function 'exitfunc' below
import os
from datetime import datetime
from threading import Timer
# Hues represent the spectrum of colors as... |
from pathlib import Path
import csv
import pandas as pd
def load_raw_dataset():
"""Load raw dataset for the given experiments"""
relative_path = '../../../data/raw/webdatacommons/webdatacommons_data_raw.csv'
dataset = pd.read_csv(relative_path, sep=',', encoding='utf-8', quotechar='"',
... |
import logging
from typing import Tuple, Union
from avions.Vol import Vol
from avions.Avion import Avion
from hotels.hotel import Hotel
class FactoryCheckAndBook():
@staticmethod
def check_and_book(vol: Vol, hotel: Hotel,
nb_personnes: int) -> Tuple[Union[Avion, False], int]:
if... |
from django.test import TestCase
from www.models import Person
class PersonTest(TestCase):
def test_persons_have_a_name(self):
Person.objects.create(
name='name1', email='email1', title='title1', image='image1')
person1 = Person.objects.get(name='name1')
self.assertEqual(str(pe... |
from PyInquirer import prompt
import configargparse
from src.create.create import createBitlink
from src.expand.expand import expandBitlink
from src.information.information import getInformation
from src.generate.generate import generateAccessToken
print("""Pytly - Made by Snowleoo
------------------------... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2022/3/8 4:39 下午
# @File : push3.py
# @author : Akaya
# @Software: PyCharm
# push3 : it runs ok
import subprocess as sp
import cv2 as cv
rtmpUrl = "rtmp://10.10.14.120/stream/9999"
camera_path = "rtmp://10.10.14.120/stream/2233"
cap = cv.VideoCapture(ca... |
#!/usr/bin/env python
"""
ApivbetaApi.py
Copyright 2015 Reverb Technologies, 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
Unle... |
from arcade.experimental.shadertoy import Shadertoy
class ExplosionMaker:
def __init__(self, size, position):
self.shadertoy: Shadertoy = Shadertoy.create_from_file(size, "explosion.glsl")
self.shadertoy.program['explosionPos'] = position
self.time = 0.0
self.position = position
... |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# ... |
class Log:
ready = "\033[92mLOG: bot is up and ready\033[0m"
class On:
active = "I'm active now!"
already_active = "Keep calm! I'm already active."
failure = "Oops, it seems like something went wrong!"
class Off:
inactive = "I'm going to sleep now. See you!"
already_inactive = "Don't disturb... |
# -*- coding: utf-8 -*-
"""gdcdatamodel.models.indexes
----------------------------------
Specialization of PsqlGraph Node/Edge indexes specific to the GDC datamodel.
This module can be used to inject indexes into Node classes for common
query patterns (e.g. secondary_keys).
"""
import logging
from sqlalchemy im... |
""" Authors: J. A. Moreno-Guerra & J. I. Ávalos-López
Company: MLearning Consultants
Library version: 1.0.0
Last modification: 10/04/2020
Corresponding author: jzs.gm27@gmail.com
auxiliary email: avaloslj2014@licifug.ugto.mx"""
from IPython.display import clear_output
import numpy as np
import matplotlib.pyplot as pl... |
import pytest
import fibonacci
def test_create_heap():
f = fibonacci.FibonacciHeap()
assert f.min() == None |
#!/usr/bin/env python3
from regexp_test import regexp_test, SUB
import simple_sub
import unittest
@regexp_test(simple_sub)
class SimpleSubTest(unittest.TestCase):
TEST_DATA = {
'REGEXP_1': ( # название тестируемого регулярного выражения
SUB, # тип тестируемого метода — SU... |
"""Tests the python routines within L004."""
from sqlfluff.testing.rules import dedent, lint, fix
RULE = "L004"
def test_indented_comments_default_config() -> None:
"""Here tab indent is replaced with spaces.
Lint fails after fixing due to the tabs that come before the comments.
That is left unfixable f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from parameters import CONNECTION_PARAMETERS
from snowflake.sqlalchemy import GEOGRAPHY
from sqlalchemy import Column, Integer, MetaData, Table
from sqlalchemy.sql import select
from json import loads
def test_create_table_geography_datatypes(engine_testaccount):
"""
... |
import argparse
import json
from collections import defaultdict
from metrics import Metrics
def load_json(path):
with open(path, "r") as outfile:
json_data = json.load(outfile)
return json_data
def eval(args):
qrel = load_json(args.path_qrel)
run = load_json(args.path_run)
data = load_... |
import os
import path_helpers as ph
# See: http://www.py2exe.org/index.cgi/win32com.shell?action=show&redirect=WinShell
# ModuleFinder can't handle runtime changes to __path__, but win32com uses them
try:
# py2exe 0.6.4 introduced a replacement modulefinder.
# This means we have to add package paths there, no... |
#Faça um algorítimo que leia o preço de um produto e mostre seu novo preço, com 5% de desconto
prod = float(input('Qual o valor do produto?:'))
desconto = (5/100)+1.0
print('Seu produto com desconto saiu por {:.2f} reais'.format(prod-desconto)) |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
Tested with CircuitPython 6.3.0
Hardware:
- Maker Pi RP2040 https://my.cytron.io/p-maker-pi-pico
- M5Stack ToF VL53L0X Sensor Unit https://my.cytron.io/p-m5stack-tof-vl53l0x-sensor-unit
- RC Servo Motor (Metal Gear) http... |
#
# PySNMP MIB module Unisphere-Data-L2TP-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-L2TP-CONF
# Produced by pysmi-0.3.4 at Mon Apr 29 21:24:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.... |
from archeogitvsszz.utilities import Calculation
def test_get_recall_and_precision():
# Normal Calculation
contributors = {'1', '2', '3'}
ground_truth = {'1', '3', '4'}
expected_recall_and_precision = [2/3, 2/3]
actual_recall_and_precision = Calculation.get_recall_and_precision(contributors, grou... |
import os
import tensorflow as tf
from PIL import Image
from io import BytesIO
import numpy as np
import json
category_index = {}
#source:https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/inference_from_saved_model_tf2_colab.ipynb
def get_image_tensor(path):
"""Load an image ... |
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView, DetailView, TemplateView
from .models import Product, Category
class IndexView(ListView):
queryset = Product.objects.order_by('-pub_date')
template_name = 'nablashop/index.html'
def get_context_data(self, **... |
#Tamito KAJIYAMA <kajiyama@grad.sccs.chukyo-u.ac.jp> caught us forgetting to encode comment and PI output
import sys
from Xml.Xslt import test_harness
sheet_1 = """<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="i... |
# Generated by Django 2.1.5 on 2019-02-07 04:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Course', '0004_auto_20181016_1859'),
]
operations = [
migrations.CreateModel(
name='Question',
... |
import colorsys
import json
import os
def hsvToRgb(h, s, v):
(r, g, b) = colorsys.hsv_to_rgb(h / 360, s / 100, v / 100)
return '#'+("%0.2X" % round(r * 255))+("%0.2X" % round(g * 255))+("%0.2X" % round(b * 255))
# svg
def generateFile(version, id, h, s, v):
c = hsvToRgb(h, s, v)
p = os.path.join('res... |
from tests.test_service_catalog.base import BaseTest
from profiles.api.serializers.user_serializers import UserSerializer
class TestUserSerializer(BaseTest):
def setUp(self):
super(TestUserSerializer, self).setUp()
self.superuser.profile.notification_enabled = True
self.superuser.profile.... |
# encoding: utf-8
"""
@desc:
"""
import json
import os
import numpy as np
from fairseq import utils
from fairseq.tasks import register_task
from fairseq.tasks.translation import TranslationTask, load_langpair_dataset
from fast_knn_nmt.custom_fairseq.data.knn_nmt_dataset import KNNNMTDataset
from fast_knn_nmt.cu... |
from .visualizer_plugin import VisualizerPlugin
__all__ = ['VisualizerPlugin']
|
from Graph import EdgeToString, Graph, ReverseEdge
#t: P-α->Q and u: P-β->R and u': Q-β->S and t': R-α->S with t ι u => u' ι nt
class CPI:
name = "CPI - Coinitial Propagation of Independence"
def Check(graph:Graph):
"""Check CPI property and return true if holds"""
errors = set()
#i... |
import os
import sys
import logging
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
Base = declarative_base()
class Person(Base):
... |
"""
D8 Machine Instruction
"""
from lark import Token, Tree
register = {"A": 0, "B": 1, "C": 2, "D": 3, "E": 4, "PAGE": 5, "X": 6, "SP": 7}
instruction = {
"stop": 0,
"clr": 1,
"ldi": 1,
"ldd": 2,
"ldx": 3,
"ldsp": 4,
"std": 5,
"stx": 6,
"stsp": 7,
"mov": 8,
"nop": 8,
"... |
# -*- coding: utf-8 -*-
"""Example for wald_test for terms - `wald_anova`
Created on Mon Dec 15 11:19:23 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np # noqa:F401 --> needed for patsy
from statsmodels.formula.api import ols, glm, poisson
from statsmodels.discrete.discrete_model import Poisson
... |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def __init__(self):
self.min_height = -1
def minDepth(self, root: TreeNode) -> int:
def dfs(root: TreeNode, step: int):
... |
"""
Module: libfmp.c8.c8s1_hps
Author: Meinard Müller, Frank Zalkow
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP)
"""
from collections import OrderedDict
import numpy as np
from scipy import signal
import librosa
import IPy... |
import io
from pathlib import Path
import kmbio.PDB
from kmtools import structure_tools
from tkpod.plugins.modeller import Modeller
from .adjacency_matrix import get_interaction_dataset
def get_modeller_scores(row):
structure_data = row.structure_text
fh = io.StringIO()
fh.write(structure_data)
fh.s... |
#!/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... |
from .upload_image import upload_image
from .json import read_json, write_json
from .on_start import on_start
from .list_files import list_files
from .render_image import render_image
from .rgb2hsv import rgb2hsv
from .hsv2rgb import hsv2rgb
from .download_image import download_image
|
#!/usr/bin/env python3
from collections import OrderedDict
import json
import argparse
import sys
import re
import logging
from tqdm import tqdm
try:
from pychain import ChainGraph
import simplefst
except ImportError:
raise ImportError("Please install OpenFST and PyChain by `make openfst pychain` after en... |
import pyautogui
def click_by_list(source_list, duration):
for node in source_list:
print('click %s' % node[0])
pyautogui.click(node[1], duration=duration)
|
# 简化 : 假设其中一个轴为0
def getRange(pts, ax):
mx = pts[0][ax]
mi = pts[0][ax]
for p in pts:
if p[ax] < mi:
mi = p[ax]
if p[ax] > mx:
mx = p[ax]
return mx - mi
def pts2flatten(pts):
ret = []
rg = [getRange(pts, i) for i in range(3)]
deli = rg.index(min(rg... |
"""
Extension Report
~~~~~~~~~~~~~~~~
Generates the report of the currently loaded/available extensions.
"""
import sys
from colorama import Fore
from colorama import Style
from pyapp.extensions.registry import ExtensionDetail
from pyapp.extensions.registry import registry
class ExtensionReport:
"""
Wrappe... |
'''
thonny-py5mode.
py5 plugin for Thonny.
# NOTES TO SELF:
* documentation: https://github.com/thonny/thonny/wiki/Plugins
* maybe look at how Run > Pygame Zero Mode is programmed?
'''
import os
import pathlib
import shutil
import subprocess
import site
import sys
import threading
import time
from distutils.sysconfi... |
import argparse
import logging
from scicopia_tools.analyzers.AutoTagger import AutoTagger
from scicopia_tools.analyzers.TextSplitter import TextSplitter
from scicopia_tools.db.arango import setup
from scicopia_tools.db.parallel import DocTransformer
features = {"auto_tags": AutoTagger, "split": TextSplitter}
logger =... |
# 991. Broken Calculator
class Solution:
def brokenCalc(self, x, y):
res = 0
while x < y:
if y % 2:
y += 1
else:
y //= 2
res += 1
return res + x - y
|
# Copyright 2019 FMR LLC <opensource@fidelity.com>
# SPDX-License-Identifer: Apache-2.0
from textwiser.base import BaseFeaturizer
from textwiser.utils import Constants
try:
import tensorflow as tf
import tensorflow_hub as hub
except ModuleNotFoundError:
pass
class _USEEmbeddings(BaseFeaturizer):
def... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 18 14:43:56 2019
@author: sergejczan
"""
from .sb2l import s2latex, s2string, s2pdf, s2open
|
from django.contrib.gis.geos import Polygon
from django.contrib.gis.measure import Distance
from math import pow, sqrt, asin, sin, cos, radians
from geopy import Point as gpPoint
from geopy.distance import VincentyDistance
EARTH_RADIUS = Distance(km=6371)
def haversin(theta):
return pow(sin(theta/2), 2)
def ah... |
"""
lo que hay que conseguir:
#
##
###
####
#####
... hasta m
"""
import random
m = random.randint(1,10)
for b in range(0,m+1):
producto ='#' * b
print(producto)
|
# -*- coding: utf-8 -*-
import time, wiringpi
class Speaker:
""" Speaker用クラス """
def __init__(self, pin):
""" 初期化メソッド """
self.pin = pin # 電子スピーカー用のGPIOピン
wiringpi.softToneCreate(self.pin)
def play(self, melody):
""" ソフトウェアトーン再生"""
for v, play_time in melody: # ... |
# Generated by Django 3.2.9 on 2021-11-04 04:02
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('main', '0018_auto_20211104_0026'),
]
operations = [
migrations.AlterField(
... |
#!/usr/bin/env python3
import gzip
import sys
# Write a program that finds all of the open reading frames in a transcript
# ORFs start with ATG and end with a stop codon (TAA, TAG, TGA)
# Command line: python3 orfs.py
# Output:
# Gene_name seq_length cds_length
def read_fasta(filename):
name = None
seqs = []
fp ... |
class Solution:
def numSub(self, s: str) -> int:
curr = total = 0
MOD = 10 ** 9 + 7
for c in s:
if c == '1':
curr += 1
total = (total + curr) % MOD
else:
curr = 0
return total
|
# -*- coding: utf-8 -*-
"""
Created on Sun May 26 11:21:31 2019
@author: yoelr
"""
from biosteam.evaluation import Model, Metric
from biosteam.evaluation.evaluation_tools import triang
import biorefineries.sugarcane as sc
__all__ = ('sugarcane_model',)
tea = sc.sugarcane_sys.TEA
ethanol = sc.system.ethanol
products ... |
from django.shortcuts import render
import requests
import pandas
from bs4 import BeautifulSoup
from .forms import TicketForm
# Create your views here.
def index(request):
context = {
'query_param_cookie': {},
'message': '',
'result': {},
'form': TicketForm(),
}
if request... |
import logging
from sim import docker
from sim.core import Environment
from sim.faas import ForkingWatchdog, FunctionReplica, FunctionRequest
logger = logging.getLogger(__name__)
class TrainingFunctionSim(ForkingWatchdog):
"""
Training forks per request
Claims resources per request and downloads per req... |
# -*- coding: utf-8 -*-
# shift+Tab取消缩进
from math import *
from abaqus import *
from abaqusConstants import *
from caeModules import *
from driverUtils import executeOnCaeStartup
import regionToolset
###################parameters#################################
depths = 100.0
duanshu = depths/10
executeOnCaeStartup()
... |
import asyncio
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
"""
Fix pytest collecting for coroutines.
"""
if collector.funcnamefilter(name) and asyncio.iscoroutinefunction(obj):
obj = pytest.mark.asyncio(obj)
return list(collector._genfunctions(name, obj))
@pyt... |
# Copyright 2019 NEC Corporation
#
# 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 t... |
TIME_APPEAR = (30, 700)
TIME_DURATION = (2, 500)
import os, sys, random
from runsets import RunSet
def selectRunSet():
runSet = RunSet()
while raw_input('Generate obstacle events for {}? (Y/n): '.format(runSet.path)).strip().lower() not in ('','y'):
name = raw_input('Specify run set [{}]:'.format(run... |
# coding:utf-8
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import (Conv2dLayer, DenseLayer, FlattenLayer,
InputLayer, PoolLayer)
from cvtron.Base.Model import Model
from .constant import VGG_MEAN
class VGG19(Model):
def __init__(self):
self.na... |
"""
menubar
=======
**Module** : ``menubar.menubar.py``
Contains the MenuBar class.
The MenuBar class is used to place the main menus for
the application.
"""
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.button import Button
from menubar.menus.filemenu import Fi... |
import psycopg2
import sys
import json
import sys
import feedparser
import time
import graphParser
username = sys.argv[1]
pword = sys.argv[2]
url = sys.argv[3]
publisher = sys.argv[4]
subject = sys.argv[5]
refresh = float(sys.argv[6])
def checkDB(title):
cur.execute("SELECT * FROM stories WHERE title = %s;", (tit... |
# Generated by Django 3.0.8 on 2020-07-03 18:32
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0028_auto_20200318_1415'),
]
operations = [
migrations.AddField(
model... |
tools = {'git':'https://github.com/git/git','ls':'https://facebook.com/home.php/'} |
import dash_core_components as dcc
import dash_html_components as html
def simple_pie_chart(id_, title=None):
"""Generates simple pie chart component
Args:
id_ (str): Component id
title (str, optional): Component text. Defaults to None
Returns:
obj: Html div object
"""
c... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
# Network ID for integration tests
import swagger_client
NETWORK_ID = 'integ_net'
# Gateway ID for integration te... |
# Copyright 2017-present Open Networking Foundation
#
# 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 agr... |
import descriptions
import spacy
nlp = spacy.load("en_core_web_lg")
products = descriptions.driver(['description'])
categories = {}
def create_docs(products, column):
doc_array = []
for product in products[column]:
# for product in product_array:
doc_array.append(nlp(product.lower()))
re... |
# -*- python -*-
import time
from . import util
from util import tree
from . import metadata
from . import reader
from collections import deque
import fnmatch
import re
RETENTION_TAG = "gr-ret" # terse in order to save space on-disk
SECONDS_PER_MINUTE = 60
SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60
SECONDS_PER_DAY... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-rest-swagger documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 9 17:02:55 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in... |
"""
This script is just used to automatically generate the convenience methods for each
of the plugin tools in the whitebox_tools.py script. It should be run each time new
tools are added to WhiteboxTools.exe and before a public release.
"""
from __future__ import print_function
import os
from os import path
import re
... |
from django.contrib import admin
from .models import Photo
def publish(modeladmin, request, queryset):
queryset.update(published=True)
publish.short_description = u'Opublikuj zaznaczone'
class PhotoAdmin(admin.ModelAdmin):
list_display = ('title', 'date', 'published')
list_filter = ('date', 'published')
... |
# Login information for the 6.034 Automated Tester
USERNAME="achavezg_MIT_EDU"
PASSWORD="cmaPgVteFXqUzN3VBhYs"
XMLRPC_URL="https://ai6034.mit.edu/labs/xmlrpc/"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.