content stringlengths 5 1.05M |
|---|
from Python_Fluigent import *
from sys import stdout
import time
mfcs = MFCS_EZ()
frp = FRP()
Q0 = [10,10] #uL/min
PdQ= [0,0]
IdQ = [0,0]
PdQprev = [0,0]
DdQ = [0,0]
P0 = [0,0]
#PID coefficients
p = 1.
i = 1.
d = 0.
P0min = 0.
P0max = 1024.
while True:
Q = frp.read_flow_rate([1,2])
P = ... |
try:
from typing import ClassVar
from tkinter import Tk, Frame, Label, Button, ttk, Canvas, Scrollbar, Radiobutton, StringVar, IntVar, Listbox, Toplevel
from tkinter.filedialog import askdirectory
from os.path import join, basename, abspath, isfile, isdir, splitext
from os import listdir, stat, syst... |
import praw
import config
from time import sleep
reddit_conn = ""
class Reddit:
@staticmethod
def bot_login():
global reddit_conn
reddit_conn = praw.Reddit(client_id=config.client_id,
client_secret=config.client_secret,
pass... |
import random
from players import Dealer, Player
from settings import number_names
class Raffle(object):
"""This class represents a game from begging to the end. It inits instance of Dealer and Player classes,
list of unique numbers from 1 to 90, counts of rounds played, list of selected numbers and ... |
import unittest
import numpy as np
from src.expression.abstract_expression import ExpressionType
from src.expression.constant_value_expression import ConstantValueExpression
from src.expression.tuple_value_expression import TupleValueExpression
from src.expression.arithmetic_expression import ArithmeticExpression
from... |
#_*_ coding: UTF-8 _*_
"""
((())) -> YES
()) -> NO
"""
def check(value):
"""This function is problem solving using stack structure."""
cnt = 0
for i in value:
if i == "(":
cnt = cnt+1
else:
if value[cnt-1] == "(":
cnt -= 1
else:
... |
from collections import defaultdict
from typing import (
Optional,
Type,
)
from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect
from django.template import (
Context,
Template,
)
from django.utils.translation import gettext
from tri_declarative import (
EM... |
import sys
from swift.codegen import dbschemegen
from swift.codegen.lib import dbscheme
from swift.codegen.test.utils import *
def generate(opts, renderer):
(out, data), = run_generation(dbschemegen.generate, opts, renderer).items()
assert out is opts.dbscheme
return data
def test_empty(opts, input, re... |
from flask import Flask#从flask包中导入Flask类
from config import Config #从config文件中导入Config类
app = Flask(__name__)#将Flask类的实例 赋值给名为 app 的变量。这个实例成为app包的成员。
app.config.from_object(Config)
#print('等会谁(哪个包或模块)在使用我:',__name__)
from app import routes#从app包中导入模块routes
# #注:上面两个app是完全不同的东西。两者都是纯粹约定俗成的命名,可重命名其他内容。
|
from django.db import models
class Country(models.Model):
"""Model for countries"""
name = models.CharField(max_length=45, blank=False)
def __unicode__(self):
return self.name
class Meta:
app_label = 'picmodels'
verbose_name_plural = "Countries"
ordering = ["name"]
... |
from Shared.functions.logging import ElevatorLogger
def init_logging() -> None:
# Initialize formatter
logger = ElevatorLogger("Backend")
# Initialize logging for incoming requests
logger.make_logger("requests")
logger.make_logger("exceptions")
# Initialize logging for external api requests
... |
#!/usr/bin/python2.7
'''
---------------------------
Licensing and Distribution
---------------------------
Program name: Pilgrim
Version : 1.0
License : MIT/x11
Copyright (c) 2019, David Ferro Costas (david.ferro@usc.es) and
Antonio Fernandez Ramos (qf.ramos@usc.es)
Permission is hereby granted, free of ch... |
import spacy
import csv
from typing import List, Tuple
Sentence = Tuple[str,str,str]
Noun = Tuple[str,str]
def read_sentences(file_name: str, n=100000) -> List[Sentence]:
# Read sentences from a csv file at file_name.
# n is the number of rows to return. Passing n=None reads the entire file
# Returns list... |
''' fasta
Module for reading and writing PHYLIP files.
'''
import os
import re
from typing import Tuple, Union
import numpy
import pyckmeans.distance
WHITESPACE_RE = re.compile(r'\s+')
class InvalidPhylipAlignmentError(Exception):
'''InvalidPhylipAlignmentError
'''
def read_phylip_alignment(
phyl... |
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
from app import app as application # noqa
|
# Generated by Django 2.1.3 on 2021-08-24 15:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('restaurant', '0004_auto_... |
from .runners import SupervisedRunner
|
from abc import ABC, abstractmethod
class Element(ABC):
def __set_name__(self, owner, name):
self.private_name = '_' + name
def __get__(self, obj, objtype=None):
return getattr(obj, self.private_name)
def __set__(self, obj, value):
value = self.parser(value)
setattr(obj, self.private_name, value)
@abs... |
'''
Created by:
Juan Sarria
March 17, 2016
'''
import pandas as pd, timeit as tm, pickle as pk, csv, sys
from utilities2 import one_hot_encoding, number_graffiti, avg_closest_properties, closest_skytrain, number_street_lights
from utilities2 import locate_neighbourhood
from utilities import number_of_homeless_shelters_... |
from django.urls import path, re_path
from user import views
from biography import views as view_bio
app_name = 'user'
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name='create'),
path('token/', views.CreateTokenView.as_view(), name='token'),
path('me/', views.ManageUserView.as_view({
... |
#
# Copyright 2014-15 the original author or 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 ag... |
from PIL import Image
import os
import numpy as np
import sys
import csv
import datetime
np.set_printoptions(threshold=sys.maxsize)
#im = Image.open(os.path.join(os.path.dirname(__file__), "mask_adjusted_images/cardboard/image00018.jpg"))
#pix = im.load()
#Working properly
def getBitArray(category, imageName):
i... |
# -*- coding:utf-8 -*-
'''
This script is used to generate png files
File system architecture:
-- anchor_data
|-- seq.anchor1.neg2.txt
|-- seq.anchor1.pos.txt
|-- seq.anchor2.neg2.txt
|-- seq.anchor2.pos.txt
-- merge_before_train
|-- train
|-- 1
|-- 0
|-- test
|-- 1
|-- 0
|-- ... |
# coding: utf-8
from __future__ import unicode_literals
import pytest
# Examples taken from the "Big List of Naughty Strings"
# https://github.com/minimaxir/big-list-of-naughty-strings
NAUGHTY_STRINGS = [
# ASCII punctuation
",./;'[]\-=",
'<>?:"{}|_+',
'!@#$%^&*()`~"',
# Unicode ... |
import os
import json
from .commands import NetWorkCommands
root = os.path.dirname(__file__)
literal_file = os.path.join(root, 'literals.json')
with open(literal_file) as f:
literals = json.load(f)
def get_literals(literal_type, type_=tuple):
# Where `literal_type` is one of 'keywords', 'functions', 'dataty... |
import sys
import numpy as np
class Octopi:
def __init__(self, field):
self.field = field
self.flashers = set()
self.total_flash = 0
def step(self):
y_max,x_max = self.field.shape
# Debugs
print('Flashed', self.flashers)
self.total_flash += len(self.flashers)
self.flashers = set()
# Increase Ene... |
from rest_framework import serializers
from .models import (
Worker
)
class WorkerSerializer(serializers.ModelSerializer):
class Meta:
model = Worker
fields = ('id', 'username', 'email', 'password', 'cpf', 'permission')
|
class Solution:
def numTrees(self, n):
dpTable = [[0 for y in xrange(0, n + 2)] for x in xrange(0, n + 2)]
for x in xrange(1, n + 2):
dpTable[x][x] = 1
for len in xrange(1, n + 1):
for x in xrange(1, n + 1 - (len - 1)):
for i in xrange(x, x + ... |
def exclude_val(data, key, value):
"""
check if certain key has certain value, return False if so and True otherwise
"""
# try to get value variable from parser specific variables
value = _ttp_["parser_object"].vars.get(value, value)
try:
if data[key] == value:
return data, F... |
import numpy as np
from scipy.stats import zscore
import matplotlib.pyplot as plt
from borsar.utils import find_range
from .utils import mne_types
def correct_egi_channel_names(eeg):
# define function correcting channel names:
def corr_ch_names(name):
if name.startswith('EEG'):
if name ==... |
import numpy as np
import re
import langdetect
import string
remove = re.compile(r"(?:http(s)?[^\s]+|(pic\.[^s]+)|@[\s]+)")
alpha = re.compile(r'(?:[a-zA-Z\']{2,15}|[aAiI])')
printable = set(string.printable)
def load_glove(path, vocab, embed_size=300):
E = dict()
vocab = set(vocab)
found = list()
wit... |
from typing import TYPE_CHECKING
from groupy.client import Groupy
from itests.setup import api_server
if TYPE_CHECKING:
from py.path import LocalPath
from tests.setup import SetupTest
def create_graph(setup):
# type: (SetupTest) -> None
"""Create a simple graph structure with some permission grants... |
'''
Source : https://leetcode.com/problems/positions-of-large-groups/
Author : Yuan Wang
Date : 2018-06-17
/**********************************************************************************
*In a string S of lowercase letters, these letters form consecutive groups of the same character.
*
*For example, a string li... |
"""Value coder"""
import numpy as np
from jpegdna.coders import AbstractCoder
from jpegdna.coders import AutomataGetterException, AutomataSetterException, AutomataSetterExceptionEncode, AutomataSetterExceptionDecode
def get_codebook(ad_bits, codebook):
"""Returns the exhaustive codebooks for a given codeword leng... |
#!/usr/bin/env python3
import click
import logging
import logging.config
from ..kernel import init_kernel
from ..logger import init_logger
@click.command()
@click.option('--ip-address', default='0.0.0.0')
@click.option('--port', default=6699)
@click.option('--session-mode', is_flag=True)
@click.option('--ping-interva... |
import sys
import socket
import json
class GameSocket:
def __init__(self, host, port):
self.host = host
self.port = port
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def connect(self):
try:
self.socket.connect((self.host, self.port))
print("Connected to server.")
exc... |
"""Utils."""
# Copyright 2020-2022 Blue Brain Project / EPFL
# 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... |
# Copyright 2021 AIPlan4EU project
#
# 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 wri... |
import connexion
import six
from swagger_server.models.data_utility import DataUtility # noqa: E501
from swagger_server.models.refinement_request import RefinementRequest # noqa: E501
from swagger_server import util
import DQWeighter
import json
import pandas as pd
import os
def refinement(datautility): # noqa: E... |
from numba import njit
from seam.add.generic import addOneColumnWithEnergyProvided
from seam.energy.energy import computeDeepEnergy
from seam.seamfinding.gencolfwd import generateColumnForward
from seam.utils import transposeImg, transposeGray
@njit(parallel=True,nogil=True)
def deepAddOneColumnForward(npimg,npgray,... |
'''Toggle the lights'''
import RPi.GPIO as GPIO
import time
# init list with pin numbers
#pinList = [2, 3, 4, 17, 27, 22, 10, 9]
pinList = [11,12,13, 15, 16, 18, 22, 7]
# 1 2 3 4 5 6 7 ,8
# plug numbers
lightlist = [3,4,5,6,7,8]
SleepTimeS = 1
SleepTime = [6,1,1]
light1=lightlist[0]
light2=lightlist... |
import functools
import re
import pytest
from autoray import do, lazy, to_numpy, infer_backend, get_dtype_name, astype
from numpy.testing import assert_allclose
from .test_autoray import BACKENDS, gen_rand
def test_manual_construct():
def foo(a, b, c):
a1, a2 = a
b1 = b['1']
c1, c2 = c... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Module test_spectral_spatial_resolution_model - Contains the unit tests for
the datamodels.miri_spectral_spatial_resolution_model module.
:History:
10 May 2017: Original version.
12 Jul 2017: Replaced "clobber" parameter with "overwrite".
26 Sep 2018: Major reorganis... |
from __future__ import print_function
import os
import json
import torch
import pickle
import numpy as np
import torch.nn as nn
import torch.utils.data
import torch.nn.parallel
from torch.autograd import Variable
import torchvision.datasets as dset
import torchvision.transforms as transforms
'''
Split the dataset... |
# DO NOT EDIT
# generated with the following command:
#
# tools/js/bower2bazel.py -w lib/js/bower_archives.bzl -b lib/js/bower_components.bzl
#
load("//tools/bzl:js.bzl", "bower_archive")
def load_bower_archives():
bower_archive(
name = "iron-a11y-announcer",
package = "iron-a11y-announcer",
version = ... |
def duplicate_encode(word):
word = word.lower()
all_letters = set()
duplicates = set()
result = ''
for letter in word:
if letter in all_letters:
duplicates.add(letter)
else:
all_letters.add(letter)
for letter in word:
if letter in duplicates:
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_almost_equal
import abel
from abel.benchmark import is_symmetric
DATA_DIR = os.path.join(os.path.split(__file... |
import sys
import dataset as ds
def sort_by_bright(img):
size = len(img)
# use index as a bright adjuster for images of same brightness
bright = lambda e: e[0]**2 + e[1]**2 + e[2]**2 - e[3]/size
by_blight = sorted(img, key=bright)
return list(by_blight)
def main(k=2):
img2 = ds.image2(append_... |
# encoding=UTF-8
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('taskgraph')
|
from configparser import ConfigParser
import os
path = os.path.dirname(__file__)+'/db.ini'
test_path = os.path.dirname(__file__)+'/testdb.ini'
def config(filename=path, section='postgresql'):
# create a parser
parser = ConfigParser()
# read config file
parser.read(filename)
# get section, default... |
"""
https://www.hackerrank.com/challenges/time-conversion/problem?isFullScreen=true
"""
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'timeConversion' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING s as parameter.
#
def timeC... |
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
'''
↓を書け
n_epoch = 30
for epoch in range(n_epoch):
print(f'train_loss: {epoch*1}')
print(f'valid_loss: {epoch*2}')
'''
n_epoch = 30
for epoch in range(n_epoch):
print(f'train_loss: {epoch*1}')
|
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 28 11:25:43 2019
@author: Taufik Sutanto
taufik@tau-data.id
https://tau-data.id
~~Perjanjian Penggunaan Materi & Codes (PPMC) - License:~~
* Modul Python dan gambar-gambar (images) yang digunakan adalah milik dari berbagai sumber sebagaimana yang telah dicantumkan dalam m... |
# Prime permutations
# Problem 49
# The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another.
# There are no arithmetic sequences made up of three 1-, 2-,... |
# -*- coding: utf-8 -*-
from flask_assets import Bundle, Environment
css = Bundle(
Bundle('css/bootstrap.less',
depends=('**/*.less'),
output='css/bootstrap.css',
filters='less',
),
'libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.css',
'libs/bootstrap-vertical-tabs/b... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... |
"""
obstree/model.py
================
PyQt models for GSadjust. Handles assembling input matrices for
network adjustment.
--------------------------------------------------------------------------------
NB: PyQt models follow the PyQt CamelCase naming convention. All other
methods/functions in GSadjust use P... |
#!/usr/bin/env python3
import pytest
from datetime import datetime,timedelta
from croniter import croniter
from validate import validate_event_webhook,validate_event_headers
from queue import Empty
import time
# The create and delete tests should ideally go in setup and teardown YAML files,
# We can't use that here b... |
from enum import Enum
from typing import Optional
from pydantic import BaseModel
from pydantic import Field
from pydantic.types import DirectoryPath
class HridHandling(str, Enum):
default = "default"
preserve001 = "preserve001"
class FileDefinition(BaseModel):
file_name: str
suppressed: Optional[bo... |
# -*- coding: utf-8 -*-
import sys
import socket
import ssl
import json
import requests
import urllib # https://docs.python.org/3/library/urllib.parse.html
import uuid
import re
import json
from bs4 import BeautifulSoup
import config
from tests.utils import *
import gettext
_ = gettext.gettext
# DEFAULTS
request_time... |
"""Single graphs."""
import functools
import os
from typing import Any, Mapping, NamedTuple, Optional
import numpy as np
import scipy.sparse as sp
import wget
from gud.data.path import data_dir
from gud.data.registry import Registry
single_graphs = Registry("single_graphs")
class GraphData(NamedTuple):
adjacen... |
#! /usr/bin/env python
#
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2015. It is licensed under
# the three-clause BSD license; see LICENSE.
# Contact: khmer-project@idyll.org
# pylint: disable=missing-docstring,invalid-name
"""
Build a countin... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 6 10:00:39 2020
@author: m1390
"""
import numpy as np
class MACE:
"""
MACE filter class:
Minimum Average Correlation Energy filter implementation
X: D x N frequency domain data matrix (fft)
D: average spectral... |
import csv
from textacy.text_utils import detect_language
from src.utils import preprocess
UBUNTU_CORPUS = 'data/processed/dialogue/ubuntu.csv'
MICROSOFT_CORPUS = 'data/processed/dialogue/microsoft.csv'
MOVIES_CORPUS = 'data/processed/dialogue/movies.csv'
REDDIT_CORPUS = 'data/processed/dialogue/reddit.csv'
OUTPUT_F... |
from os.path import dirname
from os.path import join
from setuptools import setup
def read_file(fname):
"Read a local file"
return open(join(dirname(__file__), fname)).read()
setup(
name='mkdocs-codeinclude-plugin',
version_config={
"version_format": "{tag}.dev{sha}",
"starting_versi... |
#!/usr/bin/env conda-execute
# conda execute
# env:
# - git
# - python
# - conda-smithy
# - gitpython
# - pygithub
# channels:
# - conda-forge
# run_with: python
import os
import argparse
import textwrap
import random
import re
import git
import github
import conda_smithy.github
import conda_smithy.lint_recip... |
import numpy
from chainer import functions
from chainer import testing
def _decorrelated_batch_normalization(x, mean, projection, groups):
xs = numpy.split(x, groups, axis=1)
assert mean.shape[0] == groups
assert projection.shape[0] == groups
ys = [
_decorrelated_batch_normalization_1group(xi... |
import FWCore.ParameterSet.Config as cms
#==============================================================================
# Sequence to make final electrons.
# In the past, this was including the seeding, but this one is directly
# imported in the reco sequences since the integration with pflow.
#======================... |
# run with: python nb2sln.py <filename>
import sys, json, os, pathlib
if __name__ == "__main__":
fn = str(sys.argv[1])
dic = json.load(open(fn, 'r', encoding='utf8'))
def is_code(cell):
return cell['cell_type'] == 'code'
def is_solution_cell(content_list):
kw = r"%load solutions"
cont_str = "".join... |
# We want these types to be flexible to allow for updated API responses
# or cutting-edge options to not break the client for older SDK versions;
# as such, everything is implemented using TypedDicts
# instead of, say, dataclasses.
import sys
from datetime import datetime
from typing import Optional, List, Union, Any,... |
from flask_babelex import Domain, Babel
import flask
from .. import translations
babel_domain = Domain(translations.__path__[0])
_ = babel_domain.gettext
gettext = babel_domain.gettext
pgettext = babel_domain.pgettext
ngettext = babel_domain.ngettext
npgettext = babel_domain.npgettext
lazy_gettext = babel_domain.lazy_... |
insert_service_mesh_sql = """
INSERT INTO tb_service_mesh (
NAMESPACE
, NAME
, SERVICES
, SERVICE_HOSTS
, SERVICE_ROUTES
) VALUES (
{namespace}
, {name}
, {services}
, {serviceHosts}
, {serviceRoutes}
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from fl import translate
import unittest
class TestTranslate(unittest.TestCase):
def test_translate_char(self):
c2 = translate('a', 'abc', 'def')
self.assertEqual('d', c2)
def test_translate_uppercase_char(self):
c2 = ... |
#Tyler Smith, Kamryn Harris, Weiyi Chen
#tsmith328@gatech.edu, kharris48@gatech.edu, wchen376@gatech.edu
#A06
#We worked on this project alone as a group, using this semester's course materials
#the robot with hello kitty robot
from Myro import*
def helloKitty():
i=0
while i<5:
turnLeft(1,0.5)
turnRig... |
#!/usr/local/bin/python
import os
import os.path
import sys
import getopt
import fpformat
import mask
import signal
import time
width = 266
height = 200
child_pid = None
#the value is the index of the last image
USAGE = """make.py --all --pretend"""
try:
opts, args = getopt.getopt(sys.argv[1:], 'ap', ['all',... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys
import re
import chardet
import time
import itertools
import platform
from string import digits, ascii_lowercase, ascii_uppercase
from subprocess import Popen, PIPE
YUBIKEY_PERSONALIZE_WIN = 'win/bin/ykpersonalize.exe'
YUBIKEY_PERSONALIZE_LINUX = 'linux/ykper... |
"""
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class Types(CloudFormationLintRule):
"""Check if Parameters are typed"""
id = 'E2002'
shortdesc = 'Parameters ... |
from keras.models import load_model, model_from_config
import h5py
from keras import backend as K
K.set_learning_phase(0)
char_cnn = load_model('zoo/07.2 char_cnn_model.h5')
config = char_cnn.get_config()
weights = char_cnn.get_weights()
config = {'config': config,
'class_name': 'Model'}
new_model = model_f... |
# coding=utf-8
# coding=utf-8
# Copyright 2019 The RecSim 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 ap... |
from pyrevit import script
class LineChart:
def __init__(self, data, labels, title=None):
import revitronui
self.output = script.get_output()
self.chart = self.make()
self.chart.data.labels = labels
dataset = self.chart.data.new_dataset(title)
dataset.data = data
if self.hasBackground:
palette = re... |
# This is a custom module we've made.
# Modules are files full of code that you can import into your programs.
# This one teaches our turtle to draw various shapes.
import turtle
def draw_circle(turtle, color, size, x, y):
turtle.speed(400)
turtle.penup()
turtle.color(color)
turtle.fillcolor(color)
turtl... |
# Copyright (c) 2021, eoch and Contributors
# See license.txt
# import frappe
import unittest
class TestPedido(unittest.TestCase):
pass
|
from datetime import datetime
from rest_framework import serializers
from talentmap_api.common.common_helpers import ensure_date
from talentmap_api.common.serializers import PrefetchedSerializer, StaticRepresentationField
from talentmap_api.position.serializers import PositionSerializer
from talentmap_api.bidding.mod... |
# Description:
# In this challenge, you are required to calculate and print the sum of the elements
# in an array, keeping in mind that some of those integers may be quite large.
# Function Description
# Complete the aVeryBigSum function in the editor below. It must return the sum of all array elements.
# aVeryBigSum ... |
from django.db import models
from Poem.poem_super_admin.models import Package
class ProbeManager(models.Manager):
def get_by_natural_key(self, name):
return self.get(name=name)
class ProbeHistoryManager(models.Manager):
def get_by_natural_key(self, name, version):
return self.get(name=name,... |
# app.py
from flask import Flask, render_template, request, jsonify
import AutoStencil as austen
app = Flask(__name__)
@app.route('/')
def main():
return render_template("app.html")
@app.route('/background_process')
def background_process():
try:
points_str = request.args.get('points_string', 0, type... |
#
# PySNMP MIB module ARISTA-BRIDGE-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ARISTA-BRIDGE-EXT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:09:06 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
import pytest
from yelp_beans.logic.meeting_spec import get_specs_for_current_week
from yelp_beans.matching.match import generate_meetings
from yelp_beans.models import User
from yelp_beans.models import UserSubscriptionPreferences
from yelp_beans.send_email import send_batch_initial_opt_in_email
from yelp_beans.send_e... |
import discord, random, asyncio
from discord.ext import commands as client
from Cogs.config import conf
#Imports
class Commands(client.Cog):
def __init__(self, bot):
self.b = bot
@client.command(name='commands', description='displays available commands', help=f"{conf.prefix1}commands")#store command a... |
from wtforms import fields
from peewee import DateTimeField, DateField, TimeField, BaseModel, ForeignKeyField
from wtfpeewee.orm import ModelConverter, model_form
from flask.ext.admin import form
from flask.ext.admin.model.form import InlineFormAdmin
from flask.ext.admin.model.fields import InlineModelFormField
from... |
import json
from datetime import datetime
from app.dao.dashboard import get_income_actions, get_recent_visits_data, get_recent_rents, get_recent_searches_data, get_todo, \
post_recent_search, post_user_data
from app.dao.rent import get_rentcode
from app.dao.money import get_money_item_payer_memo
from app.dao.income... |
# coding=utf-8
# Copyright 2021 The OneFlow 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 require... |
# -*- coding: utf-8 -*-
import os
from os import listdir
from os.path import isfile, join
import json
from urllib.request import urlopen, Request
from lxml import html
class PlatoData(object):
"""
The `PlatoData` represents n object to crawl the stanford philosophy encyclopedia.
"""
BASE_URL = 'http:... |
#!/usr/bin/env python2
import sys
import os
hits = {}
for line in sys.stdin:
cols = line.strip("\n").split("\t")
ref = cols[0]
mag = cols[1]
dist = float(cols[2])
pvalue = float(cols[3])
if os.path.basename(ref) != os.path.basename(mag):
if mag not in hits.keys():
hits[mag]... |
from django.shortcuts import render
# Create your views here.
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from .models import Event_reminder
from registration.forms import RegistrationFormUniqueEmail
from django.template.defaultfilters import slugify
from django.co... |
#!/usr/bin/python
#
# s2-poster.py - Selector Poster for pushing loc8tr output
#
# Usage: python s2-poster.py <server-1>:<port> ... <server-n>:<port>
#
# This is a daemon program that watches for directories created by the
# loc8tr.py telemetry tool. When it finds a new directory, it will take
# the data from loc8tr.j... |
# -*- coding: utf-8 -*-
""" Unit Test On Shapes
description:
This is the unit test for shapess.
content:
- TestLine
- TestCircle
- TestOctagon
- TestRectangle
- TestOctagonLine
- TestParallelogram
author: Shin-Fu (Kelvin) Wu
latest update:
- 2019/05/13
- 2019/05/14 add... |
import numpy as np
def sort_dicoms(dicoms):
"""
Sort the dicoms based om the image possition patient
:param dicoms: list of dicoms
"""
# find most significant axis to use during sorting
# the original way of sorting (first x than y than z) does not work in certain border situations
# wher... |
"""Create schema.
Revision ID: b04e0f09ebca
Revises: None
Create Date: 2016-05-13 11:36:41.293473
"""
# revision identifiers, used by Alembic.
revision = 'b04e0f09ebca'
down_revision = None
from alembic import op
import sqlalchemy as sa
from jekylledit.model.base import JSON
def upgrade():
op.create_table(
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.