text stringlengths 1 927k |
|---|
class Point3D(object):
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __repr__(self):
return "(" + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + ")"
my_point = Point3D(1,2,3)
print my_point |
import dataclasses
from typing import Optional
from .base_entity import BaseEntity
@dataclasses.dataclass
class CallbackEntity(BaseEntity):
uuid: Optional[str] # or request_code
callback_url: Optional[str]
state: Optional[str]
def __init__(self, data: dict):
self.uuid = data.get('uuid')
... |
import logging
logger = logging.getLogger(__name__)
from abc import abstractmethod, ABCMeta
import game
from gcc_utils import deep_unmarshal, lto_to_cons, is_cons, cons_to_list, cons_to_mat
class InterpreterException(Exception):
pass
class GCCInterface(object):
__metaclass__ = ABCMeta
@abstractmethod... |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
import argparse
from utils.helpers import boolean_argument
def get_args(rest_args):
parser = argparse.ArgumentParser()
# --- GENERAL ---
parser.add_argument('--num_frames', type=int, default=1e8, help='number of frames to train')
parser.add_argument('--max_rollouts_per_task', type=int, default=1, h... |
"""
Apply value ranges to ensure that values are reasonable and to minimize the likelihood
of sensitive information (like phone numbers) within the free text fields.
Original Issues: DC-1058, DC-1061, DC-827, DC-502, DC-487
The intent is to ensure that numeric free-text fields that are not manipulated by de-id
have v... |
# -*- coding: utf-8 -*-
# Copyright 2015 Fanficdownloader team, 2019 FanFicFare team
#
# 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
#
# Un... |
# -*- coding: utf-8 -*-
from odoo import models, fields
from odoo.addons import decimal_precision as dp
class LibraryBook(models.Model):
_name = 'library.book'
_description = 'Library Book'
_order = 'date_release desc, name'
name = fields.Char('Title', required=True, index=True)
short_name = fie... |
# This Class handles and contain every command.
# last edit: 20.02.2019 (callFEELD)
# imports
import discord
# own imports
from src.classes.Essentials import LogBotEssentials, tosteamid3, totime, LogPlayerSearch, LogIDdetails, get_closest_demo, PerformanceDisplay
from src.classes.Users import LogBotUsers
from src.cla... |
import copyreg
# Undo what Twisted's perspective broker adds to pickle register
# to prevent bugs like Twisted#7989 while serializing requests
import twisted.persisted.styles # NOQA
# Remove only entries with twisted serializers for non-twisted types.
for k, v in frozenset(copyreg.dispatch_table.items()):
if not... |
import codecs
from collections import defaultdict
import torch
from allennlp.common import Params
from allennlp.data import Vocabulary
from allennlp.modules.token_embedders.token_embedder import TokenEmbedder
@TokenEmbedder.register("sentence_embedding")
class SentenceEmbedding(TokenEmbedder):
"""
Embedd... |
# -*- coding: utf-8 -*-
# ! /usr/bin/env python
""" `medigan` is a modular Python library for automating synthetic dataset generation.
.. codeauthor:: Richard Osuala <richard.osuala@gmail.com>
.. codeauthor:: Noussair Lazrak <lazrak.noussair@gmail.com>
"""
# Set default logging handler to avoid "No handler found" warn... |
#
# Collective Knowledge (check program output)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (tem... |
#/*
# * Copyright (c) 2020 Xilinx Inc. All rights reserved.
# *
# * Author:
# * Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
# *
# * SPDX-License-Identifier: BSD-3-Clause
# */
import struct
import sys
import types
import unittest
import os
import getopt
import re
import subprocess
import shutil
fro... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 24 22:11:12 2014
@author: spatchcock
"""
import math
import numpy
import matplotlib.pyplot as plt
# Plot the normal distribution function as well as its first and second derivatives
#
# Use the numpy.vectorize function to handle array manupulation
# http://statistics.... |
import logging
import gurobipy as gp
from gurobipy import GRB
from core.solver.impl.gurobi_interface import GurobiFilter
from event_activity_network import PeriodicEventActivityNetwork
from helper import Parameters
logger_ = logging.getLogger(__name__)
# workaround to avoid double logging output
grbfilter = Gurob... |
"""Fixtures."""
import pytest
from library import config
from library.facades import seed
@pytest.fixture
def default_seed():
"""Set the default seed."""
name = config.get_env().default_seed_name
value = "value 1"
seed.get_seed().set(name=name, value=value)
yield name, value
seed.get_seed()... |
"""
A library of expressions that can be composed of existing expressions.
"""
from .udf import Function
import raco.expression
from raco.expression import *
def is_defined(function_name):
return function_name.lower() in EXPRESSIONS
def lookup(function_name, num_args):
func = EXPRESSIONS.get(function_name.... |
# coding: UTF-8
# Copyright 2012 Keita Kita
#
# 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... |
import shutil
import tempfile
import zlib
from mediaman.middleware import abstract
class CompressionMiddlewareService(abstract.SimpleMiddleware):
def compress(self, file_path):
tempfile_ref = tempfile.NamedTemporaryFile(mode="wb+")
with open(file_path, "rb") as infile:
tempfile_ref.w... |
# django
from django.urls import path
# views
from ..views.users import (About, Comment, Bookmark, UserContent)
from ..views.utopic import (UserTopic)
urlpatterns = [
path('u/@<username>/about/', About.as_view(), name="userabout"),
path('@<username>/', UserTopic.as_view(), name="user"),
path('u/@<username... |
# Copyright 2022 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... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
# @generated
#
from __future__ import absolute_import
import six
import sys
from nebula2.fbthrift.util.Recursive import fix_spec
from nebula2.fbthrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProces... |
# Copyright (c) 2020 PaddlePaddle 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
#
# Un... |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... |
from dbconn import Session, Departments, Employees
# 1. 创建一个会话实例
session = Session()
#################################
# 查询数据库,返回实体类的实例
# qset1 = session.query(Departments)
# print(qset1) # 此时只是一条SQL语句,不真正连接数据库
# print(list(qset1)) # 取值的时候,才会连接数据库
# for dep in qset1:
# print('部门ID: %s, 部门名称: %s' % (dep.dep_id, ... |
import os
# Generates a basic loot table entry for every essentials blocks with a defined blockstate file,
# where the blocks drops itself
blockstates = os.listdir("../../../../../resources/assets/essentials/blockstates/")
regNames = [os.path.basename(bstate) for bstate in blockstates]
loottablePath = "../../../../.... |
# Exploratory data analysis
# py 3, using "mplace" conda env.
import numpy as np
import pandas as pd
import pickle, itertools, os
from matplotlib import pyplot as plt
import seaborn as sns
from yahoofinancials import YahooFinancials as YF
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing impo... |
# -*- coding: utf-8 -*-
#
# vim: expandtab shiftwidth=4 softtabstop=4
#
"""ownCloud client module
Makes it possible to access files on a remote ownCloud instance,
share them or access application attributes.
"""
import datetime
import time
import requests
import xml.etree.ElementTree as ET
import os
import math
impor... |
#!/usr/bin/env python
import numpy as np
import rospy
import matplotlib
matplotlib.use('Qt5Agg')
from matplotlib import pyplot as plt
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import TwistStamped
from sensor_msgs.msg import Image
from styx_msgs.msg import TrafficLightArray, TrafficLight
from st... |
import unittest
from tests import TestClient
from procountor.client import Client
class TestClientClient(TestClient):
def __init__(self, *args, **kwargs):
super(TestClientClient, self).__init__(*args, **kwargs)
def test_0001_init(self):
""" Testing that client has required params """
... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Title : PySMuRF StreamDataEmulator
#-----------------------------------------------------------------------------
# File : _StreamDataEmulatorI32.py
# Created : 2019-10-29
#------------------------------... |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ticklen", parent_name="bar.marker.colorbar", **kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
parent_na... |
##############################################################################
#
# Copyright (c) 2006-2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 25 18:00:44 2019
@author: franchesoni
"""
import os
import numpy as np
from functions import evaluate
'''Evaluate the performance of orders over the places in vectors and save
the predictions, the orders, and the RMSDs'''
orders = [(1, 0), ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 20:12:58 2020
@author: ninjaac
"""
#############using the formate function
def print_full_name(a, b):
print("Hello {a} {b} ! You just delved into python.")
if __name__ == '__main__':
first_name = input()
last_name = input()
print_full_name(first_name,... |
'''
File to store special mathematical constants supported by the program
'''
import math
CONSTANTS = {
"e":math.e,
"pi":math.pi
}
def add_constant(name, value):
CONSTANTS[name] = value |
from __future__ import annotations
import os.path
import re
import re_assert
import before_commit.constants as C
from before_commit import git
from before_commit.commands.install_uninstall import _hook_types
from before_commit.commands.install_uninstall import CURRENT_HASH
from before_commit.commands.install_uninsta... |
"""
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
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, m... |
from setuptools import setup
from os import sep
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
version='1.3',
description='Scraping images from the web.',
author='Eri... |
class Animal(object):
pass
class Duck(Animal):
pass
class Snake(Animal):
pass
class Platypus(Animal):
pass
def can_quack(animal):
if isinstance(animal, Duck):
return True
elif isinstance(animal, Snake):
return False
else:
raise RuntimeError('Unknown animal!')
... |
# Generated by Django 2.2.6 on 2019-11-06 03:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('questions', '0005_auto_20191103_1957'),
]
operations = [
migrations.CreateModel(
name='Document... |
from _wagyu import Point
from hypothesis import given
from wagyu.hints import Coordinate
from . import strategies
@given(strategies.coordinates, strategies.coordinates)
def test_basic(x: Coordinate, y: Coordinate) -> None:
result = Point(x, y)
assert result.x == x
assert result.y == y |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020 Colin Curtain
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, mer... |
"""Auto-generated file, do not edit by hand. GI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GI = PhoneMetadata(id='GI', country_code=350, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2568]\\d{7}', possible_number_pattern='... |
import os
import torch
import torch.nn as nn
import torch.utils.data as Data
import torchvision
EPOCH = 1
BATCH_SIZE = 50
LR = 0.001
DOWNLOAD_MNIST = False
if not(os.path.exists('./mnist/')) or not os.listdir('./mnist/'):
DOWNLOAD_MNIST = True
train_data = torchvision.datasets.MNIST(
root='./mnist/',
... |
TITLE = "Computer Tomograph Simulation"
ABOUT = "# This is a header. This is an *extremely* cool app!"
AUTHORS = """
<h3 style='text-align: left; color: grey;'>Authors:</h3>
<h4 style='text-align: left; color: grey;'>Mateusz Frąckowiak 145264</h4>
<h4 style='text-align: left; color: grey;'>Kamil Niżnik 14... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 3 10:08:38 2021
@author: woojae-macbook13
"""
from gurobipy import *
try:
m = Model("mip1")
Z = LinExpr()
A = m.addVar(vtype=GRB.CONTINUOUS, name='A')
C = m.addVar(vtype=GRB.CONTINUOUS, name='C')
Z = 20*A + 30*C
c0 =... |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.serializers import serialize
from sentry.api.bases import OrganizationEndpoint
from sentry.discover.models import DiscoverSavedQuery
from sentry import features
from sentry.discover.endpoints.bases import DiscoverSaved... |
import pandas as pd
import pysam
import argparse
def parse_args():
parser=argparse.ArgumentParser(description="get gc content from a bed file")
parser.add_argument("--input_bed")
parser.add_argument("--ref_fasta")
parser.add_argument("--split_chroms",action="store_true",default=False)
parser.add_arg... |
from django.db.models import Q
from django.core.serializers import serialize
from django.shortcuts import render
from django.template.loader import get_template
from django.utils.encoding import uri_to_iri
from django.urls import reverse, get_script_prefix
from rest_framework.views import APIView
from rest_framework.p... |
"""Deals with the attributes (variable parameters) of genes"""
from neat.random import choice, gauss, random, uniform
from neat.config import ConfigParameter
# TODO: There is probably a lot of room for simplification of these classes using metaprogramming.
class BaseAttribute(object):
"""Superclass for the type... |
class SupervisedModel:
def train(self, x, y):
raise NotImplementedError
def predict(self, x):
raise NotImplementedError
def predict_classes(self, x):
raise NotImplementedError
def save(self, path):
raise NotImplementedError
def load(self, path):
raise ... |
# coding=utf-8
# Copyright 2020 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... |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2021/5/9 16:16
Desc: 浙江省排污权交易指数
https://zs.zjpwq.net/
"""
import requests
import pandas as pd
def index_eri() -> pd.DataFrame:
"""
浙江省排污权交易指数
https://zs.zjpwq.net
:return: 浙江省排污权交易指数
:rtype: pandas.DataFrame
"""
url = "https://zs.zjpwq... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 14:43:24 2019
@author: omerali
"""
import numpy as np
import os, shutil
from pathlib import Path
from time import gmtime, strftime
import json
from glob import glob
import warnings
warnings.filterwarnings("ignore")
from distutils.dir_util import... |
# 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, software
# distributed under th... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/hair/human/shared_hair_human_female_s02.iff"
result.attribute_templ... |
# -*- coding: utf-8 -*-
#
# conda-forge documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 1 01:44:13 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... |
# -*- coding: utf-8 -*-
"""
shellstreaming.util.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:synopsis: Reports HW resource info
"""
# standard modules
import time
# 3rd party moduels
import psutil
_cpu_percent_called = False
def avail_cores():
"""Return number of available cores on the node"""
# Sin... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Forms'
db.create_table(u'cmsplugin_forms_builder_forms', ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 Licens... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-05-27 08:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0174_auto_20190524_1209'),
]
operations = [
migration... |
# 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 use ... |
#! python
# ===============LICENSE_START=======================================================
# metadata-flatten-extractor Apache-2.0
# ===================================================================================
# Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
# =====================... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import fnmatch
import os
from sys import version_info
from re import match
from subprocess import PIPE
from subprocess import Popen
import sublime
import sublime_plugin
if version_info[0] == 2:
# st-v2x with py... |
'''
ARQUIVO PARA IMPORTAR OS AMBIENTES DOS SERVIDORES
OSB: COLOCAR A LISTA DE SERVIDORES (XLSX) COM OS CAMPOS [SIAPE - AMBIENTE - SETOR EXERCÍCIO]
'''
import os
import pandas as pd
from SQL import sqlexecute
from MENSAGEM import mensagemErro, mensagemInformacao
def importarAmbienteServidores():
'''
FUNÇÃO IM... |
import copy
from dataclasses import asdict
from erica.domain.ElsterXml.common.basic_xml_data_representation import EXml
class CustomDictParser(dict):
"""
Parse the given object to a dict structure that xmltodict will interpret correctly.
Attributes starting with "xml_attr_" will be interpreted as XML att... |
"""added branch name
Revision ID: d5b5eb2e8dd0
Revises: 69a7e464fef3
Create Date: 2021-03-03 21:30:29.597634
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
from sqlalchemy.sql import column, table
revision = 'd5b5eb2e8dd0'
down_revision = '69a7e464fef3'
branch_labels = N... |
#######################################################################
#
# Example of how to set Excel worksheet tab colors using Python
# and the XlsxWriter module.
#
# Copyright 2013-2019, John McNamara, jmcnamara@cpan.org
#
import xlsxwriter
workbook = xlsxwriter.Workbook('tab_colors.xlsx')
# Set up some workshee... |
import re
from dnload.glsl_block import GlslBlock
########################################
# GlslBlock ############################
########################################
class GlslBlockPreprocessor(GlslBlock):
"""Preprocessor block."""
def __init__(self, source):
"""Constructor."""
GlslBl... |
assert ENCRYPTION_KEY.islower() |
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# 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, m... |
from setuptools import setup
setup(
name='simple',
packages=['simple'],
include_package_data=True,
zip_safe=False,
install_requires=[
'flask',
],
) |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscrip... |
from ._mpl import * |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
def test():
"""
Verify that empty messages are handled correctly
"""
# get the journal
import journal
# make a channel
channel = journal.firewall(nam... |
#!/usr/bin/env python3
def solve():
'''For example, given the following spreadsheet:
5 1 9 5
7 5 3
2 4 6 8
The first row's largest and smallest values are 9 and 1, and their difference is 8.
The second row's largest and smallest values are 7 and 3, and their difference is 4.
The third row's... |
import nose
import idiot
import datetime
import time
def setup():
idiot.init()
def teardown():
pass
def test_snooze_intervals():
p = idiot.CheckPlugin()
assert p.snooze_intervals == idiot.config.snooze_intervals
class TestPlugin(idiot.CheckPlugin):
snooze_intervals = [1, 2, 3, 4]
... |
"""Stopping criterion based on the relative change of the successive integral estimators."""
import numpy as np
from probnum.quad.solvers.bq_state import BQState
from probnum.quad.solvers.stopping_criteria import BQStoppingCriterion
from probnum.typing import FloatArgType
# pylint: disable=too-few-public-methods
c... |
"""
Tests to confirm all required dependencies are
installed and loaded.
"""
# What do we import to unit test?
# class TestDependencies() |
"""
Functionality to read and write the Newick serialization format for trees.
.. seealso:: https://en.wikipedia.org/wiki/Newick_format
"""
import re
import pathlib
__version__ = "1.3.3.dev0"
RESERVED_PUNCTUATION = ':;,()'
COMMENT = re.compile(r'\[[^]]*]')
def length_parser(x):
return float(x or 0.0)
def len... |
# -*- 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 tensorflow as tf
import torch
import yalp
class BasicModel:
def __init__(self, is_sequential=True):
self.is_sequential = is_sequential
self.backend = yalp.backend
def dispatch(self):
return self._model()
def _model(self):
if self.backend == 'tf':
if s... |
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklable (module imports are okay... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import tensorflow as tf
import numpy as np
from dace.frontend.tensorflow import TFSession
import matplotlib.pyplot as plt
import sys
def data_input_fn(filenames, batch_size=2, shuffle=False):
def _parser(record):
features = {
... |
# Author: Tomas Hodan (hodantom@cmp.felk.cvut.cz)
# Center for Machine Perception, Czech Technical University in Prague
"""A Python based renderer."""
import os
import numpy as np
from glumpy import app, gloo, gl
from bop_toolkit_lib import inout
from bop_toolkit_lib import misc
from bop_toolkit_lib import renderer
... |
from app import app
app.run(host='0.0.0.0') |
#!/usr/bin/env python
# Copyright (C) 2012-2013, The CyanogenMod Project
# (C) 2017-2018,2020-2021, The LineageOS Project
#
# 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
#
# ht... |
from absl import logging
import tornado.ioloop
from tornado import queues
import tornado.web
from icubam.db import sqlite
from icubam.messaging import sms_sender
from icubam.messaging import scheduler
from icubam.www import token
class MessageServer:
"""Sends and schedule SMS."""
def __init__(self, config, port=... |
import logging
from brownie import web3 as w3
from eth_utils import encode_hex
from eth_utils import function_signature_to_4byte_selector as fourbyte
from requests import Session
from requests.adapters import HTTPAdapter
from web3 import HTTPProvider
from web3.middleware import filter
from yearn.cache import memory
... |
import typing
from django.db import models
from drf_spectacular.drainage import warn
from drf_spectacular.extensions import OpenApiFilterExtension
from drf_spectacular.plumbing import (
build_array_type, build_basic_type, build_parameter_type, follow_field_source, get_view_model,
is_basic_type,
)
from drf_spe... |
# MIT LICENSE
#
# Copyright 1997 - 2020 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,... |
from __future__ import unicode_literals
from moto.core.exceptions import RESTError
ERROR_WITH_BUCKET_NAME = """{% extends 'single_error' %}
{% block extra %}<BucketName>{{ bucket }}</BucketName>{% endblock %}
"""
ERROR_WITH_KEY_NAME = """{% extends 'single_error' %}
{% block extra %}<KeyName>{{ key_name }}</KeyName>... |
#!/usr/bin/env python3
#
# author: dec 2020
# cassio batista - https://cassota.gitlab.io
#
# sponsored by MidiaClip (Salvador - BA)
import sys
import os
import shutil
import glob
import argparse
import logging
from collections import OrderedDict
import torch
import numpy as np
from pyannote.pipeline.blocks.clusteri... |
"""Derive the license information and publish in docs."""
import functools
import json
import pathlib
import pkg_resources
import string
import subprocess # nosec
from typing import List, Tuple
__all__ = ['dependency_tree_console_text', 'direct_dependencies_table', 'indirect_dependencies_table']
ENCODING = 'utf-8'
T... |
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
from datadog_api_client.v1.model_uti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.