content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
#
# Hash/CMAC.py - Implements the CMAC algorithm
#
# ===================================================================
# 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, perp... |
# Copyright (c) 2013 Hortonworks, 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 ... |
from abc import ABCMeta, abstractclassmethod
class iDocGenerator(metaclass=ABCMeta):
"""
Generate documents
"""
def __init__(self):
pass
@abstractclassmethod
def createDocumentTuple(self):
"""
Yield list of documents
"""
pass
@abstractclassmethod
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup script for the pyexodus module.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2016
:license:
MIT License
"""
import inspect
import os
import sys
from setuptools import setup, find_packages
# Import the version string.
path = os.path.j... |
import numpy as np
import os
from sklearn.model_selection import KFold
from sklearn.model_selection import train_test_split
import pandas as pd
if __name__ == '__main__':
data_path = './augmentation_vtk_data/'
output_path = './'
num_augmentations = 20
train_size = 0.8
with_flip = True
num_sam... |
# -*- encoding: utf-8 -*-
# Copyright (c) 2017 Servionica
#
# 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... |
"""Utility code for facilitating collection of code coverage when running tests."""
from __future__ import annotations
import atexit
import os
import tempfile
import typing as t
from .config import (
IntegrationConfig,
SanityConfig,
TestConfig,
)
from .io import (
write_text_file,
make_dirs,
)
f... |
import argparse
p = argparse.ArgumentParser()
p.add_argument("--foo", action="store_true")
args = p.parse_args()
print(args.foo)
|
#!/usr/bin/env python3
""" Tests for processing microsegment data """
# Import code to be tested
import mseg as rm
# Import needed packages
import unittest
import re
import numpy as np
import os
import itertools
# Skip this test if running on Travis-CI and print the given skip statement
@unittest.skipIf("TRAVIS" i... |
# -*- coding: utf-8 -*-
import openingbook
book = openingbook.build_table(10)
assert len(book) > 0, "Your opening book is empty"
assert all(isinstance(k, tuple) for k in book), \
"All the keys should be `hashable`"
assert all(isinstance(v, tuple) and len(v) == 2 for v in book.values()), \
"All the values sho... |
"""
Insertion resources for SGAS.
Used for inserting usage records into database.
Author: Henrik Thostrup Jensen <htj@ndgf.org>
Magnus Jonsson <magnus@hpc2n.umu.se>
Copyright: NorduNET / Nordic Data Grid Facility (2009, 2010, 2011)
"""
from twisted.internet import defer
from twisted.python import log
from tw... |
# Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. 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
#
# Un... |
# Generated by Django 3.2.8 on 2021-11-01 19:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('neighbor', '0002_rename_neighbourhood_neighborhood'),
]
operations = [
migrations.RemoveField(
model_name='business',
name='... |
# -*- coding: utf-8 -*-
"""The Windows EventLog (EVT) file event formatter."""
from plaso.formatters import interface
from plaso.formatters import manager
from plaso.lib import errors
class WinEVTFormatter(interface.ConditionalEventFormatter):
"""Formatter for a Windows EventLog (EVT) record event."""
DATA_TYPE... |
"""
Some basic admin tests.
Rather than testing the frontend UI -- that's be a job for something like
Selenium -- this does a bunch of mocking and just tests the various admin
callbacks.
"""
import mock
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.test import TestCase
fro... |
import os
import json
import functools
from tornado import web
from notebook.base.handlers import IPythonHandler
from nbgrader.api import Gradebook
from nbgrader.apps.api import NbGraderAPI
class BaseHandler(IPythonHandler):
@property
def base_url(self):
return super(BaseHandler, self).base_url.rstr... |
"""Test creating new settings """
import pytest
from bot.core.database.settings_collection import SettingsCollection
from test_framework.asserts.database_asserts.check_settings_collection import check_create_new_settings
from test_framework.scripts.common.data_factory import get_test_data
@pytest.mark.asyncio
@pytes... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylin... |
import unittest
import mock
from able.queue import ble_task
class TestBLETask(unittest.TestCase):
def setUp(self):
self.queue = mock.Mock()
self.task_called = None
@ble_task
def increment(self, a=1, b=0):
self.task_called = a + b
def test_method_not_executed(self):
s... |
#!/usr/bin/env python
# encoding: utf-8
"""@package Operators
This module offers various methods to process eye movement data
Created by Tomas Knapen on .
Copyright (c) 2010 TKLAB. All rights reserved.
More details.
"""
from __future__ import division
import os, pickle, inspect
import numpy as np
import scipy as s... |
class LOG:
""" This class specifies the different logging levels that we support.
Levels can be trivially added here and in src/core/utility.py#Msg along
with their pretty output information.
"""
INFO = 1 # green
SUCCESS = 2 # bold green
ERROR = 3 # red
DEBUG = 4 ... |
# -*- coding: utf-8 -*-
"""
Marker Property
===============
"""
# %% IMPORTS
# Package imports
from matplotlib import rcParams
# GuiPy imports
from guipy import widgets as GW
from guipy.plugins.figure.widgets.types.props import BasePlotProp
from guipy.widgets import set_box_value
# All declaration
__all__ = ['Lin... |
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from sklearn.tree import DecisionTreeRegressor
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.metrics import r2_score
import pandas as ... |
import flask
from pypi_vm.infrastructure.view_modifiers import response
from pypi_vm.viewmodels.packages.package_details_viewmodel import PackageDetailsViewModel
from pypi_vm.viewmodels.packages.popular_viewmodel import PopularPackageViewModel
blueprint = flask.Blueprint('packages', __name__, template_folder='templat... |
#!/usr/bin/python3
import requests as rq
from hbtn_api.urls import URL_AUTH
def auth(apikey, email, psswd, *args):
data = {
'api_key': apikey,
'email': email,
'password': psswd,
'scope': 'checker'
}
r = rq.get(URL_AUTH, data=data)
return r.json()
|
import configparser
import datetime
import wx
import os
# local imports
from . import core
class Config:
"""
Used as a common config manager thorought the application,
it uses configparser functionality to load configuration files
and theme files.
"""
def __init__(self):
self.load_c... |
valores: list = list()
maior = menor = 0
for cv in range(0, 5):
valores.append(int(input(f'Digite um valor na posição {cv}: ')))
maior = max(valores)
menor = min(valores)
# if cv == 0:
# maior = menor = valores[cv]
# else:
# if valores[cv] > maior:
# maior = valores[cv]
... |
import random
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
NUMBERS = "0123456789"
class Robot(object):
ROBOT_NAME_CHARS_NUMBER = 2
ROBOT_NAME_NUM_NUMBERS = 3
def __init__(self):
self.reset()
@staticmethod
def _generate_name_section(collection, number_of_iteration):
"""_generate_name... |
import sublime,sublime_plugin,threading,json,os,threading,subprocess,socket,shutil
from base64 import b64encode, b64decode
# python 2.6 differences
try:
from hashlib import md5, sha1
except: from md5 import md5; from sha import sha as sha1
from SimpleHTTPServer import SimpleHTTPRequestHandler
from struct import pac... |
"""Providers services related to the cache."""
from typing import Optional
from limberframework.cache.cache import Cache
from limberframework.cache.lockers import Locker, make_locker
from limberframework.cache.stores import Store, make_store
from limberframework.foundation.application import Application
from limberfra... |
#!/usr/bin/env python2.7
# Distributed under the terms of MIT License (MIT)
# Based on fa.wikipedia's AbarAbzar tool
##https://fa.wikipedia.org/wiki/Mediawiki:Gadget-Extra-Editbuttons-persianwikitools.js
##https://fa.wikipedia.org/wiki/Mediawiki:Gadget-Extra-Editbuttons-persiantools.js
##https://fa.wikipedia.org/wiki... |
# -*- coding: utf-8 -*-
import logging
import sys
LOG_FORMAT = "[%(process)d] %(asctime)s.%(msecs)03d [%(levelname).1s] %(message)s"
LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
def setup_logging() -> None:
formatter = logging.Formatter(fmt=LOG_FORMAT, datefmt=LOG_DATE_FORMAT)
handler = logging.StreamHandler(sys... |
#!/usr/bin/env python
# ClusterShell.Node* test suite
"""Unit test for NodeSet with Group support"""
import copy
import shutil
import sys
import unittest
sys.path.insert(0, '../lib')
from TLib import *
# Wildcard import for testing purpose
from ClusterShell.NodeSet import *
from ClusterShell.NodeUtils import *
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import io
import math
import numpy as np
import random
import torch
from PIL import Image
def temporal_sampling(hdf5_video, hdf5_video_key, start_idx, end_idx, num_samples, video_length):
"""
Given the start and en... |
from setuptools import setup, Extension
import setuptools
stream_json_parser_utils = Extension('stream_json_parser_utils', extra_compile_args = [ '--std=c++11' ], sources = [ 'utils/src/utils.cpp' ])
if __name__ == '__main__':
setup(
name='streamjsonparser',
version='1.1',
description='Stream ... |
from collections import OrderedDict
from datetime import datetime, timezone
from pytest import raises
from qsck import serialize
def test_serialize_is_a_function():
assert hasattr(serialize, '__call__')
def test_it_formats_identifier_and_timestamp_as_unix_epoch():
identifier = 'LOG'
some_key_value_pa... |
"""
This build static figures with dataset from
the google drive : "study_mearec_SqMEA1015um".
"""
import sys
sys.path.append('../../examples/modules/comparison/')
from generate_erroneous_sorting import generate_erroneous_sorting
import spikeinterface.extractors as se
import spikeinterface.comparison as sc
impor... |
from optparse import OptionParser
from random import randint
import random
import sys
import io
import queue
#import statprof
from contextlib import contextmanager
#@contextmanager
#def stat_profiler():
#statprof.start()
#yield statprof
#statprof.stop()
#statprof.display()
class Edge:
def __in... |
from moneywave.account import Account
from moneywave.resources import Resource
from moneywave.transaction import Transaction
from moneywave.utils import Util, Settings
from moneywave.wallet import Wallet
class MoneyWave:
def __init__(self, api_key, secret_key, mode="test"):
self.settings = Settings(api_ke... |
class PropsdDictionary(dict):
"""A dictionary backed by propsd
This dictionary enables the use of a standard python dictionary
that is backed by the propsd service. The dictionary must be
refreshed by calling the refresh method.
"""
def __init__(self, propsd_client):
self.__propsd_client = propsd_cli... |
import argparse
import seaborn as sns # noqa
from matplotlib import pyplot as plt
from pathlib import Path
from dask import dataframe as dd
import const
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', required=True)
args = parser.parse_args()
data_dir = Path(args.... |
default_chunk_size = 32 * 1024 * 1024
gs_max_parts_per_compose = 32
upload_chunk_identifier = "gs-chunked-io-part"
reader_retries = 5
writer_retries = 5
|
import cmath
def usual(tab):
N = len(tab)
tab2 = [0] * N
for n in range(0, N):
for k in range(0, N):
tab2[n] = tab2[n] + tab[k] * cmath.exp(-2 * 1j * cmath.pi * n * (k / N))
return tab2
def inverse(tab):
N = len(tab)
tab2 = [0] * N
for n in range(0, N):
for ... |
from sklearn import preprocessing
from desafio_iafront.jobs.common import transform
from desafio_iafront.data.saving import save_partitioned
class Preprocessing:
def __init__(self, result, saida):
self.result = result
self.saida = saida
def normalizer(self):
# Faz a escala dos valor... |
from typing import TYPE_CHECKING
from contextlib import closing
from nonebot.rule import Rule
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import MessageEvent
from .. import crud
from ..db import get_db
if TYPE_CHECKING:
from nonebot.typing import Bot, Event
def validate_user() -> Rule:
... |
from django.utils.encoding import force_text
import pytest
from apps.core.tests.base_test_utils import (
generate_uid_and_token,
mock_email_backend_send_messages,
)
from apps.users.constants.messages import EXPIRED_LINK_MESSAGE
from .constants import NEW_TEST_PASSWORD, PASS_RESET_CONFIRM_URL, PASS_RESET_URL
... |
from pftools.module_conv_utils import PFConversion
class pncConversion(PFConversion):
"""Class for probe data conversion
inherits from PFConversion
Parameters
----------
pfFile : string
probe file (surface or volume)
verbose : bool
Activate or desactivate informative prints (d... |
# Generated by Django 3.0.8 on 2020-08-20 19:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0019_auto_20200820_1508'),
]
operations = [
migrations.AlterField(
model_name='course',
name='hours',
... |
""" This module contains the code that allows the LWR to stage file's during
preprocessing (currently this means downloading or copying files) and then unstage
or send results back to client during postprocessing.
:mod:`lwr.managers.staging.preprocess` Module
-------------------------------
.. automodule:: lwr.manage... |
import re
import json
VIEW_KEY_RE = r"a.+?href=\".+?viewkey=(.+?)\""
INFO_RE = r"var flashvars_.+? = ({.+})"
class Extractor(object):
def __init__(self):
self._viewkey_re = re.compile(VIEW_KEY_RE, re.MULTILINE)
self._videoinfo_re = re.compile(INFO_RE, re.MULTILINE)
def get_viewkeys(self, dat... |
import logging
import random
import re
from datetime import datetime
from plugins import Processor, handler, match
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("neikea.plugins")
class Strip(Processor):
"""
Turn the 'message' string into a dict that will contain different
versions o... |
import os
import numpy as np
import sys
import json
def read_text_lines(filepath):
with open(filepath, 'r') as f:
lines = f.readlines()
lines = [l.rstrip() for l in lines]
return lines
def check_path(path):
if not os.path.exists(path):
os.makedirs(path, exist_ok=True) ... |
from twilio.rest import Client
from twilio.twiml.voice_response import Gather, VoiceResponse
import os
class TwilioNotification:
def __init__(self, sid, auth_token):
self.client = Client(sid, auth_token)
def send_call(self, action_url, contacts):
response = VoiceResponse()
gather = ... |
# -*- coding: utf-8 -*-
# @Time : 2021/5/10 11:13
# @Author : Jiangzhesheng
# @File : test0.py
# @Software: PyCharm
import sys
import os
from flye.repeat_graph.repeat_graph import RepeatGraph
import flye.utils.fasta_parser as fp
from my_change.ond_algo import *
from bioclass import Sequence
def get_e... |
# @Author: Yang Li
# @Date: 2020-05-20 21:17:13
# @Last Modified by: Yang Li
# @Last Modified time: 2021-04-19 22:14:04
from __future__ import division
from __future__ import print_function
import argparse
import time
import numpy as np
import scipy.sparse as sp
import networkx as nx
import torch
fr... |
'''This is sandbox code
'''
|
i=0
while False:
i+=1
print("Hello:",i)
|
#! /usr/bin/python
# -*- coding: UTF-8 -*-
import smtplib
from email.mime.text import MIMEText
from email.header import Header
from settings import EMAIL_SMTP_SETTINGS
def send_mail(subject, message, message_type='html'):
message = MIMEText(message, message_type, 'utf-8')
message['From'] = Header(EMAIL_SMTP_... |
from zeus import factories
from zeus.constants import Result, Status
from zeus.models import Job
def test_new_job(client, default_source, default_repo, default_hook):
build = factories.BuildFactory(
source=default_source, provider=default_hook.provider, external_id="3"
)
job_xid = "2"
path =... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_descriptio... |
from flask import Flask, make_response, render_template, request
app = Flask(__name__, template_folder='template')
@app.route('/')
def index():
return render_template('index02.html')
@app.route('/setcookie', methods = ['POST', 'GET'])
def setcookie():
if request.method == 'POST':
user = request... |
'''unit test class for churn library'''
import time
import logging
import unittest
from pandas.api.types import is_string_dtype
from functools import wraps
from churn_library import ChurnLibrarySolution
keep_cols = [
'Customer_Age',
'Dependent_count',
'Months_on_book',
'Total_Relationship_Count',
... |
from django.db import models
from s3upload.fields import S3UploadField
class Cat(models.Model):
custom_filename = S3UploadField(dest="custom_filename", blank=True)
class Kitten(models.Model):
mother = models.ForeignKey("Cat", on_delete=models.CASCADE)
video = S3UploadField(dest="vids", blank=True)
... |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from .util import number_color
from functools import partial
import glob
import math
from ui.util import number_object
from ui.mouse_event import ReferenceDialog, SnapshotDialog
import copy
Lb_width = 100
Lb_height = 40
Lb... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Warning: Auto-generated file, don't edit.
pinyin_dict = {
0x3416: 'xié',
0x3469: 'luo',
0x36BB: 'jī',
0x378E: 'bǎ,ba',
0x393D: 'chóu',
0x39D1: 'huī',
0x3D89: 'xī',
0x3E62: 'jiā',
0x3E74: 'gěng',
0x3EA2: 'huò',
... |
class DefaultableEntityEndpointsMixin(object):
"""
Defaultable entity endpoints.
"""
def set_default(self, id_):
"""
Sets a entity with given ID as default.
Args:
id_ (str): entity ID.
Returns:
dict: new entity.
"""
self.request... |
sexo = str(input('Informe seu sexo [M / F]: ')).strip().upper()[0] # pega somente a primeira letra
while sexo != 'M' and sexo != 'F':
sexo = str(input('DADOS INVALIDOS. Informe seu sexo [M / F]: ')).strip().upper()
|
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, DateField
from wtforms.validators import DataRequired
class EntryForm(FlaskForm):
entry = StringField('Entry',validators=[DataRequired()])
project = StringField('Project')
notes = StringField('Notes')... |
'''
# DC Racer Testing and Reporting System (DC RTRS)
This script runs a standard test across all the different
student code bases. The tests will be based on 100 frame
scenarios.
'''
import cv2
import numpy as np
import platform
#import matplotlib.pyplot as plt
import time
import sys
from os import listdir
from ... |
from io import * |
with open('/usr/local/airflow//dags/1','a+') as f:
f.write("1")
|
x = input("x : ")
print(type(x))
y = int(x) + 1
print(y)
print(f"x : {x}, y : {y}")
#there are some falsy values in python3 whenever we use them in boolean sense it will output false
# "" --> this a empty string which is falsy according to python3
# 0 --> no. zero is also falsy
# None --> which represent absense... |
#
# PySNMP MIB module XEDIA-L2DIAL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XEDIA-L2DIAL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:36:26 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... |
'''
Stacking the cubes with sizes in descending order from bottom to top.
**NOTE**
Every time only the left-most or the right-most cube can be stacked from the array/list.
'''
#Input Format:
'''
The first line contains a single integer T, the number of test cases.
For each test case, there are 2 lines.
The f... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from taysistunto.feeds import SpeakerFeed, DocumentFeed, ActionFeed, ActionsByWordFeed
urlpatterns = patterns('',
# Examples:
url(r'^$', 'taysistunto.vi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 02/03/2020
"""
from enum import Enum
__all__ = ["UpscaleMode", "MergeMode"]
class MergeMode(Enum):
Concat = 0
Add = 1
class UpscaleMode(Enum):
FractionalTranspose = ... |
"""Refiner is the refinement module public interface. RefinerFactory is
what should usually be used to construct a Refiner."""
import copy
import logging
import math
import psutil
import libtbx
from dxtbx.model.experiment_list import ExperimentList
from libtbx.phil import parse
import dials.util
from dials.algorit... |
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... |
import torch
from enum import Enum
from experiments import constants
class OptimizerType(Enum):
SGD = 0
Adam = 1
class SchedulerType(Enum):
MultiStep = 0
class SingleNetworkOptimization(object):
def __init__(self, network: torch.nn.Module, n_epochs: int,
lr=1e-4, weight_decay=1e-3... |
import sys
import random
import time
from cnn import utils
import logging
import warnings
warnings.filterwarnings("ignore")
import argparse
import torch.utils
import torch.backends.cudnn as cudnn
from utils.scheduler import Scheduler
from torchvision.transforms import transforms
import torchvision.datasets as datasets
... |
#!/usr/bin/env python3
import base64
import os
import subprocess
import sys
import yaml
EDITOR = os.environ.get('EDITOR', 'vi')
class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
def remove_implicit_resolver(cls, tag_to_remove):
"""
Remove implicit resolvers for a particular tag
... |
#!/usr/bin/python
"""
Basic class for communication to Parrot Bebop
usage:
./bebop.py <task> [<metalog> [<F>]]
"""
import sys
import socket
import datetime
import struct
import time
import numpy as np
import math
from navdata import *
from commands import *
from video import VideoFrames
# this will be in ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
import numpy as np
import csv
import json
import argparse
import pickle
ap = argparse.ArgumentParser()
ap.add_argument("-m", "--method", help="vote Method to learn from")
ap.add_argument("-r", "--row", help="data row joined by comma")
ap.add_argument("-f", "--filename", help="filename of dataset")
args = vars(ap.parse_... |
# Copyright (C) Izumi Kawashima
#
# json2oscimv4 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# json2oscimv4 is distributed in the... |
load(
"@bazel_tools//tools/jdk:toolchain_utils.bzl",
"find_java_toolchain",
)
load(
"@rules_scala_annex//rules:providers.bzl",
_ScalaConfiguration = "ScalaConfiguration",
_ZincConfiguration = "ZincConfiguration",
_ZincInfo = "ZincInfo",
)
load(
"@rules_scala_annex//rules/common:private/utils... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import numpy as np
import timeit
import json
from operator_benchmark import benchmark_utils
"""Performance microbenchmarks.
This module contains core ... |
# 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
# distributed under t... |
import abc
import numpy as np
class ErrFunc(abc.ABC):
"""Base class for classification model error functions."""
@abc.abstractmethod
def apply(self, prediction, y):
"""Apply the nonconformity function.
Parameters
----------
prediction : numpy array of shape [n_samples, n_... |
import bpy
from math import pi
# ----------------------------------------------------------------------------------------
# Start - copied functions
# ----------------------------------------------------------------------------------------
def sun_light(
location, rotation, power=2.5, angle=135, name="Light_sun"... |
#!/bin/python
#python
import sys
import os
import shutil
import numpy
import time
import math
import threading
from scipy import ndimage
#appion
from appionlib import appionScript
from appionlib import apStack
from appionlib import apDisplay
from appionlib import appiondata
from appionlib import apEMAN
from appionlib ... |
# terrascript/provider/josenk/esxi.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:15:57 UTC)
import terrascript
class esxi(terrascript.Provider):
"""Terraform-provider-esxi plugin"""
__description__ = "Terraform-provider-esxi plugin"
__namespace__ = "josenk"
__name__ = "esxi"
... |
from .db import session_scope, Server
from datetime import datetime, timedelta
class Gateway:
def get_all_servers(self):
with session_scope() as session:
raw_servers = session.query(Server)
raw_servers_dict = []
if raw_servers:
for raw_server in raw_se... |
"""Utility functions."""
from typing import typevar, List, Any
T = typevar('T')
def short_type(obj: object) -> str:
"""Return the last component of the type name of an object.
If obj is None, return 'nil'. For example, if obj is 1, return 'int'.
"""
if obj is None:
return 'nil'
t = str... |
from abc import ABC
from abc import abstractmethod
class DatabaseQuery(ABC):
@staticmethod
def query_invoke(func):
def wrapper_method(self_instance, *args, **kwargs):
try:
self_instance.create_connection()
result = func(self_instance, *args, **kwargs)
... |
# coding: utf-8
import argparse
from argparse import RawDescriptionHelpFormatter
import sys
import os
sys.path.append('.\src')
sys.path.append('..\src')
from src.main_functions import *
updateInput='u'
fullupdateInput='fu'
downloadInput='d'
statusInput='s'
compressInput='c'
def check_env():
try:
os.... |
import json
from collections import defaultdict
from typing import List, Tuple, Dict
from commands.snapshot import snapshot
from drive.api import DriveFile, Snapshot, resolve_paths, ResourcePath, Resource
from drive.http import ErrorHandlingRunner, GAPIBatchRunner
from drive.misc import eprint
from drive.serializers i... |
#!/usr/bin/env python3
# -*- coding: UTF-8
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import bs4
import requests
import re
from urllib.request import urlretrieve
import os.path
import csv
if __name__ == "__main__":
base__url = "http://pesquisa.memoriasreveladas.gov.br/mrex/consulta/"
first_url = "... |
# 20412 - [Job Adv] (Lv.100) Mihile 4rd job adv
sm.setSpeakerID(1101002)
if sm.sendAskYesNo("Are you ready, are you okay to leave?"):
sm.warp(913070100, 0)
sm.setInstanceTime(300, 130000000) |
##############################################################################
# Written by: Cachen Chen <cachen@novell.com>
# Date: 09/25/2009
# Application wrapper for Moonlight combobox
# Used by the combobox-*.py tests
##############################################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.