text stringlengths 1 927k |
|---|
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['Lag1Trend'] , ['Seasonal_WeekOfYear'] , ['NoAR'] ); |
from masonite.request import Request
from masonite.view import View
from masonite.controllers import Controller
from jinja2 import Markup
import json
import copy
class Component:
def __init__(self, request: Request, view: View):
"""LivewireController Initializer
Arguments:
request {m... |
# -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# usbq documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... |
#!/usr/bin/env python
import asyncio
from collections import deque
import logging
import time
from typing import List, Dict, Optional, Tuple, Set, Deque
from hummingbot.client.command import __all__ as commands
from hummingbot.core.clock import Clock
from hummingbot.logger import HummingbotLogger
from hummingbot.logg... |
r"""
Finite Delta-complexes
AUTHORS:
- John H. Palmieri (2009-08)
This module implements the basic structure of finite
`\Delta`-complexes. For full mathematical details, see Hatcher [Hat]_,
especially Section 2.1 and the Appendix on "Simplicial CW Structures".
As Hatcher points out, `\Delta`-complexes were first in... |
"Example extension, also used for testing."
from idlelib.config import idleConf
ztext = idleConf.GetOption('extensions', 'ZzDummy', 'z-text')
class ZzDummy:
## menudefs = [
## ('format', [
## ('Z in', '<<z-in>>'),
## ('Z out', '<<z-out>>'),
## ] )
## ]
def __init__(se... |
"""
Unit tests for Lambda runtime
"""
from unittest import TestCase
from mock import Mock, patch, MagicMock, ANY
from parameterized import parameterized
from samcli.local.lambdafn.runtime import LambdaRuntime, _unzip_file
from samcli.local.lambdafn.config import FunctionConfig
class LambdaRuntime_invoke(TestCase):
... |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The NYC3 Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.test_framework import NYC3TestFramework
from test_fram... |
# Copyright (c) 2013 OpenStack, 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 agreed to in wr... |
__author__ = 'schelle'
import unittest
import wflow.wflow_sbm as wf
import os
"""
Run sceleton for 10 steps and checks if the outcome is approx that of the reference run
"""
class MyTest(unittest.TestCase):
def testapirun_netcfd(self):
startTime = 1
stopTime = 30
currentTime = 1
... |
#!/usr/bin/env python
from gwcs import coordinate_frames as cf
import astropy.units as u
from astropy.time import Time
from astropy.modeling import models, Parameter, Model
from astropy.coordinates import SkyCoord, Angle
from astropy.table import Table
from astropy.cosmology import default_cosmology
from astropy impo... |
import yaml
import hashlib
def loadNotes(lang, filename):
result = None
try:
f = open("assets/notes/" + lang + "/" + filename, "r")
result = f.read()
f.close()
except:
print "WARNING: Unable to load notes for " + lang + "/" + filename
if (result == None and lang != "en"):
return loadNotes("en", filename)... |
from django.apps import AppConfig
class ForumReadMarksConfig(AppConfig):
name = 'tulius.forum.read_marks'
label = 'forum_read_marks'
def ready(self):
# pylint: disable=C0415
from tulius.forum.read_marks import mutations
mutations.init() |
import datetime
import re
from airflow import DAG
from airflow.operators import BaseOperator
from dagster import ExecutionTargetHandle, RunConfig, check, seven
from dagster.core.execution.api import create_execution_plan
from dagster.core.instance import DagsterInstance
from .compile import coalesce_execution_steps
... |
# Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
"""
Rules (TODO)
"""
from fla... |
# coding=utf-8
# Copyright 2020 The Google AI Team, Stanford University and The HuggingFace Inc. team.
#
# 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/L... |
(1)<caret> |
"""
@author axiner
@version v1.0.0
@created 2021/12/12 13:14
@abstract
@description
@history
"""
class Versions(object):
ALL = [
("2022.03.14", "add@simple"),
("2022.01.23", "init@"),
] |
from logging import getLogger
from typing import Callable, Dict, List, Optional, Type, TypeVar, cast
from custom_components.hubitat.util import get_device_overrides
from hubitatmaker import Device
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.help... |
# Copyright (c) 2015-2018 Cisco 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 restriction, including without limitation the
# rights to use, copy, modify, merge... |
#!/usr/bin/env python
# encoding=utf-8
# author : SeongCheol Jeon
# email addr : saelly55@gmail.com
# create date : 2020.01.28 01:34
# modify date :
# description :
from imp import reload
from PySide2 import QtGui, QtCore
try:
import hou
except ImportError as err:
pass
i... |
# -*- coding: utf-8 -*-
import numpy as np
from libs.base import *
import ast
global numpy
class ThompsonBayesianLinear():
""" Class for Thompson sampling for Bayesian Linear Regression
:var dict default: The value of the model, consisting of a 1*p \
list of J, p*p list of P and an error rate.
""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2020-09-13
# @Filename: acquisition.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
import collections
import functools
import multiprocessing
import pathlib
import shutil
import war... |
""" Exceptions mapped to error codes the JSON-rpc 2 spec.
-32768 to -32000 are reserved for pre-defined errors
code: -32700 message: Parse Error -> invalid json received by the server. Error occurred while parsing the json text
code: -32600 message: Invalid Request -> Json sent is not a valid Request object
code... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import warnings
import subprocess
import numpy as np
import os.path
import copy
from itertools import combinations
from pymatgen.core import Structure, Lattice, PeriodicSite, Molecule
from pymatgen.core.struc... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from numpy import asarray
from scipy.linalg import svd
__all__ = ['pca_numpy']
def pca_numpy(data):
"""Compute the principle components of a set of data points.
Parameters
----------
data :... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Retrieve all comments on an issue"
class Input:
ID = "id"
class Output:
COMMENTS = "comments"
COUNT = "count"
class GetCommentsInput(komand.Input):
schema = json.loads("""
{
"type":... |
# Copyright 2021 The Brax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
"""
<Module Name>
rsa.py
<Author>
Santiago Torres-Arias <santiago@nyu.edu>
<Started>
Nov 15, 2017
<Copyright>
See LICENSE for licensing information.
<Purpose>
RSA-specific handling routines for signature verification and key parsing
"""
import binascii
CRYPTO = True
NO_CRYPTO_MSG = 'RSA key support for G... |
import time
import socket
import re
import ctypes
import argparse
sender = ctypes.CDLL("/send.so")
sender.sendEncryptedAlert.argtype=[ctypes.POINTER(ctypes.c_char), ctypes.c_int]
sender.sendEncryptedAlert.restype=ctypes.c_int
#fileName='/var/log/nmap.log'
def getData(fileName):
data=''
with open(fileName, '... |
#!/usr/bin/env python3
import datetime
import colored
import os
import syd
import re
from tokenize import tokenize, NUMBER
from io import BytesIO
from box import Box, BoxKeyError
from difflib import SequenceMatcher
# -----------------------------------------------------------------------------
def replace_key_with_id... |
#!/usr/bin/python
# combineColumns.py
# Author: Andrew Kenneth Melkonian
# All rights reserved
def combineColumns(xyz1_path, xyz2_path, id_col_num_1, id_col_num_2):
assert os.path.exists(xyz1_path), "\n***** ERROR: " + xyz1_path + " does not exist\n";
assert os.path.exists(xyz2_path), "\n***** ERROR: " + xyz2_pa... |
from os.path import join
from collections import OrderedDict
from generators import ecs_helpers
def generate(ecs_nested, ecs_version, out_dir):
# Load temporary whitelist for default_fields workaround.
df_whitelist = ecs_helpers.yaml_load('scripts/generators/beats_default_fields_whitelist.yml')
# base fi... |
# settings.py
from dotenv import load_dotenv
import os
# explicitly providing path to '.env'
from pathlib import Path # Python 3.6+ only
env_path = Path('.') / '.env'
load_dotenv(dotenv_path=env_path)
# settings.py
APP_ID = os.getenv("APP_ID")
APP_KEY = os.getenv("APP_KEY") |
from ...os_v3_hek.defs.obje import *
obje_attrs = dict(obje_attrs)
obje_attrs[1] = Bool16('flags',
'does_not_cast_shadow',
'transparent_self_occlusion',
'brighter_than_it_should_be',
'not_a_pathfinding_obstacle',
'cast_shadow_by_default',
{NAME: 'xbox_unknown_bit_8', VALUE: 1<<8, VISIBLE: False... |
from nba_api.stats.endpoints._base import Endpoint
from nba_api.stats.library.http import NBAStatsHTTP
from nba_api.stats.library.parameters import LeagueIDNullable
class CommonPlayerInfo(Endpoint):
endpoint = 'commonplayerinfo'
expected_data = {'AvailableSeasons': ['SEASON_ID'], 'CommonPlayerInfo': ['PERSON_... |
if window.get_active_class() != 'gnome-terminal-server.Gnome-terminal':
keyboard.send_keys("<ctrl>+v")
else:
keyboard.send_keys("<ctrl>+<shift>+v") |
"""
MobileNet v2.
As described in https://arxiv.org/abs/1801.04381
Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import nam... |
# 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... |
# Generated by Django 2.0.8 on 2018-09-10 17:52
from django.conf import settings
import django.contrib.postgres.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migra... |
import numpy as np
import matplotlib.pylab as plt
from .basewidget import BaseWidget
from probeinterface.plotting import plot_probe
from spikeinterface.toolkit import compute_unit_centers_of_mass
from .utils import get_unit_colors
class UnitLocalizationWidget(BaseWidget):
"""
Plot unit localization on prob... |
# https://pytorch.org/docs/stable/_modules/torch/nn/modules/loss.ht
from torch.nn.modules.loss import _Loss
from typing import Optional
from torch import Tensor
import torch.nn.functional as F
class BCEWithLogitsLoss(_Loss):
r"""This loss combines a `Sigmoid` layer and the `BCELoss` in one single
class. This v... |
# coding: utf-8
#
# Copyright (c) 2021 Target Brands, Inc. All rights reserved.
"""
Vela server
API for the Vela server # noqa: E501
OpenAPI spec version: 0.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import ... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
version = {}
with open("irekua_autocompl... |
# Determine whether or not one string is a permutation of another.
def is_permutation(str1, str2):
counter = Counter()
for letter in str1:
counter[letter] += 1
for letter in str2:
if not letter in counter:
return False
counter[letter] -= 1
if counter[letter] == 0:
del counter[letter]
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('learning_logs', '0004_auto_20210726_1906'),
]
operations = [
migrations.CreateModel(
name='Entry',
f... |
import itertools
from typing import Optional
from django.contrib.auth.models import User
from faker import Faker
import pytest
from pytest_factoryboy import register
from rest_framework.test import APIClient
from s3_file_field.testing import S3FileFieldTestClient
from multinet.api.models import Network, Table, Worksp... |
# Copyright 2019 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 agre... |
"""Example Rolling Mean and Filled Standard Deviation Chart."""
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from implements import implements
from dash_charts.scatter_line_charts import RollingChart
from dash_charts.ut... |
import sys
from collections import OrderedDict
from functools import partial
import torch.nn as nn
from inplace_abn import ABN
from modules import GlobalAvgPool2d, DenseModule
from .util import try_index
class DenseNet(nn.Module):
def __init__(self,
structure,
norm_act=ABN,
... |
# %%
# Recorre las 1000 paginas de articulos que podemos ver
# De cada artículo guarda:
# Url
# Id de Pubmed
# Título
# Keywords
# Lista de autores con nombres y afiliaciones y país
# El código no para hasta que lo frenes o que llegue a la página 1.000, pero cada vez que carga un artículo lo guarda, así que ... |
from setuptools import setup, find_packages
setup(
name='aioevents',
version='0.2',
packages=['aioevents',],
license='MIT License',
# long_description=...,
) |
from flask import Flask
from redis import Redis
import os
import socket
app = Flask(__name__)
host = socket.gethostname()
@app.route('/')
def hello():
try:
redis = Redis(host='redis.demos.svc.cluster.local', port=6379, socket_connect_timeout=1)
redis.incr('hits')
except:
return "Failed ... |
import sys
from PySide2 import QtGui
from PySide2.QtWidgets import QApplication, QWidget, QFileDialog
class Ui_Load(QWidget):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(640, 480)
file = self.openFileNameDialog()
icon = QtGui.QIcon()
... |
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import pandas as pd
import shutil
import requests
import numpy.testing as npt
import pytest
import skimage.io as skio
from .. import argus_shapes as shapes
import pulse2percept.implants as p2pi
try:
FileNotFoundError
e... |
import os
from plugins import base
system = base.get_platform()
base.init_hosts(system)
base.handle_plugins()
base.copy_host(system)
base.flush_dns(system) |
# coding=utf-8
from __future__ import unicode_literals
from apps.core.cache.base import CacheBase, DEFAULT_TIMEOUT
from tornado.concurrent import Future
from tornado import stack_context
from collections import deque
from tornado.ioloop import IOLoop
class LRUCache(dict):
# TODO:协程安全?
def __init__(self, maxs... |
import pandas as pd
def read_csv_files(file_path):
return pd.read_csv(file_path)
def filter_films(dataframe):
pass
def join_categories_with_metadata(facts_df, categories_df):
# Hint: You can use lambda functions to change the id column in order to
# use join method in pandas.
pass
def catego... |
import shelve
if __name__ == '__main__':
s = shelve.open("22901.db")
s["name"] = "www.itdiffer.com"
s["lang"] = "python"
s["pages"] = 1000
s["contents"] = {"first":"base knowledge","second":"day day up"}
s.close()
s = shelve.open("22901.db")
name = s["name"]
print (name)
contents... |
# Copyright (c) 2021 The Regents of the University of California
# 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, this lis... |
# stdlib
from typing import Tuple, Union
# third party
import numpy as np
from sklearn.base import TransformerMixin
# Necessary packages
import torch
from torch import nn
EPS = 1e-8
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def sample_Z(m: int, n: int) -> np.ndarray:
"""Random samp... |
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import os
from java.io import Fi... |
# Copyright 2018 The TensorFlow 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... |
from __future__ import print_function, division
import os
import numpy as np
from astropy.table import Table
from astropy import units as u
from .convolved_fluxes import ConvolvedFluxes, MonochromaticFluxes
from . import fitting_routines as f
from .utils import parfile
from .utils.validator import validate_array
fro... |
import os
import requests
import argparse
import time
import schedule
from bs4 import BeautifulSoup
import sys
from sys import platform
from config import push_msg
print """
___ __ __
/ _ \ / / ___ __ _____ ___/ /
/ // / / _ \/ _ \/ // / _ \/ _ /
/____/ /_//_/\___/\_,_/_//_/\_,_/
... |
from __future__ import annotations
import logging
import re
from typing import Any, Dict, List, Optional, Text, Tuple, Type
import numpy as np
import scipy.sparse
from rasa.nlu.tokenizers.tokenizer import Tokenizer
import rasa.shared.utils.io
import rasa.utils.io
import rasa.nlu.utils.pattern_utils as pattern_utils
fr... |
from mycroft import MycroftSkill, intent_file_handler
class SkillPlayground(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
@intent_file_handler('playground.skill.intent')
def handle_playground_skill(self, message):
self.speak_dialog('playground.skill')
def create_skill()... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MacOS application usage event formatter."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import appusage
from tests.formatters import test_lib
class ApplicationUsageFormatterTest(test_lib.EventFormatterTestCase):
""... |
"""Test VTK_IGNORE_BTX setting to ensure that it is ON
"""
import sys
import vtk
from vtk.test import Testing
class TestIgnoreBTX(Testing.vtkTest):
def testIgnoreBTX(self):
"""Try to call a method that is BTX'd, to ensure VTK_IGNORE_BTX=ON
"""
stringArray = vtk.vtkStringArray()
in... |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2014 Vincent Jacques <vincent@vincent-ja... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
import time
import picamera
with picamera.PiCamera() as cam:
cam.resolution = (2592, 1944)
cam.start_preview()
time.sleep(1)
cam.exif_tags['IFD0.Artist'] = 'Me!'
cam.exif_tags['IFD0.Copyright'] = 'Copyright (c) 2013 Me!'
cam.capture('start05.jpg')
cam.stop_preview() |
# test simple async with execution
class AContext:
async def __aenter__(self):
print('enter')
return 1
async def __aexit__(self, exc_type, exc, tb):
print('exit', exc_type, exc)
async def f():
async with AContext():
print('body')
o = f()
try:
o.send(None)
except StopIt... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
# Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
import requests
from datetime import datetime, timedelta, timezone
import os
from os.path import join, dirname
from dotenv import load_dotenv
dotenv_path = join(dirname(__file__), "../../", '.env')
load_dotenv(dotenv_path)
RASPI_URL ... |
#!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Copyright (c) 2018 The Rito Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node respo... |
import torch
import numpy as np
from src.trainers.base_trainer import BaseTrainer
from src.evaluation.metrics import Metrics
class LSTMAttnTrainer(BaseTrainer):
"""
Trainer class. Optimizer is by default handled by BaseTrainer.
"""
def __init__(self, model, config):
super(LSTMAttnTrainer, se... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 17 07:41:32 2019
Deterministic nowcast with pySTEPS, with extraction of results per catchment.
Based on the input data for the Ensemble nowcast, but without any ensembles.
Make sure to change the initial part to your case.
Note that this script assumes that the catchm... |
from ti4_map_generator import __version__
def test_version():
assert __version__ == '0.1.0' |
def credit(valor):
return ('Valor créditado R${:.2f}'.format(valor))
def debit(valor):
return('Valor debitado R${:.2f}'.format(valor)) |
#!/usr/bin/env python
# encoding: utf-8
# 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, Ver... |
"""Create json files for offsets."""
from swissknife import utils
# Only give the majority some advantage.
for size in (10, 20, 50, 100, 200, 500, 1000, 2000,):
size_str = utils.int2str(size)
path = utils.join(".", f'offset_sizes_{size_str}.json')
utils.jdump(
{0: size}, path
) |
from dataclasses import dataclass, field
from typing import Optional
from xsdata.models.datatype import XmlDate
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-date-minInclusive-4-NS"
@dataclass
class NistschemaSvIvAtomicDateMinInclusive4:
class Meta:
name = "NISTSchema-SV-IV-atomic-date-minInclusive-4"
... |
"""simuran_batch_params.py describes behaviour for recursing through directories."""
import os
# Where to start running batch analysis from
start_dir = os.path.abspath(os.path.join("__dirname__", "CSR6"))
# regex_filters should be a list of regex patterns to match against.
regex_filters = ["(^small.*/.*[1-9]/S1.*)|(... |
# -*- coding: utf-8 -*-
# Owner(s): ["module: unknown"]
import copy
import logging
import torch
from torch import nn
from torch.ao.sparsity import BasePruner, PruningParametrization, ZeroesParametrization
from torch.nn.utils import parametrize
from torch.testing._internal.common_utils import TestCase
logging.basic... |
"""
'map_range_demo.py'.
=================================================
maps a number from one range to another
"""
import time
import simpleio
while True:
sensor_value = 150
# Map the sensor's range from 0<=sensor_value<=255 to 0<=sensor_value<=1023
print('original sensor value: ', sensor_value)
... |
"""
Code to proxy logs from the narrative, over a socket, to a DB.
The proxy will tend to have root permissions so it can read protected
configuration files.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '8/22/14'
import asyncore
from datetime import datetime
from dateutil.tz import tzlocal
import loggin... |
print ('----------Até 5 Kg----------\n[1] File > R$ 4,90 por Kg')
print ('[2] Alcatra > R$ 5,90 por Kg')
print ('[3] Picanha > R$ 5,90 por Kg\n')
print ('-------Acima de 5 Kg-------\n[1] File > R$ 5,80 por Kg')
print ('[2] Alcatra > R$ R$ 6,80 por Kg')
print ('[3] Picanha > R$ 7,80 por Kg\n')
print ('ACEI... |
########
# autora: danielle8farias@gmail.com
# repositório: https://github.com/danielle8farias
# Descrição:Captura o nome da pessoa e retorna uma mensagem de boas-vindas na tela.
########
#importando módulo criando em outro diretório:
# módulo sys fornece acesso a algumas variáveis usadas ou mantidas pelo interpre... |
# Copyright 2016 The TensorFlow 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... |
# Copyright 2020 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... |
import random
import torch
import torch.nn as nn
from models.cnn_layer import CNNLayer
from utility.model_parameter import ModelParameter, Configuration
class SiameseNeuralNetwork(nn.Module):
def __init__(self, config: Configuration, label_count=64, device=torch.device('cpu'), *args, **kwargs):
super(Si... |
#!/usr/bin/env python
""" Implementation of all available options """
from __future__ import print_function
import argparse
from onmt.models.sru import CheckSRU
def model_opts(parser):
"""
These options are passed to the construction of the model.
Be careful with these as they will be used during transla... |
from typing import Any
from ..envs.complex_simplify import ComplexSimplify
from ..types import MathyEnvDifficulty, MathyEnvProblemArgs
from .mathy_gym_env import MathyGymEnv, safe_register
class GymComplexTerms(MathyGymEnv):
def __init__(self, difficulty: MathyEnvDifficulty, **kwargs: Any):
super(GymComp... |
with open("inputs/11.txt") as f:
myin = f.read()
directions = myin.strip().split(",")
x = 0
y = 0
movement = {"n": [0, -1], "ne": [1, -1], "se": [1, 0], "s": [0, 1], "sw": [-1, 1], "nw": [-1, 0]}
maxsteps = 0
for d in directions:
x += movement[d][0]
y += movement[d][1]
if maxsteps < max(abs(x), abs(y))... |
import numpy as np
from toolkit.methods.pnpl import CvxPnPL, DLT, EPnPL, OPnPL
from toolkit.suites import parse_arguments, PnPLReal
from toolkit.datasets import Linemod, Occlusion
# reproducibility is a great thing
np.random.seed(0)
np.random.seed(42)
# parse console arguments
args = parse_arguments()
# Just a lo... |
# Copyright 2018 The TensorFlow 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.