text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
"""
Tests that comments are properly handled during parsing
for all of the parsers defined in parsers.py
"""
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import StringIO
class CommentTests(object):
def test_comment(self):
d... |
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
from dolfin import *
# from MatrixOperations import *
import numpy as np
#import matplotlib.pylab as plt
from scipy.sparse import coo_matrix, csr_matrix, spdiags, bmat
import os, inspect
from HiptmairSetup import BoundaryEdge
import matpl... |
import logging
import os
import shutil
from pathvalidate import sanitize_filename
import graphene
from sqlalchemy import and_, BigInteger, cast, func, or_, tuple_
from lingvodoc.schema.gql_holders import (
fetch_object,
ObjectVal,
Upload)
from lingvodoc.models import (
Entity as dbEntity,
Client,
... |
#!/usr/bin/env python
class Entry:
def __init__(self, value, flag, depth, move):
self.value = value
self.flag = flag
self.depth = depth
self.move = move
|
"""
ASGI config for silobytes project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
#!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... |
#!/usr/bin/env python2
# Copyright (c) 2015-2017 The CloudComputingChain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Test script for security-check.py
'''
from __future__ import division,print_function
impor... |
"""Script to create segmented masks."""
import argparse
from pathlib import Path
import cv2
import numpy as np
import torch
from catalyst.dl import SupervisedRunner
from catalyst.dl import utils
from iglovikov_helper_functions.config_parsing.from_py import py2cfg
from iglovikov_helper_functions.utils.img_tools import... |
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "../../../")))
import traceback
import v2.utils.utils as utils
SSL_CERT_PATH = "/etc/ceph/"
PEM_FILE_NAME = "server.pem"
PEM_FILE_PATH = os.path.join(SSL_CERT_PATH, PEM_FILE_NAME)
import logging
log = logging.getLogger()
def create_pem()... |
import json
from redata import settings
from redata.grafana.utils import load_json_data, update_home_panel_element
from grafana_api.grafana_face import GrafanaFace
from redata.grafana.panels.base import HomeLastDayTraffic, HomeLastModifiedTime, HomeAlerts
import math
def load_json_data(file_name):
with open(file_n... |
from types import MappingProxyType
from typing import Dict, List, Set
from lark import Tree, Token
from .problem import Problem
from .helpers import find_name_token_among_children
def lint(parse_tree: Tree, config: MappingProxyType) -> List[Problem]:
disable = config["disable"]
checks_to_run_w_tree = [
... |
"""Utility for plotting test results."""
import argparse
from collections import defaultdict
import csv
import numpy as np
import os.path
import sys
import matplotlib.pyplot as plt
_TESTCASE, _DATASET, _PARAM, _CONDITION, _ROUND, _TIME = 'test', 'dataset', 'param', 'condition', 'round', 'time'
def _stats(iterable):... |
#
# Copyright 2019 Xilinx, 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 ... |
import pytest
@pytest.fixture
def dns_sd():
from pymachinetalk import dns_sd
return dns_sd
@pytest.fixture
def sd():
from pymachinetalk import dns_sd
sd = dns_sd.ServiceDiscovery()
return sd
def test_registeringServicesFromServiceContainerWorks(dns_sd, sd):
service = dns_sd.Service()
disc... |
from .element_set import BaseElementSet
from .feature import Feature
class FeatureSet(BaseElementSet):
'''
A `FeatureSet` is a collection of unique `Feature` instances
and is typically used as a metadata data structure attached to some "real"
data. For instance, given a matrix of gene expressions, the... |
import datetime
from simple_blog.models.meta import Base
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import Unicode
from sqlalchemy import UnicodeText
from sqlalchemy import DateTime
from passlib.apps import custom_app_context as blogger_pwd_context
class User(Base):
__tablename__ = ... |
from datetime import timedelta
KEEP_ALIVE_TIMEOUT = timedelta(minutes=5) # default timeout is 5 minutes
BROADCAST_THREAD_COUNT = 4
MAX_TRACKER_FAILURES = 3
DEFAULT_SERVER_PORT = 42070
DB_PATH = "./tracker.db"
def set_keepalive_timeout(seconds):
global KEEP_ALIVE_TIMEOUT
KEEP_ALIVE_TIMEOUT = timedelta(secon... |
'''
Some examples for LSH
'''
from hashlib import sha1
import numpy as np
from datasketch.minhash import MinHash
from datasketch.weighted_minhash import WeightedMinHashGenerator
from datasketch.lsh import WeightedMinHashLSH, MinHashLSH
data1 = ['minhash', 'is', 'a', 'probabilistic', 'data', 'structure', 'for',
... |
#Напишете програма за конвертиране на парична сума от една валута в друга.
# Трябва да се поддържат следните валути: BGN, USD, EUR, GBP. Използвайте следните фиксирани валутни курсове:
sum = float(input())
type_currency_in = input().upper()
type_currency_out = input().upper()
BGN_ = 1
USD_ = 1.79549
EUR_ = 1.95583
GBP... |
import argparse
import os
import pytest
import parsl
from parsl.app.app import bash_app
import parsl.app.errors as pe
from parsl.tests.configs.local_threads import config
local_config = config
@bash_app
def command_not_found(stderr='std.err', stdout='std.out'):
cmd_line = 'catdogcat'
return cmd_line
@... |
import numpy as np
from PIL import Image
from .utils import overlap_ratio
class SampleGenerator():
def __init__(self, type_, img_size, trans=1, scale=1, aspect=None, valid=False):
self.type = type_
self.img_size = np.array(img_size) # (w, h)
self.trans = trans
self.scale = scale
... |
#!/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.
import os
import numpy as np
import pytest
import habitat
from habitat.utils.test_utils import sample_non_stop_action
... |
from .registry import *
from .factory import *
from .checkpoint_saver import *
from .logger import *
from .helpers import *
__all__ = ['register_model', 'create_model', 'CheckpointSaver']
|
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.13.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x42\x3e\
\x00\
\x00\x01\x00\x01\x00\x40\x40\x00\x00\x01\x00\x20\x00\x28\x42\x00\
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE... |
import re
import threading
import time
import cv2
import numpy
from airtest.core.android.adb import ADB
from airtest.core.android.android import Android as Airtest
from airtest.core.android.constant import CAP_METHOD
from fgoConst import KEYMAP
from fgoSchedule import schedule
from fgoLogging import getLogger
logger... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-interface/ampel/base/AmpelFlexModel.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 17.03.2021
# Last Modified Date: 06.02.2022
# Last Modified By: valery bri... |
# __author__ = 'Yaoshi'
# -*- coding: utf-8 -*-
import ImageGrab # from PIL
import time
import numpy as np
import string
from PIL import Image, ImageChops
from PIL.GifImagePlugin import getheader, getdata
import os
def intToBin(i):
# int to binary
i1 = i % 256
i2 = int(i / 256)
return chr(i1) + chr(i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
from skimage.util import view_as_windows
import warnings
import logging
import tensorflow as tf
from tqdm import tqdm
from tensorflow.python.ops import nn_grad, math_grad
from de... |
import sys
import pandas as pd
import numpy as np
import nltk
from api.constants import *
# Translate a Moroccan letter to an Arabian letter
def morrocan_letter_to_arabian(letter, position, word_length):
alphabet = pd.read_csv(BASE_DIR + DATA_DIR + MOROCCAN_ALPHABET)
try:
if position == 0:
... |
# 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... |
#!/usr/bin/env python
#coding:utf-8
# Created: 15.11.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
__author__ = "mozman <mozman@gmx.at>"
try:
# Python 2.6 and earlier need the unittest2 package
# try: pip install unittest2
# or download source from: http://pypi.python.org/pypi/unittest2... |
#!/usr/bin/env python
""" Generate a GeoJSON of 7 AM precip data """
import cgi
import datetime
import json
import memcache
import psycopg2.extras
import pytz
from pyiem.util import get_dbconn, ssw
def router(group, ts):
"""Figure out which report to generate
Args:
group (str): the switch string indic... |
class Solution(object):
# O(m+n)
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
if not(matrix) or len(matrix) < 1 or len(matrix[0]) < 1:
return False
n,m = len(matrix)-1,0
... |
def new_put_operation(key, val):
return {'operation': 'put', 'key': key, 'val': val}
def new_get_operation(key):
return {'operation': 'get', 'key': key}
def new_append_operation(key, val):
return {'operation': 'append', 'key': key, 'val': val}
def new_slice_operation(key, slice_):
return {'operati... |
#coding: utf8
import os, re, time, sys
from . import to_unicode, md5_for_file
is_win = sys.platform == 'win32'
is_mac = sys.platform == 'darwin'
def is_same_path(p1, p2):
if not p1 or not p2:
return False
p1 = same_slash(p1).strip('/')
p2 = same_slash(p2).strip('/')
return p1==p2
def same_... |
import torch
import torch.nn as nn
from .SingleDeconv import SingleDeconv
class TailedU2Expa(nn.Module):
def __init__(self, in_channels=35, n_classes=1):
super(TailedU2Expa, self).__init__()
padding = 0
stride = 3
self.pool = nn.MaxPool1d(3, stride=3)
self.conv1 ... |
# run tests: pytest -sv --cov-report term-missing --cov=workflow-calcium-imaging -p no:warnings
import os
import pytest
import pandas as pd
import pathlib
import datajoint as dj
import numpy as np
from workflow_calcium_imaging.paths import get_imaging_root_data_dir
# ------------------- SOME CONSTANTS --------------... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import asyncio
import pytest
from shazamio import Shazam
from shazamio.utils import get_file_bytes
@pytest.fixture(scope="session")
def event_loop():
return asyncio.get_event_loop()
@pytest.fixture
async def song_bytes():
yield await get_file_bytes(file="examples/data/dora.ogg")
@pytest.mark.asyncio(scop... |
# -*- coding: utf-8 -*-
#
# python-icat documentation build configuration file.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import icat
# -- Project information -------------------------------------------... |
total = 0
cashflow = int(input('how much to money to get?: '))
#while cashflow != 0:
if cashflow > 50 :
rest = int( cashflow / 50)
print(f'{rest} notes of 50 R$')
total = cashflow - rest * 50
print(total)
if total > 20:
|
def decorate(func):
def decorated():
print("==" * 20)
print("before")
func()
print("after")
return decorated
@decorate
def target():
print("target 함수")
target()
## output
"""
========================================
before
target 함수
after
"""
def target2():
print(... |
from django.conf.urls import url
from ..views.oj import ProblemTagAPI, ProblemAPI, ContestProblemAPI, PickOneAPI
urlpatterns = [
url(r"^problem/tags/?$", ProblemTagAPI.as_view(), name="problem_tag_list_api"),
url(r"^problem/?$", ProblemAPI.as_view(), name="problem_api"),
url(r"^pickone/?$", PickOneAPI.as_... |
# Copyright (c) 2018 Tigera, 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 required by applicable law... |
#ENTRADA DE DASDOS:
A = int(input())
B = int(input())
C = int(input())
caixa = [A, B, C]
caixa.sort()
H = int(input())
L = int(input())
janela = [H, L]
janela.sort()
#PROCESSAMENTO:
if caixa[0] <= janela[0] and caixa[1] <= janela[1]:
print('S')
else:
print('N') |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... |
import pandas as pd
import numpy as np
from ggplot import *
def compute_prob_vector(ps_file, prob_paired=True):
'''
Given a text file derived from the RNAfold output of the form
i j sqrt(prob) ubox
computes a vector (dict) of probabilities for every nucleotide
to be in paired (or ... |
from .model import MAB, SAB, ISAB, PMA, SetTransformerEncoder, SetTransformerDecoder, SetTransformer |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Nosource(BundlePackage):
"""Simple bundle package with one dependency"""
homepage = ... |
from django.db.models import F
from celery.task import task
from celery import chain, group, chord
from celery.utils.log import get_task_logger
from datetime import datetime, timedelta
import shutil
import xarray as xr
import numpy as np
import os
import imageio
from collections import OrderedDict
from data_cube_ui.u... |
import numpy as np
from .base import ObjectiveBase, ResultDict
from typing import Callable, Sequence, Tuple, Union
from .constants import MODE_FUN, MODE_RES, FVAL, GRAD, HESS, RES, SRES
class Objective(ObjectiveBase):
"""
The objective class allows the user explicitly specify functions that
compute the ... |
from django.db.models import Count
from django.utils.translation import gettext_lazy as _
from app.models import DefaultQuerySet, TimestampedModel, models
from app.tasks import send_mail
from users.models import User
class EmailLeadCampaignQuerySet(DefaultQuerySet):
def with_lead_count(self):
return self... |
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from .core import GoogleDriveFileSystem
|
class Pants:
"""The Pants class represents an article of clothing sold in a store
"""
def __init__(self, color, waist_size, length, price):
"""Method for initializing a Pants object
Args:
color (str)
waist_size (int)
length (int)
pri... |
from node import Node
class ListDinamic:
def __init__(self):
self.__node = None
self.__length = 0
def length(self):
return self.__length
def add(self, value):
if self.__node is None:
self.__node = Node(value)
else:
self.__node.add(value)
... |
import requests
frontend_url = "http://localhost:8000/"
proxy_root_url = "http://localhost:8888/"
proxy_instances_url = "{}instances".format(proxy_root_url)
def test_if_proxy_returns_404_on_not_root():
response = requests.get("http://localhost:8888/")
assert response.status_code == 404
def test_if_proxy_instance... |
from hacksport.problem import Compiled, ProtectedFile
class Problem(Compiled):
program_name = "simple_sources_binary"
compiler_sources = ["mybinary.c"]
files = [ProtectedFile("flag.txt")]
|
# Generated by Django 2.0 on 2019-06-26 00:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0006_auto_20190626_0005'),
]
operations = [
migrations.AlterField(
model_name='club',
name='icon',
... |
#! usr/bin/env python
"""
Base module for PODNODE NIROM
"""
import numpy as np
import pickle
import time
import pynirom
from pynirom.node import node as node
import tensorflow as tf
if tf.__version__ == '1.15.0':
tf.compat.v1.enable_eager_execution()
elif tf.__version__.split('.')[0] == 2: # in ['2.2.0','2.3.0'... |
#!/usr/bin/env python3
import argparse
import sys
def main(inf, outf, word_map):
iw_backoff_outgoing = []
iw_backoff_incoming = []
iw_ending_nodes = set()
max_node = 0
backoff_node = None
for line in inf:
parts = line.split()
if len(parts) < 3:
print("\t".j... |
from opera.parser.yaml.node import Node
from .operation_implementation_definition import (
OperationImplementationDefinition,
)
from .property_definition import PropertyDefinition
from ..entity import Entity
from ..list import List
from ..map import Map
from ..string import String
class OperationDefinitionForType... |
#!/usr/bin/env python
# Copyright (c) 2012 Johns Hopkins University.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written
# agreement is hereby granted, provided that the above copyright
# notice, the (update... |
import datetime
import itertools
import json
import operator
import os
from dateutil import tz
from functools import reduce, wraps
import arrow
import click
from click_didyoumean import DYMGroup
import watson as _watson
from .autocompletion import (
get_frames,
get_project_or_task_completion,
get_projects... |
"""A quick sample program to try loading games and listing missions"""
import logging
from RainbowFileReaders.RSEGameLoader import RSEGameLoader
from RainbowFileReaders.R6MissionReader import R6MissionFile
from FileUtilities.Settings import load_settings
log = logging.getLogger(__name__)
logging.basicConfig(level=l... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from dhtmlparser import HTMLElement
# Functions & objects =========================================================
def test_costructuro_parameters():
... |
#
# 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 us... |
"""empty message
Revision ID: 7829e2406e
Revises: None
Create Date: 2015-07-12 19:11:45.077763
"""
# revision identifiers, used by Alembic.
revision = '7829e2406e'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
... |
#!/usr/bin/env python
# Copyright (c) 2014-2017 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script every time you change one of the png files. Using pngcrush, it will optimize the pn... |
# encoding: utf-8
"""
Objects shared by docx modules.
"""
from __future__ import absolute_import, print_function, unicode_literals
class Length(int):
"""
Base class for length constructor classes Inches, Cm, Mm, Px, and Emu.
Behaves as an int count of English Metric Units, 914,400 to the inch,
36,00... |
#!/usr/bin/python3
import random
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __str__(self):
return "(" + str(self.x) + "," + str(self.y) + ")"
def __repr__(self):
return "(" + str(self.x) + ", " + str(self.y) + ")"
class Bound:
def __init__(self, x, y, w, h):
self.x = x
self.y = ... |
from argparse import ArgumentParser
import numpy as np
import pandas as pd
from pickle import dump
from tqdm import tqdm
AA = ('A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y')
AA_ENCODING = dict((a, 2**i) for i,a in enumerate(AA))
def generate_peptide_tensor(data, aaprops, output, maxl... |
#!/usr/bin/evn python3
"""
Record Section plotting tool for seismic waveforms (observed and synthetic)
This is a refactor of Pysep's Python utility `plotw_rs`, a record section
plotting script. The intent of this script is to plot multiple time series'
based on source-receiver characteristics (i.e., src-rcv distance, ... |
"""TensorFlow workspace initialization. Consult the WORKSPACE on how to use it."""
# Import third party config rules.
load("//tensorflow:version_check.bzl", "check_bazel_version_at_least")
load("//third_party/gpus:cuda_configure.bzl", "cuda_configure")
load("//third_party/gpus:rocm_configure.bzl", "rocm_configure")
lo... |
# script to update obspar and asp_l1 tables with "isdefault" column values
# assumes that the archfiles.db3 files have already been copied to archfiles_redo.db3
# files in the same directories
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import Ska.DBI
import os
import re
for t in ['obspar', 'asp1'... |
from setuptools import setup
setup(
name='pre_commit_placeholder_package',
version='0.0.0',
install_requires=['{name}=={version}'],
)
|
#!/usr/bin/env python
'''
The script uses a simple procedure to combine semantic segmentation and instance
segmentation predictions. The procedure is described in section 7 of the
panoptic segmentation paper https://arxiv.org/pdf/1801.00868.pdf.
On top of the procedure described in the paper. This script remove from
p... |
""" Layer-wise adaptive rate scaling for SGD in PyTorch! """
import torch
from torch.optim.optimizer import Optimizer, required
class LARS(Optimizer):
r"""Implements layer-wise adaptive rate scaling for SGD.
Args:
params (iterable): iterable of parameters to optimize or dicts defining
par... |
"""Call annotate_ast on a source file."""
import argparse
import sys
from pytype.ast import debug
from pytype.tools import arg_parser
from pytype.tools.annotate_ast import annotate_ast
from typed_ast import ast3
def main():
parser = argparse.ArgumentParser(usage='%(prog)s [options] input')
args, options = arg_p... |
import rospy
import os
import ipfshttpclient
#from urllib3.util.timeout import Timeout
from urllib.parse import urlparse
from tempfile import gettempdir
IPFS_PROVIDER = rospy.get_param("/liability/listener/ipfs_http_provider", "/ip4/127.0.0.1/tcp/5001/http")
def build_client():
rospy.loginfo("Build IPFS client: ... |
#!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the executables produced by gitian only contain
certain symbols and are only linked aga... |
# Mirao 52e ERROR codes:
# Error codes (status)
errors = {}
errors[0] = 'MRO_OK, No error'
errors[1] = 'MRO_UNKNOWN_ERROR'
errors[2] = 'MRO_DEVICE_NOT_OPENED_ERROR, mirao 52-e is not opened.'
errors[3] = 'MRO_DEFECTIVE_DEVICE_ERROR, mirao 52-e has been identified as defective.'
errors[4] = 'MRO_DEVICE_ALREADY_OPENED... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def fill(dataset):
"""
Fill all nan value in the sensor data for given core.data.dataset.Dataset
:parameter dataset: Dataset object that wants to fill in missing values
:type dataset: core.data.dataset.Dataset
:return: None
"""
from ..data i... |
# Copyright (c) 2016. Mount Sinai School of Medicine
#
# 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... |
# Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... |
# -*- coding: utf-8 -*-
# Scrapy settings for ArticleSpider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/... |
# 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
from... |
# -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
# the following is a hack to get the basec... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import time
from ..base.upgrade_worker_base import UpgradeWorkerBase
XLDR_TESEO5_BOOTLOADER_CUT2 = \
[
0x01, 0xf0, 0x3c, 0xbc, 0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# C... |
parseString = input();
problemArr = parseString.split(";")
ranges = []
for elem in problemArr:
tempArr = elem.split("-")
parsedArr = []
for i in range(len(tempArr)):
parsedArr.append(int(tempArr[i]))
ranges.append(parsedArr)
total = 0
for elem in ranges:
if len(elem) == 1:
total += 1
else:
total += ele... |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.mongo import MongoDb
from . import common
METRIC_VAL_CHECKS = {
'mongodb.asserts.msgps': lambda x: x >= 0,
'mongodb.fsynclocked': lambda x: x >= 0,
'mongodb... |
# 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 required by applicable law or a... |
"""Tests for typing.py."""
from pytype import file_utils
from pytype.tests import test_base
class TypingTest(test_base.TargetPython3BasicTest):
"""Tests for typing.py."""
_TEMPLATE = """
import collections
import typing
def f(s: %(annotation)s):%(disables)s
return s
f(%(arg)s)
"""
def... |
from .stream_item_notification import StreamItemNotification
from .stream_trigger_notification import StreamTriggerNotification
from .call_result_notification import CallResultNotification
from .call_trigger_notification import CallTriggerNotification
from .notification_key import NotificationKeyString, NotificationKey... |
# GENERATED VERSION FILE
# TIME: Fri Mar 4 10:51:49 2022
__version__ = '1.0.rc0+c5a5c07'
short_version = '1.0.rc0'
|
from django.db import models
class User(models.Model):
id = models.AutoField(primary_key=True)
username = models.CharField(max_length=32)
password = models.CharField(max_length=32)
email = models.EmailField()
createTime = models.DateField(auto_now_add=True)
modifyTime = models.DateField(auto_n... |
import re
import textwrap
from pathlib import Path
import pytest
import schema
import tomlkit
from tbump.config import (
Config,
Field,
File,
InvalidConfig,
TbumpTomlConfig,
from_parsed_config,
get_config_file,
validate_basic_schema,
validate_config,
)
from tbump.hooks import HOOKS... |
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import List, Optional, cast
import numpy as np
from ..pose import PoseBase
from .metrics import Metric
PENALTY_WEIGHT = 1e6
@dataclass
class TrackingSpec:
"""
A domain specific language for threshold distance-based style trac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.