text stringlengths 1 927k |
|---|
# Generated by Django 3.0.9 on 2020-08-07 21:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
... |
# -*- coding: utf-8 -*-
"""
fedex.services.tracking
~~~~~~~~~~~~~~~~~~~~~~~
FedEx tracking web services.
:copyright: 2014 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""
from .commons import BaseService
class TrackingService(BaseService):
"""Tracking service.
:para... |
import os
import sys
import pefile
import esm
'''
tuning this parameter to get a better curracy
'''
COMMON = set([
'rand', 'malloc', 'realloc', 'memset', 'exit', 'free', 'calloc', 'memcpy', 'memmove',
'GetVersion', 'printf', 'strchr', 'strncmp', 'fread',
'fclose', 'fprintf', 'sprintf', '_snprintf','fopen', 'strncpy... |
import logging
import time
import os
import sys
def create_logger(final_output_path, description=None):
if description is None:
log_file = '{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'))
else:
log_file = '{}_{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'), description)
head = '%(asctime)-1... |
# based on:
#
# Reversing CRC - Theory and Practice.
# HU Berlin Public Report
# SAR-PR-2006-05
# May 2006
# Authors:
# Martin Stigge, Henryk Plotz, Wolf Muller, Jens-Peter Redlich
FINALXOR = 0xffffffffL
INITXOR = 0xf... |
# Students are asked to stand in non-decreasing
# order of heights for an annual photo.
# Return the minimum number of students that must
# move in order for all students to be standing in
# non-decreasing order of height.
# Notice that when a group of students is selected
# they can reorder in any possible way betwe... |
#!/usr/bin/env python
import argparse
from lstmcpipe.io.data_management import (
move_dir_content,
check_and_make_dir_without_verification,
)
parser = argparse.ArgumentParser(
description="Script to move a directory and its content after creating the destination"
" directory."
)
parser.add_argument(
... |
# --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Haozhi Qi
# --------------------------------------------------------
import cPickle
import mxnet as mx
from utils.... |
import logging
import flask
from controller.goods_controller import *
from controller.order_controller import *
from common.exception_advice import *
app = flask.Flask(__name__)
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message... |
# -*- coding: utf-8 -*-
from model.contact import Contact
import pytest
def test_add_contact(app, db, json_contacts):
contact = json_contacts
with pytest.allure.step('Given a Contact list'):
old_contacts = db.get_contact_list()
with pytest.allure.step('When I add a contact %s to the list' % conta... |
"""
conftest.py pytest_fixtures can be accessed by multiple test files
test function has fixture func name as param, then fixture func called and result
passed to test func
added localhost.localdomain to /etc/hosts
"""
import pytest
from cnf.main import setup_app
import pymongo
config_name = 'testing'
the_app = setup... |
# Copyright 2018 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 agreed to in writing, ... |
from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... |
# Generated by Django 3.1.1 on 2020-10-04 18:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '0009_auto_20200918_0020'),
('shop', '0003_auto_20201004_2109'),
]
operations = [
migratio... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 MIT Probabilistic Computing Project.
# Released under Apache 2.0; refer to LICENSE.txt.
from collections import Counter
import numpy as np
from cgpm.utils.general import get_prng
from cgpm2.crp import CRP
from cgpm2.normal import Normal
from cgpm2.flexible_rowmix impor... |
# Python test set -- part 5, built-in exceptions
import os
import sys
import unittest
import pickle, cPickle
import warnings
from test.test_support import TESTFN, unlink, run_unittest, captured_output
from test.test_pep352 import ignore_message_warning
# XXX This is not really enough, each *operation* should be test... |
'''
XbrlSemanticSqlDB.py implements an SQL database interface for Arelle, based
on a concrete realization of the Abstract Model PWD 2.0 layer. This is a semantic
representation of XBRL information.
This module may save directly to a Postgres, MySQL, SQLite, MSSQL, or Oracle server.
This module provides the executi... |
"""Data structure for CAtlas."""
import argparse
import cProfile
import os
import sys
import tempfile
import gzip
import copy
from .rdomset import rdomset, domination_graph
from .graph_io import read_from_gxt, write_to_gxt
from .graph import Graph
from spacegraphcats.utils.logging import log_command
from io import Tex... |
from abc import ABCMeta, abstractmethod
class Component(object):
"""
Interface definition for a frontier component
The :class:`Component <frontera.core.components.Component>` object is the base class for frontier
:class:`Middleware <frontera.core.components.Middleware>` and
:class:`Backend <fronte... |
import numpy as np
from tqdm import tqdm
class Hypergraph(object):
def __init__(self,graph_type='0',nums_type=None):
self._nodes = {} # node set
self._edges = {} # edge set (hash index)
self.graph_type = graph_type # graph type, homogeneous:0, heterogeneous:1
self.nums_type = nu... |
import configparser
from pathlib import Path
import unittest
import uuid
from TM1py import Element, Hierarchy, Dimension
from TM1py.Objects import Cube
from TM1py.Objects import Rules
from TM1py.Services import TM1Service
config = configparser.ConfigParser()
config.read(Path(__file__).parent.joinpath('config.ini'))
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from timeit import default_timer
class TimeThis:
def __init__(self, title="TimeThis"):
self.title = title
self.start_time = None
def __enter__(self):
self.start_time = default_timer()
return self
de... |
# ext/associationproxy.py
# Copyright (C) 2005-2019 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
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... |
"""
This module contains all views related to multi-factor authentication
"""
import logging
import time
from django.contrib.auth.decorators import login_required
from django.contrib.auth.hashers import check_password
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils.decorato... |
# 영문자 1개 입력받아 10진수로 변환하기
print(ord(input())) |
import json
import os
import re
from collections import OrderedDict
import pytest
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import infer_and_cast, Params, parse_overrides, unflatten, with_fallback
from allennlp.common.testing import AllenNlpTestCase
class TestParams(AllenNlpT... |
# 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 t... |
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
"""Distribution class."""
from PoPs import IDs as IDsPoPsModule
from fudge import abstractClasses as abstractClassesModule
... |
# Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... |
import os
import time
import math
import numpy as np
import torch
# torch.multiprocessing.set_start_method('spawn')
torch.multiprocessing.set_start_method('forkserver', force=True)
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
from argparse import Namespace
from typing import List... |
import time
import numpy as np
from compute_overlap import compute_overlap
def compute_overlap_np(a: np.array, b: np.array) -> np.array:
"""
Args
a: (N, 4) ndarray of float [xmin, ymin, xmax, ymax]
b: (K, 4) ndarray of float [xmin, ymin, xmax, ymax]
Returns
overlaps: (N, K) ndarra... |
# -*- coding: utf-8 -*-
"""
Implement the policy value network using numpy, so that we can play with the
trained AI model without installing any DL framwork
@author: Junxiao Song
"""
from __future__ import print_function
import numpy as np
# some utility functions
def softmax(x):
probs = np.exp(x - np.max(x))
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from math import sqrt
def is_prime(a):
a = abs(int(a))
for i in range( 2, int(sqrt(a)) + 1 ):
if a % i == 0:
return False
return True
def num_primes(a,b):
i = 0
while True:
if not is_prime( i*(i + a) + b ):
bre... |
from datetime import datetime
import boto3
from feast import utils
from feast.infra.online_stores.helpers import compute_entity_id
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
def _create_n_customer_test_samples(n=1... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
from django.contrib import admin
from django import forms
from .models import *
from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
import sdap.tools.forms as tool_forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from django.apps impor... |
# Copyright 2020 HQS Quantum Simulations GmbH
# Reza Ghafarian Shirazi, Thilo Mast.
# reza.shirazi@quantumsimulations.de
#
# 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.apa... |
import cv2
import numpy as np
from math import sqrt
from scipy.spatial import distance
from yolo_app.etc.config import config
def crop_image(save_path, img, xywh):
x = xywh[0]
y = xywh[1]
w = xywh[2]
h = xywh[3]
crop_img = img[y:y + h, x:x + w]
cv2.imwrite(save_path, crop_img)
def np_xyxy2xy... |
from generate import *
from datetime import datetime
def main():
''' e.g.
python ./generate.py --length=512
--nsamples=1
--prefix=[MASK]哈利站在窗边
--tokenizer_path cache/vocab_small.txt
--topk 40 --model_path model/model_epoch29
--save_samples --save_samples_path result/20210915_29_1135
... |
import hashlib
from typing import Iterable, Tuple
from loguru import logger
class Col:
named: "NamedCols"
def __init__(self, r: int, g: int, b: int, clip: bool = False, fix_numeric_type: bool = True):
self._clip = clip
self._fix_numeric_type = fix_numeric_type
self.r = r # Note this... |
#!/usr/bin/env python
"""
Do windowed detection by classifying a number of images/crops at once,
optionally using the selective search window proposal method.
This implementation follows ideas in
Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik.
Rich feature hierarchies for accurate object detection... |
import threading
# Thread running server processing loop
class ServerThread(threading.Thread):
"""
A helper class to run server in a thread.
The following snippet runs the server for 4 seconds and quit::
server = SimpleServer()
server_thread = ServerThread(server)
server_thread.st... |
"""
This file offers the methods to automatically retrieve the graph Lachnobacterium bovis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-... |
from ._base import Base, _rule
from .fullname_json import FullnameJson
from .values.text_val import TextVal
from .values.null import NULL
from .values.holder import Holder
from .values.true import TRUE
from .values.false import FALSE
class Field(FullnameJson, TextVal, NULL, Holder, TRUE, FALSE):
reserved = {**Bas... |
from twisted.application import internet, service
from twisted.web import server, resource, client
from twisted.internet import defer, reactor, threads, utils, task
from zope import interface
import yaml
import time
import cgi
import random
from distributex.backends import in_memory_backend, memcached_backend
class ... |
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
# from itsdangerous import Serializer
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData
from mall import settings
from utils.models import BaseModel
class User(AbstractUser):
... |
######## Webcam Object Detection Using Tensorflow-trained Classifier #########
#
# Author: Evan Juras
# Date: 10/2/19
# Description:
# This program uses a TensorFlow Lite model to perform object detection on a
# video. It draws boxes and scores around the objects of interest in each frame
# from the video.
#
# This co... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 14 15:47:45 2021
@author: xuery
"""
import cv2
import time
import numpy as np
import os
import copy
import pickle
import random
import math
import matplotlib.pyplot as plt
from scipy import spatial
from skimage import morphology
from sklearn.mixtur... |
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import mock
import os.path
import pytest
import sys
from pypi_practices import five
from pypi_practices.errors import FileValidationError
from pypi_practices.make_entry import make_entry
from testing.util import REMatcher
@pyte... |
import asyncio
import logging
import multiprocessing
import re
import sys
import threading
import pytest
import loguru
from loguru import logger
async def async_writer(msg):
await asyncio.sleep(0.01)
print(msg, end="")
class AsyncWriter:
async def __call__(self, msg):
await asyncio.sleep(0.01)... |
'''Load image/labels/boxes from an annotation file.
The list file is like:
img.jpg width height xmin ymin xmax ymax label xmin ymin xmax ymax label ...
'''
import random
import numpy as np
import json
import os
# from PIL import Image, ImageDraw, ImageFile
# ImageFile.LOAD_TRUNCATED_IMAGES = True
import cv2
impo... |
"""itch50_message_parser.py: Message parser class for ITCH 5.0"""
__author__ = "Vincent Grégoire"
__email__ = "vincent.gregoire@gmail.com"
from copy import deepcopy
import meatpy.itch50.itch50_market_message
from meatpy.message_parser import MessageParser
class ITCH50MessageParser(MessageParser):
"""A market me... |
#!/usr/bin/env python3
#Author: Erik Bergstrom
#Contact: ebergstr@eng.ucsd.edu
from __future__ import print_function
import os
import sys
import re
import subprocess
import argparse
import time
from scipy import spatial
import pandas as pd
import shutil
import logging
import hashlib
from SigProfilerMatrixGenerator.s... |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
# -*- coding: utf-8 -*-
#
# 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
... |
import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
x = np.linspace(-5, 5, 300)
sin_x = np.sin(x)
cos_x = np.cos(x)
flg, aexs = plt.subplots(2, 1)
aexs[0].set_ylim([-1.5,1.5])
aexs[1].set_ylim([-1.5,1.5])
aexs[0].plot(x,sin_x,color="r")
aexs[1].plot(x,... |
# exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C3ub')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Mo... |
from __future__ import division
import numpy as np
from scipy.stats import norm
import random
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.optimize import curve_fit
from scipy import stats
import networkx as nx
import pandas as pd
from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
cla... |
"""
Default Django settings. Override these with settings in the module pointed to
by the DJANGO_SETTINGS_MODULE environment variable.
"""
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from setuptools import setup, find_packages
# **Python version check**
if sys.version_info < (3, 5):
error = """
uwsgi-sloth only supports Python 3.5 and above.
If you are using Python 2.7, please install "uwsgi-sloth<3.0.0" instead.
"""
... |
# -*- coding: utf-8 -*-
from weatherScraper.items import TempData
from weatherScraper.items import InputData
import scrapy
class WeatherbotSpider(scrapy.Spider):
name = 'weatherbot'
allowed_domains = ['www.wunderground.com']
start_urls = ['http://www.wunderground.com/history/']
def __init__(self, cod... |
# Copyright 2019 The flink-ai-extended 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 ... |
#Test
from flair.data import Sentence
from flair.models import SequenceTagger
tagger: SequenceTagger = SequenceTagger.load("ner")
sentence: Sentence = Sentence("George Washington went to Washington .")
tagger.predict(sentence)
print("Analysing the sentence %s" % sentence)
print("\nThe following NER tags are found: \... |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... |
from distutils.core import setup
setup(
name='sensu_plugin',
version='0.7.0',
author='Sensu-Plugins and Contributors',
author_email='sensu-users@googlegroups.com',
packages=['sensu_plugin', 'sensu_plugin.tests'],
scripts=[],
url='https://github.com/sensu-plugins/sensu-plugin-python',
li... |
import aesara
import aesara.tensor as at
import numpy as np
import pytest
import scipy.stats.distributions as sp
from aesara.graph.basic import Apply, ancestors, equal_computations
from aesara.graph.op import Op
from aesara.tensor.subtensor import (
AdvancedIncSubtensor,
AdvancedIncSubtensor1,
AdvancedSubte... |
import random
from .base import Fixture
# From various online generators.
project_names = [
'Waiting for Johnson',
'Helping Delilah',
'Finding Gump',
'Double Danger',
'Master of Surrender',
'Compulsive Winter',
'Inner Space',
]
# All of the WesternX sequence codes from previous films.
se... |
opt = {'task': 'twitter',
'download_path': '/mnt/home/liuhaoc1/ParlAI/downloads',
'datatype': 'train',
'image_mode': 'raw',
'numthreads': 1,
'hide_labels': False,
'batchsize': 32,
'batch_sort': True,
'context_length': -1,
'include_labels': True,
'dat... |
"""
Collection of tests for unified general functions
"""
# global
import copy
import pytest
# local
import ivy
import ivy.functional.backends.numpy
# Helpers #
# --------#
def _snai(n, idx, v):
if len(idx) == 1:
n[idx[0]] = v
else:
_snai(n[idx[0]], idx[1:], v)
def _mnai(n, idx, fn):
... |
import contextvars
import gettext
import os.path
from glob import glob
from app.t_string import TString
BASE_DIR = ""
LOCALE_DEFAULT = "en_US"
LOCALE_DIR = "locale"
locales = frozenset(
map(
os.path.basename,
filter(os.path.isdir, glob(os.path.join(BASE_DIR, LOCALE_DIR, "*"))),
)
)
gettext_tr... |
# import nltk
# import gensim
# import pandas
import string
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk import WordNetLemmatizer
from nltk import pos_tag
from nltk.stem import PorterStemmer
from gensim.models.doc2vec import TaggedDocument
from gensim.corpora import Dictionary
from gensim.... |
################################################################################
# #
# Copyright (C) 2011-2014, Armory Technologies, Inc. #
# Distributed under the GNU Affero General Public License (AGPL v3) ... |
class Solution:
# @param {integer} A
# @param {integer} B
# @param {integer} C
# @param {integer} D
# @param {integer} E
# @param {integer} F
# @param {integer} G
# @param {integer} H
# @return {integer}
def computeArea(self, A, B, C, D, E, F, G, H):
# calculate the separ... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... |
from contextlib import suppress
from datetime import timedelta
from dateutil.parser import parse
from django.db import transaction
from django_scopes import scope
from pretalx.person.models import SpeakerProfile, User
from pretalx.schedule.models import Room, TalkSlot
from pretalx.submission.models import (
Submi... |
# importing required libraries
import matplotlib.pyplot as plt
import matplotlib.image as img
# reading the image
testImage = img.imread('g4g.png')
# displaying the image
plt.imshow(testImage)
# displaying the image as an array
print(testImage)
###############################################
# In the output image,... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="eduponics-mqtt-STEMinds", # Replace with your own username
version="0.0.1",
author="Roni Gorodetsky",
author_email="contact@steminds.com",
description="Python MQTT package for STEMinds Edu... |
import ev3dev.ev3 as ev3
import rosebot as robot
import time
def increasing_tone(initial_tone, tone_rate_increase, speed, robot):
""":type robot: rosebot.RoseBot"""
robot.drive_system.go(speed, speed)
starting_distance = robot.sensor_system.ir_proximity_sensor.get_distance_in_inches()
while True:
... |
import sys
import hashlib
import pytest
import numpy as np
from numpy.linalg import LinAlgError
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_allclose,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
from numpy.random import G... |
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
# Create your models here.
class Snack(models.Model):
title = models.CharField(max_length=64)
purchaser = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
description = models.TextField()
... |
import gym
from gym.spaces import Box, Dict, Discrete
import numpy as np
import random
class ParametricActionsCartPole(gym.Env):
"""Parametric action version of CartPole.
In this env there are only ever two valid actions, but we pretend there are
actually up to `max_avail_actions` actions that can be tak... |
# coding:utf-8
class RestartRequestedMessage(object):
def __init__(self, cg):
self.cg = cg
class RestartCompleteMessage(object):
def __init__(self, cg):
self.cg = cg |
import _plotly_utils.basevalidators
class ThetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='thetasrc', parent_name='scatterpolar', **kwargs
):
super(ThetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... |
"""
This module is for managing OMERO imports, making use of the OMERO CLI,
which can be called from a Python script. Note that this code requires
a properly structured import.json file, which is produced during data
intake (using the intake.py module).
"""
import logging
from ezomero import post_dataset, post_projec... |
class ContentFilteringCategories(object):
def __init__(self, session):
super(ContentFilteringCategories, self).__init__()
self._session = session
def getNetworkContentFilteringCategories(self, networkId: str):
"""
**List all available content filtering categories for an MX n... |
from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s" % (self.id, self.name)
def __eq__(self, other):
... |
import cv2
import numpy as np
from matplotlib import pyplot as plt
cap = cv2.VideoCapture(1) # number 0 for one camera
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc,24.0,(640,480)) #params 3 = fram rate speed fram for save
# GRAY SCALE FOR ALL PIC
while(True): #video is pics
... |
# -*- coding: utf-8 -*-
#读取mnist数据集字符图片
import torch
import torchvision
from PIL import Image
import cv2
import numpy as np
import os
import gzip
import matplotlib
import matplotlib.pyplot as pltsfas
# 定义加载数据的函数,data_folder为保存gz数据的文件夹,该文件夹下有4个文件
# 'train-labels-idx1-ubyte.gz', 'train-images-idx3-ubyte.gz',
# 't10k-labe... |
"""
使用变量保存数据并进行操作
Version: 0.1
Author: BDFD
Date: 2018-02-27
"""
a = 321
b = 123
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
print(a ** b) |
#!/usr/bin/env python
import logging
import os
from importlib import util
from os import path
import setuptools
from setuptools import setup
# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_... |
from django.core.mail import send_mail
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import lo... |
# -*- coding=utf-8 -*-
r"""
"""
def showinfo(title: str, message: str):
pass
def showwarning(title: str, message: str):
pass
def showerror(title: str, message: str):
pass
def askquestion(title: str, message: str):
pass
def askokcancel(title: str, message: str):
pass
def askyesno(title: ... |
from django.db import models
class Location(models.Model):
address = models.CharField(max_length=30)
addresstype = models.CharField(max_length=20)
city = models.CharField(max_length=30)
state = models.CharField(max_length=30)
latitude = models.FloatField()
longitude = models.FloatField() |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); |
# pvtol-nested.py - inner/outer design for vectored thrust aircraft
# RMM, 5 Sep 09
#
# This file works through a fairly complicated control design and
# analysis, corresponding to the planar vertical takeoff and landing
# (PVTOL) aircraft in Astrom and Murray, Chapter 11. It is intended
# to demonstrate the basic fun... |
"""Data utilities."""
#import torch
import operator
#import json
def read_vocab_file(vocab_path, bos_eos=False, no_pad=False, no_unk=False, separator=':'):
'''file format: "word : idx" '''
word2id, id2word = {}, {}
if not no_pad:
word2id['<pad>'] = len(word2id)
id2word[len(id2word)] = '<pad... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... |
import getopt
import getpass
import sys
import time
from tack.structures.TackKeyFile import TackKeyFile
from tack.util.Time import Time
from tack.version import __version__
from tack.InvalidPasswordException import InvalidPasswordException
class Command:
def __init__(self, argv, options, flags):
try:
... |
import sys, time
from core import utils
from pprint import pprint
from modules import initials
from modules import subdomain
from modules import recon
from modules import assetfinding
from modules import takeover
from modules import screenshot
from modules import portscan
from modules import gitscan
from modules impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.