content stringlengths 5 1.05M |
|---|
"""add three time filed
Revision ID: 9299cbcf6d8b
Revises: ed535bd21f09
Create Date: 2019-12-12 15:35:20.075155
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9299cbcf6d8b'
down_revision = 'ed535bd21f09'
branch_labels = None
depends_on = None
def upgrade():... |
import numpy as np
def clean_data(df, out_df_dir=""):
df.dropna(axis=1, inplace=True)
if out_df_dir:
df.to_csv(out_df_dir)
return df
# Calculate log change of daily price
def log_change(series):
return np.log(series[1] / series[0])
# Calculate correaltion
def calculate_... |
from re import search
import jsonpickle
COMMAND_RESULT_PREFIX = "command_json_result="
COMMAND_RESULT_POSTFIX = "=command_json_result_end"
def get_result_from_command_output(output):
"""
Extracts result from output
:param output: Console output as returned from command execution
:return: Deserialized... |
# coding: utf-8
from collections import OrderedDict
from pymemcache.client.base import _readline, _readvalue, Client
from pymemcache.exceptions import MemcacheUnknownError
class MockMcClient(Client):
def get_many(self, keys):
"""
Mock function for get_many to fix uq pop bug temporarily.
... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# Advent of Code 2016
#
# From https://adventofcode.com/2016/day/2
#
import numpy as np
MOVES = {'L': [0, -1],
'R': [0, 1],
'U': [-1, 0],
'D': [1, 0],
}
pad1 = np.array([['1', '2', '3'],
['4', '5', '6'],
['7', '8', '9']])
pad2 = np.array([[None, No... |
from classlist_get import Classlist_get
from a10 import A10
a10 = A10(username='admin',password='a10',ipaddr='192.168.201.15')
classlist_get = Classlist_get(username='admin',password='a10',ipaddr='192.168.201.15')
a10.login()
#sign = (a10.signature)
#print (a10)
print (a10.signature)
#a10 = A10(username='admi... |
"""
This script runs the miller optimal control problem with a given set of parameters and save the results.
The main function is used in main_comparison.py and main_convergence.py. to run the different Miller optimal control problem.
"""
import numpy as np
from bioptim import OdeSolver, CostType
from bioptim import So... |
import sys,re,os,numpy
startspace='\s*'
oneint='(?P<%s>[-\d]+)\s+'
endint='(?P<%s>[-\d]+)\s*'
onechar='(?P<%s>\S+)\s+'
endchar='(?P<%s>\S+)\s*'
twointpair='(?P<%s>[-\d]+),(?P<%s>[-\d]+)\s*'
next_re='\s*(?P<next>[\s\S]*)';
v_para=('version','fileformat_version');
v_re=(startspace+oneint+endint+next_re)#%v_para;
L_para=... |
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N, M):
# write your code in Python 3.6
if N == 1:
return 1
eat_set = {0}
counter = 1
while True:
eat_number = (M * counter) % N
if eat_number in eat_set:
... |
import io
import os
import sys
import time
from portalocker import LOCK_EX, lock, unlock
from contextlib import contextmanager
from secrets import randbits
from logging.handlers import BaseRotatingHandler, TimedRotatingFileHandler
from logging import FileHandler
_MIDNIGHT = 24 * 60 * 60 # number of seconds in a da... |
import os, sys, pygame, random, array, gamemode, FlappyBird
import MAIN,spacein
import direction, bounds, timeout, menu
from pygame.locals import *
# Import game modules.
from loader import load_image
import player, maps, traffic, camera, tracks
mainClock = pygame.time.Clock()
from pygame.locals import *
bg = pygame... |
from datetime import date
atual = date.today().year
totmaior = 0
totmenor = 0
for p in range(1, 8):
nasc = int(input('Em que ano a {}° pessoa nasceu? '.format(p)))
idade = atual - nasc
print('Sua idade é {} anos'.format(idade))
if idade < 21:
totmenor += 1
else:
totmai... |
from enum import IntEnum
from sdl2._sdl2 import lib
class KeyCode(IntEnum):
n0 = lib.SDLK_0
n1 = lib.SDLK_1
n2 = lib.SDLK_2
n3 = lib.SDLK_3
n4 = lib.SDLK_4
n5 = lib.SDLK_5
n6 = lib.SDLK_6
n7 = lib.SDLK_7
n8 = lib.SDLK_8
n9 = lib.SDLK_9
ac_back = lib.SDLK_AC_BACK
ac_boo... |
def main():
#problem1()
#problem2()
#problem3()
#problem4()
#challenge()
#PROBLEM1
#Create a variable named favoriteTeacher and assign it "Kevin".
# Send the favoriteTeacher variable to a function that will display the item when something is sent to it.
def problem1():
favoriteTeacher = "Kevin"... |
from aries_cloudagent.config.injection_context import InjectionContext
from aries_cloudagent.config.provider import ClassProvider
from aries_cloudagent.core.protocol_registry import ProtocolRegistry
from aries_cloudagent.core.plugin_registry import PluginRegistry
from .v1_0.message_types import MESSAGE_TYPES
from .def... |
#!/usr/bin/env python
# coding=utf-8
from BBScan.tmp import *
class Args(object):
# 现在默认一下
def __init__(self, host=None, f=None, network=None):
self.f = f
self.d = ""
self.crawler = ""
# host是一个列表
self.host = host
# 默认的为True
self.full_scan ... |
# Copyright 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""
Common infrastructure fo... |
import numpy as np
from config import *
def ensure_folder(folder):
if not os.path.exists(folder):
os.makedirs(folder)
class AverageMeter(object):
"""
Keeps track of most recent, average, sum, and count of a metric.
"""
def __init__(self):
self.reset()
def reset(self):
... |
import numpy as np
import math as m
# Write a function that takes as input a list of numbers, and returns
# the list of values given by the softmax function.
def softmax(L):
ret = []
i = 0
totalExp = 0.
while i < len(L):
totalExp+=m.e**L[i]
i+=1
i = 0
while i < ... |
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : __init__.py
# Abstract :
# Current Version: 1.0.0
# Date : 2021-05-31
###... |
from django.contrib import admin
from scrape import views
from django.conf import settings
from django.conf.urls import patterns, include, url
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.LicenseeCertListView.as_view(), name='licenseecert-list'),
]
if settings.DEBUG:
import debug_too... |
# -*- encoding: utf-8 -*-
'''
@Time : 2018-3月26
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc : 圆检测
'''
# here put the import lib
import cv2 as cv
import numpy as np
def detect_circle_demo(image):
dst = cv.pyrMeanShiftFiltering(image, 10, 100) # 模糊
gray = cv.cvtColor(dst... |
""" Cisco_IOS_XR_man_xml_ttyagent_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR man\-xml\-ttyagent package configuration.
This module contains definitions
for the following management objects\:
xr\-xml\: XML
netconf\: netconf
Copyright (c) 2013\-2018 by Cisco Systems, Inc.
All righ... |
from PIL import Image, ImageDraw, ImageFont # pip install pillow
import numpy
import cv2
import sys, os
FONT_MARGIN = 2
COLOR_MAP = {
'1': (255, 35, 11),
'0': (16, 194, 20),
'C': (136, 0, 21),
'D': (7, 92, 10)}
OUTPATH = 'output'
def get_attr(info, default=None, isBoolean=False):
value = in... |
from flask import Flask
import pymongo
app = Flask(__name__)
@app.route("/")
def hello():
return "404 Page Not Found"
@app.route("/<sht>", methods=["GET"])
def retr(sht):
client = pymongo.MongoClient("mongodb+srv://username:password@cluster0-fvejx.gcp.mongodb.net/test?retryWrites=true&w=majority")
colle... |
#!/usr/bin/env python
# make-example.py
import latexpages
if __name__ == '__main__':
latexpages.make('example/latexpages.ini')
|
#! /usr/bin/env python
from setuptools import setup, find_packages
CLASSIFIERS = [
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Pyt... |
import websocket
import ssl
import json
import time
import threading
import logging
import sys
logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s")
log = logging.getLogger(__name__)
consoleHandler = logging.StreamHandler(sys.stdout)
consoleHandler.setFormatter(logFo... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import sys
def main():
import platform
print(platform.architecture())
print(sys.version)
options = Options()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
... |
print('\033[30m-'*35)
print('ANÁLISE DE EXPRESSÕES')
print('-'*35)
expr = str(input('Digite uma expressão: ')).strip()
lista = []
'''for c in range(0, len(expr)):
lista.append(expr[c])
if lista.count('(') == lista.count(')') and '(' in lista[0] and ')' in lista[-1]:
print('Sua expressão está válida')
else:
... |
from setuptools import setup
setup(
name='pyoxr',
packages=['pyoxr'],
version='1.6',
description='Python client for openexchangerates.org',
author='RetargetApp',
url='https://github.com/retargetapp/pyoxr',
keywords=['openexchangerate', 'client', 'api'],
classifiers=[]
)
|
from time import sleep
v1 = int(input('Primeiro valor: '))
v2 = int(input('Segundo valor: '))
opção = 0
while opção != 5:
print(''' [ 1 ] somar
[ 2 ] multiplicar
[ 3 ] maior
[ 4 ] novos números
[ 5 ] sair do programa''')
sleep(1)
opção = int(input('>>>>>> Qual é a sua opção? ')... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.TaskListView.as_view(), name='index'),
path('<int:pk>', views.TaskDetailView.as_view(), name='task-detail'),
path('create/', views.TaskCreate.as_view(), name='task_create'),
path('<int:pk>/update/', views.TaskUpdate.as_view... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# -*- coding: utf-8 -*-
from django.db import models
class TimeStampedModel(models.Model):
"""
A abstract model that provides self-updating (created) and modified fields.
"""
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
class Meta:
... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import collections
import io
import json
import librosa
import numpy as np
import soundfile as sf
import time
import torch
from scipy.io.wavfi... |
# validated: 2017-09-28 DS cedbafeb286d cpp/NetworkConnection.cpp cpp/NetworkConnection.h cpp/INetworkConnection.h
"""----------------------------------------------------------------------------"""
""" Copyright (c) FIRST 2017. All Rights Reserved. """
""" Open Source Software - may be modif... |
from dotenv import load_dotenv
load_dotenv()
import os
from pyflarum.client import FlarumUser
from pyflarum.client.flarum.core.posts import PostFromNotification
from pyflarum.client.extensions import absolutely_all
EXTENSIONS = [
absolutely_all.AbsolutelyAllExtension
]
USER = FlarumUser(forum_url=os.environ[... |
#!/usr/bin/python
"""
get sensor date from GLT export File
sort of power consumption, temperature, and climate data
there is a big utf-8 issue, because the keys are utf-8 encoded
decode early
unicode everywhere
encode late
"""
import requests
import datetime
import os
def get_data(url, headers):
res = requests.r... |
# Generated by Django 2.0 on 2018-09-21 11:19
import base.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0002_auto_20180921_1056'),
]
operations = [
migrations.AlterField(
model_name='key',
name='g',
... |
"""
Tests for games.
"""
import unittest
from unit_tests import ModuleTest
from copy import deepcopy
from gym.envs.classic_control import cartpole, mountain_car
from spikey import Key
from spikey import games
from spikey.meta import metagames
class FakeTrainingLoop:
def __init__(self):
pass
def copy(... |
import os
import os.path as osp
import glob
from setuptools import setup, find_packages
import torch
from torch.utils.cpp_extension import BuildExtension
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
WITH_CUDA = torch.cuda.is_available() and CUDA_HOME is not None
if os.getenv('FORCE_CUD... |
def print_formatted(number):
n=len(bin(number)[2:])
for i in range(1,number+1):
print(str(i).rjust(n,' '),oct(i)[2:].rjust(n,' '),hex(i)[2:].upper().rjust(n,' '),bin(i)[2:].rjust(n,' '))
|
'''
Created on Jun 4, 2017
@author: Asus-PC
'''
|
import os
import pickle
import numpy as np
import pandas as pd
import feature_impact
from feature_generation import add_features
RESULT_DTYPES = {'BusinessModelRisk': np.int32,
'DesireToInvest': np.int32,
'ManagementShareholdersConflict': np.int32,
'NegativeSharehol... |
from django import template
from django.template import (Node, Variable, TemplateSyntaxError, Library)
from django.template.base import Parser as TokenParser
from phrase.compat import TOKEN_TEXT, TOKEN_VAR
from django.template.defaulttags import token_kwargs
from django.conf import settings
from django.utils import tra... |
import os
import sys
os.path.join(os.path.abspath(os.path.dirname(__file__)))
|
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 28 10:15:29 2017
@author: Kjell
"""
import time
import math
from AirSimClient import *
# connect to the AirSim simulator
client = MultirotorClient()
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)
def straight(duration, speed):
pi... |
import os
import unittest
try:
from unittest.mock import patch, call
except ImportError:
from mock import patch, call
from botocore.exceptions import ClientError as BotocoreClientError
from datadog.api.exceptions import ClientError
from datadog_lambda.metric import (
decrypt_kms_api_key,
lambda_metric... |
#!/usr/bin/python
import os, sys # low level handling, such as command line stuff
import string # string methods available
import re # regular expressions
import getopt # comand line argument handling
from low import * # custom functions, written by myself
from collections import defaultdict
im... |
from django.db import models
# Create your models here.
# each class -- a table in db
# each var in class -- column in that table
class Post(models.Model):
title = models.CharField(max_length = 240)
body = models.TextField()
def __str__(self):
return self.title
|
from django.conf import settings
from django.utils.module_loading import autodiscover_modules
default_app_config = 'djangae.contrib.search.apps.SearchConfig'
DJANGAE_SEARCH_QUEUE_SETTING = "DJANGAE_SEARCH_QUEUE"
_SEARCH_QUEUE = getattr(settings, DJANGAE_SEARCH_QUEUE_SETTING, "default")
def autodiscover():
# Thi... |
from flask import Flask, render_template
from bokeh.embed import server_document
app = Flask(__name__)
@app.route('/', methods=['GET'])
def bkapp_page():
script = server_document('http://localhost:5006/bkapp')
return render_template("embed.html", script=script, template="Flask")
if __name__ == '__main__':
... |
#! /usr/bin/env python
# Viewer for archives packaged by archive.py
# Copyright (C) 2005-2011, Giovanni Bajo
# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as p... |
import json
import os
import re
from flask import current_app
import src.flag
import src.md.md
from .cache import get_file_cache
from .const import index_url_key, index_title_key, index_parent_key, index_id_key, index_highlight_key, \
index_top_key, index_notags_key, index_fixed_key, index_tags_key, index_date_ke... |
# Generated by Django 2.2.8 on 2020-01-20 17:40
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('django_eveonline_service_manager', '0003_auto_20200120_1740'),
]
operations = [
migrations.RenameField(
model_name='... |
# -*- coding: utf-8 -*-
"""
Written by Daniel Moseguí González
GitHub: user:mosegui
LinkedIn: https://www.linkedin.com/in/daniel-moseguí-gonzález-5aa02849/
"""
import logging
import numpy as np
import matplotlib.style
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import mpl_finance as fnc
from pan... |
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Look up port numbers for a service by name.
"""
# end_pymotw_header
import socket
from urllib.parse import urlparse
URLS = [
"http://www.python.org",
"https://www.mybank.com",
"ftp://prep.ai.mit.edu",
"gopher://gopher.micro.umn.edu",
"... |
from instruction import *
StringList = List[str]
metaPrefix = "#meta"
class Program:
def __init__(self, lines: StringList):
self.instructions = list()
# metadata
meta = ""
registers = set()
for l in lines:
if l.startswith(metaPrefix):
meta = l[l... |
from ..utils.constants import *
from ..utils.vector3 import vec3
import numpy as np
class Primitive:
def __init__(self, center, material, max_ray_depth=1, shadow=True, mc=False):
self.center = center
self.material = material
self.material.assigned_primitive = self
self.sh... |
#!/usr/bin/python
import json
import subprocess
import docker
import sys
import time
from communication import Communication
from data import Data
from message import ComplexEncoder
from message import Message
from observation import Observation
def run(cmd):
res = subprocess.check_output(cmd, shell=True)
r... |
from flask import Flask, flash, render_template, redirect, send_from_directory, url_for, request
import os, random, copy
from werkzeug.useragents import UserAgent
# from flask_bootstrap import Bootstrap
from flask_login import (
LoginManager,
current_user,
login_required,
login_user,
logout_user,
)
... |
import subprocess
import pexpect
import re
import os
from PySide2 import QtWidgets, QtGui, QtCore
from pygears.conf import Inject, MayInject, bind, inject
native_key_map = {
0xff08: QtCore.Qt.Key_Backspace,
0xff09: QtCore.Qt.Key_Tab,
0xff0b: QtCore.Qt.Key_Clear,
0xff0d: QtCore.Qt.Key_Return,
0xff13... |
from math import sqrt, pi
from flavio.physics.bdecays.common import meson_ff
from flavio.physics.bdecays.formfactors import hqet
from flavio.physics.bdecays.formfactors import common
from flavio.classes import AuxiliaryQuantity
from flavio.physics.running import running
process_dict = {}
process_dict['B->D*'] = {'B': ... |
"""
List generation unit tests.
Copyright (c) 2018 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
* Redistribut... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def change_chinese_plurals(apps, schema_editor):
Locale = apps.get_model("base", "Locale")
Translation = apps.get_model("base", "Translation")
for locale in Locale.objects.filter(name="Chinese"):
loc... |
__all__ = ['all_warnings']
from contextlib import contextmanager
import sys
import warnings
import inspect
@contextmanager
def all_warnings():
"""
Context for use in testing to ensure that all warnings are raised.
Examples
--------
>>> import warnings
>>> def foo():
... warnings.warn... |
#clean non numeric values from a column
df.loc[:, 'width'] = pd.to_numeric(df['width'], errors='coerce') |
import sys
#---#
print("Hello")
#---#
sys.exit(0)
#---#
print("Past the end")
|
import tensorflow as tf
feature_description = {
'image': tf.io.FixedLenFeature([], tf.string),
'xmins': tf.io.VarLenFeature(tf.float32),
'ymins': tf.io.VarLenFeature(tf.float32),
'xmaxs': tf.io.VarLenFeature(tf.float32),
'ymaxs': tf.io.VarLenFeature(tf.float32),
'labels': tf.io.VarLenFeature(tf... |
# quart_cors.py
from quart import Quart
from quart_cors import cors, route_cors
app = Quart(__name__)
app = cors(app, allow_origin="https://quart.com")
# app = cors(app, allow_origin="*")
@app.route("/api")
# @route_cors(allow_origin=["https://quart.com"])
async def my_microservice():
return {"Hello": "World!"}
... |
import src.livetracking.model.AbstractModel as AM
import cv2
import numpy as np
import src.data.utilities as u
class KerasModel(AM.AbstractModel):
def predict(self, x):
res = x[140:340, 220:420, :]
res = cv2.cvtColor(res, cv2.COLOR_BGR2RGB)
return self.model.predict(np.expand_dims(res, ax... |
'''
给定一个无序的数组,找出数组在排序之后,相邻元素之间最大的差值。
如果数组元素个数小于 2,则返回 0。
示例 1:
输入: [3,6,9,1]
输出: 3
解释: 排序后的数组是 [1,3,6,9], 其中相邻元素 (3,6) 和 (6,9) 之间都存在最大差值 3。
示例 2:
输入: [10]
输出: 0
解释: 数组元素个数小于 2,因此返回 0。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/maximum-gap
'''
class Solution:
def maximumGap(self, nums: List[int]) -> ... |
import logging
import os
import textwrap
import threading
import time
import pytest
import salt.loader
import salt.utils.atomicfile
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
log = logging.getLogger(__name__)
pytestmark = [
pytest.mark.windows_whiteli... |
try:
import smbus
except ImportError:
smbus = None
from .register_state import RegisterState
__all__ = ['FileRegisterState']
class FileRegisterState(RegisterState):
"""
A `RegisterState` that is recorded in a file.
Parameters
----------
infn : str
Readable file to use as the inp... |
from __future__ import annotations
import glob
import logging
import os
import sys
from types import MethodType
from typing import TYPE_CHECKING
from matchengine.internals import query_transform
from matchengine.internals.database_connectivity.mongo_connection import MongoDBConnection
from matchengine.internals.plugi... |
"""
Herança múltipla - Python Orientado a Objetos
"""
from smartphone import Smartphone
smartphone = Smartphone('Pocophone F1 ')
smartphone.conectar()
smartphone.desligar()
smartphone.ligar()
smartphone.conectar()
smartphone.conectar()
smartphone.conectar()
smartphone.desligar()
smartphone.conectar()
smartphone.de... |
import asyncio
import asyncio.sslproto
import gc
import os
import select
import socket
import unittest.mock
import uvloop
import ssl
import sys
import threading
import time
import weakref
from OpenSSL import SSL as openssl_ssl
from uvloop import _testbase as tb
class MyBaseProto(asyncio.Protocol):
connected = No... |
import json
from apps.Utils.formresponse import formScssResp
from apps.Utils.message_constants import LOGGEDOUT_SCSS_MSG
def create_user(userObj):
res = formScssResp("000",LOGGEDOUT_SCSS_MSG,"logoutResp",{})
return res
|
import growattServer
api = growattServer.GrowattApi()
login_response = api.login(<username>, <password>)
#Get a list of growatt plants.
print(api.plant_list(login_response['userId']))
|
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["SpecimenCollection"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class SpecimenCollection(ValueSet):
"""
Specimen collection methods
Actions t... |
###############################################################################
# Copyright 2015 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... |
"""
The `nntm.model_selection._split` module includes classes and
functions to split the data based on a preset strategy.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Raghav RV <rvra... |
import sys
import os
def main():
s = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur rhoncus tincidunt sem nec gravida. Sed id convallis quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dui purus, ornare vitae metus vitae, feugiat ultricies ipsum. Etiam id ante quis puru... |
#!/usr/bin/env python3
# .. _`schema_loader`:
#
# #####################################################################
# Schema Loader Module -- Load Embedded or External Schema
# #####################################################################
#
# .. py:module:: schema.loader
#
# A *Schema Loader* loads the a... |
from dataclasses import dataclass
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntityDescription,
)
from homeassistant.const import (
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_POWER_FACTOR,
DE... |
# -*- coding: utf-8 -*-
import random
import string
import tarfile
from contextlib import contextmanager
import os
from easybackup.adapters.ftp import FtpRepositoryAdapter, LocalToFtp, FtpToLocal
from easybackup.adapters.local import (LocalBackupCreator,
LocalRepositoryAdapter)
fr... |
from ticket import Ticket
import conn
import shared
import ticket
import dialog
import gi
import os
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
def main() -> None:
dir = os.path.dirname(os.path.abspath(__file__))
builder = Gtk.Builder()
builder.add_from_file(dir + '/app.glade')... |
from __future__ import print_function
import argparse
import os
import time
from datetime import datetime
import json
from platform import system
import logging
# Disable verbose TensorFlow looging...
# See https://github.com/LucaCappelletti94/silence_tensorflow
os.environ["KMP_AFFINITY"] = "noverbose"
os.environ['TF_... |
""" Module for credential based GUI elements """
import pyperclip
from PyQt5.Qt import QHBoxLayout, QVBoxLayout
from PyQt5.QtWidgets import QMessageBox, QPlainTextEdit, QPushButton
from incubus import IncubusFactory
from data.database import Account, System
from gui.toolkit import WidgetState
class CredentialWidget:... |
import logging
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Event, Output
from metaswitch_tinder.app import app
from metaswitch_tinder.app_structure import href
from metaswitch_tinder.components import session
from metaswitch_tinder.components.about import about... |
from conans import ConanFile, CMake, tools
import os, shutil
class JsoncppConan(ConanFile):
name = "jsoncpp"
license = "MIT"
homepage = "https://github.com/open-source-parsers/jsoncpp"
url = "https://github.com/conan-io/conan-center-index"
topics = ("conan", "json", "parser", "config")
descrip... |
class MetricDetailsList:
def __init__(self, ascending=True):
"""
Create MetricDetailsList object
:param ascending: False if "the larger, the more important" applies to the sorting attribute. Otherwise True.
"""
self._details_list = []
self.ascending = ascending
... |
from collections import defaultdict
from conda_build.config import Config
from conda_build.metadata import MetaData
def create_metapackage(name, version, entry_points=(), build_string=None, build_number=0,
dependencies=(), home=None, license_name=None, summary=None, config=None):
# local im... |
from currency_exchanger.users.models import User
from django.contrib import admin
admin.register(User)
|
# -*- coding: utf-8 -*-
"""This module contains enough knowledge about `struct` format strings to
figure out size and position of fields.
"""
import re
import struct
from struct import Struct
from .utils import split_fields
class Field(object):
"""Representation of a field defined in a `struct` format string.... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import unittest
import numpy as np
import time
from pyiron_atomistics.atomistics.structure.atoms import Atoms
from pyiro... |
import argparse
import signal
import sys
from typing import Optional
from determined import ipc
def read_action(opt: str, val: str) -> Optional[signal.Signals]:
if val.lower() == "wait":
return None
out = {s.name.lower(): s for s in signal.Signals}.get(val.lower())
if out is None:
raise V... |
#!/usr/bin/env python3
import numpy as np
import os
def loadmesh(fn, skiprows=0, strip=True):
if fn.endswith('.txt'):
return loadtxt(fn, skiprows=skiprows, strip=strip)
elif fn.endswith('.asc'):
return loadasc(fn, skiprows=skiprows, strip=strip)
elif fn.endswith('.xyz'):
return l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.