content stringlengths 5 1.05M |
|---|
"""
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft Corporation
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/LICEN... |
#
# Grigori Fursin took from http://blog.outcome.io/pytorch-quick-start-classifying-an-image
# and updated to support CK (http://cKnowledge.org/ai)
# Grigori Fursin later updated based on ReQuEST at ASPLOS'18 tournament
#
import io
import sys
import os
import requests
import numpy as np
from PIL import Image
from to... |
# Generated by Django 3.2.3 on 2021-05-20 21:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('typeclasses', '0014_alter_tag_db_category'),
]
operations = [
migrations.AlterModelOptions(
name='attribute',
options={'verb... |
# Generated by Django 3.2.9 on 2021-11-13 20:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoFie... |
from .cleaning_script import CleaningScript
from .concept_map import ConceptMap
class SqlColumn:
def __init__(
self,
table: str,
column: str,
owner: str = None,
cleaning_script: CleaningScript = None,
concept_map: ConceptMap = None,
):
self.table = table... |
from typing import Tuple
import numpy as np
from ...core import ContinuousParameter, InformationSourceParameter, ParameterSpace
from ...core.loop.user_function import MultiSourceFunctionWrapper
def multi_fidelity_currin_function() -> Tuple[MultiSourceFunctionWrapper, ParameterSpace]:
r"""
High fidelity fun... |
import warnings
import numpy as np
import matplotlib.pyplot as plt
__all__ = ['errorfill']
def errorfill(x, y, yerr=None, xerr=None, color=None, ls=None, lw=None,
alpha=1, alpha_fill=0.3, label='', label_fill='', ax=None, marker=None):
"""Plot data with errors marked by a filled region.
Para... |
import torch
import torch.nn as nn
# custom weights initialization called on netG and netD
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
nn.init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
nn.init.normal_(m.weight.data,... |
# 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 requests
from typing import Optional
from scorers import build_scorer
class SimulSTEvaluationService(object):
DEFAULT_... |
from flask import current_app
def increment(key):
counter = current_app.data.driver.db.counter
seq = counter.find_one({'_id': key})
if seq == None:
seq= {"_id": key, "seq": 1}
counter.save(seq)
else:
counter.update({'_id': key},{"$inc": {"seq": 1}})
seq = counter.find_... |
#!/usr/bin/env python
import logging
import os
import flask
import flask_wtf
import api
import socket_api
import views
from find_files import find as find_files
host = os.environ.get('HOST', '0.0.0.0')
port = int(os.environ.get('PORT', 8000))
debug = 'DEBUG' in os.environ
use_reloader = os.environ.get('USE_RELOADER... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2012-2015 Hewlett Packard Enterprise Development LP
# 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 ... |
'''
Created on Nov 3, 2015
@author: bardya
'''
import os
import argparse
from Bio import SeqIO
def parse_args():
parser = argparse.ArgumentParser(description='Given an integer "c" split a multifasta file into n/s files with s sequences.')
parser.add_argument('-i', dest='infilepath', metavar='<fasta_file_... |
version = (0, 5, 1)
|
"""
.. image:: https://img.shields.io/pypi/pyversions/mylogging.svg
:target: https://pypi.python.org/pypi/mylogging/
:alt: Python versions
.. image:: https://badge.fury.io/py/mylogging.svg
:target: https://badge.fury.io/py/mylogging
:alt: PyPI version
.. image:: https://pepy.tech/badge/mylogg... |
// Assumes that the tree is not allowed to contain duplicates
# /* *** ODSATag: checkBST *** */
def checkBST(node, low, high):
if node is None: return True # Empty subtree
rootval = node.value()
if rootval <= low or rootval >= high:
return False # Out of range
return (checkBST(node.left(), l... |
import json
import random
def Rand(start, end, num):
counter = 0
list_rand = []
new = 0
while(counter < num):
new = random.randint(start, end-1)
if new not in list_rand:
list_rand.append(new)
counter = counter + 1
return(list_rand)
stanza = 4 ... |
from common_fixtures import * # NOQA
from common_fixtures import _client_for_user
from selenium import webdriver
from requests.auth import AuthBase
# test the github auth workflow
USER_SCOPE = 'github_user'
TEAM_SCOPE = 'github_team'
ORG_SCOPE = 'github_org'
GITHUB_CLIENT_ID = os.getenv('API_AUTH_GITHUB_CLIENT_ID', N... |
__all__ = ['FastSCNN', 'fastscnn_cityscapes']
from mxnet.context import cpu
from mxnet.gluon.block import HybridBlock
from mxnet.gluon.contrib.nn import Identity
from mxnet.gluon import nn
from common import conv1x1, conv1x1_block, conv3x3_block, dwconv3x3_block, dwsconv3x3_block, Concurrent
class LinearBottleneck(... |
import os
import skimage
import numpy as np
from skimage import io, exposure, img_as_uint, img_as_float
from skimage.transform import rotate, resize
#_________________ Creation des dossiers pour les images d'apprentissage et les images de test___________________
mkdirLearn = "mkdir -p ./traitement/im_learn/"
mkdirTes... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import re
import lxml.etree
from cStringIO import StringIO
from gzip import GzipFile
from holmes.facters import Facter
from holmes.utils import _
ROBOTS_SITEMAP = re.compile('Sitemap:\s+(.*)')
class SitemapFacter(Facter):
@classmethod
def get_fact_... |
__all__ = [
"help",
"start",
"rules",
"io",
"source",
"distro",
"request_function",
"feedback",
"translate",
"search_google",
"search_qwant",
"weather",
"define"
... |
#!/usr/bin/python3.5
import re
import os
import sys
import json
import timeit
import hashlib
import datetime
import requests
import subprocess
from io import BytesIO
from shutil import copyfile
from threading import Thread
from time import gmtime, strftime
from warcio.warcwriter import WARCWriter
from warcio.archiveit... |
import torch
import torch.nn as nn
from torchvision import models
import deep_twist.data.utils as utils
def softmax_l1_loss(output, pos, lambda1=1.0):
rect = pos[0]
theta, rect_coords = output
softmax = nn.CrossEntropyLoss()
l1 = nn.SmoothL1Loss()
theta_target = utils.discretize_theta(rect[:, 2],... |
from businessfunc import VAT2TXT
if __name__ == '__main__':
para = './conf/para.conf'
VAT2TXT(parameter=para) |
from django.shortcuts import render, redirect, get_object_or_404
from .models import *
from store.models import *
from django.http import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
# we need when we click add to cart, get redirected to cart page and product to be added as well
# the process of... |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_certbot_is_existed(host):
cerbot = host.file("/opt/certbot-auto")
assert cerbot.exists
|
# Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Misc utilities
"""
import logging
import os
import tempfile
import hashlib
from pathlib imp... |
from manim_express import EagerModeScene, Size, SceneArgs
from manimlib import *
from manim_express.plot import m_line, m_scatter
# SceneArgs.color = rgb_to_hex([0., 0, 0])
SceneArgs.color = "#222222"
SceneArgs.full_screen = True
# SceneArgs.frame_rate = 30
# SceneArgs.gif = True
scene = EagerModeScene(screen_size=S... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import os
import sys
import socket
from stratum import settings
import stratum.logger
log = stratum.logger.get_logger('proxy')
if __name__ == '__main__':
if len(settings.WALLET)!=42 and len(settings.WALLET)!=40:
log.error("Wrong WALLET!")
s... |
import time
from libs.timetablelib import TimesTable
# Question:
# If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
LIMIT = 1000
def methode1():
# Attempt one, the shitty on... |
from ..utils import Object
class SupergroupFullInfo(Object):
"""
Contains full information about a supergroup or channel
Attributes:
ID (:obj:`str`): ``SupergroupFullInfo``
Args:
description (:obj:`str`):
Supergroup or channel description
member_count (:obj:`int... |
# [기초-종합] 수 나열하기3
# minso.jeong@daum.net
'''
문제링크 : https://www.codeup.kr/problem.php?id=1091
'''
a, m, d, n = map(int, input().split())
for i in range(n-1):
a = a * m + d
print(a) |
# Peter Uhe 2020/01/27
# Extract upstream and downstream points in river network for lisflood inputs.
# THis script needs to be run from the qgis console otherwise doesn't seem to work...
# Run by using this command e.g:
# exec(open('/home/pu17449/src/flood-cascade/rivernet_prep/lisflood_discharge_inputs_qgis.py').read... |
#!/usr/bin/env python
import sys
import numpy as np
import gnsstools.galileo.e6b as e6b
import gnsstools.nco as nco
import gnsstools.io as io
import gnsstools.discriminator as discriminator
class tracking_state:
def __init__(self,fs,prn,code_p,code_f,code_i,carrier_p,carrier_f,carrier_i,mode):
self.fs = fs
... |
from model.log_op import log_iter_func
from model.t_my_state import t_my_state
from model.t_oppo_state import t_oppo_state
from strategy.strategy_entity import *
from utils.print_info import *
import constants.constants
MY_NAME = constants.constants.YOUR_NAME
def check_name():
global MY_NAME
if MY_NAME == "C... |
#!/usr/bin/python
"""
Script that allow to turn on/off the My_Homessistant app by stopping flask
and set state in myh.json used in the manager
"""
import getopt
import json
import logging
import os
import subprocess
import sys
from logging.handlers import RotatingFileHandler
import psutil
def helper():
msg = "... |
from torch.optim import lr_scheduler
from .builder import LR_SCHEDULERS
@LR_SCHEDULERS.register()
def torch_scheduler(torch_optim_class, optimizer, *args, **kwargs):
# A direct mapping
return getattr(lr_scheduler, torch_optim_class)(optimizer, *args, **kwargs)
|
from itertools import chain
from pathlib import Path
import random
import signal
import numpy
import dill
from midi_to_statematrix import (
midiToNoteStateMatrix,
noteStateMatrixToMidi,
)
import data
BATCH_WIDTH = 10 # number of sequences in a batch
BATCH_LENGTH = 16 * 8 # length of each sequence
DIVISION_... |
"""
Requires the application to be running.
"""
import json
import re
import pytest
import socketio
class CustomNamespace(socketio.ClientNamespace):
connected = False
train_result = []
station_name = None
@staticmethod
def on_connect():
CustomNamespace.connected = True
@staticmetho... |
from django.db import models
class Department(models.Model):
dnumber = models.AutoField('Department Number', primary_key=True)
dname = models.CharField('Department Name', max_length=150)
mgr_ssn = models.ForeignKey("employee.Employee", on_delete=models.CASCADE)
mgr_start_date = models.DateField()
... |
import numpy as np
import pandas as pd
from scipy import interpolate
import csv
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Figure
from matplotlib.font_manager... |
from tkinter import *
class MinhaGUI:
def __init__(self):
# Cria janela principal
self.janela_principal = Tk()
# Define o título
self.janela_principal.title("Calcula IMC")
# Cria três frames
self.frame_cima = Frame(self.janela_principal)
self.frame_... |
import os
import sys
from shapeworks import *
def padfailTest1():
img = Image(os.environ["DATA"] + "/1x2x2.nrrd")
img.pad()
try:
val = padfailTest1()
print("padfailTest1 failed")
sys.exit(1)
except:
sys.exit(0)
|
import numpy as np
from scipy.stats import entropy
from .base_decision_tree import BaseDecisionTree
from .rule import Rule
from sklearn.utils import check_array
class TreeID3:
def __init__(self, features):
self.var_index = -1
self.is_leaf = True
self.childlist = []
self.splits = []... |
from datamart.utilities.utils import Utils
from datamart import search, augment
schema = {
"materialization": {
"python_path": "general_materializer",
"arguments": {
"url": "https://en.wikipedia.org/wiki/List_of_Rock_and_Roll_Hall_of_Fame_inductees",
"file_type": "html"
... |
"""
Traning a Mulit-label Model
"""
import sys
import pandas as pd
import numpy as np
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, accuracy_score, classification_report, hamming_loss
from keras.models import Sequ... |
import numpy as np
import torch
from torch.autograd import Variable
from core.observations.deformable_objects.landmarks.landmark import Landmark
from support.utilities.general_settings import Settings
class PointCloud(Landmark):
"""
Points in 2D or 3D space, seen as measures
"""
def __init__(self):
... |
"""Implementation of hypercolumn module from "Hypercolumns for Object Segmentation and Fine-grained Localization"
Original paper: https://arxiv.org/abs/1411.5752
"""
import torch
from torch import nn
from torch.nn import functional as F
from .fpn import FPNFuse
__all__ = ["HyperColumn"]
HyperColumn = FPNFuse
|
#!/usr/bin/env python3
import cbor2
import logging
import time
import math
import base64
import hashlib
from config import serial_sep
import client_common
NAME = "cr"
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(f"app-{NAME}")
logger.setLevel(logging.DEBUG)
def _task_runner(task):
(src, ... |
import enum
import sqlalchemy
from sqlalchemy import BOOLEAN
from sqlalchemy import INT
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import and_
from sqlalchemy import func
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship
from sqlalchemy_utc i... |
def listToInt(listt,base=2):
return reduce(lambda x,y:base*x+y,reversed(listt), 0)
|
import numpy as np
def distance(data):
df = data.reset_index(drop=True)
p1 = df.iloc[:-1]
p2 = df.iloc[1:]
p2 = p2.reset_index(drop=True)
ds = p2 - p1
d = np.sqrt(ds.x ** 2 + ds.y ** 2)
return d.sum()
def total_distance(data):
df = data.reset_index(drop=True)
p1 = df.iloc[0]
... |
from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('CadastraReclamacao',views.CadastraReclamacao,name='reclamacao'),
path('CadastraUsuario',views.signup,name='signup'),
path('',views.logar,name='logar'),
path('SairUsuari... |
import pytest
from mati import Client
@pytest.mark.vcr
def test_retrieve_verification(client: Client):
verification = client.verifications.retrieve('5d9fb1f5bfbfac001a349bfb')
assert verification
|
dist = float(input('Qual a distancia da sua viagem? '))
print('Voce esta prestes a comecar uma viagem de {} km.'.format(dist))
if dist <= 200:
prec = dist * 0.50
else:
prec = dist * 0.45
print('E o preco da sua passagem sera de R$ {:.2f}'.format(prec)) |
"""Message finders are classes that find translated messages.
"""
class BaseMessageFinder(object):
"""Base finder for translated messages.
Subclass this class to implement a custom message finder.
"""
def find(self, language=None):
"""Return a sequence of translated messages.
:param... |
'''
Created on May 23, 2015
@author: fabiomignini
'''
class Unauthorized(Exception):
def __init__(self, message):
self.message = message
def get_mess(self):
return self.message
|
import os
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
return path |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import codecs
import os
import pprint
import sys
import time
from collections import defaultdict
from itertools import chain
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import models
import nli_data
fro... |
from trajectoire import *
from trajectoirearc import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib import animation
P=110 # 1 tour =?
[traj1,traj2]=trajectoirearc(P)
x1=traj1[0]
y1=traj1[1]
yaw1=traj1[2]
cb1=traj1[3]
x2=traj2[0]
y2=traj2... |
#!/usr/bin/env python
# Python Network Programming Cookbook -- Chapter - 4
# This program requires Python 3.5.2 or any later version
# It may run on any other version with/without modifications.
#
# Follow the comments inline to make it run on Python 2.7.x.
import requests
import urllib
# Uncomment the below line fo... |
import reverb
import tensorflow as tf
import numpy as np
EPISODE_LENGTH = 100
OBSERVATION_SPEC = tf.TensorSpec([1530], tf.float32)
LEGALS_MASK_SPEC = tf.TensorSpec([2086], tf.uint8)
POLICY_SPEC = tf.TensorSpec([2086], tf.float32)
VALUE_SPEC = tf.TensorSpec([], tf.float32)
# Initialize the reverb server.
simple_server... |
# https://ourworldindata.org/co2-and-other-greenhouse-gas-emissions
# https://www.reddit.com/r/dataisbeautiful/comments/ickvfq/oc_two_thousand_years_of_global_temperatures_in/g234slz/
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import gif
df = pd.read_csv("data/co2-concentration-long-t... |
import glob
import json
import math
import os
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from . import utils
def get_template_results(cfg):
return {"config": cfg, "results": []}
def save_results(results, label):
del results["config"]["device"]
del results["config"]["cl... |
from collections.abc import Iterable
from contextlib import contextmanager
from functools import partial
from inspect import signature
from bonobo.config import Option
from bonobo.errors import UnrecoverableTypeError
from bonobo.util import deprecated_alias, ensure_tuple
_raw = object()
_args = object()
_none = objec... |
# This file is part of the MapProxy project.
# Copyright (C) 2016 Omniscale <http://omniscale.de>
#
# 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... |
from bbfy.bbfy import Bubufy |
def inventario(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30):
print("hola")
estudiantes = [n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30]
print("hola")
print(max(estudiantes... |
# Bubble Pop
#
# A simple game: avoid the red bubbles and stay alive!
# eat blue bubbles to get bigger!
#
# Author: Jeremy Pedersen
#
# Licensed under the Simplified BSD (2-clause) License
import pygame, sys
from pygame.locals import *
from random import randint
pygame.init()
# Set clock speed
FPS = 60
fpsClock = p... |
import logging
import random
import string
from typing import Dict
import requests
from requests.models import Response
from sqlalchemy.orm import Session
from starlette.testclient import TestClient
from ultron8.api import settings
logger = logging.getLogger(__name__)
def random_lower_string() -> str:
return ... |
# -*- coding: utf-8 -*-
"""Defines the Sqema class."""
import pathlib
import simqle
import pandas as pd
class DatabaseRoot:
def __init__(self, database_directory: str, con_name: str):
"""
:type con_name: str
:type sqema_directory: str
"""
self.con_name = con_name
... |
# Title: 벚꽃이 정보섬에 피어난 이유
# Link: https://www.acmicpc.net/problem/1712
import sys
from functools import reduce
from operator import mul, add
sys.setrecursionlimit(10 ** 6)
read_single_int = lambda: int(sys.stdin.readline().strip())
read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' ')))
def ... |
import os
from configparser import ConfigParser
class UserAgentHandler:
"""Class to handle user agent data and provide an interface for
functionality to see what's currently set.
"""
info = ConfigParser()
PATH_TO_FILE = os.path.join(os.path.abspath("."), 'useragent.ini')
default_valu... |
import logging
from pysam import AlignmentFile, FastaFile, TabixFile
from tqdm import tqdm
from .logger import isotools_logger as logger
DEFAULT_GENE_FILTER = {
"NOVEL_GENE": "not reference",
"EXPRESSED": "transcripts",
"CHIMERIC": "chimeric",
}
"""Default definitions for gene filter, as used in iosotool... |
""" A neural chatbot using sequence to sequence model with
attentional decoder.
This is based on Google Translate Tensorflow model
https://github.com/tensorflow/models/blob/master/tutorials/rnn/translate/
Sequence to sequence model by Cho et al.(2014)
Created by Chip Huyen as the starter code for assignment 3,
class... |
from .simplex_sidebar_view import SimplexSidebarItem
|
from skimage.measure import label, regionprops
from skimage.segmentation import clear_border
from skimage.morphology import disk, binary_closing
from skimage.filters import roberts
from scipy.ndimage import binary_fill_holes
from lib.utils_superpixels import coords_min_max_2D
from collections import namedtuple
from ope... |
#!/usr/bin/python3
import struct
import sys
import zlib
import topic
BUFSIZE = 0x100000
_msg_marker = struct.pack('!Q',0x9a9a9a9a9a9a9a9a)
def start_process_chunk():
global topic
topic = topic.Topic("debag.py",parse_enabled=True)
def process_chunk(chunk):
global topic
topic.process(chunk)
def delim... |
"""
Brand model
Model to manage product suppliers
"""
# Django
from django.db import models
class Brand(models.Model):
"""
Brand model
A brand is a supplier or manufacturer of products
"""
name = models.CharField(max_length=50)
email = models.EmailField()
phone = models.CharField(max_le... |
import torch
import torch.nn as nn
from utils.utils import weights_init
from .discriminator import Discriminator
class MultiScaleDiscriminator(nn.Module):
def __init__(self, num_D = 3, ndf = 16, n_layers = 3, downsampling_factor = 4, disc_out = 512):
super().__init__()
self.model = nn.ModuleDict(... |
from inst import Code,FUN
from symbol import OPERATORS
class Reg:
def __init__(self,data=None):
self.__data=data
def set(self,data):#设置内容
self.__data=data
def get(self):#获取内容
return self.__data
def __add__(self,other):
return self.get()+other.get()
def inc(sel... |
"""
////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) NVIDIA Corporation. All rights reserved.
//
// NVIDIA Sample Code
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your... |
from __future__ import absolute_import, print_function
from keyes import Keyes
app1 = Keyes('app1')
app2 = Keyes('app2')
|
import io
import sys
import pretend
import pytest
from configstore.backends.dotenv import DotenvBackend
if sys.version_info[0] == 3:
builtins_open = 'builtins.open'
else: # pragma: no cover
builtins_open = '__builtin__.open'
def test_dotenv_init_bad_install(monkeypatch):
monkeypatch.setattr('configst... |
import plotly.plotly as py
import plotly
from plotly.graph_objs import *
import os
import numpy as np
mapbox_access_token = 'pk.eyJ1IjoidGp6eGgiLCJhIjoiY2o2cTUxN2hlMDZ6eTMycWpmNGJ6bTVrcSJ9.7nt0siqLHX2uaHsOVNF-fA'
plotly.tools.set_credentials_file(username='tjzxh', api_key='Faxs8vPpdsiAqtoMO2Zt')
#os.rename... |
#!python3
class Produto:
def __init__(self):
self.descricao = ""
self.preco = 0
def precoDistribuidor(self):
return self.preco + (self.preco * (3/100))
def precoRepresentante(self):
return self.preco + (self.preco * (4.5/100))
def precoConsumitor(self):
return self.preco + (self.preco *... |
N = int(input())
d = {}
for _ in range(N):
S = input()
if S in d:
d[S] += 1
else:
d[S] = 1
m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
print(s)
|
test_temp = """
<receipt>
<h1>Receipt!</h1>
<h2>div,span,p,ul,ol are also supported</h2>:w
<line>
<left>Product</left>
<right>0.15</right>
</line>
<hr />
<line size='double-height'>
<left>TOTAL</left>
<right>0.15</right>... |
import sys
import numpy as np
import pandas as pd
from google.cloud import bigquery
import pandas_gbq as gbq
def CreateDataSet(client, dataset_name, project_id, dataset_description):
'''
This function creates a dataset named dataset_name into the project given
project_id, with the data_description provid... |
"""Subsample reads from FASTQ files with Seqtk."""
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FileHtmlField,
FloatField,
GroupField,
IntegerField,
ListField,
Persistence,
Process,
SchedulingCla... |
import sublime, sublime_plugin
import os, string
import re
from datetime import date
try:
from MarkdownEditing.wiki_page import *
except ImportError:
from wiki_page import *
try:
from MarkdownEditing.mdeutils import *
except ImportError:
from mdeutils import *
class OpenJournalCommand(MDETextComman... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# split_at_heading: true
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# ... |
import numpy as np
from itertools import product
import matplotlib.pyplot as plt
import networkx as nx
import pystache
import mpld3
from mpld3 import plugins
import os
SCRIPT_DIR = os.path.dirname(__file__)
class ListTable(list):
# from http://calebmadrigal.com/display-list-as-table-in-ipython-notebook/
"""... |
# -*- coding: utf-8 -*-
"""
created by huash at 2015-05-09 15:47
"""
__author__ = 'huash'
import sys
import os
import random
# sys.stdin = open('input/sampleD.txt', 'r')
# sys.stdin = open('input/sampleD-mid.txt', 'r')
# sys.stdout = open('output/sampleD-out.txt', 'w')
# sys.stdout = sys.stderr
def reverse(ch):
... |
from django.urls import path
from .views import dashboard, home
urlpatterns = [
path("", home, name="home"),
path('dashboard/', dashboard, name="dashboard")
]
|
"""State model."""
# Django
from django.db import models
from django.urls import reverse_lazy
# Managers
from apps.locations.managers import StateManager
# Mixins
from apps.utils.models_mixin import ModelWithSlugNameMixin
# Utilities
from apps.utils.models import BaseModel
class State(ModelWithSlu... |
__version__ = VERSION = (0, 2, 1)
import warnings
from django.db.models import options
# Django doesn't support adding third-party fields to model class Meta.
# So lets also allow them to safely exist on models even if app is missing
class SafeOptionalMetaMeta(type):
def __new__(cls, name, bases, dct):
... |
# -*- coding: utf-8 -*-
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import (
check_that, equal_to, has_length, is_, is_list, is_str, require_that, require_that_in
)
SUITE = {
"description": "Methods: 'get_account_history_operations', 'get_objects' (ope... |
# Copyright 2013 OpenStack Foundation
# 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 requ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.