text stringlengths 2 999k |
|---|
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os, re, xml.dom.minidom
#errorXMLInfo = [['zh_TW', '3', 's0101m.mul1.xml'],
# ['zh_TW', '3', 's0102m.mul2.xml'],
# ['zh_TW', '5', 's0102m.mul6.xml'],
# ['zh_TW', '3', 's0102m.mul8.xml'],
# ['zh_TW', '3', 's... |
from cgitb import html
from datetime import date
import json
from multiprocessing import Process
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
# Create your views here.
from django.db.models import Q
from django.... |
import glob
import os, os.path as osp
import pandas as pd
def enumerate_slices(df):
df = df.sort_values('ImagePositionPatient_2')
df['SliceIndex'] = list(range(len(df)))
return df
PE_PROBA_DIR = '../../data/train-pe-probas/'
HEART_PROBA_DIR = '../../data/train-heart-probas/'
pe_probas = pd.concat([pd.... |
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from appconf import AppConf
class ServerStatusAppConf(AppConf):
SERVICE_UNAVAILABLE = _("unavailable")
SERVICE_AVAILABLE = _("ok")
DISPLAY_EXCEPTIONS = True
PLUGIN_MODULE_NAME = 'status_report'
DEFAULT_GROUP... |
import os
import pickle
import glob
from itertools import chain
from fontTools.ttLib import TTCollection, TTFont
from fontTools.unicode import Unicode
from .utils import md5, load_chars
def get_font_paths(fonts_dir):
"""
Load font path recursively from a folder
:param fonts_dir: folder con... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
import unittest
import nose
import numpy as np
from numpy.testing import assert_equal
from pims import FramesSequence, Frame
from pims.process import crop
class RandomReader(FramesSequen... |
from __future__ import absolute_import
import logging
from django.core.mail import mail_admins
# Get an instance of a logger
logger = logging.getLogger(__name__)
def send_contact_me_notification(instance):
'''
Use SNS to notify Staff of person trying to contact
us via the Landing Page
:param instan... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def __init__(self, head: ListNode):
"""
@param head The linked list's head.
Note that the head is guaranteed to be not null, so it contains ... |
import unittest
'''This test file is intended to test the database and the gui to a good extent.
This should:
- create random entries with somewhat random timestamps.
- Save entries to a text file for comparison.
- Enter each entry into the database
- search for some of the random terms.
- Remove database af... |
import pytest
import torch as th
from syft.frameworks.torch.mpc.fss import DPF, DIF, n
@pytest.mark.parametrize("op", ["eq", "le"])
def test_fss_class(op):
class_ = {"eq": DPF, "le": DIF}[op]
th_op = {"eq": th.eq, "le": th.le}[op]
gather_op = {"eq": "__add__", "le": "__xor__"}[op]
# single value
... |
from garage.np.algos import CMAES
from garage.np.baselines import LinearFeatureBaseline
from garage.tf.envs import TfEnv
from garage.tf.experiment import LocalTFRunner
from garage.tf.policies import CategoricalMLPPolicy
from garage.tf.samplers import OnPolicyVectorizedSampler
from tests.fixtures import TfGraphTestCase
... |
import paho.mqtt.client as mqtt
import base64
import struct
import json
import pymongo
from datetime import datetime
from datetime import timezone
import alerts
import pytz
from tzlocal import get_localzone
import nacl.secret
import nacl.utils
br = pytz.timezone('Brazil/East')
myclient = pymongo.MongoClient("mongodb:... |
class Busca:
def __init__(self, sequencia, elemento):
self.sequencia = sequencia
self.elemento = elemento
def busca_indice_elemento(self):
"""
Retorna o indíce do elemento caso o mesmo se encontre na lista,
caso o elemento não seja encontrado, o retorno será -1
... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Dtbuild2(Package):
"""Simple package which acts as a build dependency"""
homepage = "... |
from django.contrib import admin
# Register your models here.
from django.contrib import messages
from .models import *
# Register your models here.
admin.site.register(AuthUser)
|
#!/usr/bin/env python
from distutils.core import setup, Extension
import sys
if sys.version_info >= (3,):
BOOST_LIB = "boost_python3"
else:
BOOST_LIB = "boost_python"
module_RF24Mesh = Extension(
"RF24Mesh",
libraries=["rf24mesh", "rf24network", BOOST_LIB],
sources=["pyRF24Mesh.cpp"],
)
setup(na... |
from pyBN.inference.marginal_exact.exact_bp import *
from pyBN.inference.marginal_exact.ve_marginal import * |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corporation
# Copyright 2015 Lenovo
#
# 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/LI... |
class Node:
def __init__(self, value, next_item=None):
self.value = value
self.next_item = next_item
class Queue:
def __init__(self):
self.size = 0
self.head = None
self.last = None
def put(self, x):
node = Node(value=x)
if self.size == 0:
... |
# Copyright 2018 Stanford University
#
# 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 writi... |
#!/usr/bin/env python -tt
#
# Copyright (c) 2011 Intel, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; version 2 of the License
#
# This program is distributed in the hope that it will b... |
# -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2017 McAfee Inc. - All Rights Reserved.
################################################################################
from dxlclient import _BaseObject
class DxlUtils(object):
"""
... |
# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# 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 of source code must retain the above copyright... |
import cv2
import math
import numpy as np
from hierarquia import HierarquiaDeQuadrilateros
def distance(x1, y1, x2, y2):
return math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
def recuperarCorPredominanteNaPosicao(linha, coluna, imagem, radius):
cor = np.array([0, 0, 0])
#~ # este ... |
# -*- coding: utf-8 -*-
from django.middleware.cache import UpdateCacheMiddleware, FetchFromCacheMiddleware
from django.core.cache import cache
from django.conf import settings
from django.utils.encoding import iri_to_uri
from django.utils.cache import get_max_age, patch_response_headers
from django.utils.translation i... |
import re
import falcon
import simplejson as json
import mysql.connector
import config
from datetime import datetime, timedelta, timezone
from core import utilities
from decimal import Decimal
import excelexporters.storesaving
class Reporting:
@staticmethod
def __init__():
""" Initializes Reporting"""... |
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import logging
import os
import setproctitle
import shutil
import sys
import socket
import subprocess
import tempfile
import time
import numpy as np
import pickle
import pytest
imp... |
#encoding: utf-8
import sales
|
from __future__ import division
from pydub import AudioSegment
from dejavu.decoder import path_to_songname
from dejavu import Dejavu
from dejavu.fingerprint import *
import traceback
import fnmatch
import os, re, ast
import subprocess
import random
import logging
def set_seed(seed=None):
"""
`seed` as None mea... |
import glob
def task_website():
pages = glob.glob("docs/*.rst")
return {
"file_dep": pages + ["conf.py", "index.rst"],
"actions": ["sphinx-build . .build"],
"verbosity": 2,
}
|
import pprint
class ApiResponse:
"""
Api Response
Wrapper around all responses from the API.
Examples:
literal blocks::
response = Orders().get_orders(CreatedAfter='TEST_CASE_200', MarketplaceIds=["ATVPDKIKX0DER"])
print(response.payload) # original response dat... |
from pathlib import Path
import os
import shutil
import subprocess
import traceback
import winreg
# Define to install process
DIST_DIR = Path("./duplicate_repo")
TARGET_DIR = Path(os.environ['APPDATA']) / "productivity-tools" / "duplicate-repo"
EXE_NAME = "duplicate_repo.exe"
USR_VAR_NAME = "DuplicateRepo"
def copy... |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
import numpy as np
def one_sided_ema(xolds, yolds, low=None, high=None, n=512, decay_steps=1.,
low_counts_threshold=1e-8):
"""From openai.baselines.common.plot_util.py
perform one-sided (causal) EMA (exponential moving average)
smoothing and resampling to an even grid with n points.
... |
import copy
import math
import re
from collections import defaultdict
from enum import Enum
from typing import DefaultDict, Iterable, List, Set
import numpy as np
from aoc import get_input_as, submit
inp = get_input_as(str, sep='\n\n')
class FlipVariant(Enum):
ORIGINAL = 0b0000
VERTICAL = 0b0100
H... |
import json
import requests
from odoo.addons.iap import charge
from odoo.http import Controller, request, route
from odoo.modules.module import get_module_resource
def get_keys():
try:
with open(get_module_resource('plant_identification_service', 'secret_keys.json'), 'rb') as keys_file:
keys ... |
#
# 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... |
import random
#Rock Paper Scissors. One round
rounds=int(input("How many games of Rock Paper and Scissors can you take?"))
#^^ It turns out int can't take a decimal so its just typing without any boxing
def getUserInputs():
return input("Type 0 for rock, 1 for paper, 2 for scissors:")
def runGame():
playe... |
__version__ = "2.11.0b"
|
from mayan.apps.testing.tests.base import BaseTestCase
from .mixins import AssetTestMixin
class AssetModelTestCase(
AssetTestMixin, BaseTestCase
):
def test_asset_get_absolute_url_method(self):
self._create_test_asset()
self.test_asset.get_absolute_url()
|
#salnum() function in Python programming language checks whether all the characters in a given string is alphanumeric or not.
filename = open("strings.txt", "r")
content = filename.readlines()
filename.close()
for line in content:
if(line.replace("\n", "").isalnum()):
print(line, "was ok.")
else:
... |
from collections import defaultdict, Counter
import numpy as np
from csv_detective.detection import detect_encoding, detect_separator, detect_headers, parse_table
from sklearn.base import BaseEstimator, TransformerMixin
class PredictCSVColumnInfoExtractor(BaseEstimator, TransformerMixin):
"""Extract the columns ... |
from datetime import datetime
def regularMonths(currMonth):
splitted = currMonth.split('-')
month = int(splitted[0])
year = int(splitted[1])
found = False
while not found:
month += 1
if month > 12:
month = 1
year += 1
aux = datetime(year, month, 1)
... |
# -*- coding: utf-8 -*-
# --------------------------------------
# @Time : 2021/10/30 下午12:54
# @Author : Oscar Chen
# @Email : 530824679@qq.com
# @File : train.py
# @Software: PyCharm
# Description : None
# --------------------------------------
from __future__ import absolute_import
from __future__ import di... |
from computer_players.base_computer_player import BaseComputerPlayer
from dominion_game_engine.hand import has_card_type, select_by_name
class StayAtHomeSon(BaseComputerPlayer):
def buy(self, supply, money, buys):
return self.buy_card(money, 'Cellar')
def play_action_cards(self, hand):
""" ""... |
from six.moves.urllib.parse import urlparse
from django.contrib.postgres.search import SearchVector
from django.core.paginator import InvalidPage, Paginator
from django.db.models import Q
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from prepaid_agreements.models import Prepa... |
# -*- coding: utf-8 -*-
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "Licens... |
# DADSA - Assignment 1
# Reece Benson
from classes import Player as Player
class Season():
_app = None
_j_data = None
_name = None
_players = { }
_rounds = { }
_rounds_raw = { }
_settings = { }
def __init__(self, _app, name, j_data):
# Set our application as a variable
... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
#
# 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
#... |
import pytest
from celery.result import EagerResult
from reddit.users.tasks import get_users_count
from reddit.users.tests.factories import UserFactory
@pytest.mark.django_db
def test_user_count(settings):
"""A basic test to execute the get_users_count Celery task."""
UserFactory.create_batch(3)
setting... |
# 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 numpy as np
from numba import jit
a2 = 0.2
a3 = 0.3
a4 = 0.6
a5 = 1.0
a6 = 0.875
b21 = 0.2
b31 = 3.0 / 40.0
b32 = 9.0 / 40.0
b41 = 0.3
b42 = -0.9
b43 = 1.2
b51 = -11.0 / 54.0
b52 = 2.5
b53 = -70.0 / 27.0
b54 = 35.0 / 27.0
b61 = 1631.0 / 55296.0
b62 = 175.0 / 512.0
b63 = 575.0 / 13824.0
b64 = 44275.0 / 110592.... |
import numpy as np
from numpy import dot, exp
from scipy.spatial.distance import cdist
class LSSVM:
'Class that implements the Least-Squares Support Vector Machine.'
def __init__(self, gamma=1, kernel='rbf', **kernel_params):
self.gamma = gamma
self.x = None
... |
# bamToGFF.py
# script to grab reads from a bam that align to a .gff file
import sys
import re
import ROSE_utils
from collections import defaultdict
import os
from string import join,upper,maketrans
# =====================================================================
# ====================MAPPING BAM READS ... |
import re
import random
import itertools
import math
from collections import defaultdict
from src.utilities import *
from src import channels, users, debuglog, errlog, plog
from src.functions import get_players, get_all_players, get_main_role, get_reveal_role, get_target
from src.decorators import command, event_liste... |
from modules.countdown.entities.E_InputVoice import E_InputVoice
from speech_recognition import UnknownValueError, RequestError
import speech_recognition as sr
class S_Listener:
def __init__(self,eInput):
self.eInput=eInput
def process(self):
m = sr.Microphone()
try:
... |
from api.models import OrganizationProfile, Team, Project, ProjectXForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from main.forms import QuickConverter
from odk_logger.models import XForm
from utils.logger_tools import publish_form
def _get_fi... |
def main():
populacao = int(input('População: '))
cidades = carrega_cidades()
print(f'CIDADES COM MAIS DE {populacao} HABITANTES:')
for dados in cidades:
if dados[-1] > populacao:
nome = dados[2]
ibge = dados[1]
uf = dados[0]
pop = dados[-1]
... |
"""
Determine what optional dependencies are needed.
"""
import sys
from os.path import dirname, exists, join
import pkg_resources
import yaml
from galaxy.containers import parse_containers_config
from galaxy.util import (
asbool,
etree,
parse_xml,
which,
)
from galaxy.util.properties import (
fi... |
import numpy as np
#from gifqa.util import log
from util import log
import os.path
import sys
import random
import h5py
import itertools
import re
import tqdm
import pandas as pd
import data_util
import hickle as hkl
import cPickle as pkl
from IPython import embed
__PATH__ = os.path.abspath(os.path.dirname(__file__... |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import six
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None, api_code=None):
self.reason = six.text_type(reason)
self.response = respon... |
class mystr():
def get_string(self):
self.s=input("Enter the string")
def pr_string(abc):
val=abc.s
print(val.upper())
p=mystr()
p.get_string()
p.pr_string()
|
# -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------------------------------... |
"""
Copyright (c) 2019 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 writin... |
# Copyright The PyTorch Lightning 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 law or agreed to i... |
from __future__ import print_function
import numpy as np
from six import next
from six.moves import xrange
def plot_polygon(ax, poly, facecolor='red', edgecolor='black', alpha=0.5):
""" Plot a single Polygon geometry """
from descartes.patch import PolygonPatch
a = np.asarray(poly.exterior)
# without... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
import sys
class LongestPath:
def solve (self, N, M, x, y, a, b):
ret = [a[0], b[0]]
return ret
def main():
N,M = map(int, input().split())
x = []
y = []
a = []
b = []
for i in range(N):
xt,yt = map(int,input().split())
x.append(xt)
y.append(yt)
... |
import sqlite3
SQL_CREATE_TABLE = """
CREATE TABLE IF NOT EXISTS astronauts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pesel INTEGER UNIQUE,
firstname TEXT,
lastname TEXT)"""
SQL_INSERT_TUPLE = 'INSERT INTO astronauts VALUES (NULL, ?, ?, ?)'
SQL_INSERT_DICT = 'INSERT INTO astronauts V... |
# Run this to load en_core_web_sm into your spacy module
# $ python -m spacy download en_core_web_sm
# Legend for token.dep_:
# CC coordinating conjunction
# CD cardinal digit
# DT determiner
# EX existential there (like: "there is" ... think of it like "there exists")
# FW foreign word
# IN preposition/subordinating ... |
from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
from botocore.exceptions import ClientError
import tests.backport_assert_raises
from nose.tools import assert_raises
import base64
import datetime
import ipaddress
import six
import boto
import boto3
from boto.ec... |
"""
eZmax API Definition (Full)
This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501
The version of the OpenAPI document: 1.1.7
Contact: support-api@ezmax.ca
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import eZmaxApi
from... |
# (C) Copyright 1996-2016 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... |
import logging
from openfunction.function_runtime import OpenFunctionRuntime
def dapr_output_middleware(context):
"""Flask middleware for output binding."""
def dapr_output_middleware(response):
if not context or not context.outputs or not context.is_runtime_knative():
return response
... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
"""TcEx JSON Update"""
# standard library
import os
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING: # pragma: no cover
from .tcex_json import TcexJson
class TcexJsonUpdate:
"""Update install.json file with current standards and schema."""
def __init__(self, tj: 'TcexJson') -> None: # pyli... |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
import pytest
from openpyexcel.xml.functions import tostring
from openpyexcel.tests.helper import compare_xml
from ..chartspace import PlotArea
from ..series import Series
@pytest.fixture
def ChartBase():
from .._chart import ChartBase... |
from tir import Webapp
import unittest
class GFEA069(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup("SIGAGFE", "29/12/2020", "T1", "D MG 01", "78")
inst.oHelper.Program("GFEA069")
def test_GFEA069_CT001(self):
... |
import os
import fcntl
import signal
import json
import numpy as np
CONF_PATH = '/data/ntune/'
CONF_LQR_FILE = '/data/ntune/lat_lqr.json'
ntunes = {}
def file_watch_handler(signum, frame):
global ntunes
for ntune in ntunes.values():
ntune.handle()
class nTune():
def __init__(self, CP=None, controller=None... |
# coding: utf-8
# In[1]:
#[GridSearch] AdaBoost Classification
import pandas as pd
import numpy as np
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
# read the training_data set
data_values = pd.read_csv("../../... |
# coding: utf-8
import logging
from flask import redirect, request
from pagseguro import PagSeguro
from quokka.core.templates import render_template
from .base import BaseProcessor
from ..models import Cart
logger = logging.getLogger()
class PagSeguroProcessor(BaseProcessor):
STATUS_MAP = {
"1": "checke... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator(apikey)
translator_instance = LanguageTranslatorV3(
version='201... |
import os
from pathlib import Path
from requests import HTTPError
import pytest
from github_stats_pages import stats_plots
tests_data_folder = Path('tests_data')
def test_load_data():
dict_df = stats_plots.load_data(tests_data_folder)
assert isinstance(dict_df, dict)
def test_user_readme(token=None):
... |
from django.conf.urls import url
from relais.views import registration
urlpatterns = [
url(r'^$', registration.online, {'func': registration.index}),
url(r'^category/$', registration.online, {'func': registration.category}),
url(r'^category/individual/$', registration.online, {'func': registration.form, ... |
import abc
import collections
import dataclasses
import logging
import os
import subprocess
import tempfile
import traceback
import typing
import version
import yaml
from github3.exceptions import (
ConnectionError,
NotFoundError,
)
import gci.componentmodel as cm
import ci.util
from ci.util import (
ex... |
n = int(input())
h = [list(map(int, input().split())) for _ in range(n)]
# dp[i][j]: i-1日目に1つの行動を取った際の最大幸福度
dp = [[0] * 3 for _ in range(n + 1)]
for i in range(1, n + 1):
for j in range(3):
for k in range(3):
# 2回連続は不可
if j == k:
continue
dp[i][k] = max(dp... |
# Copyright (c) 2020, Xilinx
# 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 of source code must retain the above copyright notice, this
# list of conditions and the follow... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
__all__ = ['Inception3', 'inception_v3']
model_urls = {
# Inception v3 ported from TensorFlow
'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth',
}
def in... |
'''
===============================================================================
-- Author: Hamid Doostmohammadi, Azadeh Nazemi
-- Create date: 05/11/2020
-- Description: This code is for detection of corners keypoints by Shi-Thomas method.
-- Status: In progress
====================================... |
"""
A module for shelling out.
Keep in mind that this module is insecure, in that it can give whomever has
access to the master root execution access to all salt minions.
"""
import base64
import fnmatch
import functools
import glob
import logging
import os
import re
import shutil
import subprocess
import sys
import ... |
class CastorExportClient(object):
pass
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Constants
# ---------
# Subplot types that are each individually positioned with a domain
#
# Each of these subplot types has a `domain` property with `x`/`y`
# properties.
# Note that this set does not contain `xaxis`/`yaxis` because t... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'empty_union_34333.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
ra... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""RDM record schemas."""
import time
from urllib import parse
... |
from .. import DataWrapper
from cogdl.data import Graph
class FullBatchNodeClfDataWrapper(DataWrapper):
def __init__(self, dataset):
super(FullBatchNodeClfDataWrapper, self).__init__(dataset)
self.dataset = dataset
def train_wrapper(self) -> Graph:
return self.dataset.data
def va... |
from tasks.utilities.runner import TaskRunner
# Run the background task...
TaskRunner().run_task()
|
import psycopg2
class Database():
def __init__(self):
self.params = {
"host": "localhost",
"database": "postgres",
"user": "postgres",
"password": "123456"
}
self.conn = None
self.cursor = None
self.open()
def open(self):... |
from contextlib import contextmanager
import os
import threading
import time
import pytest
from tests_python import debugger_unittest
from tests_python.debugger_unittest import get_free_port, overrides, IS_CPYTHON, IS_JYTHON, IS_IRONPYTHON, \
IS_PY3K
import sys
def get_java_location():
from java.lang impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.