content stringlengths 5 1.05M |
|---|
"""
This Python file contains the template for the QuickPACS-style workflow
builder functions and function runners.
The runners are designed to make it easy to run each modular workflow function
without having it connected to a larger workflow - this allows the user to
generate only one needed output if necessary, ... |
from unittest import mock
import urllib
import tornado.web
from monstro import forms, db
from monstro.views import (
View, ListView, TemplateView, DetailView, FormView,
CreateView, UpdateView, RedirectView, DeleteView
)
from monstro.views.authenticators import CookieAuthenticator
import monstro.testing
clas... |
import matplotlib.pyplot as plt
import pandas as pd
# 数据文件high-speed rail.csv存放着世界各国高速铁路的情况
# 1)各国运营里程对比柱状图, 标注China为“Longest”
data = pd.read_csv('High-speed+rail.csv', index_col='Country')
print(data)
print(data['Operation'])
operation = data['Operation']
operation.plot(title='Operation Mileage', kind='bar', use_index... |
mail_box = input('Enter a file name: ')
file = open(mail_box, 'r')
count = 0
for line in file:
if line.startswith('From '):
words = line.split()
print(words[1])
count += 1
print('There are', count, 'lines in the file with From as the first word')
|
import time
from playwright.sync_api import sync_playwright, Route
from playwright.sync_api import Request
from pages.login_page.login_page import LoginPage
from pages.main_page.main_page import MainPage
from models.user import User, fake_user
from test.test_base import *
with sync_playwright() as p:
browser = p... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# @author:Spring
# 斯坦福大学官网有完整的课程计划和视频.
# 其中自然语言处理推荐CS224,
# 如果是图像处理好象是CS231.
import numpy as np
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.estimators.estimator import SKCompat
from tensorflow.python.ops import array_ops as array_ops_
import matplotli... |
from __future__ import unicode_literals
from django.contrib import admin
from django_business_rules.models import BusinessRuleModel
@admin.register(BusinessRuleModel)
class BusinessRuleAdmin(admin.ModelAdmin):
pass
|
# coding=utf-8
import tensorflow as tf
import logging
import os
from algorithm import config
from base.env.stock_market import Market
from base.nn.tf.model import BaseSLTFModel
from checkpoints import CHECKPOINTS_DIR
from helper.args_parser import model_launcher_parser
class Algorithm(BaseSLTFModel):
def __init... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, ifitwala and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import getdate, add_years, date_diff, nowdate
from frappe.model.document import Document
class StudentA... |
import os
import secrets
def create_env_file():
prompt = "> "
print("APP_SETTINGS= ? ex. production, development, testing, staging")
APP_SETTINGS = input(prompt)
print("FLASK_APP= ? ex. run.py")
FLASK_APP = input(prompt)
print("FLASK_ENV= ? ex. development, production")
FLASK_ENV = inpu... |
# -*- coding: utf-8 -*-
#
import numpy
import pytest
import colorio
numpy.random.seed(0)
@pytest.mark.parametrize('xyz', [
numpy.random.rand(3),
numpy.random.rand(3, 7),
numpy.random.rand(3, 4, 5),
])
def test_conversion(xyz):
# test with srgb conditions
L_A = 64 / numpy.pi / 5
ciecam02 ... |
from pandas import Series
s = Series([100, 200, 300, 400])
print(s /10)
|
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
# Reval = re-eval. Re-evaluate saved detections.... |
from backend.target_validators.abinitio_gmx_validator import AbinitioGMXValidator
from backend.target_validators.abinitio_smirnoff_validator import AbinitioSMIRNOFFValidator
def new_validator(target_type, target_name=None):
target_validator_dict = {
'ABINITIO_GMX': AbinitioGMXValidator,
'ABINITIO_S... |
# Copyright 2019 Inspur Corporation. 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 app... |
from net.swordie.ms.constants import BossConstants
# Amon - (Easy/Chaos) Zakum's Altar
mapText = {
BossConstants.ZAKUM_JQ_MAP_2 : "I am impressed. Now, for the final stage.\r\nProceed, if you dare..",
BossConstants.ZAKUM_JQ_MAP_1 : "Intimidated? It's not too late to turn around."
}
optionOne = "#L0#Take me back to E... |
import os
import pickle
import shutil
import subprocess
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import h5py
from QDTK.Operator import trafo_to_momentum_rep
from mlxtk import dvr
from mlxtk.cwd import WorkingDir
from mlxtk.doit_analyses import output
from mlxtk.doit_compat impor... |
import json
from typing import Union
import numpy as np
# Modified from
# https://gist.github.com/jannismain/e96666ca4f059c3e5bc28abb711b5c92#file-compactjsonencoder-py
# to handle more classes
class CompactJSONEncoder(json.JSONEncoder):
"""A JSON Encoder that puts small containers on single lines."""
CONTAI... |
# This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
# 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! ***
from enum import Enum
__all__ = [
'CachingType',
'DeallocationOption',
'JobPriority',
'StorageAccountType',
'VmPriority',
]
clas... |
# Copyright (c) 2021 Jonas Thorsell
import sys
import numpy as np
numbers = [int(x) for x in sys.stdin.readline().split(',')]
print(numbers)
board = []
for l in sys.stdin:
if len(l.strip()) != 0:
board.append([int(x) for x in l.split()])
board = np.array(board).reshape((-1,5,5))
mark = np.zeros(board.shap... |
import json
from werkzeug.exceptions import InternalServerError
from werkzeug.wrappers import Response
class HttpResponse(Response):
def __init__(self, content=None, content_type='text/html;charset=utf8', status=200, headers=None, **kwargs):
super().__init__(content, content_type=content_type, st... |
# GMIT IF Statements
x = int(input("Please enter an interger: "))
if x < 0:
x = 0
print('negative changed to zero')
elif x == 0:
print('Zero')
elif x == 1:
print ('Single')
else:
print ('More')
print("The final value of x is:", x)
|
#!/usr/bin/python
import pysam
import csv
import Bio.Seq
import regex
import sys, getopt
# http://www.tutorialspoint.com/python/python_command_line_arguments.htm
# Returns "Start" if You need to look for the primer at the "start" of the read, returns "End" if you need to look for the primer at the end of the... |
from cms.models.pages import (
BlogIndexPage, EventIndexPage, HomePage, IndexPage, NewsIndexPage,
PastEventIndexPage, RichTextPage, _paginate, ChapterIndexPage,
PersonIndexPage
)
from django.test import RequestFactory, TestCase
from wagtail.tests.utils import WagtailPageTests
class TestPages(TestCase):
... |
import os
import re
import sys
import time
import json
import signal
import urllib.request
from decimal import Decimal
from urllib.parse import quote
from datetime import datetime
from subprocess import TimeoutExpired, Popen, PIPE, DEVNULL, CompletedProcess, CalledProcessError
from multiprocessing import Process
from... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# Copyright 2019 SAP SE
#
# 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 appl... |
"""
Author: Omkar Damle
March 2018
"""
from torch.utils.data import Dataset
import os
import numpy as np
import cv2
from scipy.misc import imresize
class DAVIS17OnlineDataset(Dataset):
def __init__(self, train=True,
inputRes=None,
db_root_dir='',
transform=None,... |
# Copyright 2017 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, s... |
from cyder.api.v1.endpoints.dns.mx import api
|
from __future__ import absolute_import, print_function
from datetime import datetime
import requests
from dateutil import parser
from . import endpoints
from .model.show import Show, Alias
from .model.episode import Episode
from .model.season import Season
from .model.person import Character, Person, Crew
from .model... |
import os, sys, socket, random
from urllib import quote_plus
from panda3d.core import HTTPClient, HTTPCookie, URLSpec, Ramfile, Ostream, HTTPDate, DocumentSpec
from direct.task.Task import Task
from direct.directnotify.DirectNotifyGlobal import directNotify
notify = directNotify.newCategory('UserFunnel')
class UserFun... |
import bisect
from tests import test_chop
def chop(val, seq):
pos = bisect.bisect_left(seq, val)
return pos if len(seq) > pos and seq[pos] == val else -1
if __name__ == '__main__':
test_chop(chop)
|
"""
A basic calculator made with tkinter library,
inspired by @pildorasinformaticas and made by @Davichet-e
"""
import math
import cmath
import tkinter as tk
from typing import Callable, Iterator, List, Tuple, Union
class Calculator:
"""
Basic tkinter calculator
"""
def __init__(self, ... |
import re
import socket
class FilterModule(object):
def filters(self):
return {
'kube_lookup_hostname': self.kube_lookup_hostname,
}
def kube_lookup_hostname(self, ip, hostname, many=False):
ips = set()
ip = ip.split(':')[0]
if ip and ip != "":
... |
import torch
def giou_loss(pred_bboxes, target_bboxes, reduction="elementwise_mean"):
pass
|
from typing import List
from collections import Counter
class Solution:
def longestCommonPrefix(self, strs: List[str]) -> str:
# Test for empty array
if not strs:
return ""
for currString in range(len(strs)):
if strs[currString] == "":
return ""
... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#!/usr/bin/env python3
# pyre-strict
from pytorch_lightning.callbacks import ModelCheckpoint
from torchrecipes.core.base_train_app i... |
"""
Given a sorted array and a target value,
return the index if the target is found.
If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Example 1:
Input: [1,3,5,6], 5
Output: 2
"""
# taking the input from the user
x = list(map(int, input("Enter the el... |
# coding: utf-8
"""Tests to Access"""
import json
from django.test import TestCase, Client
from django.urls import reverse
from core.access.factories import UserFactory
class LoginViewTest(TestCase):
def setUp(self):
self.client = Client()
UserFactory(username='admin')
def test_get(self)... |
"""bareasgi_session"""
from .helpers import add_session_middleware, session_data
from .storage import SessionStorage, MemorySessionStorage
__all__ = [
"add_session_middleware",
"session_data",
"SessionStorage",
"MemorySessionStorage"
]
|
from .meta import *
from .attribute_adapter import *
|
import torch
import torch.nn as nn
# import torch.nn.functional as f
import torch.optim as optim
import numpy as np
import time
import os
from models.rnn_mlp import RNN_MLP
from models.social_attention import SocialAttention
from models.spatial_attention import SpatialAttention
from models.s2s_social_attention import... |
import numpy as np
import gammapy.modeling as modeling
import emcee
from gammapy.modeling.sampling import (
par_to_model,
uniform_prior,
)
import scipy.stats as stats
from ecpli.ECPLiBase import ECPLiBase, LimitTarget
class _EnsembleMCMCBase(ECPLiBase):
"""Base class for all affine invariant ensemble ... |
import abc
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Type, Union
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
if TYPE_CHECKING:
from qrcode.main import ActiveWithNeighbors, QRCode
DrawerAliases = Dict[str, Tuple[Type[QRModuleDrawer], Dict[str, Any]]]
class BaseImage:
... |
from election_anomaly import db_routines as dbr
from election_anomaly import user_interface as ui
import pandas as pd
import re
import os
import numpy as np
class MungeError(Exception):
pass
def clean_raw_df(raw,munger):
"""Replaces nulls, strips whitespace, changes any blank entries in non-numeric columns ... |
# Copyright 2016 Cisco Systems, 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 applicable law or agreed to in writing... |
""" This module loads all the classes from the vtkAddon library into its
namespace."""
from vtkAddonPython import *
|
import pickle
from batch_adversarial_search import BatchPredictorAdversarialBFS
from common import Config, VocabType
from argparse import ArgumentParser
from interactive_predict import InteractivePredictor
from interactive_predict_adversarial_search import InteractivePredictorAdvMonoSearch, \
InteractivePredictorA... |
INPUT_NAME = 'publisher'
OUTPUT_NAME = 'output1'
OUTPUT_UPDATER_NAME = "outputUpdater"
DATA_KEY = "data"
TYPE_KEY = "type"
TELEMETRY_TYPE = "telemetry"
WARNING_TYPE = "warning"
ALERT_TYPE = "alert"
# datas
DATA_DATE_NAME = 'timestamp' |
"""
Group end goals
===============
This module takes the outputs of the genetic algorithm and groups them into clusters of metabolic end goals.
"""
import warnings
import os
from os.path import join
from os import listdir
from BOFdat.util import dijkstra
from BOFdat.util.update import _import_model
from BOFdat.util.... |
import pandas as pd
import matplotlib.pyplot as plt
def plotHeatmap(s, col, fillValue=None, ynTicks=10, xnTicks=8, cbar_label=None,
scaling=1, vmin=None, vmax=None, fig=None, ax = None, with_cbar=True,
cbar_nTicks=None, transpose=True):
'''
Plot a heatmap from time series data.
Usage for dat... |
"""
type definitions for opencl types (mapping to ctypes).
This is based on:
https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/scalarDataTypes.html
And to some point it will be based on data in headers
"""
from __future__ import print_function, absolute_import, division
import ctypes
if ctypes.sizeof(ctyp... |
from genetic import *
from image import *
from snn import *
import math, random
import numpy
def convert_binary(data, w, h, t):
ans = [[0 for x in xrange(w)] for x in xrange(h)]
for x in xrange(h):
for y in xrange(w):
if data[x][y] > t:
ans[x][y] = 1
else:
ans[x][y] = 0
return ans
def convert_mat(... |
"""Bazel-specific intellij aspect."""
load(
":intellij_info_impl.bzl",
"intellij_info_aspect_impl",
"make_intellij_info_aspect",
)
def tool_label(tool_name):
"""Returns a label that points to a tool target in the bundled aspect workspace."""
return Label("//aspect/tools:" + tool_name)
def get_go_... |
class Node:
def __init__(self, data, point=None):
"""
Create Node that alows to store two data in head and pointer.
Example : \n
>>> node = Node(5)
>>> node.point = Node(3)
>>> node
5-->3-->
:param data: Values to be stored in head
:param poi... |
#!/bin/python
# -*- coding: utf8 -*-
import logging
import unittest
from builtins import range
from tablestore.client import *
from tablestore.metadata import *
from tablestore.error import *
from lib.mock_connection import MockConnection
from lib.test_config import *
class SDKParamTest(unittest.TestCase):
def ... |
def test_healthcheck(survey_runner):
response = survey_runner.test_client().get('/healthcheck')
assert response.status_code == 200
assert "success" in response.get_data(as_text=True)
|
from mtq.job import Job
from mtq.utils import is_str
class QueueError(Exception):
pass
class Queue(object):
'''
A queue to enqueue an pop tasks
Do not create directly use MTQConnection.queue
'''
def __str__(self):
return self.name
def __repr__(self):
return '<mtq.Queu... |
"""
Module: 'flowlib.units._dual_button' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import Any
class Dual_button:
""""""
def deinit(self, *arg... |
import unittest
from tests.integration.exchange import BacktestExchangeBaseIntegrationTest
from tests.integration.run import (
ParseParamsAndExecuteAlgorithmIntegrationTests, MainLoopIntegrationTest,
ExecuteAlgorithmIntegrationTests)
def test_suite():
suite = unittest.TestSuite([
unittest.makeSuit... |
# 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... |
import angr
class GetProcessHeap(angr.SimProcedure):
def run(self):
return 1 # fake heap handle
class HeapCreate(angr.SimProcedure):
def run(self, flOptions, dwInitialSize, dwMaximumSize): #pylint:disable=arguments-differ, unused-argument
return 1 # still a fake heap handle
class HeapAll... |
# Generated by Django 2.2.5 on 2019-11-04 18:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('affiliate_marketing', '0010_brand_vendor_code'),
]
operations = [
migrations.AddField(
model_name='brand',
name='sto... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import abc
from typing import (
Any, Dict, Iterator, Optional, Union,
)
from pyhocon import ConfigTree
from databuilder.extractor.base_extractor import Extractor
class ElasticsearchBaseExtractor(Extractor):
"""
Extra... |
import os, io
from google.cloud import vision
import pandas as pd
from numpy import random
from colormap import rgb2hex
credential_path = '/home/mcw/subha/DSC/dsc_django/app/dl_scripts/gvision_attributes/servicetokenjson.json'
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credential_path
client = vision.ImageAnnotat... |
#!/usr/bin/env python3
from argparse import RawTextHelpFormatter, ArgumentParser
from stem.control import Controller
import time
import os
import logging
logger = logging.getLogger(__name__)
def get_controller(addr, port):
cont = Controller.from_port(addr, port)
cont.authenticate()
return cont
def get_... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2016-2017 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... |
#!/usr/bin/python3
# This file is part of libmodulemd
# Copyright (C) 2017-2018 Stephen Gallagher
#
# Fedora-License-Identifier: MIT
# SPDX-2.0-License-Identifier: MIT
# SPDX-3.0-License-Identifier: MIT
#
# This program is free software.
# For more information on the license, see COPYING.
# For more information on fre... |
from rect import Rect
from bullet import Bullet
import pygame
#pistol rifle
class Gun(Rect):
Images = { "pistol" : pygame.image.load("images/pistol.png"),
"pistol_two" : pygame.image.load("images/pistol_two.png"),
"rifle" : pygame.image.load("images/rifle.png") }
def __init__(self, damage, b... |
from setuptools import setup
setup(name='gamdist',
version='0.1',
description='Generalized Additive Models',
url='http://www.gotinder.com',
author='Bob Wilson, Tinder',
author_email='bob.wilson@gotinder.com',
license='Apache v2.0',
packages=['gamdist'],
install_requires=... |
#!/usr/bin/env python3
import argparse
import numpy as np
from mapTools import *
from utilities import writeLog
from plotTools import addImagePlot
import matplotlib.pyplot as plt
import sys
'''
Description:
Author: Mikko Auvinen & Jukka-Pekka Keskinen
mikko.auvinen@fmi.fi
Finnish Meteorological Instit... |
# Compare Algorithms
from pandas import read_csv
from matplotlib import pyplot
from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import LogisticRegressionCV
from sklearn.tree import DecisionTreeClas... |
import giphypop
import random
class Giphy(object):
def __init__(self):
self.g = giphypop.Giphy(api_key="dc6zaTOxFJmzC")
def search(self, text):
results = [x for x in self.g.search(text)]
im = random.choice(results)
return im.media_url |
import torch
import numpy as np
import matplotlib.pyplot as plt
from torch.autograd import Variable
from min_norm_solvers import MinNormSolver
from utils import calc_gradients, circle_points, model_from_dataset, reset_weights
from ..base import BaseMethod
def get_d_paretomtl_init(grads, losses, preference_vectors, ... |
from django.shortcuts import render
from django.http import JsonResponse
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.decorators import login_required
from myapp.models.schema_file import *
def solve7(time, submitted_answer, original_answer):
if time == '':
return False
if time ... |
from argparse import ArgumentParser
class CmdLineTool:
def __init__(self, description):
self.description = description
self._initializeOptParser()
def _initializeOptParser(self):
self.argParser = ArgumentParser(description = self.description)
def run(self):
"""
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base CCDData class.
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from astropy.io import fits
from astropy.tests.helper import pytest
from astr... |
import numpy as np
from ...utils import box_utils
from ..dataset import DatasetTemplate as Dataset
def transform_annotations_to_kitti_format(annos, map_name_to_kitti=None, info_with_fakelidar=False, **kwargs):
"""
Args:
annos:
map_name_to_kitti: dict, map name to KITTI names (Car, Pedestrian,... |
from apiclient import errors
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from email.message import EmailMessage
import base64
import time
from lib.debugging import *
from lib.utils import *
def get_service(token_path):
store = file.Storage(to... |
from gen import *
from dataset import *
import numpy as np
from fg import Foreground, FGTextureType
def save_to_file(npy_file_name, n_examples, dataset, use_patch_centers=False, e=16):
np_data = np.array(np.zeros(e**2))
np_targets = np.array(np.zeros(1))
if use_patch_centers:
np_patch_centers = n... |
# -*- coding: utf-8 -*-
###############################################################
# Author: patrice.ponchant@furgo.com (Fugro Brasil) #
# Created: 17/12/2020 #
# Python : 3.x #
########################################... |
from tests.utils import econf_compile, econf_foreach_cluster, module_and_mapping_manifests, SUPPORTED_ENVOY_VERSIONS
import os
import pytest
# Tests if `setting` exists within the cluster config and has `expected` as the value for that setting
# Use `exists` to test if you expect a setting to not exist
def _test_clus... |
from openstack.bssintl import bss_intl_service
from openstack import resource2 as resource
class Version(resource.Resource):
resource_key = 'version'
resources_key = 'versions'
base_path = '/'
service = bss_intl_service.BssIntlService(
version=bss_intl_service.BssIntlService.UNVERSIONED
)
... |
##################################################################
## (c) Copyright 2018- by Jaron T. Krogel ##
##################################################################
#====================================================================#
# quantum_package_analyzer.py ... |
# -*- coding: utf-8 -*-
"""Tests for the wgs_sv_calling workflow module code"""
import textwrap
import pytest
import ruamel.yaml as yaml
from snakemake.io import Wildcards
from snappy_pipeline.workflows.wgs_sv_calling import WgsSvCallingWorkflow
from .common import get_expected_output_bcf_files_dict, get_expected_o... |
import os
from functools import lru_cache
import typer
from changelog import dump_to_file, load_from_file
from changelog.exceptions import ChangelogParseError, ChangelogValidationError
from changelog.model import Changelog
@lru_cache(maxsize=None)
def global_options():
return {"path": os.getenv("CHANGELOG_PATH"... |
# -*- coding: utf-8 -*-
##
# \file init_fdtd_geospr.py
# \title Definition of the numerical parameters for the FDTD method.
# The updated scheme that gives the pressure
# at each time iteration is defined in the upd_fdtd.py files.
# It is applied for the grid convergence studies geo... |
# prenese strani (približno 170 strani seznama, vsaka stran navede 50 iger) in podatke shrani v igre.csv (konzole ohranjajo prvotna imena)
import os, sys, inspect
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from pomozno.obdelovanje_html import obdelava_html_seznam
from pomozno import prenos_strani
from pomoz... |
from app.cache import get_from_cache, set_into_cache, delete_from_cache
import logging as _logging
import hashlib, json
logging = _logging.getLogger("matrufsc2_decorators_cacheable")
logging.setLevel(_logging.DEBUG)
__author__ = 'fernando'
CACHE_CACHEABLE_KEY = "cache/functions/%s/%s"
def cacheable(consider_only=No... |
from flask import Flask, request, jsonify
import utils
app = Flask(__name__)
def extract_req_data(data):
if isinstance(data, str):
return data.split("|")
elif isinstance(data, list):
return data
else:
raise Exception("Invalid Request format !!")
@app.route("/info")
def get_disque_info():
return jsonify(util... |
# MIT licensed
# Copyright (c) 2020 lilydjwg <lilydjwg@gmail.com>, et al.
# Copyright (c) 2017 Felix Yan <felixonmars@archlinux.org>, et al.
import pytest
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
async def test_anitya(get_version):
assert await get_version("shutter", {
"source": "anitya",
"... |
import requests
def giveme(names: [str], system: str='macOS', target: str='./.gitignore'):
"""
Parameters
----------
names: a list of names. if more than one, concat ignore files
"""
url = 'https://raw.githubusercontent.com/github/gitignore/master/{}.gitignore'
content = b''
for name i... |
# Python Implementation: MPI weather forecasting benchmark
# -*- coding: utf-8 -*-
##
# @file mpiWeatherConv.py
#
# @version 1.0.0
#
# @par Purpose
# Run a MPI Jena weather classification task using keras.
#
# @par Comments
# This is another experiment from Chollet's book fea... |
# Copyright (c) 2018-2019 Alexander L. Hayes (@hayesall)
#
# 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... |
"""Common Wrapper/Interface around various video reading/writing tools to make video reading stable,
consistent and super easy around different systems and OS.
Backends
- OpenCV (in-development)
# How to Read Video
```python
from vidsz import Reader
# open reader
reader = Reader("static/countdown.mp... |
#! /usr/bin/env python
"""
Copyright 2010-2019 University Of Southern California
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 appl... |
import urllib
import json
import os
from flask import Blueprint, flash, redirect, render_template, url_for, request
from flask_login import login_required, current_user
from werkzeug.utils import secure_filename
from app import app, db
from .models import Blog, Comment
main = Blueprint('main', __name__)
# helper... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.