content stringlengths 5 1.05M |
|---|
import sys, traceback
import datetime
from time import sleep
import daemon
import click
from corr.main import core
class CoRRTask:
def __init__(self, pid=None, name=None, refresh=10, aid=None, origin=None, tag=None, clnk_module=None, api_module=None, elnk_module=None, timeout=60*60):
self.pid = pid
... |
# 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 logging
from dataclasses import dataclass
from typing import Dict, Hashable, Mapping, Set, Tuple, Union, overload
import xarray as xr
logger = logging.getLogger(__name__)
@dataclass(frozen=True, eq=False)
class Spec:
"""Root type Spec"""
default_name: str
__doc__: str
# Note: we want to pre... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="functional-functions",
version = "0.5.2",
author = "Lawrence Chin",
author_email = "lawrence.chin@compass.com",
description = "Commonly used functions by the Compass FBI ... |
'''
Module defining update state for the UrbanScape class
'''
import numpy as np
#=============================
# |
# UrbanScape Agent Methods |
# |
#=============================
# Base class for all Food Agents
# agent has a location and wealth
class Agent(object):
def __init__(self, loc... |
from setuptools import setup
with open("README.md", 'r') as f:
long_description = f.read()
setup(
name='supervised-product-matching',
version='0.1',
description='Neural network for product matching, aka classifying whether two product titles represent the same entity.',
license="MIT",
long_descript... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @author: loricheung
import os
import math
import json
import urllib
import argparse
from alfred.feedback import Feedback
headers = {
'Host': 'frodo.douban.com',
'Content-Type': 'application/json',
'Connection': 'keep-alive',
'Accept': '*/*',
'User-A... |
import configparser
import glob
import os
class Config():
def __init__(self, config_name):
super(Config, self).__init__()
self.config_name = config_name
self.init()
def init(self):
inilist = glob.glob("*.ini")
if not os.path.isdir("./playlist"):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 28 08:19:09 2019
@author: amandaash
"""
import numpy as np
import matplotlib.pyplot as plt
def viral_load(A,B,alpha,beta, time):
V = A * np.exp(-alpha*time) + B * np.exp(-beta*time)
return V
A = [160000, 3000, 50000, 20000, 1000... |
from __future__ import print_function
import os
import fixtures
import testtools
from common.contrail_test_init import ContrailTestInit
from contrail_fixtures import *
from common.connections import ContrailConnections
from testresources import ResourcedTestCase
from sanity_resource import SolnSetupResource
from tcuti... |
"""
GeneratorConf
=============
This file defines the configurations to setup and run the Generator.
It contains a list of tasks needed to be done by the Generator. Each
task specification is specified by a list of variables in a dictionary.
Each dictionary has these configuration variables:
"TEMPLATE" - th... |
import logging
class Logger:
def __init__(self, log_level):
log_format_string = "%(asctime)s [%(levelname)s] %(message)s"
log_formatter = logging.Formatter(log_format_string)
logging.basicConfig(level=log_level, format=log_format_string)
file_handler = logging.FileHandler("boxrec... |
import os
import time
import numpy as np
import math
from scipy.spatial.distance import cdist
import pickle
import paramiko
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torch.utils.tensorboard impo... |
import numpy as np
import pytest
from pandas import (
Categorical,
Index,
)
import pandas._testing as tm
class TestTake:
# https://github.com/pandas-dev/pandas/issues/20664
def test_take_default_allow_fill(self):
cat = Categorical(["a", "b"])
with tm.assert_produces_warning(None):
... |
# ==============================================================================
### IF YOU ARE RUNNING THIS IN SPYDER MAKE SURE TO USE A NEW CONSOLE EACH TIME
### TO CLEAR THE SESSION
### (press F6, and select 'Execute in a new dedicated Python console')
# =============================================================... |
# 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... |
from collections.abc import Mapping
import logging
import os
import pandas
from .models import (
genome_name_from_library,
load_gtf_cache,
)
logger = logging.getLogger(__name__)
class GTFCache(Mapping):
"""Map library IDs to the correct GTF annotation table
"""
def __init__(self, libraries, gen... |
"""Unittests for library.
Run using `python -m unittest` in the top level directory folder.
"""
import os
import sys
add_path = os.path.dirname(os.path.dirname((os.path.realpath(__file__))))
# Ensure that the script lib is on path for imports.
sys.path.insert(0, add_path)
|
from django.shortcuts import render,get_object_or_404
from .models import Artist, Album, Song, SongReview
from django.contrib.auth.decorators import login_required
from .forms import GenreForm, ArtistForm, AlbumForm, SongForm, SongReviewForm
# Create your views here.
#Index view
def index(request):
return render... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/tasks_v2beta3/proto/task.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... |
from .endpoint import Endpoint, QuerysetEndpoint, api
from .exceptions import FlowRunFailedException, FlowRunCancelledException
from .. import FlowRunItem, PaginationItem
from ...exponential_backoff import ExponentialBackoffTimer
import logging
logger = logging.getLogger("tableau.endpoint.flowruns")
class FlowRuns(... |
import configparser
from datetime import datetime
import discord
from discord.ext import tasks
@tasks.loop(hours=24)
async def activity_loop(bot):
await bot.wait_until_ready()
if bot.is_closed(): return
current_day = datetime.today().strftime("%A")
await bot.change_presence(
activity=discor... |
#!/usr/bin/env python
# encoding: utf-8
import json
data = [{'a': 'A', 'b': (2, 4), 'c': 3.0}]
print 'DATA:', repr(data)
print 'repr(data) :', len(repr(data))
print 'dumps(data) :', len(json.dumps(data))
print 'dumps(data, indent=2) :', len(json.dumps(data, indent=2))
print 'dumps(data, separa... |
import numpy as np
import pandas as pd
class Dataset(object):
def __init__(self , data_path):
self.df = pd.read_csv(data_path, header = None)
self.Y = self.one_hot_encoding(self.df.iloc[0:, 4].values)
self.x = self.standard_deviation(self.df.iloc[0:, [0 , 1 , 2 , 3]].values)
def split_d... |
from anoncreds.protocol.utils import crypto_int_to_str, isCryptoInteger, intToArrayBytes
def get_claim_request_libindy_msg(claim_req, schema_seq_no):
return ({
'type': 'CLAIM_REQUEST',
'data': {
'issuer_did': 'FuN98eH2eZybECWkofW6A9BKJxxnTatBCopfUiNxo6ZB',
'blinded_ms': {
... |
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from fabric_cm.credmgr.swagger_client.api.default_api import DefaultApi
from fabric_cm.credmgr.swagger_client.api.tokens_api import TokensApi
|
"""add last_modified to gym_defenders
Revision ID: 35dee4fce912
Revises: 5f84a4df8243
Create Date: 2017-11-01 14:27:52.303046
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '35dee4fce912'
down_revision = '5f84a4df8243'
bran... |
from random import choice
from aiohttp import ClientSession
from io import TextIOWrapper, BytesIO
from re import compile
version = '0.1.4'
animals = [
"cat", "dog", "bird", "panda",
"redpanda", "koala", "fox", "whale",
"kangaroo", "bunny", "lion", "bear",
"frog", "duck", "penguin"
]
get_animal_name = ... |
import xadmin
from .models import Banner
class BannerAdmin(object):
# 显示不要用image,而应该用image_img
list_display = ['title', 'image_img', 'url', 'index', 'add_time']
search_fields = ['title', 'url', 'index']
list_filter = ['title', 'url', 'index', 'add_time']
model_icon = 'fa fa-picture-o'
# 注册轮播图
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage: program.py <customer>
program.py <customer>
program.py (-h | --help)
program.py --version
Options:
-h --help Show help.
--version Show version.
"""
# TODO
#
# Ty found these errors
# Group-20 and Group-30 are identical, including rxnId. ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Yahoo! 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/LICE... |
from rest_framework.pagination import PageNumberPagination
class PaginateContent(PageNumberPagination):
"""
Custom pagination class
"""
page_size = 10
page_size_query_param = 'page_size'
|
# ~\AppData\Local\Programs\Python\Python38\python.exe
# config.py
import os
basedir = os.path.abspath(os.path.dirname(__file__)) # Gets current folder
class Config(object):
# Creates environment variables
SECRET_KEY = os.environ.get('SECRET_KEY') or 'this-is-an-example-password'
SQLALCHEMY_DATABA... |
import pandas as pd
import Levenshtein
import numpy as np
from anytree.search import find
from utils.category_tree import get_category_tree
from utils.io_custom import read_pickle_object
from scipy.spatial.distance import cosine
import re
def find_node(id, tree):
return find(tree, lambda node: node.name == id)
d... |
"""
crystal_tools
part of pyTEMlib
Author: Gerd Duscher
Provides convenient functions to make most regular crystal structures
Contains also a dictionary of crystal structures and atomic form factors
Units:
everything is in SI units, except length is given in nm.
angles are assumed to be in degree but will ... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
# Copyright (c) 2015-2020 Avere Systems, Inc. All Rights Reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
'''Abstraction for backend services instance objects
Because the data structure/objects backend serv... |
import pandas as pd
import numpy as np
import os
import tqdm
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, LSTM, Dropout
from sklearn.model_selection import train_test_split
label2int = {
"male": 1,
"female": 0
}
def load_data(vector_length=128):
"""A function... |
from random import randint
from django.contrib.auth import get_user_model
__author__ = "Alex Laird"
__copyright__ = "Copyright 2019, Helium Edu"
__version__ = "1.4.38"
def generate_phone_verification_code():
code = None
while not code:
code = randint(100000, 999999)
# Ensure the slug does n... |
# A parallel code to get progenitor particles (of any type) for TNG snapshots. Run this code directly. The core code is progenitor_particles.py
import argparse
import h5py
from mpi4py import MPI
import numpy as np
import time
import glob
import os
from codes import progenitor_particles
comm = MPI.COMM_WORLD
rank = co... |
# Copyright 2018-2021 Xanadu Quantum 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... |
import re
from django.db import models
from django.utils import timezone
from common.models import BaseModel
from organization.models import Organization
class ClientIndustry(BaseModel):
"""Client industry model"""
name = models.CharField(max_length=100, null=False)
name_slug = models.Char... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
i... |
import cv2 as cv
import numpy as np
IMAGE = cv.imread('D:\@Semester 06\Digital Image Processing\Lab\Manuals\Figures\lab7\_img1.png', 0)
cv.imshow('Original Image', IMAGE)
cv.waitKey()
cv.destroyAllWindows()
print(IMAGE.shape)
def globalAdaptiveThreshold(_img):
size = np.shape(_img) # Find img size
rows = s... |
import logging
from twilio.rest import Client
from twilio.base.exceptions import TwilioException
class TwilioSender:
def __init__(self, filename):
with open(filename) as f:
account_sid, auth_token, from_phone_num, my_phone_num = f.readlines()
account_sid = account_sid[:-1]
... |
'''Test the Collector cidr methods '''
import ipaddress
import spectreapi
def test_collector(server):
'''Make sure we can get collectors'''
collector = server.get_collector_by_name('RodSerling')
assert collector.name == 'RodSerling', "Collectors should have names"
def test_get_targets(server):
'''Make... |
import decimal
import os
from contextlib import contextmanager
from django.test import TestCase
from django.core.exceptions import ImproperlyConfigured
from mock import patch
from configurations.values import (Value, BooleanValue, IntegerValue,
FloatValue, DecimalValue, ListValue,
... |
__author__ = "Andy Dustman <farcepest@gmail.com>"
version_info = (1,3,6,'final',1)
__version__ = "1.3.6"
|
# Distributed under the MIT License.
# See LICENSE.txt for details.
import unittest
from spectre import Spectral
from spectre import DataStructures
from spectre import Interpolation
from numpy.polynomial.legendre import Legendre
import numpy as np
class TestRegularGrid(unittest.TestCase):
# arbitrary polynomial... |
from itertools import permutations
def possible_permutations(sequence):
for per in permutations(sequence):
yield list(per)
'''
Create a generator function called possible_permutations() which should receive a list and return lists with all possible permutations between it's elements.
'''
[print(n) for ... |
import puzzleinput
adapters = sorted(puzzleinput.numbers)
adapters.append(adapters[-1]+3)
one_diffs = 0
three_diffs = 0
jolts = 0
for adapter in adapters:
difference = adapter - jolts
if difference <= 3:
jolts += difference
if difference == 1:
one_diffs += 1
if difference =... |
import os
import subprocess
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
client_address = "http://localhost:5000/vat.html?actor=client"
server_address = "http://localhost:5000/vat.html?actor=server&name=server"
print("client", os.getcwd())
def retry_until(until, retri... |
from kafka import KafkaProducer
import json
import sys
import time
class ProducerServer(KafkaProducer):
def __init__(self, input_file, topic, **kwargs):
super().__init__(**kwargs)
self.input_file = input_file
self.topic = topic
#TODO we're generating a dummy data
def generate_data... |
from collections import defaultdict
from functools import lru_cache
from .constants import (
MAX_SQUARE,
MIN_SQUARE,
MAX_INT,
NORTH,
EAST,
SOUTH,
WEST,
NE,
SE,
SW,
NW,
)
from .types import (
DIRECTIONS,
EMPTY,
UNIVERSE,
Bitboard,
Color,
PieceType,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author : YongJie-Xie
@Contact : fsswxyj@qq.com
@DateTime : 0000-00-00 00:00
@Description : 数据库操作类的测试类
@FileName : test_database.py
@License : MIT License
@ProjectName : Py3Scripts
@Software : PyCharm
@Version : 1.1
"""
import MySQLdb
from MySQ... |
# Copyright 2015 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.
# Functions in this file relies on depot_tools been checked-out as a sibling
# of infra.git.
import logging
import os
import re
import subprocess
BASE_DIR... |
def test_warning_to_error_translation():
import warnings
statement = """\
def wrong1():
a = 1
b = 2
global a
global b
"""
with warnings.catch_warnings():
warnings.filterwarnings("error", module="<test string>")
try:
compile(statement, '<test string>', 'exec')
... |
import pandas as pd
import pickle
from sklearn.model_selection import GridSearchCV, KFold
from sklearn.preprocessing import MinMaxScaler
from sklearn.svm import SVR
pd.options.mode.chained_assignment = None
# Load the entire set
df = pd.read_csv('../data/dataset_processed.csv', index_col=0)
target = df['Enthalpy(kcal)... |
import tensorflow as tf
def layer(input_layer, num_next_neurons, is_output=False):
num_prev_neurons = int(input_layer.shape[1])
shape = [num_prev_neurons, num_next_neurons]
if is_output:
weight_init = tf.random_uniform_initializer(minval=-3e-3, maxval=3e-3)
bias_init = tf.ran... |
import numpy as np
class LinearRegression:
def __init__(self, fit_intercept: bool=True):
self.fit_intercept = fit_intercept
def fit(self, X:np.ndarray, Y:np.ndarray):
if X.shape[0] != Y.shape[0]:
raise ValueError(f"Y must have shape {(X.shape[0],)}")
copy_X = np.in... |
"""
MetaGenScope-CLI is used to upload data sets to the MetaGenScope web platform.
"""
from setuptools import find_packages, setup
dependencies = [
'click',
'requests',
'configparser',
'pandas',
'datasuper==0.9.0',
]
dependency_links = [
'git+https://github.com/dcdanko/DataSuper.git@develop#eg... |
from django.db import models
# Create your models here.
class Session_data(models.Model):
session_id = models.CharField(max_length=200, primary_key=True)
usr_data = models.TextField()
total_img = models.IntegerField()
spp = models.IntegerField()
lock = models.IntegerField() |
'''
Copyright (C) 2018 Intel 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
?
Unless required by applicable law or agreed to in writing,
so... |
"""
Module for managing the climate within a room.
* It reads/listens to a temperature address from KNX bus.
* Manages and sends the desired setpoint to KNX bus.
Modified by Haifeng for KTS smart solution in Guohao Changfeng Residence
- Air conditioner: temperature, target_temperature, operation_mode, fan_mode, on_of... |
# /usr/bin/env python
# coding:utf-8
"""
Author: zhiying
URL: www.zhouzying.cn
Data: 2019-01-24
Description: B站用户信息爬虫
抓取字段:用户id,昵称,性别,头像,等级,经验值,粉丝数,生日,地址,注册时间,签名,等级与经验值等。抓取之后生成B站用户数据报告。
"""
import requests
import time
import pymysql.cursors
def get_info():
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64)... |
"""
Defines package metadata.
Be careful not to pull in anything Django-related here (this may complicate access to the
metadata defined below).
"""
from pathlib import PurePath
version_file_path = PurePath(__file__).parent / 'VERSION'
with open(version_file_path) as file:
__version__ = file.read().strip()
|
import os
import logging
import math
from pyvivado import builder, interface, signal
from rfgnocchi import config, noc, ettus
logger = logging.getLogger(__name__)
class NocBlockDummyBuilder(builder.Builder):
def __init__(self, params):
super().__init__(params)
module_name = 'n... |
# -*- coding: utf-8 -*-
import torch
from torch import nn
from torch.autograd import Variable
from ..utils.nn import get_rnn_hidden_state
from . import FF, Attention
class ReverseVideoDecoder(nn.Module):
"""
A reverse video feature reconstruction decoder
"""
def __init__(self, input_size, hidden_... |
#!/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 unittest
import shutil
import json
import os
import tempfile
import time
import threading
import shlex
import tr... |
# Generated by Django 3.1.7 on 2021-05-16 06:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AsteriskPublication',
fiel... |
from rest_framework import serializers
from cards.models import CardEffect
def validate_effect_modifiers(card_effect: CardEffect, power: int or None, range_: float or None):
"""
Checks if given card effect should have modifiers and checks if they were provided.
If they were not provided raises Validation... |
# 3.2/pinmux.py
# Part of PyBBIO
# github.com/alexanderhiam/PyBBIO
# MIT License
#
# Beaglebone pinmux driver
# For Beaglebones with 3.2 kernel
from config import *
from sysfs import kernelFileIO
def pinMux(gpio_pin, mode, preserve_mode_on_exit=False):
""" Uses kernel omap_mux files to set pin modes. """
# Ther... |
import backoff
import requests
import yaml
from artifactory import ArtifactoryPath, RepositoryLocal
import zipfile
import os
import subprocess
from multiprocessing.dummy import Pool
from functools import partial
from delivery_tool.exceptions import ApplicationException
import tempfile
tf = tempfile.TemporaryDirectory... |
import cmws.slurm_util
import cmws.examples.scene_understanding.run
def get_run_argss():
mode = "cube"
experiment_name = f"noColor_{mode}"
for seed in range(5):
for num_grid_rows, num_grid_cols in [[2, 2]]:
for shrink_factor in [0.01,0.03,0.1,0.3]:
if num_grid_rows =... |
import pickle
import secrets
from collections import namedtuple
OfferDiff = namedtuple('OfferDiff', ('new', 'deleted'))
class PublishedMessage:
def __init__(self, text=None, messageId=None, authKeys=None):
self.text = text
self.messageId = messageId
self.authKeys = authKeys or list()
def addAut... |
def F(x):
return a*(x**4)+b*(x**3)+c*(x**2)+d*(x)+e-f
while True:
try:
a, b, c, d, e, f = [int(i) for i in raw_input().split()]
start = -10.0**70
end = 10.0**70
last = -1
spec = False
while True:
if(end-start == 1 and F(end)!= 0 and F(start) != 0):
spec = True
break
mid = (start+end)/2.... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-05 02:27
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('operacion', '0013_orden_comision'),
]
operations = [
... |
#!/usr/bin/env python
# This is a simple script meant to retrieve all files from a web server with an HTML-fronted S3 bucket and scan
# the files for secrets using duroc_hog. It will then post the results to Insights.
import os
import gzip
import pprint
import re
import requests
import tempfile
import sys
import subp... |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
from datetime import datetime
import dateparser
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' HELPER FUNCTIONS '''
class Client(BaseClient):
def __init__(... |
from django.apps import AppConfig
class GifcolAppConfig(AppConfig):
name = 'gifcol_app'
|
import pyexlatex as pl
import pyexlatex.table as lt
import pyexlatex.presentation as lp
import pyexlatex.graphics as lg
import pyexlatex.layouts as ll
import plbuild
from lectures.intro.main import get_intro_lecture
from plbuild.paths import images_path
from schedule.main import LECTURE_1_NAME
AUTHORS = ['Nick DeRobe... |
# coding=utf-8
# *** WARNING: this file was generated by 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 . im... |
# Generated by Django 3.1.4 on 2021-10-29 17:50
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0032_auto_20211029_2051'),
]
operations = [
migrations.AddField(
model_name='payment_link',
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 23 00:37:13 2018
@author: jack.lingheng.meng
"""
import logging
import tensorflow as tf
import numpy as np
import time
from datetime import datetime, date
import sched
from threading import Thread
import os
from Environment.LASEnv import LASEnv... |
# --------------------------------------------------------
# This code is modified from Jumpin2's repository.
# https://github.com/Jumpin2/HGA
# --------------------------------------------------------
import torch
import torch.nn as nn
from torch.nn import functional as F
import numpy as np
from model.modules import ... |
#!/usr/bin/env python3
import sys, base64
import xml.etree.ElementTree as ET
import xml.dom.minidom as md
from struct import unpack, unpack_from, iter_unpack
from pprint import pprint
from collections import defaultdict, namedtuple
Point = namedtuple("Point", "x y z")
class DataElement(ET.Element):
def __init__(s... |
import sys
import os
import json
from pathlib import Path
SETTINGS = {
'editor.renderWhitespace': 'boundary',
}
def _conf_exit(code, rm=False):
input('\n処理を終了します。メッセージを確認してEnterを押してください。')
if rm: os.remove(__file__)
sys.exit(code)
def get_vscode_settings():
user = os.getenv('... |
from libraries import *
from preprocess import preprocess_
#load the train file tokens
with open(r'../data/train_stem.txt','r',encoding='utf-8') as file_:
train_stemm = file_.read().splitlines()
train_stem=[]
for i in train_stemm:
train_stem.append(i.split())
#make a single list of all the tokens and pass it ... |
'''
databases
=========
Access to all the database stores.
'''
from .block_followers import (
ACCOUNTS_PROCESSED,
FOLLOWERS_SEEN,
FOLLOWERS_BLOCKED
)
from .block_media_replies import (
TWEETS_PROCESSED,
REPLIES_PROCESSED,
REPLIERS_SEEN,
REPLIERS_BLOCKED
)
def get_databases():... |
from django import forms
class UserInfoSearchForm(forms.Form):
real_name = forms.CharField(max_length=50, required=False)
sex = forms.CharField(max_length=50,required=False)
age = forms.IntegerField(help_text='年龄', required=False)
email = forms.EmailField(max_length=50, required=False)
# phone = f... |
# Generated by Django 3.1.5 on 2021-01-17 19:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
def run():
my_list = [1, 'Hello', True, 4.5]
my_dict = {'firstname': 'Hector', 'lastname': "Olvera"}
super_list = [
{"firstname": 'Facundo', 'lastname': 'García'},
{'firstname': 'Miguel', 'lastname': 'Torres'},
{'firstname': 'Pepe', 'lastname': 'Rodelo'},
]
super_dict = {
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from unittest.mock import Mock
import pytest
from click.testing import CliRunner
from yeahyeah_plugins.path_item_plugin.core import PathItemPlugin
from yeahyeah.core import YeahYeah
@pytest.fixture(autouse=True)
def disable_click_echo(monkeypatc... |
from .upload import PharmgkbUploader
from .dump import PharmgkbDumper
|
# Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... |
import csv
with open('Depth Data/KinectDataRaw.csv', 'r', newline='') as file:
reader = csv.reader(file)
fileWriter = open("Depth Data/KinectDataCorrect.csv", "w")
index = 0
reverseSpot = 487 #CHANGE
for row in reader:
target = row.pop(0) #Remove the target
row = list(map(int, row)... |
# -*- coding:utf8 -*-
""" Lexical analysis is the process of analyzing a stream of individual characters (normally arranged as lines),
into a sequence of lexical tokens (tokenization. for instance of "words" and punctuation symbols that make up source code)
to feed into the parser. Roughly the equivalent of splitting o... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 21 09:21:55 2016
@author: Katherine
"""
# -*- coding: utf-8 -*-
"""
Alpine Tundra Model
Created on Sun Mar 27 15:51:07 2016
@author: Katherine
"""
from Parameters_with_Overland_Flow import *
import numpy as np
def Alpine_Tundra_Model(t,y,SWCSOIL,TSOIL,thetaS_mod, LAI... |
#!/usr/bin/python
import os
import socket
import sys
import signal
if len(sys.argv) == 1:
sys.exit('usage: %s [--server directory] args...' % sys.argv[0])
if sys.argv[1] == '--server':
dir = sys.argv[2]
del sys.argv[1:3]
else:
dir = '.'
stdin_path = os.readlink('/proc/self/fd/0')
stdout_path = os.rea... |
from fastapi import HTTPException
from app.api import database
from app.api.models import categories, CategoryIn, CategoryOut
async def get_category(category_id: int):
"""Get category with set id from database."""
return await database.fetch_one(query=categories.select().where(categories.c.category_id == cat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.