content stringlengths 5 1.05M |
|---|
"""
the module to generate C++ code
この module は C++ のコードを生成します。
以下の関数を提供します。
- :func:`read_input`
- :func:`write_output`
- :func:`declare_constants`
- :func:`formal_arguments`
- :func:`actual_arguments`
- :func:`return_type`
- :func:`return_value`
次のように利用することが想定されています。
.. code-block:: c++
#include ...
...... |
# python3
# -*- coding: utf-8 -*-
# @Time : 2021/11/15 16:49
# @Author : yzyyz
# @Email : youzyyz1384@qq.com
# @File : __init__.py.py
# @Software: PyCharm
import nonebot
from nonebot import on_command,logger
from nonebot.adapters.cqhttp import Bot,Event,MessageEvent,MessageSegment,GroupMessageEvent
from noneb... |
"""
Image Repository Option Validation.
This is to be run last after all CLI options have been processed.
"""
import click
from samcli.commands._utils.option_validator import Validator
from samcli.commands._utils.template import get_template_artifacts_format
from samcli.lib.providers.provider import (
get_resource... |
#!/usr/bin/env python3
__author___= "Maria Kechagia"
__copyright__= "Copyright 2018"
__license__= "Apache License, Version 2.0"
__email__= "m.kechagiaATtudelft.nl"
__updated__="ataupill@ualberta.ca"
import re
import os
import json
import sys
import time
from collections import defaultdict
from collections import Ord... |
#!/usr/bin/env python3
import subprocess
def create_repo(name):
subprocess.call(["gcloud", "source", "repos", "create", name])
subprocess.call(["gcloud", "source", "repos", "clone", name])
|
# -*- coding: utf_8 -*-
import numpy as np
from sklearn.base import BaseEstimator
from chainer import Variable
import chainer.functions as F
class NNmanager (BaseEstimator):
def __init__(self, model, optimizer, lossFunction, **params):
# 学習器の初期化
# ネットワークの定義
self.model = model
# オプ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of tornadis library released under the MIT license.
# See the LICENSE file for more information.
import socket
import os
import tornado.iostream
import tornado.gen
from tornado.util import errno_from_exception
from tornadis.write_buffer import WriteBu... |
# ---------------------------------------------------------------------
# Qtech.BFC_PBIC_S.get_metrics
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# NO... |
"""Dynamic class loading and object creation.
"""
# Copyright (c) 2015 University of Southampton
#
# 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 lim... |
from tkinter import *
from tkinter import ttk, messagebox
import random
# 五十音词典获取
def get_dictionary():
dictionary = {}
with open("./五十音.csv", "r") as f1:
list1 = f1.readlines()
list1.remove(list1[0])
for index in range(0, len(list1)):
list1[index] = list1[inde... |
# -*- coding: utf-8 -*-
"""This file contains the necessary interface for OLECF plugins."""
from __future__ import unicode_literals
import abc
from plaso.parsers import logger
from plaso.parsers import plugins
class OLECFPlugin(plugins.BasePlugin):
"""The OLECF parser plugin interface."""
NAME = 'olecf_plugin... |
import argparse
def main():
parser = argparse.ArgumentParser()
|
from django.db import models
# Create your models here.
class Items(models.Model):
name = models.CharField(max_length=30)
slot = models.CharField(max_length=30)
gold = models.IntegerField()
count = models.IntegerField()
usable = models.CharField(max_length=30)
bonus = models.CharField(max_length=30)
prosperity ... |
import os
import maya.api.OpenMaya as om
import maya.api.OpenMayaRender as omr
from ._mpynode import MPyNode, MPyNodeEventManager
NODE_PY_CLASS = None
##----if this env var is set to 1, no compiled versions of the class will be loaded---##
ENV_VAR_PY_ONLY = "MPY_SCRIPTED_ONLY"
##----determine if the comp... |
# -*- coding: utf-8 -*-
from django.conf.urls import url, include
from . import views
from rest_framework import routers
routers = routers.DefaultRouter()
routers.register('classes', views.ClassDataView)
routers.register('classStudent', views.ClassStudentDataView)
urlpatterns = [
url('', include(routers.urls)),
... |
"""Reorder sys.path to put $VTROOT/dist/* paths before others.
This ensures libraries installed there will be preferred over other versions
that may be present at the system level. We do this at runtime because
regardless of what we set in the PYTHONPATH environment variable, the system
dist-packages folder gets prepe... |
import tarfile
import argparse
import subprocess
from pathlib import Path
import torch
import torchvision
from torchvision import transforms
from torch.utils.data import DataLoader
from model import *
from utils import *
from dataset import *
def parse_args():
parser = argparse.ArgumentParser()
parser.add_a... |
import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from reinvent_chemistry import Conversions, PhysChemDescriptors
from unittest_reinvent.fixtures.test_data import ASPIRIN, CELECOXIB, IBUPROFEN, PENTANE, METAMIZOLE, \
METHYLPHEMYL_FRAGMENT, GENTAMICIN
class TestPhysChemDescriptors(... |
from collections import OrderedDict
import pytest
from chalice.awsclient import TypedAWSClient
@pytest.mark.parametrize('service,region,endpoint', [
('sns', 'us-east-1',
OrderedDict([('partition', 'aws'),
('endpointName', 'us-east-1'),
('protocols', ['http', 'https']),
... |
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as Spline
from Utils.spherical_bessel_transform import SphericalBesselTransform
from Utils.loginterp import loginterp
from LPT.velocity_moments_fftw import VelocityMoments
class GaussianStreamingModel(VelocityMoments):
'''
Class ... |
""" UnitTest for phrase_constructor"""
import unittest
import logging
import kex
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S')
test_en = 'Efficient discovery of grid services is essential for the success of grid computing. The ' \
'... |
# proxy module
from traitsui.wx.set_editor import *
|
import os
from dataclasses import dataclass
from typing import List, Optional
import joblib
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.preprocessing import LabelEncoder, OrdinalEncoder
from sklearn.utils.multiclass import type_of_target
from .enums i... |
# Copyright 2021 cstsunfu. 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... |
import os
import pytest
from typing import Dict, Generator
from oso import Oso
from sqlalchemy_oso import roles as oso_roles
from fastapi.testclient import TestClient
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, Session, close_all_sessions
from app import crud
from app.core.config imp... |
counts = {"A+": {"A+":0, "A-":0, "C+":0, "C-":0, "G+":0, "G-":0, "T+":0, "T-":0},
"A-": {"A+":0, "A-":0, "C+":0, "C-":0, "G+":0, "G-":0, "T+":0, "T-":0},
"C+": {"A+":0, "A-":0, "C+":0, "C-":0, "G+":0, "G-":0, "T+":0, "T-":0},
"C-": {"A+":0, "A-":0, "C+":0, "C-":0, "G+":0, "G-":0, "T+":0, ... |
# Copyright 2020 Thomas Rogers
# SPDX-License-Identifier: Apache-2.0
import typing
from .. import map_objects
from . import object_property
class WallTypeDescriptor:
def __init__(self, wall_type: int, descriptor: dict):
self._wall_type = wall_type
self._descriptor = descriptor
@property
... |
import pytest
import data_structures
class TestLinkedList:
@pytest.fixture(scope='function')
def test_list(self):
x = data_structures.LinkedList()
x.insert('lorem')
x.insert('dim')
x.insert('sum')
x.insert('Cha')
x.insert('siu')
x.insert('bao')
... |
'''
Author: Ringo S W Chu, Peter Hohin Lee, Winson Luk
'''
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import torch
import torch.utils.data
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from model.helper.parser import Gene... |
import os, sys
#Pegamos o diretório que contem os arquivos bagunçados
diretorio = sys.argv[1]
#Pegamos o nome do novo diretório a partir da primeira linha no arquivo
nome = input()
#Obtemos o caminho até o diretório recuperado
caminho = os.path.join(os.getcwd(), "Recuperação", nome)
#Criamos esse diretório
os.mkdir... |
import io
from collections import OrderedDict
from decimal import Decimal
import pytz
from defusedcsv import csv
from django import forms
from django.db.models import DateTimeField, Max, OuterRef, Subquery, Sum
from django.dispatch import receiver
from django.utils.formats import localize
from django.utils.translation... |
# Section12-2
# 파이썬 데이터베이스 연동(SQLite)
import sqlite3
# DB 파일 조회(없으면 새로 생성)
conn = sqlite3.connect('C:/pythonbasic/resource/database.db') # 본인 db 경로
# 커서 바인딩
c = conn.cursor()
# 데이터 조회(전체)
#c.execute("SELECT * FROM users")
# 커서 위치가 변경
# 1개 로우 선택
#print('One -> \n', c.fetchone())
# 지정 로우 선택
#pr... |
"""Provides a data provider for the CelebA dataset.
See celeba_dataset.py for more details of the CelebA dataset.
Author: Ramakrishna Vedantam (vrama@)
"""
from datasets.celeba import celeba_dataset
import tensorflow as tf
from tensorflow.contrib.slim.python.slim.data import dataset_data_provider
from datasets impor... |
#!/usr/bin/env python2
# coding: utf-8
from utils import cached_method
from pattern_matcher import Classifier, Model
class BaseDerived(object):
@cached_method
def base(self):
return Classifier('Base')
@cached_method
def derived(self):
return Classifier('Derived', generals=[self.base(... |
from datetime import datetime, timedelta
from flask import abort, make_response, redirect, render_template, url_for
from webapp import app
from pandas import DataFrame, read_csv
from statsmodels.tsa.arima.model import ARIMA
import numpy
@app.route('/')
def frontpage():
# if app.forecast is None:
# return redirect(... |
from SpaceSim.Simulation.Group import Group
|
import logging
import keras.backend as K
from keras.layers import Dense, Dropout, Activation, Embedding, Input, Concatenate, Lambda
from keras.models import Model, Sequential
from my_layers import Conv1DWithMasking, Remove_domain_emb, Self_attention, Attention, WeightedSum
import numpy as np
logging.basicConfig(level=... |
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from falcon import HTTPNotFound
from ... import db
from ...auth import debug_only
@debug_only
def on_delete(req, resp, role):
connection = db.connect()
... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
"""
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... |
import copy
from collections import defaultdict
from typing import List, Dict, Tuple, Callable, Any, Optional
from drepr.models import DRepr, WildcardExpr, StepExpr, RangeExpr, Expr, IndexExpr, Preprocessing, PreprocessingType, \
RMap, RMapFunc, Path, RangeAlignment
from drepr.patches import ResourceData
def pat... |
""" tests for mpinterfaces.transformations """
from __future__ import unicode_literals
import unittest
from mpinterfaces.transformations import get_r_list
from io import StringIO
import sys
__author__ = "Seve G. Monahan"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Joshua J. Gabriel"
__email__ = "... |
ifun, g, ret = lambda: [*map(int, input().rstrip().split())], range, -1
vNum = ifun()[0]
edges = [None for _ in g(vNum + 1)]
for _ in g(vNum):
iL = ifun()
edges[iL[0]] = [(iL[ix], iL[ix+1]) for ix in g(1, len(iL) - 1, 2)]
# 제일 먼 정점 찾는 함수
# (현재 정점, 이전 정점) -> [제일 먼 정점, 제일 먼 정점까지 거리]
def dfs(cv, pv):
vt, vtD... |
import os
arch = "WIN_NT"
crdir = "C:/Project/TransViz"
try:
os.environ["TransVizInstalledPath"]
crdir = os.environ["TransVizInstalledPath"]
except KeyError:
print "Defaulting TransVizInstalledPath's Path "
crbindir = os.path.join(crdir,'bin/')
crlibdir = os.path.join(crdir,'lib/')
|
# Copyright 2012 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.
"""Runs Facebook's JSGameBench benchmark.
As of May 14, 2014, JSGameBench is no longer maintained. See README.md:
https://github.com/facebookarchive/jsgameb... |
# Generated by Django 3.2.6 on 2021-08-31 18:44
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_pet_title'),
]
operations = [
migrations.AddField(
model_name='pet',
name='posted',
... |
class AnnotationBaseExcept(Exception):
"""Base exception"""
def __init__(self, msg=""):
self.msg = msg
def __str__(self):
return repr(self.msg)
class FileParseException(AnnotationBaseExcept):
"""Occurs when parsing a file"""
def __init__(self, msg="", line_num=-1):
self.ms... |
"""
AWS Secrets Module Mock for test resources
Version: 1.0.0
"""
from os import path
from unittest.mock import Mock
from dotenv import dotenv_values
from flambda_app import APP_NAME
from flambda_app.aws.secrets import Secrets
from tests import ROOT_DIR
def get_secrets(secret_name):
config_path = path.join(ROOT... |
from flask import Markup, request, render_template # type: ignore
from werkzeug.exceptions import default_exceptions, HTTPException # type: ignore
GENERIC_ERROR_WORDING = 'Sorry, we are experiencing technical difficulties.'
GENERIC_ERROR_DESCRIPTION = 'Please try again in a few moments.'
ERROR_404_WOR... |
'''
program: lib_nested_sampling.py
author: tc
created: 2016-02-09 -- 13 CEST
notes: loosely based on
Skilling, J. (2006). Nested sampling for general Bayesian
computation. Bayesian analysis, 1(4), 833-859.
'''
import sys
import random
__all__ = ['nested_sampling_run']
def _argmin_list(x):
... |
import logging
import random
from abc import ABCMeta, abstractmethod
from learner import QLearner
from world import QbertWorld
class Agent:
__metaclass__ = ABCMeta
@abstractmethod
def action(self):
"""
Perform an action.
"""
raise NotImplementedError
class QbertAgent(Ag... |
# encoding: utf-8
u'''MCL — Institution'''
from ._utils import getReferencedBrains
from Acquisition import aq_inner
from five import grok
from .interfaces import IPerson, IInstitution
from plone.memoize import view
import plone.api
IInstitution.setTaggedValue('typeURI', u'https://cancer.jpl.nasa.gov/rdf/types.rdf#Ins... |
from django.db import models
from django.utils.timezone import datetime
def image_upload_path(instance, filename):
_, extension = filename.split('.')
current_time = str(datetime.now())
filename = f'{current_time}.{extension}'
return filename
class CreatedUpdatedMixin(models.Model):
created_... |
import os
import random
import sys
from time import time
this_dir = os.path.dirname(os.path.abspath(__file__))
if os.path.join(this_dir, "../..") not in sys.path:
sys.path = [os.path.join(this_dir, "../..")] + sys.path
try:
from pychess.Utils.book import getOpenings # nopep8
from pychess.Utils.const impo... |
import mdtraj as md
import time
import numpy as np
"""
A simple way to get conformations from a trajectory.
Provide phi and psi angle pairs to get PDBs of the molecule in these conformations.
These should correspond to energy wells on the free energy surface.
You are much better at peak picking than any algorithm I co... |
from nose.tools import assert_equal
import os
import csv
from collections import deque
from mock import MagicMock
import urllib.parse
import grequests
from download_logs.aws_lambda import AWSLambda
def get_file(path, filename):
return open(get_path(path, filename), 'r')
def get_path(path, filename):
return... |
import discord
import json
import asyncio
from discord.ext import commands
from filehandler import FileHandler
from jsonhandler import JsonHandler
fh = FileHandler()
jh = JsonHandler()
class ReactBuy(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.load_data()
def load_data(self)... |
'''
Authors: Alex Wong <alexw@cs.ucla.edu>, Safa Cicek <safacicek@ucla.edu>
If this code is useful to you, please cite the following paper:
A. Wong, S. Cicek, and S. Soatto. Learning topology from synthetic data for unsupervised depth completion.
In the Robotics and Automation Letters (RA-L) 2021 and Proceedings of In... |
s = input()
start = s.find('A')
stop = s.rfind('Z')
print(stop - start + 1)
|
# Generated by Django 3.0.10 on 2021-01-24 02:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0011_auctionlot_collected'),
]
operations = [
migrations.CreateModel(
name='LotImage',... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.core.management.base import BaseCommand
from django.conf import settings
from uw_pws import PWS
from uw_canvas.accounts import Accounts
from uw_canvas.reports import Reports
from restclients_core.exceptions import DataFa... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
from urllib.parse import urlparse, parse_qsl
from azure.core.async_paging import AsyncList
from ._models import RequestStatistics
from... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-09-11 12:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0055_virtualchassis_ordering'),
]
operations = [
migrations.AlterF... |
import os
import logging.handlers
class EnvRotatingFileHandler(logging.handlers.RotatingFileHandler):
def __init__(self, filename, mode='a', maxBytes=0, backupCount=0, encoding=None, **kwargs):
filename = filename.format(**os.environ)
super().__init__(filename, mode, maxBytes, backupCount, encodi... |
import sys
import os
import datetime
import time
import math
from functions import *
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtWidgets import QInputDialog, QLineEdit, QFileDialog, QGridLayout
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSignal
#from PyQt5 import QtCore, QtGui, QtWidgets... |
import torch.nn as nn
import torch.nn.functional as F
from layers import GraphConvolution
class GCN(nn.Module):
def __init__(self, nfeat, nhid, nclass, dropout):
super(GCN, self).__init__()
self.gc1 = GraphConvolution(nfeat, nhid)
self.gc2 = GraphConvolution(nhid, nclass)
se... |
class Catalogue:
def __init__(self, name):
self.name = name
self.products = []
def add_product(self, product_name):
self.products.append(product_name)
def get_by_letter(self, first_letter):
result = []
for product in self.products:
if first_letter in pro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 09:55:25 2019
Author: Mamadou N'Diaye <mamadou.ndiaye@oca.eu>
License: MIT license
"""
#%%
"""
### Initialization
"""
import numpy as np
import pylab as pl
import pyzelda.zelda as zelda
import pyzelda.ztools as ztools
from pathlib import Pa... |
import unittest
import collections
from collections import namedtuple
from handlers import *
from psmqtt import *
import psutil._common
def get_subtopic(topic, param):
t = Topic(topic)
return t.get_subtopic(param) if t.is_multitopic() else topic
class TestMain(unittest.TestCase):
def test_get_subtopic(s... |
from django.contrib.auth import authenticate, login, logout, get_user, BACKEND_SESSION_KEY, load_backend
from django.contrib.auth.middleware import AuthenticationMiddleware as DjangoMiddleware
from django.contrib.auth.models import BaseUserManager, AnonymousUser
from djangae.contrib.gauth.common.backends import BaseApp... |
import sys
import gc
import unittest
import Loading_Data
import numpy as np
from sklearn import model_selection
import pandas as pd
import CodeFile
class Test_MLP(unittest.TestCase):
@classmethod
def setUpClass(self):
print("Loading the dataset and getting X (i.e features) and y (i.e target)")
... |
#!/usr/bin/env python3
#
# jurl.py by Bill Weinman <https://bw.org/contact/>
# Jump to URL (a private short URL service)
# Copyright (c) 2010-2021 The BearHeart Group, LLC
# updated 2021-04-16 for Using SQL With Python
#
from BWDB import BWDB
from BWCGI import BWCGI
from BWConfig import ConfigFile
import sys
import os... |
# flake8: noqa
"""
ID Lookup API
The Factset Identifier Lookup API provides the ability to search for various identifier types based on keyword. The API returns tickers, entity names and other identifiers that Factset supports. In addition, the API offers filters that allows users to refine the results. # n... |
# Copyright 2021 Waseda Geophysics Laboratory
#
# 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... |
from threading import current_thread, active_count
from time import sleep
from toolz import unique
import tkinter as tk
from tkinter import filedialog
from enum import Enum
from requests import request
from requests.exceptions import RequestException, ProxyError, Timeout
from concurrent.futures import as_completed, Thr... |
# -*- coding: utf-8 -*-
"""
test_celllab_cts.py: Unit-test function for CellLabCTS.
Created on Thu Jul 9 08:20:06 2015
@author: gtucker
"""
from nose.tools import assert_equal
from numpy.testing import assert_array_equal
from landlab import RasterModelGrid, HexModelGrid
from landlab.ca.celllab_cts import Transition... |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
import os
class LogPlotter(object):
""" Definition of a class for reading in a log file and plotting the results.
"""
def __init__(self, log_dir, output_file_name=None, pdf=False):
""" Initialise log plot ""... |
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.cli import CLI
class MyTopo( Topo ):
"Simple topology"
def __init__( self ):
"Creat topo"
... |
import time
import os
import pandas as pd
import random
import subprocess
hitCount = 0
missCount = 0
def set_up_experiment():
global hitCount
global missCount
data = pd.read_csv("source.csv")
# print(data.loc[0])
# return
source_data = data["website"].tolist()
iteration_num = 20 # numb... |
from copy import copy, deepcopy
import pytest
from returns.context import ContextIOResult, RequiresContextIOResult
from returns.primitives.exceptions import ImmutableStateError
def test_context_ioresult_immutable():
"""Ensures that helper is immutable."""
with pytest.raises(ImmutableStateError):
Con... |
#!/usr/bin/env python3
"""
# scripts/manifest/lib/get_parameters.py
# (c) 2020 Sam Caldwell. See LICENSE.txt.
#
# get the parameter list
#
"""
def get_parameters(item: str, block: list) -> list:
"""
evaluate a class of items to download and
return the list of actual objects to download.
... |
import pytest
import tempfile
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from numpy.testing import assert_raises
import numpy as np
from skopt import gp_minimize, forest_minimize
from skopt import load
from skopt import dump
from skopt import expected_minimum, expected_minimum... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
from odoo.addons.test_mail.tests.common import BaseFunctionalTest, MockEmails, TestRecipients
from odoo.tools import mute_logger
from odoo.tests import tagged
@tagged("odoobot")
class T... |
#
# For network and multi node implementation
# please ask about PRO version
#
# www.SimBatch.com
#
# JSON Name Format, PEP8 Name Format
NODES_ITEM_FIELDS_NAMES = [
('id', 'id'),
('name', 'node_name'),
('stateId', 'state_id'),
('state', 'state'),
('stateFile', 'state_file'),
('desc', 'descripti... |
# Authors: Bryan Hunter and Josh Liddiard
from time import sleep
from game_data.guessed_word import GuessedWord
from game_data.word import Word
from game_data.player import Player
from game_data.utils import Utils, TextColors
class Game():
# Initialize the Game() class:
def __init__(self):
self.ut... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
class Observer:
def __init__(self):
pass
def OnNotify(self, event):
pass
|
""" Test module for barbante.recommendation.RecommenderPBCF class.
"""
import barbante.maintenance.product_templates as pt
from barbante.recommendation.tests.fixtures.ProductBasedRecommenderFixture import ProductBasedRecommenderFixture
class TestRecommenderPBCF(ProductBasedRecommenderFixture):
""" Class for test... |
from algorithm.Algorithm import Algorithm
from .sameNumberDiceOccurrenceSimulation import SameNumberDiceOccurrenceSimulation
from .approximateAreaOfCircle import ApproximateAreaOfCircle
class SimulationRunner(Algorithm):
def __init__(self):
Algorithm.__init__(self)
self._test_data = [
... |
from __future__ import annotations
from random import randint
from django.db import models
from django.db.models.aggregates import Count
from django.utils import timezone
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.exceptions import ValidationError
from typing... |
##################################################################################################
##################################################################################################
##################################################################################################
# presplit_map.py: writ... |
import torch
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import sys
from two_dimensional import two_d_gpsa
sys.path.append("../..")
from models.gpsa_vi_lmc import VariationalWarpGP
sys.path.append("../../data")
from simulated.generate_twod_data import generate_twod_da... |
# -*- coding: utf-8 -*-
from django.db import models
from apps.registro.models.Anexo import Anexo
from apps.titulos.models.Cohorte import Cohorte
from apps.titulos.models.EstadoCohorteAnexo import EstadoCohorteAnexo
import datetime
"Cada asignación de una cohorte a un anexo"
class CohorteAnexo(models.Model):
anexo... |
import numpy as np
import pandas as pd
from guess_language import guess_language
from google.cloud import translate
import os
import time
import random
airbnb = pd.read_csv('../data/summary-listings.csv')
reviews = pd.read_csv('../data/reviews_2019.csv')
reviews.drop(['id', ], axis=1, inplace=True)
listings = pd.read_... |
from pythonforandroid.recipe import PythonRecipe
class VispyRecipe(PythonRecipe):
version = '0.4.0'
url = 'https://github.com/vispy/vispy/archive/v{version}.tar.gz'
depends = ['python2', 'numpy', 'pysdl2']
patches = ['disable_freetype.patch',
'disable_font_triage.patch',
... |
#Import general modules
import argparse, requests, re
import html
import pandas as pd
from os.path import join, isdir
#Define constants
testRun = False
regionOutputFile = 'region_frequencies'
globalOutputFile = 'global_frequencies'
#Setup url and parameters
frequencyURL = 'http://www.allelefrequencies.net/hla6006a_sc... |
#!/usr/bin/env python3.7
#
# Copyright (c) University of Luxembourg 2021.
# Created by Oscar Eduardo CORNEJO OLIVARES, oscar.cornejo@uni.lu, SnT, 2021.
#
import os, sys
def load_traces(file_path):
traces = {}
with open(file_path) as f:
for line in f:
mutant_trace = line.strip().split(';'... |
import flask_login as login
from flask import Blueprint, Flask, Markup, redirect, request, url_for
from redata.ui_admin.utils import (
BaseRedataView,
grafana_url_formatter_fun,
table_details_link_formatter,
)
class ScanView(BaseRedataView):
can_delete = False
form_excluded_columns = ("created_at... |
# 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 ... |
# dfmbot/fb_dfmbot/urls.py
from django.conf.urls import include, url
from .views import DFMBotView
urlpatterns = [
url(r'^66d2b8f4a09cd35cb23076a1da5d51529136a3373fd570b122/?$', DFMBotView.as_view())
] |
"""
Problem: P1932
Time: 2020/09/26 14:07:04
Author: Insouciant21
Status: Accepted
"""
a = int(input())
b = int(input())
print(a + b)
print(a - b)
print(a * b)
print(a // b)
print(a % b)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.