text stringlengths 2 999k |
|---|
import sys
import pickle
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble... |
import requests
import zipfile
import json
import os
import sys
import pandas as pd
from time import sleep
from utils.config import qualtrics_sitewide_creds
from utils import db, db_utils
class QualtricsApi:
"""Query Qualtrics API for new survey responses and then write to database.
Attributes:
apiTo... |
from .datasets import Datasets
from .reshape import Reshape
from .reshape_config import ReshapeConfig
from .spark_io import SparkIO, SparkIOContext
from .spark_io_config import SparkIOConfig
from .table_name import TableName
__all__ = [
"Datasets",
"Reshape",
"ReshapeConfig",
"SparkIO",
"SparkIOCon... |
"""Xiaomi aqara button sensor."""
import logging
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import Basic, Identify, MultistateInput, OnOff
from .. import LUMI, BasicCluster, PowerConfigurationCluster, XiaomiCustomDevice
from ... import CustomCluster
from ...const import (
COMMAND,
COMMAND_... |
"""
Hosts the code for the Exclude window
|
"""
import tkinter as tk
import importlib
from GUI.languages import en
from GUI.widgets import create_label, create_canvas, create_frame, create_scrollbar, \
create_check_button, create_int_var, create_button
from app.main import open_export_folder
cl... |
# This file is part of libigl, a simple c++ geometry processing library.
#
# Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public License
# v. 2.0. If a copy of the MPL was not distributed with thi... |
import torch
import torch.nn as nn
from .midas.midas_net import MidasNet
class DoepdNet(torch.nn.Module):
"""
There are 3 run modes available for this model.
1. Yolo : Trains/Inferences only yolo layer, while ignoring midas and planeRCNN
2. PlaneRCNN : Trains/Inferences only PlaneRCN... |
import os
import numpy as np
import pandas as pd
import torch
import tensorflow as tf
# Custom Library
import sys
sys.path.append('../')
from proxy_apps import ProxyTSPRD
from proxy_apps.utils import file_reader, path_handler
class ProcessDataFile(tf.data.Dataset):
def _generator(file_name, n_rows, n_cols, n_rep... |
import json
import getpass
import socket
import urllib2
import urlparse
import platform
import eventlet
import eventlet.greenpool
import requests
def join_sockets(a, b):
""" socket joining implementation """
def _pipe(from_, to):
while True:
try:
data = from_.recv(64 * 102... |
from bs4 import BeautifulSoup
from collections import defaultdict
import pandas as pd
import pickle
import requests
from unidecode import unidecode
# this dictionary will map players to a set containing all the years in which they were selected for an all-star game, either initially or as a replacement
all_star_appear... |
class Gender:
masculine = 0
feminine = 1
neuter = 2
class Case:
nominative = 0 # именительный
genitive = 1 # родительный
dative = 2 #дательный
accusative = 3 # винительный
instrumental = 4 #творительный
prepositional = 5 #предложный
# Data structure which holds information a... |
import numpy as np
class MazeMap:
def __init__(self):
pass
def from_dict(self, mapdict):
pass
example_mapdict = {
"start": (5, 6),
"goal": (5, 3),
"walls": {
"top": [[(0,0), (10,0)],
[(2,1), (8,1)],
[(4,2), (6,2)]],
... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import os
import json
from torchvision import datasets, transforms
from torchvision.datasets.folder import ImageFolder, default_loader
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.data import create_transform
... |
import os
import molgrid
import pytest
import torch
def pytest_addoption(parser):
# Allows user to force tests to run on the CPU (useful to get performance on CI)
parser.addoption(
"--nogpu",
action="store_false",
help="Force tests to run on CPU",
)
@pytest.fixture(scope="sessio... |
# coding=utf-8
"""
Tests of the code in uncertainties/__init__.py.
These tests can be run through the Nose testing framework.
(c) 2010-2016 by Eric O. LEBIGOT (EOL).
"""
from __future__ import division
# Standard modules
import copy
import weakref
import math
from math import isnan, isinf
import random
import sys... |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Björn Larsson
#
# 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 r... |
# -*- coding: utf-8 -*-
# Global imports
import sys,time
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
import itertools
import argparse as ap
import multiprocessing as mp
# Script information
__author__ = "Sergi Rodà"
__license__ = "MIT"
__version__ = "1.... |
import os, sys
import pprint, argparse
import boto3
def main(args):
rekognition = boto3.client('rekognition')
# Configure argument for rekognition.Image
if args.s3_bucket and args.filepath:
# case: specify API input using image in AWS S3
img_kwarg = {
'S3Object': {
... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
# Message logger service
process.load("FWCore.MessageService.MessageLogger_cfi")
# DT and CSC geometry
process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
# Read... |
"""
Variable manager for Jac
Representations for all jac runtime variables
"""
from jaseci.element.element import element
from jaseci.graph.node import node
from jaseci.graph.edge import edge
from jaseci.jac.jac_set import jac_set
import uuid
NoneType = type(None)
class JAC_TYPE:
STR = "JAC_TYPE.STR"
INT = ... |
# DO NOT EDIT! This file is automatically generated
import marshmallow
from commercetools import helpers, types
from commercetools.schemas._common import (
LocalizedStringField,
LoggedResourceSchema,
ReferenceSchema,
ResourceIdentifierSchema,
)
from commercetools.schemas._type import FieldContainerFie... |
import subprocess
import glob
import os
HOME_SITE="/home/site/wwwroot"
DEFAULT_SITE="/opt/defaultsite"
STARTUP_COMMAND_FILE="/opt/startup/startupCommand"
APPSVC_VIRTUAL_ENV="antenv"
# Temp patch. Remove when Kudu script is available.
os.environ["PYTHONPATH"] = HOME_SITE + "/antenv/lib/python3.6/site-packages"
def su... |
"""Convert a path to an image (JPG/JPEG/PNG) to a vector of class probabilities created by a pretrained ImageNet deeplearning model (Keras, TensorFlow)."""
import importlib
from h2oaicore.transformer_utils import CustomTransformer
from h2oaicore.models import TensorFlowModel
import datatable as dt
import numpy as np
fr... |
# -*- coding: UTF-8 -*-
import sys
import os
from torch.utils.data import DataLoader,Dataset
import torchvision.transforms as transforms
from PIL import Image
sys.path.append('../')
# print(type(sys.path), '\r\n'.join(sys.path))
import torch.nn as nn
from end2end_model.training_set_gen import gen_config
from end2end_... |
"""EnvStore module for TcEx Framework"""
# flake8: noqa
from .env_store import EnvStore
|
# 1. data
dataset_type = "Thumos14Dataset"
data_root = "data/thumos14/"
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True
)
num_frames = 480
chunk_size = 32
img_shape = (112, 112)
overlap_ratio = 0.25
keep_ratio = 0.4
feat_downsample = 2
expid = "3.a.iii"
data = dict(
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-16 17:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Bucket... |
#!/usr/bin/env python3
# Copyright (c) 2020 6WIND S.A.
# SPDX-License-Identifier: BSD-3-Clause
"""
Minimalist application that subscribes to module changes, operational data
requests and RPC calls for the sysrepo-example.yang module.
"""
import argparse
import logging
import signal
import sys
import time
import liby... |
from copy import copy
from typing import Tuple, Union
import numpy as np
import aesara.tensor.basic
from aesara.configdefaults import config
from aesara.gradient import DisconnectedType
from aesara.graph.basic import Apply
from aesara.graph.null_type import NullType
from aesara.graph.op import COp, ExternalCOp, OpenM... |
# Copyright 2015 Confluent 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 required by applicable law or agreed to in writing, s... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Embrane, 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/l... |
import logging
import os
import sys
initialized = False
def setup_logging():
FORMAT = f"[%(asctime)s] - {os.getpid()} - %(levelname)s | %(name)s | %(funcName)s | %(message)s"
logging.basicConfig(
level=logging.DEBUG, format=FORMAT, filename="debug.log", filemode="w"
)
formatter = logging.Fo... |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffypdnn(RPackage):
"""The package contains functions to perform the PDNN method
desc... |
import os.path as osp
import shutil
import unittest
import numpy as np
import skrobot
import trimesh
class TestAxis(unittest.TestCase):
def test_init(self):
skrobot.model.Axis()
def from_coords(self):
coords = skrobot.coordinates.Coordinates()
skrobot.model.Axis.from_coords(coords)... |
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import distance2bbox, force_fp32, multi_apply, multiclass_nms, multiclass_nms_with_mask
from mmdet.ops import ModulatedDeformConvPack
from ..builder import build_loss
from ..registry import HEADS
from ..utils import ConvModule, Scale,... |
import keyboard
from player_detector import PlayerDetector
from drops_detector import DropsDetector
from snapshoter import Snapshoter
PIC_INTERVAL_SEC = 0.1
PICKUP_BUTTON = 'z'
class DropsSnapshoter(Snapshoter):
def __init__(self, pipe_connection):
super().__init__(pipe_connection, PIC_INTERVAL_SEC)
... |
import numpy as np
import itertools
import sys
import os
from qmla.exploration_strategies import connected_lattice
import qmla.shared_functionality.probe_set_generation
from qmla import model_building_utilities
class IsingProbabilistic(connected_lattice.ConnectedLattice):
def __init__(self, exploration_rules, **k... |
# import pandas as pd
# from datetime import date, timedelta
# from point import Point
# import os
# from urllib.error import HTTPError
# sdate = date(2020, 3, 22) # start date || this is the first day that JHU posted data for MDC
# edate = date.today() # end date || currently set to yesterday's date beca... |
import inspect
from contextlib import ExitStack
from enum import Enum
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generator,
List,
NamedTuple,
Optional,
Sequence,
Union,
cast,
)
from dagster import check
from dagster.core.errors import (
DagsterInvalidDefinitionError,... |
import pygatt
import retrying
import struct
TIMEOUT = 1
UUID_DEVICE_NAME = "00002a00-0000-1000-8000-00805f9b34fb"
UUID_MODEL_NUMBER = "00002a24-0000-1000-8000-00805f9b34fb"
UUID_MANUFACTURER = "00002a29-0000-1000-8000-00805f9b34fb"
UUID_READ = "bccb0003-ca66-11e5-88a4-0002a5d5c51b"
UUID_WRITE = "bccb0002-ca66-11e5-8... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
__version__ = "1.0.0"
__author__ = "Qu DoNG"
# https://leetcode.com/problems/reverse-string/
class Solution(object):
def reverseString_(self, s):
"""
result status: Time Limit Exceeded...
:type s: str
:rtype: str
"""
... |
"""
Copyright 2020 The OneFlow 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 law or agr... |
#!/usr/bin/env python3
import pytest
from helpers.cluster import ClickHouseCluster
import random
import string
import os
import time
from multiprocessing.dummy import Pool
from helpers.network import PartitionManager
from helpers.test_tools import assert_eq_with_retry
from kazoo.client import KazooClient, KazooState
c... |
'''Copyright 2018 Province of British Columbia
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 in writing,... |
def chess_positions():
return [f"{char}{num + 1}" for num in range(8) for char in "abcdefgh"]
def knight_moves():
positions = chess_positions()
moves = []
for position in positions:
position_alpha_ord = ord(position[0])
position_digit = int(position[1])
moves.append(f"{position}... |
# 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 in writing, software
# distributed under the... |
from datetime import datetime
class PathEntity:
def __init__(self, enter_time, leave_time, eid):
self.enter_time = enter_time
self.leave_time = leave_time
self.eid = eid
class Path:
def __init__(self, oid, pid, path_entities):
self.oid = oid
self.pid = pid
self... |
# Copyright 2018 The TensorFlow Probability 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 o... |
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, parent=None, title="CheckBOx Example")
self.mainPanel = wx.Panel(self)
self.checkBold = wx.CheckBox(self.mainPanel, label="Bold")
self.checkBold.SetValue(wx.CHK_CHECKED)
self.checkItalic = wx.CheckBox(self.mainPanel, label="It... |
#!/usr/bin/env python3
import subprocess
import logging
import copy
import os
import time
from schema import VMDescriptionSchema, VMNameSchema
from expose import ExposedClass, exposed, transformational
from exception import VMRunningError, VMNotRunningError
from threading import RLock
from tap_device import TAPDevice... |
import pandas as pd
from src.data.fuels.calc_ghgi import calcGHGI
from src.data.fuels.calc_cost import calcCost
from src.timeit import timeit
# calculate fuel data
@timeit
def calcFuelData(times: list, full_params: pd.DataFrame, fuels: dict, gwp: str = 'gwp100', levelised: bool = False):
fuelSpecs = {'names': {}... |
#!/usr/bin/env python3
import numpy
import scipy.stats
import matplotlib
matplotlib.use("Agg")
import pylab
import seaborn
seaborn.set(context="paper", style="white", palette="deep")
data=numpy.loadtxt("bias_log.csv", delimiter=",")
data[:,0]*=1000
linfit=numpy.zeros([4,4])
pylab.close()
pylab.figure(figsize=(3,2))... |
# First import the library
import pyrealsense2 as rs
from PIL import Image
import numpy as np
import cv2
image_no = 100000
# Create a context object. This object owns the handles to all connected realsense devices
pipeline = rs.pipeline()
config = rs.config()
print(config)
exit()
config.enable_stream(rs.stream.dept... |
from builtins import str
from builtins import zip
from builtins import range
from past.builtins import basestring
import unittest2 as unittest
import numpy as np
from vsm.viewer.labeleddata import *
class TestLabeleddata(unittest.TestCase):
def setUp(self):
words = ['row', 'row', 'row', 'your', 'boat'... |
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
#
import enum
import typing
from typing import Optional, List, Tuple, cast, overload
from kopf.structs.bodies import Body
from ..k8sobject import K8sInte... |
import inspect
import os
import re
import sys
from collections import abc
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Set, Tuple, Union
from unittest.mock import MagicMock, patch
import yaml
from django.http import HttpResponse
from jsonschema.exceptions import ValidationError
from zerv... |
## @ingroup Components-Energy-Networks
# Solar.py
#
# Created: Jun 2014, E. Botero
# Modified: Feb 2016, T. MacDonald
# Mar 2020, M. Clarke
# Jul 2021, E. Botero
# Aug 2021, M. Clarke
# ----------------------------------------------------------------------
# Imports
# ----------------... |
# -*- coding: utf-8 -*-
"""DNACenterAPI pnp API fixtures and tests.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
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, inclu... |
from django.contrib import admin
# Register your models here.
from apps.user.models import User
admin.site.register(User)
|
"""
Example of solving a Kaggle problem using schemaflow's API.
This script performs an end-to-end analysis and prediction of the Kaggle exercise
https://www.kaggle.com/c/house-prices-advanced-regression-techniques
It demonstrates the advantages of explicitly declaring the types in the Pipe (using Schemaflow's API).
... |
for a in range(100,1000):
ge=a%10
shi=a//10%10
bai=a//100
if a == bai**3+shi**3+ge**3 :
print("水仙花数是{}。".format(a))
|
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
# -*- coding: utf-8 -*-
"""SQLite parser."""
from __future__ import unicode_literals
import os
import tempfile
# pylint: disable=wrong-import-order
try:
from pysqlite2 import dbapi2 as sqlite3
except ImportError:
import sqlite3
from dfvfs.path import factory as dfvfs_factory
from plaso.lib import specification... |
#import module from tkinter for UI
from tkinter import *
from playsound import playsound
import os
from datetime import datetime;
#creating instance of TK
root=Tk()
root.configure(background="white")
#root.geometry("300x300")
def function1():
os.system("py dataset_capture.py")
def function2():
... |
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class UserProfile(AbstractUser):
email = models.EmailField(unique=True)
|
"""
ASGI config for yemeksepeti project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... |
import win32gui, win32con, win32api, time, os, glob
## some of these tests will fail for systems prior to XP
for pname in(
## Set actions all take an unsigned int in pvParam
"SPI_GETMOUSESPEED", "SPI_GETACTIVEWNDTRKTIMEOUT", "SPI_GETCARETWIDTH",
"SPI_GETFOREGROUNDFLASHCOUNT", "SPI_GETFOREGROUNDLOCKTI... |
#
# andre@corp.insite.com.br
# 2017-10-10
# Codigo que faz regressao simples e encontra embeddings
#
# a ideia aqui e a seguinte:
# - carregar dados do movielens
# - inicializar o embedding de forma aleatoria
# - encontrar os embeddings de filmes e de usuarios que gerem o menor erro possivel
# t8: retira os bias de... |
import cv2
import torch
import torchvision.utils
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import glob
import pprint
import os
import time
from shutil import copyfile
import pdb
import random
from collections import Counter, namedtuple
from models import DnCNN_DS, MulticlassNet
fro... |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2016-2019 Datadog, Inc.
from checks import AgentCheck
from common import assert_init_config_init, assert... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
##############################
#### Revision information ####
import subprocess
major_ver = 2
minor_ver = 1
old_count = 208
try:
revision = int(subprocess.check_output(['git', 'rev-list', '--count', '--first-parent', 'HEAD']))
ver_str = '%d.%d.%d' % (major_ver, mino... |
"""
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
import fnmatch
import os
import re
from enum import IntEnum
from . import builtin
from ..file_types import File
from ..iterutils import iterate
from ..backends.make import writer as make
from ..backends.ninja import writer as ninja
from ..backends.make.syntax import Writer, Syntax
from ..build_inputs import build_inpu... |
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import csv
import uuid
import StringIO
from huxley.accounts.models import User
from huxley.core.constants import ContactGender, ContactType, ProgramTypes
from huxley.core... |
#coding:utf-8
import numpy as np
import pylab as pl
from sklearn import svm, datasets
"""
線形SVMでirisデータを分類
"""
# データをロード
iris = datasets.load_iris()
X = iris.data[:, :2]
Y = iris.target
# 分類器を学習
clf = svm.SVC(C=1.0, kernel='linear')
clf.fit(X, Y)
pl.figure(1)
# メッシュの各点の分類結果を描画
h = 0.02
x_min, x_max = X[:, 0].min()... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Input:
CREDENTIALS = "credentials"
HOSTNAME = "hostname"
PORT = "port"
class ConnectionSchema(insightconnect_plugin_runtime.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variable... |
import unittest
from unittest import mock
from unittest.mock import MagicMock
from clovars.simulation import analyse_simulation_function
from tests import SKIP_TESTS
@mock.patch('clovars.simulation.analysis.analyse_simulation.SimulationLoader') # do not actually attempt to load data!
class TestAnalyseSimulation(uni... |
# -*- coding: utf-8 -*-
import collections
import itertools as itt
import numpy as np
from iminuit import Minuit
from ._libstat import _vector_apply
from .costfunc import BinnedChi2, BinnedLH, UnbinnedLH
from .nputil import minmax
def fit_uml(f, data, quiet=False, print_level=0, *arg, **kwd):
"""
perform un... |
"""User url routes"""
from django.conf.urls import include
from django.urls import path
from rest_framework import routers
from profiles.views import (
UserRetrieveViewSet,
CurrentUserRetrieveUpdateViewSet,
CountriesStatesViewSet,
ChangeEmailRequestViewSet,
)
router = routers.DefaultRouter()
router.re... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Mrunmay D and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.utils.nestedset import NestedSet
class Account(NestedSet):
nsm_parent_field = "parent_account"
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... |
# -*- coding: utf-8 -*-
# SimpleNetV1(2016)
# Implementation of https://arxiv.org/abs/1608.06037
# Lets keep it simple, Using simple architectures to outperform deeper and more complex architectures
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import os
... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 5 17:04:12 2021
@author: adamkritz
"""
import matplotlib.gridspec as grd
import pandas as pd
import sys
from PyQt5.QtWidgets import QMainWindow, QAction, QApplication
import webbrowser
from PyQt5.QtWidgets import QSizePolicy
from PyQt5.QtWidgets import QPushButton
f... |
from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
import pytest
from copy import copy
@pytest.fixture
def CellRange():
from ..cell_range import CellRange
return CellRange
class TestCellRange:
def test_ctor(self, CellRange):
cr = CellRange(min_col=1, min_row=1, max_col=5... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira, 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/li... |
# 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 ... |
#
# 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 us... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
<<<<<<< HEAD
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
=======
OpenAPI spec version: v1.5.3
Generated b... |
import _plotly_utils.basevalidators
class ShowticksuffixValidator(
_plotly_utils.basevalidators.EnumeratedValidator
):
def __init__(
self,
plotly_name='showticksuffix',
parent_name='heatmap.colorbar',
**kwargs
):
super(ShowticksuffixValidator, self).__init__(
... |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# Giorgio Patrini <giorgio.patrini@anu.edu.au>
# ... |
from copy import deepcopy
from django.test import TestCase
from mock import patch, mock
from corehq.apps.accounting.tests.utils import DomainSubscriptionMixin
from corehq.apps.commtrack.tests.util import make_loc
from corehq.apps.domain.models import Domain
from corehq.apps.user_importer.importer import (
create... |
# coding: utf-8
"""
Justap API
欢迎阅读 Justap Api 文档 Justap 是为移动端应用和PC端应用打造的下一代聚合支付SAAS服务平台,通过一个 SDK 即可快速的支持各种形式的应用,并且一次接口完成多个不同支付渠道的接入。平台除了支持服务商子商户模式,同时还对商家自有商户(即自己前往微信、支付宝等机构开户)提供了完整的支持。 感谢您的支持,我们将不断探索,为您提供更优质的服务!如需技术支持可前往商户中心提交工单,支持工程师会尽快与您取得联系! # 文档说明 采用 REST 风格设计。所有接口请求地址都是可预期的以及面向资源的。使用规范的 HTTP 响应代码来表示请... |
from django.test import TestCase
from django.contrib.auth.models import User
from users.models import Profile
class UserModelTests(TestCase):
def setUp(self):
# Create a test user
self.test_user = User.objects.create_user(
id=1,
first_name="Ron",
last_name="... |
#!/usr/bin/env python
from utils import utils
def main():
reach = 824501
# reach = 92510
# reach = 59414
# reach = 18
recipes = [3, 7]
worker_one = 0
worker_two = 1
idx = -1
look_at_steps = 6
look_at = 1
while True:
score_new_recipe = recipes[worker_one] + recipes... |
#! /usr/bin/env python3
import os
import re
import time
import json
import logging
import pickle
import threading
import requests
from argparse import ArgumentParser
from configparser import ConfigParser
from pathlib import Path
from tempfile import NamedTemporaryFile
from cs import read_config, CloudStack
import cat... |
import pandas as pd
import subprocess
from subprocess import Popen, PIPE, STDOUT
import sys
import os
from distutils.spawn import find_executable
import multiprocessing
from functools import partial
from osgeo import gdal
import rasterio
import bare.io
import bare.geospatial
def create_overview(img_file_name, scale=... |
a=input()
b =-1
while b:
n=input()
for i in range(1,100):
print(i)
|
import setuptools
setuptools.setup(
name = 'fancy',
packages = setuptools.find_packages(),
version = 'v3.0.0',
description = 'Framework for the Analysis of Cosmic raYs',
author = 'Francesca Capel',
author_email = 'capel.francesca@gmail.com',
url = 'https://github.com/cescalara/fancy',
... |
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.utils.data
import numpy as np
from opt import opt
from dataloader import VideoLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.