text stringlengths 2 999k |
|---|
import pytest
from pyle38.commands.intersects import Intersects
key = "fleet"
id = "truck"
feature = {
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [13.37, 52.25]},
"properties": {"id": id},
}
polygon = {
"type": "Polygon",
"coordinates": [
[
[13.361263275146... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-20 02:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pets', '0005_lostpet_description'),
]
operations = [
migrations.AlterField(... |
"""
Message variables in English.
"""
import discord
# Variables
teste = "Test - Locales - EN"
|
"""
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping
from yolo3.model import preprocess_true_boxes, yolo_body, tiny_yolo_body, yolo_... |
from digsandpaper.sandpaper_utils import load_json_file
__name__ = "TypeIndexMapping"
name = __name__
class TypeIndexMapping(object):
name = "TypeIndexMapping"
component_type = __name__
def __init__(self, config):
self.config = config
self._configure()
def _configure(self):
... |
from random import Random
from eth2spec.test.context import spec_state_test, with_altair_and_later
from eth2spec.test.helpers.inactivity_scores import randomize_inactivity_scores, zero_inactivity_scores
from eth2spec.test.helpers.state import (
next_epoch_via_block,
set_full_participation,
set_empty_partic... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('opportunities', '0026_auto_20160411_1821'),
]
operations = [
migrations.AlterField(
model_name='opportunity',
... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2019 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... |
from torch.utils.tensorboard import SummaryWriter
from collections import defaultdict
import json
import os
import csv
import shutil
import torch
import numpy as np
from termcolor import colored
COMMON_TRAIN_FORMAT = [
('episode', 'E', 'int'),
('step', 'S', 'int'),
('episode_reward', 'R', 'float'),
('d... |
# Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'map_service.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
#!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Control Loss Vehicle scenario:
The scenario realizes that the vehicle looses control due to
bad road conditions, etc. and checks to see if the vehicle
regains control and c... |
import tensorflow as tf
import numpy as np
import pickle
import random
from tqdm import tqdm
import os
from open3d.ml.tf.ops import voxelize
from .base_model_objdet import BaseModel
from ...utils import MODEL
from ..utils.objdet_helper import Anchor3DRangeGenerator, BBoxCoder, multiclass_nms, limit_period, get_padd... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import rospy
import random
from geometry_msgs.msg import Twist
import tf
import numpy as np
import actionlib
import requests
import math
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
import actionlib_msgs
from nav_msgs.msg import Odometry
from obstacle_... |
N, K, X = map(int, input().split())
a = list(range(1, N + 1))
for _ in range(K):
A, B = input().split()
if A == '?':
b = a[:]
continue
A, B = int(A) - 1, int(B) - 1
a[A], a[B] = a[B], a[A]
C = list(map(int, input().split()))
c = [C[i] for i in range(N) if C[i] != a[i]]
print(*sorted([b... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
import sys
import dateutil.parser
import requests
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
MIME_TEXT_PLAIN = 'text/plain'
METHOD_GET = 'GET'
METHOD_POST = 'POST'
METH... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... |
# Copyright (c) 2016, Vladimir Feinberg
# Licensed under the BSD 3-clause license (see LICENSE)
import numpy as np
from .matrix import Matrix
from ..util.docs import inherit_doc
# TODO(test)
@inherit_doc
class Identity(Matrix):
def __init__(self, n):
super().__init__(n, n)
def matvec(self, x):
... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.translation import activate # so we can get translation page addresses right
from datetime import date
from django.utils import f... |
"""Tests for FOOOF core.info."""
from fooof.core.info import *
###################################################################################################
###################################################################################################
def test_get_obj_desc(tfm):
desc = get_obj_desc(... |
class PluginsContext(object):
def __init__(self, app, session, plugins_data):
self.app = app
self.session = session
self.plugins_data = plugins_data
def getvar(self, var):
try:
var = self.plugins_data._get(var)
return var
except KeyError:
... |
import pytest
from pytest_cases import parametrize_with_cases, case, parametrize
class FooCases:
@staticmethod
def case_static():
return 1
@classmethod
def case_class(cls):
return 1
@staticmethod
@case(id="foo")
def case_static_custom_id():
return 1
@staticm... |
from dataclasses import dataclass, field
from typing import List
import tensorflow as tf
from graph_networks.utilities import *
import logging
import os
ATOM_FEATURE_DIM = DGIN4_ATOM_FEATURE_DIM
EDGE_FEATURE_DIM = DGIN4_EDGE_FEATURE_DIM
@dataclass
class BasicModelConfig:
"""
Config for model1/2/3 run file.
... |
# pylint: disable=too-many-lines
# 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) AutoRe... |
import os
import tarfile
import pytest
from atomic_reactor.constants import (EXPORTED_COMPRESSED_IMAGE_NAME_TEMPLATE,
IMAGE_TYPE_DOCKER_ARCHIVE)
from atomic_reactor.core import DockerTasker
from atomic_reactor.inner import DockerBuildWorkflow
from atomic_reactor.plugin import Pos... |
from datetime import date, time, timedelta, timezone
from decimal import Decimal
import operator
import os
from dateutil.tz import tzlocal, tzutc
import hypothesis
from hypothesis import strategies as st
import numpy as np
import pytest
from pytz import FixedOffset, utc
import pandas.util._test_decorators as td
impo... |
"""
Auswärtiges Amt OpenData Schnittstelle
Dies ist die Beschreibung für die Schnittstelle zum Zugriff auf die Daten des [Auswärtigen Amtes](https://www.auswaertiges-amt.de/de/) im Rahmen der [OpenData](https://www.auswaertiges-amt.de/de/open-data-schnittstelle/736118) Initiative. ## Deaktivierung Die Schnitts... |
# Copyright (c) 2021 Emanuele Bellocchia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... |
import base64
import calendar
import hashlib
import hmac
import time
from datetime import datetime
import requests
from .exceptions import (
KucoinAPIException, KucoinRequestException, MarketOrderException, LimitOrderException
)
from .utils import compact_json_dict, flat_uuid
class Client(object):
REST_API... |
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
from vgg import vgg
import shutil
# Training settings
parser = argparse.ArgumentParser(description='PyTorch Slimming... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
# -*- coding: utf-8 -*-
from datetime import datetime
from operator import itemgetter
from itertools import groupby
from application.services.inventory import get_specs_info
from application.models import EntrySpec
def cart_json(cart):
info = get_specs_info([e.sku for e in cart.entries])
specs = []
for e... |
import fileinput
f = fileinput.input()
cases = int(next(f))
next(f)
def solve(n, jobs):
result = [i + 1 for i in range(n)]
result.sort(key=lambda i: (jobs[i - 1][0]/jobs[i - 1][1], i))
print(*result)
def solve_case(f):
n = int(next(f))
jobs = [tuple(map(int, next(f).split())) for i in range(n)... |
from torch import nn
from torch.nn import functional as F
# adapted from Fairseq
class CrossEntropyWithLabelSmoothing(nn.Module):
def __init__(self, ls_eps=0.1, ignore_idx=None, reduce=True, reduction='mean', *args, **kwargs):
super(CrossEntropyWithLabelSmoothing, self).__init__()
self.ls_eps = ls... |
from flask import Blueprint
passport_print = Blueprint('passport_print', __name__)
from . import passport |
# https://www.acmicpc.net/problem/17836
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
n, m, time = map(int, input().split())
map = [list(map(int, input().split())) for _ in range(n)]
visited = [[0] * m for _ in range(n)]
get_sword = 1000000
def BFS():
global get_sword
q = []
visited[0][0] = 1
q.append((0, 0)... |
import regex as re
def remove_article(text):
return re.sub('^l[ea] ', '', text)
def remove_feminine_infl(text):
text = re.sub('(?<=\w+)\(e\)(?!\w)', '', text)
text = re.sub('(?<=\w+)\(ne\)(?!\w)', '', text)
return text
|
# Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
"""
The Affect class.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import becca.tools as tools
class Affect(object):
"""
Track reward over time.
Affect, or mood, is the level of arousal of the brain.
It is influenced by the recent history of reward and in turn
influences the... |
import sys
import shlex
import gc
import signal
import random
from subprocess import PIPE
from os.path import isfile
from argparse import ArgumentParser
from math import log
from collections import defaultdict
import shared.param as param
from shared.utils import subprocess_popen, IUPAC_base_to_ACGT_base_dict as BASE2... |
#!/usr/bin/env python
# Copyright 2021, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
""""Test utility to simulate a repository
RepositorySimulator provides methods to modify repository metadata so that it's
easy to "publish" new repository versions with modified metadata,... |
#!/usr/bin/env python
"""SoccerSerialParserCOM.py: Collects data from a Daktronics All Sport 5000 connected via port J2 to a
Daktronics All Sport CG connected to a computer on COM port (defined on line 47), then parses data to
a .csv readable by broadcasting programs. This file has only been tested using game co... |
from tables.indexesextension import keysort
import numpy
from time import perf_counter as clock
N = 1000 * 1000
rnd = numpy.random.randint(N, size=N)
for dtype1 in ('S6', 'b1',
'i1', 'i2', 'i4', 'i8',
'u1', 'u2', 'u4', 'u8', 'f4', 'f8'):
for dtype2 in ('u4', 'i8'):
print("dty... |
import typing
import uuid
from contextlib import contextmanager
import requests_mock
import wrapt
from commercetools.testing.abstract import BaseBackend
from commercetools.testing.api_clients import ApiClientsBackend
from commercetools.testing.auth import AuthBackend
from commercetools.testing.cart_discounts import C... |
# Generated by Django 2.0.8 on 2018-08-31 08:25
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(... |
from webcamlib.Config import Config, ConfigTemperature, ConfigLightSensor
import logging
from pathlib import PosixPath
import datetime
class Annotate:
def __init__(self, config, data):
self.logger = logging.getLogger('annotate')
self.annotate = config
self.data = data
def Annotate(self... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-04-17 19:40
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('rodan', '0018_auto_20200318_2345'),
]
operations = [
migration... |
"""Support for Z-Wave climate devices."""
# Because we do not compile openzwave on CI
import logging
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_COOL, CURRENT_HVAC_FAN, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF, DOMAI... |
import ckan.model as model
import ckan.forms
from ckan.tests import *
from ckan.lib.create_test_data import CreateTestData
import ckan.authz
import ckan.forms.authz
class TestRender(object):
@classmethod
def setup_class(self):
CreateTestData.create()
self.authorizer = ckan.authz.Authorizer()
... |
class NoAccountException(Exception):
"""
Raised when trying to access the account of someone without one
"""
pass
class InvalidMobileWorkerRequest(Exception):
pass
class IllegalAccountConfirmation(Exception):
pass
|
import copy
import os
from PIL import Image
import torch
import torch.utils.data
import torchvision
from pycocotools import mask as coco_mask
from pycocotools.coco import COCO
from . import transforms as T # EDITED
class FilterAndRemapCocoCategories(object):
def __init__(self, categories, remap=True):
... |
import sys
import os
DUMP_PASS_LIB: str = sys.argv[1]
CXX_BC_DIR: str = sys.argv[2]
OUTFILE: str = sys.argv[3]
assert os.path.exists(CXX_BC_DIR)
items = os.listdir(CXX_BC_DIR)
for item in items:
os.system(f"opt --enable-new-pm=0 -load {DUMP_PASS_LIB} --dump -o doesnt_matter.bc {item} >> {OUTFILE}")
|
import h5py
import numpy as np
from typing import Any, Dict, List, Tuple, Union, Optional
from tianshou.data import Batch
from tianshou.data.utils.converter import to_hdf5, from_hdf5
from tianshou.data.batch import _create_value, _alloc_by_keys_diff
class ReplayBuffer:
""":class:`~tianshou.data.ReplayBuffer` sto... |
# * Copyright (c) 2020-2021. Authors: see NOTICE file.
# *
# * 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 ... |
from typing import List, Tuple, Union, cast
from pytezos.context.abstract import AbstractContext # type: ignore
from pytezos.michelson.instructions.base import MichelsonInstruction, format_stdout
from pytezos.michelson.stack import MichelsonStack
from pytezos.michelson.types import BigMapType, BoolType, ListType, Map... |
# 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... |
"""
@brief test log(time=1s)
@author Xavier Dupre
"""
import sys
import os
import unittest
import warnings
import pandas
from pyquickhelper.loghelper.flog import fLOG
from pyquickhelper.helpgen.sphinx_main_helper import produce_code_graph_changes
from pyquickhelper.pycode import fix_tkinter_issues_virtualenv... |
from flask import Flask, request as flaskRequest, jsonify, render_template
import requests
import json
import time
from datetime import datetime, timedelta
import sqlite3
import sys
import ccxt
import os
from threading import Thread
from pathlib import Path
import logging
#setup the logging module for file output
log... |
"""
Pipeline to analyze allesfitter output for planet transit timings
argument 1: allesfitter path
argument 2: p-value threshold
argument 3: Boolean to select to plot wout/with TESS or wout/with/only TESS
Tansu Daylan
MIT Kavli Institute, Cambridge, MA, 02109, US
tansu.daylan@gmail.com
www.tansudaylan.com
"""
import... |
#!/usr/bin/env python3
import mc
def run(mc):
mc.set('cnt', 0)
mc.incr('cnt', 2)
mc.decr('cnt', 5)
if __name__ == '__main__':
mc.run_udp(run)
|
from cleanser import Cleanser
def test_spaces():
text = "I have some extra spaces. "
expected = "I have some extra spaces."
assert Cleanser(text).whitespaces().text == expected
def test_tabs():
text = "I have a tab or two in me."
expected = "I have a tab or two in me."
... |
'''Visualization of the filters of VGG16, via gradient ascent in input space.
This script can run on CPU in a few minutes (with the TensorFlow backend).
Results example: http://i.imgur.com/4nj4KjN.jpg
'''
from __future__ import print_function
from scipy.misc import imsave
import numpy as np
import time
from keras.appl... |
"""
Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of the contexts and temp... |
def ficha(nome='desconhecido', gols=0):
print(f'O jogador {nome} fez {gols} gols no campeonato')
n = str(input('Nome do jogador: '))
g = str(input('Número de gols: '))
if g.isnumeric():
g = int(g)
else:
g = 0
if n.strip() == '':
ficha(gols=g)
else:
ficha(n, g) |
#!/usr/bin/python
# -*- coding:UTF-8 -*-
# -----------------------------------------------------------------------#
# File Name: setup
# Author: Junyi Li
# Mail: 4ljy@163.com
# Created Time: 2021-01-30
# Description:
# -----------------------------------------------------------------------#
from __future__ import abs... |
#!/usr/bin/env python
#
# @file
# @brief The top level IRI configuration object
#
# This holds the Python representation of the YAML top level
# description of the IR instance and provides some basic features
# such as iterators over objects in the instance (by type).
#
import os
import time
import sys
import yaml
imp... |
"""
simple_sp_driver.py
A simple driver implementing Braun-Willett flow routing and then a
(non-fastscape) stream power component.
DEJH, 09/15/14
"""
from __future__ import print_function
import time
import numpy
import pylab
from landlab import ModelParameterDictionary, RasterModelGrid
from landlab.components impo... |
#!/usr/bin/env python
import inspect
import ray
from ray.util.annotations import _is_annotated
IGNORE_PATHS = {
".impl.",
".backend.",
".experimental.",
".internal.",
".generated.",
".test_utils.",
".annotations.",
".deprecation",
}
def _fullname(attr):
"""Fully qualified name o... |
flags = {
'AAA': {'undefined': ['OF', 'SF', 'ZF', 'PF'], 'defined': ['AF', 'CF'], 'setted': [], 'modified': ['OF', 'SF', 'ZF', 'AF', 'PF', 'CF'], 'tested': ['AF'], 'cleared': []} ,
'AAD': {'undefined': ['OF', 'AF', 'CF'], 'defined': ['SF', 'ZF', 'PF'], 'setted': [], 'modified': ['OF', 'SF', 'ZF', 'AF', 'PF', 'CF'], '... |
#!/usr/bin/env python3
# Oppgave av Stian Knudsen
# 1 Vokaler
hjelpeStreng = "aeiouyæøå"
def vokaler(streng):
"""
Returnerer vokalene(streng) i inndata
"""
delStreng = ""
for i in streng:
if i.lower() in hjelpeStreng:
delStreng += i
return delStreng
def antallVokaler(str... |
# ------------------------------------------------------------------------------
# Class TaskReminder
# ------------------------------------------------------------------------------
from PythonUtils.user_input import UserInput
from PythonUtils.option_input import OptionInput
from PythonUtils.option import Option
from... |
from django.conf import settings
from django.core.mail import send_mail
from library.library.models import Checkout
# from celery import shared_task
from celery.contrib.abortable import AbortableTask
from config.settings.celery import app
from time import sleep
@app.task(bind=True, base=AbortableTask)
def send_overdue... |
from .atss import ATSS
from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .cornernet import CornerNet
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .fcos import FCOS
from .fovea import FOVEA
from .fsaf import FSAF
from .gfl import GFL
from .grid_rcnn import GridRCNN
fro... |
#"Automatizando tarefas maçantes com Python", capítulo 4, exercício 1
def virgulas(lista):
for i in lista[0:-1]:
print(i, end=', ')
print('and ' + lista[-1])
lista_exemplo = ['anta', 'boi', 'cavalo', 'doninha', 'elefante']
virgulas(lista_exemplo) #melhorar para retornar como string
|
# coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
... |
import os
import pip
# dd = pip.main(['show', '-f', 'reedsolo'])
# print(dd)
import pkg_resources
from pip._vendor import pkg_resources
for dist in pkg_resources.working_set:
if dist.key in ['reedsolo']:
if dist.has_metadata('RECORD'):
lines = dist.get_metadata_lines('RECORD')
pat... |
"""
This is the core file in the `gradio` package, and defines the Interface class, including methods for constructing the
interface using the input and output types.
"""
import gradio
from gradio.inputs import InputComponent, get_input_instance
from gradio.outputs import OutputComponent, get_output_instance
from grad... |
'''
Created on Jul 12, 2013
Author: William Kolby Smith
Inputs:
1. MODIS Landcover (MOD12Q1) data. Reference: Friedl, M.A. et al. Remote Sens. Environ. 114, 168-182 (2010).
2. Nitrogen Fixation data. Reference: Wang, Y.P. & Houlton, B.Z. Geophys. Res. Lett. 36, doi:10.1029/2009gl041009 (2009).
3. Nitrogen Deposition... |
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['xtark_driver'],
package_dir={'': 'src'})
setup(**setup_args)
|
def echofilter(input, output, delay=0.7, atten=4):
print(input)
print(output)
print(delay)
print(atten)
|
"""Test Runway utils."""
# pylint: disable=no-self-use
# pyright: basic
from __future__ import annotations
import datetime
import json
import logging
import os
import string
import sys
from decimal import Decimal
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
import pytest
from mock import MagicMo... |
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../IAA/')
import vc_agent
import pytest
sofie_credential_signed = {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://mm.aueb.gr/contexts/access_control/v1"
],
"id": "https://www.sofie-iot.eu/... |
"""Test cltk.corpus."""
from cltk.corpus.greek.beta_to_unicode import Replacer
from cltk.corpus.greek.tlg.parse_tlg_indices import get_female_authors
from cltk.corpus.greek.tlg.parse_tlg_indices import get_epithet_index
from cltk.corpus.greek.tlg.parse_tlg_indices import get_epithets
from cltk.corpus.greek.tlg.parse_t... |
from django.apps import AppConfig
class AdminPageLockConfig(AppConfig):
name = 'admin_page_lock'
verbose_name = 'Admin Page Lock'
|
import pytest
from feast import Feature, ValueType
from feast.errors import SpecifiedFeaturesNotPresentError
from tests.integration.feature_repos.universal.entities import customer, driver
from tests.integration.feature_repos.universal.feature_views import (
conv_rate_plus_100_feature_view,
create_conv_rate_re... |
from __future__ import print_function
import yaml
import os
import sys
import v20
from common import input
#
# The default environment variable that points to the location of the v20
# configuration file
#
DEFAULT_ENV = "V20_CONF"
#
# The default path for the v20 configuration file
#
DEFAULT_PATH = "~/.v20.conf"
... |
# 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
from ... import _utilities, _tables
from... |
from otree.api import Bot, expect
from . import Introduction, LotteryInstructions, LotteryUnderstanding, LotteryUnderstood, LotteryDecision
class PlayerBot(Bot):
def play_round(self):
expect(
"You will receive £5.00 to thank you for your participation today.",
"in",
se... |
# -*- coding: utf-8 -*-
"""
Configuration parsing and resolving
===================================
"""
import copy
import getpass
import hashlib
import logging
import os
import git
import yaml
from numpy import inf as infinity
import orion
import orion.core
from orion.core.io.orion_cmdline_parser import OrionCmdlin... |
# -*- coding: utf-8 -*-
#
# Author: Daniel Garcia (cr0hn) - @ggdaniel
# Github: https://github.com/cr0hn
#
import asyncio
from multiprocessing import Process
from threading import Thread, Event, BoundedSemaphore, currentThread
class _ConcurrentManager(object):
def __init__(self, n_process=2, n_threads=5, n_ta... |
from typing import Dict, Any, Optional, Iterable
from io import StringIO
import json
import os
from zerver.lib import mdiff
from zerver.lib.openapi import validate_against_openapi_schema
if False:
from zulip import Client
ZULIP_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
F... |
"""This script automatically categorizes plugins from their tags.
It is conservative and will not categorize if there is any ambiguity. Also
refuses to overwrite plugin categories, and is thus idempotent.
"""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
_CATEGORY_TAGS_MAP = {
... |
"""Tests the module that parses and executes commands."""
# Copyright 2016 Google 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
#
# Unles... |
"""Mail (SMTP) notification service."""
from email.mime.application import MIMEApplication
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import email.utils
import logging
import os
import smtplib
import voluptuous as vol
from homeassistant.c... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
from codage import coder_nrz
def binaire_vers_decimal(bits):
"""
Transforme un tableau de bits en entier
:param bits: Le tableau de bits
:return: L'entier représentant la valeur binaire
"""
s = ""
for bit in bits:
s += str(... |
import sys
def setPrintToFile(filename):
stdout_original = sys.stdout
f = open(filename, 'w')
sys.stdout = f
return f,stdout_original
def closePrintToFile(f, stdout_original):
sys.stdout = stdout_original
f.close()
def load_data(file):
words = []
tags_1 = []
tags_2 = []
... |
from os import environ,path
from key import db_uri,db_key
basedir = path.abspath(path.dirname(__file__))
class Config:
#general config
FLASK_DEBUG = 1
FLASK_APP = 'app.py'
#database config
SQLALCHEMY_DATABASE_URI = db_uri #environ['DATABASE_URL']
SECRET_KEY = db_key
SQLALCHEMY_... |
# Generated by Django 2.1.5 on 2019-02-07 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_refinery_common', '0014_organism_experiments'),
]
operations = [
migrations.AddField(
model_name='dataset',
nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.