text stringlengths 2 999k |
|---|
import pandas as pd
from src.approaches.acfa.acfa import ACFASampler
class ProbSampler(ACFASampler):
"""Implements the Active Feature Acquisition-based Sampler by estimating utility
with a probability based method."""
def __init__(self, *args, **kwargs):
self.b = kwargs.pop("b") if "b" in kwargs... |
__import__('setuptools').setup(
name="aye",
version="0.0.1",
author="Tony Fast", author_email="tony.fast@gmail.com",
description="Interactive Notebook Modules.",
license="BSD-3-Clause",
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-ipynb'],
install_requires=['ipytho... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class SoftTargetCrossEntropy(nn.Module):
"""
The soft target CrossEntropy from timm.
https://github.com/rwightman/pytorch-image-models/blob/e4360e6125bb0bb4279785810c8eb33b40af3ebd/timm/loss/cross_entropy.py
It works under the mixup.
... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**params... |
from sqlalchemy import Column, ForeignKey, Table
from sqlalchemy import Boolean, DateTime, Float, Integer, LargeBinary, String, Text
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import relationship
###########################################################################... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import os
import MySQLdb
from six import iteritems
import logging
from werkzeug.wrappers import Request
from werkzeug.local import LocalManager
from werkz... |
# This is a migrator for CyPhy projects.
# We recently started tracking a Component's "backend folder" location
# inside CyPhy itself, instead of in the project.manifest.json.
# This migrator will take component location data from the project.manifest.json
# and insert it into the CyPhy model.
# Algorithm:
# ... |
#
# PySNMP MIB module JUNIPER-SONET-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-SONET-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:50:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... |
import pandas
import xml.etree.ElementTree as ET
import sys
import argparse
sys.path
sys.path.append('/usr/local/lib/python2.7/site-packages/')
import xmltodict
import os
import pandas as pd
import re
# This script removes PHI tags that are not PHI (according to HIPAA) from i2b2 annotations
def extractXML(directory,... |
# Copyright 2013 Mellanox Technologies, 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 t... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import os
import sys
import re
from functools import wraps
import click
from . import configs, decorators, telemetry
from .constants import EdgeConstants
from .edgecert import EdgeCert
from .edgemanager import ... |
# 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... |
# Time: O(n)
# Space: O(1)
# Initially, there is a Robot at position (0, 0). Given a sequence of its moves,
# judge if this robot makes a circle, which means it moves back to the original place.
#
# The move sequence is represented by a string. And each move is represent by a character.
# The valid robot moves are R ... |
# coding: utf-8
"""
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use ... |
from CommonServerPython import *
import traceback
COLORS = {'AWS': 'ff0000',
'GCP': '339966',
'Azure': '0000ff'}
HTML_START = """<h1 style="color: #2e6c80; height: 170px; line-height: 170px; text-align: center;">"""
HTML = """<span style="color: #{color};"><strong>{provider} &... |
# Copyright (c) 2013 Mirantis 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... |
import pytest
from apistar import Route, http, test
from apistar.server.app import App, ASyncApp
# HTTP Components as parameters
def get_request(request: http.Request):
return {
'method': request.method,
'url': request.url,
'headers': dict(request.headers),
'body': request.body.d... |
"""
This sample demonstrates retrieving sensor versions by hostname
"""
# pylint: disable=C0103,W0621,E0401
import json
from falconpy.hosts import Hosts
def device_list(offset: int, limit: int):
"""
I return a list of all devices for the CID, if I max out on the query limit, I can paginate
"""
result ... |
"""
Contains all the algorithms associated with graph
data structure.
"""
from collections import deque as Queue
from concurrent.futures import ThreadPoolExecutor
from pydatastructs.utils import GraphEdge
from pydatastructs.miscellaneous_data_structures import DisjointSetForest
from pydatastructs.graphs.graph import Gr... |
#!/usr/bin/env python3
"""Matplotlib 3D plotting example
Demonstrates plotting with matplotlib.
"""
import sys
from sample import sample
from sympy import sin, Symbol
from sympy.external import import_module
def mplot3d(f, var1, var2, show=True):
"""
Plot a 3d function using matplotlib/Tk.
"""
i... |
"""
WSGI config for kodland project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... |
# -*- coding: latin-1 -*-
# -----------------------------------------------------------------------------
# Copyright 2014, 2017 Stephen Tiedemann <stephen.tiedemann@gmail.com>
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (t... |
#!/usr/bin/env python
# Copyright 2017 Google 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
#
# Unless require... |
from functools import partial
import psutil
import numpy as np
import pandas as pd
import tsfresh.utilities.dataframe_functions as tsfresh_utils
from sklearn.base import TransformerMixin
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.pipeline import Pipeline
from tsfresh import extract_feature... |
"""Support for deCONZ climate devices."""
from __future__ import annotations
from typing import Any
from pydeconz.models.sensor.thermostat import (
THERMOSTAT_FAN_MODE_AUTO,
THERMOSTAT_FAN_MODE_HIGH,
THERMOSTAT_FAN_MODE_LOW,
THERMOSTAT_FAN_MODE_MEDIUM,
THERMOSTAT_FAN_MODE_OFF,
THERMOSTAT_FAN_M... |
# encoding: utf-8
"""
Utilities for path handling.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this so... |
from abc import abstractmethod
class HardwareBase:
@staticmethod
def get_cmdline():
with open('/proc/cmdline') as f:
cmdline = f.read()
return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2}
@staticmethod
def read_param_file(path, parser, default=0):
try:... |
from collections import namedtuple
import coreapi
from rest_framework import viewsets, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.schemas import AutoSchema
from app.pagination import CustomPagination
from environments.identities.model... |
#!/usr/bin/env python3
# Original source: https://github.com/laelbarlow/jackhmmerer
# Licence notice: MIT License, copyright (c) 2021 Lael D. Barlow
"""Script for parsing parameters and running jackhmmer.
"""
import os
import subprocess
import pandas as pd
# Make output directory for intermediate profiles.
os.mkdir(s... |
# 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
# d... |
__author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... |
'''Classes to represent information about courses'''
from datetime import datetime
class Course:
'''The prefix and number for a course.
Prefix is guaranteed to be upper-case.'''
def __init__(self, prefix, number):
self.Prefix = prefix.upper()
self.Number = number
def __eq__(self, other):
retu... |
# -*- coding: utf-8 -*-
from .BaseHandler import BaseHandler
import urllib
import hashlib
from uuid import uuid1
from utils.GenCode import PayCode
class Order(BaseHandler):
def post(self, *args, **kwargs):
out_trade_no = self.get_argument('out_trade_no')
total_fee = self.get_argument('t... |
import pygame as game
import time
import random
import math
import constants
class Button:
def __init__(s, pos = [0, 0], size = [0, 0], text = "", func = None, font = constants.small_font, centered = True, visible_background = True, hover_img = "", idle_img = "", pressed_img = ""):
if centered:
... |
#!/usr/bin/env python
# coding=utf-8
# pylint: disable=missing-docstring,too-many-lines
################################################################################
#
# Description: Grammar based generation/fuzzer
#
# Portions Copyright 2014 BlackBerry Limited
#
# Licensed under the Apache License, Version 2.0 (the... |
from typing import Set
import os
from pydantic import BaseSettings, Field # pylint: disable=no-name-in-module
class LocalFileAdapterConfig(BaseSettings):
"""Configuration for local file adapter"""
local_dirs: Set[str] = Field(
{"tests/data/local_files"},
description=(
"Root dir... |
import torch
import torch.nn as nn
from layers import GCN, AvgReadout, Discriminator, Discriminator2
import pdb
class DGI(nn.Module):
def __init__(self, n_in, n_h, activation):
super(DGI, self).__init__()
self.gcn = GCN(n_in, n_h, activation)
self.read = AvgReadout()
self.sigm = nn.... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from scipy.spatial import KDTree
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classifi... |
# Copyright 2012 Cloudbase Solutions Srl
#
# 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... |
#!/usr/bin/env python
try:
from urllib import urlencode # python2
except ImportError:
from urllib.parse import urlencode # python3
import badge
"""
http://shields.io/
The following styles are available (flat is the default as of Feb 1st 2015)
"""
STYLES = ["plastic", "flat", "flat-square", "for-the-badge", ... |
import torch
from .Criterion import Criterion
# TODO: use THNN
class BCECriterion(Criterion):
eps = 1e-12
def __init__(self, weights=None, sizeAverage=True):
if weights is not None and weights.dim() != 1:
raise ValueError("weights input should be 1D Tensor")
super(BCECriterion, ... |
""" Load VGGNet weights needed for the implementation in TensorFlow
of the paper A Neural Algorithm of Artistic Style (Gatys et al., 2016)
Created by Chip Huyen (chiphuyen@cs.stanford.edu)
CS20: "TensorFlow for Deep Learning Research"
cs20.stanford.edu
For more details, please read the assignment handout:
https://do... |
# -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayLeafNode project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """ska-tmc-cspsubarrayleafnode-mid"""
version = "0.8.7"
version_info = version.split(".... |
# File: B (Python 2.4)
from direct.directnotify import DirectNotifyGlobal
from pirates.piratesbase import PiratesGlobals
from direct.showbase import RandomNumGen
class BattleRandom:
notify = DirectNotifyGlobal.directNotify.newCategory('BattleRandom')
def __init__(self, avId):
self.avId = avId
... |
from utils.config import env_config
PREFIX_URL = "/v1"
@env_config
class AggregatorConfig:
UBIC_URL: str = "http://127.0.0.1:8888"
SHARES_ROUTE: str = "/v1/shares"
ENDPOINTS_ROUTE: str = "/v1/endpoints"
ENDPOINTS_CACHE_TTL = 3600
AGGR_NAME: str = "Yandex"
AGGR_UUID: str = "777aaaaa-1af0-489e-... |
import os
import csv
budget_data = os.path.join("Resources","budget_data.csv")
#Iniatialize the variable
dates = []
profit_losses = []
amount = []
with open(budget_data) as csvfile:
csvreader = csv.reader(csvfile, delimiter= ",")
csv_header = next(csvreader)
#print(f"CSV Header: {csvheader}")
... |
##Function that returns the duplicates contained in an array
##https://www.geeksforgeeks.org/python-program-print-duplicates-list-integers/
def return_duplicates(elements): ## Define the function return duplicates
array = len(elements) ## array = all elements of the input range
duplicates = [] ## duplicat... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tinkoff/invest/grpc/orders.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message... |
#!/usr/bin/python
#coding=utf-8
class Post(object):
def __init__(self, title = None, date = None, filetype = None, comments=True, layout='post',category = 'unclassified', tags = ['None']):
self.title = title
self.date = date
self.comments = comments
self.layout = layout
self.... |
import os
from domain.models.paths import Paths
from shared.helpers.path_helper import get_path_configuration
from domain.models import hyper_parameter_information
from domain.services.contract.abstract_configure_network_service import AbstractConfigureNetworkService
from object_detection.utils.config_util import get_... |
from unittest import mock
import pytest
import youtube_dl
from mopidy import httpclient
from mopidy_youtube import Extension, youtube
from tests import playlist_uris as playlist_uris_list
from tests import video_uris as video_uris_list
user_agent = "{}/{}".format(Extension.dist_name, Extension.version)
@pytest.fi... |
from __future__ import division, print_function, unicode_literals
import numpy as np
try:
from sklearn.externals import joblib
except:
joblib = None
from word2vec.utils import unitvec
class WordVectors(object):
def __init__(self, vocab, vectors, clusters=None):
"""
Initialize a WordVec... |
from math import sqrt
n = 600851475143
fact = []
primeFact = []
for i in range(2,int(sqrt(n))):
#check if a factor
if(n%i==0):
#check if factor is prime
prime = True
j=2
while(j<=sqrt(i)):
if(i%j==0):
print "Not a prime",i
prime = Fal... |
import random
from xworld_task import XWorldTask
class XWorldNavColorTarget(XWorldTask):
def __init__(self, env):
super(XWorldNavColorTarget, self).__init__(env)
def idle(self):
goals = self._get_colored_goals()
agent, _, _ = self._get_agent()
targets = [g for g in goals if sel... |
import sys
import typing
import numba as nb
import numpy as np
@nb.njit
def seg_build(n: int) -> typing.NoReturn:
return np.zeros(n * 2, np.int64)
@nb.njit
def seg_build_from_array(a: np.ndarray) -> np.ndarray:
n = len(a)
seg = np.empty(n * 2, np.int64)
seg[n:] = a
for i in range(n - 1, ... |
import locale
import logging
import threading
from memorious.core import settings
LANGUAGES = 'eng'
log = logging.getLogger(__name__)
lock = threading.RLock()
def get_ocr():
"""Check if OCR service is available; else throw an error"""
if not hasattr(settings, '_ocr'):
try:
from tesserocr... |
from pymysql import install_as_MySQLdb
install_as_MySQLdb()
# import pymysql
# pymysql.install_as_MySQLdb() |
"""Supporting functions for the 'fix' command."""
import logging
import numpy as np
import pandas as pd
from . import descriptives, params, smoothing
def do_fix(target_raw, antitarget_raw, reference,
do_gc=True, do_edge=True, do_rmask=True, do_cluster=False):
"""Combine target and antitarget coverage... |
"""
This module contains all string representations of a month's week, used by :class:`~cms.models.events.event.Event`.
"""
from django.utils.translation import ugettext_lazy as _
#: First week of the month
FIRST = 1
#: Second week of the month
SECOND = 2
#: Third week of the month
THIRD = 3
#: Fourth week of the mon... |
from unittest import TestCase
from app.domain.model import Holder, Account, Currency
class TestHolder(TestCase):
def test_create_new_holder_and_add_operations(self):
new_holder = Holder("str_id", [])
self.assertIsInstance(new_holder, Holder)
new_account_1 = Account("id_account_1", Cu... |
#!/usr/bin/env python
import numpy as np
import sklearn
from sklearn.preprocessing import LabelEncoder
import pickle
from sensor_stick.srv import GetNormals
from sensor_stick.features import compute_color_histograms
from sensor_stick.features import compute_normal_histograms
from visualization_msgs.msg import Marker... |
# VMSS Editor - Azure VM Scale Set management tool
# vmsseditor.py - GUI component of Rolling Upgrade, tkinter based
# - uses vmss.py and subscription.py classes for Azure operations
"""
Copyright (c) 2016, Guy Bowerman
Description: Graphical dashboard to show and set Azure VM Scale Set properties
License: MIT (see LI... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... |
import datetime
from django.db import models
from django.contrib.contenttypes.models import ContentType
from .settings import OBSOLETE_DAYS
class NoticeSettingManager(models.Manager):
def get_or_create(self, user=None, notice_type=None, backend=None,
**kwargs):
try:
re... |
"""
SQL-style merge routines
"""
from __future__ import annotations
import copy
import datetime
from functools import partial
import hashlib
import string
from typing import (
TYPE_CHECKING,
Optional,
Tuple,
cast,
)
import warnings
import numpy as np
from pandas._libs import (
Timedelta,
hash... |
"""Module for setting up testing fixtures"""
# Third-party libraries
import pytest
from flask import current_app, Response
# Local imports
from application import create_app
from app.db import MovieStore
# constants
from app.utils import BASE_URL
@pytest.yield_fixture(scope='session')
def app_():
"""
Setup ... |
class Message:
"""A wrapper around the tuple that pika returns when reading a message.
"""
def __init__(self, delivery_info, properties, body):
"""
Args:
delivery_info [pika.spec.GetOK]
properties [pika.spec.BasicProperties]
body [str]
"""
self.... |
#!/usr/bin/python
'''
A collection of useful tools and functions for the manipulation of SBtab tables and SBtab documents.
'''
import re
import string
import libsbml
import numpy
import scipy
import scipy.linalg
import scipy.optimize
import random
import copy
import math
import os
try: from . import SBtab
except: impo... |
txt = sorted(tuple(x for x in input().lstrip()))
txt_set = set()
for i in txt:
if i not in txt_set:
print(f"{i}: {txt.count(i)} time/s")
txt_set.add(i)
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# manage.py
import os
import unittest
import coverage
from flask_script import Manager
from authentek.app import create_app as initialize_app
from authentek.logger import log
from authentek.extensions import db, migrate
from authentek.database.models import User, BlacklistToken # noqa
from flask_migrate import Mi... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import io
from pathlib import Path
import yaml
from aiohttp.test_utils import TestServer
from simcore_service_webserver.db import is_service_enabled, is_service_responsive
def test_uses_same_postgres_version(
... |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
import csv
import pandas as pd
import plotly_express as px
with open('graphs/class2.csv',newline='') as f:
reader=csv.reader(f)
file_data=list(reader)
#to remove header from CSV
file_data.pop(0)
total_entries=len(file_data)
total_marks=0
for marks in file_data:
total_marks += float(marks[... |
import gpxpy
import gpxpy.gpx
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def parse_gpx(filename):
distances = [0]
speeds = [0]
times = [0]
with open(filename, 'r') as gpx_file:
gpx = gpxpy.parse(gpx_file)
for track in gpx.tracks:
for segment in t... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fullapp_project.settings')
try:
from django.core.management import execute_from_command_line
exc... |
from describe.descriptors.descriptor import Descriptor
from describe.descriptors.mbtr import MBTR
from describe.descriptors.ewaldmatrix import EwaldMatrix
from describe.descriptors.coulombmatrix import CoulombMatrix
from describe.descriptors.sortedcoulombmatrix import SortedCoulombMatrix
from describe.descriptors.sinem... |
"""
AUTHOR - Atharva Deshpande
GITHUB - https://github.com/AtharvaD11
QUESTION LINK - https://www.codechef.com/problems/FLOW002
"""
***********************************************************
for _ in range(int(input())):
a,b = map(int,input().split())
print(a%b)
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-27 09:11
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import pretix.base.models.organizer
def create_teams(apps, schema_editor):
Event = apps.get_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import subprocess
import sys
import tempfile
import unittest
sys.path.insert(1, os.path.abspath('.'))
import polib
from polib import u
class TestFunctions(unittest.TestCase):
def test_pofile_and_mofile1(self):
"""
Test bad u... |
# Copyright (c) MONAI Consortium
# 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, so... |
import pytest
from lhotse.audio import RecordingSet, Recording, AudioSource
from lhotse.cut import CutSet
from lhotse.features import FeatureSet, Features
from lhotse.supervision import SupervisionSet, SupervisionSegment
from lhotse.testing.dummies import dummy_cut, dummy_supervision
@pytest.fixture()
def libri_reco... |
# -*- coding: utf-8 -*-
from pandas_ta.utils import get_offset, verify_series
def skew(close, length=None, offset=None, **kwargs):
"""Indicator: Skew"""
# Validate Arguments
length = int(length) if length and length > 0 else 30
min_periods = int(kwargs["min_periods"]) if "min_periods" in kwargs and kw... |
from SCons.Script import Import
Import("env")
board_config = env.BoardConfig()
env.Append(
ASFLAGS = ["-x", "assembler-with-cpp"],
CCFLAGS = [
"-mcmodel=medany",
"-mabi=lp64f",
"-march=rv64imafc",
"-fno-common",
"-ffunction-sections",
"-fdata-sections",
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Resources layer tests."""
def test_endpoint_serialization(app, client, example_record):
"""Te... |
#
# 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... |
from collections import OrderedDict
import re
from mako.pygen import PythonPrinter
from sqlalchemy import schema as sa_schema
from sqlalchemy import sql
from sqlalchemy import types as sqltypes
from .. import util
from ..operations import ops
from ..util import compat
from ..util import sqla_compat
from ..util.compat... |
from . import test_web_dialog_size
|
from .core import *
from .layers import *
from .learner import *
from .initializers import *
model_meta = {
resnet18:[8,6], resnet34:[8,6], resnet50:[8,6], resnet101:[8,6], resnet152:[8,6],
vgg16:[0,22], vgg19:[0,22],
resnext50:[8,6], resnext101:[8,6], resnext101_64:[8,6],
wrn:[8,6], inceptionresnet_2:... |
# -*- coding: utf-8 -*-
#
# Streams documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 30 11:18:49 2014.
#
# 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
# autogenerated file.
#
# A... |
import os
import datetime
import pytest
from cffconvert.citation import Citation
@pytest.fixture(scope="module")
def citation():
p = os.path.join(os.path.dirname(__file__), "CITATION.cff")
with open(p, "rt", encoding="utf-8") as fid:
cffstr = fid.read()
return Citation(cffstr)
def test_cffob... |
"""Use ctypes to load libOdb.so and access symbols"""
import ctypes
from ctypes.util import find_library
from .util import suppress_stdout
_LIB = find_library("Odb")
if _LIB is None:
raise OSError("Could not find libOdb. Try updating your LD_LIBRARY_PATH.")
_ODBQL = ctypes.CDLL(_LIB)
_ODBQL.odbql_column_name.re... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 16 13:09:06 2017
@author: Steff
"""
import ClassifierTemplate as ct
import pandas as pd
data = pd.read_csv("../../data/processed/train_set.csv", index_col=0)
# DataFrame containing label (!)
df = pd.DataFrame(data)
# Build Classifier object with DataFrame and column n... |
import mock
import pytest
from ocflib.account.manage import _notify_password_change
from ocflib.account.manage import change_password_with_keytab
from ocflib.account.manage import change_password_with_staffer
from ocflib.account.manage import modify_ldap_attributes
@pytest.yield_fixture
def mock_spawn():
with mo... |
# Generated by Django 2.0.7 on 2018-07-10 02:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sessions_coding', '0006_auto_20180709_2207'),
]
operations = [
migrations.AlterField(
model_name='classroom_session',
... |
pergunta = {
'pergunta 1': {
'pergunta': {'quanto é 2+2? '},
'respostas': {
'a': '1',
'b': '4',
'c': '5'
},
'resposta_certa': 'b'
},
'pergunta 2': {
'pergunta': {'quanto é 7x2? '},
'respostas': {
'a': '15',
... |
# -*- coding: utf-8 -*-
# # Authors: MNE Developers
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
import hashlib
import os.path as op
from datetime import datetime, timedelta, timezone
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allc... |
from floodsystem.stationdata import build_station_list
stations = build_station_list()
N = len(stations)
print(N)
|
#!/usr/bin/env ipython
"""
Validator script for BOT bright and dark pixel analyses.
"""
from bot_eo_validators import run_validator
run_validator('bright_defects', 'dark_defects')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.