text
stringlengths
2
999k
# Generated by Django 3.1.13 on 2021-09-01 22:46 import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('authentication', '0003_auto_20210901_1731'), ] operations = [ migrations...
def greet(first_name, last_name): print(f"Hi {first_name} {last_name}") greet("Tom", "Hill")
import logging from typing import TYPE_CHECKING, Dict, Optional, Tuple import settings from .mappers import FoliumMapBuilder if TYPE_CHECKING: from pandas.core.frame import DataFrame logger = logging.getLogger(__name__) class MapPlotter: def __init__( self, data: "DataFrame", colu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pip._vendor.chardet.sbcharsetprober import SingleByteCharSetModel # 3: Positive # 2: Likely # 1: Unlikely # 0: Negative GREEK_LANG_MODEL = { 60: { # 'e' 60: 2, # 'e' 55: 1, # 'o' 58: 2, # 't' 3...
#!python from linkedlist import LinkedList # Implement LinkedStack below, then change the assignment at the bottom # to use this Stack implementation to verify it passes all tests class LinkedStack(object): def __init__(self, iterable=None): """Initialize this stack and push the given items, if any.""" ...
#PIA Deteccion de rugosidad de la corteza de un arbol #Materia: Vision Computacional import cv2 import Tkinter import tkFileDialog import numpy as np from matplotlib import pyplot as plt def Rugosidad(): images = [] # gray = [] for item in Org_img: # gray = cv2.cvtColor(item, cv2.COLOR_BGR2G...
#!/usr/bin/env python # 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 uuid import pytest from rest_framework import status from rest_framework.reverse import reverse from datahub.company.models import OneListTier from datahub.company.test.factories import AdviserFactory, CompanyFactory from datahub.company.test.utils import address_area_or_none from datahub.core.constants import...
import sst import os sst.setProgramOption("timebase", "1ps") sst_root = os.getenv( "SST_ROOT" ) l2PrefetchParams = { "prefetcher": "cassini.NextBlockPrefetcher" } ariel = sst.Component("a0", "ariel.ariel") ariel.addParams({ "verbose" : "0", "maxcorequeue" : "256", "maxissuepe...
from typing import Optional import torch import torch.autograd as autograd import torch.distributed as distributed from torch.autograd.function import once_differentiable from . import _backend def _activation_from_name(activation): if activation == "leaky_relu": return _backend.Activation.LeakyReLU ...
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm import reframe.utility.sanity as sn @rfm.simple_test class GpuDirectCudaCheck(rfm.RegressionTest): ...
""" Home View """ from django.core.handlers.wsgi import WSGIRequest from django.http import HttpResponse from django.shortcuts import render from django.views import View from TWT.apps.timathon.models.team import Team from TWT.apps.timathon.models.submission import Submission from random import randint from allauth.soc...
# Copyright 2021 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 agree...
# Copyright 2017 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. # # NOTE: Created with generate_compiled_resources_gyp.py, please do not edit. { 'targets': [ { 'target_name': 'paper-dialog-extracted', 'de...
""" Test script for the Unicode implementation. Written by Bill Tutt. Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" from test_support import verify, verbose print 'Testing General Unicode Character Name, and case insensitivity...', # G...
# -*- coding: utf-8 -*- # Created by restran on 2016/10/10 from __future__ import unicode_literals, absolute_import import logging import os import sys import psycopg2 # 把项目的目录加入的环境变量中,这样才可以导入 common.base sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from common.base import TaskExecu...
# vim: fileencoding=utf-8 import warnings from webob import Request from zope.interface.verify import verifyObject from pyramid.security import forget from pyramid.security import remember from pyramid.testing import testConfig from pyramid.testing import DummyRequest from pyramid.testing import DummySecurityPolicy fro...
# Copyright (c) 2014-2017 Red Hat, 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...
import os import pickle import numpy as np import xarray as xr import swot_simulator import swot_simulator.random_signal as random_signal ROOT = os.path.dirname(os.path.abspath(__file__)) def test_gen_signal_1d(): with open(os.path.join(ROOT, "data", "gen_signal_1d.bin"), "rb") as stream: (fi, psi, x, n...
# Generated by Django 3.2.3 on 2021-05-30 18:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('awards', '0001_initial'), ] operations = [ migrations.AlterField( model_name='profile', name='photo', fi...
# # Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending # ############################################################################## # NOTE: the jvm should have been initialized, or this test will certainly fail ############################################################################## import sys i...
"""Module contianing the :class:`CwlToolEngine` implementation of :class:`Engine`.""" from planemo import cwl from planemo.runnable import RunnableType from .interface import BaseEngine class CwlToolEngine(BaseEngine): """An :class:`Engine` implementation backed by cwltool. More information on cwltool can b...
#!/bin/python3 import json import os, sys from sensors import growbme680, growbme280, growbmp280, grownosensor from camera import camera from specimen import specimen if __name__ == "__main__": print("Starting growlab") config = {} try: with open("./config.json") as f: config = json.l...
""" A dataset handle and abstract low level access to the data. the dataset will takes data stored locally, in the format in which they have been downloaded, and will convert them into a MNE raw object. There are options to pool all the different recording sessions per subject or to evaluate them separately. """ # flak...
'''OpenGL extension EXT.bindable_uniform This module customises the behaviour of the OpenGL.raw.GL.EXT.bindable_uniform to provide a more Python-friendly API ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions, wrapper from OpenGL.GL import glget import ctypes from OpenGL.raw.G...
import re import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from collections import OrderedDict from torch import Tensor from torch.jit.annotations import List __all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161'] model_urls = { 'd...
import os from distutils.extension import Extension def _get_bool(key: str, default: bool = False) -> bool: value = os.getenv(key) if value is not None: return value.lower() in ["true", "1", "t"] return default def _get_extensions(): return [ Extension( "audiomatch.popcou...
from __future__ import print_function, division #!!!!!!!! NEED TO BE UPDATED TO TAKE THE SAME FORM AS OPERATORS IN HAAR !!!!!!!! """This module is used to compute the divergence operator in the x-direction. The procedure "create_matrix" returns the matrix representing the linear combination of this operation on a ca...
#appModules/explorer.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2018 NV Access Limited, Joseph Lee #This file is covered by the GNU General Public License. #See the file COPYING for more details. """App module for Windows Explorer (aka Windows shell). Provides workarounds for controls suc...
# -*- coding: utf-8 -*- # # socketfromfd documentation build configuration file, created by # sphinx-quickstart on Sat Aug 20 14:45:15 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 # autogenerated file. ...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
#!/usr/bin/python # -*- coding: utf-8 -*- import requests proxies = { "http": "http://10.10.1.10:3128", "http": "http://user:pass@10.10.1.10:3128", "https": "http://10.10.1.10:1080", } requests.get("http://example.org", proxies=proxies) """ You can also configure proxies by setting the environment varia...
import unittest from django.test import TestCase from back2back.models import Entry from back2back.structure import GentsRecurve class TestCreatingEntry(TestCase): def test_simple(self): category = GentsRecurve() category.create_entry('Larry Godfrey') self.assertEqual(Entry.objects.count...
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
# -*- coding: utf-8 -*- """Add permissions for proxy model. This is needed because of the bug https://code.djangoproject.com/ticket/11154 in Django (as of 1.6, it's not fixed). When a permission is created for a proxy model, it actually creates if for it's base model app_label (eg: for "article" instead of "about", fo...
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2018 ZhicongYan # # 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...
from django.urls import path from . import views urlpatterns = [ # path('', views.index, name='index'), # path('hello', views.hello, name='hello'), ################################################ path('',views.home, name='home'), path('about.html',views.about,name='about'), path('home.html', v...
"""A collection of string constants. Public module variables: whitespace -- a string containing all ASCII whitespace ascii_lowercase -- a string containing all ASCII lowercase letters ascii_uppercase -- a string containing all ASCII uppercase letters ascii_letters -- a string containing all ASCII letters digits -- a ...
from datetime import timedelta from enum import Enum import logging import pathlib from typing import Union import f90nml # type: ignore[import] from pyschism.enums import Stratification _logger = logging.getLogger(__name__) PARAM_TEMPLATE = pathlib.Path(__file__).parent / 'param.nml.template' PARAM_DEFAULTS = f90...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# Copyright 2018 The Meson 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 law or agreed to ...
""" .. _tut_creating_data_structures: Creating MNE-Python data structures from scratch ================================================ This tutorial shows how to create MNE-Python's core data structures using an existing :class:`NumPy array <numpy.ndarray>` of (real or synthetic) data. .. contents:: Page contents ...
from .auto_form_encode_command import AutoFormEncodeCommand from .http_request_command import ResterHttpRequestCommand, ResterHttpResponseCloseEvent from .set_syntax_command import SetSyntaxCommand __all__ = [ 'AutoFormEncodeCommand', 'ResterHttpRequestCommand', 'ResterHttpResponseCloseEvent', 'SetSynt...
# Copyright 2020 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...
import seaborn as sns import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import sys os.chdir(os.path.dirname(sys.path[0])) train = pd.read_csv('./client/data_storage/data_7.csv') train.drop('phone_num', axis=1, inplace=True) cols = [c for c in train.columns] #返回数据的列名到列表里 print('Numbe...
import shutil import subprocess import tempfile import logging import time import hashlib import uuid import asyncio from OpenSSL import crypto from functools import wraps from socket import socket def run_async(p): @wraps(p) def runner(*a,**k): loop = asyncio.get_event_loop() try: ...
""" Example usage from command line python railrl/launchers/experiments/ashvin/bear_launcher.py --demo_data=/home/ashvin/data/s3doodad/demos/icml2020/hand/pen2_sparse.npy --eval_freq=1000 --algo_name=BEAR --env_name=pen-v0 --log_dir=data_walker_BEAR/ --lagrange_thresh=10.0 --distance_type=MMD --mode=auto --num_samples_...
#!/bin/env python import re import subprocess def resize(primary=None, primary_mode=None, secondary=None, secondary_mode=None, secondary_location="--right-of", toggle=False, clone=False): screeninfo = subprocess.check_output(['xrandr']).decode() screens = sorted(re.findall("(\w+) connected", s...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.LoanTerm import LoanTerm class AlipayPcreditLoanLoanApplyModel(object): def __init__(self): self._apply_amt = None self._back_url = None ...
try: from symsynd.driver import Driver, SymbolicationError from symsynd.report import ReportSymbolizer from symsynd.macho.arch import get_cpu_name from symsynd.demangle import demangle_symbol have_symsynd = True except ImportError: have_symsynd = False from sentry import options from sentry.lan...
""" Unit tests for config file and CLI argument parsing. """ from io import StringIO from textwrap import dedent import pytest from vulture.config import ( DEFAULTS, _check_input_config, _parse_args, _parse_toml, make_config, ) def test_cli_args(): """ Ensure that CLI arguments are conv...
import argparse import ast # TODO: make abstract HParams class and make this as child of it class HParams: def __init__(self, hparams_string=None): """Create model hyperparameters. Parse nondefault from given string.""" ################################ # Experiment Parameters # ...
# This file is part of 'miniver': https://github.com/jbweston/miniver # # This file will be overwritten by setup.py when a source or binary # distribution is made. The magic value "__use_git__" is interpreted by # _version.py. version = "__use_git__" # These values are only set if the distribution was created with '...
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv from datetime import datetime with open('hounds.csv') as csvfile: reader = csv.DictReader(csvfile) for row in reader: file = '_greyhounds/{}.md'.format(row['Name'].lower()) with open(file, 'w') as f: f.write( """--- layout: g...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import logging import pika import pytest import time from kafka import KafkaConsumer as KafkaConsumerOrig, TopicPartition from pika import PlainCredentials from demoproject.models import DemoModel1 from django_mb.config imp...
from flask_unchained.bundles.sqlalchemy import ModelManager from ..models import Market class MarketManager(ModelManager): class Meta: model = Market def create(self, abbrev, name, exchange, country, commit=False, **kwargs): return super().create(abbrev=abbrev, name=name, exchange=exchange, ...
# idea: Convert each interval into 2 points, one adding passengers and one removing, go through list and see if it ever goes over capacity. class Solution: def carPooling(self, trips: List[List[int]], capacity: int) -> bool: trip_points = [] for trip in trips: trip_points.append((trip[1...
#!/usr/bin/python3 import ircutil import fnmatch mybot = ircutil.Connection() mybot.nick = "ezBot" mybot.server = "irc.freenode.org:6665" @mybot.trigger() def raw(event): # See everything from irc server and ircutil print(event.raw) @mybot.trigger(lambda event: event.WELCOME) def autojoin(event): mybot....
# Copyright 2017 Sayan Dutta # # 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, ...
import discord from discord.ext import commands from clever_chat import AsyncClient client = commands.Bot(command_prefix='amogus') @client.event async def on_message(message): if message.author == client.user: return if message.channel.id == 854342237461676073: response = await As...
from net_modules import keypoints_2d import tensorflow as tf import zutils.tf_math_funcs as tmf import numpy as np import zutils.pt_utils as ptu import net_modules.auto_struct.utils as asu import prettytensor as pt import math from zutils.py_utils import * import zutils.tf_graph_utils as tgu from net_modules.auto_str...
import os,shutil from SCons.Script import DefaultEnvironment from platformio import util try: # PIO < 4.4 from platformio.managers.package import PackageManager except ImportError: # PIO >= 4.4 from platformio.package.meta import PackageSpec as PackageManager def parse_pkg_uri(spec): if PackageMana...
import paho.mqtt.client as mqtt import logging from threading import Thread import json from appJar import gui # TODO: choose proper MQTT broker address MQTT_BROKER = 'mqtt.item.ntnu.no' MQTT_PORT = 1883 # TODO: choose proper topics for communication MQTT_TOPIC_INPUT = 'ttm4115/team_04/command' MQTT_TOPIC_OUTPUT = 't...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-28 22:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0004_auto_20160806_1312'), ] operations = [ migrations.AlterField(...
with open("data.txt") as f: polymer = f.read().strip() def react_polymer(pol): pol = [ord(c) for c in pol] i = 0 while i < len(pol) - 1: if abs(pol[i] - pol[i + 1]) == 32: del pol[i] del pol[i] i -= 1 else: i += 1 return pol def p...
import numpy as np class TrainingControl(): def __init__(self, max_step, evaluate_every_nstep, print_every_nstep): self.state_dict = { 'epoch': 0, 'batch': 0, 'step': 0, 'step_to_evaluate': False, 'step_to_print': False, 'step_to_stop...
# coding=utf-8 # # Copyright 2017 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 re...
# import tensorflow as tf from onnx_darknet.handlers.backend_handler import BackendHandler from onnx_darknet.handlers.handler import onnx_op from onnx_darknet.handlers.handler import darknet_func from .math_mixin import BasicMathMixin @onnx_op("Floor") @darknet_func(tf.floor) class Floor(BasicMathMixin, BackendHandl...
from .backend import keras from .backend import backend as K # https://github.com/CyberZHG/keras-layer-normalization/blob/master/keras_layer_normalization/layer_normalization.py class LayerNormalization(keras.layers.Layer): def __init__(self, center=True, scale=True, ...
from django.urls import path from .views import EnterUrlView, ResultView, ResultAjaxView app_name = "check" urlpatterns = [ path("", EnterUrlView.as_view(), name="enterurl"), path("result/", ResultView.as_view(), name="result"), path("result_ajax/", ResultAjaxView.as_view(), name="result_ajax"), ]
from python_git_wrapper.exceptions import * from python_git_wrapper.repository import Repository
def ed( X, Y ): i = len(X) - 1 j = len(Y) - 1 #last character are same while True: if i >=0 and j >=0: if X[i] == Y[j]: dis = ed( X[:i], Y[:j]) break #last two characters are transposed if i >= 1 and j >= 1: if X[...
from django.db import migrations, transaction class Migration(migrations.Migration): dependencies = [ ('msgboard', '0001_initial'), ] def generate_data(apps, schema_editor): from msgboard.models import Message test_data = [ ('Test User1', 'A simple test message'),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from netests.constants import NOT_SET from netests.tools.cli import parse_textfsm from netests.protocols.lldp import LLDP, ListLLDP from netests.mappings import mapping_sys_capabilities def _iosxr_lldp_ssh_converter( hostname: str, cmd_output, options={} ) -...
from .ORConv import ORConv2d #from .ORConv_v2 import ORConv2d_v2 #__all__ = ['ORConv2d', 'ORConv2d_v2'] __all__ = ['ORConv2d']
""" PyPAC: Proxy auto-config for Python =================================== Copyright 2018 Carson Lam 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/L...
from __future__ import division import kdtree from component import Component from transform import Transform from abc import ABCMeta, abstractmethod class Collider2D(Component): __metaclass__ = ABCMeta _quadTree = kdtree.create(dimensions=2) _rMax = None @staticmethod def register(newCollider):...
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
########################################################################## ########################################################################## # tclean_base.py # # Copyright (C) 2018 # Associated Universities, Inc. Washington DC, USA. # # This script is free software; you can redistribute it and/or modify it # u...
import argparse import os import pickle from types import SimpleNamespace from typing import OrderedDict from pytorch_lightning import callbacks from torch._C import device from utils.vocab import build_vocab, load_vocab from utils.data_loader import get_loader from utils import NLGEval from torchvision.transforms imp...
import os from flask import Flask from flask import send_from_directory app = Flask(__name__) @app.route('/') def hello_world(): return '<a href="/download">View file</a>' @app.route('/download') def download(): uploads = '/home/runner/manim-repl/manim/media/videos/example_scenes/720p30/' return send_from_dir...
# Utilities for handling command line args import re import getopt def split_args (argstr): """Split a string into a list of arguments like the Bourne shell does with its command line""" # Strip leading spaces argstr = re.sub(r'^\s+', '', argstr) if not argstr: return [""] # nothing but whitespace # Check ...
import cProfile import re import os from pymongo import MongoClient from htmlmin.minify import html_minify from settings import APP_JSON, APP_MOL2, APP_ARTICLES from difflib import SequenceMatcher as SM import ujson as json from Levenshtein import ratio #import json Masses = dict(H=1.01, He=4.00, Li=6.94, Be=9.01, B=1...
# coding: utf-8 """ LUSID API # Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages : * [C#](https://gith...
for i in incorrect_idx: print('%d: Predicted %d True label %d' % (i, pred_y[i], test_y[i])) # Plot two dimensions colors = ["darkblue", "darkgreen", "gray"] for n, color in enumerate(colors): idx = np.where(test_y == n)[0] plt.scatter(test_X[idx, 1], test_X[idx, 2], color=color, label="Cl...
from django.test import TestCase from django.urls import reverse from studies.models import Book, UserBookMany from studies.tests.speed_set_up import SpeedSetUP class DeleteBookView(TestCase): def setUp(self): speed_set_up = SpeedSetUP() self.user_a = speed_set_up.set_up_user_a() self.boo...
import pytest import sys import trio import inspect import re import time pytestmark = pytest.mark.trio io_test_pattern = re.compile("io_.*") async def tests(subtests): def find_io_tests(subtests, ignored_names): functions = inspect.getmembers(sys.modules[__name__], inspect.isfunction) for (f_na...
#!/usr/bin/python ''' (C) Copyright 2020 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 ...
""" Path Assignment Mixed-integer Program (PAMP) Assumes you have a assignment path graph """ import os import itertools import copy from datetime import datetime import networkx as nx from docplex.mp.model import Model def solve(graph, ass_to_path, arcs_to_parents, demand_to_parents): """ Solve the assignmen...
from panda3d.core import * from direct.gui.DirectGui import * from panda3d.core import * from direct.fsm import StateData from toontown.toon import ToonAvatarPanel from toontown.friends import ToontownFriendSecret from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from otp.otpbase i...
import io import os.path import pytest from astral import GoogleGeocoder def read_contents(*names, **kwargs): return io.open( os.path.join(*names), encoding=kwargs.get("encoding", "utf8") ).read() try: api_key = read_contents(os.path.dirname(__file__), '.api_key').strip() except: api_...
# Natural Language Toolkit: Expectation Maximization Clusterer # # Copyright (C) 2001-2022 NLTK Project # Author: Trevor Cohn <tacohn@cs.mu.oz.au> # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT try: import numpy except ImportError: pass from nltk.cluster.util import Vect...
# Copyright 2019 Google 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, so...
""" Traditional pipeline in computer graphics renders images from the viewpoint of a virtual pin-hole camera by using the very frequent perspective projection. View direction is initially set along the negative z-axis in camera coordinate system. So, 3D content which we define needs a transformation from ordinary 3D c...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. from .coco import COCODataset from .coco_classes import COCO_CLASSES from .datasets_wrapper import ConcatDataset, Dataset, MixConcatDataset from .mosaicdetection import MosaicDetection from .voc import VOCDetection
# Generated by Django 2.2 on 2019-05-16 10:29 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('openbook_communities', '0024_auto_20190512_1948'), ] operations = [ migrations.RemoveField( model_name='community', name='hide...
# coding: utf-8 ''' A collection of mixins useful for the various *Client interfaces ''' # Import Python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import fnmatch import signal import logging import weakref import traceback import collections import copy as pycopy # ...
import bisect from typing import List, Sequence, TypeVar, Union, overload from seqtk._helper import slice_to_indices _T = TypeVar("_T") class concatenate(Sequence[_T]): def __init__(self, sequences: Sequence[Sequence[_T]]): self._sequences = sequences self._cumulative_sizes = self._calculate_cum...
#!/usr/bin/python import timeit import commands import sys import re from optparse import OptionParser def runbench (compiler, runs, search, n): commands.getstatusoutput ('./searchtest.%s %d %s %d' % (compiler, runs, search, n)) def timebench (compiler, runs, search, n): return timeit.Timer ('runbench (\'%s\...
# Copyright (C) 2021 Istituto Italiano di Tecnologia (IIT). All rights reserved. # This software may be modified and distributed under the terms of the # GNU Lesser General Public License v2.1 or any later version. import dataclasses import warnings from dataclasses import field import casadi as cs from liecasadi im...