text stringlengths 1 927k |
|---|
from .restconf import RestConf |
"""
Tests for the Openstack Cloud Provider
"""
import logging
import os
import shutil
from time import sleep
import salt.utils.verify
from salt.config import cloud_config, cloud_providers_config
from salt.ext.six.moves import range
from salt.utils.yaml import safe_load
from tests.support.case import ShellCase
from t... |
# Dataset utils and dataloaders
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import math
import numpy as np
import ... |
import torch
import matplotlib.image as img
import cv2
import dlib
from imutils.face_utils import *
import numpy as np
# image = img.imread("extra//test.jpg")
# image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR) # opencvImage
dlib_path = 'extra//shape_predictor_68_face_landmarks.dat'
def get_face(img):
g... |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import argparse
import inspect
import json
import logging
import os
import pkgutil
import warnings
from collections import namedtuple, defaultdict
from importlib ... |
class StructValue:
pass |
# -*- coding: utf-8 -*-
"""
The ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format <pyfunc-filesystem-format>`
for Python models and provides utilities for saving to and loading from this format. The format is
self contained in the sense that it includes all necessary information for anyone to load it ... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x18\x... |
###########################
#
# #153 Investigating Gaussian Integers - Project Euler
# https://projecteuler.net/problem=153
#
# Code by Kevin Marciniak
#
########################### |
import sys
shifts = int(sys.stdin[0])
file_ = sys.stdin[1]
overwritten = sys.stdin[2]
checker = []
for icmfcr in shifts:
for i in file_:
if i == "1":
checker.append("0")
elif i == "0":
checker.append("1")
if str(checker) == overwritten:
print "Deletion succeeded"
else:... |
import numpy as np
import matplotlib.pyplot as plt
# plt.style.use('../notebooks/test.mplstyle')
import seaborn as sns
from logs import logDecorator as lD
import jsonref, pprint
config = jsonref.load(open('../config/config.json'))
logBase = config['logging']['logBase'] + '.modules.test_plot.test_plot'
@lD.log(logB... |
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def mergeTwoLists(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
dummy... |
"""
Functions for creating and restoring url-safe signed pickled objects.
The format used looks like this:
>>> signed.dumps("hello")
'UydoZWxsbycKcDAKLg.AfZVu7tE6T1K1AecbLiLOGSqZ-A'
There are two components here, separatad by a '.'. The first component is a
URLsafe base64 encoded pickle of the object passed to dump... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
core_req = ["requests", "numpy", "pandas", "appdirs>=1.4.4", "tqdm>=4.27.0", "plotly>=4.0.0"]
extras_req = {
"dev" : ["twine", "black", "pytest", "pytest-cov"],
"test" : ["pytest", "pytest-cov"],
"docs" : [... |
# A script to help doing the deliveries.
# Now using the Casava directory structure
# The user is asked to provide a project ID, a run name, and an UPPMAX project
import sys
import os
import glob
import re
import grp
from datetime import datetime
import argparse
import stat
from subprocess import check_call, CalledPro... |
from simplesam import Reader, Writer
import inspect
import sys, os, fileinput, string
in_file = open(sys.argv[1], 'r')
in_sam = Reader(in_file)
out_file = open('full_ecoli_mapped_q10_truth.txt', 'w')
# out_sam = Writer(out_file)
x = next(in_sam)
try:
while(x.qname != ''):
#if(x.reverse):
# out_file.write("+" + ... |
from kivymd.app import MDApp
from kivy.uix.widget import Widget
from kivy.uix.actionbar import ActionBar
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivymd.theming import ThemableBehavior
from kivymd.uix.list import OneLineListItem, MDList, TwoLineListItem, ThreeLineListItem... |
from rest_framework import viewsets
from . import serializers, models, permissions
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settin... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
"""TransE."""
from typing import Any, ClassVar, Mapping, Optional
import torch
import torch.autograd
from torch.nn import functional
from ..base import EntityRelationEmbeddingModel
from ...constants import DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE
from ...losses import Loss
from ...nn.emb im... |
# Python code to unscramble a jumbled word using the Enchant dictionary(US) and itertools in Python.
from itertools import permutations
import enchant
word_list = enchant.Dict("en_US")
# Taking the input word and converting it into lowercase words.
word = input("Enter the letters: ")
word = word.lower()
word_length ... |
import argparse
import crypt
import json
import os
import pwd
import random
import re
import string
import subprocess
import sys
import traceback
from itertools import product
import yaml
class ACL:
@staticmethod
def get_file_acl(path):
if not os.path.exists(path):
raise IOError("The dir... |
'''
A dummy package to allow wildcard import from brian2 without also importing
the pylab (numpy + matplotlib) namespace.
Usage: ``from brian2.only import *``
'''
# To minimize the problems with imports, import the packages in a sensible
# order
# The units and utils package does not depend on any other Brian packag... |
import pytest
class TestKeytoolParse:
@staticmethod
@pytest.mark.parametrize("printcert, correct_certs",
[
('Owner: CN=ca, OU=ca, O=ca, L=ca, ST=ca, C=CA\nIssuer: CN=root, OU=root, O=root, L=root, ST=root, C=CA\nSerial number: 5f822698\nValid from: Wed Apr 14 13:40:13 EDT 2021 until: Tue ... |
# Copyright 2017 AT&T Corporation
# 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... |
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# Permission is here... |
"""
Django settings for classic_tetris_project_django project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/setti... |
"""This module contains base classes and types for creating new Modules and using module trees.
"""
import abc
from collections import deque
import numpy as np
class ModuleBase(object):
"""The base interface for all modules. Modules must inherit from this interface.
"""
__metaclass__ = abc.ABCMeta
def... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... |
import warnings
import torch.nn as nn
from mmcv.utils import Registry, build_from_cfg
from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS
try:
from mmdet.models.builder import DETECTORS, build_detector
except (ImportError, ModuleNotFoundError):
warnings.warn('Please install mmdet t... |
"""
Django settings for MyResumes project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
... |
from common.dummy_core_magma import DummyCore
from bit_vector import BitVector
from tile.tile_magma import Tile
from common.testers import BasicTester
import tempfile
from fault.random import random_bv
def check_all_config(tester,
tile_circ,
tile,
data_wr... |
#!/usr/bin/env python
#
# connectv2x 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
# autogenerated file.
#
# ... |
import pytest
from vcx.error import VcxError, ErrorCode
from vcx.api.wallet import *
import json
TYPE = "record type"
EMPTY_TYPE = ""
ID = "123"
EMPTY_ID = ""
VALUE = "record value"
VALUE_NEW = "RecordValueNew"
EMPTY_VALUE = ""
TAGS = "{\"tagName1\":\"str1\",\"tagName2\":\"5\",\"tagName3\":\"12\"}"
OPTIONS = json.dump... |
"""
Very simple user management for the MicroPsi service
The user manager takes care of users, sessions and user roles.
Users without a password set can login with an arbitrary password, so make sure that users do not set empty passwords
if this concerns you.
When new users are created, they are given a role and stor... |
import os
import pandas as pd
import geopandas as gpd
## Config
# Number of rows to read
nrows = 1000
#nrows = 1000000
#nrows = None
# Output file path
day_num = 1
input_csv_filepath = f'../../data/footfall/footfall_20210217/day{day_num}Bcntrakingotherdays.csv'
# Clip mask file path
#clip_mask_filepath = '../../da... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Address(Model):
"""NOTE: This class is auto generated by the swagger cod... |
# Generated by Django 2.0.1 on 2018-01-24 21:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='brief',
... |
import os
import sys
import subprocess
import shutil
from pathlib import Path, PurePosixPath
from click import ClickException
from jinja2 import Environment, PackageLoader, StrictUndefined
from ploomber.io import TerminalWriter
def to_pascal_case(name):
return ''.join([w.capitalize() for w in name.split('_')])
... |
#!/usr/bin/env python2.4
# Example 3
i = 1
def h():
print i
i = 2
print i
h()
print i |
import json
import os
import numpy as np
import torch
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID
from zerogercrnn.experiments.ast_level.utils import read_non_terminals
from zerogercrnn.lib.constants import EMPTY_TOKEN_ID, UNKNOWN_TOKEN_ID, EOF_TOKEN
from zerogercrnn.lib.metrics import Metr... |
class Solution:
def generate(self, numRows: int) -> List[List[int]]:
result = [[1]]
for i in range(1, numRows):
temp1 = result[-1] + [0]
temp2 = [0] + result[-1]
result.append([temp1[i] + temp2[i] for i in range(len(temp1))])
return result[:numRows]
... |
# -*- coding: utf-8 -*-
import time
import httplib
import functools
from flask import request
from framework.auth import cas
from framework.auth import signing
from framework.flask import redirect
from framework.exceptions import HTTPError
from .core import Auth
from .core import User
def collect_auth(func):
... |
import keras
from keras.layers import Activation
from keras.layers import Conv2D, BatchNormalization, Dense, Flatten, Reshape
def get_model():
model = keras.models.Sequential()
model.add(Conv2D(64, kernel_size=(3,3), activation='relu', padding='same', input_shape=(9,9,1)))
model.add(BatchNormalization())... |
from itertools import chain
import math
import logging
import collections
from collections import OrderedDict
import tqdm
import random
import time
from einops import rearrange, repeat
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import autocast
from tl2.pr... |
import numpy as np
import math
import pyrobot.utils.util as prutil
import rospy
import habitat_sim.agent as habAgent
import habitat_sim.utils as habUtils
from habitat_sim.agent.controls import ActuationSpec
import habitat_sim.errors
import quaternion
from tf.transformations import euler_from_quaternion, euler_from_mat... |
# -*- coding: utf-8 -*-
__version__ = '0.4.6'
import argparse
from . import fritzconnection
SERVICE = 'Hosts'
# version-access:
def get_version():
return __version__
class FritzHosts(object):
def __init__(self,
fc=None,
address=fritzconnection.FRITZ_IP_ADDRESS,
... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.rust
~~~~~~~~~~~~~~~~~~~~
Lexers for the Rust language.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, words, default
from pygments... |
def jwt_response_payload_handler(token, user=None, request=None):
"""
重写获取jwt载荷数据方法
"""
return {
'token': token,
'id': user.id,
'username': user.username
} |
import importlib
import inspect
import json
import os
import sqlite3
import tempfile
import typing
from shutil import copyfile
from typing import Any, Generator, List, Union
from pydantic import BaseModel, root_validator
from pydantic.fields import ModelField
from sqlite_utils import Database as _Database
from typing_... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
"""
Import Tower Hamlets
"""
from time import sleep
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseCsvStationsCsvAddressesImporter
from data_finder.helpers import geocode, geocode_point_only, PostcodeError
from addressbase.models import Address
class Command(BaseCsvSta... |
#!/usr/bin/env python
#python 3 compatibility
from __future__ import print_function
#stdlib imports
from xml.dom import minidom
from datetime import datetime
from collections import OrderedDict
import re
import sys
import tempfile
import time
import shutil
if sys.version_info.major == 2:
import StringIO
else:
... |
import pytest
from drydock_provisioner import objects
class TestPostgres(object):
def test_result_message_insert(self, populateddb, drydock_state):
"""Test that a result message for a task can be added."""
msg1 = objects.TaskStatusMessage('Error 1', True, 'node', 'node1')
msg2 = objects.T... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2020 Fei Gao <feig@princeton.edu>
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2020 David Shah <dave@ds0.me>
# SPDX-License-Identifier: BSD-2-Clause
import argparse, os
from migen import *
from litex... |
"""Tools to fetch and extract Facebook Insights metrics.
>>> graph_id = '1234567890'
>>> metrics = ['page_impressions', 'page_engaged_users']
>>> page_metrics = fetch_metrics(graph_id, metrics)
>>> page_impressions = page_metrics['page_impressions']
>>> page_impressions.values
{'day': [
{'end_time': '2016-11-15T08... |
"""Unit tests dla socket timeout feature."""
zaimportuj functools
zaimportuj unittest
z test zaimportuj support
# This requires the 'network' resource jako given on the regrtest command line.
skip_expected = nie support.is_resource_enabled('network')
zaimportuj time
zaimportuj errno
zaimportuj socket
@functools.lr... |
import tensorflow.compat.v1 as tf
from t3f.tensor_train import TensorTrain
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import shapes
from t3f import decompositions
def project_sum(what, where, weights=None):
"""Project sum of `what` TTs on the tangent space of `where` TT.
project_sum(what, x) =... |
import enum
import json
import os
import pathlib
import typing
import fsspec
import pandas as pd
import pydantic
import tlz
from ._search import search, search_apply_require_all_on
class AggregationType(str, enum.Enum):
join_new = 'join_new'
join_existing = 'join_existing'
union = 'union'
class Con... |
from merkletree import MerkleTree
from .hashing import TigerHash
class TigerTree(MerkleTree):
segment = 1024;
hashsize = TigerHash.size;
@classmethod
def _hash(klass, *chunks):
return TigerHash.digest(*chunks); |
import itertools
import os
import multiprocessing as mp
import threading
import queue
from ..helpers import ResourceMatcher
from .. import PackageWrapper, ResourceWrapper
def init_mp(num_processors, row_func, q_in, q_internal):
q_out = mp.Queue()
processes = [mp.Process(target=work, args=(q_in, q_out, row_fu... |
# qubit number=2
# total number=18
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... |
from django.urls import path
from . import views
urlpatterns = [
path('report1/', views.MonthlyProductSales.as_view(), name='report1'),
path('product_crosstab_client/', views.ProductClientSalesMatrix.as_view(), name='product_crosstab_client'),
] |
# import urllib
import json
import time
import math
import re
from . import simple_downloader
class MapException(Exception):
def __init__(self, map_obj, *args, **kwargs):
super(MapException, self).__init__(*args, **kwargs)
self.map = map_obj
class DynMap(object):
def __init__(self, url):
... |
"""
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... |
from django.db import models
# Create your models here.
class TimeStampMixin(models.Model):
"""
An abstract base class model that provides self-updating
``created_at`` and ``updated_at`` fields.
"""
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_no... |
# 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.
from functools import lru_cache
import os
import shutil
import struct
import numpy as np
import torch
from . import FairseqDataset
def __b... |
"""
Practice File 4
Created by David Story
Description: Some nice examples of things you can do with functions from the following libraries:
- sys
- os
- time
- datetime
"""
import sys
import os
import time
import datetime
# get the time
print(time.time())
# get the current date
print(datetime.date.... |
from NewRelicApiParser.Base import BaseNewRelic
class AlertsViolations(BaseNewRelic):
def __init__(self, API_KEY):
super().__init__(API_KEY)
def get_list(self, options: dict = {}) -> dict:
"""
fetch the alert violations for new relic
"""
url = self.BASE_URI + '/alerts_... |
# adapted from Keith Ito's tacotron implementation
# https://github.com/keithito/tacotron/blob/master/util/audio.py
import librosa
import numpy as np
class Audio():
def __init__(self, hp):
self.hp = hp
self.mel_basis = librosa.filters.mel(sr=hp.audio.sample_rate,
... |
# Copyright 2016-2017 Dirk Thomas
# Copyright 2017 Open Source Robotics Foundation, 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
#
#... |
# Generated by Django 2.2.6 on 2019-10-22 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Sposition',
fields=[
('id'... |
from PyQt4 import QtCore
from multiprocessing import Pool
import dill
def run_dill_encoded(what):
fun, args = dill.loads(what)
print "load", fun, args
return fun(*args)
def apply_async(pool, fun, args):
print "...", fun, args
print "dumps", dill.dumps((fun, args))
return pool.map_async(run_dil... |
# -*- coding: utf-8 -*-
#
# K2hash Python Driver
#
# Copyright (c) 2022 Yahoo Japan Corporation
#
# 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 limit... |
# Copyright 2019 Iguazio
#
# 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, softwa... |
from iptcinfo import IPTCInfo
import sys
fn = (len(sys.argv) > 1 and [sys.argv[1]] or ['test.jpg'])[0]
fn2 = (len(sys.argv) > 2 and [sys.argv[2]] or ['test_out.jpg'])[0]
# Create new info object
info = IPTCInfo(fn)
# Check if file had IPTC data
if len(info.data) < 4: raise Exception(info.error)
# Print list of keyw... |
import asyncio
from asyncio.futures import Future
from typing import List
from PIL import Image
from io import BytesIO
from importlib import resources
from datetime import datetime
from collections import defaultdict
from .base_rust_api import BaseRustSocket
from .structures import RustTime, RustInfo, RustMap, RustMar... |
# Copyright (c) 2021 - present / Neuralmagic, 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 b... |
# Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import glob
import multiprocessing as mp
import numpy as np
import os
import tempfile
import time
import warnings
import cv2
import tqdm
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.... |
"""
This module contains utilities which are shared between other modules.
"""
from typing import Any, Callable
class cached_property: # pylint: disable=invalid-name
"""Descriptor that transforms a class method into a property whose value is
computed once and then cached for subsequent accesses.
Args:
... |
# !
# * Copyright (c) FLAML authors. All rights reserved.
# * Licensed under the MIT License. See LICENSE file in the
# * project root for license information.
from contextlib import contextmanager
from functools import partial
import signal
import os
from typing import Callable, List
import numpy as np
import time
... |
#!/usr/bin/python
#
# FishPi - An autonomous drop in the ocean
#
# Simple viewer for onboard camera
#
import argparse
import io
import sys
import socket
import struct
# from StringIO import StringIO
import wx
class CameraPanel(wx.Panel):
def __init__(self, parent, server, port=8001, enabled=True):
wx.P... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
from tests.integration.integration_test_case import IntegrationTestCase
class TestQbsSubmissionData(IntegrationTestCase):
def test_submission_data_2_0001(self):
self.submission_data('2', '0001')
def submission_data(self, eq_id, form_type_id):
self.launchSurvey(eq_id, form_type_id, roles=['dum... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
# Copyright 2018-2021 The glTF-Blender-IO 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 ... |
n1,n2 = list(map(int,input().split()))
cont = 1
for i in range(1,(int((n2/n1))+1)):
r = ""
for y in range(n1):
r += str(cont) + " "
cont += 1
print(r[:-1]) |
from . import Agent
from . import Coordinator
from . import DataManager
from . import DataPoint
from . import Utils |
## Module statistics.py
##
## Copyright (c) 2014 Antonio Valente <y3sman@gmail.com>
##
## 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
... |
import asyncio
import aiohttp
import logging
from lavaplayer.exceptions import NodeError
from .objects import (
Info,
PlayerUpdateEvent,
TrackStartEvent,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
WebSocketClosedEvent,
)
from .emitter import Emitter
import typing as t
if t.TYPE_CH... |
# SPDX-License-Identifier: Apache-2.0
from ..common._apply_operation import apply_identity
from ..common._registration import register_converter
from ..common._topology import Scope, Operator
from ..common._container import ModelComponentContainer
def convert_sklearn_identity(scope: Scope, operator: Operator,
... |
import spoke
try:
spoke.call("junk", None, timeout=2)
except TimeoutError:
print("Got expected TimeoutError")
else:
raise TestFailure("Didn't get a TimeoutError") |
# coding=utf-8
from __future__ import unicode_literals
from itertools import cycle
import unittest
import mock
import pytest
import six
from email_validator import validate_email
from faker import Faker
from faker.providers.person.ja_JP import Provider as JaProvider
from faker.utils import text
class TestIntern... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-17 19:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
from setuptools import setup
from sys import version_info
setup(name='avscript',
version='0.3.8',
description='Audio/Visual Script Parser',
url='https://github.com/kenlowrie/avscript',
author='Ken Lowrie',
author_email='ken@kenlowrie.com',
license='Apache',
packages=['avscript... |
"""A mixing that extends a HasDriver class with Galaxy-specific utilities.
Implementer must provide a self.build_url method to target Galaxy.
"""
from __future__ import print_function
import contextlib
import random
import string
import time
from functools import partial, wraps
import requests
import yaml
from .da... |
"""Python part of the warnings subsystem."""
import sys
__all__ = ["warn", "warn_explicit", "showwarning",
"formatwarning", "filterwarnings", "simplefilter",
"resetwarnings", "catch_warnings"]
def showwarning(message, category, filename, lineno, file=None, line=None):
"""Hook to write a wa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.