text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
#
# 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.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os... |
from django.shortcuts import render
from django.views import View
from django.views.generic import ListView, DetailView, CreateView
from django.http import HttpResponseRedirect
from .models import Post, Comments, Event, EveComm
from django.urls import reverse_lazy, reverse
from django.core.mail import send_mail
from dj... |
# image utilities
import numpy as np
import collections
from PIL import Image
# raster
from rasterio.features import rasterize
import rasterio
from rasterio.windows import Window
def total_chunks_in_image(tif, window, stride):
rst = rasterio.open(tif)
res_height = rst.meta['height']
res_width = rst.meta... |
#!/usr/bin/env python
############################################
## /* PSM FK for Traid project */ ##########
## \author: Haoying Zhou
############################################
import numpy as np
class TraidPSMFK():
def __init__(self, joint_pos):
####### note: joint_pos should be a 1x3 matrix for eac... |
import random
import math
import os
import numpy as np
import pandas as pd
from pysc2.agents import base_agent
from pysc2.lib import actions
from pysc2.lib import features
_NO_OP = actions.FUNCTIONS.no_op.id
_SELECT_POINT = actions.FUNCTIONS.select_point.id
_BUILD_SUPPLY_DEPOT = actions.FUNCTIONS.Build_SupplyDepot_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.
# Changes ... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State, MATCH, ALL
app = dash.Dash(__name__, suppress_callback_exceptions=True)
app.layout = html.Div([
html.Button("Add Filter", id="add-filter", n_clicks=0),
html.Div(id='dropdown-c... |
from django.db import models
# Create your models here.
class dac(models.Model):
""" 单独下发DAC的值 """
time = models.DateTimeField(auto_now_add= True, null=False)
data = models.SmallIntegerField(null=False)
class Meta:
ordering = ['-time']
class msg(models.Model):
""" MSG 数据模型 "... |
def maximum(questions):
return questions.map(lambda x: len(x)).max()
def longest_question(question1, question2):
return max(
maximum(question1),
maximum(question2)
) |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... |
import os
import sys
import django
from django.core import management
def pytest_addoption(parser):
parser.addoption('--no-pkgroot', action='store_true', default=False,
help='Remove package root directory from sys.path, ensuring that '
'rest_framework is imported fr... |
from django.contrib import admin
from django.views.decorators.csrf import csrf_exempt
from django.urls import path
from graphene_django.views import GraphQLView
urlpatterns = [
path('admin/', admin.site.urls),
path('graphql', csrf_exempt(GraphQLView.as_view(graphiql=True))),
]
|
# Copyright (C) 2017 Creu Blanca
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
from odoo.addons.web.controllers import main as report
from odoo.http import content_disposition, route, request
import json
class ReportController(report.ReportController):
@route()
def report_routes(self,... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: modules/perception/proto/sequence_type_fuser_config.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... |
# -*- coding: utf-8 -*-
import manager
import HelpUtil
f = open("command_help.txt", "r")
command_help = f.read()
f.close()
person = None
def print_help():
HelpUtil.person = person
HelpUtil.print_help()
def run_command(command_str):
if command_str == "exit":
return False
if command_str ==... |
from draw import Rect, plot
class quadTree():
def __init__(self, boundary, capacity):
self.boundary = boundary
self.capacity = capacity
self.points = []
self.divided = False
def contains(self, point):
x = self.boundary.center[0]
y = self.boundary.center[1]
... |
import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
from pymysql._compat import PY2, long_type
if not PY2:
basestring = str
class TestDBAPISet(unittest.TestCase):
def test_set_equality(self):
self.assertTrue(pymysql.STRI... |
# Imports
from . import compute
from . import update
from . import util
|
__version__ = "1.3.0.0"
|
#!/usr/bin/env python
import hashlib
import os
import sys
VERSION_DEFINES = ["MAJORVER", "MINORVER", "REVISION", "PATCHLVL"]
VERSION_LEVELS = ["major", "minor", "rev", "patch"]
# TODO: Get from sys.argv
bump = None
def update_version(file):
lines = []
with open(file, "r") as fp:
for line in fp:
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: operation_log.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.protob... |
#!/usr/bin/env python3
import boto3
import csv
import fire
import json
import uuid
class DataLoad(object):
"""
Load the service data into DynamoDB
"""
def __init__(self):
self.loadmap = LoadMap()
def Load(self, filename, table, mapfile='', overwrite=False, dryrun=True, local=False):
... |
# Copyright 2020 Dirk Klimpel
#
# 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,... |
import unittest
from scrapy.item import Item, Field
class ItemTest(unittest.TestCase):
def test_simple(self):
class TestItem(Item):
name = Field()
i = TestItem()
i['name'] = u'name'
self.assertEqual(i['name'], u'name')
def test_init(self):
class TestItem... |
"""The lookin integration climate platform."""
from __future__ import annotations
import logging
from typing import Any, Final, cast
from aiolookin import Climate, MeteoSensor
from aiolookin.models import UDPCommandType, UDPEvent
from homeassistant.components.climate import ClimateEntity
from homeassistant.component... |
# -*- 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.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequired
from ccxt... |
import pytest
from pathlib import Path
if __name__ == "__main__":
for p in list(Path.cwd().glob("test_*.py")):
print(p)
pytest.main(["-s", f"{p}"]) |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne 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
#
# h... |
import random
from gym.spaces import Discrete
from railrl.exploration_strategies.base import RawExplorationStrategy
from railrl.core.serializable import Serializable
class EpsilonGreedy(RawExplorationStrategy, Serializable):
"""
Take a random discrete action with some probability.
"""
def __init__(s... |
# https://www.hackerrank.com/challenges/30-interfaces/problem
class AdvancedArithmetic(object):
def divisorSum(n):
raise NotImplementedError
class Calculator(AdvancedArithmetic):
def divisorSum(self, n):
l = []
for z in range(1,n//2+1):
if(n%z==0): l.append(z)
retu... |
# app/extensions.py
from flask_assets import Environment
from flask_admin import Admin
from flask_babel import Babel
from flask_bootstrap import Bootstrap
from flask_debugtoolbar import DebugToolbarExtension
from flask_mail import Mail
from flask_marshmallow import Marshmallow
from flask_moment import Moment
from flask... |
import pytest
from jina.drivers.evaluate import RankEvaluateDriver
from jina.executors.evaluators.rank.precision import PrecisionEvaluator
from jina.proto import jina_pb2
from jina.types.document.helper import DocGroundtruthPair
class SimpleRankEvaluateDriver(RankEvaluateDriver):
def __init__(self, field: str, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006,2008-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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 Fou... |
import os
from unittest import TestCase
import dvc
from dvc.system import System
from dvc.utils.compat import str
from dvc.utils.fs import (
get_mtime_and_size,
contains_symlink_up_to,
BasePathNotInCheckedPathException,
)
from mock import patch
from tests.basic_env import TestDir
from tests.utils import sp... |
# Copyright (c) 2017, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Base class of servers'''
import asyncio
import os
import platform
import re
import signal
import sys
import time
from contextlib import suppress
from func... |
#link: https://leetcode.com/problems/tree-diameter/
class Solution(object):
def treeDiameter(self, edges):
"""
:type edges: List[List[int]]
:rtype: int
"""
self.graph = collections.defaultdict(list)
self.diameter = 0
for x,y in edges:
self.graph[x... |
"""Payments for a Request."""
from enum import Enum
from sqlalchemy import event
from namex.constants import PaymentState
from namex.models import State, db
class Payment(db.Model):
class PaymentActions(Enum):
"""Valid actions for a payment."""
CREATE='CREATE'
UPGRADE='UPGRA... |
"""
===================================
Count rate filtered correlation - 2
===================================
Scan count rate filter and compute stack of correlation
functions for different mean count rates in time windows.
Potential application: filter aggregates, see also
PAID correlation (Laurence???)
Low count ... |
"""Holds configurations to read and write with Spark to Kafka."""
from typing import Any, Dict, List, Optional
from butterfree.configs import environment
from butterfree.configs.db import AbstractWriteConfig
class KafkaConfig(AbstractWriteConfig):
"""Configuration for Spark to connect to Kafka.
Attributes:
... |
from setuptools import find_packages, setup
long_description = '''
Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver).
Use the most recent version of the API from Instagram.
Features:
1. Performs Public API (web, anonymous) or Private API (mobile app, authorized) reque... |
"""twa URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... |
import json
import logging
import uuid
from datetime import datetime
from datetime import time as dt_time
from datetime import timedelta
from functools import partial
from typing import Callable, Dict, Optional, Sequence, Tuple, List
import flask
import werkzeug.exceptions
from dateutil.tz import tz
from flask import ... |
from collections.abc import Iterable
from collections import namedtuple
from difflib import get_close_matches
from numbers import Real
from io import StringIO
import itertools
import os
import re
import tempfile
from warnings import warn
import numpy as np
import h5py
import openmc.checkvalue as cv
from openmc.mixin ... |
"""
Imported calendars from the trading_calendars project
GitHub: www.tradcing.com
Subtracts 1 minute from the start time as listed in the trading_calendars project
"""
from datetime import time
from .market_calendar import MarketCalendar
import trading_calendars
class TradingCalendar(MarketCalendar):
def __in... |
import config
import csv
from binance import Client, helpers
from flask import flash, redirect
CLIENT = Client(config.API_KEY, config.API_SECRET)
def get_symbols():
exchange_info = CLIENT.get_exchange_info()
return exchange_info['symbols']
def get_balance():
account = CLIENT.get_account()
return a... |
from .VisMotif import VisMotif
|
import json
mime_type = None
modified_date = None
title = None
def build_tree(items_list, item_id, parent, drive_service):
global title, mime_type, modified_date
for k in items_list:
if k['id'] == item_id:
labels = k['labels']
if labels['hidden'] or labels['trashed']:
... |
from diggext.drivers import *
|
from openpyxl import load_workbook
import re
filename = 'aalh_iit_peopleportraits_004.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 501
iterationrow = 7
targetcol = 15
rightsuricol = 26
rightsdesccol = 27
nocruri = 'http://ri... |
from django.core.management.base import BaseCommand
from open_humans.models import OpenHumansMember
from main.models import DataSourceMember
from django.conf import settings
from datauploader.tasks import process_github
# import vcr
class Command(BaseCommand):
help = 'Import existing users from legacy project'
... |
#! /usr/bin/python3
# Import the socket module
import socket
# Import command line arguments
from sys import argv
import random
import bisect
import time
from database.memory import ShortMemory
from database.memory import LongMemory
from database.memory import History
class TTTClient:
"""TTTClient deals with net... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
import time
from tests import pyunit_utils
#----------------------------------------------------------------------
# PUBDEV-3359: verify that we can parse thousands of files correctly or
# identify if not. Split the airlines_all da... |
import sys
import typing
from . import anim_utils
from . import object_utils
from . import io_utils
from . import image_utils
from . import keyconfig_utils
from . import node_utils
from . import view3d_utils
from . import mesh_utils
|
from .formula import *
from .scales import *
import exh.options as options
options.scales = options.scales + FocusScales() |
from __future__ import print_function
import yaml
import time
import os
import logging
from argparse import ArgumentParser
import tensorflow as tf
from utils import DataUtil, AttrDict
from model import Model
from cnn_discriminator import DisCNN
from share_function import deal_generated_samples
from share_function impo... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 or... |
numero1 = int(input('Primeiro numero: '))
numero2 = int(input('Segundo numero: '))
soma = numero1 + numero2
print('A soma entre {} e {} números é {}'.format(numero1, numero2, soma))
print(type(numero2))
|
from discord.ext import commands
import discord, random
class Events(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Bot is Ready")
print(f"Logged in as {self.bot.user}")
print(f"Id: {self.bot.u... |
# Copyright 2018-2022 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# Copyright 2018 New Vector 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 in writin... |
import inspect
import logging
import pathlib
import sys
import warnings
from typing import (
Any,
Callable,
Collection,
Dict,
Iterable,
Optional,
Set,
Tuple,
Type,
Union,
)
from typing import cast
from . import errors as errors_
LOGGER = logging.getLogger(__name__)
_KW_PARAM_... |
# Copyright 2020 The SODA 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 wri... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from maskrcnn_benchmark.utils.registry import Registry
BACKBONES = Registry()
ROI_BOX_FEATURE_EXTRACTORS = Registry()
RPN_HEADS = Registry()
RROI_BOX_FEATURE_EXTRACTORS = Registry() |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import tensorflow as tf
from niftynet.engine.sampler_resize_v2 import ResizeSampler
from niftynet.io.image_reader import ImageReader
from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
from ni... |
#!/usr/bin/env python
"""The setup script."""
import io
import os
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
cwd = os.path.abspath(os.path.dirname(__file__))
with io.... |
import pygame
import pkg_resources
import os
import weakref
import logging
logger = logging.getLogger('fmu_logger')
font_cache = weakref.WeakValueDictionary()
image_cache = weakref.WeakValueDictionary()
sound_cache = weakref.WeakValueDictionary()
package_name = 'pygameui'
def get_font(size=16, use_bold=False, name=... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import neural_renderer as nr
import numpy as np
import cv2
class DepthRenderer(nn.Module):
def __init__(self, cfg):
super(DepthRenderer, self).__init__()
min_depth = cfg.MODEL.MVSNET.MIN_DEPTH
max_depth = min_depth + (cfg.... |
#
# Task metadata/kwargs/shared/return API
#
import pytest
import multiprocessing as mp
import time
import warnings
from pexen import sched, util
from pexen.sched import TaskRes
#from pexen.sched.pool import ThreadWorkerPool, ProcessWorkerPool
from tests.sched.common import *
from tests.sched.common import check_res... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZhimaCustomerEpCertificationCertifyResponse(AlipayResponse):
def __init__(self):
super(ZhimaCustomerEpCertificationCertifyResponse, self).__init__()
self._biz_no = No... |
'''
Image crop detection by absolute patch localization.
Neural network architecture description in PyTorch.
Basile Van Hoorick, Fall 2020.
'''
# Library imports.
import cv2
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import random
import scipy
import seaborn as sns
import shutil
import ... |
# python 3.7
"""Contains the base class for generator in a GAN model."""
import os.path
import sys
import logging
import numpy as np
import torch
from . import model_settings
__all__ = ['BaseGenerator', 'BaseDiscriminator']
def get_temp_logger(logger_name='logger'):
"""Gets a temporary logger.
This logger ... |
from django.urls import include, path, re_path
from django.contrib import admin
from django.conf.urls.static import static
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from kubeoperator import settings
from kubeoperator.celery_flower import celery_flower_view
from . import error_handler
sch... |
import json
import os
from pathlib import Path
import subprocess as sp
import sys
from textwrap import dedent
import venv
assert __name__ == "__main__"
name_kernel = "binary-embedding"
path_venv = Path(".venv").resolve()
if "-h" in sys.argv or "--help" in sys.argv:
print(
dedent(f"""\
Prepare an... |
# Python module
# -*- tab-width: 4 -*- ;; Emacs
# -*- coding: utf-8 -*- ;; PEP 0263
# vi: set tabstop=4 :: Vi/ViM
# vi: set fileencoding=utf-8 :: PEP 0263
############################################################ IDENT(1)
#
# $Title: Python bindings for libcmb $
# $Copyright: 2018 Devin Teske. All rights reser... |
"""
Various non-grid data containers.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------... |
# encoding=utf-8
from airtest.core.android.android import Android
from airtest.core.android.cap_methods.screen_proxy import ScreenProxy
from airtest.core.android.cap_methods.minicap import Minicap
from airtest.aircv.utils import string_2_img
from numpy import ndarray
import unittest
import warnings
warnings.simplefilte... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2018 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from pymor.basic import *
from pymor_dealii.pymor.operator import DealIIMatrixOperator
from pymor... |
import zmq
import threading
import logging
import shortuuid
from zeroconf import ServiceInfo, Zeroconf, IPVersion
import socket
class tcpConnection(threading.Thread):
"""Setups and manages a connection thread to iotdashboard via TCP."""
def __get_local_ip_address(self):
s = socket.socket(socket.AF_IN... |
"""Represents a Tag on an Entry"""
import logging
import datetime
import math
from pylons import config
from sqlalchemy import and_, desc, func, or_, select, types
from sqlalchemy.sql import text
from abraxas.model ... |
import os, sys
#os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import skimage.io
from skimage.transform import resize
from imgaug import augmenters as iaa
from tqdm import tqdm
import PIL
from PIL import Image... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Wizblcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from collections import deque
import errno
from enum import Enum
impo... |
from django.apps import AppConfig
class SampleConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'sample'
|
#-------------------------------------------------------------------------------------------------------------------------------
# COVID19 PREDICTION IN INDIA
# FILE NAME: test.py
# DEVELOPED BY: Vigneshwar Ravichandar
# TOPICS: Regression, Machine Learning, TensorFlow
#--------------------------------------------... |
import socket # Import socket module
import time # Import time module
import datetime
import os
import p2putils
import select
import sys
from builtins import input
from tkinter import filedialog, Tk
"""
Depends on:
1. pip install future - For Python 2,3 Compatibility
"""
class Client:
"""
The constructor... |
import datetime
from copy import deepcopy
from django.core.exceptions import FieldError, MultipleObjectsReturned
from django.db import models, transaction
from django.test import TestCase
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.translation import uge... |
# 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
# distribu... |
import pymongo
conn = pymongo.MongoClient('localhost', 27017)
db = conn.get_database('mongo_test')
collection = db.get_collection('customer')
collection.insert_one({"name":"cbchoi", "category":1, "region":'Daejeon'})
results = collection.find()
[print(result) for result in results] |
from django.core.management.base import BaseCommand
from django.conf import settings
from xml.dom import minidom
import urllib2
class Command(BaseCommand):
"""
Synchronize CurrencyItem's with XE rates database
"""
def handle(self, *args, **kwargs):
""" Docstr """
from xe_currencies.mo... |
import timeit
import numpy as np
from mpi4py import MPI
from bingo.symbolic_regression.agraph.crossover import AGraphCrossover
from bingo.symbolic_regression.agraph.mutation import AGraphMutation
from bingo.symbolic_regression.agraph.generator import AGraphGenerator
from bingo.symbolic_regression.agraph.component_gen... |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import timedelta
import pytest
from indico.modules.events.sessions.models.sessions import ... |
from datetime import datetime
import flask_login as login
from flask import Blueprint, Flask, Markup, redirect, request, url_for
from flask_admin import Admin, AdminIndexView, expose, helpers
from flask_admin.contrib.sqla import ModelView
from werkzeug.security import generate_password_hash
from wtforms import fields,... |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webapp.settings.dev')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from io import BytesIO
import requests
import random
import json
import hashlib
import hmac
import urllib
import uuid
import time
import copy
import math
import sys
from datetime import datetime
import calendar
import os
from PIL import Image
from requests_toolbelt impor... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 or... |
import sys
from PyQt5.QtWidgets import *
class MyWindow(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(300, 300, 400, 300)
btn1 = QPushButton("Button1")
btn2 = QPushButton("Button2")
btn3 = QPushButton("Button3")
layout = QHBoxLayout()
... |
import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 0, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 12); |
# -*- coding: utf-8 -*-
"""
Slightly adapted from https://github.com/befelix/safe-exploration/blob/master/safe_exploration/ssm_gpy/gaussian_process.py
Created on Wed Sep 20 10:37:51 2017
@author: tkoller
"""
import GPy
import numpy as np
from .gp_models_utils_casadi import gp_pred_function, _get_kernel_function
from ... |
#!/usr/bin/python
'''
Fixes invalid dates found in spl JSONs.
'''
import arrow
DATE_FORMAT = 'YYYY-MM-DD'
# Restores the date string after parsing.
def fixDate(y, m, d):
return (y + '-' + m + '-' + d)
# Accepts a date string in format YYYY-MM-DD and fixes invalid dates.
def validate_date(date):
year, month, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.