content stringlengths 5 1.05M |
|---|
# Subject/Participant
sub='sub-01'
# Total number of experimental runs
total_run=8
# Left-out run for testing
test_run=1
# Predictor ROI
roi_1_name='FFA'
# Target ROI
roi_2_name='GM'
# Functional Data
filepath_func=[]
filepath_func+=['./example_data/'+sub+'/'+sub+'_movie_bold_space-MNI152NLin2009cAsym_preproc_denoise... |
# Generated by Django 3.1.7 on 2022-03-13 11:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('properties', '0004_auto_20220313_1005'),
]
operations = [
migrations.CreateModel(
name='Propert... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
import unittest
import smart_open.utils
class ClampTest(unittest.TestCase):
def test_low(self):
self.assertEqual(smart_open.utils... |
# Generated by Django 2.0 on 2018-12-29 18:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('content', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='contentpost',
name='template_file',
... |
#! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Created on 23/09/2020 20:22
@Author: XinZhi Yao
"""
import logging
import threading
from logging import CRITICAL # NOQA
from logging import DEBUG # NOQA
from logging import ERROR # NOQA
from logging import FATAL # NOQA
from logging import INFO # N... |
from src.logger import logger
from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error
class measure_metrics:
def __init__(self):
self.log = logger.log()
def compute_r2_score(self, y_true, y_pred):
return r2_score(y_true, y_pred)
def compute_mean_squared_error(self, ... |
from youtube_dl import extractor
from discord_extsource.exceptions import NotSeekable
from .extractor import extract
from .PyAVSource import PyAVSource
class YTDLSource(PyAVSource):
def __init__(self, Data: dict, *args, **kwargs) -> None:
super().__init__(Data["url"], *args, **kwargs)
self.Data... |
import sys
import numpy as np
import argparse
def norm_score(reverse=False):
data = []
for line in sys.stdin:
line = line.strip()
score = float(line)
if reverse:
score = -score
data.append(score)
arr = np.asarray(data)
norm_arr = (arr - np.min(arr)) / (np.m... |
# # Comments are stripped during encoding for multicall
# Copyright (c) 2015 - 2016, Intel 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/... |
from pathlib import Path
project_root = Path(__file__).parent.absolute()
import os
import random
import math
from collections.abc import Sequence
from functools import partial
import torch
import pytorch_lightning as pl
from pytorch_lightning.callbacks import Callback
from munch import Munch
import ray
from ray im... |
from typing import Any
from typing import Optional
from cleo.io.inputs.argument import Argument
from cleo.io.inputs.option import Option
def argument(
name: str,
description: Optional[str] = None,
optional: bool = False,
multiple: bool = False,
default: Optional[Any] = None,
) -> Argument:
re... |
#
# Copyright (c) 2019, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import json
from http import HTTPStatus
from django.test import TestCase, override_settings
from ... |
from typing import List, Tuple
class Node:
def __init__(self, node) -> None:
self.line = node.line
self.col = node.col
self.type = None
def get_position(self) -> Tuple[int, int]:
return self.line, self.col
class ProgramNode(Node):
def __init__(self, declarations, node: N... |
import numpy as np
import os
os.chdir('C:/Users/DELL/Desktop/Luis/Pset2')
import matplotlib.pyplot as plt
import K_S_Labor_Q3 as ks
ks1 = ks.K_S(N_k = 50)
Z, E = ks1.Simulation_U_Z()
ki, ni, r_v, w_v = ks1.simulation_Ag_K(gk_Mat, gn_Mat, Z, E, ret = 1)
K = np.mean(ki, axis=1)
N = np.mean(ni, axis=1)
alpha =... |
import json
import os
def load_results(result_file_path):
if not os.path.isfile(result_file_path):
return { "artifacts": [] }
with open(result_file_path, "r") as result_file:
results = json.load(result_file)
results["artifacts"] = results.get("artifacts", [])
return results
def save_results(result_file_pat... |
import pdb
import shutil
from os import name
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import override_settings
import pytest
from blog.models import BlogPost
from conftest import lo... |
import pymc3 as pm
import pandas as pd
import matplotlib
import numpy as np
import pickle as pkl
import datetime
import os
from BaseModel import BaseModel
from matplotlib.gridspec import SubplotSpec, GridSpec, GridSpecFromSubplotSpec
import matplotlib.patheffects as PathEffects
import gc
import isoweek
from collections... |
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext
from apps.client_details.models import ClientDetailsBase
from canvas import util
from canvas.cache_patterns import CachedCall
from drawquest.apps.drawquest_auth.details_models i... |
import re
import nltk
import nltk.data
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
try:
nltk.data.find('tokenizers/punkt')
except LookupError:
... |
import pprint,json, pytest
from collatorx.common.provider import Provider
from collatorx.providers.coinbase import CoinbaseClient
pp = pprint.pprint
# @pytest.fixture(scope="class")
# def base_provider():
# '''An instance of Provider base class'''
# provider = Provider()
# return provider
# @pytest.fixt... |
#!/usr/bin/python
# coding: utf-8
#
# author:
#
# date:
# description:
#
import numpy as np
import zipfile
import theano
from theano import tensor
#theano.config.compute_test_value = 'warn'
import fuel
import h5py
from fuel.datasets.hdf5 import H5PYDataset
from fuel.streams import DataStream
from fuel.schemes impor... |
# Copyright (c) 2021 Grumpy Cat Software S.L.
#
# This Source Code is licensed under the MIT 2.0 license.
# the terms can be found in LICENSE.md at the root of
# this project, or at http://mozilla.org/MPL/2.0/.W
from shapelets import init_session
from shapelets.dsl.data_app import DataApp
from shapelets.dsl import dsl... |
"""
Validates a stream of JSON revsion documents against a JSON schema and writes
them to stdout if they validate -- otherwise, complains noisily.
Usage:
validate (-h|--help)
validate [<input-file>...] --schema=<path> [--threads=<num>]
[--output=<path>] [--compress=<type>] [--verbose] [--debug]
O... |
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2004. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purp... |
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import SocketServer
import sys
import socket
class LogServer(BaseHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
d... |
import matplotlib.pyplot as plt
import numpy as np
from os import makedirs, listdir
from os.path import join, isfile, isdir, exists, splitext
from pprint import pprint
import json
Settings = json.load(open('settings.txt'))
pprint(Settings)
print("")
from pak.datasets.MOT import MOT16
from pak import utils
import sys
sy... |
from cvm.services import is_contrail_vm_name
def test_contrail_vm_name():
contrail_name = 'ContrailVM-datacenter-0.0.0.0'
regular_name = 'VM1'
contrail_result = is_contrail_vm_name(contrail_name)
regular_result = is_contrail_vm_name(regular_name)
assert contrail_result is True
assert regular... |
tuple1 = ('apple', 'banana', 'cherry')
print(tuple1)
print(tuple1[1])
print(tuple1[-1])
tuple2 = ('apple', 'banana', 'cherry', 'orange', 'kiwi', 'melon', 'mango')
print(tuple2[2:5])
print(tuple2[-4:-1])
# change tuple value
x = tuple(tuple1)
print(x)
y = list(x)
y[1] = 'kiwi'
x = tuple(y)
print(x)
# create tuple with... |
from fastapi_utils.api_model import APIModel
from tifa.apps.admin.local import g
from tifa.apps.admin.router import bp
from tifa.models.menu import Menu, MenuItem
class TMenu(APIModel):
id: str
name: str
slug: str
class TItem(APIModel):
id: str
name: str
items: list[TItem]
@bp... |
#From the Train_details_22122017.csv finding out all the trains that run through the stations VSKP,HWH,BBS and separeting the into seperate files and also simultaneously making a list of the train numbers
f=open('Train_details_22122017.csv','r')
v=open('vskp.csv','w')
h=open('hwh.csv','w')
b=open('bbs.csv','w')
header... |
"""
This is the loadable seq2seq trainer library that is
in charge of training details, loss compute, and statistics.
See train.py for a use case of this library.
Note: To make this a general library, we implement *only*
mechanism things here(i.e. what to do), and leave the strategy
... |
# -*- coding: utf-8 -*-
# Copyright 2021 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 o... |
import random
import string
import hashlib
from Crypto.Cipher import DES
from Crypto import Random
import codecs
import base64
class Hasher():
def __init__(self):
self.BASE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
self.key = Random.get_random_bytes(8)
def randomPas... |
'''
You are given an integer array cost where cost[i] is the
cost of ith step on a staircase. Once you pay the cost,
you can either climb one or two steps.
You can either start from the step with index 0, or the
step with index 1.
Return the minimum cost to reach the top of the floor.
... |
from task_1_3_1_functions import gcd
#1 Write a Python function, which Implements the Euler function.
#Euler function is return a count of numbers not great than N, which are mutually simple with N.
#Example φ(6)=2, as only 1 and 5 from 1,2,3,4,5 are mutually simple with 6. Write a function which returns a count of n... |
#!/usr/bin/python
import sys
import hashlib
import math
import os.path
from os import path
import time
#This function will hash the input string using SHA224
def hash1(s, blen):
m = hashlib.sha224()
m.update(s)
temp = m.hexdigest()
return (int(temp, 16) % blen) #The return value is modded by the length of the bl... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from abc import ABC, abstractmethod
class ITest(ABC):
# This function must be called before any other function.
@abstractmethod
def prepare(self, input):
pass
@abstractmethod
def calculate_objective(self, times):
... |
#for CSV parsing
import csv
from math import log2
class TreeNode:
def __init__(self):
self.children = {}
self.value = ""
def process_csv(file_name):
data = []
with open(file_name, 'r') as some_file:
csv_file = csv.reader(some_file,
delimiter=',',
... |
"""
pyaud_plugins._plugins.fix_file
===============================
"""
import os
import tempfile
import typing as t
from pathlib import Path
import pyaud
from pyaud_plugins._environ import environ as e
@pyaud.plugins.register()
class Imports(pyaud.plugins.FixFile):
"""Audit imports with ``isort``.
``Black... |
from flask import current_app
import traceback
def remove_index(index_name='bill'):
current_app.elasticsearch.indices.delete(index=index_name, ignore=[400, 404])
def create_index(index_name='bill'):
created = False
# index settings
settings = {
"mappings": {
"properties": {
"l... |
"""Source-code related to the spark-skeleton."""
|
import tkinter as tk
import tkinter.messagebox as mbox
root = tk.Tk()
root.title("Number Memory")
root.iconbitmap("app.ico")
root.geometry("800x400")
root.resizable(False, False)
mbox.showerror("Number Memory", "This function is not implemented yet. ")
root.after(1000, root.destroy())
root.mainloop()
|
"""
Test unit systems.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2015, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------... |
#!python
import string
# Hint: Use these string constants to ignore capitalization and/or punctuation
# string.ascii_lowercase is 'abcdefghijklmnopqrstuvwxyz'
# string.ascii_uppercase is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# string.ascii_letters is ascii_lowercase + ascii_uppercase
def is_palindrome(text):
"""A string ... |
from pathlib import Path
import sqlite3
def makeDatabase(path):
path = Path(path)
Path.mkdir(path.parent, exist_ok=True, parents=True)
if path.exists():
raise ValueError(f"That database ({path}) already exists and would be overwritten. Exiting")
conn = sqlite3.connect(str(path))
cursor = c... |
"""Functions"""
import os
import sys
from sys import exit, stderr, argv, path, modules
from os.path import isfile, isdir, realpath, dirname, exists
import numpy as np
import pandas as pd
# plotting
import matplotlib
import seaborn.apionly as sns
from matplotlib import rc
import matplotlib.lines as mlines
import pylab a... |
#Kyle Verdeyen
#Independent Study, Summer 2017
#Joanne Selinski
#View for the mainform. Very basic validation checks.
from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from .forms import MainFormModelForm
from django.urls import reverse
# Create your views here.
def... |
from .builder import build_dataset
from .base import BaseDataset
from .voc import VOCDataset
|
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 08:15:03 2020
@author: rafae
"""
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import spacy
from spacy.lang.pt.stop_words import STOP_WORDS
import unidecode
import string
#import xgboost as xgb
from sklearn.metrics import a... |
import sys
import time as t
import numpy as np
from depthy.misc import Normalizer
def get_indices(offset: int = 0, dim: int = 0, direction: tuple = (0, 0), height: int = 0) -> (np.ndarray, np.ndarray):
"""
Compute array of indices diagonal directions (SE, SW, NW, NE) of the slice.
:param offset: differ... |
from authlib.integrations.flask_client import OAuth
from flask import redirect, render_template, session
from loginpass import Google, create_flask_blueprint
from goslinks.auth.constants import AUTH_EMAIL_KEY, AUTH_NEXT_URL_KEY
from goslinks.db.factory import get_model
def handle_authorize(_remote, _token, user_info... |
__author__ = "Henry Richard J"
__license__ = "MIT License"
__maintainer__ = "Henry Richard"
from access_points import get_scanner
import requests
import PySimpleGUI as sg
from geopy.geocoders import Nominatim
ssids = []
bssids = []
Coordinations = []
search_in_Google=[]
locator = Nominatim(user_agent="Wi... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\situations\complex\paparazzi_situation.py
# Compiled at: 2018-10-12 18:14:28
# Size of source mod 2*... |
__author__ = "Joseph D. Hughes"
__date__ = "December 3, 2022"
__version__ = "1.2.3"
__maintainer__ = "Joseph D. Hughes"
__email__ = "jdhughes@usgs.gov"
__status__ = "Production"
__description__ = """
This is the pymake program for compiling fortran, c, and c++ source files,
such as the source files that come with MODFL... |
# -*-coding:utf-8 -*-
'''
@File : data_preprocess.py
@Author : HW Shen
@Date : 2020/9/2
@Desc :
'''
import re
import pandas as pd
# import jieba
import jieba_fast as jieba
from bs4 import BeautifulSoup
def pd_clean_data(movie_name):
print("===================开始数据清洗======================")
... |
import logging
import unittest
from velocityhelper.api.surfacemodel import SurfaceModel
from velocityhelper.api.isomodel import IsoModel
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class IsoModelTest(unittest.TestCase):
def test_getList(self):
result = IsoModel()
... |
import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
from ibm_watson import ApiException
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
version = '2018-05-01'
authenticator = IAMAuthenticato... |
import OS_model
from numpy import random
# import numpy as np
time_step_old = 0.005
time_step_new = 0.01
random.seed(72)
x = OS_model.Monolayer(size=5)
x.set_k_pert(k_pert=0) # Remove randomness so that simulations are 'the same'
x.set_time_step(time_step_old) # Set time step
x.show_cells()
# Writing data file
# f... |
import sys
import operator
select_count = 10000
with open("../data/fann_sentiments.train", "r") as f:
with open("../data/fann_sentiments.10k.train", "w") as outf:
i = 0
for line in f:
if i == 0:
outf.write("%s\n" % "10000 3208 5")
else:
outf.write("%s" % line)
if i == select_count*2:
bre... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class UNet(nn.Module):
def __init__(self, logger):
super(UNet, self).__init__()
self.logger = logger
self.down0 = ConvBlock(3, 64)
self.down1 = ConvBlock(64, 128)
self.down2 = ConvBlock(128, 256)
... |
"""add weekly and monthly discount in car option
Revision ID: 7a4c58aabfb8
Revises: 86b8ecd7fa47
Create Date: 2018-06-15 14:59:30.084362
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7a4c58aabfb8'
down_revision = '86b8ecd7fa47'
branch_labels = None
depends_... |
from confluent_kafka import Producer, Consumer, KafkaError
import time
import re
import sys
def word_count(text):
return len(re.sub("[\n\t,. ]+", " ", text).split(" "))
def main():
print(len(sys.argv))
origen = 'origen' if len(sys.argv) < 2 else sys.argv[1]
destino = 'destino' if len(sys.argv) < 3 e... |
from .config import parseNamespace, parseClassName
from .constants import *
from .property import URIProperty, IntProperty, TextProperty
from .toplevel import TopLevel
SEARCH_QUERY_URI: str = PYSBOL2_NS.SearchQuery.toPython()
OBJECT_TYPE_URI: str = PYSBOL2_NS.ObjectType.toPython()
OFFSET_URI: str = PYSBOL2_NS.Offset.t... |
# global
import os
import ivy
import argparse
import ivy_mech
import ivy_vision
import numpy as np
from ivy.framework_handler import set_framework, unset_framework
from ivy_demo_utils.ivy_scene.scene_utils import SimCam, BaseSimulator
from ivy_demo_utils.framework_utils import choose_random_framework, get_framework_fro... |
# coding:utf-8
"""
Spelling corrector library, used to correct common typos in domains like
gmal.com instead of gmail.com.
The spelling corrector uses difflib which in turn uses the
Ratcliff-Obershelp algorithm [1] to compute the similarity of two strings.
This is a very fast an accurate algorithm for domain spelling ... |
from discord import Embed
from discord.ext import commands, tasks
from core import loop_errors
from core.loop import Loop
class Utility(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
# ? TODO
# * check before invoke
# * infinity loop
# * stop loop command
@commands.com... |
"""
Copyright 2022 Lincoln Zhou, zhoulang731@gmail.com
This script demonstrates training multi-class semantic segmentation model on custom dataset, using U-Net architecture.
Please refer to U-Net paper: https://arxiv.org/abs/1505.04597
The scripts in this repo partially use code from: https://github.com/bnsre... |
import cv2
import os
import glob
import imutils
import numpy as np
import argparse
import matplotlib.pyplot as plt
ap = argparse.ArgumentParser(description='Process obama weekly addresses.')
ap.add_argument("-sv", "--showvid", help="Display the video while processing.", default=False)
args = vars(ap.parse_args())
s... |
import argparse
import json
import os
def get_args_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--input', default='', type=str, help='path to redcaps annotations directory')
parser.add_argument('--output', default='', type=str, help='output annotations file path')
return parser
... |
"""
Diff 2 CAL DAC settings XML files. The command line is:
dacDiff [-V] FLE|FHE|LAC|ULD <dac_xml_file1> <dac_xml_file2> <output_base_filename>
where:
-V = verbose output
FLE|FHE|LAC|ULD = DAC dacType to validate
<dac_xml_file1> = GLAST Cal dac xml 'fragment' file (minuend)
<dac... |
#!/usr/bin/env python3
from panflute import *
import re
import sys
"""
Converts blockquotes of the following form:
> Note:
to actual boxes with different colours.
"""
def latex_blockquote(elem, doc):
if type(elem) != BlockQuote:
return
content = stringify(elem).strip()
if not content.startswith(... |
# -*-coding:utf-8 -*-
u"""
:创建时间: 2022/3/16 22:02
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
"""
class CPMelBaseException(Exception): pass
class CPMelException(CPM... |
# -*- coding: utf-8 -*-
# @Author: sijanonly
# @Date: 2018-03-19 11:01:12
# @Last Modified by: sijanonly
# @Last Modified time: 2018-03-19 11:01:22
class CustomException(Exception):
pass
|
# -*- coding: utf-8 -*-
"""
Basic PromQLLexer Tests
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.token import Token
from pygments_promql import PromQLLexer
@pytest.fixture(scope="mo... |
# ler um numero e mostre o seu dobro, triplo e raiz quadrada
n1 = int(input('Digite um numero: '))
print(f'Dobro: {n1*2}')
print(f'Triplo: {n1*3}')
print(f'Raiz Quadrada: {n1**(1/2):.2f}')
print(f'Outra forma de fazer raiz quadrada {pow(n1,(1/2)):.2f}')
|
import sys
import pytest
import itertools
from pysd.py_backend.data import Columns
class TestColumns:
@pytest.fixture(scope="class")
def out_teacup(self, _root):
return _root.joinpath("data/out_teacup.csv")
@pytest.fixture(scope="class")
def out_teacup_transposed(self, _root):
return... |
from django_tex.environment import environment
import markdown
from apps.reporting.utils.mdtex import LaTeXExtension
def md_to_tex(value):
return markdown.markdown(value, extensions=[LaTeXExtension()])
def tex_report_env(**options):
env = environment(**options)
env.filters.update({
'md_to_tex': ... |
"""generate_gradient.py
~~~~~~~~~~~~~~~~~~~~~~~
Use network2 to figure out the average starting values of the gradient
error terms \delta^l_j = \partial C / \partial z^l_j = \partial C /
\partial b^l_j.
"""
#### Libraries
# Standard library
import json
import math
import random
import shutil
import sys
sys.path.appe... |
import math
import time
# This class represents a node
class Node:
# Initialize the class
def __init__(self, id, location):
self.id = id
self.location = location
self.neighbours = []
self.parent = None
self.g = 0 # Distance to start node
self.h = 0 # Distance t... |
# coding: utf-8
"""
Peacemakr
This API describes the Peacemakr services, which enable seamless application layer encryption and verification. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
im... |
#!/usr/bin/env python
# Copyright 2014-2020 Scalyr 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 ... |
""" Evaluate the baselines ont ROUGE/METEOR"""
import argparse
import json
import re
import os
from os.path import join, exists
from evaluate import eval_meteor, eval_rouge
try:
_DATA_DIR = '/home/wanglihan/CNN/finished_files/'
except KeyError:
print('please use environment variable to specify data directori... |
#!/usr/bin/env python3
import os.path
import shutil
import subprocess
import sys
import tempfile
import mgm_utils
# The run_kaldi.sh script is assumed to be in a directory called kaldi-pua-singularity, which is a peer to the
# galaxy install. It can either be a check out of that repo, or just the script and the app... |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
# All rights reserved.
#
#
# * R... |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
"""
File: train.py
Project: msalib
File Created: Thursday, 13th December 2018 10:08:17 pm
Author: Qianxiao Li (liqix@ihpc.a-star.edu.sg)
-----
Copyright - 2018 Qianxiao Li, IHPC, A*STAR
License: MIT License
"""
import tensorflow as tf
import math
from msalib.scipyoptimizer import ScipyOptimizer
class Trainer(object)... |
# coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
class AwesomebikesClientAdapter(JSONAdapterMixin, TapiocaAdapter):
api_root = 'http://localhost:8000/api/'
resource_mapping = {'bikes': {'resource': 'bikes/'}}
... |
import io
import logging
import os
import tempfile
import pandas as pd
from flask import render_template, request, flash, send_from_directory
from werkzeug.utils import secure_filename
from self_finance.back_end.data import Data
from self_finance.back_end.date_range import DateRange
from self_finance.back_end.insight... |
class Credentials:
"""
Class that generates new instances of credentials.
"""
accounts_list = [] # Empty accounts list
# Init method up here
def __init__(self, acc_name, user_name, password):
'''
method that defines variables to be used
'''
self.acc_name = acc_... |
from goodtables import validate
from .checks.get_checks_for_dataset import get_checks_for_dataset
def run_checks(filepath):
"""
Find the custom checks for the datapackage at filepath and
run both the custom checks and the default checks on the datapackage.
"""
checks = ['structure', 'schema']
... |
""" Isomorphic widget for rendering jinja2 templates
"""
from ._version import __version__, module_name
from .widget_template import Template
__all__ = ["__version__", "Template"]
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": module_name}]
|
from flask_dance.consumer import OAuth2ConsumerBlueprint
from functools import partial
from flask.globals import LocalProxy, _lookup_app_object
from flask import _app_ctx_stack as stack
def make_42_blueprint(
client_id=None,
client_secret=None,
*,
scope=None,
redirect_url=None,
redirect_to=Non... |
import os, shutil
import numpy as np
import scipy.signal
from scipy import interpolate
import matplotlib.pyplot as plt
import trials_key
def find_trial_MVC_by_time(sub_info, sub_data):
# get activation levels and trials key-value pairs
sub_key = trials_key.gen(sub_info.sub)
# make dict of trials sorted b... |
from webserver import db
from webserver import models
from webserver import query
from webserver import app
from algoliasearch.search_client import SearchClient
import graphene
import graphene.relay
from pprint import pprint
import json
'''
Fields that will be forwarded to algolia
Note you can use __ to go into embe... |
'''
Script: Your Name Your Workout (v0.2)
Author: @zeroyaw (Yaw Asare)
Date: 4-17-2020
Purpose/background: I came across an IG post where you use the letters of your name to create a workout. I thought this would be great to make into a script
'''
####### Defining the functions
# Function to show the user what this ... |
class Solution:
def arraysIntersection(self, arr1, arr2, arr3):
set1 = set(arr1)
set2 = set(arr2)
set3 = set(arr3)
ans = set1.intersection(set2, set3)
return sorted(list(ans))
|
# On purpose raise ImportError
from django import NonExistingClass
class ImportErrorClass(NonExistingClass):
pass
|
from itertools import *
for i in repeat('over-and-over', 5):
print(i)
|
def divide(x, y):
return x / y
def multiply(x, y):
return x * y
def subtract(x, y):
return x - y
def add(x, y):
return x + y
def power(x, y):
return x ^ y
|
try:
import openeye
except Exception as e:
print(e)
print('Warning: Cannot import openeye toolkit; not all functionality will be available.')
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
#from . import typing
#from . import topology
#from . import utils
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.