text stringlengths 1 927k |
|---|
"""
reader_util
"""
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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
#
# Unles... |
"""Implementation of chess board object on client side of application
Authors:
Peter Hamran xhamra00@stud.fit.vutbr.cz
Date:
20.01.2020
"""
class Board:
def __init__(self):
self.dimensions = (8, 8)
def get_background(self):
...
#TODO |
import functools
import glob
import inspect
import os
import imageio
import numpy as np
import pytest
from bentoml.yatai.client import YataiClient
from tests.bento_service_examples.example_bento_service import ExampleBentoService
def pytest_configure():
'''
global constants for tests
'''
# async req... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyNetcdf4(PythonPackage):
"""Python interface to the netCDF Library."""
homepage = "h... |
n, m = [int(m) for m in input().split()]
a = [int(m) for m in input().split()]
print(n - sum(a) if n - sum(a) >= 0 else -1) |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 31 16:01:25 2015.
@author: rc,alex
"""
import os
import sys
if __name__ == '__main__' and __package__ is None:
filePath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(filePath)
from glob import glob
import numpy as np
import pandas ... |
import os
from fitnick.base.base import introspect_tokens
def refresh_authorized_client():
import requests
with requests.session() as session:
with open('fitnick/base/fitbit_refresh_token.txt', 'r') as f:
refresh_token = f.read().strip()
with open('fitnick/base/fitbit_refresh_t... |
from django.db import models
from cms.models.pluginmodel import CMSPlugin
from django.utils.encoding import python_2_unicode_compatible
from hvad.models import TranslatableModel, TranslatedFields
from teamModule import local_settings
class Formation(TranslatableModel):
translations = TranslatedFields(
na... |
#!/usr/bin/python
#
# 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 ag... |
from utils.config import process_config
from utils.dirs import create_dirs
from utils.args import get_args
from utils import factory
import sys
def main():
# capture the config path from the run arguments
# then process the json configuration fill
try:
args = get_args()
config = process_con... |
# 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 may ... |
'''
This is a dispy graph which produces a workflow that sends copies of the output data from the producer node (words)
to two nodes (filter1 and filter2), and the outputs of those two filters are merged in the last node (count).
.. image:: /api/images/grouping_split_merge.png
It can be executed with MPI and STORM.... |
# -*- coding: utf-8 -*-
"""
Manage CloudFront distributions
.. versionadded:: 2018.3.0
Create, update and destroy CloudFront distributions.
This module accepts explicit AWS credentials but can also utilize
IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then automatically obtain... |
from django.test import TestCase
from django.core.files import File
from django.core.exceptions import ValidationError
from ..models import GalleryUpload, Gallery, Photo
from .factories import GalleryFactory, PhotoFactory, SAMPLE_ZIP_PATH, SAMPLE_NOT_IMAGE_ZIP_PATH, \
IGNORED_FILES_ZIP_PATH
class GalleryUploadTe... |
import contextlib
import functools
from dataclasses import dataclass
from typing import List, Optional
from pytest_alembic.config import Config
from pytest_alembic.executor import CommandExecutor, ConnectionExecutor
from pytest_alembic.history import AlembicHistory
from pytest_alembic.revision_data import RevisionData... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ******************************************************************************
# $Id$
#
# Project: GDAL
# Purpose: Build a JPEG2000 file from the XML structure dumped by dump_jp2.py
# Mostly useful to build non-conformant files
# Author: Even Rouault, ... |
#!c:\users\outof\documents\projects\tryten\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line() |
import pytest
from core.base import BaseProduct
from core.products import TangibleProduct, NoInstanceAccessError
class TestBaseProduct:
def test_class_exists(self):
assert globals().get('BaseProduct') == BaseProduct
def test_base_fails_without_implementing_abstracts(self):
with pytest.ra... |
from django.conf.urls import url, include, handler404
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Template, Context
from django.contrib import admin
import treenav.urls
from ..admin import MenuItemAdmin
from ..models import MenuItem
admin.autodiscover()
# create a second Ad... |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class DummyModel(models.Model):
slug = models.CharField(max_length=50)
def __str__(self):
return str(self.id) |
sm.showFieldEffect("demonSlayer/whiteOut", 0)
sm.sendDelay(1950)
sm.completeQuestNoRewards(23203)
sm.deleteQuest(23203)
sm.curNodeEventEnd(True)
sm.warpInstanceIn(931050300, 0) |
# Challenge from:
# https://www.reddit.com/r/dailyprogrammer/comments/pihtx/intermediate_challenge_1/
import sys
def main():
pass
def init_schedule():
events = {}
question = input('''What would you like to do?\nInput a to add an event
\nInput d to delete an event
\nInput l... |
import logging
import sys
from functools import cmp_to_key
from django.utils.translation import ugettext as _
from ddtrace import tracer
from iso8601 import iso8601
from casexml.apps.case import const
from casexml.apps.case.const import CASE_ACTION_COMMTRACK
from casexml.apps.case.exceptions import (
CaseValueEr... |
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import models, layers
from tensorflow.python.keras.datasets import mnist
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
import random
import json
(train_images, train_labels), (test_images, test_labels) = mnist.load_da... |
from model.group import Group
import random
import string
import os.path
import getopt
import sys
import time
import clr
clr.AddReferenceByName('')
from Microsoft.Office.Interop import Excel
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
g... |
# -*- coding: utf-8 -*-
# This repo is licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
"""CRUS - Compute Rolling Upgrade Service
MIT License
(C) Copyright [2020] Hewlett Packard Enterprise Development LP
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, includin... |
import os
import sys
import json
service = sys.argv[1]
servicename=sys.argv[2]
region=sys.argv[3]
plan = sys.argv[4]
filename = sys.argv[5]
data = os.popen("ibmcloud resource service-instance-create "+servicename+" "+service+" "+plan+" "+region).read()
print(data)
if(len(data.split("\n"))<3):
data = json.loads(o... |
"""
Sensor for data from Austrian "Zentralanstalt für Meteorologie und Geodynamik".
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/weather.zamg/
"""
import logging
import voluptuous as vol
from homeassistant.components.weather import (
WeatherEntit... |
is_cold = True
is_hot= False
if is_cold:
print("hello")
print("you are fucker")
elif is_hot:
print("shame on you")
print("you are dick")
else:
print("im your sis")
pritn("you are my bro")
temp = 30
if temp < 40:
print("its not hot day")
else:
print("its cold") |
#@+leo-ver=5-thin
#@+node:tbrown.20171028115144.5: * @file ../plugins/editpane/leotextedit.py
#@+<<leotextedit.py imports >>
#@+node:tbrown.20171028115508.1: ** <<leotextedit.py imports >>
# import re
import leo.core.leoGlobals as g
assert g
from leo.core.leoQt import QtWidgets # QtConst, QtCore, QtGui
from leo.core.... |
### Register Transforms
### This is interesting because we don't expect all transforms to be
### available on all platforms. To do this we allow things to fail at
### two levels
### 1) Imports
### If the import fails the module is removed from the list and
### will not be processed/registered
### 2) Registration
... |
"""
Position feed-forward network from "Attention is All You Need"
"""
import torch.nn as nn
import onmt
from onmt.modules.hyperbolic import cLinear
class PositionwiseFeedForward_h(nn.Module):
""" A two-layer Feed-Forward-Network with residual layer norm.
Args:
d_model (int): the size of i... |
"""
Testing features and method for
Echo State Network - Reservoir for MNIST digit classification with memory
"""
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
import evodynamic.experiment as experiment
import evodynamic.connection.random as conn_random
import evodynamic.connection as c... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... |
#!/usr/bin/env python
# Tai Sakuma <tai.sakuma@gmail.com>
##__________________________________________________________________||
import os, sys
import timeit
import array
import ROOT
from alphatwirl.roottree import Events, BEvents
# https://cp3.irmp.ucl.ac.be/projects/delphes/ticket/1039
ROOT.gInterpreter.Declare('#... |
from django import forms
from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter
from django.contrib.admin.options import VERTICAL, ModelAdmin, TabularInline
from django.contrib.admin.sites import AdminSite
from django.core.checks import Error
from django.forms.models import BaseModelFormSet
from djan... |
#!/usr/bin/env python2
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
import argparse
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (2, 7, 0):
sys.exit("Error: Electrum requires Python version >= 2.7.0...... |
'''Testing the crop_resize function'''
testpath = "./Data/Competition_data/train/1/study/sax_10/IM-4562-0001.dcm"
testf = dicom.read_file(testpath)
img = crop_resize(testf.pixel_array.astype(float) / np.max(testf.pixel_array), 64)
rawimg = testf.pixel_array.astype(float)
# plt.imshow(rawimg,'gray')
# plt.imshow(img, '... |
import os
from setuptools import find_packages, setup
# include the non python files
def package_files(directory, strip_leading):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
package_file = os.path.join(path, filename)
paths.a... |
# 詳しい説明は同様のプログラム logis_gradCV.py を参照
import sys
sys.path.append('../')
import numpy as np
import pandas as pd
from scipy import sparse
from sklearn.metrics import f1_score
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import make_scorer
import matplotlib.pyplot as plt
import seaborn as sns
f... |
import json
import sys
from pathlib import Path
import numpy as np
from minydra import Parser
from subsample_density_dataset import label_file
from tqdm import tqdm
if __name__ == "__main__":
parser = Parser()
args = parser.args.resolve()
base = Path("/network/tmp1/schmidtv/perovai")
out = Path("/ne... |
from azure.keyvault.secrets import SecretClient
from azure.identity import DefaultAzureCredential,AzureCliCredential
from commands import add_secrets
import csv
import click
def register_commands(group):
group.add_command(remove_single)
group.add_command(remove_list)
group.add_command(clean_keyvault)
@cli... |
"""
Model tests
"""
from unittest import mock
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from richie.plugins.lti_consumer.factories import LTIConsumerFactory
from richie.plugins.lti_consumer.models import LTIConsumer
def get_lti_settings(is_regex=True):
... |
import sys
from PyQt5.QtWidgets import QDialog, QApplication
from demoRadioButton2 import *
class MyForm(QDialog):
def __init__(self):
super().__init__()
self.ui = Ui_Dialog()
self.ui.setupUi(self)
self.ui.radioButtonMedium.toggled.connect(self.dispSelected)
self.ui.radioB... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
import difflib
import filecmp
import logging
from random import shuffle
import os
import tempfile
from cathpy.core.release import (
CathDomainList, CathNamesList, CathDomall,
CathDomainListEntry, CathDomallEntry, )
from . import testutils
LOG = logging.getLogger(__name__)
def cmp_file_contents(f1, f2, rstr... |
from plotly.basedatatypes import BaseLayoutHierarchyType
import copy
class Up(BaseLayoutHierarchyType):
# x
# -
@property
def x(self):
"""
The 'x' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
from django.apps import AppConfig
class WxloginConfig(AppConfig):
name = 'wxlogin' |
"""Rainforest data."""
from __future__ import annotations
from datetime import timedelta
import logging
import aioeagle
import aiohttp
import async_timeout
from requests.exceptions import ConnectionError as ConnectError, HTTPError, Timeout
from uEagle import Eagle as Eagle100Reader
from homeassistant.config_entries ... |
# -*- coding: utf-8 -*-
#请在python3下的环境编译
#安装依赖pip3 install python-docx
from docx import Document
from docx.shared import Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH
import os
document = Document()
document.add_heading('HHU ACM Template', 0)
p = document.add_paragraph('Writter ')
p.add_run('Luo Longjun, ')... |
# 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
#
# Unless required by applica... |
"""
Created on Thu Oct 14 14:47:38 2021
@author: cxue2
"""
from ._metric import Metric
from ._misc import _numpy
import sklearn.metrics as M
class RocAuc(Metric):
@_numpy
def __call__(self, output, y_true):
return M.roc_auc_score(y_true, output[:, 1], **self.kwargs) |
# Copyright (c) 2011 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.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'sfntly',
'type': 'static_library',
'sources': [
... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import numpy as np
import os
import sys
from cntk.ops.tests.ops_test_utils import ... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_0_1.models.compati... |
from utils.utils import data_train, data_val
from utils.model import model, model_thresholding
from utils.losses import dice_coefficient, dice_loss
from utils.preprocess import *
import pickle
import keras
## VARIABLES
ROOT = "./" ##BASE PATH TO MRBrainS18
LABEL = "Basal ganglia" ##LABEL TO TRAIN FOR
EPOCHS = 400 ##NU... |
import h5py
import numpy
import os
import random
import sys
import subprocess
# import samplers
# import pyDOE
# import ghalton
try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve # Python 3
def download(src, dst):
if not os.path.exists(dst):
# TODO: s... |
'''
This module is a streaming algorithm developed to compute the (in)degree centrality of vertices using CountMin sketch.
CountMin provides approximate frequencies for each distinct element in the input stream. Accuracy of the approximation based on the dimensions of the 2D array used to store these frequencies. Exact... |
# Copyright 2013 Rackspace Hosting
# 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 require... |
#!/usr/bin/env python
## category General
## desc Splits long FASTQ reads into smaller (tiled) chunks
'''
For each read in a FASTQ file, split it into smaller (overlapping) chunks.
Fragments are defined by their length and offset. For example, if the length
is 35 and the offset is 10, sub-reads will be 1->35, 11->45, 2... |
import os
def get_java_files(directory):
java_files = []
for root, dirs, files in os.walk(directory):
for f in files:
if f.endswith('.java'):
java_files.append(f)
return java_files
def verify_prefix(prefix, files):
if len(files) == 0:
print(prefix + ' directory does not contain any files!')
exit(-1)... |
from itertools import chain
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from guardian.utils import get_identity
class ObjectPermissionChecker(object):
"""
Generic object permissions checker class being the heart o... |
from threading import Thread
from pyfirmata import Arduino, pyfirmata, util
from pyfirmata.util import ping_time_to_distance
import time
### Start of pin configuration
board = Arduino() # or Arduino(port) define board
print("Communication successfully started!")
it = util.Iterator(board)
it.start()
sonarEcho = board... |
"""
Definition of models.
"""
from django.db import models
# Create your models here.
class testdata(models.Model):
id = models.IntegerField(default=170)
type = models.CharField(max_length=20)
source = models.CharField(max_length=20)
total = models.IntegerField(default=200) |
from .. import eco_method
from ..variables import allocate
from .utilities import pad_z_edges, where
@eco_method(inline=True)
def _calc_cr(vs, rjp, rj, rjm, vel):
"""
Calculates cr value used in superbee advection scheme
"""
eps = 1e-20 # prevent division by 0
return where(vs, vel > 0., rjm, rjp)... |
#**
# @file Option_4_bio_mne_comparison.py
# @author Christoph Dinh <chdinh@nmr.mgh.harvard.edu>;
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# @version 1.0
# @date May, 2017
#
# @section LICENSE
#
# Copyright (C) 2017, Christoph Dinh. All rights reserved.
#
# @brief Model inverse operator wit... |
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from __future__ import unicode_literals
from ..one_drive_object_bas... |
from ._tree import Tree
from ..util import gini, count_dict, argmax
class ClassificationTree(Tree):
def __init__(self,
number_of_features,
number_of_functions=10,
min_sample_split=200,
predict_initialize={'count_dict': {}}):
# Constant ... |
from typing import Dict, Any
from xmltodict import parse # type: ignore # hints missing...
from xml.parsers.expat import ExpatError
from mds_logging import getLogger, timed
from gateway_request_environment_plugin import GatewayRequestEnvironment
from agw_request import AGWRequestResponse
from service_exception_handl... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import queue
import warnings
import torch
import pyro.poutine as poutine
from pyro.distributions.util import is_identically_zero
from pyro.infer.elbo import ELBO
from pyro.infer.enum import (
get_importance_trace,
iter_di... |
from twisted.internet import reactor
from spyd.game.client.exceptions import InvalidPlayerNumberReference
class ClientPlayerCollection(object):
def __init__(self, cn):
self.cn = cn
self.players = {}
def has_pn(self, pn=-1):
if pn == -1:
pn = self.cn
return pn in ... |
# Import subprocess so we can use system commands
import subprocess
# Import the re module so that we can make use of regular expressions.
import re
# Python allows us to run system commands by using a function provided by the subprocess module
# (subprocess.run(<list of command line arguments goes here>, <specify th... |
import os
import pathlib
import shutil
from pathlib import Path
import pytest
from teamcity import is_running_under_teamcity
from geolib.geometry.one import Point
from geolib.models import BaseModel, BaseModelStructure
from geolib.models.dstability import DStabilityModel
from geolib.models.dstability.analysis import ... |
import math
import torch
from torch._six import inf
from torchvision.utils import make_grid
import numpy as np
from tqdm import tqdm
def _grad_norm(parameters, norm_type=2):
r"""Compute gradient norm of an iterable of parameters.
The norm is computed over all gradients together, as if they were
concate... |
'''
tinkerer.ext
~~~~~~~~~~~~
Blogging extensions.
:copyright: Copyright 2011-2016 by Vlad Riscutia and contributors (see
CONTRIBUTORS file)
:license: FreeBSD, see LICENSE file
''' |
"""
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import argparse
import cv2
import numpy as np
import os
from sklearn.cluster import KMeans
from sklearn.cluster import MiniBatchKMeans
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from matplotlib import pyplot as plt
from sklearn import svm, datasets
from sklearn.model_selection import t... |
# MINLP written by GAMS Convert at 01/15/21 11:37:20
#
# Equation counts
# Total E G L N X C B
# 2935 1123 129 1683 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... |
import urllib2
from xml.dom import minidom
WHERE_API_APP_ID = "MoToWJjdQX4XzV34ELXxh3MLG5x1cgBMiMrEuJ.0D_bohsdQlv5p7qzQXLgXmWID_zPRxFULW454h3"
WHERE_API_URL = "http://where.yahooapis.com/v1/places.q(%s);count=1?appid=" + WHERE_API_APP_ID
WHERE_API_NS = "http://where.yahooapis.com/v1/schema.rng"
WEATHER_URL = 'http://x... |
from setuptools import setup
from setuptools_rust import Binding, RustExtension
setup(
name="cdjs",
version="0.1.5",
rust_extensions=[RustExtension("cdjs.cdjs", binding=Binding.PyO3)],
packages=["cdjs"],
author="ofhellsfire",
author_email="ofhellsfire@yandex.ru",
description="Custom Datetim... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import libs.common as common
import sys
import time
import pandas as pd
import tushare as ts
from sqlalchemy.types import NVARCHAR
from sqlalchemy import inspect
import datetime
####### 3.pdf 方法。宏观经济数据
# 接口全部有错误。只专注股票数据。
def stat_all(tmp_datetime):
# 存款利率
# d... |
"""Test the Settings service API.
"""
import pytest
import json
import json5
import tornado
from strict_rfc3339 import rfc3339_to_timestamp
from .utils import expected_http_error
from .utils import maybe_patch_ioloop, big_unicode_string
async def test_get(fetch, labserverapp):
id = '@jupyterlab/apputils-extensi... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: romanshen
@file: distributions.py
@time: 2021/05/07
@contact: xiangqing.shen@njust.edu.cn
"""
import torch
# Priors
def gaussian_prior(name, log2pi, mu, sigma, device):
"""
Args:
*args: {"mu": , "sigma":, "log2pi"}
Returns: log_gaussi... |
# -*- coding: utf-8 -*-
import os
import shutil
import unicodedata
import webbrowser
import requests
from wox import Wox,WoxAPI
from bs4 import BeautifulSoup
URL = 'http://bbs.sgcn.com/forum.php?mod=forumdisplay&fid=197&filter=author&orderby=dateline'
URL2 = 'http://bbs.sgcn.com/forum.php?mod=forumdisplay&fid=160&fi... |
# %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/contrib/utils-hillshadeRgb.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a targ... |
class DoublyNode:
def __init__(self, data):
self.data = data
self.leftlink = None
self.rightlink = None
def __str__(self):
return '| {0} |'.format(self.data)
def __repr__(self):
return "Node('{0}')".format(self.data)
def getdata(self):
return self.data... |
# coding=utf-8
import os
import time
import json
from django.shortcuts import render, get_object_or_404
from django.views.generic import View
from django.db.models import ObjectDoesNotExist
from pics.utils import _ajax_error, _ajax_success, _is_doubtful
from . import models as spider_models
# Create your views here... |
# -*- coding: utf-8 -*-
from unittest import TestCase
from nose import tools
from django.contrib import admin
from ella.core.models import Author
from ella.articles.models import Article
from ella.positions.admin import PositionOptions
from ella.positions.models import Position
class TestPositionAdmin(TestCase):
... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
from django.contrib.auth.models import User
from django.db import models
from app.core.base import BaseModel
class Structure(BaseModel):
parent = models.ForeignKey('Structure', on_delete=models.CASCADE)
users = models.ManyToManyField(User)
roles = models.ManyToManyField('Role')
name = models.CharF... |
# -*- coding: utf-8 -*-
import json
from datetime import datetime
import scrapy
from scrapy import Request
from scrapy import signals
from fooltrader.api.quote import get_security_list
from fooltrader.consts import SSE_KDATA_HEADER
from fooltrader.contract.files_contract import get_trading_dates_path_sse
from fooltr... |
# Developed by Alexander Bersenev from Hackerdom team, bay@hackerdom.ru
"""Common functions and consts that are often used by other scripts in
this directory"""
import subprocess
import sys
import time
import os
import shutil
# change me before the game
ROUTER_HOST = "127.0.0.1"
SSH_OPTS = [
"-o", "StrictHostK... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: data_ext.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.protobuf import reflection as _refl... |
import json
import logging
import os
import re
import sys
from collections import defaultdict
from multiprocessing import Pool
from mwm import mwm
class PromoIds(object):
def __init__(self, countries, cities, mwm_path, types_path, osm2ft_path):
self.countries = countries
self.cities = cities
... |
'''This file contains utilities common to all type of files and associated with the editor'''
from tkinter import *
from threading import *
from utils import *
def TellPos(command, editor, count, activity_log, code_input):
'''
Tells the current position of the cursor
'''
pos = "at line "
pos = pos... |
import numpy as np
import scipy.signal as sig
from scipy.integrate import cumtrapz
from .rotate import inst2earth, _rotate_vel2body
import warnings
class CalcMotion(object):
"""
A 'calculator' for computing the velocity of points that are
rigidly connected to an ADV-body with an IMU.
Parameters
... |
from __future__ import division
from __future__ import unicode_literals
# look here for improvements...
# http://www.arnebrodowski.de/blog/write-your-own-restructuredtext-writer.html
import codecs
import os
import xml.etree.ElementTree as ET
from subprocess import Popen, PIPE
from django.utils.safestring import mar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.