text stringlengths 1 927k |
|---|
import cv2
import numpy as np
Initial_Frame = 900
Final_Frame = 1190
video_name = 'Sample2 with detections.avi'
frame = cv2.imread("image/Seg_frame%d.jpg" % Initial_Frame)
height, width, layers = frame.shape
fps = 15
video = cv2.VideoWriter(video_name, 0, fps, (width,height))
for x in range(Initial_Frame,Fina... |
"""
PERIODS
"""
numPeriods = 180
"""
STOPS
"""
numStations = 13
station_names = (
"Hamburg Hbf", # 0
"Landwehr", # 1
"Hasselbrook", # 2
"Wansbeker Chaussee*", # 3
"Friedrichsberg*", # 4
"Barmbek*", # 5
"Alte Woehr (Stadtpark)", # 6
"Ruebenkamp (City Nord)", # 7
"Ohlsdorf*", # 8
"Kornweg", # 9
"... |
import os
import torch
from pathlib import Path
from nn_interpretability.model.definition.am_mnist_classifier import AMCNN
from nn_interpretability.model.definition.mc_dropout_cnn import CNN_Dropout
from nn_interpretability.model.definition.general_mnist_cnn import GeneralCNN
from nn_interpretability.model.definition.... |
import os
import re
from collections import OrderedDict
from typing import Generator, List, Optional, Reversible
import delegator
from git import Commit
from git.exc import InvalidGitRepositoryError
from git.repo import Repo
from github import Github
from github.Label import Label
from github.Issue import Issue
from g... |
# encoding=utf8
# pylint: disable=mixed-indentation, trailing-whitespace, line-too-long, multiple-statements, attribute-defined-outside-init, logging-not-lazy, no-self-use, redefined-builtin, singleton-comparison, unused-argument, arguments-differ, no-else-return
import logging
from scipy.spatial.distance import euclid... |
import dr.dist
import dr.experiment
import dr.gym
import dr.ppo |
SHORT_PLUGIN_NAME = 'smaract'
package_url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_samarct'
description = 'Set of PyMoDAQ plugins for linear actuators from Smaract' \
'(SLC positioners). MCS and MCS2 controllers are supported.'
author = 'David Bresteau'
author_email = 'david.bresteau@cea.fr'
# p... |
import os
import platform
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, sizeof, c_bool, c_char, c_int32,
c_void_p)
from .enums import (CorsairAccessMode, CorsairError, CorsairLedId,
CorsairEventId, CorsairDevicePropertyId)
from .structs import (CorsairProtocolDetails, ... |
# Gym-TORCS-Kai Environment for Reinforcement Learning in TORCS
# original author : Naoto Yoshida
# (https://github.com/ugo-nama-kun/gym_torcs)
# modified version author : Daiko Kishikawa
#
# This environment is under modification. (2019.12)
#
import gym
from gym import spaces
from gym.utils import seeding
import num... |
from django.conf import settings
from django.db import models
from django.views.generic import TemplateView
User = settings.AUTH_USER_MODEL
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.Foreign... |
from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import TensorflowUtils as utils
import read_MITSceneParsingDataParis as scene_parsing
import datetime
import BatchDatsetReader as dataset
from six.moves import xrange
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_siz... |
from .sha256 import sha224, sha256
from .sha512 import sha384, sha512 |
import h5py
import numpy as np
class HDF5Saver:
def __init__(self, sensor_width, sensor_height, file_path_to_save="data/carla_dataset.hdf5"):
self.sensor_width = sensor_width
self.sensor_height = sensor_height
self.file = h5py.File(file_path_to_save, "w")
# Creating groups to stor... |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'visitkoreakz.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django.... |
import kivy
from functools import partial
kivy.require('2.0.0')
from kivymd.uix.imagelist import SmartTile
from constants import Screen
class CustomSmartTile(SmartTile):
def __init__(self, **kwargs):
super(CustomSmartTile, self).__init__(**kwargs)
self.height = '240dp'
self.size_hint_y = No... |
from dateparser import parse
import datetime as dt
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class EsAssociacaoMunicipiosSpider(BaseGazetteSpider):
TERRITORY_ID = '3200000'
name = 'es_associacao_municipios'
allowed_domains = ['diariomunicipales.or... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... |
def main():
data = open("day07/input.txt", "r")
lines = [line for line in data]
crabs = [int(fish.strip()) for fish in lines[0].split(",")]
median_val = sorted(crabs)[len(crabs) // 2]
fuel_sum = 0
for crab in crabs:
fuel_sum += abs(crab - median_val)
print(fuel_sum)
if __name__ =... |
"""
shared functions
"""
#!/usr/bin/env python
#coding=utf-8
def cmp_str(element1, element2):
"""
compare number in str format correctley
"""
try:
return cmp(float(element1), float(element2))
except ValueError:
return cmp(element1, element2)
def list_to_str(value_list, cmpfun=cm... |
from game import Game
if __name__ == '__main__':
# Initialize the game
game = Game()
# Game loop
while True:
# Get the user's guess
guess = input('Guess a word: ').lower()
# Check the guess
game.check_guess(guess)
# Print the board
game.print_board()
... |
# coding: utf-8
from __future__ import absolute_import, print_function, with_statement
import logging
import os
from os.path import dirname
format = "%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"
def getLogger(verbose=0, filename=None, name="nnsvs"):
logger = logging.getLogger(name)
if ver... |
import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... |
import argparse
from bigquery import get_client
from gh_api import curr_commit_master
from gh_api import repo
from util import create_bq_table, push_bq_records
from util import get_repo_names, curr_time_utc
from util import unique_vals
parser = argparse.ArgumentParser()
parser.add_argument('--proj', action = 'store... |
roadSign=[]
roadSign.append("Johnson's house")
roadSign.append("Fox streetlamp")
roadSign.append("Guang Hualu kindergarten")
roadSign.append("Dog rescue center")
roadSign.append("Samll street park")
roadSign.append("Ri Tan School")
print(roadSign)
nextRoadSign=roadSign.pop()
print(nextRoadSign)
nextRoadSign=roadSign.po... |
import datetime as dt
from xml.etree import ElementTree as ET
from django.core.management.base import BaseCommand
from django.db import transaction
from django_scopes import scopes_disabled
from pretalx.event.models import Event, Organiser, Team
from pretalx.person.models import User
class Command(BaseCommand):
... |
# coding=utf-8
import pandas as pd
import MySQLdb
import python.com.nfs.util.MailUtil as mailutil
import sys
# ========== 从原始csv文件中导入股票数据,以浦发银行sh600000为例
# 导入数据 - 注意:这里请填写数据文件在您电脑中的路径
'''
1、循环股票代码
2、最新的一条数据20均线在最高与最低之间
2、取出最新的5条数据
3、最后一条的均线数据大于倒数第二条
4、写入数据库,发送 或者写入df,形成xls文件
5、发送
'''
try:
reload(sys)
sys.set... |
from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... |
# Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
"""
:py:mod:`rootpy` overrides the default logging class, inserting a check that
there exists a default logging handler. If there is not, it adds one.
In additon, this can be used to intercept ROOT's log messages and redirect them
through python's logging subsystem
Example use:
.. sourcecode:: python
# Disable ... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_swirl_prong_hue.iff"
result.attribute_template_id = 9
result.... |
from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
"""Тест домашней страницы"""
def test_root_url_resolve_to_home_page_view(self):
"""Тест: корневой url преобразуется в представление дом... |
# -*- coding: utf-8 -*-
# Copyright (c) 2008 Alberto García Hierro <fiam@rm-fr.net>
# 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 rig... |
from telegram.ext import MessageHandler, Filters, CommandHandler, Updater
from mastodon import MastodonIllegalArgumentError, MastodonUnauthorizedError
import DataHandler
import threading
import os
import sys
import logging
import certifi
import urllib3
import re
bot_token = '<your bot token here>'
# secretfile = open... |
from tkinter import *
import tkinter.filedialog as tkFileDialog
root = Tk("Text Editor")
text = Text(root)
text.grid()
def saveas():
global text
t = text.get("1.0", "end-1c")
savelocation= tkFileDialog.asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
button=Button... |
from django.contrib import admin
from .models import Comment
admin.site.register(Comment) |
# Letian Xu
# 01/10/2019
# I have not given or received any unauthorized assistance on this assignment.
def overlap(s1,s2):
'''
Arguments: s1 and s2 represent two lists, also represent a square.
Return: The area of the overlap of the two squares, if the squares do not overlap, return 0.
'''
# Use ... |
import webbrowser as web
def tutorial_hindi() -> None:
"""Watch tutorial on how to use this library on YouTube in Hindi"""
web.open("https://youtu.be/o6WV9zFJg1o")
def tutorial_english() -> None:
"""Watch tutorial on how to use this library on YouTube in English"""
web.open("https://youtu.be/vpfrw... |
# Generic parser schema
# with the default values
# Author: Evgeny Blokhin
import os, sys
import re
import time
import math
import random
import hashlib
import base64
from ase.data import chemical_symbols
class Output:
def __init__(self, filename='', calcset=False):
self._filename = filename # for quic... |
# coding: utf-8
# Copyright 2020 Tarkan Temizoz
# 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... |
# coding=utf-8
import sys
from pathlib import Path
import webbrowser
import numpy as np
import cv2
from PIL import Image
from PyQt5.QtCore import QDir, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QImage, QPixmap, QColor
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QMessageBox, QFile... |
#! /usr/bin/env python
from __future__ import print_function
import sys
import os
import glob
pFiles = glob.glob('*_p.py')
caseDict = {}
for pf in pFiles:
caseDict[pf] = set(glob.glob(pf[:-5]+'*_n.py'))
#fix cases were problem name is a subset of some other problem name
for pf1 in pFiles:
for pf2 in pFiles:
... |
from __future__ import absolute_import
from django.forms import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
import xadmin
from .xadmin_action import RunloopAction
from .models import RunLoopGroup, Orders
ACTION_NAME = {
'add': _('Can add %s'),
'change': _('Can change %s'),
... |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... |
# Generated by Django 3.1.12 on 2021-08-09 17:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("videos", "0001_initial"),
("gdrive_sync", "0001_initial"),
]
operations = [
migrations.AddField(
... |
# Python Quiz Game
import time
from pygame import mixer
mixer.init()
mixer.music.load("Audio/KBCMAIN.mp3")
mixer.music.set_volume(0.2)
mixer.music.play()
print("Let's Play Kaun Banega Crorepati")
name = input("Please Enter your Name: ")
print("Welcome", name)
decision = input("Do you want to play KBC(Yes/No): ")
deci... |
# -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr, urliz... |
# !/usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
from sqlalchemy import String, ForeignKey, Integer, Enum
from .base import AbstractModel, RequiredColumn
class Customer(AbstractModel):
__tablename__ = "customer"
user_id = RequiredColumn(String(50))
stripe_customer_id = RequiredColumn(String(50)) |
from project.fileviews.base import FileView
class ImageFileView(FileView):
"""
Class for displaying image files.
"""
def render(self, request):
return super().render(request, 'project/file_view_image.html') |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
from setuptools import find_packages, setup
def req_file(filename):
with open(filename) as f:
content = f.readlines()
return [x.strip() for x in content]
install_requires = req_file("requirements.txt")
setup(
name="bsmetadata",
python_requires=">=3.7.11, <3.10",
version="0.1.0",
url... |
import setuptools
# To publish:
#
# - Update VERSION constant below
# - python3 -m pip install --upgrade build twine
# - rm -rf dist && python3 -m build
# - python3 -m twine upload dist/*
# - Username is __token__, password is token value
VERSION = "1.0.0rc1"
INSTALL_REQUIRES = ["requests<3.0.0"]
with ... |
# Generated by Django 1.11.2 on 2017-06-22 10:22
import bitfield.models
import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search ... |
import os
import re
import cv2
import umap
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
def global_std_pool2d(x):
"""2D global standard variation pooling"""
return torch.st... |
try:
from django.utils.encoding import smart_text, smart_str
except ImportError:
from django.utils.encoding import smart_unicode as smart_text, smart_str |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... |
import pdfkit
class PdfPrinter:
"""A wrapper class around pdfkit functionality to print html to pdfs"""
@staticmethod
def from_file(infile, outfile):
options = {
"page-size": "Letter",
"dpi": "96",
"margin-top": "1in",
"margin-right":... |
"""This is an example app, demonstrating usage."""
import os
from flask import Flask
from flask_jsondash.charts_builder import charts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.config.update(
JSONDASH_FILTERUSERS=False,
JSONDASH_GLOBALDASH=True,
JSONDASH_GLOBAL_USER='global',
)
... |
#!/usr/bin/env python
# Lint as: python3
"""Client actions related to administrating the client and its configuration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import traceback
import crypto... |
#
# Copyright (c) 2020 - Neptunium Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from social_fabric.config_repo import ConfigRepo
class NetworkTemplateProcessor:
def __init__(self):
self.file_loader = FileSystemLoader(ConfigRepo.TEMPLAT... |
"""Tests for tinypages build using sphinx extensions."""
import filecmp
import os
from pathlib import Path
import shutil
from subprocess import Popen, PIPE
import sys
import pytest
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')
def test_tinypages(tmpd... |
import asyncio
from collections.abc import Iterator
from operator import add
import queue
import random
from time import sleep
import pytest
from tornado import gen
from distributed.client import _as_completed, as_completed, _first_completed, wait
from distributed.metrics import time
from distributed.utils import Can... |
"""
pdf2image is a light wrapper for the poppler-utils tools that can convert your
PDFs into Pillow images.
"""
import os
import platform
import tempfile
import types
import shutil
import pathlib
from subprocess import Popen, PIPE
from PIL import Image
from .generators import uuid_generator, counter_generato... |
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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... |
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('requirements.txt', encoding='utf-8') as f:
reqs = f.read()
pkgs = [p for p in find_packages()]
print(pkgs)
setup(
name='fastHan',
version='1.7... |
# Copyright 2016 Palo Alto Networks, 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 pytest
from pyemv import ac
def test_generate_ac_exception() -> None:
# SK < 16 bytes
with pytest.raises(
ValueError,
match="Session Key must be a double length DES key",
):
ac.generate_ac(
sk_ac=bytes.fromhex("AAAAAAAAAAAAAAAA"),
data=bytes.fromhex(... |
from model import DeepJIT
import torch
from tqdm import tqdm
from utils import mini_batches_train, save
import torch.nn as nn
import os, datetime
def train_model(data, params):
data_pad_msg, data_pad_code, data_labels, dict_msg, dict_code = data
# set up parameters
params.cuda = (not params.no_cuda) ... |
# Generated by Django 2.0.3 on 2018-06-03 14:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mymodel', '0011_auto_20180603_2208'),
]
operations = [
migrations.AlterField(
model_name='room'... |
import xml.etree.ElementTree as ET
import bz2, sys
def SortOsm(inFina, outFina):
fi = bz2.BZ2File(inFina)
root = ET.fromstring(fi.read())
fi.close()
objDict = {}
for obj in root:
if 'id' in obj.attrib:
i = int(obj.attrib['id'])
#print obj.tag, i
if obj.tag not in objDict:
objDict[obj.tag] = {}
... |
# -*- coding: utf-8 -*-
'''
Load up the libvirt keys into Pillar for a given minion if said keys have been generated using the libvirt key runner
'''
from __future__ import absolute_import
# Don't "fix" the above docstring to put it on two lines, as the sphinx
# autosummary pulls only the first line for its descriptio... |
#!/usr/bin/env python3
import json, sys, os, base64, hashlib, glob
def writeSource(f, src):
for line in src:
f.write(line)
def processOutputs(f, outputs):
for output in outputs:
if( "text" in output.keys() ):
f.write("```\n")
for line in output["text"]:
f.write(line)
f.write("\n```\n")
if( "d... |
"""
ASGI config for AIC21_Backend 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... |
import mongodb_setup as dbConnection
import TweetModel as TweetModel
# from watchdir import watch
from ImportText import collectTxt
class main():
try:
dbConnection
collectTxt()
# watch()
except KeyboardInterrupt:
print("Interrupted Main")
exit(0) |
##
# @file
# This file is part of SeisSol.
#
# @author Carsten Uphoff (c.uphoff AT tum.de, http://www5.in.tum.de/wiki/index.php/Carsten_Uphoff,_M.Sc.)
#
# @section LICENSE
# Copyright (c) 2015-2018, SeisSol Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificatio... |
# 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)
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import sp... |
import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... |
# Copyright 2017 The TensorFlow 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 applica... |
"""users table
Revision ID: 4b83761bf52a
Revises: 0d3bdf63aacc
Create Date: 2029-12-29 17:17:20.500426
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4b83761bf52a'
down_revision = '0d3bdf63aacc'
branch_labels = None
depends_on = None
def upgrade():
# ### ... |
# 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.package import *
class Dpdk(MakefilePackage):
"""DPDK is a set of libraries and drivers for fast packet p... |
# -*- coding: utf-8 -*-
# pylint: disable=expression-not-assigned,line-too-long
SPDX_2_2_DCI_TV = {
"SPDXVersion": "SPDX-2.2",
"DataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"DocumentName": "$_SINGLE_LINE",
"DocumentNamespace": "$_URI_MINUS_PART",
"[ExternalDocumentRef]": [
"Do... |
# 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... |
from adlmagics.adlmagics_main import AdlMagics
def load_ipython_extension(ipython):
ipython.register_magics(AdlMagics) |
#!/usr/bin/env python
from rabbitmq import RabbitMQ, Consumer, Publisher
import time
import json
import pika
import random
import threading
import sys
from datetime import datetime
from tinydb import TinyDB, Query
QUEUE_URL = '152.118.148.103'
QUEUE_PORT = '5672'
USERNAME = '1306398983'
PASSWORD = '446167'
VHOST = '13... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
# Copyright 2019 Extreme Networks, 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 i... |
# Copyright 2016 The Kubernetes 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 agreed to ... |
import sys
import os
import re
import base64
import argparse
from collections import OrderedDict
# Common Code #
def parse_tree_string(parsetree, indent=None, b64_source=True, indent_level=0, debug=False):
indent_str = (' ' * indent * indent_level) if indent else ''
if isinstance(parsetree, ParseTree):
... |
import logging
from logging import getLogger, StreamHandler, INFO
import json
import os
import tensorflow as tf
import grpc
from pkg.apis.manager.v1beta1.python import api_pb2
from pkg.apis.manager.v1beta1.python import api_pb2_grpc
from pkg.suggestion.v1beta1.nas.enas.Controller import Controller
from pkg.suggestion.... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import pickle
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Layer
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
# import paramet... |
from django.apps import AppConfig
class CvgalleryConfig(AppConfig):
name = 'CVgallery' |
"""
A simple kivy wrapper
"""
import kivy
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
"""
A really simple discrete env... |
import re
from collections import defaultdict
from openpyxl import load_workbook
class TargetScanDB :
def __init__(self):
self.elems = []
self.gene2mirnas = defaultdict(list)
def make_dictionary(self):
for elem in self.elems:
self.gene2mirnas[elem[0]].append(elem)
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
import tempfile
import zipfile
from threading import Lock, Thread
from typing import Text, List
import six
import time
from buil... |
"""Tests for the namedtuple implementation in collections_overlay.py."""
import textwrap
from pytype import file_utils
from pytype.overlays import collections_overlay
from pytype.pytd import escape
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class NamedtupleTests(test_base.TargetIndependen... |
import numpy as np
import neurokit2 as nk
def test_hrv_time():
ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
_, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1... |
# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Bazel macros for running lit tests."""
load(":lit_test.bzl", "lit_test", "lit_test_suite")
def ir... |
from people.models import Village, Mother, Driver, HealthCenter, MotherDriverConnection
from django.http import JsonResponse, Http404
from django.core import serializers
from decouple import config
from .geokdbush.geokdbush import around, distance
import requests
import json
import time
FRONTLINE_KEY = config('FRONTLI... |
import argparse
import os
import tempfile
from getpass import getuser
import skein
from skein.tornado import SimpleAuthMixin, KerberosAuthMixin, init_kerberos
from tornado import web, ioloop
# An argument parser for configuring the application
parser = argparse.ArgumentParser(
description="A web service for subm... |
from web3 import Web3
from brownie import Contract
from brownie.convert import to_bytes
from brownie.network import accounts
from brownie.network.account import Account
from brownie import (
Wei,
Contract,
# Registry,
# RegistryController,
License,
LicenseController,
Policy,
PolicyCon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.