text stringlengths 2 999k |
|---|
"""Helpers to download repository content."""
import os
import pathlib
import tempfile
import zipfile
import async_timeout
import backoff
from queueman import QueueManager, concurrent
from custom_components.hacs.helpers.classes.exceptions import HacsException
from custom_components.hacs.helpers.functions.filters impo... |
from __future__ import print_function
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
import urlparse
import plivoxml
class HangupException(Exception): pass
def lambda_handler(event, context):
logger.info('got event {}'.format(event))
if 'body' not in event:
raise HangupEx... |
import argparse
import copy
import json
import pickle
import pprint
import os
import sys
from tqdm import tqdm
from typing import *
from my_pybullet_envs import utils
from state_saver import StateSaver
import numpy as np
import torch
import math
import my_pybullet_envs
from system import policy, openrave
import pybu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-17 13:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("shop", "0009_epaycallback_md5valid")]
operations = [
migrations.CreateModel(
name="... |
import matplotlib.pyplot as plt
import numpy as np
SMALL_SIZE = 8
MEDIUM_SIZE = 13
BIGGER_SIZE = 16
plt.rc('font', size=BIGGER_SIZE) # controls default text sizes
plt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title
plt.rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels
p... |
# encoding: utf-8
from __future__ import print_function, division, unicode_literals, absolute_import
import time
import numpy as np
from jaqs.data import RemoteDataService
from jaqs.data.basic import Bar, Quote
from jaqs.trade import (model, EventLiveTradeInstance, EventBacktestInstance, RealTimeTradeApi,
... |
# retrace.py is a python script to automate the retracing of the SVG Refinement
#
# Copyright (c) 2014 Stephen E Slevinski Jr <slevin@signpuddle.net>
#
# License: MIT
import sys
import os
import math
import argparse
import time
start = time.time()
##################
# Argument Setup
##################
parser = argpa... |
"""Define the PETSc Vector class."""
from openmdao.utils.mpi import MPI
CITATION = '''@InProceedings{petsc-efficient,
Author = "Satish Balay and William D. Gropp and Lois Curfman McInnes and Barry F. Smith",
Title = "Efficient Management of Parallelism in Object Oriented Numerical Software Libraries",
Book... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from b... |
import argparse
import sys
import os
import matplotlib.pyplot as plt
from tensorboardX import SummaryWriter
plt.switch_backend('agg')
sys.path.insert(0, '../utils') # If that is the way to include paths for this project, then why not also for 'backbone'?
sys.path.insert(0, '../eval')
sys.path.insert(0, '../backbone... |
from conf import global_variable
class Node:
# ip
ip = ""
# port
port = 0
# beiz
remark = ""
# jiamiafangshi
security = ""
def __init__(self, ip, port, remark, security):
self.ip = ip
self.port = port
self.remark = remark
self.security = security
... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
from django.urls import path
from cookiecutter_starter.users.views import (
user_detail_view,
user_redirect_view,
user_update_view,
)
app_name = 'users'
urlpatterns = [
path('~redirect/', view=user_redirect_view, name='redirect'),
path('~update/', view=user_update_view, name='update'),
path('<... |
from RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_tools import *
# In this file we define the locations of the MVA weights, cuts on the MVA values
# for specific working points, and configure those cuts in VID
# The following MVA is derived for Fall17 samples for non-triggering photons.
# See more docum... |
import os
import glob
import copy
import obspy
import scipy
import time
import pycwt
import pyasdf
import datetime
import numpy as np
import pandas as pd
from numba import jit
from scipy.signal import hilbert
from obspy.signal.util import _npts2nfft
from obspy.signal.invsim import cosine_taper
from scipy.fftpack import... |
# Copyright 2016 F5 Networks 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 writ... |
# -*- coding: utf-8 -*-
"""
File name: pump_script.py
Author: Daniel Hulse
Created: October 2019
Description: A simple example of I/O using faultprop.py and the pump model in ex_pump.py
"""
#Using the model that was set up, we can now perform a few different operations
#First, import the fault propogation library as ... |
import asyncio
from pathlib import Path
from secrets import token_bytes
import aiosqlite
import pytest
from beet.types.blockchain_format.coin import Coin
from beet.util.db_wrapper import DBWrapper
from beet.util.ints import uint64
from beet.wallet.wallet_interested_store import WalletInterestedStore
@pytest.fixture... |
# coding: utf-8
################################
#### Author: Mattijn van Hoek ##
#### While working for HKV ##
################################
from __future__ import print_function
import gzip
import io
from datetime import datetime
import collections
# import geopandas as gpd
import pandas as pd
import pytz
im... |
from .__version__ import __version__
from .config import Config
from .utils import get_config_object_from_proxy
|
from django.conf.urls import url
from user_profile.views import UserDetail, UserList, UserEdit, UserSettingsPage, UserBlogList
urlpatterns = [
url(r'^edit/$', UserEdit.as_view(), name="user-profile-edit"),
url(r'^settings/$', UserSettingsPage.as_view(), name="user-settings"),
url(r'^blog-list/$', UserBlogL... |
import os
import numpy as np
import pandas as pd
import datetime as dt
import lib.utils as utils
def data_hash(vacinas_foldername="vacinado_obito",
testes_foldername="testes_covid19",
hospital_foldername="hospitalizacao_covid19",
obitos_foldername="obitos_covid19"):
'''
... |
#coding:utf-8
#
# id: functional.arno.optimizer.opt_sort_by_index_04
# title: ORDER BY DESC using index (non-unique)
# decription: ORDER BY X
# When a index can be used for sorting, use it.
# tracker_id:
# min_versions: []
# versions: 2.0
# qmid: functional.arno.optimizer... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
# pyth... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Statistical tools for time series analysis
"""
from __future__ import division
from six.moves import range, zip
import numpy as np
import pandas as pd
from scipy import stats
from sm2.tools.tools import add_constant
from sm2.compat.numpy import lstsq
from sm2.regres... |
#!/usr/bin/env python3
# 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.
"""
Basic script which allows local human keyboard input to talk to a trained model.
## Examples
```shell
parlai intera... |
# -*- coding: UTF-8 -*-
# for localized messages
from . import _
# GUI (Screens)
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Screens.ChannelSelection import SimpleChannelSelection
from Screens.EpgSelection import EPGSelection
from Screens.MessageBox import MessageBox
from ... |
# coding: utf-8
"""
Pure Storage FlashBlade REST 1.8.1 Python SDK
Pure Storage FlashBlade REST 1.8.1 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.8.1
Cont... |
from .base import FeedbackField
import pandas as pd
class AnnotationsCount(FeedbackField):
def evaluate(self, annotation):
item = annotation.item
other_annotations = item.annotations.exclude(user=None).exclude(user=annotation.user)
if other_annotations:
return other_annotation... |
# class Phase(float, Radian):
# ...
|
from abc import ABC, abstractmethod
class Module(ABC):
def __init__(self, threaded=False):
self.threaded = threaded
@abstractmethod
def run_in_series(self, **kwargs):
"""
This is the none-threaded function. It run in series!
Args:
**kwargs:
Returns:
... |
"""Exception middleare. Catch all 500 errors and return a simple page"""
import traceback
from django.shortcuts import render
class ExceptionMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request, *args, **kwargs):
response = self.get_resp... |
"""main controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from controller import Robot,Motor,DistanceSensor,Lidar
import cv2
import matplotlib.pyplot as plt
import numpy as np
import math
import time
hizi=6.28
maxMesafe=1024
#se... |
# -*- coding: utf-8 -*-
# Levanta el corpus de los archivos y genera las imagenes
# Recibe como parámetros el directorio de trabajo, el xml con el corpus,el prefijo de nombres de documentos a levantar y un indicador binario de si solo generar las oraciones que tienen hedge y/o negación
# Ejemplo python generate_image_... |
import graphene
from graphql_auth.types import ExpectedErrorType
from graphql_jwt.decorators import login_required
from graphene_file_upload.scalars import Upload
from ..models import Profile, Avatar
from ..forms import ProfileForm
from .nodes import ProfileNode
class UpdateProfileMutation(graphene.relay.ClientIDMuta... |
# -*- coding: utf-8 -*-
u"""rsdicom setup script
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from pykern import pksetup
pksetup.setup(
name='rsdicom',
author='RadiaSoft LLC',
author_email='pip@radiasoft.net',
descrip... |
import discord
import git
from discord.ext import commands
from discord.ext.commands import CommandNotFound
class Management(commands.Cog):
"""
Set of commands for Administration.
"""
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_error(self, ctx, err... |
from matrix_fact.svd import SVD
import numpy as np
from numpy.testing import *
class TestSVD():
data = np.array([[1.0, 0.2, 1.0],
[0.3, 1.0, 1.0],
[0.1, 0.6, 0.4]])
U = np.array([[-0.64407866, 0.75716718, 0.10890606],
[-0.69296703, -0.51722384, -0.502271... |
from janome.tokenizer import Tokenizer
import re
from japana.dictionary import lookup_dic
from japana.kanji_count import extract_unicode_block
from japana.progress_bar import printProgressBar
from japana.word_classifier import word_classifier
def word_count(text, kana=False, asc=True, _dict=False, ignore=True, celery... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from ..utils import extract_CN_from_content
from ..items import ScrapySpiderItem
import re
class A168Spider(CrawlSpider):
name = '168'
allowed_domains = ['lankao.gov.cn']
star... |
import collections
import os
import random
import h5py
import PIL.Image as Image
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
class VisionLanguageDataset(Dataset):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
data_path = kwargs["data_path"]
data... |
import unittest
from unittest.mock import MagicMock
from test_workflow.test_result.test_result import TestResult
class TestTestResult(unittest.TestCase):
test_result: TestResult
def setUp(self) -> None:
self.test_result = TestResult("sql", {"with-security": {}}, 0)
def test_failed(self) -> None... |
import pygame, sys, random
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
WIDTH = 640
HEIGHT = 480
win_size = (WIDTH, HEIGHT)
pygame.init()
win = pygame.display.set_mode(win_size)
pygame.display.set_caption('Cycle Sort')
clock = pygame.time.Clock()
#width of the bars
n = 4
w = int(WIDTH/n)
h_arr = [... |
from orm import DateTime, Integer, Model, String
from sqlalchemy.sql import func
from app.db.database import database, metadata
class Ingredient(Model):
__tablename__ = "ingredients"
__database__ = database
__metadata__ = metadata
id = Integer(primary_key=True)
ingredient = String(max_length=255... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, 2012 Pablo A. Costesich <pcostesi@alu.itba.edu.ar>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... |
from django.core.exceptions import ValidationError as DjangoValidationError
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from rest_framework.reverse import reverse
from mayan.apps.documents.serializers.document_ser... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/usr/bin/env python
import time
import serial
import sys
import platform
LATENCY_TIMER = 16
DEFAULT_BAUDRATE = 1000000
class PortHandler(object):
def __init__(self, port_name):
self.is_open = False
self.baudrate = DEFAULT_BAUDRATE
self.packet_start_time = 0.0
se... |
import networkx
from rdkit import Chem
from ._base import Descriptor
__all__ = ("RingCount",)
class RingCountBase(Descriptor):
__slots__ = ()
explicit_hydrogens = False
def parameters(self):
return ()
class Rings(RingCountBase):
__slots__ = ()
def calculate(self):
return [fro... |
import re
import os
import glob as glob
import pandas as pd
def parse_lat_lon(ll):
"""convert deg/dec minutes into dec"""
REGEX = r'(\d+)[^\d]+([\d.]+)[^NSEW]*([NSEW])'
deg, mnts, hemi = re.match(REGEX, ll).groups()
mult = 1 if hemi in ['N', 'E'] else -1
deg, mnts = int(deg), float(mnts)
deg =... |
from django.db import models
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField( max_length=100)
message = models.TextField()
created = models.DateTimeField(auto_now=False, auto_now_add=True)
checked = models.Boolean... |
# ClearML - example code, retrieve other task artifacts and print the artifacts
# Please run examples/reporting/artifacts.py example before running this example
#
from pprint import pprint
from clearml import Task
def main():
# Getting the task we want to get the artifacts from
artifacts_task = Task.get_task... |
#
# Copyright 2022 The Foundry Visionmongers 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 applicab... |
from rest_framework import serializers
from .models import Attendance, Attendee
class AttendeeSerializer(serializers.ModelSerializer):
class Meta:
model = Attendee
fields = ['nim', 'name']
class AttendanceSerializer(serializers.ModelSerializer):
attendee = AttendeeSerializer(many=False, read_... |
n = int(input('Digite o primeiro termo: '))
r = int(input('Digite a razão: '))
d = n + (10 - 1) * r
for c in range(n, d + r, r):
print(c, end =' ')
|
import torch
from collections import defaultdict
from typing import Callable, Any, Dict, Tuple, Set, Optional, List
from torch.ao.quantization import QConfig
from torch.ao.quantization.qconfig import add_module_to_qconfig_obs_ctr, QConfigAny, qconfig_equals
from torch.ao.quantization.quantize import (
is_activation... |
"""
py.test plugin to support ``oep2 report``. Adds arguments to py.test,
and creates fixtures for loading git repos.
"""
from collections import defaultdict
from git.refs.remote import RemoteReference
from git.repo.base import Repo, Head
from github3.repos.repo import Repository
import cgi
import os.path
import pytes... |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... |
#!/usr/bin/env python
# coding: utf-8
#from __future__ import unicode_literals, print_function, division
from io import open
import unicodedata
import string
import re
import random
import pickle
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.utils import data
f... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... |
# coding: utf-8
"""
Healthbot APIs
API interface for Healthbot application # noqa: E501
OpenAPI spec version: 1.0.0
Contact: healthbot-hackers@juniper.net
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ReportSchema... |
import abc
# import asyncio
import shared.utilities.util as util
# import json
import importlib
# import sys
from daq.daq import DAQ
from daq.interface.ifdevice import IFDevice, DummyIFDevice, IFDeviceFactory
from daq.manager.manager import Managers
class InterfaceFactory():
@staticmethod
def create(config, ... |
"""django-template-toolkit Tags & Filters"""
from django import template
from django import forms
register = template.Library()
@register.filter
def spacer(value) -> str:
"""Adds leading space if value is not empty"""
return ' ' + str(value) if value is not None and value else ''
@register.filter
def fiel... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.subsystem.subsystem import Subsystem
class PythonEval(Subsystem):
options_scope = "python-eval"
@classmethod
def register_options(cls, register):
super()... |
from pentest.command import JarvisCmd
import sys
__name__ = "sslyze"
def main():
args_config = {
'passthrough_args': ['--xml_out', '--help', '-h'],
'output_args': [
{
'format': 'xml',
'arg': '--json_out'
}
]
}
cmd = JarvisCmd(sys.argv)
cmd.set_args_config(args_config)
for arg in cmd.args:
... |
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from ..models import Author, Inbox
# https://stackoverflow.com/a/59669317
@receiver(post_save, sender=User)
def new_user_created(sender, instance, created, **kwargs):
if created:
... |
# -*- coding: utf-8 -*-
'''
Execution of arbitrary commands
===============================
The cmd state module manages the enforcement of executed commands, this
state can tell a command to run under certain circumstances.
A simple example to execute a command:
.. code-block:: yaml
# Store the current date i... |
import os
from setuptools import setup
from extras import RunFlakesCommand
version = '2.4.0'
readme_file = os.path.join(os.path.dirname(__file__), 'README.rst')
with open(readme_file) as f:
long_description = f.read()
setup(
name='django-guardian',
version=version,
python_requires='>=3.5',
url='... |
# -*- coding: utf-8 -*-
import hoggorm
from .main_plot import plot
def predict(model, comp=[1, 2],
objNames=[], newX=[], newY=[], newObjNames=[], figsize=None):
"""
This is a convenience function that generates plots of predicted vs.
original values of hoggorm models.
PARAMETERS
--... |
# Generated by Django 2.2.4 on 2019-09-01 01:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('visits', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='visit',
... |
import numpy as np
from sklearn import svm
from svmutil import *
import sys
train_file = sys.argv[1]
test_file = sys.argv[2]
def scikitSVM(x_train, y_train, x_test, y_test, C):
x = x_train
y = y_train[:,0]
clf = svm.SVC(C=C, kernel='rbf', gamma=0.05)
clf.fit(x, y)
train_acc = clf.score(x, y)
#val_acc = clf.sco... |
import praw
import json
import time
import csv
import pprint
config = json.load(open('config.json'))
def removeduplicates():
data = None
with open('subreddits.csv', 'r') as f:
reader = csv.reader(f)
data = list(reader)
data_cleaned = []
for p in data:
p = p[0].lower()
... |
from .item_schema import ItemSchema, ItemWithSetCountSchema
from .category_schema import CategorySchema
from .item_image_schema import ItemImageSchema
from .user_schema import UserSchema
from .item_transaction_schema import ItemTransactionSchema
from .remaining_format_schema import RemainingFormatSchema
from .koe... |
from __future__ import division
from datetime import datetime, timedelta
from django.test import TestCase
from django.core.exceptions import ValidationError
from model_mommy import mommy
from facilities.models import Facility
from ..models import (
CommunityHealthUnit,
CommunityHealthWorker,
CommunityHea... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bank.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you... |
import itertools
import logging
import threading
import traceback
from collections import namedtuple
from typing import Any, Callable, List
import numpy as np
import pytest
from determined import _core
from determined.pytorch import Reducer, _PyTorchReducerContext, _simple_reduce_metrics
logger = logging.getLogger(_... |
import random
import numpy as np
import cv2
def str2bool(v):
if v.lower() in ['true', 1]:
return True
elif v.lower() in ['false', 0]:
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')
def rle_encode(mask_image):
mask_image = np.rot90(mask_image[:... |
from django import forms
from .models import Dweet
class DweetForm(forms.ModelForm):
body = forms.CharField(
required=True,
widget=forms.widgets.Textarea(
attrs={
"placeholder": "Dweet something...",
"class": "textarea is-success is-medium",
... |
#!/usr/bin/env python
#
# Copyright (c) 2004, 2005 Google Inc.
# 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, th... |
# =========================================================================================================
# File: CycleGAN_TrainingScheme.py
# Author: Elad Dvash
#
# Description:
# This file contains an implementation of a CycleGAN (https://arxiv.org/abs/1703.10593) and a CycleWGAN -
# a CycleGAN with an IWGAN-GP-lik... |
# 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 ap... |
#
# Author: See contributors at https://github.com/JurajNyiri/pytapo/graphs/contributors
#
import hashlib
import json
import requests
import urllib3
from .const import ERROR_CODES
from .media_stream.session import HttpMediaSession
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class Tapo:
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: Felipe Espic
"""
import numpy as np
import shutil
import sys, os
curr_dir = os.getcwd()
sys.path.append(os.path.realpath(curr_dir + '/../src'))
import libutils as lu
import magphase as mp
import configparser # Install it with pip (it's not the same as 'Confi... |
# Data sources
database(
thermoLibraries=['surfaceThermoPt111', 'primaryThermoLibrary', 'thermo_DFT_CCSDTF12_BAC','DFT_QCI_thermo'], # 'surfaceThermoPt' is the default. Thermo data is derived using bindingEnergies for other metals
reactionLibraries = [('Surface/CPOX_Pt/Deutschmann2006', False)], # when Ni is u... |
from .tm_test import test_tbmatch
from .surf_test import test_surfmatch
from .sift_test import test_siftmatch
from .orb_test import test_orbmatch
|
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import numbers
def latency_metric(func):
def prepare_latency_metric(
delays,
src_lens,
... |
from django.contrib import admin
from seotools.models import SEOCountryDescriptor, RegistrationInfoGraphic
# Register your models here.
class CountryDescriptorAdmin(admin.ModelAdmin):
fields = ['country', 'description', 'meta_description', 'image1', 'image2', 'image3', 'keywords']
class Registrat... |
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key u... |
#!/usr/bin/env python
import numpy as np
import pickle
import rospy
from sensor_stick.pcl_helper import *
from sensor_stick.training_helper import spawn_model
from sensor_stick.training_helper import delete_model
from sensor_stick.training_helper import initial_setup
from sensor_stick.training_helper import capture_sa... |
import os
import sys
import json
from decimal import Decimal
from SidechainTestFramework.sc_boostrap_info import MCConnectionInfo, SCBootstrapInfo, SCNetworkConfiguration, Account, \
VrfAccount, CertificateProofInfo, SCNodeConfiguration, ProofKeysPaths, LARGE_WITHDRAWAL_EPOCH_LENGTH
from SidechainTestFramework.si... |
# Copyright (c) 2021 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... |
# Copyright 2019 Hewlett Packard Enterprise Development LP
#
# 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 ... |
from leetcode_tester import Tester
from src.list_node import ListNode
from typing import Optional
class Solution:
def addTwoNumbers(
self, l1: Optional[ListNode], l2: Optional[ListNode]
) -> Optional[ListNode]:
carry = 0
results = []
while l1 or l2 or carry:
v1... |
#-----
# Description : Example script to create model matrix
# Date : March 2022
# Author : Berkan Lafci
# E-mail : lafciberkan@gmail.com
#-----
#%% Start logging
import logging
logging.basicConfig(filename='exampleModel.log', filemode='w', level=logging.INFO)
logging.info(' Script "exam... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python3
from support.classifiers import classifiers
from setuptools import setup
import support
support.use("system")
from support.setup_codes import setup_commands
name = 'amuse-sphray'
author = 'The AMUSE team'
author_email = 'info@amusecode.org'
license_ = "Apache License 2.0"
url = 'http://www.amu... |
import copy
from math import sqrt
import dace
from dace.libraries.standard.nodes.code import _get_inputs_and_outputs
from dace.symbolic import symstr
from daceml.onnx.implementation_repository import register_pure_expansion
|
import time
import os
import sys
import Adafruit_DHT
import RPi.GPIO as GPIO
from datetime import datetime
# output data section
class Recon(object):
def __init__(self, light_pin=8 ,pump_pin = 11, humi_pin = 10 , com_pin=7 ,ex_pin=9):
self.light_pin = light_pin
self.humi_pin = humi_pin
self.pump_pin = pump_pin
... |
from __future__ import absolute_import
import mjolnir.featuresets
import json
import os
import pytest
def test_create_enwiki(fixtures_dir):
"""Do nothing test asserts happy path doesnt blow up"""
features = mjolnir.featuresets.enwiki_features()
assert len(features) > 0
params = {'query_string': '{{qu... |
#!/usr/bin/python
'''
(C) Copyright 2018-2019 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 appli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.