text stringlengths 2 999k |
|---|
"""
Inference algorithms and utilities used in the RSA example models.
Adapted from: http://dippl.org/chapters/03-enumeration.html
"""
from __future__ import absolute_import, division, print_function
import collections
import six
import torch
from six.moves import queue
import pyro
import pyro.distributions as dis... |
#############################################################################
# Copyright (C) 2020-2021 German Aerospace Center (DLR-SC)
#
# Authors:
#
# Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... |
from io import open
from setuptools import find_packages, setup
with open('requirements.txt') as fp:
install_requires = fp.read()
setup(
name='dinglehopper',
author='Mike Gerber, The QURATOR SPK Team',
author_email='mike.gerber@sbb.spk-berlin.de, qurator@sbb.spk-berlin.de',
description='The OCR ev... |
# Generated by Django 3.2.3 on 2021-05-21 01:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ideathon', '0008_alter_comment_content'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='conten... |
from typing import List
from .collection import Collection
from .scope import Scope
from .trace import Trace
from .point import Point
class Envelope(Collection):
def __init__(self,
scope: Scope = None,
points: List[Point] = [],
traces: List[Trace] = []) -> None:
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops i... |
import numpy as np
from pygomoku.Board import Board
from pygomoku import Player
def change_color(color):
if color == Board.kPlayerBlack:
return Board.kPlayerWhite
elif color == Board.kPlayerWhite:
return Board.kPlayerBlack
else:
return color
class GameServer(object):
"""The ser... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .client import Client # noqa
from .exceptions import ( # noqa
HTTPError,
BadRequestsError,
UnauthorizedError,
ForbiddenErro... |
'''
Copyright (c) 2015, Harsh Bhatia (bhatia4@llnl.gov)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions a... |
'''
pluginPackages test case
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
def foo():
print ("imported unpackaged plug-in child 1")
__pluginInfo__ = {
'name': 'Unpackaged Listed Import Child 1',
'version': '0.9',
'description': "This is a unpackaged child plugin.",
'license': '... |
import setuptools
import os
def read(path):
with open(path, 'r') as fhandle:
return fhandle.read()
requirements = read(os.path.join(os.path.dirname(__file__), "requirements.txt"))
dev_reqs = read(os.path.join(os.path.dirname(__file__), 'requirements-dev.txt'))
extras_require = {"test": dev_reqs, "dev": de... |
#! /usr/bin/env python
import os, sys, time
# usage: memory.log memory_index.log
lines = open(sys.argv[1], 'rb').readlines()
index = open(sys.argv[2], 'rb').readlines()
# logfile format:
# #<allocation-point> <time(ms)> <key ('A' | 'F')> <address> <size> <total-size> <total-space-time> <peak-total-size>
# example:
#... |
#!/afs/bx.psu.edu/project/pythons/linux-x86_64-ucs4/bin/python2.7
"""
Read data in UCSC wiggle format and write it to an "array tree" file.
usage: %prog array_length output.array_tree < input.wig
"""
from __future__ import division
import sys
from bx.arrays.array_tree import *
from bx.arrays.wiggle import WiggleRe... |
# ActivitySim
# See full license in LICENSE.txt.
import logging
import pandas as pd
import numpy as np
from activitysim.core import simulate
from activitysim.core import tracing
from activitysim.core import pipeline
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import t... |
from django.apps import AppConfig
class OfficebeerConfig(AppConfig):
name = "officeBeer"
|
import os
import sys
import traceback
from _pydev_bundle import _pydev_imports_tipper
from _pydev_bundle._pydev_calltip_util import get_description
from _pydev_bundle.pydev_imports import _queue, Exec
from _pydev_imps._pydev_saved_modules import thread
from _pydevd_bundle import pydevd_thrift
from _pydevd_bundle impor... |
from d3m import index
from d3m.metadata.base import ArgumentType
from d3m.metadata.pipeline import Pipeline, PrimitiveStep
from d3m.metadata import hyperparams
# -> dataset_to_dataframe -> column_parser -> extract_columns_by_semantic_types(attributes) -> imputer -> random_forest
# ... |
import itertools
import pytest
from pyrdf2vec.graphs import KG, Vertex
from pyrdf2vec.rdf2vec import RDF2VecTransformer
from pyrdf2vec.walkers import ( # isort: skip
AnonymousWalker,
HALKWalker,
NGramWalker,
RandomWalker,
WalkletWalker,
WLWalker,
)
from pyrdf2vec.samplers import ( # isort: ... |
import numpy as np
import matplotlib.pyplot as pl
from shap.plots import labels
from shap.common import safe_isinstance
from . import colors
def waterfall_plot(expected_value, shap_values, features=None, feature_names=None, max_display=10, show=True):
# unwrap pandas series
if safe_isinstance(features, "... |
# -*- encoding: utf-8 -*-
# -----
# Created Date: 2021/7/16
# Author: Hanjing Wang
# -----
# Last Modified:
# Modified By:
# -----
# Copyright (c) 2020 MARL @ SJTU
# -----
import os
import ray
import copy
import pytest
import torch
import time
from malib.backend.datapool.parameter_server import (
Parameter,
P... |
from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
from selfsigned import TLSCerts
class RateLimitV0Test(AmbassadorTest):
# debug = True
target: ServiceType
def init(self):
self.target = HTTP()
def manifests(self) -> str:
return """
---
apiVers... |
import sys
import logging
from redash.utils import json_loads, json_dumps
from redash.query_runner import *
logger = logging.getLogger(__name__)
types_map = {
5: TYPE_BOOLEAN,
6: TYPE_INTEGER,
7: TYPE_FLOAT,
8: TYPE_STRING,
9: TYPE_STRING,
10: TYPE_DATE,
11: TYPE_DATETIME,
12: TYPE_DA... |
import os
os.system("python seg_rgbd_flexible.py -i ./pc12 -th 2700 -s 430 -e 1473 -o ./pc12/nxp")
os.system("python seg_rgbd_flexible.py -i ./zmq1_12 -th 2800 -s 430 -e 1451 -o ./zmq1_12/nxp")
os.system("python seg_rgbd_flexible.py -i ./zmq2_12 -th 2900 -s 430 -e 1451 -o ./zmq2_12/nxp")
os.system("python seg_rgbd_flex... |
from puma.runnable.remote_execution.remote_object_status_buffer_subscription_manager import RemoteObjectStatusBufferSubscriptionManager # noqa: F401, I100
from puma.runnable.remote_execution.remote_object_result_reference import RemoteObjectResultReference # noqa: F401, I100
from puma.runnable.remote_execution.remote... |
import sys
from PIL import ImageDraw, ImageFont, Image
def input_par():
print('Enter the text to insert in image: ')
text = str(input())
print('Enter the desired size of the text: ')
size = int(input())
print('Enter the color for the text(r, g, b): ')
color_value = [int(i) for i in input().sp... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
def root(classes):
"""get all root classnames
"""
return [c for c in classes if c.startswith("h-")]
def properties(classes):
"""get all property (p-*, u-*, e-*, dt-*) classnames
"""
return [c.partition("-")[2] for c in classes if c.startswith("p-")
or c.startswith("u-") or c.starts... |
# title :shannon_entropy.py
# description :This uses the Shannon entropy equation to estimate the
# average minimum number of bits needed to encode a
# string of symbols, based on the frequency of the symbols.
# author :Gianni Perez
# date :20170901
# ... |
import os
import pickle
import time
from collections import Counter
from typing import Callable, Dict, List, Optional, Tuple, Union
import gym
import numpy as np
import scipy.sparse as sp
from active_reward_learning.common.policy import (
BasePolicy,
CombinedPolicy,
EpsGreedyPolicy,
GaussianNoisePolic... |
from larch.io import read_athena
from glob import glob
passed = 0
for fname in sorted(glob('*.prj')):
print("### ", fname)
group = read_athena(fname)
print('read ', group, list(group.groups.keys()))
passed += 1
print(f"Read {passed:d} Athena Project files")
|
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
def _invoke_generator(ctx, proto_dep, output_dir):
direct_descriptor_set = depset([proto_dep[ProtoInfo].direct_descriptor_set])
transitive_descriptor_set = depset(transitive ... |
import os
from flask import Flask
app = Flask(__name__)
from meli_auth.views import meli_views
app.register_blueprint(meli_views, url_prefix=os.environ.get('MELI_AUTH_ROOT_URL'))
|
# Copyright 2017 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 pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
#!/usr/local/bin/python
"""
***********************************************
- PROGRAM: boundary2tad.py
- CONTACT: Bryan lajoie (bryan.lajoie@umassmed.edu)
***********************************************
"""
from __future__ import print_function
from __future__ import division
import sys
import argparse
i... |
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup
setup(
# This field lists other packages that your project depends on to run.
#... |
# Generated by Django 3.2.7 on 2021-09-24 22:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('massiliarp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='maintainablebuilding',
name='number_... |
import os
import re
import tempfile
from argparse import ArgumentParser, RawTextHelpFormatter
from typing import Any
from django.conf import settings
from django.db import connection
from django.utils.timezone import now as timezone_now
from scripts.lib.zulip_tools import parse_os_release, run, TIMESTAMP_FORMAT
from ... |
"""Provide code generation for unrolling recursive calls and iterations."""
import abc
import io
import textwrap
from typing import Sequence, List
from icontract import DBC, require
from aas_core_codegen import intermediate
from aas_core_codegen.common import Identifier, assert_never
from aas_core_codegen.csharp.comm... |
import re, logging
import numpy as np
from collections import namedtuple
from functools import reduce
import datetime
EVENT_CHANNEL = 'EDF Annotations'
log = logging.getLogger(__name__)
class EDFEndOfData(BaseException): pass
def tal(tal_str):
'''Return a list with (onset, duration, annotation) tuples for an EDF+... |
# Copyright (c) 2015 Blizzard Entertainment
#
# 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, publi... |
import pytest
from tests.helpers import check
from yatl.types import YATLEnvironmentError, YATLSyntaxError
def test_for_as_object():
test = """
.for (x in xs): .(x)
"""
expected = """
- a
- b
"""
check(test, expected, {"xs": ["a", "b"]}, {})
def test_for_as_list():
t... |
import os
import shutil
import time
import random
import numpy as np
import math
import sys
sys.path.append('../../')
from utils import *
from pytorch_classification.utils import Bar, AverageMeter
from NeuralNet import NeuralNet
import tensorflow as tf
from .OthelloNNet import OthelloNNet as onnet
args = dotdict({
... |
from elasticsearch_dsl.query import MultiMatch
from ..documents import OrderDocument, ProductDocument, UserDocument
def _search_products(phrase):
prod_query = MultiMatch(
fields=['name', 'title', 'description'],
query=phrase,
type='cross_fields')
return ProductDocument.search().query(... |
# Copyright (c) 2015-2018 The Botogram Authors (see AUTHORS)
#
# 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, mod... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import label_smoothed_cross_entropy_r3f, sentence_prediction_r3f # noqa
|
import csv
import re
from os import path
import numpy as np
FIELDNAMES = 'timeStamp', 'response_time', 'request_name', "status_code", "responseMessage", "threadName", "dataType",\
"success", "failureMessage", "bytes", "sentBytes", "grpThreads", "allThreads", "URL", "Latency",\
"IdleTime", "C... |
# Generated by Django 2.1.15 on 2019-12-30 20:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('transactional_mail', '0002_auto_20180313_2251'),
]
operations = [
migrations.CreateModel(
name='RegisteredEmailType',
field... |
import unittest
import pexpect
import re
global config
global mtfterm
class TestFTFS(unittest.TestCase):
def testsListDirectoryCommand(self):
mtfterm.sendline('ftfs-ls')
files = ["header.txt", "header.html.gz", "dostextfile.txt", "body.html.gz", "body.txt", "testecho.shtml", "footer.txt", "testvir... |
"""
molecool_mit
for mit workshop
"""
import sys
from setuptools import setup, find_packages
import versioneer
short_description = __doc__.split("\n")
# from https://github.com/pytest-dev/pytest-runner#conditional-requirement
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-run... |
import os
import shutil
import tempfile
import pytest
import globus_sdk
from tests.common import register_api_route
_IS_WINDOWS = os.name == "nt"
BASE32_ID = "u_vy2bvggsoqi6loei3oxdvc5fiu"
def _compute_confdir(homedir, alt=False):
if alt:
return os.path.join(homedir, "alt-conf-dir/lta")
if _IS_WIN... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('users:create')
TOKEN_URL = reverse('users:token')
ME_URL = reverse('users:me')
def create_user(**para... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
# Copyright The OpenTelemetry 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 ... |
import os
import pathlib
import tensorflow as tf
import tensorflow_federated as tff
AUTOTUNE = tf.data.experimental.AUTOTUNE
def make_client_ids(clients_dir: pathlib.Path):
return [p.name for p in clients_dir.iterdir() if p.is_dir()]
def provide_client_data_fn(
clients_dir: pathlib.Path,
img_height: int... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
class bit2c (Exchange):
... |
from .models import SnorkelSession
__version__ = 0.4
|
import logging
from logging.handlers import RotatingFileHandler
import contextlib
import datetime
class LogFilter(logging.Filter):
def __init__(self):
super().__init__(name="discord.state")
def filter(self, r):
if r.levelname == "WARNING" and "referencing an unknown" in r.msg:
... |
# -*- coding: utf-8 -*-
def main():
s = input()
total = 0
for si in s:
total += int(si)
if total % 9 == 0:
print('Yes')
else:
print('No')
if __name__ == '__main__':
main()
|
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Brandmand and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PartidaSIA(Document):
pass
|
import FWCore.ParameterSet.Config as cms
process = cms.Process('SIM')
# import of standard configurations
process.load("FWCore.MessageService.MessageLogger_cfi")
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('Configuration.EventConten... |
import sys
sys.path.append('../..')
import time
import watson_nlp_calls as Watson
import google_cloud_nlp_calls as GoogleCloud
import azure_nlp_calls as Azure
import aws_nlp_calls as AWS
decimalPointsTFC = 4
def makeCalls(text):
"""
Sends out entity recognition calls to all four providers using their SDKs, an... |
from base.base_model import BaseModel
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import *
from layers.utils_layers import resize_img
from losses.focal_loss import CategoricalFocalLoss
# define conv block
def conv2d(input_map, c, s, n, kernel_size=3, use_relu=True):
x = inpu... |
# 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... |
from kandinsky import *
from time import *
def run():
h=input("Unicode high byte? (0x00) ")
if len(h)==0:
h="0"
h=int(eval(h))
d=256
chmin=h*d
chmax=(h+9)*d # +10→out of memory
ch=chmin
while True:
fill_rect(0,0,320,222,"red")
for r in range(12):
for c in range(32):
p=320*(ch-c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: gbk -*-
# Date: 2019/2/20
# Created by 冰河
# Description 发现周围的蓝牙设备,并把蓝牙设备的名字和Mac地址输出到屏幕
# 博客 https://blog.csdn.net/l1028386804
from bluetooth import *
devList = discover_devices()
for device in devList:
name = str(lookup_name(device))
print "[+] Found... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... |
from flask import render_template
from . import main
@main.app_errorhandler(404)
def four_ow_four(error):
return render_template('404.html'), 404 |
from scrape_linkedin import ProfileScraper
from scrape_linkedin.utils import HEADLESS_OPTIONS
import json
from dotenv import load_dotenv
import os
load_dotenv()
LI_AT_COOKIE = os.getenv('LI_AT_COOKIE')
HEADLESS = True
if not LI_AT_COOKIE:
raise Exception("Please define the environment variable LI_AT_COOKIE conta... |
from backend.models.postgis.application import Application
from backend.models.postgis.utils import NotFound
from backend.services.users.authentication_service import AuthenticationService
class ApplicationService:
@staticmethod
def create_token(user_id: int) -> Application:
application = Application(... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... |
import pytest
from datetime import datetime
from pyecore.ecore import *
import pyecore.ecore as ecore
def test_eclass_meta_attribute_access():
assert isinstance(EClass.name, EAttribute)
assert EClass.name.eType is EString
def test_ecore_bad_names():
with pytest.raises(BadValueError):
EParameter(... |
import random
from .stan_pre_processing_functions import (
get_names, get_metabolite_dot_products,
get_area_factors, get_mixture_dot_products
)
def stan_data_preparation(mixture, metabolites):
pass
def get_zeros(metabolite_count):
zeros = []
for i in range(0, metabolite_count):
x = rand... |
from django.db import models
from apps.home.models import Profil,Session
from django.db.models.fields.related import OneToOneField,ManyToManyField
from django.db.models.deletion import CASCADE
from django.db.models.fields import CharField, DateField, IntegerField, TextField
# Create your models here.
class ClassLevels... |
# 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... |
import logging
from typing import List, Optional
import pulp
from backend.domain import (
TeamSummary,
SeattleTeamDraft,
OriginalTeamOptimization,
TeamName,
OptimizationParameters,
Player,
FigureData
)
AGE_WEIGHT_DEFAULT = 0.05
M = 2000
MIN_CAP_HIT = 48.9 # 60% of cap
MAX_CAP_HIT = 81.5 ... |
from hashlib import sha256
import base64
import json
data="""{
"instructedAmount": {"currency": "EUR", "amount": "123.50"},
"debtorAccount": {"iban": "DE40100100103307118608"},
"creditorName": "Merchant123",
"creditorAccount": {"iban": "DE02100100109307118603"},
"remittanceInformationUnstructured"... |
from src.platform.coldfusion.interfaces import CINTERFACES
from cprint import FingerPrint
class FPrint(FingerPrint):
def __init__(self):
self.platform = "coldfusion"
self.version = "9.0"
self.title = CINTERFACES.CFM
self.uri = "/CFIDE/administrator/images/loginbackground.jpg"
... |
# Test script that demonstrates the capabilities
# of the pylabeler library
from pylabeler.labeler import Labeler
import matplotlib.pyplot as plt
# Locations of images
image_folder = 'img'
image_filename = lambda ID : "%s/%s.jpg"%(image_folder, ID)
# Where to load/save the labels for each image
label_file = 'labels.... |
import os
import sys
import json
import time
import numpy as np
import tensorflow as tf
from blocks.helpers import Monitor
from blocks.helpers import visualize_samples, get_nonlinearity, int_shape, get_trainable_variables, broadcast_masks_np
from blocks.optimizers import adam_updates
import data.load_data as load_data
... |
# -*- coding: utf-8 -*-
from pygments.style import Style
from pygments.token import (
Token,
Comment,
Name,
Keyword,
Generic,
Number,
Operator,
String,
)
BASE03 = "#1c1c1c"
BASE02 = "#262626"
BASE01 = "#4e4e4e"
BASE00 = "#585858"
BASE0 = "#808080"
BASE1 = "#8a8a8a"
BASE2 = "#d7d7af"
BAS... |
import atexit
import glob
import logging
import numpy as np
import os
import subprocess
from typing import Dict, List, Optional, Any
from mlagents.envs.base_unity_environment import BaseUnityEnvironment
from mlagents.envs.timers import timed, hierarchical_timer
from .brain import AllBrainInfo, BrainInfo, BrainParamete... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2018 Contributor
#
# 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... |
from flask import Flask, request
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
api = Api(app)
app.config.from_object('config.DevelopmentConfig')
db = SQLAlchemy(app)
migrate = Migrate(app, db)
from app import routes
|
import FWCore.ParameterSet.Config as cms
from L1Trigger.L1THGCalUtilities.caloTruthCellsProducer_cfi import caloTruthCellsProducer
caloTruthCells = cms.Sequence(caloTruthCellsProducer)
if caloTruthCellsProducer.makeCellsCollection:
## cluster and tower sequence
from L1Trigger.L1THGCal.hgcalConcentratorProdu... |
import pickle
import numpy as np
import torch
from manopth.manolayer import ManoLayer
from torch import nn
class ManoAdaptor(torch.nn.Module):
def __init__(self, mano_layer, load_path=None):
super().__init__()
self.adaptor = torch.nn.Linear(778, 21, bias=False)
if load_path is not None:
... |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
# 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... |
# -*- coding: utf-8 -*-
DESC = "dcdb-2018-04-11"
INFO = {
"DescribeAccountPrivileges": {
"params": [
{
"name": "InstanceId",
"desc": "Instance ID in the format of dcdbt-ow7t8lmc."
},
{
"name": "UserName",
"desc": "Login username."
},
{
"name": ... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
#!/usr/bin/env python3
# Copyright 2021 Ben
# See LICENSE file for licensing details.
"""Charm the service."""
import logging
from ops.charm import CharmBase
from ops.main import main
from ops.framework import StoredState
from ops.model import ActiveStatus
logger = logging.getLogger(__name__)
class SnappassTestC... |
from ichnaea.api.locate.geoip import (
GeoIPPositionSource,
GeoIPRegionSource,
)
from ichnaea.api.locate.tests.base import BaseSourceTest
class SourceTest(object):
def test_no_fallback(self, london_model, geoip_db, http_session,
session, source, stats):
query = self.make_... |
import io
import os
import sys
from pathlib import Path
from convpandas.__main__ import cli
# プロジェクトトップに移動する
os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/../")
out_path = Path("./tests/out/")
out_path.mkdir(exist_ok=True, parents=True)
data_path = Path("./tests/data")
class Test_csv2xlsx:
def test_... |
# -*- coding: utf-8 -*-
import ujson
import ubinascii
import machine
from umqtt.simple import MQTTClient
with open('secrets.json') as fp:
secrets = ujson.loads(fp.read())
client = MQTTClient(
client_id='esp8266_{}'.format(
str(ubinascii.hexlify(machine.unique_id()), 'utf-8'),
),
server=secrets... |
# -*- coding: utf-8 -*-
from amazoncaptcha import AmazonCaptcha, AmazonCaptchaCollector, ContentTypeError, NotFolderError, __version__
from maliarov import webdriver
import unittest
import sys
import os
#----------------------------------------------------------------------------------------------------------... |
from dataclasses import dataclass
import pandas as pd
@dataclass
class Company:
name: str
ticker: str
cik: str
sector: str
subSector: str
industry: str
@dataclass
class Trades:
table: pd.DataFrame
company: Company
|
import torch
import torch.nn as nn
from transformers import BertModel, BertPreTrainedModel
class FCLayer(nn.Module):
def __init__(self, input_dim, output_dim, dropout_rate=0.0, use_activation=True):
super(FCLayer, self).__init__()
self.use_activation = use_activation
self.dropout = nn.Drop... |
# pylint: disable=too-many-lines
# 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) AutoRe... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
n1=int(input('digite um número: '))
n2=int(input('digite outro número: '))
s=(n1+n2)
#print('A soma entre',n1,'e',n2,'é igual a:',s,'!')
print('A soma entre {} e {} vale {}!'.format(n1,n2,s))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.