text stringlengths 1 927k |
|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# 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
#... |
def print():
pass
print() |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
from molsysmt._private.exceptions import *
from molsysmt._private.digestion import *
from .is_openmm_Topology import is_openmm_Topology
def to_openmm_System(item, atom_indices='all', forcefield=None, parameters=None, check=True):
if check:
try:
is_openmm_Topology(item)
except:
... |
from flask import Flask, render_template, request
from datetime import datetime
from ChartHelper import ChartHelper
from werkzeug.middleware.proxy_fix import ProxyFix
app = Flask(__name__)
#
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_host=1)
@app.route("/")
def index():
return render_template('index.html',... |
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
import os
import json
import time
import logging
from connectors.mongodb.mongohandle import MongoHandle
from twarc import Twarc
logging.basicConfig(level=logging.INFO)
with open('./config/config.json') as data_file:
config = json.load(data_file)
logging.info('Finished parsing config.')
handle = MongoHandle(conf... |
import os
DEBUG_MODE = True
SECRET_KEY = 'secret'
# Database config
DB_USER = 'postgres'
DB_NAME = 'postgres'
DB_PASSWORD = ''
DB_HOST = os.environ.get('POSTGRES_HOST', 'localhost')
DB_PORT = os.environ.get('POSTGRES_PORT', 5432)
# Slack config
SLACK_TOKEN = 'token'
SLACK_API_INVITE_URL = 'https://slack.com/api/user... |
"""
Copyright: MAXON Computer GmbH
Description:
- Enables the snap if it's not already the case.
- Sets it to 3D Type and also to Point mode.
Class/method highlighted:
- c4d.modules.snap
- c4d.modules.snap.IsSnapEnabled()
- c4d.modules.snap.GetSnapSettings()
- c4d.modules.snap.SetSnapSettings(... |
from django.contrib import admin
from django.urls import path
from .views import home, infoDiaEstado
urlpatterns = [
path('', home),
path('info_dia_estado', infoDiaEstado, name="dataInfoDiaEstado"),
] |
from unittest import TestCase
from mock import Mock, call
from cloudshell.cp.aws.domain.services.ec2.vpc import VPCService
from cloudshell.cp.aws.domain.services.waiters.vpc_peering import VpcPeeringConnectionWaiter
class TestVPCService(TestCase):
def setUp(self):
self.tag_service = Mock()
self.... |
from django.apps import apps
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
from wagtail.utils.pagination import paginate
from wagtail... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gokiting.settings')
try:
from django.core.management import execute_from_command_line
except Imp... |
from .SaliencyMap import SaliencyMap
from .DeepDream import DeepDream
from .GradCam import GradCam
from .Weights import Weights
from .Base import Base
from .ClassActivationMapping import ClassActivationMapping |
# 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 u... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# Copyright 2018 ZhangT. All Rights Reserved.
# Author: ZhangT
# Author-Github: github.com/zhangt2333
# config.py 2018/2/10 21:49
# 包含一些通用常量和工具函数
HEADERS = {"Host": "bkjws.sdu.edu.cn",
"Connection": "keep-alive",
"Accept": "*/*",
"Origin":... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "rrbot_description"
PROJECT_SPACE_DIR ... |
# 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 argparse
import pegasusio as pio
import pandas as pd
parser = argparse.ArgumentParser(description='Merge demuxlet result with gene-count matrix.')
parser.add_argument('demux_res', metavar = 'demux_result.best', help = 'Demuxlet demultiplexing results.')
parser.add_argument('raw_mat', metavar = 'raw_feature_bc_... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['MovingAverage'] , ['BestCycle'] , ['AR'] ); |
import math
from enum import IntEnum
import numpy as np
import gym
from gym import spaces
from .random import *
from .opengl import *
from .objmesh import *
from .entity import *
from .math import *
from .params import *
# Default wall height for room
DEFAULT_WALL_HEIGHT=2.74
# Texture size/density in texels/meter
TE... |
from django.contrib import admin
from polls.models import Question, Choice
# Register your models here.
admin.site.register(Question)
admin.site.register(Choice) |
# 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... |
# COUNT CONTAINED PERMUTATIONS
# O(M * U + N) time and O(U) space, where M -> length of big string,
# U -> number of unique characters in small string, N -> length
# of small string.
# U is actually a constant since it can't be greater than 26. and
# M > N, so M will dissolve N
# So, modified complexities:
# O(M) tim... |
from dku_language_model.context_independent_language_model import FasttextModel, Word2vecModel, GloveModel
from dku_language_model.contextual_language_model import ElmoModel |
from getratings.models.ratings import Ratings
class NA_Syndra_Jng_Aatrox(Ratings):
pass
class NA_Syndra_Jng_Ahri(Ratings):
pass
class NA_Syndra_Jng_Akali(Ratings):
pass
class NA_Syndra_Jng_Alistar(Ratings):
pass
class NA_Syndra_Jng_Amumu(Ratings):
pass
class NA_Syndra_Jng_Anivia(Ratings):
pass
class NA_Syn... |
from setuptools import setup, find_packages
setup(
name='backboard',
version='1.0.3',
description='Background noises for your keyboard typing',
long_description=open('README.md').read(),
long_description_content_type="text/markdown",
url='https://github.com/donno2048/BS',
packages=find_packa... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
import pickle
# This is the script which builds a ASP model intended to be solved with clingo.
# This program has been test on Ubuntu 18.04 and CentOS 7.
# Using Clingo 5.3.0 installed via Conda
# Parsing the output of this program will require clyngor-with-clingo which may be installed via pip.
if __name__ == "__main... |
"""
Copyright (c) 2021 TU Darmstadt
Author: Nikita Araslanov <nikita.araslanov@tu-darmstadt.de>
License: Apache License 2.0
"""
import os
import torch
from PIL import Image
import numpy as np
import torchvision.transforms as tf
from .dataloader_base import DLBase
class DataSeg(DLBase):
def __init__(self, cfg... |
import math
import warnings
from itertools import combinations
from typing import TYPE_CHECKING
from typing import Optional
from typing import Sequence
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import statsmodels.api as sm
from matplotlib.ticker import MaxNLocator
from statsmodels.graphi... |
'''
05 - What time did the bike leave? (Global edition)
When you need to move a datetime from one timezone into another, use
.astimezone() and tz. Often you will be moving things into UTC, but for
fun let's try moving things from 'America/New_York' into a few different
time zones.
-----------------------------... |
#!/usr/bin/env python
"""Cluster SNVs based on SNV freqs confidence interval
"""
__author__ = "Andreas Wilm, Niranjan Nagarajan"
__email__ = "wilma@gis.a-star.edu.sg"
__copyright__ = "2013,2014 Genome Institute of Singapore"
__license__ = "The MIT License"
# --- standard library imports
#
import sys
import logging... |
"""
First, we convert the num to its birary.
```
>>> bin(5)
>>> '0b101'
```
Second, we need to return the base10 of binary's the complement.
Complement is easy `'101' => '010'`.
Turn to base10:
```
'010' => 0*pow(2, 2) + 1*pow(2, 1) + 0*pow(2, 0)
'11011' => 1*pow(2, 4) + 1*pow(2, 3) + 0*pow(2, 2) + 1*pow(2, 1) + 1*pow... |
# -*- coding: utf-8 -*-
"""Package info."""
__version__ = '0.1.0'
__title__ = 'jacoren'
__description__ = ''
__author__ = 'Piotr Kuszaj'
__author_email__ = 'peterkuszaj@gmail.com'
__license__ = 'MIT'
__all__ = ('platform', 'cpu', 'memory', 'disks') |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... |
"""SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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 withou... |
"""
.. module:: utils
:synopsis: Miscellaneous helper constructs
.. moduleauthor:: Steven Silvester <steven.silvester@ieee.org>
"""
import os
import inspect
import dis
import tempfile
import sys
from .compat import PY2
def _remove_temp_files(dirname):
"""
Remove the created mat files in the user's temp f... |
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('', include('posts.urls', namespace='post')),
path('admin/', admin.site.urls),
] |
def lerp(value1, value2, factor):
return value1+(value2-value1)*factor
print(lerp(100, 200, 0.))
print(lerp(100, 200, 1.))
print(lerp(100, 200, .5))
print(lerp(100, 200, .25)) |
import logging
import time
from abc import ABC
from abc import abstractmethod
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Type
from typing import Union
from typing_extensions import Protocol
from paasta_tools.utils import load_system_paasta... |
import tensorflow as tf
from keras.activations import relu
from keras.initializers import VarianceScaling
from keras.layers import Dense, Conv2D, Flatten
from keras.losses import logcosh
class DDQN:
""" Implements a Dueling Dual Deep Q-Network based on the frames of the Retro Environment """
def __init__(sel... |
# -*- coding: utf-8 -*-
# :Project: pglast -- DO NOT EDIT: automatically extracted from pg_class.h @ 13-2.0.6-0-ga248206
# :Author: Lele Gaifax <lele@metapensiero.it>
# :License: GNU General Public License version 3 or later
# :Copyright: © 2017-2021 Lele Gaifax
#
from enum import Enum, IntEnum, IntFlag, auto
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
def _create_activation(activation_type):
if activation_type == 'relu':
return torch.relu
elif activation_type == 'swish':
return lambda x: x * torch.sigmoid(x)
raise ValueError('invalid activation_type.')
def create_encod... |
import xbmc
import xbmcgui
import sys
import urllib
import utils
from stream_api import app_state
class Updater(object):
installed = False
percent = 0
title1 = ""
def update(self, app):
if app["state"] == 0 or app["state"] == 2 or app["state"] == 258 or app["state"] == 1282 or app["state"] ... |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Unit tests for git_cl.py."""
import contextlib
import datetime
import json
import logging
import os
import StringIO
import sys
... |
# coding: UTF-8
import argparse
import logging
import random
import torch
import copy
import numpy as np
from dataset import CDTB
from collections import Counter
from itertools import chain
from structure.vocab import Vocab, Label
from structure.nodes import node_type_filter, EDU, Relation, Sentence, TEXT
from treebuil... |
from __future__ import with_statement
import logging
from logging.config import fileConfig
from alembic import context
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
from flask import current_app
from sqlalchemy import engine_... |
#!/usr/bin/env python2
# BSD 3-Clause License -> see /LICENSE
# Copyright (c) 2017-2020 by Ben de Waal, All rights reserved.
#
import sys
from v1.interfaces import *
# blacklist.py [del|delete|remove] [number]
PRIMARY = "blacklist"
SECONDARY = "whitelist"
REMOVE = (len(sys.argv) > 2) and sys.argv[1] in ["del","delet... |
from setuptools import setup, find_packages
from codecs import open
import os
from netlib import version
# Based on https://github.com/pypa/sampleproject/blob/master/setup.py
# and https://python-packaging-user-guide.readthedocs.org/
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'RE... |
"""Support for Fibaro binary sensors."""
import logging
from homeassistant.components.binary_sensor import (
ENTITY_ID_FORMAT, BinarySensorDevice)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_ICON
from . import FIBARO_DEVICES, FibaroDevice
DEPENDENCIES = ['fibaro']
_LOGGER = logging.getLogger(__name_... |
import os
from setuptools import setup, find_packages
setup(name='no_mp',
version = '0.1.dev0',
description="No Mp Test Fixture",
author="Martijn Faassen",
author_email="faassen@startifact.com",
license="BSD",
packages=find_packages(),
zip_safe=False,
install_requires=[
... |
"""
Generic GeoRSS events service.
Retrieves current events (typically incidents or alerts) in GeoRSS format, and
shows information on events filtered by distance to the HA instance's location
and grouped by category.
For more details about this platform, please refer to the documentation at
https://home-assistant.io... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2021/9/12 18:29
Desc: 巨潮资讯-数据中心-评级预测-投资评级
http://webapi.cninfo.com.cn/#/thematicStatistics?name=%E6%8A%95%E8%B5%84%E8%AF%84%E7%BA%A7
"""
import time
from py_mini_racer import py_mini_racer
import requests
import pandas as pd
js_str = """
function mcode(input) ... |
# Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
from coremltools.converters.mil.mil.passes.pass_registry import register_pass
fro... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... |
# %% [markdown]
# # Imports
import json
import os
import warnings
from operator import itemgetter
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from joblib.parallel import Parallel, delayed
from sklearn.metrics... |
import copy
def filterRemaining(remaining, environment):
returned = copy.copy(remaining)
for i in range(len(returned)-1, -1, -1):
r = returned[i]
if any(not(r[e]==environment[e]) for e in environment if e in r):
del returned[i]
else:
runs = copy.copy(r['runs'])
... |
import os
import numpy as np
from sklearn.model_selection import train_test_split
import cv2
class DataHandler(object):
def _load_data(im_fnames, add_channel_dim=True):
im0 = cv2.imread(im_fnames[0], 0)
im_batch = np.zeros((len(im_fnames),) + im0.shape)
im_batch[0] = im0
for i, fn... |
"""
Module with the base class and supporting functions for all annotators.
Any callable that can be called by passing a document can be used as an annotator,
but the base class "Annotator" defined in here is designed to allow for a more
flexible approach to do things.
"""
from abc import ABC, abstractmethod
__pdoc__ ... |
import functools
import queue
import random
import time
from concurrent.futures import ThreadPoolExecutor
from itertools import repeat
from log import logger
shut_down_pool_queue = queue.Queue()
# sys_thread_pool = ThreadPoolExecutor(max_workers=2)
def shutdown_listener():
for _ in repeat(None):
t_poo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-22 09:20
from __future__ import unicode_literals
import api.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0102_auto_20170121_2038'),
]
operations = [
migration... |
# -*- coding: UTF-8 -*-
'''
Created on 2020-03-08
@author: daizhaolin
'''
from .config import Config
from .helper import cached_property
from .logging import create_logger
class ScriptEngine(object):
def __init__(self):
self.name = __name__
self.config = Config({
'DEBUG': False
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms, datasets
import logging
import argparse
import sys
import asyncio
import numpy as np
import syft as sy
from syft import workers
from syft.frameworks.torch.federated import utils
logger = logging.getLogger(__name__)... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
spyder.plugins.layout
=====================
Layout plugin.
"""
from spyder.plugins.layout.plugin import Layout
# The following statement is required to be able... |
from qtpy.QtCore import QPointF
from nezzle.utils import TriggerDict
class BaseArrow(object):
ITEM_TYPE = 'BASE_HEAD'
DEFAULT_OFFSET = 4
def __init__(self, width, height, offset):
self._attr = TriggerDict()
self._attr['ITEM_TYPE'] = self.ITEM_TYPE
self._offset = offset
... |
# Copyright 2012 OpenStack Foundation
# 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 requ... |
#!/usr/bin/env python3.6
from passlock import User, Credentials
def function():
print(" ____ _____ _ ")
print(" | _ \ / ____|| | ")
print(" | |_) ) ____ ___ ___ /... |
from panda3d.core import *
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
from direct.gui import DirectLabel
from toontown.quest import Quests
class NPCForceAcknowledge:
def __init__(self, doneEvent):
self.doneEvent = doneEvent
self.dialog = None
return... |
from xml.dom import Node
from htmltreediff.util import (
get_child,
get_location,
remove_node,
insert_or_append,
)
class EditScriptRunner(object):
def __init__(self, dom, edit_script):
self.dom = dom
self.edit_script = edit_script
self.del_nodes = []
self.ins_nodes... |
# -*- coding: utf-8 -*-
'''
Episode 7-3
'''
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
sys.path.append('storybuilder')
from storybuilder.builder.world import World
# DEFINE
TITLE = "英雄の帰還"
# NOTE: outlines
ABSTRACT = """
変身して$sherlockたちを追い詰める$jake。しかし$sherlockの機転で工場に穴を開け、... |
# Copyright 2011 Jamie Norrish (jamie@artefact.org.nz)
#
# 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... |
"""
This is the script that is executed on the compute instance. It relies
on the model.pkl file which is uploaded along with this script to the
compute instance.
"""
import argparse
from azureml.core import Dataset, Run
from azureml.automl.core.shared.constants import TimeSeriesInternal
from sklearn.externals import ... |
import pandas as pd
import argparse
import logging
import sys
import json
def get_best_logger(log_file, verbose):
# Setup logger - (Python logger breaks PEP8 by default)
logger = logging.getLogger(__name__)
if verbose:
logger.setLevel('DEBUG')
# file_handler logs to file, stream_handler to con... |
import os
import traceback
import base64
import datetime
import logging
from xml.etree.ElementTree import XML
from signxml import xmldsig
__all__ = ['AuthenticationError', 'parse_saml']
def decode_response(resp):
return base64.b64decode(resp.encode('utf8'))
# Getters
def get_xmldoc(xmlstring):
return XM... |
"""Spike sorting classes and window"""
from __future__ import division
from __future__ import print_function
__authors__ = ['Martin Spacek', 'Reza Lotun']
import os
import sys
import time
import datetime
from copy import copy
import operator
import random
import shutil
import hashlib
import multiprocessing as mp
fr... |
import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class MyBot(sc2.BotAI):
async def on_step(self, iteration):
for structure in self.structures:
self._client.debug_text_world(
"\n".join([
f"{structure.type_id.name... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 13:41:14 2019
@author: Emmett & Binyang
"""
from pprint import pprint
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer
##Let’s first build a corpus to tra... |
"""empty message
Revision ID: 0076_add_intl_flag_to_provider
Revises: 0075_create_rates_table
Create Date: 2017-04-25 09:44:13.194164
"""
# revision identifiers, used by Alembic.
revision = "0076_add_intl_flag_to_provider"
down_revision = "0075_create_rates_table"
import sqlalchemy as sa
from alembic import op
de... |
"""Whale Alert view"""
__docformat__ = "numpy"
import logging
import os
from openbb_terminal.cryptocurrency.onchain import whale_alert_model
from openbb_terminal.decorators import check_api_key
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
lambda_... |
'''
Copyright 2019 The Microsoft DeepSpeed Team
'''
import os
import stat
import torch
import warnings
import hashlib
import torch.distributed as dist
from collections import OrderedDict
from shutil import copyfile
from torch.nn.modules import Module
from torch.distributed.distributed_c10d import _get_global_rank
fro... |
import numpy as np
import statsrecorder as sr
rs = np.random.RandomState(323)
mystats = sr.StatsRecorder()
# Hold all observations in "data" to check for correctness.
ndims = 42
data = np.empty((0, ndims))
for i in range(1000):
nobserv = rs.randint(10,101)
newdata = rs.randn(nobserv, ndims)
data = np.vs... |
import numpy as np
from PyQt5 import QtCore, QtGui, QtWidgets
from sscanss.config import path_for, settings
from sscanss.core.math import Plane, Matrix33, Vector3, clamp, map_range, trunc, VECTOR_EPS
from sscanss.core.geometry import mesh_plane_intersection
from sscanss.core.util import Primitives, DockFlag, StrainComp... |
from asyncio import AbstractEventLoop, Task, get_event_loop
from dataclasses import asdict
from datetime import datetime
from functools import wraps
from typing import Callable, Optional, Tuple
from quart import Quart, request
from werkzeug.exceptions import HTTPException
from .config import config
from .logger impor... |
import logging
from cleo.config import ApplicationConfig as BaseApplicationConfig
from clikit.api.event import PRE_HANDLE
from clikit.api.event import PreHandleEvent
from clikit.api.formatter import Style
from clikit.api.io import Input
from clikit.api.io import InputStream
from clikit.api.io import Output
from clikit... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# thanks to penn5 for bug fixing
""" Userbot initialization. """
import os
from sys import version_info
from logging ... |
# 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 u... |
import os.path
import speech_recognition as sr
import moviepy.editor as mp
from pydub import AudioSegment
from pydub.utils import make_chunks
import time
import glob
import re
import math
from pathlib import Path
import soundfile as sf
lang = input("Please choose the language for voice recognition by language code. (d... |
import math
from particle import Particle
#from glfunctions import draw_sprite
from code.constants.common import GOLD_SPINNER_LIFESPAN, TILE_WIDTH, TILE_HEIGHT
from code.controllers.intervalcontroller import IntervalController
class GoldSpinner(Particle):
def __init__(self, x, y, dest_x, dest_y):
Par... |
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2019 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.plugins i... |
# coding: utf-8
# 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... |
# 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 argparse
import os
import shutil
import sys
import textwrap
import llnl.util.filesystem as fs
import llnl.util.tty... |
from unittest import TestCase
import importlib
import ast
import json
import logging
from ConfigParser import ConfigParser
from io import StringIO
from mock import patch
#ignore pycountry debug logging
quiet = logging.getLogger('pycountry.db')
quiet.setLevel(logging.ERROR)
class TestMake_solr_document(TestCase):
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class BatchNormalization(Base):
@staticmethod
def export(): # typ... |
import cmakepybind11
from cmakepybind11.foo import pyFoo
from cmakepybind11.bar import pyBar
from cmakepybind11.foobar import pyFooBar
print(f'version: {cmakepybind11.__version__}')
# foo
print(f'Foo: {dir(pyFoo.Foo)}')
pyFoo.free_function(2147483647) # max int
pyFoo.free_function(2147483647+1) # max int + 1
f = py... |
import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... |
import requests
from requests.adapters import HTTPAdapter
def get_requests_session():
"""
Set connection pool maxsize and block value to avoid `connection pool full` warnings.
:return: requests session
"""
session = requests.sessions.Session()
session.mount('http://', HTTPAdapter(pool_connect... |
# Copyright (c) 2015 Pixomondo
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the MIT License included in this
# distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the MIT License. All rights
# not expressly grante... |
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import mmcv
from mmseg.apis import inference_segmentor, init_segmentor
def test_test_time_augmentation_on_cpu():
config_file = 'configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py'
config = mmcv.Config.fromfile(config_file)
# Rem... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.