content stringlengths 5 1.05M |
|---|
# coding: utf-8
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import tensorflow as tf
from PIL import Image
def visual_records(tfrecords_path):
# make an input queue from the tfrecord file
filename_queue = tf.train.string_input_producer([tfrecords_path]) ... |
import logging
import os
from dataclasses import dataclass
from dotenv import load_dotenv
@dataclass(frozen=True)
class Settings:
DB_NAME: str
DB_PASS: str
DB_LOGIN: str
DB_HOST: str
DB_PORT: str
DB_URL: str
def _init_config():
load_dotenv()
return Settings(DB_NAME=os.getenv("DB_NAM... |
import numpy as np
import sys
import matplotlib.ticker as mticker
def file2stats(filename):
#f=open(filename)
f=open('results/'+filename)
print('WARNING: Results read have not been regenerated')
lines = f.readlines()
f.close()
A = []
for line in lines:
A.append(float(line[:-1]))
... |
# Copyright (c) 2018, Raul Astudillo Marban
import time
import numpy as np
class Utility(object):
"""
Class to handle a continuously differentiable utility function.
param func: utility function.
param dfunc: gradient of the utility function (if available).
param parameter_space: spa... |
import os
import numpy as np
import cv2
from matplotlib import pyplot as plt
from mtcnn import MTCNN
def perform_face_alignment(is_training=True, show_frames=False, stop_early=False, save_output=False, output_ix=0):
train_path = "data/train"
val_path = "data/val"
align_train_path = "data/aligned_trai... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""
Translator from Torch.FX to MLIR.
The following defines a se... |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from exoplanet_core.numpy import ops as nops
from exoplanet_core.testing import (
check_contact_points,
get_mean_and_true_anomaly,
)
aesara = pytest.importorskip("aesara_theano_fallback.aesara")
ops = pytest.importorskip("exoplanet_core.pymc.ops")
de... |
from argparse import ArgumentParser
from .derivations import filer, equation_file, _derivation
if __name__ == '__main__':
from argparse import ArgumentParser
parser = ArgumentParser(description='generates derivations for SPyJac')
parser.add_argument('-conv', '--constant_volume',
ac... |
"""make fields in product_relations non-nullable
Revision ID: aeec123e508c
Revises: ce157c2fa22e
Create Date: 2020-05-27 21:23:58.519384
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'aeec123e508c'
down_revision = 'ce157c2fa22e'
branch_labels = None
depends_o... |
import matplotlib
import wireframe.models
import wireframe.trainer
import wireframe.datasets
|
# coding: utf-8
class TrieNode: # 参考implement_trie.py实现
def __init__(self):
# Initialize your data structure here.
self.map = {}
self.isLeaf = False
class WordDictionary:
# initialize your data structure here.
def __init__(self):
# Write your code here
self.root = TrieNode()
... |
# Copyright 2020 dkisler.com Dmitry Kisler
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WAR... |
import pandas
def mergeDF(left, right):
return pandas.merge(left, right,how='outer', on='ds')
def mergeColumnmap(leftColumnmap, rightColumnmap, mergedColumnlist):
columnmap={}
count =1
for key, value in leftColumnmap.items():
if key == 'ds':
continu... |
import numpy as np
import pandas as pd
import scipy.spatial.distance as ssd
from sklearn.utils import check_array
import logging
from time import time
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - ... |
import logging
import inspect
import structlog
import datetime
import typing
TIME_FMT = '%Y-%m-%dT%H:%M:%S.%fZ'
DEFAULT_DISABLED_LOGGERS = [
'hpack',
'hpack.table',
'hpack.hpack',
'pgnotify.notify',
]
def add_caller_info(logger, method_name, event_dict):
frame = inspect.currentframe()
while ... |
from typing import List
from logging import Logger
from telegram.ext import Dispatcher, CommandHandler, Filters
# Commands
from .admin import admin
from .registrasi import registrasi
from .link import link
from .formulir import formulir
from .donasi import donasi
from .elearning import elearning
from .courses import c... |
from logger import logger
from jinja2 import Template
import json
import re
from collections import defaultdict
import os
from manager.event_manager import parse_event_date
from manager.s3_manager import download_from_s3
from manager.template_helper import recover_string_template
class BaseConfigManager:
def __ini... |
# -*- coding: utf-8 -*-
""" Ranker Module
This module contains functions to rank the results of utilities. This can be
used as a part of the multi-criterai decision analysis, or over the results of
the hierarchical aggregation.
"""
__author__ = "Juan Carlos Chacon-Hurtado"
__credits__ = ["Juan Carlos Chacon-Hurtado"... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
def suma(a, b):
return a+b
def resta(a, b):
return a-b |
from django.contrib import admin
from .models import (
ShortHand
)
admin.site.register(ShortHand)
|
#!/usr/bin/env python
# coding=utf-8
#
# Copyright © 2011-2015 Splunk, 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 requi... |
import copy
import torch
import sys
sys.path.append("../synthesizer")
from math import sqrt
from torch import nn
from synthesizer.layers.tacotron2 import Encoder, Decoder, Postnet
from synthesizer.utils.generic_utils import sequence_mask
# TODO: match function arguments with tacotron
class Tacotron2(nn.Module):
d... |
from evawiz_basic import *
#def request(self,module_name='',options={}):
def request(handler,*args):
module_name = args_get(0,args)
options=args_get(1,args)
if not options: options = {}
module_type = get_option(options,'type','private')
lang_type = get_option(options,'lang','c++')
from_mod... |
from unittest import TestCase
from gravedigger.gravedigger import filter_whitelisted_containers
class DummyContainer:
def __init__(self, name: str):
self.name = name
def __repr__(self):
return self.name
class TestWhitelistedContainer(TestCase):
container_foo = DummyContainer("foo")
... |
from ...MetaDataObject import MetaDataObject
from ...ext_exception import ExtException
class IncludeSimple(MetaDataObject):
ext_code = {'obj': 2}
def __init__(self):
super(IncludeSimple, self).__init__()
self.new_dest_path = None
self.new_dest_dir = None
@classmethod
def deco... |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from datetime import datetime as dt
N = 500
D = 2
M = 30
K = 3
#first cloud is centred at (0, -2)
X1 = np.random.randn(500, 2) + np.array([0, -2])
#second cloud is centred at (2, 2)
X2 = np.random.randn(500, 2) + np.array([2, 2])
#Third clo... |
"""Utilities needed to emulate Python's interactive interpreter.
"""
# Inspired by similar code by Jeff Epler oraz Fredrik Lundh.
zaimportuj sys
zaimportuj traceback
zaimportuj argparse
z codeop zaimportuj CommandCompiler, compile_command
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
... |
#!/usr/bin/env python
import sys
import string
maxlines = int(sys.argv[3] or '1000', 10)
perfect = {}
with open(sys.argv[1], 'r') as f:
for line in map(string.strip, f):
key, v0 = line.split(",", 1)
perfect[key] = float(v0)
count = 0
low = 0.0
up = 0.0
perfect_max = max(perfect.itervalues())
... |
# Copyright (c) 2020 Jhonatan Da Ponte Lopes
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import pygame
import sys
from pygame.locals import MOUSEBUTTONUP, MOUSEBUTTONDOWN
pygame.init()
class Button():
"""A simple button class"""
def __init__(self, rect, butto... |
from __future__ import unicode_literals
import frappe, requests
from frappe import _
from jinja2 import utils
from html2text import html2text
from six import text_type
from frappe.utils import sanitize_html
from frappe.utils.global_search import search
def get_context(context):
context.no_cache = 1
if frappe.form_di... |
import queue
from collections import defaultdict as dd
N, Q = map(int, input().split())
ab = [map(int, input().split()) for _ in range(N - 1)]
cd = [map(int, input().split()) for _ in range(Q)]
tree = dd(set)
eo = [0] * N
for a, b in ab:
tree[a - 1].add(b - 1)
tree[b - 1].add(a - 1)
# DFS
q = queue.Queue()
... |
# Thanks Heng
def readfq(fp): # this is a generator function
last = None # this is a buffer keeping the last unprocessed line
while True: # mimic closure; is it a bad idea?
if not last: # the first record or a record following a fastq
for l in fp: # search for the start of the next record
... |
# -*- coding: utf-8 -*-
# MIT LICENSE
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# pu... |
import pygame
pygame.init()
# Inicializndo o pygame
display = pygame.display.set_mode([880,880])
# Criando a janela
pygame.display.set_caption("TESTE")
def draw(rgb):
display.fill(rgb)
if __name__ == '__main__':
# Atualizando a janela em tempo real
gameloop = True
while gameloop:
# Fill ... |
import Arena
from MCTS import MCTS
from hex.HexGame import HexGame, display
from hex.HexPlayers import *
from hex.pytorch.NNet import NNetWrapper as NNet
import numpy as np
from utils import *
"""
use this script to play any two agents against each other, or play manually with
any agent.
"""
g = HexGame(6)
# all pl... |
import logging
import database
from database import User
logger = logging.getLogger(__name__)
logger.info('Before handler')
def handler(event, context):
dbs = database.initialize_database()
query = dbs.query(User).filter(User.email == event['request']['userAttributes']['email']).first()
print(dbs.query... |
if __name__ == '__main__':
import argparse
import json
import logging
import os
import subprocess
import sys
import tempfile
from autosklearn.classification import AutoSklearnClassifier
from autosklearn.regression import AutoSklearnRegressor
from autosklearn.evaluation import E... |
#!/usr/bin/env python3
# This script expects tags to be in the form of v{MAJOR}.{MINOR}.{PATCH}
# EX: v2.11.2, v3.1.4
import sys
import subprocess
import argparse
def run_command(cmd):
ret = err = ""
try:
ret = subprocess.check_output(cmd.split(' '), stderr=subprocess.STDOUT).decode("utf-8").strip(... |
import yaml
import os
from collections import namedtuple
class Configuration(object):
def __init__(self, config_file):
self.app_home = os.environ['APP_HOME']
with open(self.app_home + '/config/vegamite/' + config_file) as config_file:
settings = yaml.load(config_file)
for... |
import datetime
import json
from decimal import Decimal
from django.http import JsonResponse
from django.shortcuts import render, redirect
from accounts.models import Order, ShippingAddress
def home(request):
if request.user.is_authenticated:
customer = request.user.customer
order, created = Ord... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 5 15:07:28 2014
@author: leo
"""
from numpy import *
w = 2*pi/9
ak = lambda k: (1.0/9) * (3 + exp(-1j*k) + 2*exp(-3j*k) - exp(-4j*k) -2*exp(-6j*k))
harms = lambda k: arange(-k,k+1)
def discplot(x,y, color='k'):
plt.plot(x, y, 'o'+color)
plt.vlines(x, [0], y,... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# utf-8
import sys, os
sys.path.append(os.pardir)
from common.functions import *
from common.gradient import numerical_gradient
class TwoLayerNet(object):
def __init__(self, input_size, hidden_size, output_size, weight_init_std=0.01):
# 初始化权重
self.params = {}
self.params['W1'] = weight_init_std * np.random.ra... |
import json
import time
import os
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
class JsonWriterPipeline(object):
def __init__(self):
time_str = time.strftime("%m-%d-%Y_%H-%M-%S")
self.file = open('{0}/products/products/data/items_{1}.json'.format(PR... |
#import shared
#import time
#from multiprocessing import Pool, cpu_count
import hashlib
from struct import unpack, pack
from subprocess import call
import sys
import time
from bmconfigparser import BMConfigParser
from debug import logger
import paths
import openclpow
import queues
import tr
import os
import ctypes
imp... |
# Do not check for unused imports
# flake8: noqa:F401
from .image_utils import *
__version__ = "0.2.0.3b2"
|
""" Tets base JSON-RPC structures."""
|
'''
Created on Jan 17, 2018
@author: andrewoliver
'''
import unittest
from hashmap import HashMap
class TestHashMap(unittest.TestCase):
# Checks that the initialized size of the hashmap is correct.
# Checks that the hashmap size parameter does not allow negative values.
def test_init(self):
h = ... |
# -*- coding: utf-8 -*-
# This code is copyrighted and all rights are reserved
# for full legalities see the LEGAL file
def add_info(report):
report['CrashDB'] = '{"impl": "launchpad", "project": "appgrid"}'
|
"""Compute the fingerprints of an array of smiles."""
from itertools import chain
import numpy as np
import pandas as pd
from rdkit.Chem import AllChem
__all__ = ["generate_fingerprints"]
#: Floating point used to stored the features
DTYPE = np.float32
dictionary_functions = {
"morgan": AllChem.GetMorganFinge... |
from .env import Env
from .goal_env import GoalEnv
from .env_spec import EnvSpec
from .make_env import make_gym_env
from .make_env import make_envs
from .make_env import make_vec_env
|
import argparse
from collections import namedtuple
from io import StringIO
import os
import shutil
from subprocess import Popen, PIPE, STDOUT, CalledProcessError
import sys
import tempfile
from . import endf
# For a given MAT number, give a name for the ACE table and a list of ZAID
# identifiers
ThermalTuple = named... |
fname = input('Enter File: ')
prefix='../file/'
if len(fname)<1 : fname = prefix+'mbox-short.txt'
else: fname = prefix+fname
fh = open(fname)
dct = dict()
for ln in fh:
if not ln.startswith('From '):
continue
lsl = ln.split()
tim = lsl[5]
hour = tim.split(':')[0]
dct[hour] = dct.get(hour,0... |
# *****************************************************************************
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from ipywidgets import Widget
... |
import paramiko
import time
import re
import os
import argparse
import abc
import jvmtunerInterface
from jvmtunerInterface import JvmFlagsTunerInterface
argparser = argparse.ArgumentParser(parents=[jvmtunerInterface.argparser])
argparser.add_argument('--local_catalina_location',
help='Give the ... |
from django.shortcuts import render
from fifaRecords import models
session = models.Results.objects.values("Session")
l = []
for i in session:
l.append(i['Session'])
l = list(dict.fromkeys(l))
def Records(request):
a = ["Brazil", "Italy", "Germany", "Uruguay", "Argentina", "France","England", "Spain... |
import base64
import io
import itertools
import json
import logging
import multiprocessing
import os
import pickle
import numpy as np
import lithops
import dill
from . import matrix_utils
from .matrix_utils import list_all_keys, block_key_to_block, key_exists
from . import utils
cpu_count = multiprocessing.cpu_count(... |
for 1..100 -> $iter {
print "Fizz" if $iter % 3 == 0;
print "Buzz" if $iter % 5 == 0;
print $iter unless $iter % 5 == 0 or $iter % 3 == 0;
print "\n";
}
|
from flask import Flask, render_template
from faixa import *
app=Flask(__name__)
@app.route('/lista')
def listar_faixas():
return render_template('lista.html',nome='Lista de Faixas')
app.run()
|
from __future__ import division
import numpy as np
import sys
import math
import os
def get_pred_iterative(pmf, S):
"""Function to get predicted abundances (reverse-sorted) for distributions with no analytical ppf."""
cdf = [(S - i + 0.5) / S for i in range(1, S + 1)]
cdf = np.sort(cdf)
r... |
np.arctan2(x1, x2) |
"""
Copyright (c) 2021 BEAM CONNECTIVITY LIMITED
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
CLI commands to interact with Dashboard Folders in Grafana
"""
import json
import logging
import rich
import typer
from .api... |
#
# PySNMP MIB module HPN-ICF-SNMP-EXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-SNMP-EXT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:41:23 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
#!/usr/bin/env python
# ENCODE DCC FRiP wrapper
# Author: Jin Lee (leepc12@gmail.com)
import sys
import os
import argparse
from encode_lib_common import (
get_num_lines, gunzip, log, ls_l, mkdir_p, rm_f,
run_shell_cmd, strip_ext, write_txt)
def parse_arguments():
parser = argparse.ArgumentParser(prog='E... |
import datetime
import time
import unittest
import pandas as pd
from io import StringIO
from test.utility import create_variable, create_dataset, delete_variable, delete_variable_data, delete_dataset, \
get_dataset, get_variable, get_data, update_variable_metadata, upload_data_put, update_dataset_metadata
class T... |
# Copyright 2017 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.
import base64
import mock
from libs.test_results.gtest_test_results import GtestTestResults
from services import constants
from waterfall.test import wf_tes... |
class Go_to:
def __init__(self, app):
self.app = app
def groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith('group.php') and len(wd.find_elements_by_name('new')) > 0):
wd.find_element_by_link_text("groups").click()
def home_page(self):
wd = s... |
"""Package containing the command line interface for widget-mark"""
from .__main__ import main
from .cli import CLI |
import copy
import glob
import os
import geopandas as gpd
import pandas as pd
from geopandas import GeoDataFrame
from pandas import DataFrame
import numpy as np
from network_wrangler import RoadwayNetwork
from .parameters import Parameters
from .logger import WranglerLogger
class ModelRoadwayNetwork(RoadwayNetwork... |
import random
import time
N = 10000
TIMES = 10
def std_selection_sort(x):
for i in range(len(x)):
min_ind = i
for j in range(i, len(x)):
if x[min_ind] > x[j]:
min_ind = j
x[i], x[min_ind] = x[min_ind], x[i]
return x
def opt_selection_so... |
# coding:utf-8
# Produced by Jiaxin Zhang
# Start Data: 20_May_2020
# Configuration for the model.
#
# For GOD I Trust.
# 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... |
import unittest
from copy import deepcopy
from ..selection.selection import Selection
from .methods import HDF5TestComponent
from .utilities import DEFAULT_STORE_PARAMS
from .utilities import load_config_data, update_cfg_file
CFG_FILE = "barcode_selection.json"
CFG_DIR = "data/config/selection/"
READS_DIR = "data/rea... |
from abc import ABC, abstractmethod
from typing import List, Optional
from haystack.database.base import Document
class BaseReader(ABC):
@abstractmethod
def predict(self, question: str, documents: List[Document], top_k: Optional[int] = None):
pass
|
arr=[1, 4, 20, 3, 10, 5]
n=len(arr)
#Max triplet sum in array
def func1(arr,n):
first,second,third=-99999999,-99999999,-99999999
for i in range(n):
if arr[i]>third:
first=second
second=third
third=arr[i]
elif arr[i]>second:
first=sec... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import habitat_sim
import magnum as mn
import numpy as np
import os
def reconfigure_scene(env, scene_path, add_humans):
"""This function takes a habitat scene and adds relevant changes to the
scene that make it useful for locobot assistant.
For exa... |
from .....core import BaseDataGenusProcessor
from .taxonomy_list import TaxonomyListAnalyzer
from .taxonomy_guesser import TaxonomyGuesserAnalyzer
from .taxonomy_fetcher import TaxonomyFetcherAnalyzer
class TaxonomiesDGP(BaseDataGenusProcessor):
def init(self):
self.steps = self.init_classes([
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import csv
input = 'day04.input'
def part1():
valid = 0
with open(input) as f:
reader = csv.reader(f, delimiter=' ')
for row in reader:
if len(row) == len(set(row)):
valid += 1
return valid
def part2():
valid = 0
with open(input) as f:
reader = ... |
import sys
import time
from Utils import *
import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
def attention_reader_small(rnn_type,hidden_size,dropout_rate_embd,dropout_rate_d,dropout_rate_q,learning_rate,
batch_size,optimizer_name,num_epoches,eval_iter,
... |
import tkinter as tk
import math
root = tk.Tk()
root.title("Converter")
a = 6375137
f = 1/298.257223563
e2 = 2*f - f**2
def compute():
ph = math.radians(float(phentry.get()))
rm = a*(1-e2)/(1-e2*(math.sin(ph))**2)**1.5
rn = a/(1-e2*(math.sin(ph))**2)**0.5
resultlabel["text"] = f"Rm:... |
# -*- coding: utf-8 -*-
#
# Copyright © 2010 Eugeniy Meshcheryakov <eugen@debian.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
# -*- coding: utf-8 -*-
# Copyright © IBM Corporation 2010, 2019
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import logging
import json
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
from resilient_lib import Re... |
# This is a header for the application
# You should read this header and insert your name and your date below as part of the peer review
# This is a typical part of any program
# Author: <author>
# Creation Date: <date>
# Below is a simple program with 10 issues (some are syntax errors and some are logic errors. ... |
# Filename: perfect.py
a = True
n = 0
while a == True: # To loop the following commands
running = True
while running == True:
r = 0
n = n+ 1
for x in range(1,n + 1):
if n%x == 0: # To determine the factors of n
r... |
from datetime import datetime, date
from marqeta.response_models.application import Application
from marqeta.response_models import datetime_object
import json
import re
class AccessTokenResponse(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# coding: utf-8
import os
from setuptools import setup, find_packages
from cmsplugin_text_ng import __version__ as version
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = 'cmsplugin-text-ng',
version = version,
description = "django-cms improved text ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General P... |
"""Definition and setup of the SpaceX Binary Sensors for Home Assistant."""
import logging
import time
import datetime
from homeassistant.util.dt import as_local, utc_from_timestamp
from homeassistant.components.sensor import ENTITY_ID_FORMAT, DEVICE_CLASS_TIMESTAMP
from homeassistant.const import LENGTH_KILOMETERS, ... |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from .source import SourceMagento
__all__ = ["SourceMagento"]
|
#!/usr/bin/env python3
"""Copied from phosphor-settings-manager
Loads a "target" YAML file and overwrites its values with values from
"override" YAML files.
Override files are processed in the order given.
Usage:
merge_settings.py <target yaml> [override yamls]
"""
import sys
import yaml
import copy
# Custom rep... |
import os
import glob
import filecmp
from BMSelector import main as mn
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
PDB = glob.glob(os.path.join(TEST_DIR, "data/pdb/*.pdb"))[0]
CPPTRAJ = glob.glob(os.path.join(TEST_DIR, "data/cpptraj/*"))[0]
TLEAP = glob.glob(os.path.join(TEST_DIR, "data/tleap/*"))[0]
FP = o... |
import asyncio
import json
import ssl
from requests.exceptions import ConnectTimeout, ReadTimeout
import websockets
from websockets.client import WebSocketClientProtocol
from websockets.typing import Data
from .ws_message import WSMessage
from .ws_response import WSResponse
from .ws_timeout_error import WSTimeoutErro... |
import numpy as np
from scipy.special import gamma, gammainc
from sklearn.neighbors import NearestNeighbors
def incgamma(a, x):
return gammainc(a, x) * gamma(a)
def find_unit_volume(dims):
return np.pi ** (dims / 2) / gamma((dims / 2) + 1)
def compute_normalized_volumes(x, ks=None, y=None):
"""
Co... |
from linhas import ilinha as l
def menu():
print('\033[33m1 - \033[34mVerpessoas cadastradas\033[m')
print('\033[33m2 - \033[34mCadastrar novas pessoa\033[m')
print('\033[33m3 - \033[34mSair do sistema\033[m')
l()
while True:
esc = int(input('\033[32mSua Opção: \033[m'))
if esc > 3 a... |
from .core import Query
def test_simple():
assert Query().tests.to_graphql(indentation=0) == """query {tests {}}"""
def test_medium():
query = (
Query()
.repository(owner="juliuscaeser", name="rome")
.pullRequest(number=2)
.values("title", "url")
.commits(last=250)
... |
# Exercício Python 62: Melhore o DESAFIO 61, perguntando para o usuário se ele quer mostrar mais alguns termos. O programa encerrará quando ele disser que quer mostrar 0 termos.
a1 = int(input("Qual o 1º termo da PA? "))
r = int(input("Qual a rasão da PA? "))
an = a1
n = 1
tot = 0
mais = 10
while mais != 0:
tot +=... |
from django.db import models
class Product(models.Model):
title= models.CharField(max_length=100)
description= models.TextField(blank=True,null=True)
price= models.DecimalField(max_digits=10,decimal_places=2)
summary= models.TextField(blank=True,null=True)
featured= ... |
"""module for validator validator."""
from typing import Any
from ..field_definition import FieldDefinition
from ..contexts import ValidatingContext, TransformingContext, ToJSONContext
class Validator:
"""Abstract and base class for validators."""
def define(self, fdesc: FieldDefinition) -> None:
"""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.