filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_17153
import argparse import numpy as np import healpy if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--weight-paths", nargs="+", required=True) parser.add_argument("--jk-def", required=True) parser.add_argument("--output", required=True) args = parser.parse_args() ...
the-stack_106_17154
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Filename: mb_pendulum.py # @Date: 2019-06-16-18-38 # @Author: Hany Abdulsamad # @Contact: hany@robot-learning.de import gym from trajopt.gps import MBGPS # pendulum env env = gym.make('Pendulum-TO-v0') env._max_episode_steps = 150 alg = MBGPS(env, nb_steps=150, ...
the-stack_106_17156
# -*- coding: utf-8 -*- def clear_not_using_groups(): import sqlite3 bot_db = sqlite3.connect('Bot_db') cursor = bot_db.cursor() cursor.execute("SELECT g_tt.id FROM groups_tt as g_tt LEFT OUTER JOIN users AS u ON g_tt.url = u.url WHERE u.id ISNULL") ids = cursor.fetchall() for id in ids: ...
the-stack_106_17157
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.4.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # ### COVID-19 Global Stats # This notebook lets you ex...
the-stack_106_17158
import base64 import web3 from snet.sdk.payment_channel import PaymentChannel from snet.snet_cli.utils import get_contract_object, get_contract_deployment_block BLOCKS_PER_BATCH = 20000 class MPEContract: def __init__(self, w3): self.web3 = w3 self.contract = get_contract_object(self.web3, "Mu...
the-stack_106_17159
import logging from collections import OrderedDict as _o logger = logging.getLogger(__name__) default_ns_order = ['WM', 'UN', 'HUME', 'SOFIA', 'CWMS'] class Concept(object): """A concept/entity of interest that is the argument of a Statement Parameters ---------- name : str The name of the...
the-stack_106_17160
import sys import re import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay import numpy as np import itertools def systematize_error(e, model_name, errors, bigger_errors): pattern = re.compile('Observation: \{(.+)\}, Prediction: (.+), True label: (.+)') m = re.fi...
the-stack_106_17161
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Wu Yi-Chiao (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import os import sys import yaml import copy import fnmatch import datetime import numpy as np class ConfigInfo(object): def __init__(self, yml_path, c_text):...
the-stack_106_17162
from flask import render_template,redirect,url_for, abort,request,flash from . import main from .forms import CommentsForm, UpdateProfile, CaseForm from ..models import User, Case,Comment from flask_login import login_required, current_user from .. import db, photos import markdown2 @main.route('/') def index(): '...
the-stack_106_17163
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
the-stack_106_17165
#!/bin/python # # simple restful client tester for the API application. # import requests import json import uuid base_url = 'http://localhost:5000/' user_name = 'test' user_email = str(uuid.uuid4()) + "@example.net" user_pass = '1234' # register new user print('=> Registering new user') register = requests.post(ba...
the-stack_106_17166
from email import header import os from django.db.models import Q from django.urls import reverse from django.conf import settings from django.shortcuts import render from django.core.cache import cache from django.views.generic import View from utils.mixin import LoginRequiredMixin from utils.aliyun_utility import Ali...
the-stack_106_17167
from setuptools import setup, find_packages import os BASE_DIR = os.path.dirname(__file__) with open(os.path.join(BASE_DIR, 'requirements.txt')) as _file: requirements = [line.strip() for line in _file] setup( name='pydicts', version='v0.1.1', packages=find_packages(), install_requires=requiremen...
the-stack_106_17169
#!/usr/bin/python import calendar import Tkinter import ttk import tkFont def get_calendar(locale, fwday): # instantiate proper calendar class if locale is None: return calendar.TextCalendar(fwday) else: return calendar.LocaleTextCalendar(fwday, locale) class Calendar(ttk.Frame): # X...
the-stack_106_17171
from __future__ import absolute_import from django.contrib.auth.decorators import login_required, permission_required from django.contrib.sites.shortcuts import get_current_site from django.shortcuts import get_object_or_404, render from django.views.decorators.csrf import csrf_protect import django_comments from dja...
the-stack_106_17173
import unittest from atc_tools.time import TimeSequence class TimeTest(unittest.TestCase): def test_01_sequence(self): seq = TimeSequence("2021/01/10 14:23", delta_seconds=3600) t1 = seq.next() t2 = seq.next() t3 = next(seq) t4 = seq.reverse(2) self.assertEqual(t...
the-stack_106_17175
# coding: utf-8 """ ThingsBoard REST API ThingsBoard Professional Edition IoT platform REST API documentation. # noqa: E501 OpenAPI spec version: 3.3.3PAAS-RC1 Contact: info@thingsboard.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F40...
the-stack_106_17176
""" Octahedral Lambda ================= """ from ..metal_complex import MetalComplex from ..vertices import MetalVertex, BiDentateLigandVertex from ...topology_graph import Edge class OctahedralLambda(MetalComplex): """ Represents a metal complex topology graph. .. moldoc:: import moldoc.molec...
the-stack_106_17177
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
the-stack_106_17178
import libsubmit from libsubmit.channels.ssh.ssh import SSHChannel as SSH def connect_and_list(hostname, username): conn = SSH(hostname, username=username) ec, out, err = conn.execute_wait("echo $HOSTNAME") conn.close() return out def test_push(conn, fname="test001.txt"): with open(fname, 'w') ...
the-stack_106_17179
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel from RecoJets.JetProducers.PileupJetIDParams_cfi import * #_stdalgos_4x = cms.VPSet(full, cutbased,PhilV1) _stdalgos_5x = cms.VPSet(full_5x,cutbased,PhilV1) #_chsalgos_4x = cms.VPSet(full, cu...
the-stack_106_17184
"""Environment discovery""" import os import glob from toposort import toposort_flatten from .environment import Environment __all__ = ('discover',) def discover(glob_pattern): """ Find all files matching given glob_pattern, parse them, and return list of environments: >>> envs = discover("requir...
the-stack_106_17185
import FWCore.ParameterSet.Config as cms process = cms.Process("PROD") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Geometry.DTGeometry.dtGeometry_cfi") process.DTGeometryESModule.applyAlignment = False process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") proces...
the-stack_106_17186
from django.db.models.query import prefetch_related_objects from iaso.models import OrgUnit, GroupSet from .comparisons import as_field_types, Diff, Comparison def index_pyramid(orgunits): orgunits_by_source_ref = {} for orgunit in orgunits: if orgunits_by_source_ref.get(orgunit.source_ref, None) is N...
the-stack_106_17192
# Copyright Splunk 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, softw...
the-stack_106_17193
# Load Packages import pandas as pd import numpy as np import random from matplotlib import pyplot as plt from sklearn.model_selection import LeaveOneOut from sklearn import preprocessing from sklearn.metrics import accuracy_score, precision_score, recall_score from sklearn.model_selection import train_test_split from ...
the-stack_106_17196
# coding: utf8 def extract_slices(input_tensor, slice_direction=0, slice_mode='single'): """Extracts the slices from three directions This function extracts slices form the preprocesed nifti image. The direction of extraction can be defined either on sagital direction (0), cornal direction (1) or...
the-stack_106_17198
"""Extensions of core argparse classes.""" import argparse import glob import inspect import logging import os import re import sys from copy import deepcopy from typing import Any, Callable, Dict, List, NoReturn, Optional, Sequence, Set, Tuple, Type, Union from unittest.mock import patch from .formatters import Defa...
the-stack_106_17199
""" Test cases for InventoryItem Model """ import logging import unittest import os from flask_api import status from werkzeug.exceptions import NotFound from service.models import InventoryItem, DataValidationError, db from service import app DATABASE_URI = os.getenv( "DATABASE_URI", "postgres://postgres:postg...
the-stack_106_17201
import sys import logging from datetime import datetime from .setup import put_to_s3 from .iam_aws import AssumedRoleSession from .analizer import analizer_expose_sg, analizer_launch_days, security_groupUSE, ami_informationcreationDays, ami_informationOWNER, ami_informationNAME, vpc_informationLog, lb_informationLog, l...
the-stack_106_17202
"""PyTorch implementation of Wide-ResNet taken from https://github.com/jeromerony/fast_adversarial/blob/master/fast_adv/models/cifar10/wide_resnet.py""" import math import torch import torch.nn as nn import torch.nn.functional as F from models.FiLM import FiLM_Layer from models.DualBN import DualBN2d class BasicBlo...
the-stack_106_17203
#*****************************************************# # This file is part of GRIDOPT. # # # # Copyright (c) 2015, Tomas Tinoco De Rubira. # # # # GRIDOPT is released under the BSD 2-cl...
the-stack_106_17204
# ----------------------------------------------------------------------------- # lex_closure.py # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0, "..") import ply.lex as lex tokens = ( 'NAME', 'NUMBER', 'PLUS', 'MINUS', ...
the-stack_106_17205
""" ProvidedMakeWorkflow """ from aws_lambda_builders.workflows.custom_make.validator import CustomMakeRuntimeValidator from aws_lambda_builders.workflow import BaseWorkflow, Capability from aws_lambda_builders.actions import CopySourceAction from aws_lambda_builders.path_resolver import PathResolver from .actions impo...
the-stack_106_17206
import argparse import importlib import os import time import numpy as np import tensorflow as tf import models FLAGS = tf.flags.FLAGS DEFAULT_MODEL = 'vmnet' if __name__ == '__main__': tf.flags.DEFINE_string('model', DEFAULT_MODEL, 'Name of the model.') tf.flags.DEFINE_string('cuda_device', '-1', 'CUDA device...
the-stack_106_17207
# Copyright 2011-2013 Luis Pedro Coelho <luis@luispedro.org> # License: MIT import numpy as np from mahotas.thresholding import otsu, rc, bernsen, gbernsen from mahotas.histogram import fullhistogram def slow_otsu(img, ignore_zeros=False): hist = fullhistogram(img) hist = hist.astype(np.double) Hsum = img...
the-stack_106_17208
# Copyright (C) 2020 FireEye, 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: [package root]/LICENSE.txt # Unless required by applicable law or agreed to in writing,...
the-stack_106_17212
import pandas as pd from joblib import Parallel, delayed from tqdm import tqdm def calc_temp_overlap(start_1, end_1, start_2, end_2): """ Calculate the portion of the first time span that overlaps with the second Parameters ---------- start_1: datetime start of first time span end_1: ...
the-stack_106_17213
# MongoDB and Flask Application # Dependencies and Setup from flask import Flask, render_template from flask_pymongo import PyMongo import scrape_mars # Flask Setup app = Flask(__name__) # PyMongo Connection Setup app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app" mongo = PyMongo(app) # Flask Rou...
the-stack_106_17214
# -*- coding: utf-8 -*- """ tracker.models ~~~~~~~~~~~~~~ tracker models file :copyright: (c) 2014 by arruda. """ from django.db import models from django.utils import timezone class Realm(models.Model): """ A Wow realm """ name = models.CharField(u"Realm Name", max_length=350, blan...
the-stack_106_17222
def dump_by_quantiles(df, q_low = 0.01 , q_high = 0.99): """Inputs: df : A Pandas dataframe q_low: float, the lower quantile cut off q_high: float, the higher quantile cut off Returns: the dataframe without the rows containing outliers""" # create a df of the high ...
the-stack_106_17223
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # %% import sys import os import multiprocessing import numpy as np import torch from torch import nn, optim from kbc.util import set_seed from kbc.training.data import Data from kbc.training.batcher import Batcher from kbc.models import DistMult, ComplEx, TransE im...
the-stack_106_17227
""" A Python Wrapper for WhenIWork.com .. moduleauthor:: Alex Riviere <fimion@gmail.com> """ import requests def raise_for_status_with_message(resp): try: resp.raise_for_status() except requests.exceptions.HTTPError as error: if resp.text: raise requests.exceptions.HTTPError('...
the-stack_106_17230
# Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Base classes for Bio.Phylo objects. All object representations for phylogenetic tree...
the-stack_106_17232
import os, inspect import tensorflow as tf import numpy as np PACK_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+"/.." def training(sess, saver, neuralnet, dataset, epochs, batch_size, normalize=True): print("\nTraining to %d epochs (%d of minibatch size)" %(epochs, batch_size...
the-stack_106_17238
from __future__ import absolute_import, print_function from .ast_tools import token, symbol, ast_to_string, match, atom_list def slice_ast_to_dict(ast_seq): sl_vars = {} if isinstance(ast_seq, (list, tuple)): for pattern in slice_patterns: found,data = match(pattern,ast_seq) if...
the-stack_106_17239
# -*- coding: utf-8 -*- from os import path as os_path import numpy as np import logging from ctypes import c_double from multiprocessing.sharedctypes import RawArray from .spectrum import hash_numpy_array, Spectrum logger = logging.getLogger(__name__) class SpectrumArray(object): """ An object representin...
the-stack_106_17241
#!/usr/bin/env python3 # Foundations of Python Network Programming, Third Edition # https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter18/xmlrpc_introspect.py # XML-RPC client import xmlrpc.client def main(): proxy = xmlrpc.client.ServerProxy('http://127.0.0.1:7001') print('Here are the functions supp...
the-stack_106_17242
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from time import sleep import os # Set chrome options for working with headless mode (no screen) chrome_options = webdriver...
the-stack_106_17243
""" MIT License Copyright (c) 2019 Mingqi Yuan 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, merge, publish, d...
the-stack_106_17244
import math import numpy as np import tensorflow as tf def identity_initializer(scale=1.0): """Identity initializer by Quoc V. Le et al. This is also recommended by at least one paper to initialize the weights matrix in a RNN. References: Paper: Quoc V. Le et al., http://arxiv.org/abs/1504.00...
the-stack_106_17248
import os from definitions.ir.dfg_node import * class DFSSplitReader(DFGNode): def __init__(self, inputs, outputs, com_name, com_category, com_options = [], com_redirs = [], com_assignments=[]): super().__init__(inputs, outputs, com_name, com_category, co...
the-stack_106_17249
# Copyright 2018 OpenStack Foundation # 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 requ...
the-stack_106_17251
# Copyright 2021 The Feast 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
the-stack_106_17252
from collections import defaultdict from caseworker.users.services import get_gov_user from core import client from core.helpers import convert_value_to_query_param from caseworker.cases.constants import CaseType, CaseStatusEnum from lite_forms.components import Option def get_denial_reasons(request, convert_to_opti...
the-stack_106_17253
from geometry_msgs.msg import Pose, Point from erdos.op import Op from erdos.data_stream import DataStream from erdos.message import Message class RaiseObjectOperator(Op): """ Raises the Sawyer arm while gripping the object. """ stream_name = "raise-object-stream" def __init__(self, name): ...
the-stack_106_17255
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Nov 7, 2015 Don't blink... @author: Juan_Insuasti ''' import sys import datetime import os.path import json from Shared import Logger class DataLogger: def __init__(self, initFile, storage, storageRoute, logPrefix = "", logs = True,logName='Data Logger'...
the-stack_106_17256
import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler # function to preprocess data and convert it into useful features def raw_to_data(input): columns = ['age', 'workclass', 'fnlwgt', 'education_level', 'education-num', 'marital-status', 'occupation', 'relationship', 'race', '...
the-stack_106_17257
# -*- coding: utf-8 -*- import logging from functools import lru_cache from typing import Tuple, Union import numpy as np Shape = Union[int, Tuple[int, int]] logger = logging.getLogger(__name__) @lru_cache(maxsize=8) def filtergrid( size: Shape, quadrant_shift: bool = True, normalize: bool = True ) -> Tuple[np...
the-stack_106_17259
#!/usr/bin/env python import rospy from flexbe_core import EventState, Logger from flexbe_core.proxy import ProxyActionClient from moveit_msgs.msg import MoveGroupAction, MoveGroupGoal, Constraints, JointConstraint, MoveItErrorCodes ''' Created on 10.10.2016 @author: Alberto Romay ''' class JointStateToMoveit(Ev...
the-stack_106_17261
import torch import itertools from .base_model import BaseModel from .cycle_gan_model import CycleGANModel import os from collections import OrderedDict from util.util import mkdirs class CycleDualViewGANModel(BaseModel): @staticmethod def modify_commandline_options(parser, is_train=True): return Cycl...
the-stack_106_17262
import json import geojson from flask import current_app from server.models.dtos.project_dto import DraftProjectDTO, ProjectDTO, ProjectCommentsDTO from server.models.postgis.project import Project, Task, ProjectStatus from server.models.postgis.statuses import TaskCreationMode from server.models.postgis.task import ...
the-stack_106_17263
#! /usr/bin/env python """Genetic Programming in Python, with a scikit-learn inspired API""" from setuptools import setup, find_packages import gplearn DESCRIPTION = __doc__ VERSION = gplearn.__version__ setup(name='gplearn', version=VERSION, description=DESCRIPTION, long_description=open("README....
the-stack_106_17266
from unittest.mock import MagicMock, patch from colorama import Fore from doddle.boards import ( EmojiScoreboardPrinter, HtmlScoreboardPrinter, Keyboard, KeyboardPrinter, Scoreboard, ScoreboardPrinter, ScoreboardRow, ) from doddle.words import Word class TestScoreboardRow: def test_r...
the-stack_106_17269
from __future__ import division import os, subprocess, logging, sys, argparse, inspect, csv, time, re, shutil, datetime, platform, multiprocessing, itertools, hashlib, math, types, gzip, operator, textwrap from natsort import natsorted from lib.interlap import InterLap from collections import defaultdict import warning...
the-stack_106_17271
""" This is a hacky little attempt using the tools from the trigger creation script to identify a good set of label strings. The idea is to train a linear classifier over the predict token and then look at the most similar tokens. """ import argparse import json import logging from pathlib import Path import torch imp...
the-stack_106_17272
import json import shutil import sys from pathlib import Path import os import subprocess import argparse SCRIPT_DIR = Path(__file__).parent.absolute() ROOT_DIR = SCRIPT_DIR.parent.parent.absolute() FRONTEND_DIR = ROOT_DIR / "src" / "frontend" WEB_DIR = ROOT_DIR / "src" def build_new_static(env): shutil.rmtree("...
the-stack_106_17273
"""Configs for building the Mousavi model. """ class Config: """A class used for mousavi model configs. """ def __init__(self): """ Parameters ---------- signal_len: int The length of the input ECG signal(Time in secs * Sampling rate). input_...
the-stack_106_17277
"""Command to show diagnosis information about mpf and mc.""" import sys from serial.tools import list_ports from mpf._version import version as mpf_version class Command: """Runs the mpf game.""" def __init__(self, mpf_path, machine_path, args): """Run mpf diagnosis.""" del args ...
the-stack_106_17279
import time from tkinter import Label import cv2 import requests import numpy as np import urllib3 from PIL import ImageGrab, Image, ImageTk from urllib3.packages.six import StringIO import PIL username = "jarde" password = "invisy" url_with_auth = f"http://{username}:{password}@140.193.201.45:8080/shot.jpg" url = f"...
the-stack_106_17280
from pyne.material import Material as pymat import copy from collections import Counter class Materialflow(pymat): """ Class contains information about burnable material flow. Based on PyNE Material. """ def __init__( self, comp=None, mass=-1.0, den...
the-stack_106_17284
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
the-stack_106_17286
import os import tensorflow as tf import datetime from source.loss_manager import LossManager from source.data_loader import DataLoader from source.settings_reader import SettingsReader from source.model import Model main_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) single_view_path = os.path...
the-stack_106_17289
# Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # See: https://spdx.org/licenses/ from abc import ABC, abstractmethod import typing as ty import numpy as np from lava.lib.dnf.utils.convenience import num_neurons from lava.lib.dnf.operations.shape_handlers import ( AbstractShapeHandl...
the-stack_106_17290
""" Configure application --------------------- This module implements parsers and data structures needed to configure the application. It supports richer settings than those that can be easily represented on the command line by leveraging file formats such as YAML and JSON that are widely used to configure applicatio...
the-stack_106_17291
from typing import Union import torch from numpy import ndarray from torch import Tensor from torchvision.io import read_video from .video_data import VideoData class VideoReader: """VideoReader for reading video file""" @staticmethod def of_array(video: Union[Tensor, ndarray], video_fps: float, audio:...
the-stack_106_17296
""" This example demonstrates the ability to link the axes of views together Views can be linked manually using the context menu, but only if they are given names. """ import numpy as np import pyqtgraph as pg app = pg.mkQApp("Linked Views Example") #mw = QtWidgets.QMainWindow() #mw.resize(800,800) x = np.linspace...
the-stack_106_17297
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
the-stack_106_17299
# dataset settings dataset_type = 'HSIGANDataset' data_root = 'data/HSI' img_norm_cfg = dict( mean=[128]*32, std=[16]*32, to_rgb=False) crop_size = (256, 256) train_pipeline = [ dict(type='LoadENVIHyperSpectralImageFromFile',channel_select=range(4,36),median_blur=False), dict(type='LoadAnnotations'), di...
the-stack_106_17300
""" Given some input calculate how many are increasing line by line """ current = (int(l) for l in open('input')) next(current) # there is no previous value for the first row previous = (int(l) for l in open('input')) print(sum(c > p for c, p in zip(current, previous)))
the-stack_106_17301
#!/usr/bin/env python3 import operator from functools import reduce from typing import Optional, Tuple import torch from torch import Tensor from .. import settings from ..utils.broadcasting import _matmul_broadcast_shape, _mul_broadcast_shape from ..utils.memoize import cached from .diag_lazy_tensor import Constant...
the-stack_106_17303
# -*- coding: utf-8 -*- import warnings from datetime import datetime import uuid class ExtractRecord(object): """The extract base class.""" creation_date = None """datetime.datetime: The date and time of the extract creation.""" electronic_signature = None """unicode or None: Digital signature ...
the-stack_106_17304
#!/usr/bin/env python3 import os import sys import time import json import getopt import subprocess as sp # Nightmode Downmixing settings. SUR_CHANNEL_VOL = 0.60 # Volume level to set the non-center channels to. LFE_CHANNEL_VOL = 0.60 # Volume to set the LFE channel to. # Globals MAXDB = '-0.5' def main(): co...
the-stack_106_17305
import ast import os import sys from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from setuptools.command.sdist import sdist try: from Cython.Build import cythonize except ImportError: cythonize = None PYPY = hasattr(sys, "pypy_version_info") author = author_email = ...
the-stack_106_17307
# File: G (Python 2.4) from pandac.PandaModules import * from direct.showbase.DirectObject import * from direct.interval.IntervalGlobal import * from direct.actor import Actor from pirates.piratesbase import PiratesGlobals from pirates.effects import PolyTrail from PooledEffect import PooledEffect from EffectControlle...
the-stack_106_17308
error_msg = """Jittor only supports Ubuntu>=16.04 currently. For other OS, use Jittor may be risky. We strongly recommended docker installation: # CPU only >>> docker run -it --network host jittor/jittor # CPU and CUDA >>> docker run -it --network host jittor/jittor-cuda Reference: 1. Windows/Mac/Linux通过Docker安装计图: h...
the-stack_106_17309
''' Management of cron, the Unix command scheduler. =============================================== The cron state module allows for user crontabs to be cleanly managed. Cron declarations require a number of parameters. The timing parameters, need to be declared, minute, hour, daymonth, month and dayweek. The user w...
the-stack_106_17310
import asyncio import json import logging import queue import re from collections import defaultdict from typing import Sequence from mmpy_bot.driver import Driver from mmpy_bot.plugins import Plugin from mmpy_bot.settings import Settings from mmpy_bot.webhook_server import NoResponse from mmpy_bot.wrappers import Mes...
the-stack_106_17314
from __future__ import annotations from typing import Optional, List, TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover import numpy as np from pyNastran.gui.dev.gui2.gui2 import MainWindow2 from pyNastran.gui.qt_files.colors import BLACK_FLOAT import vtk from pyNastran.gui.qt_files.QVTKRenderWindowInteracto...
the-stack_106_17315
#!/usr/bin/env python #-*- coding:utf-8 _*- """ @author: Selonsy @file: cli.py @time: 2019-01-23 负责用户交互 """ import re import sys import getopt from utils import glovar from utils import echo from utils.customlog import CustomLog logger = CustomLog(__name__).getLogger() def set_opts(args): ''' 根据命令行输入的...
the-stack_106_17317
# Copyright 2019 The TensorNetwork 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 agreed ...
the-stack_106_17318
""" Ce module a ete ecrit par Olivier Brebant en aout 2011. On peut l'utiliser librement sous licence MIT """ from tkinter import Tk, Canvas, N, E, RIDGE, LEFT, BOTH, YES, NE, LAST from math import floor from .couleurs import rgb, rgb2hex # Un petit message invitant a lire la doc print(""" Merci d'utiliser la librai...
the-stack_106_17319
from pathlib import Path import cv2 import numpy as np import torch from custom_models.model import GrayscaleModel, GaussianBlur def export(): output_dir = Path(__file__).parent / 'out' output_dir.mkdir(parents=True, exist_ok=True) export_onnx(output_dir=output_dir) print('Done.') def export_onnx(...
the-stack_106_17321
# Copyright 2019 The Texar 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 ...
the-stack_106_17324
#!/usr/bin/python -Wall # ================================================================ # Please see LICENSE.txt in the same directory as this file. # John Kerl # kerl.john.r@gmail.com # 2007-05-31 # ================================================================ # Group module for the dihedral group parameterize...
the-stack_106_17325
import scrapy import time class Spider(scrapy.Spider): name = 'ip' allowed_domains = [] def start_requests(self): url = 'http://ip.chinaz.com/getip.aspx' # url = 'http://httpbin.org/get' for i in range(4): print("++++++++++++++++++++++++++++++++++++++++++++",i) ...
the-stack_106_17331
import torch import pytest from onnx2pytorch.operations import Reshape @pytest.fixture def inp(): return torch.rand(35, 1, 200) @pytest.fixture def pruned_inp(): return torch.rand(35, 1, 160) @pytest.mark.parametrize("enable_pruning", [True, False]) def test_reshape(inp, pruned_inp, enable_pruning): ...
the-stack_106_17332
from tapiriik.settings import WEB_ROOT, ENDOMONDO_CLIENT_KEY, ENDOMONDO_CLIENT_SECRET, SECRET_KEY from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase from tapiriik.services.interchange import UploadedActivity, ActivityType, ActivityStatistic, ActivityStatisticUnit, Waypoint, WaypointType, ...
the-stack_106_17334
import os import re import pdfkit import pickle import requests import pytesseract import urllib.request from PIL import Image from bs4 import BeautifulSoup from config import URL,HEADER def connect(): if not os.path.isdir('.temp'): os.mkdir('.temp') with requests.Session() as request: ...
the-stack_106_17335
# Copyright 2020 The HuggingFace Team. 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 applicabl...