text stringlengths 2 999k |
|---|
import unittest
from bst import BST, Node
from .test_bst_base import TestBSTBase
class TestBSTInsert(TestBSTBase):
def test_null(self):
result = self.subject.insert(100)
self.assertIsNotNone(self.subject.root)
self.assertEqual(self.subject.root, result)
def test_duplicate_at_root(sel... |
from ufo2ft.filters.transformations import TransformationsFilter, log
from fontTools.misc.loggingTools import CapturingLogHandler
from math import isclose
import pytest
@pytest.fixture(
params=[
{
"capHeight": 700,
"xHeight": 500,
"glyphs": [
{"name": "s... |
import asyncio
import logging
import time
from asyncio import Future
from typing import Callable, List, Optional, Set, Tuple
from confluent_kafka import KafkaError, KafkaException, Message, Producer
from loguru import logger
from eventbus import config
from eventbus.config import ProducerConfig, UseProducersConfig
fr... |
import string
def build_shift_dict(shift):
mapping = {}
alphabet = string.ascii_lowercase + string.ascii_lowercase[: shift]
for i in range(len(alphabet)):
try:
mapping.update({ alphabet[i]: alphabet[i + shift] })
except IndexError:
break
mapping.update(dict... |
# Copyright (c) 2020 HOOMD-TF Developers
import tensorflow as tf
import os
import pickle
from pkg_resources import parse_version
class SimModel(tf.keras.Model):
R'''
SimModel is the main way that HOOMD-TF interacts with a simulation.
'''
def __init__(
self, nneighbor_cutoff, output_forces... |
import torch
import torch.nn as nn
import math, random, sys
import argparse
from jtvae import Vocab, JTNNVAE
import rdkit
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)
parser = argparse.ArgumentParser()
parser.add_argument('--nsample', type=int, required=True)
parser.add_argument('--vocab', requ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Shigeki Karita
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Decoder definition."""
import logging
from typing import Any
from typing import List
from typing import Tuple
import torch
from espnet.nets.pytorch_backend.nets_utils impor... |
"""
Write a Python program to get the maximum and minimum value in a dictionary.
"""
my_dict = {'x':500, 'y':5874, 'z': 560}
key_max = max(my_dict.keys(), key=(lambda k: my_dict[k]))
key_min = min(my_dict.keys(), key=(lambda k: my_dict[k]))
print('Maximum Value: ',my_dict[key_max])
print('Minimum Value: ',my_dict[key... |
import os
import mlp.config as cfg
import mlp.viewer.display_tools as display_tools
# export at 25 fps
dt_display = 0.04
def export(q_t, v):
path = cfg.EXPORT_PATH + "/blender"
if not os.path.exists(path):
os.makedirs(path)
filename = path + "/" + cfg.DEMO_NAME + ".yaml"
print ("Export motion... |
# coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.30
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ctm... |
#
##############################################
# #
# Ferdinand 0.40, Ian Thompson, LLNL #
# #
# gnd,endf,fresco,azure,eda,amur,rac,hyrma #
# #
###############################... |
import json
import requests
import flask
from kafka import KafkaConsumer
from time import sleep
KAFKA_BROKER = 'ec2-35-162-75-2.us-west-2.compute.amazonaws.com'
KAFKA_PORT = '9092'
def api_request(json_info, ip_address, port):
url = 'http://' + ip_address + ":" + port + "/inceptionV3/" + json_info["job_type"]
... |
# Generated by Django 2.2.2 on 2019-06-12 13:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... |
from __future__ import unicode_literals
from django import forms
from django.template import Library, Node, Variable
register = Library()
class StylingNode(Node):
def __init__(self, form_name, *args, **kwargs):
self.form_name = form_name
def render(self, context):
form = Variable(self.form_... |
from io import StringIO
from unittest.mock import patch
from django.core.management import call_command
from django.test import SimpleTestCase
@patch('scraper.management.commands.runscraper.CrawlTaskHandler.run_spider')
@patch(
'scraper.management.commands.runscraper.CrawlTaskHandler.__init__',
retur... |
#!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 withou... |
import copy
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from util import get_mask, tensor_right_shift
from components import Hyp, PointerNet
class Seq2Seq(nn.Module):
def __init__(self, encoder, decoder, decoder_hidden_dim, rule_num, rule_embed_dim,
node_nu... |
import logging
from ssc2ce.common import L2Book
class BitfinexL2Book(L2Book):
change_id = None
timestamp = None
logger = logging.getLogger(__name__)
def __init__(self, instrument: str):
"""
:param instrument:
"""
L2Book.__init__(self, instrument)
def handle_snaps... |
from math import ceil, log
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init, ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool
import numpy as np
import cv2
import math
from mmdet.core import multi_apply, multiclass_nms, distance2bbox, force_fp32
from... |
import os
def setup_plutoserver():
mydir = os.path.dirname(os.path.realpath(__file__))
iconpath = os.path.join(mydir, 'icons', 'pluto-logo.svg')
return {
"command": ["julia", "--optimize=0", "-e", "import Pluto; Pluto.run(host=\"0.0.0.0\", port={port}, launch_browser=false, require_secret_for_open_links=fals... |
"""
mpiece.lexer
~~~~~~~~~~~~~~~
Lexer classes.
:license: BSD, see LICENSE for details.
:author: David Casado Martinez <dcasadomartinez@gmail.com>
"""
import re
class Token:
""" The token save info about markdown grammar.
They are used in the parse function in lexer class.
:param str render_func:
Ren... |
from datetime import datetime, timezone
from unittest import TestCase
from isoduration.types import DateDuration, Decimal, Duration, TimeDuration
from env_var import env
from .helpers import VAR_NAME, check_validators
class TestDates(TestCase):
def test_iso_date(self):
valid_values = (
(
... |
# Copyright The OpenTelemetry 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 in ... |
#http://mastertheboss.com/jboss-server/jboss-script/manage-jboss-as-7-with-jython
from java.util import Date
from org.jboss.as.cli.scriptsupport import CLI
cli = CLI.newInstance()
cli.connect()
cli.cmd("cd /subsystem=naming")
result = cli.cmd(":jndi-view")
response = result.getResponse()
print
print 'JNDI VIEW========... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from uuid import UUID
import httpretty
import pytest
import six
from dateutil import parser
import durga
from durga.element import Element
str = six.string_types[0]
class MusicBrainzResource(durga.Resource):
base_url = 'http://musicbrainz.org/ws/... |
#!/usr/bin/env python
# Copyright 2018 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 require... |
import yaml
import logging
logging.basicConfig(
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO,
datefmt='%Y-%m-%dT%H:%M:%S')
class WorkloadConfigParser:
def __init__(self, job_config_file_location):
self._job_config = yaml.load(job_config_file_location, Loader=yaml.FullL... |
from django.views.generic.base import TemplateView
class MochaView(TemplateView):
template_name = 'mocha/base.html'
urlname = 'mocha_view'
def dispatch(self, request, *args, **kwargs):
config = kwargs.get('config', None)
if config:
self.template_name = '{}/spec/{}/mocha.html'.... |
#!/usr/bin/python
# Copyright (c) 2011 The Chromium OS 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 cros_portage_upgrade.py."""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpa... |
#!C:\Users\Richard\PycharmProjects\PacMan\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.5'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.py... |
# Template Matching Example - Normalized Cross Correlation (NCC)
#
# This example shows off how to use the NCC feature of your OpenMV Cam to match
# image patches to parts of an image... expect for extremely controlled enviorments
# NCC is not all to useful.
#
# WARNING: NCC supports needs to be reworked! As of right n... |
# Copyright 2017 reinforce.io. 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... |
# Copyright 2020 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# encoding: utf-8? whatever allows for currency symbols
# Author: Syris Norelli, snore001@ucr.edu
# Last Updated: July 2018
### TODO:
### Implement better fault tolerance for "NoSuchElementException"
### Implement "market disruption" indication based on distribution of prices
### Implement predictions of profit based... |
from typing import Callable, Dict, Optional, Set, Tuple
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from zerver.lib.name_restrictions import is_disposable_domain
# TODO: Move DisposableEmailError, etc. into here.
from zerver.... |
#!/usr/bin/env pytest
""" Tests for tweeter.py. """
# Imports - Python Standard Library
from types import GeneratorType
from typing import List
from unittest.mock import MagicMock, patch
# Imports - Third-Party
from tweepy.api import API
import tweepy
# Imports - Local
from app.tweeter.tweeter import (
twitter_a... |
# Generated by Django 3.0.3 on 2020-02-18 21:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0099_powerfeed_negative_voltage'),
]
operations = [
migrations.AlterField(
model_name='region',
name='level'... |
import json
from tqdm import tqdm
import spacy
import argparse
import os
from joblib import Parallel, delayed
import logging
import sys
def set_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.INFO)
fo... |
from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/1618.c')
procedure('kernel_heat_3d')
loop(0)
tile(0,2,16,2)
tile(0,4,16,4)
tile(0,... |
import numpy as np
import torch
from mmcv.cnn import ConvModule, normal_init
from mmcv.runner import BaseModule
from torch import nn as nn
from mmdet3d.core.bbox.structures import (LiDARInstance3DBoxes,
rotation_3d_in_axis, xywhr2xyxyr)
from mmdet3d.models.builder import build... |
from django.db import models
from django.conf import settings
SECTIONS = settings.SECTIONS
STATES = (
('allocated', 'alokované'),
('borrowed', 'požičané'),
('stored', 'odložené'),
('payed', 'zaplatené'),
('archived', 'archivované'),
)
class TransactionType(models.Model):
section = models.Cha... |
import time
def get_current_time_milliseconds() -> float:
"""Timeouts will be handled in milliseconds.
This method will return the time elapsed since
the CPU recieved power in nanoseconds, and thus
is only useful for measuring relative time intervals,
it is not adjusted for the absolute time.
... |
#!/usr/bin/env python 3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Baidu.com, Inc. All Rights Reserved
#
"""
brief
Authors: panxu(panxu@baidu.com)
Date: 2020/05/15 10:50:00
""" |
# 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 ... |
# 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 os
import os.path as osp
from typing import List
HEADER = 'Copyright (c) OpenTAI. All rights reserved.\n'
HEADER_KEYWORDS = {'Copyright', 'License'}
def has_copyright(lines: List[str]) -> bool:
for line in lines:
if not HEADER_KEYWORDS.isdisjoint(set(line.split(' '))):
... |
import numpy as np
import sys
import os
import matplotlib.pyplot as plt
sys.path.insert(0, '../pyorbit/')
import pyorbit.classes.kepler_exo as kp
import pyorbit.classes.constants as constants
"""
Initial realization of the parameters
np.random.seed(12345678)
planet_b = {
'P': np.random.uniform(6,9),
'K': ... |
# 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 ... |
#========================================================================================
# File: app_settings.py
# Author: Tam Ngo/JSC
# Date: 2012-02-22
# Modification History:
# Date | Author | Description
# ---------------------------
# 06/29/16 | Jose F Martinez | Modified to be used to generate cosmo... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python3
import os
import sys
def main():
"""
main
:return: 0
"""
destination = ".\\dl\\"
f_in = ".\\link.txt"
if str(os.path.exists(destination)) == "False":
os.mkdir(destination)
if len(sys.argv) >= 2:
os.system(f"cd {destinat... |
###########################################################################################
# #
# Set up paths for the Object Detection Metrics #
# ... |
__author__ = "jacksonsr45@gmail.com"
new_forest_orcs = {
'1': {
'name': 'little_forest_orcs',
'life': {
},
'recharge_time': {
},
'attack': {
},
'defense': {
},
'speed_attack': {
},
'move_speed': {
},
... |
"""Implementation of Valve learning layer 2/3 switch."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# L... |
import os
import sys
import requests
from tqdm import tqdm
if len(sys.argv) != 2:
print(
'You must enter the model name as a parameter, e.g.: download_model.py 124M')
sys.exit(1)
model = sys.argv[1]
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
subdir =... |
import torch.nn as nn
import torchvision
import math
import matplotlib.pyplot as plt
class Flatten(nn.Module):
def forward(self, x):
return x.view(len(x), -1)
def plot(tensor, n_adv=100, nrow=None, scale_noise=1, save=None, fig=None):
if nrow is None:
nrow = int(math.sqrt(n_adv))
img = ... |
from setuptools import setup, Extension
from Cython.Build import cythonize
ext_mods = [
Extension('pyaes._aes_base', ['pyaes/_aes_base.pyx']),
Extension('pyaes._mode_base', ['pyaes/_mode_base.pyx'])
]
setup(
name='pyaes',
version='2.0.0.dev0',
python_requires='>=3.5',
packages=['pyaes', 'pyaes... |
number = "2.0.0"
|
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
# Written by: wyattwismer
n = int(raw_input())
h,mn = 0,0
for c in raw_input():
h += 1 if c=='+' else -1
mn = min(mn,h)
print -mn + h
|
# import pytest
# from code_challenges.queue_with_stacks.queue_with_stacks.queue_with_stacks import Pseudo_Queue
# from code_challenges.stacks_and_queues.stacks_and_queues.stacks_and_queues import EmptyQueueException
# def test_Pseudo_Queue_enqueue_for_empty():
# expected = "[5]"
# queue = Pseudo_Queue()
# ... |
# -*- coding: utf-8 -*-
"""hardware control backend for hifipower.
Can be used with Orange Pi (the original device is based on OPi Plus,
as it has gigabit Ethernet port and SATA controller),
or a regular Raspberry Pi"""
import atexit
import os
import time
try:
# use SUNXI as it gives the most predictable results
... |
# Copyright 2019 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... |
def square_sum(numbers):
# #1
# sum = 0
# for x in numbers:
# sum += x * x
# return sum
# #2
return sum(x ** 2 for x in numbers)
|
# -*- coding: utf-8 -*-
"""
Tests for pyTibber
"""
import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../")))
import aiohttp # noqa: E402
import tibber # noqa: E402
@pytest.mark.asyncio
async def test_tibber_no_session():
tibber_connection = tibber.T... |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import time
import tables
tref = time.time()
trel = tref
def show_mem(explain):
global tref, trel
filename = "/proc/%s/status" % os.getpid()
with open(filename) as fd:
for line in fd:
if line.... |
#!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... |
# coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import absolute_import
import sys
import unittest
im... |
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParap... |
"""Base AutoML class."""
import logging
from typing import Sequence, Any, Optional, Iterable, Dict, List
from .blend import Blender, BestModelSelector
from ..dataset.base import LAMLDataset
from ..dataset.utils import concatenate
from ..pipelines.ml.base import MLPipeline
from ..reader.base import Reader
from ..util... |
"""
HaloCatalog-specific fields
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------... |
import math
import torch
import os
import time
import logging
import json
from exp.sufficient_update.run_manager import *
from utils.common import set_manual_seed
from utils.common import AverageMeter
from utils.common import get_monitor_metric
from utils.logger import save_checkpoint, time_string
from uti... |
import socket
import select
from msvcrt import kbhit, getch # type: ignore
import logging
from qcodes.instrument_drivers.QuantumDesign.\
DynaCoolPPMS.private.commandhandler import CommandHandler
command_handler = CommandHandler()
log = logging.getLogger(__name__)
RECEIVE_BUFFER_SIZE = 4096
PORT = 5000
ADDRESS ... |
from .activity import get_activity
from .upload import post_upload, get_upload
from .athlete import get_activities, get_stats, get_athlete
|
# Configuration file for ipython-qtconsole.
c = get_config()
#------------------------------------------------------------------------------
# IPythonQtConsoleApp configuration
#------------------------------------------------------------------------------
# IPythonQtConsoleApp will inherit config from: BaseIPythonA... |
#!/usr/bin/env python3
# This script runs fio benchmark test on the local nvme device using the SPDK NVMe driver.
# Prework: Run script/setup.sh to bind SSDs to SPDK driver.
# Prework: Change any fio configurations in the template fio config file fio_test.conf
# Output: A csv file <hostname>_<num ssds>_perf_output.csv... |
# -*- coding: utf-8 -*-
import guzzle_sphinx_theme
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.ab... |
# Lint as: python3
# Copyright 2021 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 ... |
# Generated by Django 3.0.7 on 2020-12-08 02:13
import bookwyrm.models.fields
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("bo... |
from requests import get
from urllib.parse import urlencode
from datetime import timedelta
import os
import redis
import json
import sys
def redis_connect() -> redis.client.Redis:
try:
client = redis.Redis(
host=os.getenv('HOST'),
port=6379,
db=0,
socket_ti... |
#!/usr/bin/python
# coding: utf-8
# ---------------------------------------------------------------------------------------------------------------------
#
# Florida International University
#
# This software is a "Camilo Valdes Work" under the terms of the United States Copyrig... |
import base64
import io
import sys
if sys.version_info[0] < 3:
text_type = unicode # noqa: F821
StringIO = io.BytesIO
def native(s, encoding="utf-8"):
if isinstance(s, unicode): # noqa: F821
return s.encode(encoding)
return s
else:
text_type = str
StringIO = io.S... |
import argparse
from model import InvoiceNetCloudScan
from extract_features import extract_features
ap = argparse.ArgumentParser()
ap.add_argument("--mode", type=str, choices=["train", "test"],
required=True, help="train|test")
ap.add_argument("--data", default="data/dftrain.pk",
help... |
# Copyright 2019 U.C. Berkeley RISE Lab
#
# 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 agree... |
#### 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 = Tangible()
result.template = "object/tangible/hair/human/shared_hair_human_female_s24.iff"
result.attribute_templ... |
# Generated by Django 2.2.4 on 2020-05-31 06:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('faceapp', '0022_attendancelogs_subject'),
]
operations = [
migrations.AddField(
model_name='att... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("TestRPCdigi")
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.loa... |
#! /usr/bin/env python
"""Static analysis tool for checking docstring conventions and style.
Implemented checks cover PEP257:
http://www.python.org/dev/peps/pep-0257/
Other checks can be added, e.g. NumPy docstring conventions:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
The repository is l... |
from pythonforandroid.recipe import CythonRecipe
class XevanHashRecipe(CythonRecipe):
url = 'https://files.pythonhosted.org/packages/e3/a9/6e74bab6b3bc97e5f68f8c1fbc9a4e4ad1617ba167fa004511b1f9288c64/xevan_hash-0.2.3.tar.gz'
md5sum = 'ff2b5a650fbcd718109137da372c99aa'
version = '0.2.3'
depends = ['py... |
# modified from utils/models/segmentation/erfnet.py
# load pretrained weights during initialization of encoder
import torch
import torch.nn as nn
import torch.nn.functional as F
from .common_models import non_bottleneck_1d
from .builder import MODELS
class DownsamplerBlock(nn.Module):
def __init__(self, ninput,... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 require... |
# select.py
from django.conf import settings
from pyensemble.models import Stimulus
import os, random
import pdb
def select_audio(request,*args,**kwargs):
name = kwargs.get('name',None)
playlist = kwargs.get('playlist',None)
use_jspsych = kwargs.get('use_jspsych', True)
stimulus = None
timeline ... |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... |
def LOP(string):
"""finds the longest odd length palindrome within a given string"""
def reflection(pivot, point):
"""given position of two characters pivot and point in a string, finds
the position of a character as far from pivot as point in the opposite
direction; i.e the posit... |
from setuptools import setup
from os import path as os_path
import surf
this_directory = os_path.abspath(os_path.dirname(__file__))
def read_file(filename):
with open(os_path.join(this_directory, filename), encoding='utf-8') as f:
long_description = f.read()
return long_description
def read_requir... |
from django.contrib import admin
from .models import Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Customer, CustomerCheckIn
@admin.register(CustomerCheckIn)
class CustomerCheckInAdmin(admin.ModelAdmin):
list_display = [field.name for field in CustomerCheckIn._meta.get_fields()]
@admin.register... |
import math
import torch
import numpy as np
import random
import time
from collections import deque, namedtuple
from pytorch_drl.utils.memory.segment_tree import SumTree, MinTree
class UniformBuffer:
def __init__(self, size, batch_size,
seed, device, action_type=torch.long):
self.size ... |
import sqlite3 as sql
import os
from flask import Blueprint, render_template, jsonify, request
from flask_login import login_required, current_user
from ..models.models import Case, CaseSchema
from .. import db
ROOT_DIR = os.getcwd()
case_schema = CaseSchema()
cases_schema = CaseSchema(many=True)
case = Blueprint('c... |
from pywinauto.timings import *
|
import pytest
from lenstronomy.Conf import config_loader
def test_numba_conf():
numba_conf = config_loader.numba_conf()
assert 'nopython' in numba_conf
assert 'cache' in numba_conf
assert 'parallel' in numba_conf
assert 'enable' in numba_conf
assert 'fastmath' in numba_conf
assert 'error_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.