text
stringlengths
1
927k
# Copyright 2015 Intel Corporation. # Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Lic...
#!/usr/bin/env python # # Copyright 2016 Cisco Systems, 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 applicab...
# Copyright 2016 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 ag...
import sqlite3 class myunfollowersdb: def __init__(self): self.connection = sqlite3.connect('database/myunfollowers.db') self.cursor = self.connection.cursor() def createTables(self): self.cursor.execute("""CREATE TABLE "users" ( "userId" INTEGER NOT NULL, ...
''' Description: This file contains the IPinIP test for dualtor testbed Usage: Examples of how to start this script /usr/bin/ptf --test-dir ptftests ip_in_ip_tunnel_test.IpinIPTunnelTest --platform-dir ptftests --qlen=2000 --platform remote -t hash_key_list=['src-port', 'dst-port', 'src-mac...
""" Django settings for devopsdjango project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ from pa...
from django import http from django.shortcuts import render from meiduo.libs.captcha.captcha import captcha # Create your views here. from django.views.generic.base import View from django_redis import get_redis_connection from meiduo.utils.response_code import RETCODE from random import randint # from meiduo.libs.yunt...
from django.conf.urls import include, url from core.tests.resources import NoteResource note_resource = NoteResource() urlpatterns = [ url(r'^', include(note_resource.urls)), ]
# Copyright 2019 Google LLC. 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...
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3 extraInfo = {'camPos': Point3(652.314, -154.956, 60.7173),'camHpr': VBase3(-5.3369, -32.9357, 0),'focalLength': 1.39999997616,'skyState': 2,'fog': 0}
# Lint as: python3 # # Copyright 2020 The XLS 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...
def table(name=None, primary_key="id", column_map=None): """数据据保存的表名""" def decorate(clazz): setattr(clazz, "__table_name__", clazz.__name__ if name is None else name) setattr(clazz, "__primary_key__", primary_key) setattr(clazz, "__column_map__", None if column_map is None else column_m...
from ...error import GraphQLError from .base import ValidationRule # Necessary for static type checking if False: # flake8: noqa from ..validation import ValidationContext from ...language.ast import Document, OperationDefinition, Name from typing import Any, List, Optional, Union, Dict class UniqueOper...
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
import json from unittest.mock import AsyncMock, patch import pytest from .. import settings def describe_list(): def describe_GET(): @pytest.mark.slow def it_returns_example_image_urls(expect, client): request, response = client.get("/images", timeout=10) expect(response...
#from notify import Notify from pathlib import Path, PurePath from notify.models import Actor, Chat, Account, Message, BlockMessage, MailMessage from notify import Notify from notify.providers.dummy import Dummy import asyncio ## Add two more providers: Twitter and Whatsapp via Twilio # f = open(Path(__file__).paren...
""" Django settings for dev_blog project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ import os ...
"""GUI class module.""" # TODO: Add library viewer with scoring, queueing and search funcionality using # splitter window: top left - artist, top right - album, centre - tracks, # bottom - details. # TODO: Add delete file/directory menus, with confirmation? # TODO: Add support for mulitple track selections...
# Copyright 2021 (c) Crown Copyright, GC. # # 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 django_filters.rest_framework as filters from rest_framework import generics from rest_framework.pagination import CursorPagination from rest_framework.permissions import IsAuthenticated from .models import AuditLog from .serializers import AuditLogSerializer class ActionAtCursorPagination(CursorPagination): ...
# -*- coding=utf-8 -*- import keras from keras.models import Sequential from keras.layers import Dense, Activation, Dropout from keras.layers.convolutional import Conv1D from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences import pandas as pd import numpy as np import s...
# -*- coding: utf8 -*- from __future__ import absolute_import import logging import os import subprocess from django.conf import settings log = logging.getLogger('pontoon') class PullFromRepositoryException(Exception): pass class PullFromRepository(object): def __init__(self, source, target): se...
""" Various ugly utility functions for twill. Apart from various simple utility functions, twill's robust parsing code is implemented in the ConfigurableParsingFactory class. """ import os import re from collections import namedtuple from lxml import html try: import tidylib except (ImportError, OSError): ...
#!/usr/bin/env python # Save parameters every a few SGD iterations as fail-safe SAVE_PARAMS_EVERY = 5000 import glob import random import numpy as np import os.path as op import pickle def load_saved_params(): """ A helper function that loads previously saved parameters and resets iteration start. "...
pessoa = ('Gustavo', 39, 'M', 99.88) print(pessoa) del(pessoa) # del() - apaga uma variável da memória input('\n\nPressione <enter> para continuar')
from pygame import Vector2 from .movement import Movement from ...util import MaxValue class VectorMovement(Movement): def __init__(self, sprite, thrust=10, friction=1, rotation=60, brake=6, max_velocity=150, angle=0): Movement.__init__(self, sprite, thrust) self.friction = friction * Movement.per_...
import unittest from circular_buffer import CircularBuffer # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 class CircularBufferTest(unittest.TestCase): def test_reading_empty_buffer_should_fail(self): buf = CircularBuffer(1) with self.assertRaisesWithMessage(BaseExcep...
# Generated by Django 2.2.13 on 2021-03-14 21:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('public_interface', '0005_auto_20210313_1919'), ] operations = [ migrations.AddField( model_name='vouchers', name='f...
#!/usr/bin/python ################################################################################ # 23145ca0-5cc5-11e4-af55-00155d01fe08 # # Justin Dierking # justindierking@hardbitsolutions.com # phnomcobra@gmail.com # # 10/24/2014 Original Construction ################################################################...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSO...
from statement_parser.text_analyser import TextAnalyser from xbrl.instance import TextFact BALANCE_TAGS_REVERSAL = [ "us-gaap_CashDividendsPaidToParentCompanyByConsolidatedSubsidiaries", ] class Expense: def __init__(self, fact, label, text_blocks=None): self.fact = fact self.cost = float(fac...
from speechinput import speech_input from speechoutput import speech_output in_speech = speech_input() if (in_speech): speech_output(in_speech)
from abc import ABCMeta, abstractmethod class Scene(object): __metaclass__ = ABCMeta @abstractmethod def enter(self): """ Enter method to every scene :return: """ pass class Engine(object): __metaclass__ = ABCMeta def __init__(self, scene_map): s...
# PREPARE A CSV-FILE TO ENABLE AN STACKED PLOT FOR POSITIVE TESTS, HOSPITALIZATIONS AND DECEASED # Hospitalizations and deceased are not lagged in time, the date of the result of the "desease onset", positieve test or notification is leading # https://data.rivm.nl/geonetwork/srv/dut/catalog.search#/metadata/2c4357c8-76...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019-2020 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
import unittest from unittest.mock import mock_open, patch from conjur.data_object.conjurrc_data import ConjurrcData from conjur.errors import InvalidConfigurationException EXPECTED_REP_OBJECT={'conjur_url': 'https://someurl', 'conjur_account': 'someaccount', 'cert_file': "/some/cert/path"} EXPECTED_CONJURRC = \ """ ...
# 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 ...
#!/usr/bin/env python # _*_ coding: utf-8_*_ # # Copyright 2016 7x24hs.com # thomas@7x24hs.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...
import os from threading import Thread from time import sleep from cloud_provider.cloud_client import CloudClient from pyVmomi import vim from keystoneclient.v3 import client as KeystoneClient from openstack import connection from urllib import request import json from cloud_provider.utils import download_plugins from...
# Copyright 2020 Ram Rachum and collaborators. # This program is distributed under the MIT license. from __future__ import annotations import math import inspect import re import abc import random import itertools import collections.abc import statistics import concurrent.futures import enum import functools import n...
# # 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...
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
""" This file offers the methods to automatically retrieve the graph Candidatus Kerfeldbacteria bacterium RIFOXYA2_FULL_38_24. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, t...
# This code is from # Multi-Task Learning as Multi-Objective Optimization # Ozan Sener, Vladlen Koltun # Neural Information Processing Systems (NeurIPS) 2018 # https://github.com/intel-isl/MultiObjectiveOptimization import numpy as np from .min_norm_solvers_numpy import MinNormSolver def moo_mtl_search(multi_obj_f...
import os import sys from collections import OrderedDict sys.path.append(os.path.join(os.path.dirname(__file__), '../src')) from AccessToken import * Role_Attendee = 0 # depreated, same as publisher Role_Publisher = 1 # for live broadcaster Role_Subscriber = 2 # default, for live audience Role_Admin = 101 # deprecate...
import collections import unittest import uuid from sqlalchemy import inspect import galaxy.datatypes.registry import galaxy.model import galaxy.model.mapping as mapping datatypes_registry = galaxy.datatypes.registry.Registry() datatypes_registry.load_datatypes() galaxy.model.set_datatypes_registry(datatypes_registr...
fahr = float(input('insira a temperatura em Fahrenheit: ')) celsius = ((fahr - 32) / 9) * 5 print(f'a temperatura convertida em Celsius será de {celsius:.2f}ºC.')
from typing import Callable, TypeVar, AsyncIterator, Iterator import collections import asyncio _T = TypeVar('_T') class _StopFeedableAsyncIterator: pass class FeedableAsyncIterable(AsyncIterator[_T]): def __init__(self, maxsize: int = 1): self._queue: asyncio.Queue = asyncio.Queue(maxsize=maxsize...
from Helper.helper import start_text, help_text from config import bot from telethon import events class start(): @bot.on(events.NewMessage(pattern="/start")) async def event_handler_start(event): await bot.send_message( event.chat_id, start_text, file='https://tele...
# qubit number=2 # total number=10 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...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: MNN import flatbuffers class Plugin(object): __slots__ = ['_tab'] @classmethod def GetRootAsPlugin(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = Plugin() ...
from ..builder import DETECTORS from .logo_two_stage import LogoTwoStageDetector @DETECTORS.register_module() class LogoFasterRCNN(LogoTwoStageDetector): """Implementation of `Faster R-CNN <https://arxiv.org/abs/1506.01497>`_""" def __init__(self, backbone, rpn_head, ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from warnings import warn from flask_multipass import MultipassE...
from .PropulsionDevice import Propulsion from .PropulsionManager import PropulsionManager, EventlessPropulsionManager, NullPropulsionManager from .PropulsionManagerFactory import PropulsionManagerFactory from .PropulsionFactory import PropulsionFactory
from os import path from pathlib import Path as path_lib import json class LanguageManager(object): def __init__(self): self._path_to_language_file = 'config/languageConfig.json' def get_languages(self): languages = [] language_file_path = path.join( path.dirname(path....
from django.db import models from django.urls import reverse # Used to generate URLs by reversing the URL patterns import uuid # Required for unique book instances from django.contrib.auth.models import User from datetime import date class Genre(models.Model): """Model representing a book genre.""" name = mode...
"""Implementation of partial-become rule.""" # Copyright (c) 2016 Will Thames <will@thames.id.au> # # 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 limi...
# Copyright 2013-2022 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 RMatlab(RPackage): """MATLAB emulation package. Emulate MATLAB code using R.""" ...
# -*- coding: utf-8 -*- # # Copyright 2016-2020 BigML # # 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 ...
from aiogram.dispatcher.filters.state import StatesGroup, State class Mailing(StatesGroup): Q1 = State() class Special(StatesGroup): Q1 = State() Q2 = State()
# -*- coding: utf-8 -*- from sqlalchemy import event, exc, select from sqlalchemy.engine import Connection, Engine def pessimistic_connection_handling(some_engine: Engine) -> None: @event.listens_for(some_engine, 'engine_connect') def ping_connection( connection: Connection, branch: bool ) -> Non...
# Бинго 75 + Выигрышные номера последних 4 тиражей def test_bingo75_winning_numbers_last_4_draws(app): app.ResultAndPrizes.open_page_results_and_prizes() app.ResultAndPrizes.click_game_bingo75() app.ResultAndPrizes.click_winning_numbers_of_the_last_4_draws() app.ResultAndPrizes.button_get_report_winn...
from pykfs.git.hook.hookobj import PostReceive, CommitMsg, PreReceive def pre_receive(settings={}): hook = PreReceive(settings=settings) return hook() def post_receive(settings={}): hook = PostReceive(settings=settings) return hook() def commit_msg(settings={}): hook = CommitMsg(settings=setti...
""" Django settings for filosocast project. Generated by 'django-admin startproject' using Django 3.0.8. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os...
import sys import json import numpy as np import pylab def plot(X,Y,theory,data,err): #print "theory",theory[1:6,1:6] #print "data",data[1:6,1:6] #print "delta",(data-theory)[1:6,1:6] pylab.subplot(3,1,1) pylab.pcolormesh(X,Y, data) pylab.subplot(3,1,2) pylab.pcolormesh(X,Y, theory) py...
""" Simple PyWren example using the map_reduce method which counts the number of words inside each object specified in 'iterdata' variable. This example processes some objects which are in COS. Be sure you have a bucket named 'sample_data' and the objects object1, object2 and object3 inside it. Otherwise, you can cha...
#!/usr/bin/env python """ """ import os import sys import shutil import configparser import traceback from pathlib import Path from subprocess import check_output, CalledProcessError, STDOUT import django.core.management from evennia.server import evennia_launcher from muddery.launcher import configs # -------------...
# ####### # Copyright (c) 2016 GigaSpaces Technologies Ltd. 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 # # Unles...
# coding: utf-8 """ convertapi Convert API lets you effortlessly convert file formats and types. # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class GetXlsxWorksheetsRequest(object...
from typing import Dict, TextIO from utils.file import write_enum from utils.string import to_pascal_case def read_template() -> str: template_file: TextIO = open("./file_templates/csharp-enum.cs", "r") return template_file.read() def as_enum_row(key: object, json: object) -> str: enum_name = to_pascal...
# Copyright 2014-2018 The PySCF Developers. 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...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Page.url' db.alter_column('api_page', 'url', self.gf('...
# Generated by Django 4.0.3 on 2022-03-11 14:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('home', '0002_items'), ] operations = [ migrations.RenameModel( old_name='Items', new_name='Item', ), ]
#!/usr/bin/env python # encoding: utf-8 """ CouchService.py Created by Dave Evans on 2010-04-20. Copyright (c) 2010 Fermilab. All rights reserved. """ from time import time import WMCore.Database.CouchUtils as CouchUtils class CouchService(object): def __init__(self, **options): super(CouchService, self...
# Copyright 2016-2021 IBM Corp. 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...
def sqrt(n): x0 = 1 while (x0 * x0) - 1 <= n: x0 += 1 for _ in range(10): x0 -= ( (x0**2 - n) / (x0 * 2) ) return x0 def root(n, p=2): x0 = 1 while (x0 * x0) - 1 <= n: x0 += 1 for _ in range(10): x0 -= ( (x0**p - n) / (p * (x0 ** (p-1))) ) return x0
# # Python script using OME API to get alerts for a group. # # _author_ = Raajeev Kalyanaraman <Raajeev.Kalyanaraman@Dell.com> # _version_ = 0.1 # # Copyright (c) 2018 Dell EMC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
from moonleap import Prop, extend from moonleap.typespec.field_spec import FieldSpec from . import props @extend(FieldSpec) class ExtendFieldSpec: target_type_spec = Prop(props.target_type_spec)
# Copyright (c) 2022 Serum # 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, distribute, su...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
class ConsoleDialogueView: def __init__(self, speaker="", message=""): self.speaker = speaker self.message = message def render(self): self.__print_message() input() return self def render_with_choice(self, options): if len(options) == 0: raise ...
def extractRydeniustranslationsBlogspotCom(item): ''' Parser for 'rydeniustranslations.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None urlfrag = [ ('/vrmmo-summoner-hajimemashita-chapter-', 'V...
""" Storage for optical spectral line information. """ from __future__ import print_function import numpy as np def hydrogen(nu,nl, vacuum=True): """ Compute the rest wavelength of Hydrogen recombination lines in angstroms """ rydberg = 10973731.6 # m^-1 protontoelectron = 1836.15266 # ratio ...
# 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 ...
import os from django.utils.translation import ugettext_lazy as _ try: from localsettings import * except ImportError: pass # Django settings for wafer project. ADMINS = ( # The logging config below mails admins # ('Your Name', 'your_email@example.com'), ) DATABASES = { 'default': { 'EN...
""" Empirical Cross Entrpy (ECE) The discrimination and calibration of the LRs reported by some systems can also be measured separately. The empirical cross entropy (ECE) plot is a graphical way of doing this. The ECE is the average of -P(Hp) * log2(P(Hp|LRi)) for all LRi when Hp is true, and -P(Hd) * log2(P(Hd|LRi))...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: Ampel-interface/ampel/model/operator/AllOf.py # License: BSD-3-Clause # Author: valery brinnel <firstname.lastname@gmail.com> # Date: 15.10.2018 # Last Modified Date: 18.03.2021 # Last Modified By: valery br...
from abc import abstractmethod from inspect import getmembers from typing import AnyStr, AsyncIterable, Optional, Sequence, Tuple from tickit.core.adapter import Adapter, Interpreter from tickit.utils.compat.typing_compat import Protocol, runtime_checkable @runtime_checkable class Command(Protocol): """An interf...
N, M, K = map(int, input().split()) down = K // M right = K % M print(down, right)
# Copyright 2019 Xanadu Quantum Technologies 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 agre...
import copy as cp import os import os.path as osp from collections import OrderedDict import json_tricks as json import numpy as np from mmpose.datasets.builder import DATASETS from .topdown_base_dataset import TopDownBaseDataset @DATASETS.register_module() class TopDownOneHand10KDataset(TopDownBaseDataset): ""...
import time import pandas as pd from selenium import webdriver # Scrapping images and their caption from unsplash website # saving these images url and captions into a csv file WEBSITE = 'http://unsplash.com/s/photos/landscape-forest-mountain' columns = ['description', 'url'] imageset = pd.DataFrame(columns = columns...
""" common type operations """ from typing import Any, Callable, Union import warnings import numpy as np from pandas._libs import algos, lib from pandas._libs.tslibs import conversion from pandas.compat import PY36 from pandas.core.dtypes.dtypes import ( CategoricalDtype, DatetimeTZDtype, ExtensionDtype...
import mock import time from unittest.case import SkipTest from ddtrace.context import Context from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.span import Span from ddtrace.ext import errors, priority from .base import BaseTracerTestCase class SpanTestCase(BaseTracerTestCase): def test_ids(...
def is_even(x): """ Return True if x is an even number. False if x is odd. """ assert isinstance(x, int) assert x > 1 if (x % 2) == 0: return True # if not even that odd. return False def is_prime(x): """ Return True if x is a prime number. False otherwise. """ as...
# set async_mode to 'threading', 'eventlet', 'gevent' or 'gevent_uwsgi' to # force a mode else, the best mode is selected automatically from what's # installed async_mode = None import time from flask import Flask, render_template import socketio sio = socketio.Server(logger=True, async_mode=async_mode) app = Flask(_...
import os import dataclasses import numpy as np import torch from torch.utils.data import DataLoader from torch.optim import Adam from torch.optim.lr_scheduler import OneCycleLR from pymarlin.core import module_interface, data_interface from transformers import AutoModelForTokenClassification from pymarlin.utils.sta...
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bo...
import pandas as pd import numpy as np from manage_state import set_state, set_stand_state from utilities import combine_csv, concat_data, blank_filter, resolve_acc_gyro, resolve_acc_gyro_labels from rolltec_features import create_features def combine_state_features(directory, state, window=40, stand=0): """ ...