text stringlengths 2 999k |
|---|
"""Parser and representation for BibTeX .bib databases.
This parser is derived directly from the WEB source code for BibTeX --
especially section "Reading the database file(s)" -- and hence
(barring bugs in translation) should be fully compatible with BibTeX's
own parser.
"""
__all__ = "Parser Entry FieldError resolv... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def create_user(self, email, name, pas... |
import logging
c_logger = logging.getLogger("client")
|
"""
xcvr_field.py
Classes for representing types of fields found in xcvr memory maps.
"""
import struct
class XcvrField(object):
"""
Base class for representing fields in xcvr memory maps.
Args:
name: string, denoting the name of the field. Must be unique for a particular XcvrMemMap.
... |
import os
from pathlib import Path
from quart import Quart, request, Response
from werkzeug.utils import secure_filename
UPLOAD_FOLDER = './files/'
ALLOWED_EXTENSIONS = {'tar', 'txt'}
app = Quart(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['ALLOWED_EXTENSIONS'] = ALLOWED_EXTENSIONS
app.config['M... |
#!/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2020-present Works Mobile Corp.
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 requir... |
https://www.youtube.com/watch?v=vXXapR_9KP4&t=531s
L = [1.5, "Python", False]
T = (1.2, "Java", True)
for i in range(len(L)):
if L[i]:
L[i] = L[i] + T[i]
else:
T[i] = L[i] + T[i]
print(L)
|
from time import sleep
def exibir_menu():
print('''\n\033[1m\033[33mEscolha uma opção:\033[0;0m
[1] Cadastrar um veículo
[2] Listar veículos cadastrados
[3] Procurar dados de um veículo
[4] Remover veículo cadastrado
[5] Finalizar programa
''')
veiculo = 0
veiculos = []
def cadastrar(vei... |
# ----------------------------------------------------------------------------
# Copyright 2016-2017 ARM 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: tests.montecarlo.test_simulation
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for the `trim.montecarlo.simulation` module.
"""
# Copyright 2019 Hendrix Demers
#
# Licensed under the Apache License, Version 2.0 (the "Li... |
from django.conf.urls import url
from views import *
urlpatterns = [
# LeisRef
url(r'^/?$', LeisRefListView.as_view(), name='list_legislation'),
url(r'^act-related/?$', LeisRefActListView.as_view(), name='act_related'),
url(r'^new/?$', ActCreateView.as_view(), name='create_legislation'),
url(r'^ed... |
#!/usr/bin/env python
# This Python file uses the following encoding: utf-8
# Copyright 2015 Tin Arm Engineering AB
# 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
#... |
# -*- coding: utf-8 -*-
"""
Provides links to different representations of annotations.
"""
from h._compat import urlparse, url_unquote
def pretty_link(url):
"""
Return a nicely formatted version of a URL.
This strips off 'visual noise' from the URL including common schemes
(HTTP, HTTPS), domain p... |
from __future__ import absolute_import
import itertools
from django.contrib import messages
from django.core.context_processors import csrf
from django.db import transaction
from django.http import HttpResponseRedirect
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf... |
from datetime import datetime,timedelta
import os
import tornado.ioloop
import tornado.web
from tornado.options import define,parse_command_line,options
from app import (
IndexHandler,
TindexHandler,
DbHandler,
DropHandler,
AddHandler,
SelectHandler
)
define('port',default=8081,type=int) #定义默认的启... |
'''
Created on 2013-2-1
@author: desperedo
miniPascal Compiler Code Generator
'''
import Bytecode
class InvokableStub(object):
def __init__(self, ID, Address, Function, ReturnMap):
self.ID = ID;
self.Address = Address;
self.Function = Function;
self.ReturnMap = ReturnMap;
class Generator(object):
def ... |
#!/usr/bin/env python3
import time
import urllib.parse
import threading
import argparse
import logging
import datetime
import timeit
import collections
import faulthandler
import signal
import copy
import requests
import flask
from flask import Flask
from flask import request
from flask import Response
from flask_co... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... |
__author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... |
# This file contains the class with which the user interacts.
# - It loads the scan file specified by the user, parse it.
# - Allow the user to define the reference frame of his scene.
# make a new list from the original for which we calculate all the coords
# in the unified reference frame defined by the user.... |
'''
Backend independent higher level interfaces, common exceptions.
'''
class JSONError(Exception):
'''
Base exception for all parsing errors.
'''
pass
class IncompleteJSONError(JSONError):
'''
Raised when the parser can't read expected data from a stream.
'''
pass
def parse(basic_e... |
from .plot_update_map import plotly_map_update_visualization |
import re
from utils import *
SEARCH_LIMIT = 10000
def get_gene(sdb, gene_id):
return sdb.genes.find_one({'gene_id': gene_id}, projection={'_id': False})
def get_gene_by_name(sdb, gene_name):
# try gene_name field first
gene = sdb.genes.find_one({'gene_name': gene_name}, projection={'_id': False})
i... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
#!/usr/bin/env python3
"""Areas of pipe, ducts or hydraulic diameters."""
import csv
import math
import os
from calculations.unit_convertion import unit_convertion
script_dir = os.path.dirname(__file__)
rel_path = "../csv_data/pipes/"
def circular_pipe(diameter, unit):
"""Circular area in [m2].
:param diame... |
"""
Sends updates to a Discord bot.
Usage:
>>> from tqdm.contrib.discord import tqdm, trange
>>> for i in tqdm(iterable, token='{token}', channel_id='{channel_id}'):
... ...

"""
from __future__ import absolute_import
import logg... |
"""
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
from aws_cdk import (
core,
aws_iam as iam
)
class CoreStackProperties(core.StackProps):
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class ZhimaMerchantContractCommonQueryModel(object):
def __init__(self):
self._contract_no = None
self._sign_principal_id = None
self._sign_principal_type = None
@property
... |
"""
Original source: https://github.com/dmyersturnbull/tyrannosaurus
Copyright 2020–2021 Douglas Myers-Turnbull
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... |
import re
import telegram as tg, config as cfg
regex_admin_mention = r'(.+: `.*\b(' + cfg.triggers + r')\b)'
re_admin_mention = re.compile(regex_admin_mention, re.IGNORECASE | re.MULTILINE)
re_message_prefix = re.compile('([0-9]{2}:[0-9]{2} )?(\[Dsc] )?(.+?) > ', re.MULTILINE)
re_color_formatting = re.compile('[\x1B... |
CSRF_ENABLED = True
SECRET_KEY = 'xxxx'
COSMOSDB_HOST = 'https://xxx:443/'
COSMOSDB_KEY = 'xxxx'
COSMOSDB_DATABASE = 'service catalogue'
COSMOSDB_COLLECTION_VM = 'virtualmachines'
COSMOSDB_COLLECTION_VMID = 'vmid'
COSMOSDB_COLLECTION_IP = 'ipaddresses'
COSMOSDB_COLLECTION_FW = 'firewallrules'
COSMOSDB_COLLECTION_FWID... |
#!/usr/bin/env python
# Copyright (c) 2014, Paessler AG <support@paessler.com>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright not... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'yangyang'
'''
天勤主程序启动外部python进程的入口:
run.py --source_file=C:\\tqsdk\\xx\\a.py --instance_id=ABCD --instance_file=c:\\tmp\\ABCD.desc
'''
import os
import sys
import json
import argparse
import logging
import importlib
import datetime
import tqsdk
from tqsd... |
from builtins import range
from builtins import object
import os
import json
from collections import OrderedDict
import scipy.sparse as sp
from .inferencer import IForest, LeafComputer, Blender, IForestBlender
class Inferencer(object):
"""
Loads up a model for inferencing
"""
def __init... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("EventFilter.CSCRawToDigi.cscFrontierCablingUnpck_cff")
process.load("EventFilter.CSCRawToDigi.cscUnpacker_cfi")
process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
process.load("Geometry.CSCGeometry.cscGeometry_cfi")
... |
""" create thread demo """
import threading
import time
def do_it(sleep_time: int) -> None:
""" do it function """
time.sleep(sleep_time)
print("".join([
"did it: thread id -> ",
str(threading.get_ident()),
", thread name -> ",
threading.current_thread().name
]))
threa... |
# -*- coding: utf-8 -*-
# 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... |
#!/usr/bin/env python3
import csv
import requests
# Constants
URL = 'https://yld.me/raw/dS03'
POINTS = [5]*6
MAX = sum(POINTS)
# Fetch data
data = requests.get(URL).text.splitlines() # Review: requests.get
# Compute individual scores (Imperative)
scores = []
for student in csv.reader(data): ... |
def set_up_datasets(args):
if args.dataset == 'miniimagenet':
args.num_class = 64
if args.deepemd == 'fcn':
from Models.dataloader.miniimagenet.fcn.mini_imagenet import MiniImageNet as Dataset
elif args.deepemd == 'sampling':
from Models.dataloader.miniimagenet.sampli... |
import logging
from pretix.base.ticketoutput import BaseTicketOutput
logger = logging.getLogger('tests.testdummy.ticketoutput')
class DummyTicketOutput(BaseTicketOutput):
identifier = 'testdummy'
verbose_name = 'Test dummy'
download_button_text = 'Download test file'
def generate(self, op):
... |
import logging
import sys
def setup_logging(log_level=logging.INFO):
logging.basicConfig(
stream=sys.stderr,
format="[%(threadName)10s][%(levelname)s][%(asctime)s] %(message)s",
level=log_level,
)
|
# coding: utf-8
"""
Unofficial python library for the SmartRecruiters API
The SmartRecruiters API provides a platform to integrate services or applications, build apps and create fully customizable career sites. It exposes SmartRecruiters functionality and allows to connect and build software enhancing it.
... |
self.cols = [Sym(headings[0]), Num(headings[1].split('-')[0]),
Num(headings[2].split('<')[1]), Sym(headings[3]),
Num(headings[4].split('>')[1])]
def aha_distance(i, r1, r2):
distance = 0
for col, row1, row2 in zip(i.cols, r1, r2):
distance += col.d... |
from math import pow
# Değişkenlerin tanımlanması
s = 0
i = 0
basamak = 0
# Sayının girilmesi
sayi = int(input())
while (sayi > 0):
# Çevirme işleminin yapılması
basamak = int((sayi % 2) * pow(10, i))
i += 1
sayi = sayi // 2
s = s + basamak
# Çevrilen sayının ekrana yazdırılması
print(s)
|
import sys
import requests
import tempfile
import io
import os
import time
import yaml
import json
import shutil
from hashlib import md5
from io import BytesIO
from zipfile import ZipFile
from tarfile import TarFile
from glob import glob
U_FLAG_YML = "u_flags.yml"
def question(text):
yes = {'yes','y', 'ye', ''}
... |
import struct
import socket
import select
import time
import zmq
import typing as typ
from can import BusABC, Message
# custom types for can bus
CanDataType = typ.Union[bytes, str]
NetworkListType = typ.Union[typ.Sequence[str], None, bool]
# custom error(s)
class InvalidCanMessageError(Exception):
pass
class Ca... |
from tensorboard.backend.event_processing import event_accumulator
ea=event_accumulator.EventAccumulator('../logs_landm/2019_08_04_14_38_LandNet-NoSE/events.out.tfevents.1564900704.Workstation')
ea.Reload()
# print(ea.scalars.Keys())
# ea1=event_accumulator.EventAccumulator('./dsm_aug/eval_0/events.out.tfevents.156240... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 25 10:19:00 2021
@author: holmanf
"""
import os,sys
from typing_extensions import IntVar
## Defines current working directory even in executable.
def resource_path(relative_path):
""" Get absolute path to resource, works for development and for PyInstaller """
t... |
import datetime
import enum
import logging
from typing import Union, Optional, TypeVar, List, Type, Callable, Dict, TYPE_CHECKING
from ravendb import constants
from ravendb.documents.commands.query import QueryCommand
from ravendb.documents.queries.index_query import IndexQuery
from ravendb.documents.queries.query imp... |
# Copyright (c) 2014 OpenStack Foundation.
#
# 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 ... |
#!/usr/bin/env python3
"""
Code for running ssh on remote hosts.
"""
import os
import sys
import signal
import subprocess
from os.path import dirname,abspath
import colors as color
SSH_OPTIONS = ['-o','StrictHostKeyChecking=no','-o','UserKnownHostsFile=/dev/null', '-o', 'LogLevel=ERROR']
def run_command_on_host(ho... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v5/proto/errors/conversion_upload_error.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fro... |
from aiogram.types import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton, InlineKeyboardButton, \
InlineKeyboardMarkup
from src.telegram.buttons import *
start = ReplyKeyboardMarkup(resize_keyboard=True)
start.row(push_me)
keyboards = {
'start': start
} |
# from flask import Flask, render_template, Response, request, redirect, url_for
# import tkinter as tk
# import time
# import random
# import speech_recognition as sr
import pyttsx3 as engine
# import threading
# from bs4 import BeautifulSoup
# import requests
from flask import Flask, render_template, Res... |
##################################################################################################################################
# Adarsh , Aadithya #
###################################################... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
from torch.nn import functional as F
from detectron2.layers import paste_masks_in_image
from adet.structures.instances import Instances
from detectron2.utils.memory import retry_if_cuda_oom
def detector_postprocess(results, output_he... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Detectron2 training script with a plain training loop.
This scripts reads a given config file and runs the training or evaluation.
It is an entry point that is able to train standard models in detectron2.
In order to let one script support tra... |
"""Tool Shed Security"""
import logging
from sqlalchemy import and_, false
from galaxy.util import listify
from galaxy.util.bunch import Bunch
log = logging.getLogger(__name__)
class Action:
def __init__(self, action, description, model):
self.action = action
self.description = description
... |
from django.urls import include, path
from common import views
app_name = "common"
urlpatterns = [
path("semester/", views.set_semester, name="set_semester"),
path(
"settings/",
include(
[
path("edit/", views.edit_settings, name="edit_settings"),
],
... |
from abc import abstractmethod
from ...kernel.agent.Agent import Agent
from .exceptions import DelegatorException
class Delegator(Agent):
def __init__(self, agentID):
self.__agentList = []
super().__init__(agentID)
def setUp(self):
self._social = True
# Defines the agent s... |
"""
Gauss-Jordan Tests Suite
"""
import xorro
from xorro import gje
from xorro import gje_simplex as simplex
import numpy as np
def cols_state_to_matrix(state):
## Parse columns state to matrix
return gje.columns_state_to_matrix(state)
def get_clause(m,lits):
## Deduce clause after GJE
return gje.dedu... |
"""This module will contain fixtures to test graph.py."""
import pytest
from ..depth_first import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_one():
g = Graph()
g.gdict = {
'A': {'B': 10},
'B': {'A': 5, 'D': 15, 'C': 20},
'C': ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from d... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from erpnext.crm.doctype.lead.lead import Lead
import frappe
from frappe import _
from frappe.contacts.address_and_contact import load_address_and_contact
from frappe.email.inbox import link_communication_to_document
from frappe.model.mapper import get_mapped_doc
from frappe.utils import comma_and, cstr, getdate, has_g... |
# Zip file download of Filip Korzeniowski's version with annotated keys: http://www.cp.jku.at/people/korzeniowski/bb.zip
import os
import re
import glob
import logging
from typing import Iterator, Optional, Tuple
from abc import abstractmethod
from inceptionkeynet.data import Dataset, DatasetCreator, MusicPi... |
from django.apps import AppConfig
class FifarecordsConfig(AppConfig):
name = 'fifaRecords'
|
def main():
# input
H, W = map(int, input().split())
Ass = [[*map(int, input().split())] for _ in range(H)]
# compute
sumH = [0]*W
sumW = [0]*H
for i in range(H):
for j in range(W):
sumH[j] += Ass[i][j]
sumW[i] += Ass[i][j]
# output
for i in range(H)... |
# Copyright 2021 "Dan Farrell <djfarrell@hopspan.com>"
#
# 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, ... |
# views.team.team
from flask import redirect, url_for, request, flash
from app.forms import CreateTeam as CreateTeamForm
from app.util import session as session_util, team as team_util
from .team import TeamView
class CreateTeamView(TeamView):
"""Create a team.
"""
def get_form(self):
return C... |
"""Abstract base model for Neural network"""
from abc import ABC,abstractmethod
from utils.config import Config
class BaseModel(ABC):
"""Abstract model base class that is inherited by all child classes"""
def __init__(self,cfg):
self.config = Config.from_json(cfg)
@abstractmeth... |
# Crawling for content of articles from icismarkit
from configparser import ConfigParser
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.suppo... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
import logging
from django.shortcuts import render
# Create your views here.
from urllib.parse import parse_qs
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.generics imp... |
import json
import random
from danmu_abc import TcpConn, Client
from .utils import Header, Opt, Pack
class TcpDanmuClient(Client):
__slots__ = ('_room_id', '_pack_heartbeat')
def __init__(
self, room_id: int, area_id: int, loop=None):
heartbeat = 30.0
conn = TcpConn(
... |
import gym
from ray.rllib.env.vector_env import VectorEnv
from ray.rllib.utils.annotations import override
class MockEnv(gym.Env):
"""Mock environment for testing purposes.
Observation=0, reward=1.0, episode-len is configurable.
Actions are ignored.
"""
def __init__(self, episode_length, config... |
""" Parsing utilities for Polly's ScheduleTree representation. """
import logging
import textwrap as t
import attr
import pyparsing as p
LOG = logging.getLogger(__name__)
@attr.s
class Node:
tok = attr.ib()
def indent(self, level=0, idt=' '):
val = self.tok[2]
if not isinstance(self.tok[2],... |
from .estimator import Estimator
from .classifiers import (
LogisticRegressionClassifier,
RandomForestClassifier,
XGBoostClassifier,
LightGBMClassifier,
CatBoostClassifier,
ElasticNetClassifier,
ExtraTreesClassifier,
BaselineClassifier,
DecisionTreeClassifier,
KNeighborsClassifie... |
# -*- coding: utf-8 -*-
__author__ = 'Paul Ollivier'
__email__ = 'contact@paulollivier.fr'
__version__ = '0.1.0'
|
# -*- coding: utf-8 -*-
'''
Support for Stormpath
.. versionadded:: 2015.8.0
'''
# Import python libs
from __future__ import absolute_import, print_function
import json
import logging
# Import salt libs
import salt.utils.http
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load the module if... |
import json
from com.alipay.ams.api.request.alipay_request import AlipayRequest
class AlipayMerchantRegistrationRequest(AlipayRequest):
def __init__(self):
super(AlipayMerchantRegistrationRequest, self).__init__()
self.__product_codes = None
self.__registration_request_id = None
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import request
from flask.ext.restful import Resource
from flask.ext.restful import reqparse
from ..models import *
from ..lib.util import *
from ..login.views import auth
class devResource(Resource):
# decorators = [auth.login_required]
def get(self):... |
# coding=utf-8
# Copyright (C) 2020 NumS Development 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... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
import copy
import torch.nn as nn
from rlkit.launchers.launcher_util import setup_logger
import rlkit.torch.pytorch_util as ptu
from rlkit.core.ma_eval_util import get_generic_ma_path_information
def experiment(variant):
import sys
sys.path.append("./multiagent-particle-envs")
from make_env import make_env... |
from datetime import datetime
from django.forms import forms
from django.test import SimpleTestCase
from django.utils.timezone import get_current_timezone
from bootstrap_daterangepicker.fields import DateTimeRangeField
tz = get_current_timezone()
class DateTimeRangeTests(SimpleTestCase):
def test_default_setup... |
# lc665.py
# LeetCode 665. Non-decreasing Array `E`
# acc | 98% | 34'
# A~0g20
class Solution:
def checkPossibility(self, nums: List[int]) -> bool:
p = None
for i in range(len(nums)-1):
if nums[i] > nums[i+1]:
if p is not None:
return False
... |
# Header File: main.py
# Welcome / LogIn Window for Ness.
# History:
# Date Programmer - Description
# ---------- ---------- ----------------------------
# 05/04/2021 Ricardo Josue Colindres - Created
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from database imp... |
#!/usr/bin/env python
#
# Copyright 2006-2008 the V8 project authors. 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 logging
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
#The background is set with 40 plus the number of the color, and the foreground with 30
#These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_message(message,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# acinn_litsem documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 6 00:28:19 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class TagResource:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is att... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: lapis-hong
# @Date : 2018/1/15
"""Training Wide and Deep Model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os
import shutil
impor... |
from Acquire.Identity import Authorisation
from Acquire.Storage import DriveInfo, PARRegistry
from Acquire.Crypto import PublicKey
def run(args):
"""Call this function to initiate the two-step file-download process.
Step 1: download - tells the service to download the file. If the
file i... |
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
class Tag(models.Model):
name = models.CharField(max_length=127)
class City(models.Model):
name = models.CharField(max_length=127)
class User(AbstractUser):
email = models.EmailField(unique... |
from __future__ import with_statement
# http://docs.python.org/distutils/
# http://packages.python.org/distribute/
try:
from setuptools import setup
except:
from distutils.core import setup
import os.path
version_py = os.path.join(os.path.dirname(__file__), 'vxi11', 'version.py')
with open(version_py, 'r') ... |
"""
MIT License
Copyright (c) 2021 molokhovdmitry
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... |
'''
Config instance
'''
__all__ = 'CONFIG',
CONFIG = None
|
# Copyright 2021 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... |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.