text stringlengths 1 927k |
|---|
# Generated by Django 3.2.5 on 2021-07-24 21:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('neighbourapp', '0003_bus... |
import argparse
import os
import cv2
import librosa
import numpy as np
import soundfile as sf
import torch
from tqdm import tqdm
from lib import dataset
from lib import nets
from lib import spec_utils
class VocalRemover(object):
def __init__(self, model, device, window_size):
self.model = model
... |
import pathlib
import typing as T
import pytest
from xarray_sentinel import reformat
pytest.importorskip("zarr")
DATA_FOLDER = pathlib.Path(__file__).parent / "data"
def test_to_group_zarr(tmpdir: T.Any) -> None:
product_path = (
DATA_FOLDER
/ "S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_... |
import sys,os,argparse,time
import numpy as np
import torch
import utils
tstart=time.time()
# Arguments
parser=argparse.ArgumentParser(description='xxx')
parser.add_argument('--seed',type=int,default=0,help='(default=%(default)d)')
parser.add_argument('--experiment',default='',type=str,required=True,choices=['mnist2... |
# Lint as: python3
# Copyright 2020 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 ... |
# -*- coding: utf-8 -*-
# author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
import numpy as np
import cv2
import sys
# import any special Python 2.7 packages
if sys.version_info.major == 2:
from urllib import urlopen
# import any special Python 3 packages
elif... |
#!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... |
from selectable.base import ModelLookup
from selectable.registry import registry
from .models import Taxonomy
class TaxonomyLookup(ModelLookup):
model = Taxonomy
search_fields = ('name__icontains', )
registry.register(TaxonomyLookup) |
# -*- coding: utf-8 -*-
#
# VPP test framework documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 13 08:45:03 2016.
#
# 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 ... |
# 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 ... |
import sys, os
sys.path.append(os.path.abspath(os.path.join('..', 'linked_list')))
from LinkedList import linked_list
from node import Node
class queue_linked_list():
def __init__(self):
self.head = None
self.tail = None
def enqueue(self, value):
tempNode = Node(value)
if (se... |
# Copyright 2021 Huawei Technologies Co., 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
#
# Unless required by applicable law or agreed to... |
# Replace Linux/m68k numeric constants with human readable names.
#@author b0bb
#@category Pwn
#@keybinding
#@menupath Analysis.Pwn.Constants.m68k
#@toolbar
from constants.Constants import Constants
import ghidra.app.util.opinion.ElfLoader as ElfLoader
def run():
if currentProgram.getExecutableFormat() != ElfLo... |
from rest_framework_csv.renderers import CSVStreamingRenderer
def list_file_headers():
return [
'asn_code',
'asn_status',
'total_weight',
'total_volume',
'supplier',
'creater',
'create_time',
'update_time'
]
def list_cn_data_header():
return ... |
# Copyright 2019 Xanadu Quantum Technologies 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 agre... |
# Django
from django.test import TestCase
from django.test.client import RequestFactory
# Django Local
from recommendation.views import CustomRecommendationCreateView
from user.models import HealthProfessional
class CreateRecomendationCustomViewTeste(TestCase):
def setUp(self):
self.factory = RequestFact... |
from .celeba_dataset import *
from .ilsvrc12_dataset import *
__all__ =[
"CelebaDataset",
"Ilsvrc12Dataset"
] |
import pandas
import utils
import config
var = config.Variable()
df = pandas.read_excel(var.config)
pwd = var.pwd
def run():
# Get data for gatsby-config.js
with open(var.gatsby_config_template, "r") as f:
gatsby_config = f.read()
# Get data for src/data/content.js
with open(var.content_te... |
from collections.abc import Sequence
import numpy as np
import openmdao.api as om
from .common import BoundaryConstraintComp, ControlGroup, PolynomialControlGroup, PathConstraintComp
from ..utils.constants import INF_BOUND
from ..utils.misc import get_rate_units, _unspecified
from ..utils.introspection import get_ta... |
# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
#!/usr/bin/env python
# Copyright (c) 2018 Intel Labs.
# authors: German Ros (german.ros@intel.com)
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
""" This module contains a local planner to perform low-level waypoint following based on PID contr... |
import os
import subprocess
from setuptools import setup
from setuptools import find_packages
def version():
if not os.path.isdir(".git"):
print "This does not appear to be a Git repository."
return
try:
p = subprocess.Popen(["git", "describe",
"--tags", "... |
from __future__ import unicode_literals
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_auth_ldap.backend import populate_user
from .models import UserProfile
try:
USER_ATTR_IMAGE_URL = settings.AUTH_LDAP_USER_ATTR_IMAGE_URL
except At... |
"""Support for HomematicIP Cloud devices."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as... |
"""hug/input_formats.py
Defines the built-in Hug input_formatting handlers
Copyright (C) 2015 Timothy Edmund Crosley
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, includi... |
#!/usr/bin/env python3
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# Read version i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
猜数字游戏
"""
import random
answer = random.randint(1, 100)
counter = 0
while True:
counter += 1
number = int(input('请输入你猜测的数字:'))
if number > answer:
print('大一点')
elif number < answer:
print('小一点')
else:
print('猜测的数字正确,正确数字为:%d'... |
# coding=utf-8
# Copyright 2020 TF.Text 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 ag... |
# Generated by Django 4.0.3 on 2022-03-24 08:24
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('newsapp', '0004_profile_bio'),
]
operations = [
migrations.AddField(
model_name='business',
name='i... |
import argparse
import asyncio
import os
import psutil
import random
import time
from collections import deque
from typing import Optional, List, Union, Dict, Tuple
from quarkchain.cluster.guardian import Guardian
from quarkchain.cluster.miner import Miner, MiningWork, validate_seal
from quarkchain.cluster.p2p_comman... |
import base64
import json
import pytest
from mlflow.entities import RunInfo, RunData, Run, LifecycleStage, RunStatus, Metric, Param, RunTag
from mlflow.exceptions import MlflowException
from mlflow.utils.search_utils import SearchUtils
@pytest.mark.parametrize("filter_string, parsed_filter", [
("metric.acc >= 0.... |
def cat_dog(str):
count_cat = 0
count_dog = 0
for i in range(len(str)-2):
if str[i:i+3] == "cat":
count_cat += 1
for i in range(len(str)-2):
if str[i:i+3] == "dog":
count_dog += 1
if count_cat == count_dog:
return True
return False |
# -*- coding: utf-8 -*-
"""Authentication of Mac OS X users
Currently uses shell commands to do lookup, should probably be rewritten to
use PAM and/or PyObjC.
"""
import re
import logging
import pexpect
from repoze.what.adapters import BaseSourceAdapter, SourceError
__all__ = ['MacOSXAuthenticator', 'MacOSXMetadata... |
""" Test cases for GroupBy.plot """
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, Series
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase
pytestmark = pytest.mark.slow
... |
# Generated by Django 2.1.5 on 2019-01-24 22:47
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Treasure',
fields=[
('id', models.AutoField... |
import json
import csv
import pickle
class ArticleFromJson: # pragma: no cover
"""Data model for one article"""
def __init__(
self,
publisher: str,
title: str,
description: str,
url: str,
date_published,
content: str,
author: str = 'Not Found',... |
"""Implementation of different policy gradient methods"""
import argparse
import numpy as np
import plot as plt
import random
from collections import namedtuple
from env import Action, Easy21, State
from tqdm import tqdm
from typing import Callable, List
# For reproducibility
random.seed(0)
np.random.seed(0)
Traject... |
# Write your solution for 1.1 here!
x=0
for i in range(101):
x+=i
print(x) |
#!/usr/bin/env python3
import getpass
import inspect
import os
import sys
import clitool
import mc_bin_client
import memcacheConstants
from functools import wraps
def cmd_decorator(f):
"""Decorate a function with code to authenticate based on
the following additional arguments passed by keyword:
bucke... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: stringprep.py
"""Library that exposes various tables found in the StringPrep RFC 3454.
There are two kinds of tables: sets, for which a member test ... |
from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='xargs',
version='0.4.3',
author='Maco',
description='Binding form data validation framework.',
long_description=long_description,
long_description_content_type='text/markdown',
autho... |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... |
#!/usr/bin/env python
"""Provide error classes."""
# Imports
from db_tools import __author__, __email__
class DBToolsError(Exception):
"""Base error class."""
class NotImplementedYet(NotImplementedError, DBToolsError):
"""Raise when a section of code that has been left for another time is asked to execute.... |
#coding=utf-8
# datatype.py
integer = 123
print integer
_float = 12.34
print _float
string = 'hello \'python\' '
print string
string1 = r'hello \\\\'
print string1
boolean = True
print boolean
print
# 逻辑运算
print True and True
print True and False
print True or False
print False or False
print not True
print
pri... |
import numpy as np
import argparse
import matplotlib.pyplot as plt
import cv2
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.layers import MaxPooling2... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2020 Stefano Gottardo (original implementation module)
Miscellaneous utility functions for generating context menu items
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
f... |
"""
Copyright (c) 2018 Intel Corporation
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 wri... |
"""Implementation of the KNX date data point."""
from __future__ import annotations
from typing import NamedTuple
from xknx.exceptions import ConversionError
from .dpt import DPTBase
class XYYColor(NamedTuple):
"""
Representation of XY color with brightness.
`color`: tuple(x-axis, y-axis) each 0..1; N... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["Model", "TrainState", "LossHistory"]
import pickle
from collections import OrderedDict
import numpy as np
from . import config
from . import display
from . import gradients as grad
from . import... |
import requests
import platform
import os
sys = platform.system()
dataset_cmd = "python dataset/prepare_data.py -fold=1 -num_folds=1024 -base_fn=dataset/tf/data_1024 -input_fn=dataset/data -max_seq_length=1024 > tf.log"
train_cmd = "python train/train1.py --config_file=configs/mega.json --input_file=dataset/tf/data_10... |
#!/usr/local/bin/python
# coding: utf-8
# Logchart V1.0.0 for python3
# Log Chart
# Copyright (C) 2017-2017 Kinghow - Kinghow@hotmail.com
# Git repository available at https://github.com/kinghows/Logchart
import getopt
import sys
import configparser
import os
from pyecharts import options as opts
from pyecharts.globa... |
import pytest
import io
from unittest.mock import patch
import os
import tempfile
from microrepl import connect_miniterm
@pytest.yield_fixture
def fake_stderr():
fake_stderr = io.StringIO()
with patch('sys.stderr', fake_stderr):
yield fake_stderr
@pytest.yield_fixture
def fake_sys_exit():
with pa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
##############################################################################
from PyQt4.QtGui import (
QWidget,
QListWidget,
QVBoxLayout,
)
##############################################################################
class QPacketList(QWidget):
def... |
"""Test suite for our zeromq-based messaging specification.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as par... |
from math import pow, sqrt
print('\033[1m>>> EQUAÇÃO DE 2º GRAU <<<\033[m')
a = int(input('> VALOR DE A: '))
if a != 0:
b = int(input('> VALOR DE B: '))
c = int(input('> VALOR DE C: '))
print('-'*30)
print('\033[1mRESULTADO...\033[m')
delta = pow(b, 2) - (4 * a * c)
if delta > 0:
x1 = (... |
"""
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
import sys
import threading
import queue
import random
import collections
import torch
import torch.multiprocessing as multiprocessing
# from torch._C import _set_worker_signal_handlers, _update_worker_pids, \
# _remove_worker_pids, _error_if_any_worker_fails
# from torch.utils.data.dataloader import DataLoader
#... |
# Copyright 2020 Canonical Ltd.
# See LICENSE file for licensing details.
import json
import os
import textwrap
import unittest
from unittest.mock import patch
import yaml
from charms.loki_k8s.v0.loki_push_api import LokiPushApiConsumer
from fs.tempfs import TempFS
from helpers import TempFolderSandbox
from ops.charm... |
import os
import unittest
from nose.plugins import PluginTester
from nose.plugins.skip import SkipTest
from nose.plugins.multiprocess import MultiProcess
support = os.path.join(os.path.dirname(__file__), 'support')
def setup():
try:
import multiprocessing
if 'active' in MultiProcess.status:
... |
# Copyright (c) [2012]-[2021] Shanghai Yitu Technology Co., Ltd.
#
# This source code is licensed under the Clear BSD License
# LICENSE file in the root directory of this file
# All rights reserved.
"""
Borrow from timm(https://github.com/rwightman/pytorch-image-models)
"""
import torch
import torch.nn as nn
import num... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... |
# orm/instrumentation.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines SQLAlchemy's system of class instrumentation.
This module is usua... |
class Graph:
"""
Data structure to store graphs (based on adjacency lists)
"""
def __init__(self):
self.num_vertices = 0
self.num_edges = 0
self.adjacency = {}
def add_vertex(self, vertex):
"""
Adds a vertex to the graph
"""
if vertex not i... |
from django.conf import settings
from guardian.shortcuts import get_objects_for_user
from signbank.tools import get_selected_datasets_for_user, get_datasets_with_public_glosses
from signbank.dictionary.models import Dataset
def url(request):
if not request.user.is_authenticated():
# for anonymous users, s... |
# test_349.py
import unittest
from intersection_349 import intersect
class intersectTest(unittest.TestCase):
def test_intersect_1(self):
self.assertEqual(intersect([1,2,2,1], [2,2]), [2])
# @unittest.skip("demonstrating skipping")
def test_intersect_2(self):
res = intersect([4,4,9,5],... |
# 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 this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
try:
from marionette.marionette import Actions
except:
from marionette_driver.marionette import Actions
from ga... |
"""
time_freq_scoping_factory
=========================
Contains functions to simplify creating time frequency scopings.
"""
from ansys.dpf.core import Scoping
from ansys.dpf.core import errors as dpf_errors
from ansys.dpf.core.common import locations
from ansys.dpf.core.model import Model
def scoping_by_load_step(l... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# !/usr/bin/env python3
# Author: C.K
# Email: theck17@163.com
# DateTime:2021-04-27 21:41:14
# Description:
import os
import sys
class Solution(object):
def subsets(self, nums):
ret = []
self.dfs(nums, [], ret)
return ret
def dfs(self, nums, path, ret):
ret.append(path)
... |
# Copyright 2017 Uber Technologies, 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 required by applica... |
import frappe
def execute():
path = frappe.get_app_path("niyopolymers", "patches", "imports", "price_list.csv")
frappe.core.doctype.data_import.data_import.import_file("Price List", path, "Insert", console=True) |
# ------------------------------------------------------------------------------
# CodeHawk Java Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2021 Andrew McG... |
from tir import Webapp
import unittest
class JURA108(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.SetTIRConfig(config_name="user", value="daniel.frodrigues")
inst.oHelper.SetTIRConfig(config_name="password", value="1")
inst.oHelper.Setup('SIGAJURI','','T1','D M... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
import yapgvb as graph
from yapgvb import RenderingContext, CLIRenderError
import textwrap
import math
import colorsys
import pickle
from moerderklassen import *
from utils import colorgen
import utils
class MyRenderingContext(RenderingContext):
... |
from bs4 import BeautifulSoup as soup
from selenium import webdriver
class Scrapper:
def getArticles(self, cryptoName):
url = 'https://coinmarketcap.com/currencies/' + cryptoName + '/news/'
driver = webdriver.Firefox()
driver.get(url)
page = driver.page_source
page_soup = ... |
from django import forms
class UserSignupForm(forms.Form):
first_name = forms.CharField(max_length=30, label='First Name')
last_name = forms.CharField(max_length=30, label='Last Name')
def signup(self, request, user):
user.first_name = self.cleaned_data['first_name']
user.last_name = self... |
import operator
from datetime import date, datetime
from typing import Any, Literal, Optional
from dateutil import tz
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from google.protobuf import message
from proto.google.fhir.proto.r4.core import datatypes_pb2
ComparatorType = Litera... |
'''
Date of modification : 2021.01.22
Code Summary : realsense camera python code 최종 ë²„ì „
Input option 0 : D435i (default)
1 : L515
2 : D445i
'''
#####################################################
## ... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.externals import joblib
from glob import glob
from astropy.io import fits
from astropy.table import Table, join
from copy import deepcopy
import os
import imp
imp.load_source('helper_functions', '../../Carbon-Spectra/helper_functions.py')
from helper_func... |
# 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,... |
#!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... |
"""This example uses the light sensor on your CPX, located next to the picture of the eye. Try
shining a flashlight on your CPX, or covering the light sensor with your finger to see the values
increase and decrease."""
import time
from adafruit_circuitplayground.express import cpx
while True:
print("Light:", cpx.l... |
# Generated by Django 2.2.4 on 2019-08-21 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0011_postgresql_auth_group_id_sequence")]
operations = [
migrations.AddField(
model_name="user",
name="auth_type",
... |
import os
import json
import time
import asyncio
import collections
from aiohttp import web, WSMsgType
from typing import List, Dict, Any, Callable
from .utils import resource_conditions, TTLQueue
from services.utils import logging
from pyee import AsyncIOEventEmitter
from ..data.refiner import TaskRefiner, ArtifactR... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import flask
import redis
import os
import json
import bs4
import bridge
import codecs
import datetime
from werkzeug.serving import WSGIRequestHandler
base_path = os.getcwd() + '/'
print "base_path:",base_path
app = flask.Flask(__name__)
ap... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
import json, uuid
from datetime import datetime, date
from decimal import Decimal
from werkzeug.http import http_date
from django.db.models import Model
from django.db.models.base import ModelBase
from django.db.models.query import QuerySet, ValuesQuerySet
from django.db.models.fields.related import ManyToManyField
fro... |
import configparser
import unittest
import adform
class AuthorizeTestCase(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config.read('config.ini')
self.client_id = config['DEFAULT']['CLIENT_ID']
self.client_secret = config['DEFAULT']['CLIENT_SECRET']
... |
import numpy as np
a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])
print(len(a)) |
"""
This module contains the code for the interactive conversion
of units at the command line.
@author: tgwoodcock
"""
from . import convmag_functions as cm
# interactive conversion
def main():
CONVERTING = True
print("*****Conversion between magnetic units.*****")
print("\nAt the 'Input:' promt, enter:... |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# filelife Trace the lifespan of short-lived files.
# For Linux, uses BCC, eBPF. Embedded C.
#
# This traces the creation and deletion of files, providing information
# on who deleted the file, the file age, and the file name. The intent is... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-01-07 08:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0367_globalsettings'),
]
operations = [
migrations.Al... |
#!/usr/bin/env python
"""
This application presents a 'console' prompt to the user asking for commands.
For 'read' commands it will create ReadPropertyRequest PDUs, then lines up the
coorresponding ReadPropertyACK and prints the value. For 'write' commands it
will create WritePropertyRequst PDUs and prints out a sim... |
from . import constants, orbit_lib, rich_print |
import itertools
import logging
import time
from typing import List, Callable
from pathlib import Path
from triple_agent.constants.paths import DEBUG_CAPTURES
from triple_agent.classes.capture_debug_pictures import capture_debug_picture
from triple_agent.classes.timeline import TimelineCoherency
from triple_agent.pars... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-08-24 14:34
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("testresults", "0005_testclass_test_type")]
operations = [
... |
'''
Created by auto_sdk on 2019.07.31
'''
from dingtalk.api.base import RestApi
class OapiAttendanceShiftSearchRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.op_user_id = None
self.shift_name = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingt... |
from __future__ import absolute_import, division, print_function
import os
import argparse
import PIL.Image as pil
import rawpy
import torch
from torchvision import transforms
import numpy as np
import deps.monodepth2.networks as networks
from deps.monodepth2.utils import download_model_if_doesnt_exist
from seathru ... |
"""Test fileio modeule."""
# Copyright 2019 CSIRO (Data61)
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.