text stringlengths 2 999k |
|---|
"""The test project for the timer event circular calling and
updating height interface value.
Command examples:
$ python test_projects/timer_circular_calling_height/main.py
"""
import sys
sys.path.append('./')
import os
from types import ModuleType
from typing_extensions import TypedDict
import ap... |
#!/usr/bin/env python
#
# Copyright (c) 2018 Alexandru Catrina <alex@codeissues.net>
#
# 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 ri... |
#
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
"""Constants."""
import gettext
import os
from otopi import util
from ovirt_engine_setup import config as osetupconfig
from ovirt_engine_setup import constants as osetupcons
from ovirt_engine_setup.c... |
# Toil documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 25 12:37:16 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have ... |
# Panther is a scalable, powerful, cloud-native SIEM written in Golang/React.
# Copyright (C) 2020 Panther Labs Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of t... |
import math
import numpy as np
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as pb
import random
from datetime import datetime
import time
import sys
import csv
def dist(x, y, pos):
return math.sqrt((pos[0]-x)**2 + (pos[1]-y)**2)
areaSiz... |
import db
from src.modeling.model_manager.files import download_file
from src.modeling.reporting.feature_importance import display_importances
def get_column(column, id):
query = f"SELECT {column} FROM model_manager WHERE id = {id}"
data = db.execute(query).fetchone()[0]
return data
def get_y_test(id):
... |
"""
Username/Password Authentication
"""
from django.core.urlresolvers import reverse
from django import forms
from django.core.mail import send_mail
from django.conf import settings
from django.http import HttpResponseRedirect
import logging
# some parameters to indicate that status updating is possible
STATUS_UPDA... |
"""`kedro_viz.services.modular_pipelines` defines modular pipelines-related business logic.
The service layer consist of pure functions operating on domain models.
"""
from typing import Dict
from kedro_viz.constants import ROOT_MODULAR_PIPELINE_ID
from kedro_viz.models.graph import (
GraphNode,
GraphNodeType,... |
# can't use from [module] import [object] because it breaks mocks in testing
from vyper.parser import context as ctx
from vyper.parser.context import Constancy
from vyper.parser.function_definitions.parse_external_function import ( # NOTE black/isort conflict
parse_external_function,
)
from vyper.parser.function_d... |
# Copyright 2017 The Bazel 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 applicable la... |
# Copyright (c) 2012-2016 Seafile Ltd.
from __future__ import unicode_literals
import unicodedata
import urlparse
import json
from functools import wraps
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden
class _HTTPException(Exception):
def __init__(self, message=''):
se... |
from typing import List, Optional
from natsort import natsorted
from qtpy.QtCore import Signal, Qt, QPointF, QSize
from qtpy.QtGui import (
QBrush,
QPainter,
QResizeEvent,
QColor,
QWheelEvent,
QTransform,
)
from qtpy.QtWidgets import (
QSlider,
QLabel,
QHBoxLayout,
QVBoxLayout,
... |
#!/usr/bin/env python
"""Functions for the efficiency statistical analysis."""
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import copy
import numpy as np
import scipy as sp
import ar... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Enable this backend to turn on every single codegen backend within `pants.backend.codegen`."""
from pants.backend.codegen.grpcio.python.grpcio_prep import GrpcioPrep
from pants.backend... |
"""Support for loading code packages into Ray at runtime.
Ray packages allow developers to define self-contained code modules that can
be imported reproducibly into any Ray cluster. Each package can define its own
runtime environment, which can include:
- Different versions of code (e.g., from different git commits).... |
from django.db import models
# Create your models here.
class Product(models.Model):
created = models.DateTimeField(auto_now_add= True)
fk_vendor = models.IntegerField(default= '0')
name = models.TextField()
price = models.FloatField(default= '0.0')
photo = models.TextField()
description = mode... |
import sys
sys.path.insert(0, '..')
from flask import send_from_directory,jsonify,request,render_template,url_for,Response,abort
from app import app,db,celery
import redisearch
# ast is used to convert string literal representation of list to a list,
# this is needed since redis stores list as string
import json,ast... |
from flask_wtf import Form
from wtforms import SelectField, TextField, IntegerField, SubmitField, validators
class ApiForm(Form):
url = TextField("Enter URL")
Extract = SelectField(
'Extract',
choices=[('sp', 'Headers on a Single Page'), ('dh', 'Headers On a domain'),
('lop',... |
# Generated by Django 2.1.2 on 2018-11-08 07:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pywolf', '0035_auto_20181108_1532'),
]
operations = [
# migrations.AlterUniqueTogether(
# name='morganization',
# un... |
from django.test import TestCase
from django.urls import resolve, reverse
from . import views
class TestMapUrl(TestCase):
def test_map_check_resloved(self):
url = reverse('map.check')
self.assertEqual(resolve(url).func, views.check)
def test_map_fetch_resloved(self):
url = reverse('m... |
#!/usr/bin/env python
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... |
#!/usr/bin/env python3
######################################################################
## Author: Carl Schaefer, Smithsonian Institution Archives
######################################################################
import time
import os
import re
import wx
from wx import DirPickerCtrl
import db_access as dba... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.21
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
from django.urls import path
from django.views.generic import TemplateView
from .views import *
app_name = 'core'
urlpatterns = [
path('', TemplateView.as_view(template_name='core/index.html'), name='index'),
path('languages/', LanguageListView.as_view(), name='languages'),
path('languages/<int:pk>/', Lan... |
# pylint: disable=protected-access, redefined-outer-name
from __future__ import absolute_import
import copy
import sys
from argparse import ArgumentParser
from os import PathLike
from pathlib import Path
from typing import Dict
from unittest.mock import MagicMock
import pytest
import snakemake
from configargparse imp... |
"""Django settings for Pontoon."""
from __future__ import absolute_import
import re
import os
import socket
from django.utils.functional import lazy
import dj_database_url
_dirname = os.path.dirname
ROOT = _dirname(_dirname(_dirname(os.path.abspath(__file__))))
def path(*args):
return os.path.join(ROOT, *ar... |
from flask import session, Blueprint, request
from website import db
from helpers import *
from datetime import datetime as dt
import re
master_api = Blueprint('master_api', __name__)
@master_api.route("/logout", methods=['POST'])
def logout():
releaseWaves()
session.pop('username', None)
return success({... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fee.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ... |
"""
Objective
In this challenge, we learn about geometric distributions.
Task
The probability that a machine produces a defective product is 1/3.
What is the probability that the 1st defect occurs the 5th item produced?
"""
def defect(p=1/3, n=5):
return (1-p)**(n-1)*p
print(round(defect(), 3)) |
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, t... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... |
"""
Estimates covariance matrix for KW94 Dataset 1 with
Simulated Max. Likelihood.
"""
import os
import numpy as np
import pandas as pd
import respy as rp
from estimagic.differentiation.differentiation import jacobian
from estimagic.inference.likelihood_covs import cov_jacobian
from estimagic.optimization.optimize im... |
print('TABUADA')
n = int(input('Digite um numero: '))
n1 = n *1
n2 = n *2
n3 = n *3
n4 = n *4
n5 = n *5
n6 = n *6
n7 = n *7
n8 = n *8
n9 = n *9
n10= n *10
print('-----------\n{} x 1 = {}\n{} x 2 = {}\n{} x 3 = {}\n{} x 4 = {}\n{} x 5 = {}\n{} x 6 = {}\n{} x 7 = {}\n{} x 8 = {}\n{} x 9 = {}\n{} x 10 = {}\n-----... |
## lists5.py
def main():
pals = [] ### an empty list
num = int(input('How many pals to add? '))
for n in range(num):
pal = input('Enter name of pal ')
pals.append(pal)
pals.append('Jenny')
pals.insert(3,'Lenny')
print(pals) ## crude dump
... |
import unittest
import os
from datetime import datetime
from util import Singleton
from .. import GithubService, GithubRemote, GithubRealRemote
@Singleton
class GithubMockRemote(GithubRemote):
def get_notifications(self):
return [{"type": "Issue", "title": "This is an issue"}]
def connect(self, key)... |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon Kinesis Analytics'
prefix = 'kinesisanalytics'
class Action(BaseAction):
def __init__(self, action=None):
... |
def tsv_from_dicts_list(dicts_list, tsv_path, max_cells_in_mem=-1):
pass
|
# noqa: D100
########################################################################################
# This file is part of exhale. Copyright (c) 2017-2019, Stephen McDowell. #
# Full BSD 3-Clause license available here: #
# ... |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import re
from datadog_checks.utils.common import get_docker_hostname
import psycopg2
HOST = get_docker_hostname()
PORT = '6432'
USER = 'postgres'
PASS = 'datadog'
DB = 'datadog_test'
DEFAULT_INSTANCE = {
'... |
# As the test filename says, init functions must return None.
# This file tests that; it also makes sure that it gets tested
# when in a patchpoint.
class C(object):
def __init__(self, n):
self.n = n
if n == 500:
return n
# Call it in a loop to make sure that the constructor gets inlin... |
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copy... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... |
# -*- coding:utf-8 -*-
from django.conf.urls import include
from django.urls import path
from encounterapp.api.history import PatientHistoryView, PatientHistoryUpdateView
from encounterapp.api.encounter import EncounterView, EncounterUpdateView
from encounterapp.api.refer import PatientReferView, PatientReferUpdateView... |
import numpy as np
import matplotlib.pyplot as plt
from pylab import *
import os
import sys
import time
import cv2
from PIL import Image
from keras.preprocessing.image import *
from keras.utils.np_utils import to_categorical
from keras.models import load_model
import keras.backend as K
from models import *
from infere... |
import os
import mock
import six
import tempfile
from specter import Spec, expect
from aumbry.errors import LoadError, SaveError
from aumbry.utils.file import load_file, save_file
class VerifyFileUtils(Spec):
def before_each(self):
self.cfg_file = tempfile.NamedTemporaryFile(delete=False)
with s... |
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import haystack
from haystack.backends import (
BaseEngine,
BaseSearchBackend,
BaseSearchQuery,
EmptyResults,
log_query,
)
from haystack.constants import DJANGO_CT, DJANGO_ID, ID
from haystack.... |
from typing import Union, NamedTuple, Optional, Any, Callable
import jax.numpy as jnp
import jax
import chex
from optax._src import base
from optax._src import combine
from optax._src import numerics
from optax._src import transform
ScalarOrSchedule = Union[float, base.Schedule]
def _scale_by_learning_rate(learni... |
import random
import asyncio
import tempfile
from aiohttp import web
from unittest import mock
from http import HTTPStatus
from aiohttp.test_utils import TestServer
from dffml.util.asynctestcase import AsyncTestCase
from dffml import (
DataFlow,
run,
INISecret,
Input,
BaseDataFlowFacilitatorObjectC... |
from django.test import TestCase
from django.utils import timezone
import datetime
from django.core.exceptions import ValidationError
from BasicBusinessManager.models.order_related_objects.sale_out import Sale_out
# Create your tests here.
class SaleOutModelTests(TestCase):
def test_is_sale_name_returned_properly(... |
from __future__ import absolute_import
from django.contrib.localflavor.mk.forms import (
MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField)
from django.test import SimpleTestCase
from .forms import MKPersonForm
class MKLocalFlavorTests(SimpleTestCase):
def setUp(self):
self.form = MKPerson... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@Auther :liuyuqi.gov@msn.cn
@Time :2018/7/9 22:26
@File :plot.py
'''
def plotGroup(): # df3新建一列
df3["disk"] = None
for i in range(0, 68219):
df3["disk"][i] = lambda x: x[i], df1["disk"]
# instance分类统计
group1 = df3.groupby("appid").count()
... |
'''
@author: Pranshu Aggarwal
@problem: https://hack.codingblocks.com/app/practice/1/132/problem
'''
def chewbacca_and_numbers(n):
num, sum, i = n, 0, 0
while n > 9:
rem = n % 10
if rem > 9 - rem: rem = 9 - rem
powerToI = int(10**i)
sum += int(rem * powerToI)
... |
def sum_square_even_root_odd(nums):
|
# coding: utf-8
"""
Tests for advanced stores
"""
import os
import shutil
import signal
import subprocess
import tempfile
import time
from unittest.mock import patch
from uuid import uuid4
import pytest
from mongogrant import Client
from mongogrant.client import check, seed
from mongogrant.config import Config
from py... |
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=True, image='yandex/clickhouse-server', tag='20.1.10.70', with_installed_binary=True, stay_alive=True)
node2 = clu... |
class Solution:
def numWays(self, steps: int, arrLen: int) -> int:
MOD = 10 ** 9 + 7
K = min(arrLen-2, steps+5)
arr = [1, 1] + [0] * (K)
for i in range(steps-1):
new_arr = arr[:]
for j in range(len(arr)):
if j != 0:
new_arr... |
#!/usr/bin/env python
# -- coding: utf-8 --
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (th... |
from __future__ import absolute_import, division, print_function, unicode_literals
from fuse.components import Component
class Ansible(Component):
pass
|
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import pytest
import numpy as np
from emcee.autocorr import integrated_time, AutocorrError
def get_chain(seed=1234, ndim=3, N=100000):
np.random.seed(seed)
a = 0.9
x = np.empty((N, ndim))
x[0] = np.zeros(ndim)
for i in rang... |
import sys
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.core.exceptions import PermissionDenied
from django.template import TemplateDoesNotExist, Temp... |
from datetime import datetime, timedelta
from django.conf import settings
from hashlib import md5
import glob
import logging
import os, sys
import requests
import tempfile
logger = logging.getLogger(__name__)
ssl_verify = True
def make_image(progress_id):
tmpdir = tempfile.mkdtemp()
now = datetime.utcnow()
... |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='mlops deploy',
author='felipe.filgueira',
license='',
)
|
import torch
import torch.nn as nn
import torchvision
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import utils
import os
from PIL import Image
class ResnetGenerator(nn.Module):
""" Generator class utilizing resnets"""
def __init__(self, input_channels, output_channels... |
import os,sys
import matplotlib.pyplot as plt
import itertools
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.autograd as autograd
from torchvision import datasets, transforms
from torchvision.utils import save_image
from torc... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 itertools as it
import warnings
from sympy.core.function import Function
from sympy.core.numbers import I, oo, Rational
from sympy.core.power import Pow
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.functions.elementary.miscellaneous import (sqrt, cbrt, root, Min,
... |
from dataclasses import dataclass, field
from common.utils import load_programming_languages, load_stopwords, load_design_tools, load_business_analyst_skills
from acora import AcoraBuilder
@dataclass
class JobDescription:
job_title: str
job_description: str
job_company: str
job_yake_keywords: list = f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
pymysql installed as MySQLdb
"""
from . import pymysql
pymysql.install_as_MySQLdb()
# vi:set tw=0 ts=4 sw=4 nowrap fdm=indent
|
import requests
import shutil
import json
import sys
def download_file(url, dest):
response = requests.get(url, stream = True)
response.raise_for_status()
with open(dest, 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
def render_latex(output_format, latex, dest_filename, host = 'http://63.142.251.... |
import random
import re
from pylatex import NoEscape, Subsection, Enumerate
simbolo_variable = '&'
class InstanciaEjercicio:
titulo = None
def __init__(self, titulo, problema, respuesta, distractores, parametros, formulas):
vars_instanciadas = {}
for nombre, parametro in parametros.items():
vars_instanci... |
"""
Built-in block-level token classes.
"""
import re
import sys
from itertools import zip_longest
import mistletoe.block_tokenizer as tokenizer
from mistletoe import span_token
from mistletoe.core_tokens import (
is_link_label,
follows,
shift_whitespace,
whitespace,
is_control_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMemberDataOauthQueryModel import KoubeiMemberDataOauthQueryModel
class KoubeiMemberDataOauthQueryRequest(object)... |
"""Tests for the `skewt` module."""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing
import datetime as dt
import pytest
from cartopy import crs as ccrs
import tropycal.tracks as tracks
def assert_almost_equal(actual, desired, decimal=7):
"""Check that values are almost e... |
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from what_apps.do.models import Task
from what_apps.social.models import DrawAttention
T = ContentType.objects.get_for_model(Task)
def get_messages_for_user(user):
'''
Takes a user, returns a sorted list of tuples where... |
# Copyright 2019, OpenTelemetry 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 agreed to i... |
from configshell_fb import ConfigNode, ExecutionError
from uuid import UUID
from rpc.client import JSONRPCException
import json
def convert_bytes_to_human(size):
if not size:
return ""
for x in ["bytes", "K", "M", "G", "T"]:
if size < 1024.0:
return "%3.1f%s" % (size, x)
si... |
from typing import List
import watchmen.pipeline.index
from watchmen.common.constants import pipeline_constants
from watchmen.common.snowflake.snowflake import get_surrogate_key
from watchmen.database.topic.adapter.topic_storage_adapter import get_template_by_datasource_id
from watchmen.monitor.model.pipeline_monitor ... |
from ..core.Processor import Processor
class PutS3Object(Processor):
def __init__(
self,
object_key='test_object_key',
proxy_host='',
proxy_port='',
proxy_username='',
proxy_password=''):
super(PutS3Object, self).__init__(
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Some wrappers to avoid circular imports, or make certain calls easier.
"""
"""
The idea of a 'global' vispy.use function is that although vispy.app
and vispy.gloo.gl can b... |
import can
import threading
import time
def can_bus_monitor():
while True:
message = can_bus.recv();
if (message.arbitration_id == 0x500):
print("=============================");
print("RPM: ", int.from_bytes([message.data[0], message.data[1]], byteorder='little', signed=False)/4)
print("CLT: ", int.from... |
from django.conf.urls import *
from corehq.apps.styleguide.examples.controls_demo.views import *
from corehq.apps.styleguide.views.docs import (
SelectControlFormExampleView,
SelectControlViewExampleView,
)
urlpatterns = patterns('corehq.apps.styleguide.examples.simple_crispy_form.views',
url(r'^$', Defaul... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
"""
This file offers the methods to automatically retrieve the graph SmaGri.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-0... |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
# tutorial:
# https://python-packaging.readthedocs.io/en/latest/index.html
setup(name='mobilpy',
version='0.4.1',
description='Library that helps create the XML necessary for online payments with Mo... |
#!/usr/bin/env python3
# coding: utf-8
event_names = []
f = open('stopevents.txt', 'r')
line = f.readline()
while line:
event_names.append(line.strip())
line = f.readline()
f.close()
f = open('include/utils/stopevents_defs.h', 'w')
f.write('/* Generated file, see stopevents_gen.py */\n\n')
i = 0
for e in event_nam... |
import sys
import json
from os import path, remove, makedirs
from subprocess import call
import signal
import time
begin_time = time.time()
runs = 50
job_minutes = 230
run_minutes = 180
folder = "radius"
jobname = sys.argv[1]
def try_run_fill(base_string, fill):
if path.exists(fill['filename'] + ".dat") or path.e... |
# Created by MechAviv
# Dragon Fireworks Damage Skin | (2435802)
if sm.addDamageSkin(2435802):
sm.chat("'Dragon Fireworks Damage Skin' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""YOLO_v3 Nano Model Defined in Keras."""
import os
from keras_applications.imagenet_utils import _obtain_input_shape
from tensorflow.keras.utils import get_source_inputs, get_file
from tensorflow.keras.layers import UpSampling2D, Concatenate, Dense, Multiply, Add... |
import logging
from dataclasses import dataclass
from typing import Optional
from bitstring import BitArray
from blspy import G1Element, AugSchemeMPL, PrivateKey
from chiapos import Verifier
from scam.consensus.constants import ConsensusConstants
from scam.types.blockchain_format.sized_bytes import bytes32
from scam.... |
# coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.lookups import Lookups, Table
from spacy.strings import get_string_id
from spacy.vocab import Vocab
from ..util import make_tempdir
def test_lookups_api():
table_name = "test"
data = {"foo": "bar", "hello": "world"}
lookups... |
"""Deprecated: use jeepney.io.asyncio instead"""
import asyncio
from warnings import warn
from jeepney import Parser, MessageType
from jeepney.auth import AuthenticationError, BEGIN, make_auth_external, SASLParser
from jeepney.bus import get_bus
from jeepney.bus_messages import message_bus
from jeepney.routing import ... |
import pandas as pd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def df_summary (df):
info = df.info()
describe = df.describe()
nulls = df.isnull().sum()/len(df)*100
value_count = df.value_counts()
... |
import yaml
def of_yaml(path_yaml: str):
with open(path_yaml, 'r', encoding='utf-8') as f:
return yaml.load(f.read(), Loader=yaml.FullLoader)
|
from load_data import LoadData
from check_solution import CheckSudoku
from brute_force.brute_force import BruteForce
from base_solver.solve_it_like_a_human import SolveItLikeAHuman
from genetic_algorithm.genetic_algorithm import GeneticAlgorithm
import numpy as np
import logging
logger = logging.getLogger('Sudoku Solve... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
file = open("out.dat", "r")
# parse data in file
for (id, line) in enumerate(file):
min_n = 3
max_n = 0
# a2 and f2 are initialized with a latency 0 since for n = 3 we don't have a latency value
data = {"a1": [], "a2": [0], "f1": [],... |
from django.http import HttpResponse
from django.shortcuts import render
from .models import Post
def home(request): # the root folder of the templates must be the templates folder
# pass a context
return render(request, "blog/home.html", context={"posts": Post.objects.all()})
# this also populates the ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim.lr_scheduler import StepLR
import sys, pickle
import numpy as np
from copy import deepcopy
from .blocks import Encoder1,Encoder2,Decoder,domainClf
# define the NN architecture
class ConvAutoencoder(nn.Module):
"""
"""
def __init... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.