filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_0_7286 | from opytimizer.optimizers.science import SA
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
params = {
'T': 100,
'beta': 0.999
}
# Creates a SA optimizer
o = SA(params=params)
|
the-stack_0_7288 | #!/usr/bin/env python3
import unittest
import os
from getJenkinsVersion import get_latest_version, get_jenkins_version
USERNAME = os.environ.get('MAVEN_REPOSITORY_USERNAME', '')
PASSWORD = os.environ.get('MAVEN_REPOSITORY_PASSWORD', '')
# Test that GetJenkinsVersion returns the correct value
class TestGetJenkinsVe... |
the-stack_0_7290 | """Script to run stacking scripts on the DESY cluster.
Through use of argparse, a given configuration for the code can be selected.
This can be given from the command line, in the form:
python RunCluster.py -c Desired_Configuration_Name -n Number_Of_Tasks -s
Each available configuration must be listed in "config.ini... |
the-stack_0_7294 | """
File: sillystream/examples/daemon.py
Author: John Andersen
Description: A process that forks off and redirects stdout to sillystream server
To run:
python examples/daemon.py
python sillystream/__main__.py client
"""
import os
import sys
import time
import sillystream
# Send stdout to sillystream
STREAM = True
# S... |
the-stack_0_7295 | import ctypes
import numpy as np
import os
import subprocess
import tempfile
import tvm
from tvm import relay, get_global_func, target, register_func
from tvm.relay.expr import Expr, Function, Let, GlobalVar
from tvm.relay.adt import Constructor
from tvm.relay.expr_functor import ExprFunctor, ExprVisitor
from tvm.relay... |
the-stack_0_7297 | import pandas as pd
from pyecharts.components import Table
from pyecharts.options import ComponentTitleOpts
__all__ = ['statistics']
def statistics(model, jupyter=True, path='Model Summary.html', title="Model Summary", subtitle=""):
t = pd.DataFrame([[i.name, i.__class__.__name__, i.trainable, i.dtype, i.input_sh... |
the-stack_0_7298 | # This scripts demonstrates how to use mitmproxy's filter pattern in inline scripts.
# Usage: mitmdump -s "filt.py FILTER"
import sys
from mitmproxy import filt
def start(context):
if len(sys.argv) != 2:
raise ValueError("Usage: -s 'filt.py FILTER'")
context.filter = filt.parse(sys.argv[1])
def resp... |
the-stack_0_7301 | # encoding: utf-8
# cython: profile=False
# cython: embedsignature=True
"""
Implementation of DirichletDistribution.
The Dirichlet distribution makes use of path counts from a DFA. Consider
two representations of the DFA for the golden mean process.
0 1
0 0 1
1 0 -1
and
0 1
0 0 1
1 0... |
the-stack_0_7303 | from collections import OrderedDict
from functools import partial
from matplotlib.figure import Figure
from PyQt5 import QtWidgets, QtCore, QtGui
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from .model import AxesSet
from .widgets import *
class AxPositioningEditor(QtWidgets.QWi... |
the-stack_0_7304 | import os
from configparser import ConfigParser
from nipype.utils import config as nuc
from pkg_resources import resource_filename
def get_fitlins_config():
"""Construct Nipype configuration object with precedence:
- Local config (``./nipype.cfg``)
- Global config (``$HOME/.nipype/nipype.cfg`` or ``$NIPY... |
the-stack_0_7306 | # 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 ... |
the-stack_0_7308 | import inspect
def get_classname(o):
""" Returns the classname of an object r a class
:param o:
:return:
"""
if inspect.isclass(o):
target = o
elif callable(o):
target = o
else:
target = o.__class__
try:
return target.__qualname__
except AttributeEr... |
the-stack_0_7310 | import os
from conan.tools.build import build_jobs
from conan.tools.files.files import load_toolchain_args
from conan.tools.microsoft.subsystems import subsystem_path, deduce_subsystem
from conans.client.build import join_arguments
class Autotools(object):
def __init__(self, conanfile, namespace=None):
... |
the-stack_0_7311 | # Copyright 2015 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 required by applica... |
the-stack_0_7313 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.clock import Clock
from kivy.core.window import Window
from random import randint, choice
from math import radians, pi, sin, cos
import kivent_core
import kivent_cymunk
from kivent_core.gameworld import GameWorld
from kivent_core.managers.resource_ma... |
the-stack_0_7314 | def save(file, conf):
with open(file, 'w') as configfile:
conf.write(configfile)
def getOpts():
import configparser
import copy
import os
config = configparser.ConfigParser()
file = os.path.abspath(os.path.join('.', 'config.ini'))
DEFAULT_OPTIONS = {
'DEFAULT'... |
the-stack_0_7315 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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_0_7320 | # Create a list of strings: mutants
mutants = ['charles xavier',
'bobby drake',
'kurt wagner',
'max eisenhardt',
'kitty pryde']
aliases= ['prof x', 'iceman', 'nightcrawler', 'magneto', 'shadowcat']
powers = ['telepathy',
'thermokinesis',
'teleportation',
'magnetokines... |
the-stack_0_7322 | import sys
from typing import Iterable, Optional
import numpy as np
import tensorflow as tf
def _as_tensor(x):
if isinstance(x, np.ndarray):
x = tf.convert_to_tensor(x)
return x
def _build_train_step(model, data, jit_compile: bool):
data = tf.nest.map_structure(_as_tensor, data)
@tf.functi... |
the-stack_0_7323 | # If executes from local python Kernel
import sys
sys.path.append('./python_env/lib/python3.6/site-packages')
# Import libraries for general use
from unidecode import unidecode # Library to parse format
from bs4 import BeautifulSoup # Library to scripting in HTML
import numpy # Library for math function
import request... |
the-stack_0_7325 | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import os
import itertools
import pandas as pd
import unittest
from coremltools._deps import HAS_SKLEARN... |
the-stack_0_7326 | from os import path
from setuptools import setup, find_packages
import sys
import versioneer
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
min_version = (3, 6)
if sys.version_info < min_version:
... |
the-stack_0_7328 | """
Modified from https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
Edits:
ResNet:
- Changed input layer from 3 channel -> 1 channel (depth images)
- Divided inplanes, planes, and width_per_group by 4
BasicBlock:
- Commented out ValueError triggered by base_width ... |
the-stack_0_7329 | from hpc.autoscale.ccbindings.mock import MockClusterBinding
from hpc.autoscale.job.job import Job
from hpc.autoscale.job.schedulernode import SchedulerNode
from hpc.autoscale.node.nodemanager import new_node_manager
def setup_module() -> None:
SchedulerNode.ignore_hostnames = True
def test_placement_group() ->... |
the-stack_0_7330 | """
Copyright (C) 2021 University of Luxembourg
Developed by Dr. Joshua Heneage Dawes.
Module containing classes for construction of iCFTL specifications.
Specifications are constructed hierarchically, as chains of objects.
The root object is always a Specification instance. This can contain configuration informat... |
the-stack_0_7331 | # -*- coding: utf-8 -*-
from .fixtures import fixture_data, Amount, Asset, Price
import unittest
class Testcases(unittest.TestCase):
def setUp(self):
fixture_data()
def test_init(self):
# self.assertEqual(1, 1)
Price("0.315 USD/GPH")
Price(1.0, "USD/GOLD")
Price(0.315... |
the-stack_0_7333 | import torch
import numpy as np
from baseline.utils import lookup_sentence, get_version
from torch.autograd import Variable
import torch.autograd
import torch.nn as nn
import torch.nn.functional
import math
import copy
PYT_MAJOR_VERSION = get_version(torch)
def sequence_mask(lengths):
lens = lengths.cpu()
ma... |
the-stack_0_7334 |
import sys, os
sys.path.append(os.path.join(os.path.expanduser("~"), "chipfish"))
import app as chipfish
from glbase_wrapper import location, glload, genelist
draw = 'pdf'
c = chipfish.app()
c.startup(os.path.expanduser("../trk_TEs.txt"))
#annot = glload(os.path.expanduser('~/hg38/hg38_ensembl_v95_enst.glb'))
#ann... |
the-stack_0_7336 | # -*- coding: utf-8 -*-
"""
Capacity scaling minimum cost flow algorithm.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
__all__ = ['capacity_scaling']
from itertools import chain
from math import log
imp... |
the-stack_0_7337 | # -*- coding: utf-8 -*-
from nose.plugins.attrib import attr
from unittest import TestCase
import os
class BookTestCase(TestCase):
@attr("skip")
def test_scaffold(self):
assert False
# create temp directory
directory = "../var/tests/book"
if not os.path.exists(directory):
... |
the-stack_0_7338 | import numpy as np
def levenshtein_distance(string1, string2):
m, n = len(string1), len(string2)
matrix = np.zeros((m + 1, n + 1), dtype=np.int32)
# source prefixes can be transformed into empty string by
# dropping all characters
for i in range(m + 1):
matrix[i, 0] = i
# target pref... |
the-stack_0_7340 | # *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions... |
the-stack_0_7341 | from typing import List, Optional, Tuple
import torch
import torch.nn as nn
from kornia.utils.helpers import _torch_svd_cast
__all__ = ["zca_mean", "zca_whiten", "linear_transform", "ZCAWhitening"]
class ZCAWhitening(nn.Module):
r"""Compute the ZCA whitening matrix transform and the mean vector and applies the... |
the-stack_0_7342 | import collections
import claripy
class SimVariable(object):
__slots__ = ['ident', 'name', 'region', 'category']
def __init__(self, ident=None, name=None, region=None, category=None):
"""
:param ident: A unique identifier provided by user or the program. Usually a string.
:param str n... |
the-stack_0_7343 | """Definitions for command-line (Click) commands for invoking Annif
operations and printing the results to console."""
import collections
import os.path
import re
import sys
import click
import click_log
from flask import current_app
from flask.cli import FlaskGroup, ScriptInfo
import annif
import annif.corpus
import... |
the-stack_0_7345 | import os
from setup import basedir
class BaseConfig(object):
SECRET_KEY = "SO_SECURE"
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
# SQLALCHEMY_DATABASE_URI = "postgresql://localhost/Cathal"
MONGODB_URI = os.environ['MONGODB_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True
... |
the-stack_0_7346 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import cslib
def get_drive_mapped_path_dict():
def get_mapped_path_for_drive(drive):
# use window API (WNetGetConnectionW)
try:
import ctypes
from ctypes import wintypes
mpr = ctypes.WinDLL('mpr')
... |
the-stack_0_7347 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import collections
import errno
import os
import sys
import unittest
try:
import fcntl
except ImportError: # pragma: no cover
# Doesn... |
the-stack_0_7348 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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... |
the-stack_0_7349 | #!/usr/bin/python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
the-stack_0_7350 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# IMPORTS
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import modules.globals as sg
# CLASS DEFINITION
class MailHelper:
# Constructor
def __init__(self):
self.load_conf()
self.smtp = None
... |
the-stack_0_7352 | import urllib.parse
from django.contrib import auth
from django.db import close_old_connections
from channels.middleware import BaseMiddleware
import rest_framework_jwt.serializers
import rest_framework.exceptions
import jwt.exceptions
import backend.auth
class TokenMiddleware(object):
"""
Middleware that au... |
the-stack_0_7353 | """Commands the vehicle simulator to drive autonomously based on a given keras model.
Usage:
Use `model.h5` to drive in autonomous mode
`python drive.py model.h5`
Or, use `model.h5` to drive in autonomous mode, and save dashcam photos of the run to `./run1/`
`python drive.py model.h... |
the-stack_0_7354 | from ebaysdk.finding import Connection
from ebaysdk.exception import ConnectionError
import time
import psycopg2
import re
from gen_utils import database_connection, get_api_key, get_search_words, get_test_search_words, get_trace_and_log
class SearchRequest(object):
def __init__(self, api_key, keyword):
se... |
the-stack_0_7356 | """
Classes for curves
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 29.02.2016
"""
__author__ = 'martinez'
import vtk
import math
import numpy as np
from pyseg.globals.utils import angle_2vec_3D, closest_points
###### Global variables
PI_2 = .5 * np.pi
MAX_PER_ANG = .25 * np.pi... |
the-stack_0_7358 | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
import os
import platform
import re
import time
from sys import version_info
from logg... |
the-stack_0_7360 | # guac.py
#
# plays Tic Tac Toe
import json
import time
import arena
import re
HOST = "arena-west1.conix.io"
TOPIC = "realm/s/guac/"
REALM = "realm"
SCENE = "guac"
# Globals (yes, Sharon)
cubes = {} # dict of cube objects to be indexed by tuple (x,y)
# grid elements can be:
# -1: unassigned
# 0: red
# 1: blue
gri... |
the-stack_0_7361 | from django import forms
from django.utils.translation import ugettext_lazy as _
from fobi.base import BaseFormFieldPluginForm, get_theme
from pldp.forms import SURVEY_MICROCLIMATE_CHOICES
theme = get_theme(request=None, as_instance=True)
class MicroclimateForm(forms.Form, BaseFormFieldPluginForm):
"""Microcli... |
the-stack_0_7363 | #!-*- coding:utf-8 -*-
#!/usr/bin/env python
#---------------------------------------------------
#掲示板を表示
#copyright 2010-2012 ABARS all rights reserved.
#---------------------------------------------------
import cgi
import os
import sys
import re
import datetime
import random
import logging
import urllib
from goog... |
the-stack_0_7366 | from __future__ import absolute_import
import os
import sys
import weakref
from pyramid.httpexceptions import HTTPException
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.utils import capture_internal_exceptions, event_from_exception
from sentry_sdk._compat import reraise
from sentry_sdk.i... |
the-stack_0_7367 | """
Hexpatch
========
Patch a binary file from a simple description, using non-overlapping longest-match context matches.
Useful for instruction-patching executables, if codegen has not changed too much, even different versions will match.
Patch file format
-----------------
- Line-based text file
- comments lines st... |
the-stack_0_7368 | import os
import logging
import multiprocessing as mp
# from hexrd.utils.decorators import memoized
from hexrd import imageseries
from .config import Config
from .instrument import Instrument
from .findorientations import FindOrientationsConfig
from .fitgrains import FitGrainsConfig
from .material import MaterialConf... |
the-stack_0_7369 | import sys
sys.path.append(".")
from query_representation.query import *
from evaluation.eval_fns import *
from cardinality_estimation.featurizer import *
from cardinality_estimation.algs import *
from cardinality_estimation.fcnn import FCNN
from cardinality_estimation.mscn import MSCN
import glob
import argparse
impo... |
the-stack_0_7372 | #!/usr/bin/env python
import json
import yaml
import urllib
import os
import sys
from jsonref import JsonRef # type: ignore
import click
from openapi2jsonschema.log import info, debug, error
from openapi2jsonschema.util import (
additional_properties,
replace_int_or_string,
allow_null_optional_fields,
... |
the-stack_0_7373 | from typing import Text, List, Tuple
from rasa.core.domain import Domain
from rasa.core.training.story_conflict import (
StoryConflict,
find_story_conflicts,
_get_previous_event,
)
from rasa.core.training.generator import TrainingDataGenerator, TrackerWithCachedStates
from rasa.validator import Validator
f... |
the-stack_0_7374 | import logging
from collections import namedtuple, defaultdict
from enum import Enum
from itertools import product
from gym import Env
import gym
from gym.utils import seeding
import numpy as np
class Action(Enum):
NONE = 0
NORTH = 1
SOUTH = 2
WEST = 3
EAST = 4
LOAD = 5
class Player:
def... |
the-stack_0_7376 | # -*- coding: utf-8 -*-
from PySide6.QtWidgets import (
QApplication)
from PySide6.QtGui import (
QFontMetrics,
QTextOption)
from PySide6.QtCore import (
QEvent)
from .textline import SourceTextLineBase
from .textviewer import TextViewer
__all__ = ["SourceViewer"]
class SourceTextLine(SourceTextLi... |
the-stack_0_7379 | from InitProb import *
from collections import defaultdict
PNFile = "lsup"
OVERRIDE = 1
vertices = [[1, 1], [0, 3], [-1, 1], [-1, -1], [1, -1], [0.5, 0], [0, 0.75], [-0.5, 0], [0, 1]]
edgelists = [[0,1,2,3,4], [5,6,7,8]]
trpl = [[1, 1], [0, 3], [-1, 1]]
c = .1
box = [np.array([ 0.08*c, 0.08*c]),\
np.arr... |
the-stack_0_7380 | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# flake8: noqa
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/maste... |
the-stack_0_7381 | # -*- coding: utf-8 -*-
u"""Simplify rendering jinja2
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkinspect
from pykern import pkio
from pykern... |
the-stack_0_7382 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Libraries
import sys
import time
import logging
import platform
import os
import random
# Modules
import core.log
from core.data.wordlist import *
from core.data.crossword import *
from core.data.constants import *
from core.helpers.parse import *
from core.implements.ba... |
the-stack_0_7383 | """Test suite main conftest."""
import transaction
import pytest
from mock import Mock
from pyramid.decorator import reify
from pyramid.request import Request
from pyramid import testing
from zope.sqlalchemy import register
import pyramid_basemodel
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_... |
the-stack_0_7384 | import os
from pypaper import latex_tools as lt
test_dir = os.path.dirname(__file__)
def test_compile_bibtex():
ffp = test_dir + "/test_data_files/sample.bib"
citations = ["Safak:1992ub", "Vesic:1975"]
not_cited = ["Rodriguez:2000sr"]
bibtex_str = lt.compile_bibtex(citations, ffp)
print(bibtex_s... |
the-stack_0_7385 | # coding=utf-8
# Kevin Manfredy Axpuac Juárez - 15006597
# Miguel Angel Lemus Morales - 14003328
# Archivo Principal
from help import Help
from instructions import Inst
from playerVsPlayer import PlayerVsPlayer
from playerVsMachine import PlayerVsMachine
from machineVsMachine import MachineVsMachine
# menu... |
the-stack_0_7386 | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import timeit
class AlexNet(nn.Module):
def __init__(self, num_classes=1000):
super(AlexNet, self).__init__()
self.features = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=11, stride=4, padding=2),
... |
the-stack_0_7388 | from tabulate import tabulate
import requests
import argparse
import pprint
import json
import os
class EnvDefault(argparse.Action):
def __init__(self, envvar, required=True, default=None, **kwargs):
if not default and envvar:
if envvar in os.environ:
default = os.environ[envvar... |
the-stack_0_7390 | # SPDX-FileCopyrightText: Copyright 2022, Siavash Ameli <sameli@berkeley.edu>
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileType: SOURCE
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the license found in the LICENSE.txt file in the root directory
# of this source ... |
the-stack_0_7391 | # import the necessary packages
from PIL import Image, ImageOps
import pytesseract
from pytesseract import Output
import argparse
import cv2
import os
import json
def process_list(text: str) -> dict:
final = {}
items = text.split("\n")[4:][:-1]
for item in items:
if item == "":
continu... |
the-stack_0_7394 | # Copyright (c) 2019 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 app... |
the-stack_0_7396 | # Copyright 2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.
import argparse
def predict(start_date: str,
end_date: str,
path_to_ips_file: str,
output_file_path) -> None:
"""
Generates and saves a file with dai... |
the-stack_0_7398 | import json
import public_config as c
import logging
import argparse
import shutil
from tinydb import TinyDB, Query
from juriscraper.pacer import (
DocketReport,
PacerSession,
PossibleCaseNumberApi,
FreeOpinionReport,
)
logging.basicConfig(level=logging.DEBUG)
district_dict = {
"00": "med",
... |
the-stack_0_7402 | # Copyright 2020 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... |
the-stack_0_7403 | # Copyright 2018 The Cirq Developers
#
# 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 ... |
the-stack_0_7404 | _base_ = './faster_rcnn_r50_fpn_1x_coco.py'
model = dict(
backbone=dict(
norm_cfg=dict(requires_grad=False),
norm_eval=True,
style='caffe',
init_cfg=dict(
type='Pretrained',
checkpoint='open-mmlab://detectron2/resnet50_caffe')))
# use caffe img_norm
img_norm_c... |
the-stack_0_7405 | import platform
import os
import sys
# Resources shared by both the Network and Server files
BUFSIZE = 4096 * 2
PORT = 5555
INTERNAL_PORT = 4321
# The ipv4 address of the host machine. Run ipconfig from cmd to get this
HOST = "127.0.0.1"
if platform.system() == 'Darwin':
LOCAL = "127.0.0.1" #"192.168.1.154"
else:
... |
the-stack_0_7406 | """
TODO: ADD FEATURE TO ENABLE USE OF UNBOUNDED VARIABLES
Note: This does not work with the current version of PLEpy, to be fixed
in future versions
Uses a calculated "cross-talk" matrix (converts 3D counts to 2D
activity for each 3D and 2D shell) to fit first-order rate coefficients
and initial activity in 3D shells... |
the-stack_0_7410 | # Pelenet modules
from .anisotropic import AnisotropicExperiment
from ..network import ReservoirNetwork
from ._abstract import Experiment
"""
@desc: Class for running an experiment, usually contains performing
several networks (e.g. for training and testing)
"""
class AnisotropicReadoutExperiment(AnisotropicExp... |
the-stack_0_7413 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
the-stack_0_7417 | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
# from .utils import load_state_dict_from_url
from ib_layers import *
# __all__ = ['ResNet', 'resnet18', 'resnet34', '... |
the-stack_0_7418 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
import math
from dataloader.pretrained_weights.pretrain_zoo import PretrainModelZoo
"""
This is your result for task 1:
mAP: 0.7066194189913816
ap of each class:
plane:0.890548001039... |
the-stack_0_7419 | # 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... |
the-stack_0_7420 | from openshift import Openshift
from command import Command
import re
import requests
import time
class NodeJSApp(object):
nodesj_app_image = "quay.io/pmacik/nodejs-rest-http-crud"
api_end_point = 'http://{route_url}/api/status/dbNameCM'
openshift = Openshift()
pod_name_pattern = "{name}.*$(?<!-buil... |
the-stack_0_7421 | import logging
import torch
import torch.nn.functional as F
from torch import nn
from predict_pv_yield.models.base_model import BaseModel
logging.basicConfig()
_LOG = logging.getLogger("predict_pv_yield")
class Model(BaseModel):
name = "conv3d_sat_nwp"
def __init__(
self,
include_pv_yield... |
the-stack_0_7422 | from ffai.web.api import *
import numpy as np
import time
class MyRandomBot(Agent):
def __init__(self, name):
super().__init__(name)
self.my_team = None
self.actions_taken = 0
def new_game(self, game, team):
self.my_team = team
self.actions_taken = 0
def act(self... |
the-stack_0_7424 | # -*- encoding: utf-8 -*-
import builtins
import unittest
import unittest.mock
import pytest
from common.utils.backend import Backend
class BackendStub(Backend):
def __init__(self):
self.__class__ = Backend
def setup_load_model_mocks(openMock, pickleLoadMock, seed, idx, budget):
model_path = "/run... |
the-stack_0_7425 | import os
import pypandoc
import json
import yaml
import re
import datetime
from .config import Config
from pypandoc.pandoc_download import download_pandoc
from pylatex import Document, Description
from pylatex.section import Chapter
from pylatex.utils import *
class Cover:
artist = None
title = None
year ... |
the-stack_0_7427 | # preprocessing.py
"""
parses MIMIC-CXR radiology reports from data/mimic-cxr-reports/ into data/train.csv and data/test.csv
train.csv contains two columns with each column wrapped in double quotes; the first column contains
the input text (radiology examination, technique, comparison, and findings) while the second
c... |
the-stack_0_7428 | import threading
import time
from datetime import datetime
import schedule
import atexit
import SocketServer
import BioControle
import syslog
# ------------------------------------------------------------------------
def display_jobs():
print('------------------------------------------------------------------')
... |
the-stack_0_7430 | # Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from collections import Counter
import os.path
import shutil
import tempfile
import queue
import nose.tools
import numpy as np
import PIL.Image
from . import create_db
from digits import test_utils
test_utils.skipIfNotFramework('none')
class Ba... |
the-stack_0_7433 | # -*- coding: utf-8 -*-
"""
Created on Mon May 31 18:14:32 2021
@author: ilayda
"""
#1.kutuphaneler
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#2.veri onisleme
#2.1.veri yukleme
veriler = pd.read_csv('odev_tenis.txt.crdownload')
#pd.read_csv("veriler.csv")
#test
print(veriler)
'''
#enco... |
the-stack_0_7434 | # -----------------------------------------------------------------------------
#
# Copyright (C) The BioDynaMo Project.
# 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.
#
# See the LICENSE file distributed with... |
the-stack_0_7436 | """
Copyright (C) 2019 Authors of gHHC
This file is part of "hyperbolic_hierarchical_clustering"
http://github.com/nmonath/hyperbolic_hierarchical_clustering
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 Lice... |
the-stack_0_7437 | """Limited version of os module: only keep what is more or less relevant in a
browser context
"""
import sys
error = OSError
name = 'posix'
linesep = '\n'
from posix import *
import posixpath as path
sys.modules['os.path'] = path
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, alts... |
the-stack_0_7439 | from datetime import date
pessoas = {}
listaDePessoas = []
hoje = date.today().year
somaIdade = mediaIdade = 0
while True:
pessoas.clear()
pessoas['nome'] = str(input('Nome: ')).strip()
while True:
pessoas['sexo'] = str(input('Sexo [M/F]: ')).upper()[0]
if pessoas['sexo'] in 'MF':
... |
the-stack_0_7440 | import logging
from van.adam import transactions as t
from van.adam.inventory_methods.output import calculate_output
from van.adam.inventory_methods.sell_outs import take_all, take_less
from van.adam.transactions import is_taxable
def calc_profit(sell: tuple) -> tuple:
"""
Calculates the buy price, sell pric... |
the-stack_0_7441 | """Setup for TcEx Module."""
# standard library
import os
# third-party
from setuptools import find_packages, setup
metadata = {}
metadata_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tcex', '__metadata__.py')
with open(
metadata_file,
encoding='utf-8',
) as f:
exec(f.read(), metadata)... |
the-stack_0_7442 | import numpy as np
import tensorflow as tf
from tensorflow.contrib.framework.python.ops import arg_scope
import data_iter
import nn_extra_gauss
import nn_extra_nvp
from config_rnn import defaults
batch_size = 32
sample_batch_size = 1
n_samples = 4
rng = np.random.RandomState(42)
rng_test = np.random.RandomState(31707... |
the-stack_0_7443 | # -*- coding = utf-8 -*-
# /usr/bin/env python
# @Time : 20-11-18 下午8:25
# @File : test.py
# @Software: PyCharm
# try/except/else while/else break continue
# while True:
# reply = input('Enter txt:')
# if reply == 'stop':
# break
# try:
# num = int(reply)
# except:
# ... |
the-stack_0_7446 | """empty message
Revision ID: d68e85682c2c
Revises: fed65154fba4
Create Date: 2018-09-27 11:27:26.206337
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd68e85682c2c'
down_revision = 'fed65154fba4'
branch_labels = None
depends_on = None
def upgrade():
# ... |
the-stack_0_7451 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import textwrap
import numpy as np
import pytest
from astropy.io import fits
from astropy.nddata.nduncertainty import (
StdDevUncertainty, MissingDataAssociationException, VarianceUncertainty,
InverseVariance)
from astropy import units as u
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.