text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
"""
idfy_rest_client.controllers.person_controller
This file was automatically generated for Idfy by APIMATIC v2.0 ( https://apimatic.io ).
"""
from .base_controller import BaseController
from ..api_helper import APIHelper
from ..configuration import Configuration
from ..ht... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
import random
from paho.mqtt import client as mqtt_client
broker = 'localhost'
port = 1883
topic = "python/mqtt"
# Generate client ID with pub prefix randomly.
client_id = f'python-mqtt-{random.randint(0, 100)}'
def connect_mqtt() -> mqtt_client:
def on_connect(client, userdata, flags, rc):
if rc == 0:
... |
"""Models for daily API."""
# pylint: disable=no-name-in-module
from typing import List
from pydantic import BaseModel, Field
class DailyDataItem(BaseModel):
"""Data Schema."""
station: str = Field(..., title="Station Idenfifier")
date: str = Field(..., title="Calendar Date")
max_tmpf: float = Field... |
from paypalrestsdk import PayoutItem, ResourceNotFound
import logging
logging.basicConfig(level=logging.INFO)
try:
payout_item = PayoutItem.find("YKV9JPD7C2PCY")
print("Got Details for PayoutItem[%s]" % (payout_item.payout_item_id))
except ResourceNotFound as error:
print("Payout Item Not Found")
|
import dm_env
import numpy as np
from mava.adders.reverb import base
from mava.utils.wrapper_utils import parameterized_restart, parameterized_termination
from tests.adders.adders_utils import make_sequence, make_trajectory
agents = {"agent_0", "agent_1", "agent_2"}
reward_step1 = {"agent_0": 0.0, "agent_1": 0.0, "ag... |
from graphgallery.sequence import FullBatchSequence
from graphgallery import functional as gf
from graphgallery.gallery.nodeclas import PyG
from graphgallery.gallery import Trainer
from graphgallery.nn.models import get_model
@PyG.register()
class SGC(Trainer):
"""
Implementation of Simplifying Graph Conv... |
from discord_webhook import DiscordWebhook, DiscordEmbed
from bs4 import BeautifulSoup
from utils import feed as feed_func
from config import url
import asyncio
blacklisted_words = ["@everyone", "@here"]
last_triggered_id = None
async def main():
while True:
data = feed_func()
feed = data[0]
... |
"""
Weather Region
===============
Depending on the number of weather stations, a ``WeatherRegion``
is generated per weather station. Within this regions,
regional load profiles are calculated.
"""
from datetime import date
import uuid
import numpy as np
from energy_demand.technologies import technological_stock
from ... |
import logging
class ObjectHolder(object):
""" Abstract class for holders of objects which are accessed via a data accessor.
Objects can be filtered using a filter function.
"""
def __init__(self):
#logging.debug(__name__ + ": __init__")
self._dataAccessor = None
self._dat... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import random
import re
import unittest
import warnings
import requests
from pymatgen.core import SETTINGS, SETTINGS_FILE, yaml
from pymatgen.analysis.phase_diagram import PhaseDiagram
from pymatgen.analysis.pourbaix_diagram ... |
#image analysis project from vtx
#add training dataset from kaggle project
#https://www.kaggle.com/rhammell/ships-in-satellite-imagery
#paper https://www.irjet.net/archives/V6/i9/IRJET-V6I9291.pdf
import numpy as np
import matplotlib.pylab as plt
import json
from sklearn.model_selection import train_test_split
import ... |
from decimal import Decimal
import numpy as np
from mathpy.combinatorics.factorial import factorial, stirling, stirlingln, ramanujan, risingfactorial, fallingfactorial
def test_factorial():
n = (1, 3, 5, 10, 20, 50)
expected = (1, 6, 120, 3628800, 2432902008176640000,
3.04140932017... |
# import pandas and load nls data
import pandas as pd
pd.set_option('display.width', 78)
pd.set_option('display.max_columns', 7)
pd.set_option('display.max_rows', 200)
pd.options.display.float_format = '{:,.2f}'.format
nls97 = pd.read_csv("data/nls97b.csv")
nls97.set_index("personid", inplace=True)
# create a series f... |
"""Autogenerated 2021-11-16T11:37:36.568263 by redcap_classfiles.py
"""
from ....pgrest import *
from ...constants import Constants
from ..rcconstants import REDCapConstants
from ..rcaptable import RcapTable
__all__ = ["RcapImagingItemsV11"]
class RcapImagingItemsV11(RcapTable):
"""Imaging Items V11"""
__... |
from __future__ import absolute_import
class HashOnReferenceMixin(object):
def __hash__(self):
return hash(id(self))
|
class disjoint_set:
def __init__(self):
self.parents = {}
self.ranks = {}
self.count = {}
def add_node(self,key):
self.parents[key] = key
self.ranks[key] = 0
self.count[key] = 1
def make_child(self,child,parent):
self.parents[child] = parent
def fi... |
import unittest
from ssl import CERT_NONE
from devo.sender import Sender, SenderConfigSSL, Lookup
from .load_certs import *
class TestLookup(unittest.TestCase):
def setUp(self):
self.server = os.getenv('DEVO_SENDER_SERVER', "127.0.0.1")
self.port = int(os.getenv('DEVO_SENDER_PORT', 4488))
... |
import subprocess as _sp
import os as _os
def current_commit():
root = _os.path.split(__file__)[0].split('/')[:-2]
root = '/'.join(root)
# print(root)
out = _sp.check_output(["git", "--git-dir=%s/.git" % root, "--work-tree=%s/" % root, "describe","--always"]).strip()
return out
# return _sp.ch... |
# -*- 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
# -----------------------------------------------------------------------------
try:
basestri... |
#!/usr/bin/env python3
from testUtils import Utils, Account
from Cluster import Cluster
from TestHelper import TestHelper
from WalletMgr import WalletMgr
from Node import Node
import signal
import json
import time
import os
import filecmp
###############################################################
# nodmtp_chain... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-22 06:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mississippi', '0002_resource_views'),
]
operations = [
migrations.AddField(... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def create_default_checker_objects(apps, schema_editor):
Scraper = apps.get_model("dynamic_scraper", "Scraper")
Checker = apps.get_model("dynamic_scraper", "Checker")
for s in Scraper.objects.all():
... |
"""
sparsifier class
"""
from asaplib.compressor import random_split, fps, CUR_deterministic
class Sparsifier:
def __init__(self, sparse_mode):
"""
Object handing the sparsification of data
Parameters
----------
sparse_mode: str
Type of the sparse mode
... |
'''A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
'''
# To use a consistent encoding
from codecs import open as copen
from os import path
# Always prefer setuptools over distutils
from setuptools import setup
# Get the version
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing di
#
# Note that not all possible configuration values are present in this
# auto... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 12 11:46:51 2017
@author: terevaldivia
"""
import os
from CC3501Utils_personal import *
import numpy as np
class Fondo(Figura):
def __init__(self, pos=Vector(0, 0), rgb=(1.0, 1.0, 1.0)):
super(Fondo, self).__init__(pos, rgb)
... |
#!/usr/bin/env python
# coding=utf-8
from CosmAna import Pylib
from CosmAna import PS
import numpy as np
from CosmAna import ReadSnapshot
from CosmAna import PCS as Assigment
from CosmAna import MPI_IO
from smooth import Smooth
import os
def checkdir(dirpath):
isExists = os.path.exists(dirpath)
if not isExists... |
import numpy as np
from cbsyst.helpers import Bunch, maxL
from cbsyst.MyAMI_V2 import MyAMI_K_calc, MyAMI_K_calc_multi
from cbsyst.carbon_fns import *
from cbsyst.boron_fns import *
from cbsyst.helpers import ch, cp, NnotNone, calc_TF, calc_TS, calc_TB, calc_pH_scales
from cbsyst.non_MyAMI_constants import *
# Helper... |
import os
import cdsapi
import xarray as xr
from typing import Type, Union
from zipfile import ZipFile, BadZipFile
from src.data.climate.era5 import get_era5_data
from src.data.climate.ncep import get_ncep_data
DATA_DIR = "/home/emmanuel/projects/2020_rbig_rs/data/climate/raw/rcp/"
c = cdsapi.Client()
xr_types = U... |
def test_request_healthcheck_returns_200(client):
"""Make request to endpoint healthcheck and returns status 200"""
assert client.get("/api/healthcheck").status_code == 200
|
import macpie as mp
from macpie._config import get_option
def date_proximity(
left: mp.Dataset,
right: mp.Dataset,
get: str = "all",
when: str = "earlier_or_later",
days: int = 90,
dropna: bool = False,
drop_duplicates: bool = False,
duplicates_indicator: bool = False,
merge_suffix... |
from opwen_email_server import config
from opwen_email_server.services.auth import AzureAuth
from opwen_email_server.services.storage import AzureFileStorage
from opwen_email_server.services.storage import AzureObjectsStorage
from opwen_email_server.services.storage import AzureObjectStorage
from opwen_email_server.ser... |
# Copyright 2016 Bridgewater Associates
#
# 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... |
'''
Given:
array of integers
Objective:
return a frequency array of the elements
count the number of times a value appears in the array
NB: Aways return a 100 value frequency array
Assumptions:
Example:
arr = [1, 1, 3, 2, 1]
values range = [0 ...... |
SDK_VERSION = 1
ENCODING = "utf-8"
__version__ = '0.1.1'
USER_AGENT = "AliyunEncSDK-python/{}".format(__version__)
|
"""
Module to create a file with the file sizes
From : http://mayankjohri.wordpress.com/2008/07/02/create-list-of-files-in-a-dir-tree/
"""
import os
import sys
from argparse import ArgumentParser
LIST_FILE = "file_sizes.txt"
def get_filesize(path):
""" Module to list file sizes"""
file_list ... |
# Generated by Django 2.2.13 on 2021-04-05 01:30
from django.db import migrations
from django.conf import settings
def forwards(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0018_add_itunes_receipt_field'),
]
operations = [
m... |
#-------------------------------------------------------------------------------
#
# Python GUI - Scrollable objects mixin - Cocoa
#
#-------------------------------------------------------------------------------
from GUI import export
from GUI.GScrollableBases import ScrollableBase as GScrollableBase
class Scrolla... |
from collections import defaultdict
import numpy as np
import torch
import torch.nn.functional as F
import scipy
import scipy.io
from sklearn.preprocessing import label_binarize
from ogb.nodeproppred import NodePropPredDataset
from load_data import load_twitch, load_fb100, DATAPATH
from data_utils import rand_train_te... |
# Generated by Django 2.1 on 2018-10-06 17:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('validator', '0005_auto_20181006_1722'),
]
operations = [
migrations.AddField(
model_name='validationrun',
name='data_f... |
import numpy as np
from statsmodels.robust import mad
from scipy.optimize import minimize_scalar
class BoxCox(object):
"""
Mixin class to allow for a Box-Cox transformation.
"""
def transform_boxcox(self, x, lmbda=None, method='guerrero', **kwargs):
"""
Performs a Box-Cox transformati... |
import numpy as np
import cv2
from helpers.constants import MODEL_PATH, DIGITS_PATH, DIGIT_RECOGNIZER_MODEL_NAME
from helpers.helpers import preprocess_image, check_if_white
from keras.models import load_model
class DigitRecognition:
def __init__(self):
'''
Init function
'''
sel... |
import subprocess
from distutils.util import strtobool
from charmhelpers.core import hookenv
from charms.reactive import (
hook,
when_all,
when_any,
when_not,
is_flag_set,
toggle_flag,
clear_flag,
)
from charms.reactive.relations import endpoint_from_name
from charms import layer
@when_al... |
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
import tempfile
import torch
from mmdet3d.core import limit_period
from mmdet3d.datasets import LyftDataset
def test_getitem():
np.random.seed(0)
torch.manual_seed(0)
root_path = './tests/data/lyft'
# in coordinate system ... |
from django.db import models
# Create your models here.
class Owner(models.Model):
name = models.CharField(max_length=30)
surname = models.CharField(max_length=30)
birth_date = models.DateField()
def __str__(self):
return self.name
def __str__(self):
return self.su... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-22 22:32
from __future__ import unicode_literals
import cms.models.fields
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_f... |
#! /usr/bin/env python3
import sys
from training_config import *
from keras_conf import *
from prep import preprocess
from keras_lb import keras_train
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--tags', nargs='+', help='tags list', required=True)
parser.add_argument('-o', '--object'... |
from copy import copy
from django.conf.urls import patterns, include, url
from tastypie.api import Api
from tastypie.resources import Resource
import collection.api
import catamidb.api
import jsonapi.api
import staging.api
import annotations.api
# monkey patch the Resource init method to remove a particularly cpu hung... |
__version__ = "0.5.26"
|
import tensorflow as tf
import numpy as np
import os
from config.config_Faster_RCNN import cfg
import cv2
from utils.faster_rcnn.anchors import *
from utils.faster_rcnn.roi import proposal_target
import time
from utils.faster_rcnn.load_coco import preprocess
# from utils.faster_rcnn.anchors_target_layer im... |
from pathlib import Path
import os
from shutil import move as sh_mv
from re import match as re_match
from f4pga.common import *
from f4pga.module import Module, ModuleContext
def default_output_name(place_constraints):
p = place_constraints
m = re_match('(.*)\\.[^.]*$', place_constraints)
if m:
re... |
import re, os, pymongo, datetime, asyncio
import motor.motor_asyncio # pylint: disable=import-error
from config import DATABASE, BOT_NAME, SPELLING_MODE
from typing import List
from pyrogram.types import InlineKeyboardButton, Message, InlineKeyboardMarkup
from imdb import IMDb
imdb = IMDb()
myclient = pymongo.MongoCl... |
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... |
from typing import Any, List, Optional
from pydantic import BaseModel
from regression_model.processing.schemas import HouseDataInputSchema
class PredictionResults(BaseModel):
errors: Optional[Any]
version: str
predictions: Optional[List[float]]
class MultipleHouseDataInputs(BaseModel):
inputs: List... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 26 09:40:28 2022
@author: Featherine
"""
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as md
import numpy as np
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxSc... |
import numpy as np
from numpy import abs, sum, exp, log, copy, repeat, min, max, dot, mean, diag, ones
from scipy.sparse import eye
def backend_init():
pass
def graph_dropout(M, _):
return M
def separate_cols(x):
return [x[:, col_num] for col_num in range(x.shape[1])]
def combine_cols(cols):
ret... |
import fnmatch
import itertools
import os
from dcos import http, util
from dcos.errors import DCOSException, DCOSHTTPException
from six.moves import urllib
logger = util.get_logger(__name__)
def get_master(dcos_client=None):
"""Create a Master object using the url stored in the
'core.mesos_master_url' prop... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Ported from latex2sympy by @augustt198
# https://github.com/augustt198/latex2sympy
# See license in LICENSE.txt
import sympy
from sympy.external import import_module
from sympy.printing.str import StrPrinter
from .errors import LaTeXParsingError
LaTeXParser = LaTeXLexer = MathErrorListener = None
try:
LaTeXP... |
import json
import urllib.request
call_url_template = "https://wap.tplinkcloud.com/?token=%s&appName=%s" + \
"&appVer=%s&termID=%s&ospf=%s&netType=%s&locale=%s"
class Bulb(object):
def __init__(self, token, deviceId, transition=50, appName="Kasa_Android",
appVer="1.8.3.674", termID="", ospf="... |
# Copyright 2021 The KNIX 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 agree... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# 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... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from prereq_map.test.course_data import TestCourse
from prereq_map.test.typeahead import TestTypeahead
from prereq_map.test.course_title import TestCourseTitle
from prereq_map.test.process_data import TestProcessData
|
import logging
import os
import unittest
import yaml
from ISR.utils import utils
from unittest.mock import patch
class UtilsClassTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
logging.disable(logging.CRITICAL)
@classmethod
def tearDownClass(cls):
pass
def setUp(self):... |
# inspired from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# https://localhost:4443
import http.server, ssl, os
from subprocess import check_call
IP='0.0.0.0'
PORT... |
from libsim.models import (
SimulationStep,
OnOffController,
)
from libsim.util import (
latest_sample,
)
def is_on(ctrl, step):
return latest_sample(ctrl(step)) == ctrl.on
def is_off(ctrl, step):
return latest_sample(ctrl(step)) == ctrl.off
def controller(start, hyst, on, off):
return OnO... |
import os
from wpkit.basic import PowerDirPath
pkg_dir=PowerDirPath(os.path.dirname(__file__))
pkg_data_dir=pkg_dir+'/data'
pkg_scripts_dir=pkg_data_dir+'/shell_scripts'
pkg_documents_dir=pkg_data_dir+'/documents'
def is_linux():
import sys
pf=sys.platform
if pf=='linux':
return True
return Fal... |
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
import gc
def encode_labels(df, cols = None):
'''
Inputs:
df: a pandas dataframe containing the column for which to calculate target encoding (categ_col)
cols: all columns' names for which to do label encodi... |
import time
from Data.parameters import Data
from reuse_func import GetData
class District_names():
def __init__(self,driver):
self.driver = driver
def test_districtlist(self):
self.p = GetData()
self.driver.find_element_by_xpath(Data.hyper_link).click()
self.p.page_loading(s... |
import logging
GLOBAL_CONFIG_FILE = "/etc/tuned/tuned-main.conf"
ACTIVE_PROFILE_FILE = "/etc/tuned/active_profile"
PROFILE_MODE_FILE = "/etc/tuned/profile_mode"
POST_LOADED_PROFILE_FILE = "/etc/tuned/post_loaded_profile"
PROFILE_FILE = "tuned.conf"
RECOMMEND_CONF_FILE = "/etc/tuned/recommend.conf"
DAEMONIZE_PARENT_TIM... |
basic_english_words = 'a,able,about,account,acid,across,act,addition,\
adjustment,advertisement,after,again,against,agreement,air,all,almost,\
among,amount,amusement,and,angle,angry,animal,answer,ant,any,apparatus,\
apple,approval,arch,argument,arm,army,art,as,at,attack,attempt,attention,\
attraction,authority,auto... |
--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py.intermediate 2021-02-02 16:48:13 UTC
+++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
@@ -32,6 +32,9 @@ def init(root_src_dir):
elif sys.platform.startswith("freebsd"):
... |
# Portfolio
def query_portfolio():
pass
# Positions
def query_open_positions():
pass
def has_open_position(symbol):
pass
def query_open_position_by_symbol(symbol):
pass
# Balances
def query_balance(asset):
pass
def query_balances():
pass
def query_balance_free(asset):
pass
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. 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 requir... |
# Copyright 2017 by Maximilian Greil. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for SVDSuperimposer module."""
import unittest
try:
from numpy import array
... |
import streamlit as st
import tensorflow as tf
from tensorflow.keras.models import model_from_json
from tensorflow.keras.losses import BinaryCrossentropy
import numpy as np
from tensorflow.keras.preprocessing import text
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessi... |
from functools import partial
from celery.schedules import crontab
from celery.task import periodic_task
from corehq.apps.commtrack.models import CommTrackUser, SupplyPointCase
from corehq.apps.sms.api import send_sms_to_verified_number
from custom.ilsgateway.models import SupplyPointStatus, SupplyPointStatusTypes, S... |
from user import Inputs
from calc import Calculations as cal
print(3*"<$>","Welcome to the Investment plnner",3*"<$>")
print("Let's start")
usr = Inputs()
usr.take_inputs()
print("Your total due tax is :",usr.total_tax)
usr.display_invest()
print("We always provide option of complete tax free investments.")
# usr.inves... |
# Copyright 2020 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.
"""Chromium presubmit script for src/components/autofill.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on th... |
from django.db import models
from django.contrib.auth.models import User
# DataBase file here
class Account(models.Model):
#user = models.ForeignKey(User)
name = models.CharField(max_length = 200, null = True)
email = models.CharField(max_length = 200, null = True)
date_created = models.DateTimeField(... |
description = 'memograph readout'
devices = dict(
t_in_memograph_treff = device('nicos_mlz.devices.memograph.MemographValue',
hostname = 'memograph04.care.frm2',
group = 2,
valuename = 'T_in TREFF',
description = 'inlet temperature memograph',
),
t_out_memograph_treff = devic... |
# *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. 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... |
from .linktap import LinkTap
|
"""
AiiDA KKR
"""
__version__ = "0.1.0"
|
import os
import torch.nn as nn
from torchutils.io import ModelSaver
model = nn.Linear(1, 1)
def test_saver_epoch(tmp_path):
n_saved = 5
num_epochs = 10
saver = ModelSaver(tmp_path, filename_prefix="net", score_name="score", n_saved=n_saved)
for epoch in range(num_epochs):
score = 1.0 * epoc... |
# -*- coding: utf-8 -*-
from os import path
from codecs import open
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='zmq-message-patterns',
version='0.1.0',
... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
"""
See https://docs.tamr.com/reference/record
"The recommended approach for modifying records is to use the :func:`~tamr_client.record.upsert` and
:func:`~tamr_client.record.delete` functions for all use cases they can handle. For more advanced use cases, the
underlying :func:`~tamr_client.record._update` function can... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, VARCHAR, FLOAT, Integer, TIMESTAMP, DateTime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from contextlib import contextmanager
engine = create_engine('sqlite:///backend/internal.db')
#engine = creat... |
"""Test instructions that create blocks.
These tests are for Python > 3.8 only, because the syntax used are considered invalid in
Python < 3.8.
"""
import pytest
import sys
from cyberbrain import Binding, Symbol, JumpBackToLoopStart, Loop
from utils import get_value
@pytest.mark.skipif(
sys.version_info < (3, ... |
from .executer import execute_train, execute_validation, execute_drive, folder_execute |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Mieracoind should be started with the command line argum... |
import config
import controllers
|
from .. import db, flask_bcrypt
import datetime
import jwt
from app.main.model.blacklist import BlacklistToken
from ..config import key
class Note(db.Model):
""" Note Model for storing note related details """
__tablename__ = "note"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
desc... |
# This is your "setup.py" file.
# See the following sites for general guide to Python packaging:
# * `The Hitchhiker's Guide to Packaging <http://guide.python-distribute.org/>`_
# * `Python Project Howto <http://infinitemonkeycorps.net/docs/pph/>`_
from setuptools import setup, find_packages
import os
import sys
... |
# coding: utf-8
"""
DocuSign Admin API
An API for an organization administrator to manage organizations, accounts and users # noqa: E501
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa... |
from fastapi import FastAPI
import random
import os
app = FastAPI()
prng = random.Random()
dice_min = int(os.getenv('DICE_MIN') or '1')
dice_max = int(os.getenv('DICE_MAX') or '6')
@app.get('/')
def roll_die():
return dict(result=prng.randint(dice_min, dice_max))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.