text stringlengths 2 999k |
|---|
"""
API endpoints for nunaserver.
"""
import tempfile
import os
import uuid
from pathlib import Path
import flask
from minio.commonconfig import Filter, ENABLED
from minio.lifecycleconfig import LifecycleConfig, Expiration, Rule
from nunaserver import settings
from nunaserver.minio_connection import storage
from nunase... |
"""
Forces method classes.
The dynamic model should inherit from these classes in order to get the proper forces.
"""
import opensim as osim
class ResidualForces:
def __init__(self, residual_actuator_xml=None):
if residual_actuator_xml:
res_force_set = osim.ForceSet(residual_actuator_xml, Tru... |
import sys
import os
import re
import importlib
import warnings
is_pypy = '__pypy__' in sys.builtin_module_names
warnings.filterwarnings('ignore',
r'.+ distutils\b.+ deprecated',
DeprecationWarning)
def warn_distutils_present():
if 'distutils' not in sys.modules... |
# -*- coding: utf8 -*-
import json
from console.models import Resource, resource_repo
from console.exceptions import NotFound, AlreadyExist, PermissionDenied
from console.factory import logger
class ResourceService:
resource_repo = resource_repo
def __init__(self, rid: str = None, task_intra_id: str = None... |
########################################################################
import sys
import numpy
import vtk
from vtk_py import *
########################################################################
def transform_mesh_w_4x4mat(infilename, outfilename, matrix):
ugrid = vtk.vtkUnstructuredGrid()
if(infilename[l... |
import pygame, sys
import numpy as np
import subprocess
import time
import json
from timeit import default_timer as timer
# text box initialization
def update_message (message):
font = pygame.font.Font(None, 24)
text = font.render(message, 1, (0, 0, 0))
text_rect = text.get_rect(center =(WIDTH / 2, HEIGHT-50))
scr... |
from ..datasets import CleanData,DownloadData
# from .CleanData import cleanEngXml,cleanMathXml,CleanDataWiki,CleanDataSO
|
from apistar.backends import sqlalchemy_backend
from apistar.frameworks.wsgi import WSGIApp as App
from project.routes import routes
from project.settings import settings
app = App(
routes=routes,
settings=settings,
commands=sqlalchemy_backend.commands,
components=sqlalchemy_backend.components
)
if ... |
# Copyright 2015 PerfKitBenchmarker 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 appli... |
"""
Runs pedal as a toplevel module
"""
import sys
from pedal.command_line.command_line import parse_args, main
args = parse_args()
main(args)
|
# Generated by Django 2.1.15 on 2020-04-21 12:08
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... |
#!/usr/bin/python
################################################################################
# 2301f556-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... |
"""Logic for dealing with cwltool as an optional dependency.
Use this as the import interface for cwltool and just call
:func:`ensure_cwltool_available` before using any of the imported
functionality at runtime.
"""
import re
import warnings
warnings.filterwarnings("ignore", message=r"[\n.]DEPRECATION: Python 2", mod... |
import datetime
from django.db import models
from django.utils import timezone
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_publ... |
from streamlink.plugins.ard_live import ARDLive
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlARDLive(PluginCanHandleUrl):
__plugin__ = ARDLive
should_match = [
'https://daserste.de/live/index.html',
'https://www.daserste.de/live/index.html',
]
should_not_m... |
#!/usr/bin/python3
import sys
import json
import os
import getopt
import ipaddress
import uuid
ip = ''
function = ''
gdc = None
description = ''
listofips = None
if len(sys.argv) <= 4:
print("Error - Format should be - gdc.py -g <Generic_Data_Center_N... |
import pandas as pd
import torch
from transformers import BertJapaneseTokenizer
from wtfml.data_loaders.nlp.utils import clean_sentence
import transformers
class BERTSimpleDataset:
"""
Dataset for bert which can accept clearning function
"""
def __init__(self, input_texts, target, clearning... |
# cec2017.utils
# Author: Duncan Tilley
# Additional functions for graphing and benchmarking
def surface_plot(function, domain=(-100, 100), points=30, dimension=2, ax=None):
"""
Creates a surface plot of a function.
Args:
function (function): The objective function to be called at each point.
... |
#!/usr/bin/env python3
""" Create a new Table of Contents file (toc.xhtml) for The Big Book of Key. """
import re
from argparse import ArgumentParser
from datetime import datetime
from pathlib import Path
from typing import Dict, List
from lxml.html import parse, fromstring, tostring, HtmlElement
from copy import deep... |
# -*- coding: utf-8 -*-
# A Survey on Negative Transfer
# https://github.com/chamwen/NT-Benchmark
import numpy as np
import argparse
import os
import torch as tr
import torch.nn as nn
import torch.optim as optim
from utils import network, loss, utils
from utils.network import calc_coeff
from utils.dataloader import rea... |
#!/bin/python3
'''
This file is to plot a graph with the following setting.
1. We first select an image x_0
2. We then add some pertubation to the image to get x_1 (its type shall
configurable in the future, but we set it to be random or loaded from file
currently)
3. Next, we plot f(x) for all x on the segment... |
# -*-coding:utf-8-*-
import os
from flask import request, render_template, g
from flask_babel import gettext
from flask_wtf.csrf import CSRFError
from werkzeug.utils import redirect
from apps.configs.sys_config import DEFAULT_ADMIN_LOGIN_PAGE
from apps.core.auth.rest_token_auth import OsrTokenError, SecretTokenError, ... |
#!/usr/bin/env python
import glob
import os
import sys
verbose = '--verbose' in sys.argv
dump = '--dump' in sys.argv
internal = '--internal' in sys.argv
plain_output = '--plain-output' in sys.argv
if plain_output:
plain_file = open('plain_text_out.txt', 'w+')
in_code = None
paths = ['include/libtorrent/*.hpp', 'inc... |
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from quotes.models import Quote
class QuoteCreate(CreateView):
model = Quote
class QuoteUpdate(UpdateView):
model = Quote
class QuoteDelete(DeleteView):
model = Quote
success_url... |
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends.util import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (SI... |
from rest_framework.permissions import BasePermission
class IsDeviceOwnerOnly(BasePermission):
def has_permission(self, request, view):
return request.user.is_superuser
def has_object_permission(self, request, view, obj):
return request.user.is_superuser
|
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Peng Zhou
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from ... |
# Copyright (c) OpenMMLab. All rights reserved.
# This scripts is copied from
# https://github.com/activitynet/ActivityNet/blob/master/Crawler/Kinetics/download.py # noqa: E501
# The code is licensed under the MIT licence.
import argparse
import os
import ssl
import subprocess
import mmcv
from joblib import Parallel,... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
def average(array):
array = list(set(array))
return sum(array)/len(array)
if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
result = average(arr)
print(result) |
#!env python3
from flask import Flask, request, redirect
from hashlib import sha256
import hmac
import base64
import time
import urllib
# allow for relative importing if run directly
if __name__ == "__main__":
from config import secrets, reports, listen_port
else:
from .config import secrets, reports, listen_p... |
#
# PySNMP MIB module CISCO-DYNAMIC-TEMPLATE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-DYNAMIC-TEMPLATE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:39:09 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version ... |
# %% md
#### This notebook demonstrates the use of an optimized data pre-processing algorithm for bias mitigation
# - The
# debiasing
# function
# used is implemented in the
# `OptimPreproc`
#
# class .
# - Define
# parameters
# for optimized pre - processing specific to the dataset.
#
#
# - Divide
# the... |
from web3.contract import Contract
class PaymentLibFactory(Contract):
pass
def get_payment_lib(web3, address, abi):
return web3.eth.contract(
abi=abi,
address=address,
base_contract_factory_class=PaymentLibFactory,
)
|
#!/usr/bin/env python
# Contributors:
# Christopher P. Barnes <senrabc@gmail.com>
# Andrei Sura: github.com/indera
# Mohan Das Katragadda <mohan.das142@gmail.com>
# Philip Chase <philipbchase@gmail.com>
# Ruchi Vivek Desai <ruchivdesai@gmail.com>
# Taeber Rapczak <taeber@ufl.edu>
# Nicholas Rejack <nrejack@ufl.edu>
# ... |
# -*- coding: utf-8 -*-
"""Various helper methods for PDF extraction.
"""
# This file contains mostly unused leftovers from pdf.py.
class Stream (object):
"""Wrapper around PdfMiner's stream class"""
def __init__(self, stream):
self.stream = stream
def get(self, attribute):
"""Returns a... |
while True:
print('Plese type your name')
name=input()
if name=='your name':
break
print('Thank you!')
|
#!/usr/bin/env python
"""
Populates blank uuid fields in datasets with randomly generated values
Going forward, these ids will be generated for all new datasets. This
script fixes datasets that were generated before the change.
"""
import sys, os, ConfigParser
import galaxy.app
from galaxy.util.bunch import Bunch
im... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
import pickle
import sys
sys.path.append("..")
from model import ECO
import paddle.fluid as fluid
# Load pickle, since pretrained model is too bigger than the threshold(150M), split them into 2 parts and then reload them
f0 = open('seg0.pkl', 'rb')
f1 = open('seg1.pkl', 'rb')
model_out = dict()
model_0 = p... |
# Copyright 2012, Red Hat, 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 agr... |
from toontown.toonbase.ToonPythonUtil import Functor
from otp.level import LevelMgrBase
class LevelMgr(LevelMgrBase.LevelMgrBase):
def __init__(self, level, entId):
LevelMgrBase.LevelMgrBase.__init__(self, level, entId)
self.geom = loader.loadModel(self.modelFilename)
if not self.geom:
... |
"""
`pwmio` - Support for PWM based protocols
===========================================================
See `CircuitPython:pwmio` in CircuitPython for more details.
Not supported by all boards.
* Author(s): Melissa LeBlanc-Williams
"""
import sys
from adafruit_blinka.agnostic import detector
# pylint: disable=unu... |
# Generated by Django 2.1.1 on 2018-09-03 13:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CV', '0004_auto_20180903_1229'),
]
operations = [
migrations.RemoveField(
model_name='cv',
name='availability_string... |
#!/usr/bin/env python
"""
Example code for properties
NOTE: if your getters and setters are this simple: don't do this!
"""
class C:
def __init__(self):
self._x = None
@property
def x(self):
print("in getter")
return self._x
@x.setter
def x(self, value):
print("i... |
from chocs.http_error import HttpError
from chocs.http_request import HttpRequest
from chocs.http_response import HttpResponse
from chocs.routing import Router
from chocs.serverless.serverless import ServerlessFunction
from .middleware import Middleware, MiddlewareHandler
class ApplicationMiddleware(Middleware):
... |
# Source: https://github.com/tracy-talent/curriculum/blob/ecaf850cb7932f23b5d7c0323e80a9f9a408bef6/Machine%20Learning/Dimension%20Reduction/src/ISOMAP.py
from numpy import *
from hw4.libs.metrics import _1NN
from queue import PriorityQueue
from os import path
import time
def loadData(filename):
content = open(fi... |
{
"targets": [
{
"target_name": "node-simconnect",
"sources": [ "src/addon.cc" ],
"include_dirs": [
"SimConnect/Inc",
"<!(node -e \"require('nan')\")"
],
"link_settings": {
"libraries": [
"../... |
import unittest
import flavio
from wilson import Wilson
from .Vllgamma import *
### implement test
class TestVllgamma(unittest.TestCase):
def test_np(self):
wc,br=Wilson({'CVRR_muecc' : 1e-2},scale=2.,eft='WET',basis='flavio'),8.3949e-6
self.assertAlmostEqual(flavio.np_prediction('BR(J/psi->muegamm... |
#!/usr/bin/env python
import zmq
import numpy as np
import numpy.matlib
import importlib
from collections import defaultdict
from fastcluster import linkage_vector
import selfdrive.messaging as messaging
from selfdrive.services import service_list
from selfdrive.controls.lib.latcontrol_helpers import calc_lookahead_off... |
#!/usr/bin/env python
"""MIT - CSAIL - Gifford Lab - seqgra
seqgra complete pipeline:
1. generate data based on data definition (once), see run_simulator.py
2. train model on data (once), see run_learner.py
3. evaluate model performance with SIS, see run_sis.py
@author: Konstantin Krismer
"""
import argparse
import... |
"""Functions that work on collections of shapes
"""
from __future__ import division, print_function
import numpy as np
from .convex import convex_area, convex_centroid
__all__ = ['recenter_polygon', 'centroid_for_shapes',
'centroid_for_uncomputed_shapes', 'recenter_system',
'rescale_and_recenter... |
import six
if six.PY3:
import unittest
else:
import unittest2 as unittest
from datetime import date
from mock import Mock
from six import u
from twilio.rest.resources import Messages
DEFAULT = {
'From': None,
'DateSent<': None,
'DateSent>': None,
'DateSent': None,
}
class MessageTest(unittes... |
from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... |
# 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... |
#
# The Python Imaging Library
# $Id$
#
# WMF stub codec
#
# history:
# 1996-12-14 fl Created
# 2004-02-22 fl Turned into a stub driver
# 2004-02-23 fl Added EMF support
#
# Copyright (c) Secret Labs AB 1997-2004. All rights reserved.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on... |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# pylint: disable=wrong-import-position
import time
import struct
# CircuitPython / Blinka
import board
uart = board.UART()
uart.baudrate = 19200
# via USB cable
# import serial
# uart = serial.Serial("/dev/... |
import logging
from keras import Sequential
from keras.layers import Convolution2D, MaxPooling2D, Flatten, Dropout, Dense, SpatialDropout2D, K
from keras.optimizers import SGD
from keras.regularizers import l2
from utils_train_self_driving_car import INPUT_SHAPE, rmse
from models.abstract_model_provider import Abstra... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dogAccountantProject.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import... |
# Generated by Django 2.1.15 on 2021-08-12 11:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import time... |
# -*- coding: utf-8 -*-
"""
Module to define CONSTANTS used across the project
"""
from os import path
# identify basedir for the package
BASE_DIR = path.dirname(path.normpath(path.dirname(__file__)))
# Training and predict(deepaas>=0.5.0) arguments as a dict of dicts
# with the following structure to feed the ... |
_base_ = [
'../_base_/datasets/cityscapes_768x768.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k.py'
]
# model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained='open-mmlab://resnet50_v1c',
backbone=dict(
typ... |
#coding: UTF-8
import serial
import sys
import time
import binascii
import json
import math
from collections import deque
import paho.mqtt.client as mqtt
# 設定系変数(デフォルト値で初期化)
MQTT_BROKER_IP = "localhost"
MQTT_BROKER_PORT = 1883
SERIAL_PORT = "COM3"
MESSAGE_LEN = 240
NO_MESSAGE_TIME_OUT = 5.0
NO_MESSAGE_MAX_COUNT = 30... |
from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase
from spark_auto_mapper_fhir.classproperty import genericclassproperty
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
class ProviderSearchSystemExtensionItem(ExtensionBase):
# noinspection PyPep8Naming
def __init__(self, val... |
import logging
import re
from collections import Counter
from textblob import TextBlob
from textblob.exceptions import MissingCorpusError
from . import Bigrams, english_bigrams
class SummaryEvaluator(object):
"""Evaluate summaries of a book to find a usable summary.
A usable summary will have good coverag... |
import random
def guess_random_number(tries, start, stop):
number = random.randint(start, stop)
while tries != 0:
print('Number of tries left: ', tries)
guess = int(input("Guess a number between 1 and 10: "))
tries -= 1
if guess < number:
print('Guess high... |
import threading
import ipaddress
import socket
import time
from typing import Optional, Union
import requests
requests.packages.urllib3.disable_warnings() # type: ignore
from concurrent.futures import ThreadPoolExecutor
import colorama
colorama.init(autoreset=True)
import os
import bs4
import argparse
folder = os.pa... |
from gemstone import MicroService, event_handler, exposed_method
from gemstone.event.transport import rabbitmq, redis_transport
class EventTestService2(MicroService):
name = "event.test2"
host = "127.0.0.1"
port = 8000
event_transports = [
redis_transport.RedisEventTransport("redis://127.0.0.... |
from datetime import datetime, timedelta
class Pubg(object):
def __init__(self):
self.top_history = []
def _last_top(self, players=None):
if not players:
if self.top_history:
return self.top_history[-1]
else:
return None
... |
# -*- coding: utf-8 -*-
"""Tornado request argument parsing module.
Example: ::
import tornado.web
from marshmallow import fields
from webargs.tornadoparser import use_args
class HelloHandler(tornado.web.RequestHandler):
@use_args({'name': fields.Str(missing='World')})
def get(self, ... |
#!/usr/bin/env python3
import argparse
import kotlin_plugin_versions
import glob
import platform
import re
import subprocess
import shutil
import os
import os.path
import sys
import shlex
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--dependencies', default='../../../resources/ko... |
# 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... |
# -*- coding: utf-8 -*-
"""Standard utility functions used throughout AlphaGradient"""
# Standard Imports
from __future__ import annotations
from abc import ABC, abstractmethod
import builtins
from datetime import (
date,
datetime,
time,
timedelta,
)
import math
from pathlib import Path
# Third Party... |
"""
WSGI config for core project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ... |
'''
Parsing - Exercise 16
The script reads a multiple sequence file in FASTA format and
only write to a new file the records the Uniprot ACs of which
are present in the list created in Exercise 14).
This version of the script collects the header and the sequence
separately, in case you wanted to manipulate them.
'... |
import numpy as np
from gym_wmgds import utils
from gym_wmgds.envs.mujoco import mujoco_env
class AntEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'ant.xml', 5)
utils.EzPickle.__init__(self)
def step(self, a):
xposbefore = self.get_b... |
from django.db import models
class SFWManager(models.Manager):
def get_queryset(self):
return super(SFWManager, self).get_queryset().filter(sfwness=gifsong.SFW)
class gifsong(models.Model):
SFW = 1
NSFW = 2
UNKNOWN = 3
STATUS_CHOICES = (
(SFW, 'SFW'),
(NSFW, 'NSFW'),
... |
"""
Implementation from: https://raw.githubusercontent.com/Zenglinxiao/OpenNMT-py/bert/onmt/encoders/bert.py
@Author: Zenglinxiao
"""
import torch.nn as nn
from onmt.encoders.transformer import TransformerEncoderLayer
from onmt.utils.misc import sequence_mask
class BertEncoder(nn.Module):
"""BERT Encoder: A Tran... |
import uuid
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class Profile(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_p... |
#!/usr/bin/env python
# _*_ coding:UTF-8 _*_
"""
__author__ = 'shede333'
"""
import plistlib
import shutil
from pathlib import Path
from mobileprovision import util
from mobileprovision import MobileProvisionModel
RESOURCE_PATH = Path(__file__).resolve().parent.joinpath("resource")
SRC_MP_PATH = RESOURCE_PATH.joinpa... |
import distutils.ccompiler
import os
import os.path
import platform
import shutil
import sys
import subprocess
from typing import Optional, List
import setuptools
import setuptools.msvc
from setuptools import Extension
from cupy_builder._context import Context
import cupy_builder.install_build as build
def _nvcc_ge... |
import keyboard
import time
while True:
if keyboard.is_pressed('esc'):
print('Pressed ESC')
break
else:
time.sleep(1e-3)
|
# Based on the astropy test suite (v4.2.1)
# (https://github.com/astropy/astropy/blob/v4.2.1/astropy/cosmology/tests/test_cosmology.py)
from io import StringIO
from typing import Type
import numpy as np
import pytest
import torch
from pytest import mark
from torch import tensor
import phytorch.cosmology.drivers.analy... |
"""Cli entry point to setup db indexes."""
import click
import structlog
from click import Context
from miscutils.logging_config import Verbosity
from pymongo import ASCENDING, IndexModel
from pymongo.collection import Collection
from selectedtests.config.logging_config import config_logging
from selectedtests.dataso... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
"""
Translates DMU table in NCGMP09-style geodatabase into a fully formatted
Microsoft Word .docx file.
Assumes formatting and style names in USGS Pubs template MapManuscript_v1-0_04-11.dotx
Arguments
Input geodatabase
Output workspace
Output filename (if it doesn't end in .docx, .docx will be appended)
... |
# coding=utf-8
# Copyright 2020 The TensorFlow GAN 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 applicabl... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-13 14:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
... |
"""
WSGI config for polityper project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from dotenv import load_dotenv
from django.core.wsgi import get_wsgi_application
loa... |
from django.urls import path
from .views import (
product_orders_modal,
make_product_purchase,
allocate_product_to_order,
receive_product_stock,
ProductListView,
product_add_to_purchase,
product_search,
)
app_name = "products"
urlpatterns = [
path('', ProductListView.as_view(), name="... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
class BooleanData:
def __init__(self, objects):
self.objects = list(objects)
@ property
def head(self):
return(self.objects[0])
@ property
def tail(self):
if len(self.objects) > 1:
return self.objects[1:]
else:
return []
class BooleanUnion(... |
#!/usr/bin/env python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
import pexpect
os.environ['ANSIBLE_NOCOLOR'] = '1'
out = pex... |
import datetime
import sys
from collections import OrderedDict
class DiskEntry:
"""A disk entry."""
def __init__(self, read_in_kb, write_in_kb, timestamp):
"""Initialize a DiskEntry."""
self._read_in_kb = read_in_kb
self._write_in_kb = write_in_kb
self._timestamp = timestamp
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import logging
from pathlib import Path
import shutil
from tempfile import NamedTemporaryFile
from typi... |
#! /usr/bin/env python
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
import sys
import os
import subprocess
import atexit
from vmrunner import vmrunner
vm = vmrunner.vms[0]
import socket
# Set up a tem... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStringManipulation(Koan):
def test_use_format_to_interpolate_variables(self):
value1 = 'one'
value2 = 2
string = "The values are {0} and {1}".format(value1, value2)
self.assertEqual("The values are ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
def execute():
language_map = {
"中国(简体)": "簡體中文",
"中國(繁體)": "正體中文"
}
language_in_system_settings = frappe.db.get_single_value("System Settings", "language")
if language_in_system_settings in language_map:
new_language_name = langu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.