text stringlengths 2 999k |
|---|
__version__ = "develop"
|
# Copyright 2017 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... |
import django
from django.conf import settings
settings.configure(INSTALLED_APPS=['django_redis', 'django.contrib.contenttypes', 'django.contrib.auth'])
django.setup()
import django_redis
import django_redis.client
import django_redis.serializers
import django_redis.compressors
|
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcpretrans Trace or count TCP retransmits and TLPs.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: tcpretrans [-c] [-h] [-l] [-4 | -6]
#
# This uses dynamic tracing of kernel functions, and will need to be updated
# to match kernel... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tweepy.streaming import StreamListener
from datetime import datetime, timedelta
import json
__author__ = 'litleleprikon'
class Listener(StreamListener):
def __init__(self, f: 'open()', places):
self._places = places
self._file = f
self._... |
import cv2
import datetime
import imutils
import numpy as np
from centroidtracker import CentroidTracker
from itertools import combinations
import math
protopath = "H:/CV projects/AIComputerVision-master/model files/generic object detection model/MobileNetSSD_deploy.prototxt"
modelpath = "H:/CV projects/AIComputerVisi... |
# Copyright (c) 2011-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must ... |
from .strategy import MinMaxStrategy, StaticStrategy, RandomStrategy
from .new import NewClustering
from .new2 import New2Clustering
from .before import BeforeClustering |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import json
import subprocess
import os
import time
import math
from datetime import timedelta
import ConfigParser
wipins = (11,12,13,15,16,18,22,7,3,5,24,26,19,21,23,8,10,False,False,False,False,29,31,33,35,37,32,36,38,40)
def getPin(id):
return wipins[id]
pins = (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 20:26:33 2019
@author: xjc
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 18:34:58 2019
@author: xjc
"""
import math
import numpy as np
import fire
import os
import time
import torch
import torch.nn as nn
impor... |
# -*- coding: utf-8 -*-
from pathlib import Path
from click.testing import CliRunner
from umarkdown.cli import main
def test_cli_read_from_text_file(runner: CliRunner):
with runner.isolated_filesystem():
with open("hello.md", "w") as f:
f.write("# Hello World")
result = runner.invoke... |
from .wizcog import Wizcog
def setup(bot):
bot.add_cog(Wizcog(bot)) |
from .EMUtils import omega, k, VTEMFun, TriangleFun, SineFun
from .AnalyticUtils import (
MagneticDipoleFields,
MagneticDipoleVectorPotential,
MagneticLoopVectorPotential,
orientationDict,
)
from .CurrentUtils import (
getSourceTermLineCurrentPolygon,
getStraightLineCurrentIntegral,
)
|
# apps/vendor/models.py
# Django modules
from django.contrib.auth.models import User
from django.db import models
# Locals
# Create your models here.
class Vendor(models.Model):
name = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.OneToOneFiel... |
#!/usr/bin/python3
import sys
import pyvips
pyvips.leak_set(True)
pyvips.cache_set_max(0)
for i in range(1000):
print("loop {0} ...".format(i))
im = pyvips.Image.new_from_file(sys.argv[1])
im = im.embed(100, 100, 3000, 3000, extend="mirror")
im.write_to_file("x.v")
|
from pathlib import Path
from collections import OrderedDict
import os
def config_parser(full_path):
path = Path(full_path)
if path.exists() and path.is_file():
with open(str(path), 'r') as file:
lines = file.read().split('\n')
lines = [line for line in lines if line and not lin... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-15 18:16
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 20 20:06:36 2020
@author: AFigueroa
"""
import numpy as np
from scipy import interpolate as intp
from scipy import linalg
from scipy.spatial import distance
from tqdm import tqdm
# In[]:
def GPR_MODEL(Params,Lambda_Inv,Xtrain,Ytrain,alpha_,Xte... |
import torch
from typing import Any, Callable, Optional, Union
from pytorch_lightning.metrics.metric import Metric
class MeanSquaredError(Metric):
"""
Computes mean squared error.
Args:
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default:... |
"""
# Details:
# This script starts a Flask server to view
# Simulation Data Bases
# for more information see:
# http://flask.pocoo.org/
# Start by running:
# python dataBaseViewer.py
# Authors:
# Andrej Berg, Michael King
# History:
# -
# Last modified: 12.07.2018
# ToDo:
# -
# Bugs:
# -
""... |
# Copyright (c) 2015 Gamda Software, LLC
#
# See the file LICENSE.txt for copying permission.
import unittest
import random
from checkers.model import Model, Chip
from gameboard.coordinate import Coordinate
class TestChip(unittest.TestCase):
def test_init_raises_color_exception(self):
self.assertRaises(V... |
# Test unit for decomon with Dense layers
from __future__ import absolute_import
import pytest
import numpy as np
from decomon.layers.decomon_layers import DecomonDense, to_monotonic
from tensorflow.keras.layers import Dense
from . import (
get_tensor_decomposition_1d_box,
get_standart_values_1d_box,
assert... |
class progress_indicator(object):
def __init__(self, desc):
self._desc = desc
def __enter__(self):
print(self._desc + "...")
def __exit__(self, *args, **kwargs):
print("Done!")
|
"""
Django settings for penny123_29561 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... |
import typer
app = typer.Typer()
@app.command()
def hello(name: str = "World", formal: bool = False):
"""
Say hi
"""
if formal:
typer.echo(f"Good morning Ms. {name}")
else:
typer.echo(f"Hello {name}!")
@app.command()
def bye(friend: bool = False):
"""
Say bye
"""
... |
import re
import socket
import gsb
from twisted.internet import reactor
from .card import Card
from . import globals
from . import models
from .channels.challenge import Challenge
from .channels.chat import Chat
class Server(gsb.Server):
def __init__(self, *args, **kwargs):
gsb.Server.__init__(sel... |
from IPython import embed
import pandas as pd
import json
import re
def read_crr_tsv_as_df(path, nrows=-1, add_turn_separator=True):
"""
Transforms conversation response ranking tsv file to a pandas DataFrame.
The format is label \t utterance_1 \t utterance_2 \t ...... \t candidate_response.
See https... |
# coding: utf-8
# 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... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import math
import numpy as np
import pdb
def convbn(in_planes, out_planes, kernel_size, stride, pad, dilation):
return nn.Sequential(nn.Conv2d(in_pla... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EventAlertCondition(object... |
# -*- coding: utf-8 -*-
import codecs
import os
import torch
import torchtext
from onmt.io.DatasetBase import ONMTDatasetBase, PAD_WORD, BOS_WORD, EOS_WORD
class ImageDataset(ONMTDatasetBase):
""" Dataset for data_type=='img'
Build `Example` objects, `Field` objects, and filter_pred func... |
import contextlib
import os
import re
from typing import Tuple
from openff.toolkit.typing.chemistry import ChemicalEnvironment, SMIRKSParsingError
from pydantic import Field, validator
from qubekit.molecules import Atom, Bond, Ligand
from qubekit.utils.datastructures import SchemaBase
class AvoidedTorsion(SchemaBas... |
print("Hello")
from compas.geometry import Point
"""
#https://www.youtube.com/watch?v=-eIkUnCLMFc
#https://www.youtube.com/watch?v=-R5sgnHuTFs
#ToDo
#Reference Boost
#Reference Eigen
#Reference CGAL
#Create CGAL polyline https://doc.cgal.org/latest/Nef_3/Nef_3_2polyline_construction_8cpp-example.html
#Follow compas ... |
from django.contrib import admin
from django.utils.html import format_html
from audiobook.models import *
def make_active(self, request, queryset):
queryset.update(active=True)
make_active.short_description = "Mark selected items as active"
def make_inactive(self, request, queryset):
queryset.update(acti... |
"""Localized-GTLVQ example using the Moons dataset."""
import argparse
import prototorch as pt
import pytorch_lightning as pl
import torch
if __name__ == "__main__":
# Command-line arguments
parser = argparse.ArgumentParser()
parser = pl.Trainer.add_argparse_args(parser)
args = parser.parse_args()
... |
# 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 u... |
import datetime
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '(b*%j%7mqfgnxa*acz$opc0gj++mksj$&rgaqmf&0(vnk4+@d&'
DEBUG = True
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
],
}
ALLOWED_HOSTS =... |
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""PKI CLI."""
import logging
import os
from pathlib import Path
from click import group
from click import option
from click import pass_context
from click import password_option
from click import Path as ClickPath
from openfl.componen... |
# -*- coding: utf-8 -*-
'''
@Time : 2020/05/06 21:09
@Author : Tianxiaomo
@File : dataset.py
@Noice :
@Modificattion :
@Author :
@Time :
@Detail :
'''
import os
import random
import sys
import cv2
import numpy as np
import torch
from torch.utils.data.dataset im... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The LISYNetwork Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import re
import requests
import time
import types
try:
# Prefer lxml, if installed.
from lxml import etree as ET
except ImportError:
try:
from xml.etree import cEle... |
import click
import shutil
from ...utils.config import get_config_path, check_config_path
from ...utils.logging import logger
@click.command()
def main():
"""
Remove the configuration directory.
"""
if(check_config_path()):
config_path = get_config_path()
logger.warn("This will comple... |
from trex.astf.api import *
import argparse
# scheduler.rampup_sec =5 means that it will get to maximum rate after 5 sec
# CPS will increase linearly (every 1 sec)
class Prof1():
def __init__(self):
pass
def get_profile(self, tunables, **kwargs):
parser = argparse.ArgumentParser(descriptio... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('textfile', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='TextFileTranslation',
fie... |
#Jeffrey Bradley
#9/11/2020
# import statements
from tensorflow.keras.datasets import fashion_mnist
from sklearn.model_selection import train_test_split
import tensorflow as tf
#10 classes (of clothing) -> 0-9
#784 features
#weight matrix so that each feature is a percentage of each class
# Load in dat... |
import os
import pickle
import random
import re
import string
import warnings
import webbrowser
import twitter # pip install python-twitter
import sexmachine.detector as gender # pip install SexMachine
from requests_oauthlib import OAuth1Session
from unidecode import unidecode # pip... |
# This Python function helps you to test arbitrary regular expressions
#
# Usage:
# Import into python/ipython/script
# Pass in your regular expression as a string or regular expression r'string'
#
# Often times when writing regular expressions
# I find myself manually iterating over the pattern
# testing a string it f... |
import math
import random
import datetime
from time import sleep
def retorno():
res=input('Deseja executar o programa novamente?[s/n] ')
if(res=='s' or res=='S'):
verificar()
else:
print('Processo finalizado!')
pass
def cabecalho(texto):
... |
import random
import time
import warnings
import sys
import argparse
import shutil
import os.path as osp
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.optim import SGD
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
import torchvision.transform... |
python = Runtime.start("python","Python")
speech = Runtime.start("speech","GoogleSpeech")
webkitspeechrecognition = Runtime.start("webkitspeechrecognition","WebkitSpeechRecognition")
arduino = Runtime.start("arduino","Arduino")
arduino.connect("COM3")
speech.setGoogleURI("http://thehackettfamily.org/Voice_api/api2.php... |
#!/usr/bin/env python
import os, resource, sys
import argparse
import numpy as np
import networkx as nx
import neurokernel.core_gpu as core
from neurokernel.tools.logging import setup_logger
from neurokernel.tools.timing import Timer
from neurokernel.LPU.OutputProcessors.FileOutputProcessor import FileOutputProcesso... |
"""
The Just Indices Stats command.
To learn what the "Just" means in this context see #36
(https://github.com/ViaQ/watches-cli/issues/36)
"""
from .indices_stats import IndicesStats
class JustIndicesStats(IndicesStats):
"""Get "just" indices stats"""
def getData(self):
# This command makes sense o... |
#!/usr/bin/env ipython
'''
Meshlab can output meshes as JSON formmatted triangle and vertex data.
We need to wrangle this into the triangle format for the Arduino3D
models.
JSON is similar enough to Python that we can parse it directly just by
definind the values true, false, and null, to their Python equivalents.
... |
# 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
from ... import _utilities, _tables
__a... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The WiFicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid blocks.
In this test we connect to one node over p2p, and test block r... |
# coding: utf-8
"""Test installation of JupyterLab extensions"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import json
import os
import sys
from os.path import join as pjoin
from unittest import TestCase
import pytest
try:
from unittest.mock i... |
# 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,... |
from sqlalchemy import Integer, String, ForeignKey, func, desc, and_, or_
from sqlalchemy.orm import interfaces, relationship, mapper, \
clear_mappers, create_session, joinedload, joinedload_all, \
subqueryload, subqueryload_all, polymorphic_union, aliased,\
class_mapper
from sqlalchemy import exc as sa_exc... |
class Model(object):
def __init__(self, pk, slug):
self.id, self.pk = pk, pk
self.slug = slug
|
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
"""Qikify MVC Framework.
"""
VERSION = ('0', '2', '0')
__version__ = '.'.join(VERSION)
|
import pathlib
from typing import Dict
from melon.introducer.introducer import Introducer
from melon.introducer.introducer_api import IntroducerAPI
from melon.server.outbound_message import NodeType
from melon.server.start_service import run_service
from melon.util.config import load_config_cli
from melon.util.default... |
# Generated by Django 4.0.3 on 2022-03-14 14:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_instructor_dept_name_student_dept_name'),
('university', '0013_takes_student_alter_takes_id'),
]
... |
import pkg_resources
import sys
from django.core.management.base import NoArgsCommand
from reviewboard.scmtools.models import Tool
class Command(NoArgsCommand):
def handle_noargs(self, **options):
registered_tools = {}
for tool in Tool.objects.all():
registered_tools[tool.class_name... |
from setuptools import setup, find_packages
setup(
name = "stackoverflow",
version = "0.1.3",
packages = find_packages(),
install_requires = [
"requests>=2.23.0",
"beautifulsoup4>=4.9.0",
],
entry_points = {
"console_scripts": [
"stackoverflow = stackoverfl... |
import unittest
from uwallet.hashing import *
from uwallet.util import *
from uwallet.blockchain import ArithUint256
def _serialize_header(block):
s = int_to_hex(block.get('version'), 4) \
+ rev_hex(block.get("prev_block_hash")) \
+ rev_hex(block.get('merkle_root')) \
+ rev_hex(block.get('c... |
import requests
class AppLibrary:
def __init__(self):
self._base_url = "http://localhost:5000"
def create_user(self, username, password):
data = {
"kayttajatunnus": username,
"salasana": password,
"salasana_varmistus": password
}
requests.p... |
from opytimizer.optimizers.evolutionary import IWO
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
params = {
'min_seeds': 0,
'max_seeds': 5,
'e': 2,
'init_sigma': 3,
'final_sigma': 0.001
}
# Creates an IWO optimizer
o = IWO(params=params)
|
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter3d"
_path_str = "scatter3d.line"
_valid_props = {
"autocolorscale",
"ca... |
import re
from django import forms
tagname_re = re.compile(r'^[-a-z0-9+#.]+$')
tag_split_re = re.compile(r'[ ;,]')
class TagnameField(forms.CharField):
"""
A CharField which validates that a maximum of 5 space-separated
tagnames have been entered, that each tag is at most 25
characters long and that ... |
# -*- coding: utf-8 -*-
"""Export processing results to Timesketch."""
import re
import time
from timesketch_import_client import importer
from dftimewolf.lib import module
from dftimewolf.lib import timesketch_utils
from dftimewolf.lib.containers import containers
from dftimewolf.lib.modules import manager as modul... |
# Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
try:
import pkg_resources
except ImportError:
pkg_resources = None
def is_namespace(modname):
# pylint: disable=no-member; astroid issue #290, modifying globals at runtime.
return (pkg_resources is not None
and modname in pkg_resou... |
"""
Load the yeast dataset from UCI ML repository
"""
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from dataset_peek import data_peek
def load_yeast():
fp = "yeast.data.txt"
raw_data = pd.read_csv(fp, delim_whitespace=True, header=None)
x = np.array(raw_data.iloc[:... |
from domain import *
#
# mutable_fuzzy_set contains double type list of values that
# correspond to domain_element
#
class mutable_fuzzy_set:
def __init__(self, domain, values=None):
self.domain = domain
self.memberships = [] #double
if values:
... |
#!/usr/bin/python3
#
# merge several modules.yaml files (rpm modularity metadata) into one
#
# Copyright (c) 2020 Gerd v. Egidy
# License: MIT
# https://github.com/rpm-software-management/modulemd-tools
#
import os
import sys
import logging
import argparse
import createrepo_c as cr
import gi
gi.require_version("Modu... |
# Copyright (c) 2020 PaddlePaddle 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 applic... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make_events_info.py
Makes the entries for the events section.
See the README.md file for more information.
http://www.gridpp.ac.uk
"""
#...for the Operating System stuff.
import os
#...for parsing the arguments.
import argparse
#...for the logging.
import l... |
"""Test cases for the __main__ module."""
import pytest
from typer.testing import CliRunner
from funk_lines import __main__
@pytest.fixture
def runner() -> CliRunner:
"""Fixture for invoking command-line interfaces."""
return CliRunner()
def test_version_succeeds(runner: CliRunner) -> None:
"""It exits... |
import torch
import torch.nn as nn
from mmcv.ops.nms import batched_nms
from mmdet.core.bbox.iou_calculators import bbox_overlaps
def multiclass_nms(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factor... |
from functools import partial
from PyQt5.QtWidgets import QWidget, QLabel, QToolButton, QDoubleSpinBox, \
QSpinBox, QHBoxLayout, QListWidgetItem, QItemDelegate, QLineEdit
from PyQt5.QtGui import QIcon, QColor
from PyQt5.QtCore import Qt
from app.resources.resources import RESOURCES
from app.data.database import D... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Gtacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import GtacoinTestFramework
from... |
import numpy as np
from scipy import linalg as ln
def chained_integrator_dynamics(dt=0.1, n=2, decay=1, amplification = 1, fullB=False):
''' forward euler discretization of
dx_i/dt = x_{i+1}; dx_n/dt = u
with added decay of states or amplification
of integration terms '''
if hasattr(dec... |
#
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
SERIALIZATION_LIB = "serialization.lib"
SERIALIZATION_CLASS = "serialization... |
# Copyright (c) 2019. TsumiNa. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from os import remove
from pathlib import Path
import joblib
import numpy as np
import pandas as pd
import pytest
from xenonpy.datatools import Dataset
@pytes... |
import torch
from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.squeezenet_s... |
import os
# Prompt User to Enter the FileName
fileName = str(input("Please Enter the file Name: "))
fileName = fileName.strip()
while not fileName:
print("Name of the File Cannot be left blank.")
print("Please Enter the valid Name of the File.")
fileName = str(input("Please Enter the file Name: "))
f... |
"""
Django settings for sphinxquant project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import o... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 9 12:13:10 2019
@author: gourgue
"""
#%%
import numpy as np
from scipy import ndimage as ndi
from scipy.io import savemat
import matplotlib.pyplot as plt
from fonction_compteur_affiche import plot
from fonction_compteur_datagenerator import test_label
from skima... |
def gcd(a,b):
"""Compute the greatest common divisor of a and b"""
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b / gcd(a, b)
class Laser(object):
def __repr__(self):
return f'Laser({self.currentloc})'
d... |
from __future__ import unicode_literals
TERMINALS = ['(', ')', ',', '/']
def maybe_add_word(name, tokens):
if name:
tokens.append(name)
name = ''
return name, tokens
def tokenize_partial_response(text):
tokens = []
name = ''
if not text:
return tokens
for ch in te... |
# Generated by Django 3.1.2 on 2020-10-10 23:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Destinatario',
fields=[
... |
'''
https://www.hackerrank.com/challenges/extra-long-factorials/submissions/code/102918318
good to use mid-point breaking to make it smaller multiplication
'''
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the extraLongFactorials function below.
def extraLongFactorials(n):
i... |
from django.shortcuts import render
def index(request):
return render(request, "contact/index.html")
|
# =============================================================================
#
# 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 r... |
import tkinter
from pygitlabmonitor.gitlab import GitLab
from pygitlabmonitor.monitorframe import MonitorFrame
from pygitlabmonitor.projectcache import ProjectCache
class Monitor:
def __init__(self):
self._gitlab = GitLab()
root = tkinter.Tk()
root.title("cmiclab status")
proje... |
#!/usr/bin/env python3
import sys
import random
import string
import datetime
def get_random_digits(begin, end):
return str(random.randrange(begin, end + 1))
def get_random_string(length):
return ''.join(random.choice(string.ascii_letters) for i in range(length))
def get_random_phone(length):
return ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mw_menus.ui'
#
# Created: Sat Oct 27 00:00:52 2018
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2018 Palo Alto Networks, 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
#
#... |
#
# def func(d,c):
# d['a']=10
# d['b']=20
#
# c.append(4)
#
# c=[1]
# d = {'a': 1, 'b': 2}
# func(d,c)
# print(d)
# print(c)
y=1
x=''
a= x or None
print(a) |
"""Stupid tests that ensure logging works as expected"""
import sys
import threading
import logging as log
from io import StringIO
import unittest
import beets.logging as blog
from beets import plugins, ui
import beetsplug
from test import _common
from test._common import TestCase
from test import helper
class Logg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.