text stringlengths 2 999k |
|---|
from cvpods.layers import ShapeSpec
from cvpods.modeling.backbone import Backbone
from cvpods.modeling.backbone.fpn import build_retinanet_resnet_fpn_backbone
from cvpods.modeling.anchor_generator import ShiftGenerator
from ..auto_assign import AutoAssign
def build_backbone(cfg, input_shape=None):
"""
Build ... |
'PolyPolyline example based on pyWinGUI (Maxim Kolosov)'
from random import seed, randint
from pywingui import gdi
from pywingui.wtl import *
from pywingui.winuser import *
from pywingui.version_microsoft import WINVER
class main_window(Window):
_window_title_ = __doc__
_window_background_ = gdi.GetStockObject(gdi... |
import numpy as np
import argparse
import os
import tensorflow as tf
import sys
import gzip
import struct
from utils import prepare_data
from amlrun import get_AMLRun
# ## Download MNIST dataset
# In order to train on the MNIST dataset we will first need to download
X_train, X_test, y_train, y_test = prepare_data('m... |
# TODO: implement __init__.py |
import numpy as np
from pathlib import PosixPath
import os
import subprocess
import logging
log = logging.getLogger(__name__)
def draw_ratio_with_line(ax, data, mc_sum, mc_err, yline=1.0, autoxscale=True):
""" draw the ratio with a horizontal line on the axis """
x1 = data.bins[0]
x2 = data.bins[-1]
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 eBay Inc.
# Copyright (c) 2013 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... |
from django.http import HttpResponse
from ci_cd.models import ci_cd_info
def ci_cd_info(request):
return HttpResponse(info.objects.get(status=request.GET["status"])) |
class Solution:
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
construct a sliding window, where the left boundary
is the index of the latest unseen char.
"""
index_dict = {}
start = 0
max_size = 0
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Program: diffusionEq1D_BackwardEuler
Created: Aug 2020
@author: Ryan Clement (RRCC)
scisoft@outlook.com
Purpose: Solve the
u_t = alpha * u_xx
on the interval (0,L) with boundary conditions
u = 10 for x = 0
and
... |
# Generated by Django 3.2.8 on 2021-10-30 17:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('expenses', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='category',
options={'verbose_name_plural': ... |
import typing
def main() -> typing.NoReturn:
a = int(input())
b = int(input())
sep = '5' if b & 1 else '0'
n = ('' if b == 1 else str(b // 2)) + sep + str(a)
print(n)
main()
|
#!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import hid_constants
import usb_descriptors
class DescriptorWithField(usb_descriptors.Descriptor):
pass
DescriptorWit... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
import sys
from xml.sax.saxutils import escape
from lxml import html
import codecs
import readline
from clint.arguments import Args
import signal
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.... |
from __future__ import absolute_import
from __future__ import print_function
import theano
import theano.tensor as T
import numpy as np
from . import optimizers
from . import objectives
from . import regularizers
from . import constraints
import time, copy
from .utils.generic_utils import Progbar
from six.moves import... |
# Copyright (c) 2020 Kwot Sin Lee
# This code is licensed under MIT license
# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)
# ------------------------------------------------------------------------------
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-202... |
"""
WSGI config for quizz project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... |
# ========================================================================================================= #
# Miscellaneous functions used for various computations.
# Author : Edward Lee, edlee@santafe.edu
#
# MIT License
#
# Copyright (c) 2020 Edward D. Lee, Bryan C. Daniels
#
# Permission is hereby granted, free ... |
import logging
import os
from dvc.config import Config
from dvc.exceptions import InitError
from dvc.main import main
from dvc.repo import Repo as DvcRepo
from tests.basic_env import TestDir, TestGit
class TestInit(TestGit):
def _test_init(self):
self.assertTrue(os.path.exists(DvcRepo.DVC_DIR))
s... |
# 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 (autorest: 3.0.... |
# globals.py (facilitymatcher)
# !/usr/bin/env python3
# coding=utf-8
"""
Supporting variables and functions used in facilitymatcher
"""
import zipfile
import io
import requests
import pandas as pd
import os
from datetime import datetime
from stewi.globals import log, set_stewi_meta, source_metadata, config
import fac... |
# Copyright 2012 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 by applicable law or agre... |
#!/usr/bin/env python3
# Copyright 2020 Stanford University, NVIDIA 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 ... |
class Solution:
def minRemoveToMakeValid(self, s: str) -> str:
pleft, pleft_pos = [], []
toDel = []
for idx, ch in enumerate(s):
if ch == '(':
pleft.append('(')
pleft_pos.append(idx)
elif ch == ')':
if len(plef... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... |
''' Perimeterator - Enumerator for AWS Elasticsearch instances. '''
import logging
import boto3
from perimeterator.helper import dns_lookup
class Enumerator(object):
''' Perimeterator - Enumerator for AWS Elasticsearch instances. '''
# Required for Boto and reporting.
SERVICE = 'es'
def __init__(se... |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class footsteps(object):
__slots__ = ["xpos", "ypos", "zpos"]
__typenames__ = ["float", "float", "float"]
... |
from __future__ import print_function
import numpy as np
import time
from random import shuffle
def train_deep_vess(trnL, it, corePadSize, tstL, tst, nEpoch, trn, train_step, accuracy, keep_prob, x, y_, saver, sess, WindowSize):
def get_batch(im, l, corePadSize, ID):
""" generate a batch from im and l for ... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cirq/google/api/v2/result.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from g... |
from ..Robot import Robot
from ..helpers import *
def getCubeByID(self, id : int):
"""Gets a cube object from the cozmo world using the ID provided.
Arguments:
id : An integer representing a cube ID. Can only be 1, 2, or 3.
Returns:
A light cube object from the Cozmo library.
"""
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 5 14:04:55 2017
@author: sneha
"""
import subprocess
class QuestionGenerator(object):
"""
Define a class that generates questions given an input text file
or a db connection. Currently supported db connection is mongodb.
"""
def __init__(sel... |
"""Polynomial Interpolation (Code 4)."""
import logging
import math
from .. import get_backend, default_backend
from .. import events
from . import _slow_interpolator_looper
log = logging.getLogger(__name__)
class code4(object):
r"""
The polynomial interpolation and exponential extrapolation strategy.
.... |
import shlex
from typing import Optional, List, Union
from subprocess import CalledProcessError
class GpgError(Exception):
pass
_CmdT = Union[str, List[str]]
def _format_cmd(cmd: _CmdT) -> str:
if isinstance(cmd, str):
return cmd
if not isinstance(cmd, list):
return f"{cmd}"
ret... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_2.models.job_sta... |
"""
To run this, you'll need to have installed.
* scikit-learn
Does two benchmarks
First, we fix a training set, increase the number of
samples to classify and plot number of classified samples as a
function of time.
In the second benchmark, we increase the number of dimensions of the
training set, classify a sam... |
import dash
import dash_html_components as html
import dash_table
import pandas as pd
from app import app
#### GET DATA
dfAPI = pd.read_csv("freqs_data.csv")
#### LAYOUT
layout = html.Div(
[
html.H6(children="All records"),
html.Div(
[
dash_table.DataTable(
... |
# test_component.py
"""Unit tests for lta/picker.py."""
from asyncio import Future
from unittest.mock import AsyncMock, call, MagicMock
from uuid import uuid1
import pytest # type: ignore
import requests
from tornado.web import HTTPError # type: ignore
from lta.component import patch_status_heartbeat, status_loop,... |
"""
Collect various information about Python to help debugging test failures.
"""
from __future__ import print_function
import errno
import re
import sys
import traceback
import warnings
def normalize_text(text):
if text is None:
return None
text = str(text)
text = re.sub(r'\s+', ' ', text)
re... |
# Copyright (c) 2011-2016 Godefroid Chapelle and ipdb development team
#
# This file is part of ipdb.
# Redistributable under the revised BSD license
# https://opensource.org/licenses/BSD-3-Clause
from inspect import getargspec
import os
import sys
from contextlib import contextmanager
def import_module(possible_m... |
# -*- coding: utf-8 -*-
"""
chemdataextractor.scrape.springer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tools for scraping documents from Springer, Biomed Central and Chemistry Central XML files.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from... |
"""
Verificação de CPF. Desenvolva um programa que solicite a digitação de um número de CPF no formato xxx.xxx.xxx-xx
e indique se é um número válido ou inválido através da validação dos dígitos verificadores edos caracteres de formatação.
"""
def ValidaCpf(cpf):
valido = bool(True)
if len(cpf) != 14:
... |
"""
Collect data ipinfo and send to MQTT
"""
import argparse
import json
import logging
import sys
import time
import mqtt
import ipinfo
logging.basicConfig(level=logging.INFO)
def load_config(file):
"""
Load configuration
:return:
"""
with open(file, "r", encoding="utf-8") as config_file:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **
#
# ================= #
# ANIMATION_HANDLER #
# ================= #
# Handler class for animating the robot (controlling its behaviors)
#
# @author ES
# **
import logging
class AnimationHandler(object):
def __init__(self, session):
self.logger = logging.... |
'''
@package: pyAudioLex
@author: Jim Schwoebel
@module: jjr_freq
#jjr = adjective, comparative
'''
from nltk.tokenize import word_tokenize
from nltk.tag import pos_tag, map_tag
from collections import Counter
def jjr_freq(importtext):
text=word_tokenize(importtext)
tokens=nltk.pos_tag(text)
c=Counter(t... |
''' ** Nearly Pure Python ** Implementation of the
Extreme-point BFD-Heuristic for 2D-Cutting Stock Problem:
Based on "Extreme Point-Based Heuristics for
Three-Dimensional Bin Packing" INFORMS Journal
on Computing (2008) Teodor Gabriel Crainic, Guido Perboli,
Roberto Tadei,
'''
import json
def stock_cutting(re... |
# coding=utf-8
import threading
import time
import sys
import random
from PyQt5.QtWidgets import QMainWindow, QApplication, QDesktopWidget, QLabel, QVBoxLayout
from PyQt5.QtGui import QIcon
import linecache
settingPath = "settings.wl"
text = "<h1><font color={}>{}</font></h1>"
try:
title = linecache.getline(settin... |
import struct
import sys
import os
from controller import Robot
# Adding shared library.
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(str(os.path.join(os.path.dirname(ROOT_PATH), "lib")))
from shared.types import Motor
class Dezibot(Robot):
def __init__(self):
super().__init__()
s... |
"""Identify issues that need triage."""
from code_intelligence import graphql
from code_intelligence import util
import datetime
from dateutil import parser as dateutil_parser
import fire
import json
import logging
import os
import numpy as np
import pprint
import retrying
import json
PROJECT_CARD_ID = os.getenv('INP... |
#
# 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... |
"""
Module for StreamCollection class.
This class functions as a list of StationStream objects, and enforces
various rules, such as all traces within a stream are from the same station.
"""
import re
import copy
import logging
import fnmatch
from obspy import UTCDateTime
from obspy.core.event import Origin
from obsp... |
import socket
from queue import Queue
import threading
import random
import os
import pygame
import sys
import select
import time
os.chdir("/Users/yuanzhendong/desktop/tp3")
sys.path.append("/Users/yuanzhendong/desktop/tp3")
from client.myclient import *
class Struct(object): pass
data1 = Struct()
#########... |
import argparse, sys, os
import mathutils
import numpy as np
import bpy
from math import radians
from bpy_extras.object_utils import world_to_camera_view
parser = argparse.ArgumentParser(description='Renders given obj file by rotating a camera around it.')
parser.add_argument('--obj', type=str,help='Path to the obj fi... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
# Copyright 2015 The TensorFlow Authors. 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 applica... |
from scripts.support_functions import (
LOCAL_BLOCKCHAIN_ENVIRONMENTS,
get_account,
deploy_mocks,
)
from brownie import FundMe, MockV3Aggregator, accounts, config, network
def deploy_contract():
account = get_account()
# If we are not on a local blockchain then we need to pass the actual ETH to US... |
"""Console Backend for the SR v4 Servo Board."""
from typing import List, Optional, Set, Type
from j5.backends import Backend
from j5.backends.console import Console
from j5.boards import Board
from j5.boards.sr.v4.servo_board import ServoBoard
from j5.components.servo import ServoInterface, ServoPosition
class SRV... |
import calendar
import datetime
from base64 import b16encode
import functools
from functools import partial
from cryptography import utils, x509
from cryptography.hazmat.primitives.asymmetric import (
dsa,
ec,
ed25519,
ed448,
rsa,
)
from OpenSSL._util import (
ffi as _ffi,
lib as _lib,
... |
import json
import argparse
import os
_BASE_CONFIG = {
"SimulationName": "",
"SimulationDuration": 50,
"NetworkPoint": {},
"NetworkOrder": [],
"Constellation": "Starlink"
}
def read_options():
parser = argparse.ArgumentParser(description="Generate simulation config for sector based experiment"... |
import os, sys
from pathlib import Path
import click
import yaml
def err_log(msg, *args):
if args:
msg %= args
click.echo(click.style('Error: ', fg='red', bold=True) + msg)
# Read a yaml file given a file path. Shou
def read_yml(filepath):
target_file = Path(filepath)
if target_file.is_file()... |
import os
from PIL import Image
from tqdm import tqdm
import concurrent.futures
import glob
data_train_path = "data/train"
labels = [f for f in os.listdir("data/train")]
def reshape(file_name):
img=Image.open(file_name)
img=img.resize((350, 150))
img.save(file_name)
for label in labels:
print("Reshapi... |
# from .wider_face import WiderFaceDetection, detection_collate
# from data_augment import *
# from config import *
|
import re
import ast
from setuptools import setup
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('click/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
setup(
name='click',
author='Armin Ronacher',
author_emai... |
from functools import partial
from typing import Callable
from ...config import Conf
from .menu import Menu, MenuEntry, MenuSeparator
class DisasmLabelContextMenu(Menu):
def __init__(self, disasm_view):
super().__init__("", parent=disasm_view)
self.addr: int = None
self.entries.extend([... |
from params import *
from intersectionarc import *
from calculrayoncourbure import *
#retourne (indicateur(est ce que la cible est atteignable), R (rayon de courbure choisi pour se ramener à la traj),sgyp le signe de yp pour savoir si on tourne vers dte ou gauche))
def cibleatteignablevcste(segments,p,v):
[p... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stream_alert_states.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.... |
"""Support for tracking an Audi."""
import logging
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.util import slugify
from homeassistant.components.device_tracker.config_ent... |
import math
import random
import numpy
import qConstants as qc
import qUtilities as qu
import qGates as qg
import qMeasurement as qm
import qBitStrings as qb
def bennett():
'''Runs one iteration of the core algorithm of Bennett (1992). Returns a tuple of three items --- |alpha>, |beta>, |gamma> --- each of which... |
"""Based on
https://github.com/drhagen/parsita/blob/master/examples/json.py.
"""
import timeit
from parsita import TextParsers
from parsita import lit
from parsita import reg
from parsita import rep
from parsita import repsep
class JsonStringParsers(TextParsers, whitespace=None):
quote = lit(r'\"')
reverse... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
'''
This is test file for unit test of traffic
problem code file
'''
import sys
import os
sys.path.append(os.path.dirname(__file__)+"/../")
import pytest
from src import traffic_problem_1 as tp
from src import constants
@pytest.mark.parametrize('climate, speed', \
... |
"""
Introduction to Python : Classes & Objects, Functions
Write a python class to reverse a sentence (initialized via constructor) word by word.
That is: “I am here” should be reversed as “here am I”. Create instances of this class
for each of the three strings input by the user and display the reversed string for each... |
import streamlit as st
import location_api as loc
from location_map_component.location_map import location_map
# Cognito pool ID
# Learn how to create your own ID here
# https://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html
_IDENTITY = "replace-with-your-cognito-identity-pool-id"
st.header('Am... |
import nltk
import re
from nltk.corpus import brown
from nltk import word_tokenize
from collections import Counter, defaultdict
WORD = 0
TAG = 1
UNKNOWN_TAG = 'NN'
COUNT_CUTOFF = 5
# load new categry
news_sents = brown.tagged_sents(categories='news')
# divide to sets
set_size = round(len(news_sents) * 0.9)
train_set... |
# Define authentication modules
from django.contrib.auth.models import User, Group
# Define rest framework modules
from rest_framework import serializers
# Define serializer for user
# NOTE HyperlinkedModelSerializer handles resources retrievable from an endpoint
class UserSerializer(serializers.HyperlinkedModelSeria... |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
"""Module to test the covid data handler module functions"""
import sched
import time
import logging
from covid_data_handler import local_infection, national_local_api_request, parse_csv_data
from covid_data_handler import process_covid_csv_data
from covid_data_handler import covid_API_request
from covid_data_handler i... |
from abc import ABCMeta, abstractmethod
import torch
import torch.nn as nn
from evrepr.utils.logger import setup_logger
class EventRepresentation(nn.Module, metaclass=ABCMeta):
"""
Abstract base class for event representations.
"""
def __init__(self, cfg, input_is_torch=False):
super().__i... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
# 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... |
def eqindexMultiPass(s):
return [i for i in range(len(s)) if sum(s[:i]) == sum(s[i+1:])]
print(eqindexMultiPass([-7, 1, 5, 2, -4, 3, 0]))
|
"""
exceptions.py
Custom exceptions for the pre-proc module
"""
import os
__all__ = ['PreProcError', 'CannotLoadSourceFileError',
'AttributeNotFoundError', 'AttributeConversionError',
'ExistingAttributeError', 'InstanceVariableNotDefinedError',
'CdoError', 'NcattedError', 'NcpdqError'... |
from django.contrib.auth.decorators import login_required
from django.urls import path
from . import views
app_name = "edd.load"
urlpatterns = [
path("", login_required(views.ImportTableView.as_view()), name="table"),
path("wizard/", login_required(views.ImportView.as_view()), name="wizard"),
]
|
"""
WSGI config for qweb project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS... |
#!/usr/bin/python3
# ------------------------------------------------------------------
#
# Suite for testing correctness of .data file structure
#
# ------------------------------------------------------------------
# Conditions for .data file to have a correct structure
#
# 1) Number of atoms is on line 3
# ... |
"""
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from argocd_python_client.api_client import ApiClient, Endpoint as _Endpoint
from arg... |
from __future__ import annotations
from dataclasses import dataclass, field, fields
from datetime import date, datetime
from enum import Enum
from inspect import getmembers
from typing import Any, Dict, List, Optional
from uuid import UUID
import ujson
class BaseEnum(str, Enum):
def _generate_next_value_(name, ... |
"""
This module determines finite difference coefficients for uniform and
non-uniform grids for any desired accuracy order.
"""
import math
import numpy as np
def coefficients(deriv, acc):
"""
Calculates the finite difference coefficients for given derivative order and accuracy order.
Assumes that the un... |
import numpy as np
import matplotlib.pyplot as plt
import mglearn
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
import warnings
warnings.filterwarnings("ignore", category=Warning)
X, y = mglearn.datasets.make_forge()
X_train, X_test, y_train, y_test = train_t... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Sikacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fr... |
import lasagne as nn
import theano.tensor as T
import numpy as np
from lasagne import nonlinearities
from lasagne.layers.dnn import Conv2DDNNLayer
def lb_softplus(lb=1):
return lambda x: nn.nonlinearities.softplus(x) + lb
def heaviside(x):
return T.arange(0, 600).dimshuffle('x', 0) - T.repeat(x,... |
# Copyright 2013 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 by applicable law or agre... |
# -*- coding: utf-8 -*-
#############################################################################
#
# Copyright © Dragon Dollar Limited
# contact: contact@dragondollar.com
#
# This software is a collection of webservices designed to provide a secure
# and scalable framework to build e-commerce websites.
#
# This s... |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... |
import logging
from typing import Dict, List, Optional, Tuple
import aiosqlite
from bytecash.consensus.block_record import BlockRecord
from bytecash.types.blockchain_format.sized_bytes import bytes32
from bytecash.types.full_block import FullBlock
from bytecash.types.weight_proof import SubEpochChallengeSegment, SubE... |
import pandas
import logging
import json
logging.basicConfig(level=logging.INFO)
df = {}
output_csv = {}
drop = True
def initialize():
global output_csv, df
with open('config.json', 'r') as f:
config = json.load(f)
feature_file = config['FeaturesetFile']
filename = config['InputFile']
ou... |
#!/usr/bin/env python
import os
from systori import settings
settings.INSTALLED_APPS = [a for a in settings.INSTALLED_APPS if a != "debug_toolbar"]
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings.travis")
import django
django.setup()
import unittest
from django.core.management import call_command
f... |
#-*-coding:UTF-8-*-
import torch.nn as nn
from models.morn import MORN
from models.asrn_res import ASRN
class MORAN(nn.Module):
# MORAN = MORAN(nc, nclass, opt.nh, opt.targetH, opt.targetW, BidirDecoder=opt.BidirDecoder, CUDA=opt.cuda)
def __init__(self, nc, nclass, nh, targetH, targetW, BidirDecoder=False,
... |
from datetime import datetime, timedelta
from tapiriik.database import db
from tapiriik.settings import PAYMENT_AMOUNT, PAYMENT_SYNC_DAYS
from bson.objectid import ObjectId
class Payments:
def LogPayment(id, amount, initialAssociatedAccount, email):
# pro-rate their expiry date
expires_in_days = mi... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from typing import Iterator, Tuple, Li... |
# coding: utf-8
"""
LUSID API
# Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages : * [C#](https://gith... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.