text stringlengths 1 927k |
|---|
# Copyright 2018 The TensorFlow Probability 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 o... |
import logging
import os
import typing
from dbnd._core.constants import TaskEssence, _TaskParamContainer
from dbnd._core.current import get_databand_run
from dbnd._core.parameter.parameter_builder import parameter
from dbnd._core.parameter.parameter_definition import (
ParameterDefinition,
ParameterScope,
)
fr... |
# -*- coding: utf-8 -*-
import pytest
import responses
@responses.activate
def test_cursor_supported(api_factory):
json = """
{
"works": [
{
"id": 4168,
"title": "SHIROBAKO",
"title_kana": "しろばこ",
"media": "tv",
"media_text": "TV",
"sea... |
from freezegun import freeze_time
from salesforce_timecard.core import TimecardEntry
import pytest
import json
@freeze_time("2020-9-18")
@pytest.mark.vcr()
@pytest.mark.block_network
def test_list_timecard():
te = TimecardEntry("tests/fixtures/cfg_user_password.json")
rs = te.list_timecard(False, "2020-09-1... |
# Copyright (C) 2015 Stefan C. Mueller
import unittest
import twistit
from twisted.internet import error
class TestTimeMock(unittest.TestCase):
def setUp(self):
self.target = twistit.TimeMock()
def mock_f():
self.f_called_at = self.target.seconds()
self.... |
import readability.functions.readabilityFunctions
import readability.functions.abstract_cleanup
import readability.functions.convert_id
import readability.functions.dataminingfunctions |
#!/usr/bin/env python
"""Definition of grr_export plugin."""
import threading
import logging
from grr.lib import data_store
from grr.lib import export
from grr.lib import output_plugin as output_plugin_lib
from grr.lib import registry
from grr.lib import threadpool
from grr.lib import utils
class ExportPlugin(ob... |
import ast
import inspect
import os
# From https://gist.github.com/Xion/617c1496ff45f3673a5692c3b0e3f75a
def get_short_lambda_body_text(lambda_func):
"""Return the source of a (short) lambda function.
If it's impossible to obtain, returns None.
"""
try:
source_lines, _ = inspect.getsourcelines... |
# 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 ... |
# Copyright Philip Morris Products S.A. 2019
from .Config import Config, OCRConfig
from .BCScanner import BCScanner
from .CardSplitter import CardSplitter
from .OCR import OCR
from . import utils |
import collections
import datetime
import math
import sys
with open('combined.csv', 'r') as f:
rows = f.readlines()
combined_entries_per_turnstile = collections.defaultdict(lambda: collections.defaultdict(int))
# not grouping by subway line for now
for row in rows:
split = row.split(',')
if len(split) !=... |
from core.advbase import *
from slot.a import *
from slot.d import *
from module.x_alt import X_alt, Fs_alt
def module():
return Tiki
# divine dragon mods
tiki_conf = {
'x1.dmg': 7 / 100.0,
'x1.sp': 88,
'x1.utp': 2,
'x1.startup': 12 / 60.0,
'x1.recovery': 0,
'x1.hit': 1,
'x2.dmg': 15 ... |
'''
Created by auto_sdk on 2016.05.10
'''
from top.api.base import RestApi
class AlibabaBaichuanAppeventUploadRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.appid = None
self.bizid = None
self.params = None
def getapiname(self):
return 'ali... |
import base64
import uuid
import os
import re
from decimal import Decimal
from openpyxl.chart import PieChart, LineChart, Reference
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
from openpyxl.drawing.image import Image
from openpyxl import Workbook
from openpyxl.chart.label import DataLabelList... |
# 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! ***
from ... import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .bandwidth_schedule import *
from .cont... |
"""
License terms and conditions for Janssen:
https://www.apache.org/licenses/LICENSE-2.0
"""
import codecs
import os
import re
from setuptools import setup
from setuptools import find_packages
def find_version(*file_paths):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(he... |
import imp
import platform
import sys
from ctypes import (cdll,
POINTER, pointer,
c_char_p,
c_size_t, c_double, c_int, c_uint64, c_uint32,
create_string_buffer)
# Linux
if platform.system() == 'Linux':
if platform.architecture()[0] == '6... |
from django.contrib.contenttypes.generic import GenericForeignKey
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models.base import ModelBase
from django.db.models.signals import post_save
from django.template.defaultfilters import truncatewords_html
from django.utils.... |
import pandas as pd
import numpy as np
from fbprophet import Prophet
import pickle
import math
import scipy.optimize as optim
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
import covid19_prepare_data as prepare_data
import logging
logging.getLogger('fbprophet').setLevel(logging.WARNING)
... |
r"""
Normal form games with N players.
This module implements a class for normal form games (strategic form games)
[NN2007]_. At present 3 algorithms are implemented to compute equilibria
of these games (``'lrs'`` - interfaced with the 'lrslib' library, ``'LCP'`` interfaced
with the 'gambit' library and support enumer... |
#
#*******************************************************************************
# Copyright 2014-2020 Intel Corporation
#
# 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.a... |
import json
import logging
import requests
logger = logging.getLogger(__name__)
class HealthCheck():
def __init__(self, backup_config):
self.backup_name = backup_config['Name']
self.url = backup_config['HealthCheckUrl']
def push(self, initialize=None, failure=None):
logger.debug(
... |
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == "win32":
base = "Win32GUI"
executables = [
Executable("LukeKong.py", base=base)
]
buildOptions = dict(
packages = [],
includes = [],
include_files = [],
excludes = []
)
setup(
name =... |
import argparse
import RDT_3_0
import time
def makePigLatin(word):
m = len(word)
vowels = "a", "e", "i", "o", "u", "y"
if m<3 or word=="the":
return word
else:
for i in vowels:
if word.find(i) < m and word.find(i) != -1:
m = word.find(i)
if m==0:
... |
#!/usr/bin/env python
"""Reverse mask a region.
Create an image that masks everything except for the specified polygon.
"""
import ee
from ee_plugin import Map
Map.setCenter(-100, 40, 4)
fc = (ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA')
.filter(ee.Filter().eq('ECO_NAME', 'Great Basin s... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import sys
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
numba = pytest.importorskip("numba")
ak_numba = pytest.importorskip("awkward._con... |
from django.urls import path
from .views import MakeUsersView, OTPVerify, RegisterView, LoginView, LogoutView, TeamList, UserAvatarUpdate, UserCartUpdate, UserCheckout, UserCriteria, UserDetail, UserExistsView, UserUpdate
urlpatterns = [
path('auth/register/', RegisterView.as_view()),
path('auth/login/', Login... |
# flake8: noqa F401
from .ethereum_client import (
EthereumClient,
EthereumClientProvider,
FromAddressNotFound,
GasLimitExceeded,
InsufficientFunds,
InvalidNonce,
NonceTooHigh,
NonceTooLow,
ReplacementTransactionUnderpriced,
SenderAccountNotFoundInNode,
TransactionAlreadyImpo... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fact/controller.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google... |
import logging
from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class FactsCalculatorOperator(BaseOperator):
facts_sql_template = """
DROP TABLE IF EXISTS {destination_table};
CREATE TABLE {destination_table} ... |
"""
Code adapted from https://github.com/TonghanWang/ROMA
"""
from collections import defaultdict
import logging
import numpy as np
import torch
class Logger:
def __init__(self, console_logger):
self.console_logger = console_logger
self.use_tb = False
self.use_sacred = False
self... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
# 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 appli... |
# -*- coding: utf-8 -*-
# when web2py is run as a windows service (web2py.py -W)
# it does not load the command line options but it
# expects to find configuration settings in a file called
#
# web2py/options.py
#
# this file is an example for options.py
import socket
import os
#ip = '0.0.0.0'
port = 8000
interfac... |
"""
Copyright (C) 2015-2021 Alibaba Group Holding Limited
MicroPython's drive for SPL06
Author: HaaS
Date: 2021/09/09
"""
from driver import I2C
from utime import sleep_ms
import math
EEPROM_CHIP_ADDRESS = 0x77
spl06_dict = {'Ctemp': 0.0, 'Ftemp': 0.0,'pressure': 0.0, 'altitude': 0.0}
class SPL06(obj... |
import os
import json
from cas import CASClient
from urllib.parse import urlunparse
SSO_UI_URL = "https://sso.ui.ac.id/cas2/"
SSO_UI_FORCE_SERVICE_HTTPS = False
def normalize_username(username):
return username.lower()
def get_protocol(request):
if request.is_secure or SSO_UI_FORCE_SERVICE_HTTPS:
re... |
import numpy as np
import gym
from gym import spaces
import time
class RAEnv(gym.Env):
metadata = {
'render.modes': ['rgb_array'],
'video.frames_per_second': 50
}
def __init__(self):
self.action_space = spaces.Box(low=np.array([-1., -1.]), high=np.array([1., 1.]), dtype=np.float32)
self.observation_space = s... |
###
# Copyright (c) 2004, Brett Kelly
# Copyright (c) 2010, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice... |
from reconbf.modules import test_kernel
from reconbf.lib.result import Result
from reconbf.lib import utils
import unittest
from mock import patch
class PtraceScope(unittest.TestCase):
def test_no_yama(self):
with patch.object(utils, 'kconfig_option', return_value=None):
res = test_kernel.tes... |
import os
import unittest
import math
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
#
# ModelRegistration
#
class ModelRegistration(ScriptedLoadableModule):
def __init__(self, parent):
ScriptedLoadableModule.__init__(self, parent)
self.parent.title = "Model Registrati... |
#!/usr/bin/env python2
#
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... |
import datetime
from django.utils import timezone
from ..utils import get_current_fiscal_year, get_fiscal_year_range
class TestUtils:
def test_get_current_fiscal_year(self):
now = timezone.now()
fiscal_year_end = timezone.make_aware(datetime.datetime(now.year, 6, 30))
current_fiscal_yea... |
import numpy as np
from . import hst_observation, spectroscopy
datasets = ['ld9m10ujq', 'ld9m10uyq']
visit1 = hst_observation.Visit(datasets, 'cos', prefix='data/')
line_list = spectroscopy.COSFUVLineList(wavelength_shift=.0,
range_factor=1.0).lines
tr = 'Si III'
line = 0
ref_... |
# MIT License
#
# Copyright (c) 2019 Edward D. Lee, Bryan C. Daniels
#
# 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,... |
from __future__ import absolute_import
import datetime
import json
import logging
import os.path
import sys
from pip._vendor import lockfile, pkg_resources
from pip._vendor.packaging import version as packaging_version
from pip._internal.index import PackageFinder
from pip._internal.utils.compat import WINDOWS
from ... |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
from operator import index
import re
import time
import random
import requests
from pyquery import PyQuery as pq
from fetchers.BaseFetcher import BaseFetcher
class XiaoShuFetcher(BaseFetcher):
"""
http://www.xsdaili.cn/
代码由 [Zealot666](https://github.com/Zealot666) 提供
"""
index = 0
def fetch... |
import os
import re
import time
import hashlib
import precompiler
import precompiler._impl.pc_output as _impl_pc_output
import precompiler._utils.pc_utils as _pc_utils
import precompiler._utils.pc_file_utils as _pc_file_utils
class FileDataAdapter(object):
def __init__(self,_name,_file_interface):
self.name = _na... |
FINE_TUNE_CHECKPOINT = "" |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from Octopus.dataframe.core.utils import derived_from
__all__ = ["AbstractDataFrame"]
class AbstractDataFrame(object):
def __init__(self, data=None, index=None, columns=None, dtype=None,
copy=False):
self.dataframe = da... |
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from config import Config
db = SQLAlchemy()
login_manager = LoginManager()
migrate = Migrate()
def create_app():
app = Flask(__name__)
app.config.from_object... |
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
import os
import sys
import urllib
from common_includes import *
import chromium_roll
class CheckActiv... |
#!/usr/bin/python
from log_utils import logger
from cli_utils import CLIUtils
from constants import *
(out, err) = CLIUtils.run(LIST_NODES_CMD)
logger.debug('list of containers: {}'.format(out))
lines = out.strip().split("\n")
for i in range(1, len(lines)):
container_id = lines[i].split()[0]
(out, err) = CLIU... |
import os
import uuid
import pytest
from flask import Flask, Response, g
from flask_soocii_auth import SoociiAuthenticator, users, exceptions
from soocii_services_lib import auth
class TestFlaskSoociiAuth:
app = None
client = None
def setup_method(self, _):
self.app = Flask(__name__)
se... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: radar_sta775.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sym... |
"""
This file contains the class definition for the sampler MCMCSample classes.
"""
__author__ = 'Brandon C. Kelly'
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
import acor
class MCMCSample(object):
"""
Class for parameter samples generated by a yamcmc++ sampler. This class con... |
#!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Page related class."""
from typing import Callable, Iterator, Optional, Sequence, TypeVar, Union, overload
_T = TypeVar("_T")
class PageBase(Sequence[_T]):
"""PageBase is the base class of array wrapper and represents a page in... |
#!/usr/bin/env python
import argparse
import logging
import os.path
import shutil
import subprocess
import yaml
# The path used by the bootstrapper
BOOTSTRAPPER_REGISTRY = "/opt/registries/kubeflow/kubeflow"
# The current release of Kubeflow. This should be upgraded on every release.
CURRENT_RELEASE = "github.com/kub... |
# Generated by Django 2.2.1 on 2019-10-27 08:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comedians', '0005_registercomedian_test_multi_field'),
]
operations = [
migrations.RemoveField(
model_name='registercomedian',
... |
#!/usr/bin/env ipython
import roslib
roslib.load_manifest('robot_control')
import rospy
import tf
from geometry_msgs.msg import Twist, PoseStamped, PointStamped
from visualization_msgs.msg import Marker
import message_filters
from math import atan2, hypot, pi, cos, sin, pi, fmod, exp
from tf.transformations import eul... |
from collections import Counter
import pandas as pd
import pytest
from preprocessy.encoding import Encoder
ord_dict = {"Profession": {"Student": 1, "Teacher": 2, "HOD": 3}}
# test for empty input
def test_empty_df():
params = {"target_label": "Price", "ord_dict": ord_dict}
with pytest.raises(ValueError):
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-16 11:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Classes'... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,re,shutil
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding 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-... |
# Copyright (c) 2018 Intel Corporation
#
# 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... |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from ..azure_common import BaseTest
class LogicAppTest(BaseTest):
def test_azure_logic_app_workflow_schema_validate(self):
p = self.load_policy({
'name': 'test-azure-logic-app-workflow',
'resource': 'azu... |
# 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
#
#Unless required by applicable... |
#!/usr/bin/python
import base64
import time
import socket
import ssl
import threading
import pprint
import sys
import pkgutil
import os
# Global variables
BASE_PATH='./sample'
CA_PATH = BASE_PATH + '/rootCA.pem'
PORT = 3000
HOST = 'localhost'
# Function that configures and starts the server
def start_server(securit... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
"""Script for experiments with standard learning with GNNs (including GIB-GAT, GAT, GCN and other baselines.)"""
import argparse
from copy import deepcopy
import datetime
import matplotlib.pylab as plt
import numpy as np
import pickle
import torch
import torch.nn as nn
... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
import unittest
from pulsar.utils.httpurl import Headers, SimpleCookie
class TestHeaders(unittest.TestCase):
def testServerHeader(self):
h = Headers()
self.assertEqual(len(h), 0)
h['content-type'] = 'text/html'
self.assertEqual(len(h), 1)
def testHeaderBytes(self):
h... |
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... |
# plotting
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
# numpy
import numpy as np
# scipy
import scipy as sp
import scipy.interpolate
from scipy.special import erfinv, erf
from scipy.stats import poisson as pss
import scipy.fftpack
import scipy.sparse
# jit
from numb... |
import numpy as np
import altair as alt
import pandas as pd
import streamlit as st
st.header('st.write')
# Example 1
st.subheader('Display text')
st.write('Hello, *World!* :sunglasses:')
# Example 2
st.subheader('Display numbers')
st.write(1234)
# Example 3
st.subheader('Display DataFrame')
df = pd.DataFrame({
... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... |
import json
from packlib.base import ProxmoxAction
class NodesNodeReplicationIdSchedule_nowAction(ProxmoxAction):
"""
Schedule replication job to start as soon as possible.
"""
def run(self, prox_id, node, profile_name=None):
super().run(profile_name)
# Only include non None argument... |
from flask import Flask
from flask import request
from sense_hat import SenseHat
sense = SenseHat()
sense.set_rotation(180)
sense.clear()
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
@app.route('/display', methods=['POST'])
def display():
data = request.get_json()
message = ... |
"""
createSuperFlowStrikeList.py
Description:
Create a Test Model from scratch.
What this script does:
- Login to BPS box
- Create a new superflow from scratch
- Add flow and actions to the new created superflow
- Save the superflow
- Edit parameters inside an action
- Remove action
- Create a... |
# Copyright (c) 2015, MapR Technologies
#
# 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... |
from django.urls import path
from direzione.views import (ConventionListView, ConventionDetailView, )
app_name = 'conventions'
urlpatterns = [
path('', ConventionListView.as_view(), name = 'index'),
path('<slug>/', ConventionDetailView.as_view(), name = 'detail'),
] |
import pathlib
from setuptools import find_packages, setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text(encoding='utf-8')
requirements = [
'requests<3.0,>=2.25.1',
'PySocks==1.7.1'
]
setup(
name='PyPasser',
version='0.0.5',
author='xHossein',
license='MIT',
... |
from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
app.run( debug = True ) |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-09 19:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from cmsplugin_cascade.models import CascadeElement, CascadePage, IconFont
def forwards(apps, schema_editor):
for cascade_ele... |
__version__ = "0.7.0"
class ServiceApp(App):
def build(self):
from jnius import autoclass
Intent = autoclass('android.content.Intent')
LbrynetService = autoclass('io.lbry.browser.LbrynetService')
if __name__ == '__main__':
ServiceApp().run() |
from api_client import NeuroeneftAPI
api = NeuroeneftAPI(API_URL='http://127.0.0.1:10000')
print(api.get_predprice_for_date("2020-10-10"))
print(api.get_predprice_for_period("2020-10-10", "2020-11-10")) |
# Copyright 2017 Natural Language Processing Group, Nanjing University, zhaocq.nlp@gmail.com.
#
# 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... |
import os
import sys
if sys.platform == 'win32':
pybabel = 'pybabel'
else:
pybabel = 'flask/bin/pybabel'
if len(sys.argv) != 2:
print "usage: tr_init <language-code>"
sys.exit(1)
os.system(pybabel + ' extract -F bin/babel.cfg -k gettext -o emonitor\\modules\\translations\\modules.pot emonitor\\modules'... |
import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
... |
from switch_demo.app import main
if __name__ == '__main__':
main().main_loop() |
from pyp5js import *
"""
Demo for bar and var_bar
"""
def setup():
size(400, 400)
def draw():
background(200)
fill(0)
text("press any key to see p_arc polygonal aproximantion used", 20, 20)
fill(0, 0, 200, 100)
line(50, 50, 350, 250)
if not keyIsPressed:
# By default arc_func=b_ar... |
from cctbx import miller
import cctbx
from cctbx import crystal
ms = miller.build_set(
crystal_symmetry=crystal.symmetry(
space_group_symbol="Fd-3m",
unit_cell=("5.4307,5.4307,5.4307,90.00,90.0,90.00") ),
anomalous_flag=False,
d_min=0.4)
for hkl in ms.indices():
print(hkl)
# map the r... |
from django.contrib import admin
from .models import Category, Product
admin.site.register(Category)
admin.site.register(Product) |
#############################################
# Plazabot - pb_crawler.py
# (c)2021, Doubtfull Productions
#--------------------------------------------
# Site crawler
#--------------------------------------------
# TODO This script should round alongisde the API
#--------------------------------------------
# Inclu... |
"""
single channel speech enhancement for wind noise reduction.
refer to
"A Convolutional Recurrent Neural Network for Real-Time Speech Enhancement" .
Authors
* Wang Wei 2021
"""
import torch
import torch.nn as nn
class CNN_Block(torch.nn.Module):
def __init__(self,
in_channels,
out_channels... |
from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from django import forms
from .models import News, Category
from tinymce.widgets import TinyMCE
class NewsForm(forms.ModelForm):
text = forms.CharField(widget=TinyMCE(attrs={"cols": 80, "rows": 100}))
... |
# Copyright 2010 Google Inc.
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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 re... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
'''
Created on Mar 2, 2013
@author: Gary
''' |
import logging
from aiogram import Dispatcher
from data.config import load_admins
async def on_startup_notify(dp: Dispatcher):
for admin in await load_admins():
try:
await dp.bot.send_message(admin, "Бот Запущен и готов к работе")
except Exception as err:
logging.exceptio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.