content stringlengths 5 1.05M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import copy
import argparse
import numpy as np
import matplotlib.pyplot as plt
import gdal
import ogr
from schimpy.schism_mesh import read_mesh, write_mesh
from schimpy.schism_polygon import read_polygons, Polygon, Point
from scipy.ndimage import gaussian_filter... |
__author__ = 'hvishwanath'
import click
import os
import sys
import base64
import json
from db import *
from libpaas import settings
from libpaas.drivers.manager import DriverManager
from config import Config
from libpaas.camp import pdpparser
@click.group(help="Manage your applications across PaaS providers")
def p... |
import time
import board
from busio import I2C
from adafruit_bitmap_font import bitmap_font
import adafruit_is31fl3741
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
import IS31Framebuffer
#font_file = "tom_thumb.bdf" # 3x5 font
font_file = "tfont.bdf"
font = bitmap_font.load_font(font_file)
message ... |
from typing import Dict, List, Optional
from pydantic import BaseModel # pylint: disable=no-name-in-module
from ...utils import kubernetes
class UserDeployment(BaseModel):
name: str
image: kubernetes.Image
dagsterApiGrpcArgs: List[str]
port: int
replicaCount: Optional[int] = 1
env: Optional... |
"""
[True] hello
[True] vstack [!<class 'tuple_iterator'>]
[True] bstack []
[False] world
[False] vstack [!<class 'tuple_iterator'>]
[False] bstack []
"""
from pyteleport import tp_dummy
from pyteleport.tests.helpers import setup_verbose_logging, print_stack_here, print_, get_tp_args
class SomeClass:
def __init__... |
#! /usr/bin/env python
import redis
# from time import strftime
# import time
# import random
def monitor():
redis_host = "10.201.67.22"
redis_port = 6363
redis_client = redis.StrictRedis(host=redis_host, port=redis_port, db=0)
while True:
x = 1
redis_client.set("Key:" + 'x', x)
... |
from dataclasses import dataclass, field, asdict
from typing import List, Union
import marshmallow as ma
from .base import EntityCondensedSchema, EntityCondensed, EntitySchema, Entity, AuditingSchema, Auditing
from .tag import TagCondensedSchema, TagCondensed
from .custom_property import CustomPropertyValueSchema, Cu... |
# Generated by Django 3.1.13 on 2021-10-25 22:21
from django.db import migrations
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('nomenclatoare', '0024_historicalmaterialmobilier_materialmobilier'),
('app', '0082_auto_20211026_0119'),
]
operations = ... |
#!/Users/robertpoenaru/.pyenv/shims/python
import numpy as np
import gordan as cg
print(cg.RESULT)
# calculates the Clebsch-Gordan coefficient for a given set of parameters j1,j2,m1,m2,j,m=m1+m2
# Checks wether a spin-quantum-number is half-integer or not
def HalfInteger(x):
half = 1 / 2
x_half = x + hal... |
import unittest
from case_sensitive import case_sensitive, case_sensitive2
def test_get_age(benchmark):
assert benchmark(case_sensitive,'asd') == [True, []]
assert benchmark(case_sensitive2,'cellS') == [False, ['S']]
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 5 00:04:41 2020
@author: shashanknigam
web parser for amazon:
Things to be extracted: 1. Title of the product span id = "productTitle"
2. Number of rating : span id = acrCustomerReviewText
3. Average rating given:span class a-icon-alt... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 dhilipsiva <dhilipsiva@gmail.com>
#
# http://dhilipsiva.github.io/django-shorturl/
#
# Distributed under terms of the MIT license.
"""
There is just one simple table here.
The KeyPath table which has a key an a path.
"""
from django.... |
from __future__ import print_function
import argparse
import base64
import mimetypes
import os.path
import pickle
import sys
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIM... |
#!/usr/bin/python2.7
# -*- coding:utf-8 -*-
# Author: NetworkRanger
# Date: 2018/11/4 下午2:27
# 3.5 理解线性回归中的损失函数
# 1. 除了损失函数外,程序的开始与以往一样,导入必要的编程库,创建一个会话,加载 数据集,创建占位符,定义变量和模型
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from sklearn import datasets
sess = tf.Session()
iris = datasets.load... |
import uuid
import botocore
from botocore.stub import Stubber, ANY
from db_cluster_endpoint_provider import DBClusterEndpointProvider
provider = DBClusterEndpointProvider()
provider.sleep_period_in_seconds = 0.1
def test_create_endpoint():
request = Request(
"Create",
properties = {
"... |
import re
import sys
"""
A quoi sert ce fichier ?
- a trouver tt les transactions auquelles une addresse X a participé
- a trouver une transaction avec son hash
"""
class GetTransactions:
def __init__(self, blocks):
self.blocks = blocks
blocks = []
for i in self.blocks:
if... |
#!/usr/bin/python3
import simpy
from modules.process.production_line import ProductionLine
from modules.process.fas_instance import FASInstance
from modules.faults.wear_and_tear import WearAndTear
from modules.components.clock import Clock
from simulator.logger import Logger
# Initializing
env = simpy.Environment()
... |
def hello11():
print('hello from module 1, script11')
|
import os
# t_l = [(1, 2, 3,), (1, 2, 3,), (1, 2, 3,), (1, 2, 3,)]
#
# for i, j, k in t_l:
# print("i:" + str(i))
# print("j:" + str(j))
# print("k:" + str(k))
path = r"D:\pycharm\PyCharm 2020.1.1\workplace\zhihu_user_info_spider\zhihu_user_info\result"
for root, dirs, files in os.walk(path):
for f ... |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( a , b ) :
if a == 0 :
return b
return f_gold ( b % a , a )
#TOFILL
if __name__ == '__main__':
... |
import re
#------------------chercher dans une chaine-----------------#
re.search(r"abc", "abcdef")
# renvoie <_sre.SRE_Match object at 0x00AC1640> ou None si ça n'existe pas
if re.match(expression, chaine) is not None:
# Si l'expression est dans la chaîne
# Ou alors, plus intuitivement
pass
if re.match... |
"""
config_dir
----------
Just stores a variable with the name of the current directory, that
is the base directory of the entire filesystem.
"""
import os
base_dir = os.path.abspath(os.path.dirname(__file__)) |
__all__ = [
'Measurement',
'make_counter',
'make_rater',
'make_timer',
]
import collections
import functools
import time
Measurement = collections.namedtuple('Measurement', 'when value duration')
def make_counter(metry, name):
return functools.partial(count, metry.measure, name)
def make_rate... |
# -*- coding: utf-8 -*-
""""
Folium Features Tests
---------------------
"""
import os
from folium import Map, Popup
from folium import features
from folium.six import text_type
from folium.element import Element
tmpl = """
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="... |
# -*- coding: utf-8 -*-
"""
lytics.settings
~~~~~~~~~~~~~~~
Settings file for lytics app.
Usage:
from lytics import settings
settings.DATABASE_PATH
>>> /home/lytics/db/db.sqlite3
:copyright: (c) 2016 by Patrick Spencer.
:license: Apache 2.0, see LICENSE for more details.
"""
from ... |
class Solution:
def Fibonacci(self, n):
def dfs(n):
if n <= 1:
return n
else:
return dfs(n - 1) + dfs(n - 2)
return dfs(n)
def Fibonacci(self, n):
dp = [0, 1] + [0] * (n - 1)
for i in range(2, n + 1):
dp[i] = d... |
import json
file_path = "sample.json"
questionnaire_dic = {}
with open(file_path, 'r', encoding="utf8") as j:
contents = json.loads(j.read())
#print(contents['pages'][0]['elements'])
#element_data = contents['pages'][0]['elements']
if not (contents is None) and "pages" in contents:
for page in c... |
"""
Author: Zahra Gharaee.
This code is written for the 3D-Human-Action-Recognition Project, started March 14 2014.
"""
import numpy as np
from Preprocessing.Nomalization import make_normalization
from Preprocessing.Attection import make_attention
from Preprocessing.Ego_Transfromation import make_egoCente... |
class Node:
def __init__(self, data=None, left=None, right=None):
self.data = data
self.left = left
self.right = right
class Binary_Search_Tree:
def __init__(self):
self.root = None
def _insert(self, data, current_node):
if current_node.data == data:
... |
import json
import pytest
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from hypothesis_jsonschema import from_schema
from jigu.core.proposal import (
CommunityPoolSpendProposal,
ParameterChangeProposal,
RewardWeightUpdateProposal,
TaxRateUpdateProposal,
... |
import uuid
from PyQt5 import QtCore
from PyQt5.QtCore import QMimeData
from PyQt5.QtGui import QDrag
from PyQt5.QtWidgets import QPushButton
class FuncWidget(QPushButton):
def __init__(self):
super().__init__()
self.setText(str(uuid.uuid4()))
self.setAcceptDrops(True)
def mousePress... |
# 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 use ... |
#!/usr/bin/env python3
n, *h = map(int, open(0).read().split())
dp = [0] * n
dp[0] = 0
a = abs
for i in range(1, n):
dp[i] = min(dp[i], dp[i-1] + a(h[i] - h[i-1]))
dp[i+1] = min(dp[i+1], dp[i-1] + a(h[i] - h[i-2]))
print(dp[n-1])
|
import logging
from typing import List
from PIL import Image
import numpy as np
try:
import face_recognition
_FACE_RECOGNITION_LOADED = True
except ImportError:
_FACE_RECOGNITION_LOADED = False
class FaceEmbedder:
def __init__(self, model: str = "large", num_jitters: int = 5):
logging.info("L... |
import os
import collections
import subprocess
import warnings
import lamnfyc.context_managers
import lamnfyc.settings
import lamnfyc.packages.base
def installer(package, temp, env):
warnings.warn("This is VERY unteseted")
with lamnfyc.context_managers.chdir(os.path.join(temp, 'freetds-{}'.format(package.ve... |
"""A set of stories-pytest' exceptions."""
from _stories_pytest.exceptions import StoryPytestError
__all__ = ["StoryPytestError"]
|
# -*- coding: UTF-8 -*-
# ------------------------(max to 80 columns)-----------------------------------
# author by : (学员ID)
# created: 2019.11
# Description:
# 初步学习 WinForm 编程 ( button, messagebox )
# ------------------------(max to 80 columns)-----------------------------------
import tkinter as tk
from PIL im... |
from babbage.query.parser import Parser
from babbage.model.binding import Binding
from babbage.exc import QueryException
class Aggregates(Parser):
""" Handle parser output for aggregate/drilldown specifications. """
start = "aggregates"
def aggregate(self, ast):
refs = [a.ref for a in self.cube.m... |
"""Marsha storage modules."""
from django.conf import settings
from django.utils.module_loading import import_string
# pylint: disable=unused-import
from . import dummy, s3 # noqa isort:skip
def get_initiate_backend():
"""Select and return the selected storage backend."""
return import_string(settings.STO... |
"""
Run process using 'python TwitterProcess.py'
"""
import TwitterProcessModule as tpmod
import datetime as dt
def start_database():
#
generalDbHelper = tpmod.GeneralDbHelper(version = 1)
#Connecting to sqlite3 database
social_network_path_file = generalDbHelper.get_store_dir(store_dir_name="data", fi... |
from tkinter import *
window = Tk()
window.title("Special Midterm Exam in OOP")
window.geometry('600x600+20+10')
def bgchange():
btn.configure(bg="yellow")
btn = Button(window, text="Click to Change Color", command=bgchange)
btn.place(relx=0.5, rely=0.5, anchor="center")
window.mainloop()
... |
#!/usr/bin/env python
# Checks that all commits have been signed off and fails if not.
# (Adapted from l33t Docker script for checking for their DCO)
# Requires Python 2.7
import re
import os
import sys
import yaml
import subprocess
if 'TRAVIS' not in os.environ:
print('TRAVIS is not defined; this should run in ... |
from abc import ABC
from datetime import datetime
from typing import Optional, Iterable
from gather_vision.process import item as app_items
from gather_vision import models as app_models
class PlaylistSource(ABC):
"""A service that provides playlists."""
@property
def collections(self) -> list:
... |
"""IR interpreter."""
from __future__ import print_function, division, absolute_import
import ctypes
try:
import exceptions
except ImportError:
import builtins as exceptions
from itertools import chain
from collections import namedtuple
from functools import partial
from . import defs, ops, tracing, types
f... |
from curator import es_repo_mgr
from mock import patch, Mock
from . import CuratorTestCase
class TestRepoMgr(CuratorTestCase):
def test_repository_will_be_created_and_listed_and_deleted(self):
es_repo_mgr.create_repository(self.client, repository=self.args['repository'], repo_type='fs', location=self.ar... |
import enum
import re
from marshmallow import ValidationError
from webargs.flaskparser import abort, parser
@enum.unique
class Status(enum.Enum):
"""API body response statuses."""
CREATED = "created"
SUCCESS = "success"
EXPIRED = "expired"
INVALID = "invalid"
ERROR = "error"
@parser.error_... |
#!/usr/bin/python -Wall
# ================================================================
# This is a utility module for helping to parse command-line arguments of
# the form "N=10", "eps=1e-6", etc.
#
# John Kerl
# kerl.john.r@gmail.com
# 2009-09-16
# ================================================================
... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/enums/share_ex_raid_pass_result.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from g... |
from django.db import models
from apps.carrito.models import carrito
from apps.producto.models import producto
from django.contrib import admin
# Create your models here.
class repartidor(models.Model):
id_repartidor = models.AutoField(primary_key=True)
nombre = models.CharField(max_length=45)
apellido =... |
import string
def get_free(used):
"""
Returns variable name that is not used yet
Args:
used: iterable of used variable names
Returns:
some unused variable name
"""
for el in string.ascii_lowercase:
if not el in used:
return el
raise ValueError()
class V... |
#
# This file is part of do-mpc
#
# do-mpc: An environment for the easy, modular and efficient implementation of
# robust nonlinear model predictive control
#
# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean
# TU Dortmund. All rights reserved
#
# do-mpc is free sof... |
# -*- encoding: utf-8 -*-
# @file: appstore
# @author: theol
# @Date: 2018/1/23 16:38
# @Updated: 2018/1/2316:38
import json
import requests
from requests.exceptions import RequestException
class InAppPurchaseValidationError(Exception):
raw_response = None
def __init__(self, raw_response=None):
su... |
/home/runner/.cache/pip/pool/62/11/8e/0308778093ea17b7a6e57034ae6a51e36cf56cb87cd28a049730f252f9 |
# Copyright 2019 - The Android Open Source 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 ... |
import numpy as np
from scipy.spatial import Voronoi
from ..graph import Graph
from ..dual import DualGraph
from .voronoi import VoronoiGraph
from ...utils.jaggedarray import JaggedArray
# from .voronoi_helpers import (get_nodes, get_nodes_at_link,
# get_links_at_patch, get_corner_at_patc... |
def swap(a, x, y):
'swapping of a[x] and a[y]'
a[x], a[y] = a[y], a[x]
def SelectionSort(a):
"perform selection sort on array a"
for i in range(0, len(a), +1):
least = i
for j in range(i + 1, len(a), +1):
if (a[j] < a[least]):
least = j
swap(a, i, ... |
# Generated by Django 2.0.3 on 2018-04-07 15:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('certificados', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='certificados',
name='estudiante',
... |
# Author: Martin McBride
# Created: 2022-01-09
# Copyright (C) 2022, Martin McBride
# License: MIT
from generativepy.drawing import make_image, setup
from generativepy.color import Color
from generativepy.geometry import Text, Transform, Line
def draw(ctx, pixel_width, pixel_height, frame_no, frame_count):
setu... |
import math
import torch
from torch import nn
class ResidualBlock(nn.Module):
def __init__(self, channels):
super(ResidualBlock, self).__init__()
self.conv1 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(channels)
self.prelu = nn.PReLU(c... |
from math import gcd
N, H, *A = map(int, open(0).read().split())
for a in A:
t = gcd(a, H)
H //= t
if H == 1:
break
if H == 1:
print('YES')
else:
print('NO')
|
from .UnsupervisedRanker import MasseyRanker, ColleyRanker, KeenerRanker, MarkovRanker, ODRanker, DifferenceRanker
from .TimeSeriesRanker import EloRanker, TrueSkillRanker, GlickoRanker
__all__ = ["MasseyRanker", "ColleyRanker", "KeenerRanker", "MarkovRanker", "ODRanker", "DifferenceRanker", "EloRanker", "TrueSkill... |
# Copyright 2013 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 os
import re
import sys
def LoadSupport(input_api):
if 'cloud_storage' not in globals():
# Avoid leaking changes to global sys.path.
_old_... |
"""Calculate the errors on the fitted quantities."""
import logging
from pathlib import Path
import numpy as np
import scipy.stats
import astropy.units as u
from astropy.table import Table
from .utils import load_yaml
from .fit_models import Log10Parabola
from .conf import config
log = logging.getLogger(__name__)
de... |
#!/usr/bin/env python
"""
This file takes in a list of gerrit changes to build into the supplied OBS
project.
"""
import argparse
import contextlib
import glob
import os
import re
import shutil
import sys
import tempfile
import time
import urllib
import sh
try:
from xml.etree import cElementTree as ET
except Im... |
# Copyright 2014-2015 Zuercher Hochschule fuer Angewandte Wissenschaften
# Copyright (c) 2013-2015, Intel Performance Learning Solutions Ltd, Intel 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 Lice... |
import xml.etree.ElementTree as et
from cdxml_elements import *
class CDXML_Editor(object):
def __init__(self, cdxml_files_path=None, output_path=None):
self.container = BOX()
self.cdxml_path = cdxml_files_path
self.output_path = output_path
if self.output_path:
self.tree = et.ElementTree()
self.cdxml ... |
import pytest
import subprocess
import re
import math
number = "([0-9]+.[0-9]+e[+-][0-9]+)"
tol = 1e-5
# "basicnewton"
@pytest.mark.parametrize("solver", ["basic"])
@pytest.mark.parametrize("num_proc", [1, 2])
def test_simple(solver, num_proc):
cmd = ("cd ..; mpiexec -n {} python sauce.py solver={} "
... |
import hashlib
from dagster.serdes import serialize_dagster_namedtuple
def create_snapshot_id(snapshot):
json_rep = serialize_dagster_namedtuple(snapshot)
m = hashlib.sha1() # so that hexdigest is 40, not 64 bytes
m.update(json_rep.encode())
return m.hexdigest()
|
from . import database
from utils import *
from .common import *
@validate_lang_code
def snippets_in_articles(lang_code):
cfg = flask.g._cfg
try:
page_ids = flask.request.args.getlist('page_id', type=int)
except ValueError:
return flask.jsonify(error = 'Invalid request')
if not page_ids... |
from django.urls import path, re_path
from django.views.generic.base import RedirectView
from .views import index, item, logIn, signUp, logOut, inbox, myBids
urlpatterns = [
path("", index.index, name="index"),
path("item/<str:itemId>", item.item, name="item"),
path("logIn", logIn.logIn, name="logIn"),
... |
# ------------------------------------------------------------------------
# Globals
DEFAULTS = {
"PopulationData" : {
"seroprevalence": 0.0,
},
"EpidemiologicalData" : {
"latencyTime" : 3.0,
"infectiousPeriod" : 3.0,
"lengthHospitalStay": 7.0,
... |
from app.services.messages.message_manager import MessageManager
__all__ = [
'MessageManager'
]
|
import datetime
import pathlib
import unittest
from src.container import create_container
from src.models import AdminSistema, AdminEstacio, Estacionamento
from src.models.horario_divergente import HorarioDivergente
from src.repo import HorarioDivergenteRepo
from tests.factories import set_session, EstacionamentoFacto... |
import stanza
from tool.model.ner_model import NERModel
class StanzaModel(NERModel):
def __init__(self, save_personal_titles, fix_personal_titles):
super().__init__(save_personal_titles, fix_personal_titles)
self.model = stanza.Pipeline('en', processors='tokenize,ner', tokenize_no_ssplit=True,
... |
TRAIN_IDS_PATH = "data/train_ids.npy"
# TRAIN_LABELS_PATH = "data/raw/solutions_training.csv"
TRAIN_LABELS_PATH = "data/raw/training_solutions_rev1.csv"
import numpy as np
import os
import csv
with open(TRAIN_LABELS_PATH, 'r') as f:
reader = csv.reader(f, delimiter=",")
train_ids = []
for k, li... |
from django import forms
from .utils import BootstrapFormMixin
class RegistrationForm(BootstrapFormMixin, forms.Form):
first_name = forms.CharField(label='First Name', max_length=100)
last_name = forms.CharField(label='Last Name', max_length=100)
email = forms.EmailField(label='Email', max_length=100)
... |
# example3_css_properties - fold css properties into the cssCamelCase attributes. e.g.
# style:"margin-left:2em;" becomes cssMarginLeft:"2em"
import os, sys; sys.path.append(os.path.dirname(os.path.abspath(__file__))+os.sep+'..')
from lib.funcytag import funcyTag
div=funcyTag('div')
def bu... |
from builtins import object
class Batch(object):
"""
A fake batch, which batches nothing and just sends messages on the
queue immediately.
"""
def __init__(self, queue, max_batch_len):
self.queue = queue
# NOTE: this is ignored, and "batches" always contain a single job.
sel... |
# -*- coding: utf-8 -*-
# @Time : 2020/11/4 16:04
# @Email : 986798607@qq.com
# @Software: PyCharm
# @License: BSD 3-Clause
from itertools import combinations_with_replacement
import torch.nn.functional as F
import numpy as np
import os
import torch
from numpy import random
from torch import nn
from torch.nn impo... |
from __future__ import annotations
from librespot.common import Utils
from librespot.metadata import SpotifyId
from librespot.metadata.PlayableId import PlayableId
import re
class EpisodeId(SpotifyId.SpotifyId, PlayableId):
_PATTERN = re.compile(r"spotify:episode:(.{22})")
_hexId: str
def __init__(self, ... |
import psutil
p = psutil.Process(8012)
while True:
print(p.cpu_percent()) |
# -*- coding: utf-8 -*-
from rmaics import rmaics
from kernal import record_player
#%%
game = rmaics(agent_num=4, render=True)
game.reset()
# only when render = True
game.play()
#%%
game.save_record('./records/record1.npy')
#%%
print('play saved file')
player = record_player()
player.play('./records/... |
import os
import torch
from torchvision import datasets, transforms
class MNIST:
def __init__(self, args):
super(MNIST, self).__init__()
self.INPUT_SIZE = 784
self.NUM_CLASSES = 10
use_cuda = not args.no_cuda and torch.cuda.is_available()
kwargs = {'num_workers': args.work... |
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
from pyVmomi import vim, pbm
from pyVim.connect ... |
#!/usr/bin/env python
import argparse
import collections
import datetime
import glob
import logging
import math
import os
import random
import re
import sys
import weakref
import time
import pickle
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.majo... |
import numpy as np
import pyransac3d
def get_plane_equation(plane_model, height_map, RESOLUTION, verbose=False):
xgrid, ygrid = np.meshgrid(np.linspace(0, height_map.shape[1]*RESOLUTION, height_map.shape[1]), np.linspace(0, height_map.shape[0]*RESOLUTION, height_map.shape[0]))
xyz = np.zeros((np.size(xgrid), ... |
#!/usr/bin/env python3
import os
import boto3
from io import StringIO
class QuickDirtyS3Storage(object):
def __init__(self):
self.bucketname = os.environ.get('KALEIDOSCOPE_S3_BUCKET')
self.filename = 'kaleidoscope-appstate.json'
resource = boto3.resource('s3')
self.bucket = resourc... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# This script will set subversion property recursively
#
# Usage: SvnSetProp PROPNAME PROPVAL [PATH]
import fnmatch
import getopt
import os
import subprocess
import sys
class SvnSetProp:
def __init__(self):
# ----------------------------
# arguments
# --------------... |
# Copyright 2019 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.
"""Signing Model Objects
This module contains classes that encapsulate data about the signing process.
"""
import os.path
class CodeSignedProduct(object):... |
from rest_framework import serializers
from patientdb.models import Patient, Signals
class PatientSerializer(serializers.ModelSerializer):
class Meta:
model = Patient
fields = ("record_name", "n_sig", "fs", "counter_freq", "base_counter", "sig_len", "base_time", "base_date",
"... |
## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
# see LICENSE.txt for license information
import unittest
import ktable, khashmir
import khash, node, knode
import actions
import test_airhook
import test_krpc
tests = unittest.defaultTestLoader.loadTestsFromNames(['khash', 'node', 'knode', 'actions', '... |
from django import forms
from .models import Analisis
class AnalisisForm(forms.ModelForm):
class Meta:
models = Analisis
fields = [
'tipo_analisis',
'fecha_de_solicitud',
'fecha_resultados',
'resultados',
'analisis_del_diagnostico'
... |
# -*- coding: utf-8 -*-
# Copyright 2017 Tomoki Hayashi (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import argparse
import os
import shutil
import numpy as np
import pytest
from scipy.io import wavfile
from wavenet_vocoder.bin.calc_stats import calc_stats
from wavenet_vocoder.bi... |
#!/usr/bin/python
"""
ZetCode wxPython tutorial
This program creates a Burning widget.
author: Jan Bodnar
website: zetcode.com
last edited: May 2018
"""
import wx
class Burning(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, size=(-1, 30), style=wx.SUNKEN_BORDER)
self.pa... |
#-------------------------------------------------------------------------------
# Lia
#-------------------------------------------------------------------------------
def runLia(inputFile):
fi = open(inputFile, 'r') #reads in the file that list the before/after file names
inputData = fi.readline().split() #re... |
max_dataset = 350
min_dataset = 0
limit_dataset = 250 |
n1 = int(input('Digite um valor: '))
n2 = int(input('Digite outro numero: '))
s = n1+n2
# print ('A soma entre {}'.format (n1),'e {}' .format(n2), 'vale', s)
print('A soma entre {} e {} vale {}' .format(n1, n2, s)) |
indexPassed = []
globalAcc = 0
with open('marcomole00/8/input.txt') as file:
lines = file.read().split('\n')
for instruction in lines:
indexIn = 0
extIndex = lines.index(instruction)
indexPassed = []
infiniteLoop = False
accumulator = 0
field, value = ins... |
import unittest
import pandas as pd
import numpy as np
from pgmpy.estimators import HillClimbSearch, K2Score
from pgmpy.models import BayesianModel
class TestHillClimbEstimator(unittest.TestCase):
def setUp(self):
self.rand_data = pd.DataFrame(
np.random.randint(0, 5, size=(5000, 2)), column... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Module used for working with the Deployment Map (yml) file.
"""
import os
import yaml
from errors import InvalidDeploymentMapError
from logger import configure_logger
LOGGER = configure_logger(__name__)
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.