text stringlengths 2 999k |
|---|
from __future__ import print_function
import numpy as np
import tensorflow as tf
import argparse
import os
import pickle
import copy
import sys
import html
from model import Model
def main():
assert sys.version_info >= (3, 3), \
"Must be run in Python 3.3 or later. You are running {}".format(sys.version)
... |
from __future__ import unicode_literals
from django.apps import AppConfig
class PollingConfig(AppConfig):
name = 'Polling'
|
# 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, overload
from .. import _utilities
from... |
# Copyright 2015 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... |
"""
This Python script Copies files from one folder to another.
"""
import os
import re
src_dir = input("Enter src_dir: ")
dst_dir = input("Enter dst_dir: ")
yes = ["Yes", "YES", "yes", "y"]
if not re.match(r"^\w:[\\\w]+[^\\]+\\$", src_dir) or not re.match(r"^\w:[\\\w]+[^\\]+\\$", dst_dir):
print("Path is not in... |
from .school import type_defs |
#! /usr/bin/python
# -*- coding: utf-8 -*-
class EintData:
_count = 0
_debounce_enable_list = ['CUST_EINT_DEBOUNCE_DISABLE', 'CUST_EINT_DEBOUNCE_ENABLE']
_map_table = {}
_mode_map = {}
_int_eint = {}
_builtin_map = {}
_builtin_eint_count = 0
def __init__(self):
self.__varName =... |
# -*- coding: utf-8 -*-
with open("arquivo.txt", "a") as arquivo:
arquivo.write("O conteúdo antigo será mantido. O novo conteúdo será acoplado") |
from hetdesrun.component.registration import register
from hetdesrun.datatypes import DataType
import datetime
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
def rul_regression_linear(
train_series: pd.Series,
limit: float,
num_pred_series_future_days: int,
p... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
import sys
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTes... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 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 the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.NotifyUserVo import NotifyUserVo
class AlipayCommerceTransportNotifycenterNotifyuserQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayCommer... |
# Copyright 2018 Capital One Services, LLC
#
# 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... |
from jumpscale import j
from time import sleep
app = j.tools.prefab._getBaseAppClass()
class PrefabMongodb(app):
NAME = 'mongod'
def install(self, start=True, reset=False):
"""
download, install, move files to appropriate places, and create relavent configs
"""
if self.doneC... |
import random
from combat import Combat
#Possible colors for monsters
COLORS = ['yellow', 'red', 'blue', 'green', 'purple']
#a monster is a combat entity
class Monster(Combat):
#Hit Points
minHP = 1
maxHP = 1
#Experience Points
minXP = 1
maxXP = 1
#Other attributes
weapon = 'sword'
sound = 'roar'
#ove... |
# -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class PivotalV3HookTests(WebhookTestCase):
STREAM_NAME = 'pivotal'
URL_TEMPLATE = u"/api/v1/external/pivotal?stream={stream}&api_key={api_key}"
def test_accepted(self) -> None:
expected_topic = 'My new Feature story'
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# 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 ... |
import ccxt
# 初始化
bian_exchange = ccxt.binance({
"timeout": 15000,
"enableRateLimit": True,
})
# ss = bian_exchange.load_markets()
# 查询账户余额
ba = bian_exchange.fetch_balance()
print(ba['total']['USDT'])
# 可用
print(ba['free']['USDT'])
# 已使用
print(ba['used']['USDT'])
symbol = 'ETH/USDT'
# 买卖订单 buy/sell
# if bi... |
""" Simple set of functions to support running commands on the CLI """
#!/usr/bin/python
# Imports
import os
import subprocess
#
# Gets the current root directory of the project
#
def get_project_root():
""" Gets the current root directory of the project """
# Get the path to our source
file_name = os.p... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... |
import RobotRaconteur as RR
RRN = RR.RobotRaconteurNode.s
import numpy as np
import re
from .LocalIdentifiersManager import LocalIdentifiersManager
from .IdentifierUtil import IdentifierUtil
from ..InfoParser import InfoParser
class InfoFileLoader(object):
def __init__(self, node = None, client_obj = None):
... |
from typing import Optional
from pydantic import AnyUrl, BaseSettings, validator
class Settings(BaseSettings):
SERVER_NAME: str = ""
APPLICATION_NAME: str = "TLS Reporting"
APPLICATION_DESCRIPTION: str = """A number of protocols exist for establishing encrypted channels between SMTP
Mail Transfer Agents... |
import numpy as np
class PID(object):
DIRECT = False
REVERSE = True
def __init__(self, input, output, setpoint, kp, ki, kd, direct):
"""
:param input: A function that returns an input value
:param output: A function that sets an output value
:param setpoint: A scalar for ... |
# -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
from typing import Any, Callable, List, Type, TYPE_CHECKING, Dict
from pypika.queries import QueryBuilder
from tortoise.constants import LOOKUP_SEP
from tortoise.exceptions import UnknownFieldError, NotARelationFieldError
from tortoise.fields import JSONField, RelationField
from tortoise.query.base import MODEL, Awa... |
'''
Дополните приведенный код, так чтобы он вывел сумму минимального и максимального элементов списка numbers.
numbers = [12.5, 3.1415, 2.718, 9.8, 1.414, 1.1618, 1.324]
print()
'''
numbers = [12.5, 3.1415, 2.718, 9.8, 1.414, 1.1618, 1.324]
print(min(numbers) + max(numbers))
|
'''
Date of last edit: August 24th, 2020
Author(s): Ryan McGuire* Lane Carasik^
*Virginia CommonWealth University
*FAST Research Group
HEXER - base HEat EXchangER code
Equations for Reactor Heat Exchangers:
Python Script for calculation of Shell-and Tube heat transfer coefficient using correctional factors
for Shel... |
import sqlite3
from sqlite3 import Error
conn = sqlite3.connect('users.db')
# Create Users Database
c = conn.cursor()
c.execute("""CREATE TABLE hs_user
(first text, last text, email text, username text, password text, school text, grade text)
""")
c.execute("""CREATE TABLE uni_user
(first text, last text, email te... |
coordinates_FF007F = ((115, 56),
(115, 57), (115, 58), (115, 59), (115, 60), (115, 61), (115, 62), (115, 63), (115, 64), (115, 65), (115, 66), (115, 67), (115, 68), (115, 69), (115, 70), (115, 71), (115, 72), (115, 73), (115, 74), (115, 75), (115, 76), (116, 51), (116, 52), (116, 53), (116, 54), (116, 55), (116, 77),... |
# 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.
"""Unit tests for //compiler_gym:validate."""
import gym
from compiler_gym import CompilerEnvState, validate_states
from tests.test_main impor... |
import asyncio
import pytest
from goji.rpc.wallet_rpc_api import WalletRpcApi
from goji.simulator.simulator_protocol import FarmNewBlockProtocol
from goji.types.blockchain_format.coin import Coin
from goji.types.blockchain_format.sized_bytes import bytes32
from goji.types.mempool_inclusion_status import MempoolInclus... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pytextrank",
version="2.0.2",
author="Paco Xander Nathan",
author_email="paco@derwen.ai",
description="Python implementation of TextRank for phrase extraction and summarization of text doc... |
import requests as req
from ndj_toolbox.fetch import (xml_df, save_files)
url_base = 'https://www.al.sp.gov.br/repositorioDados/'
url_file = 'deputados/bases_eleitorais.xml'
url = url_base + url_file
def main():
xml_data = req.get(url).content
dataset = xml_df(xml_data).process_data()
dataset = dataset[... |
import logging
from collections import Counter
from pathlib import Path
from time import time, sleep
from typing import List
from blspy import G1Element
from chiapos import Verifier
from stai.plotting.manager import PlotManager
from stai.plotting.util import (
PlotRefreshResult,
PlotsRefreshParameter,
Plo... |
print("Impoting PyDas") |
"""
WSGI config for orm_field_demo 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/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... |
import string
from module_info import *
from module_info_pages import *
from process_common import *
def save_info_pages():
ofile = open(export_dir + "info_pages.txt","w")
ofile.write("infopagesfile version 1\n")
ofile.write("%d\n"%(len(info_pages)))
for i_info_page in xrange(len(info_pages)):
... |
#!/usr/bin/env python
# usegalaxy.eu sorting hat
from galaxy.jobs import JobDestination
from galaxy.jobs.mapper import JobMappingException
import copy
import math
import os
import yaml
# Maximum resources
CONDOR_MAX_CORES = 40
CONDOR_MAX_MEM = 1000
# The default / base specification for the different environments.
S... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 _utilitie... |
# Copyright 2018 the GPflow 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 writi... |
from __future__ import absolute_import
from hashlib import md5
from django.utils.encoding import force_bytes
DEFAULT_FINGERPRINT_VALUES = frozenset(['{{ default }}', '{{default}}'])
def hash_from_values(values):
result = md5()
for value in values:
result.update(force_bytes(value, errors='replace'))... |
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.views import APIView
from exo_currency.api.v1.pagination import SmallSetPagination
from exo_currency.api.v1.serializers import (
CalculateAmountSerializer, CalculateTimeWeightedRateSerializer,
CurrencyExchangeR... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOpenMiniAmpeUsersceneQueryModel import AlipayOpenMiniAmpeUsersceneQueryModel
class AlipayOpenMiniAmpeUsersceneQueryRequest(obj... |
# F strings
n = s = 0
while True:
n = int(input('Digite um numero: '))
if n == 999:
break
s += n
# print('A soma vale {}' .format(s))
print(f'A soma vale {s}')
|
# Copyright 2018 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 applicab... |
import unittest
from geopy.compat import u
from geopy.point import Point
from geopy.geocoders import Baidu
from test.geocoders.util import GeocoderTestBase, env
from geopy.exc import GeocoderAuthenticationFailure
class BaiduTestCaseUnitTest(GeocoderTestBase):
@classmethod
def setUpClass(cls):
cls.g... |
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
import re
import unittest
from marker import Marker
import time
import os
from datetime import datetime
import signal
import subprocess as sp
import serial
import threading
import random
import logging
try:
import Image
except ImportError:
from PIL import Image
... |
#!/usr/bin/env python
import functools
import numpy
import hypothesis
import hypothesis.extra.numpy
import hypothesis.strategies
import libnu.sum
from test import eq
arrays = functools.partial(
hypothesis.extra.numpy.arrays,
dtype=numpy.float32,
unique=True,
)
floats = hypothesis.strategies.floats(-1.0... |
from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for DB when DB is available"""
with patch('django.db.utils... |
# Copyright 2020 Bradbase
#
# 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 writing, so... |
from nodePrototypes import nextflowCmdProcess
class countWithFeatureCounts(nextflowCmdProcess):
"Count reads with FeatureCounts, using general settings."
def directives(self):
return {"publishDir": "'../tables', mode: 'copy'", "label": "'manycpu'"}
def customize_features(self):
self.inpu... |
from extensible_provn.view.style.nohighlight import NoHighlightStyle
class WhiteBlackStyle(NoHighlightStyle):
def __init__(self):
super(WhiteBlackStyle, self).__init__()
self.style = self.join(self.style, {
"entity": {"fillcolor": "#000000", "fontcolor": "#FFFFFF", "style": "filled"},
... |
from random import *
# somehelp.py
def welcome():
print('Welcome to the automated techincal support system.')
print('Please describe your problem')
def get_input():
return input().lower()
def get_output():
output = ['Have you tried it on a different operating system?', 'Did you reboot it?', 'What col... |
# -*- coding: utf-8 -*-
class DeploymentResponse(dict):
"""
A message that crassus returns for events such as fail or success
events for stack deployments/updates. These messages will be
transmitted as JSON encoded strings, used by Gaius.
It is initialized with the following parameters:
- st... |
D = {".":".","O":"O","-":"|","|":"-","/":"\\","\\":"/","^":"<","<":"v","v":">",">":"^"}
N,M=map(int,input().split())
L = []
for i in range(N):
L.append(input())
for x in range(M-1,-1,-1):
for y in range(N):
print(D[L[y][x]],end="")
print()
|
import os
from flask import current_app
from flask import render_template
from flask import url_for
from flask_login import current_user
from flask_mail import Message
from PIL import Image
from flaskapp import APP_PATH
from flaskapp import mail
def save_picture(form_picture):
"""Save profile picture
Argum... |
import shlex
from distutils.version import LooseVersion
from functools import partial
from itertools import product
from shipyard import Action, CIPrettyLogAction, IsolatedAction, ctx
#####################################
# Travis: Wait and pull/push images #
#####################################
def wait_and_pull_c... |
# Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
from flask import Flask, request, jsonify, abort, send_from_directory, redirect, send_file
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_cors import CORS
from marshmallow_sqlalchemy import ModelConverter
from marshmallow import fields
from roadtools.roadlib.metadef.databas... |
from pathlib import Path
from pytiled_parser import common_types, layer, tiled_map, tiled_object, tileset
EXPECTED = tiled_map.TiledMap(
infinite=False,
layers=[
layer.ObjectLayer(
name="Object Layer 1",
opacity=1,
visible=True,
id=2,
draw_or... |
# Do the necessary imports
import argparse
import shutil
import base64
from datetime import datetime
import os
import cv2
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO, StringIO
import json
import pickle
import matplotlib.ima... |
"""
Module for transforming source data DataFrames to the standard model.
"""
import os
from abc import abstractmethod
from pprint import pformat
import pandas
from kf_lib_data_ingest.common.errors import InvalidIngestStageParameters
from kf_lib_data_ingest.common.io import read_df
from kf_lib_data_ingest.common.misc... |
class BansheePackage (Package):
def __init__ (self):
Package.__init__ (self, 'banshee', 'master')
self.sources = [
'git://git.gnome.org/banshee'
]
self.git_branch = 'master'
self.configure = [ 'NOCONFIGURE=1 ./autogen.sh && ./profile-configure %{profile.name} --prefix=%{prefix}' ]
self.sources.extend(... |
from newscatcher import __version__
def test_version():
assert __version__ == '0.1.0'
|
from .chi_index import ChiFinder
from .diffusion import LinearDiffuser
from .fire_generator import FireGenerator
from .detachment_ltd_erosion import DetachmentLtdErosion, DepthSlopeProductErosion
from .flexure import Flexure
from .flow_routing import FlowRouter, DepressionFinderAndRouter
from .nonlinear_diffusion impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This example show how to apply gains to an ms in a chunked up way.
The gains should be stored in a .npy file and have the shape
expected by the corrupt_vis function.
It is assumed that the direction axis is ordered in the same way as
model_cols where model_cols is a com... |
#! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... |
# Copyright 2017 The Oppia 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 applicable ... |
from __future__ import absolute_import
import gevent
import sys
from cfgm_common.tests import test_common
sys.path.insert(0, '../../../../build/production/config/device-manager/')
sys.path.insert(0, '../../../../build/debug/config/device-manager/device_manager')
sys.path.insert(0, '../../../../build/debug/config/device... |
#!/usr/bin/env python
import subprocess,sys,os,re,fileinput,argparse,math
import vcf
import ntpath
parser = argparse.ArgumentParser(description="pulls the files and cuts them from sampleID "\t" batch ID")
parser.add_argument("--sample",help="List of the samples needed to cut.",required=True)
parser.add_argument("--be... |
# 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 builtins import range
from unittest import TestCase
from pydmd.dmd import DMD
import matplotlib.pyplot as plt
import numpy as np
import os
# 15 snapshot with 400 data. The matrix is 400x15 and it contains
# the following data: f1 + f2 where
# f1 = lambda x,t: sech(x+3)*(1.*np.exp(1j*2.3*t))
# f2 = lambda x,t: (se... |
from os import path
import yaml
import numpy as np
import random
import math
from collections import deque
from time import strftime
import csv
import gym
from logger.score import ScoreLogger
from discretizer import CustomDiscretizer
from debug_plot_functions import DebugLogger
from per_memory import Memory
from q_rtm ... |
# Copyright 2019 The KRules 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 writing,... |
import random
from typing import Any, Dict, List, Optional, cast
from lale.lib.lale import NoOp
from lale.operators import (
BasePipeline,
IndividualOp,
Operator,
OperatorChoice,
PlannedOperator,
clone_op,
make_choice,
make_pipeline,
make_pipeline_graph,
)
class NonTerminal(Operat... |
# !/usr/bin/env python3
import os
import numpy as np
import json
from glob import glob
import random
import time
import sys
sys.path.append('./')
sys.path.append('./corpus/w2v')
import gen_pieces
import vocab as vocab_160k
# 1. convert json to txt
def convert_gossip_json_to_txt(infile, outdir):
with open(infile... |
from hc.test import BaseTestCase
class ChangeEmailTestCase(BaseTestCase):
def test_it_requires_sudo_mode(self):
self.client.login(username="alice@example.org", password="password")
r = self.client.get("/accounts/change_email/")
self.assertContains(r, "We have sent a confirmation code")
... |
from functools import partial as p
from textwrap import dedent
import pytest
from tests.helpers.agent import Agent
from tests.helpers.assertions import any_metric_has_any_dim_key, has_datapoint_with_dim, has_log_message, http_status
from tests.helpers.metadata import Metadata
from tests.helpers.util import container_... |
# coding: utf-8
from enum import Enum
class TransportType(Enum):
WALKING = "WALKING"
BOAT = "BOAT"
class FromType(Enum):
CHARACTER = "CHARACTER"
BUILD = "BUILD"
STUFF = "STUFF"
class RiskType(Enum):
NONE = "NONE"
|
import tensorflow as tf
import cv2 as cv
class AnimalDetector():
def get_number_of_animals(self, path_to_image):
with tf.gfile.FastGFile('/home/aryan/Documents/newsih2020/sih2020/ML Project/Detector_class_animal/frozen_inference_graph.pb', 'rb') as f:
graph_def = tf.GraphDef()
grap... |
###############################################################################
# copyright 2012, Hamid MEDJAHED (hmedjahed@prologue.fr) Prologue #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# ... |
# -*- coding: utf-8 -*-
import fitz
import numpy as np
import cv2.cv2 as cv2
from border import border
from mmdet.apis import inference_detector, show_result, init_detector
from Functions.blessFunc import borderless
import lxml.etree as etree
import glob
import sys
import os
import re
import json
import warnings
import... |
from userManager import UserManager
from problemManager import ProblemManager
# a = UserManager()
# a.Add_User('u1', '123456', 'user1', '123', '3')
# a.Modify_User('u1', '531', '', '' , '')
# a.Modify_User('u1', '', 'u1', '' , '')
# a.Modify_User('u1', '', '', '321' , '')
# a.Modify_User('u1', '', '', '' , '2')
# a.... |
__author__ = 'Wesley Brewer'
__license__ = 'MIT'
|
import re
import sys
pattern = re.compile('x')
input = sys.stdin.read()
sys.stdout.write(pattern.sub('oo', input))
|
#!/usr/bin/env python
from __future__ import print_function
from os import path
from ceQTL import VERSION
from pyppl import Proc, PyPPL
from pyppl.utils import split
from pyppl.parameters import commands
from bioprocs import params
if path.isfile('./config.yaml'):
params.loadFile('./config.yaml')
from bioprocs.common... |
import datetime
import json
from django.contrib.admin.utils import quote
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Permission
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import Validatio... |
# 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 ... |
import os
import sys
import uuid
import tempfile
import time
from io import StringIO
import re
import numpy as np
import trimesh
from pyobb.obb import OBB
from scipy.spatial import ConvexHull
from .meshing.surface_mesh_parameters import default_surface_mesh_parameter
from .face import Face
from .tools im... |
N, M = map(int, open(0).read().split())
print((N // 1000 // M) * 1000)
|
"""
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
"""
from textwrap import dedent
from typing import Dict
from warnings import catch_warnings, simplefilter, warn
import numpy as np
from pandas._libs import algos, hashtable as htable, lib
from pandas._libs.t... |
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
logger = logging.getLogger(__name__)
class SeqSoftmaxDecoder(nn.Module):
"""This class decodes sequence hidden unit
"""
def __init__(self, hidden_size, label_size, bias=True):
"""This function sets SeqSoftmaxDecode... |
# Differentiable Augmentation for Data-Efficient GAN Training
# Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han
# https://arxiv.org/pdf/2006.10738
from random import random
import torch
import torch.nn as nn
import torch.nn.functional as F
class DiffAugment(nn.Module):
def __init__(self, policy='', ... |
# Copyright (c) 2020, hukkinj1 (licensed under the MIT License)
# Modifications Copyright (c) 2020, Foris Limited (licensed under the Apache License, Version 2.0)
import hashlib
import bech32
import ecdsa
import hdwallets
from mnemonic import Mnemonic
DEFAULT_DERIVATION_PATH = "m/44'/394'/0'/0/0"
DEFAULT_BECH32_HRP ... |
from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
openapi.Info(
title="API",
default_version='v2',
description="Descri... |
# Copyright 2013 Cloudbase Solutions Srl
# 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 r... |
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from uni_form.helpers import FormHel... |
# pylint: disable=E1101
# pylint: disable=W0212,W0703,W0622
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to... |
import torch
from src.network.net_rgb import RenderingNetwork
from src.utils import approx_psr_grad
from pytorch3d.renderer import (
RasterizationSettings,
PerspectiveCameras,
MeshRenderer,
MeshRasterizer,
SoftSilhouetteShader)
from pytorch3d.structures import Meshes
def approx_psr_grad(psr_gr... |
# Filename: HCm_UV_v4.2.py
import string
import numpy as np
import sys
#sys.stderr = open('errorlog.txt', 'w')
import warnings
warnings.filterwarnings("ignore")
#Function for interpolation of grids
def interpolate(grid,z,zmin,zmax,n):
#Columns of the library
n_comments = 0
with open('Libraries_uv/C17_POPSTA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.