text
stringlengths
1
927k
from lib.install import install import subprocess import tempfile import unittest class TestInstall(unittest.TestCase): def test_install_3x(self): with tempfile.TemporaryDirectory() as install_dir: install(install_dir, '3.2.0.0') output = subprocess.check_output([f'{install_dir}/bin/cabal', '--versi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Global logging configuration """ import logging import pygelf def setup_logger(name=__package__, level='INFO', gelf_host=None, gelf_port=None, **kwargs): """ sets up the logger """ logging.basicConfig(handlers=[logging.NullHandler()]) formatter = logging...
# -*- coding: utf-8 -*- ''' Test behaviors used by test plans ''' # pylint: skip-file # pylint: disable=C0103 import os import stat import time from collections import deque # Import ioflo libs import ioflo.base.deeding from ioflo.aid.odicting import odict from ioflo.base.consoling import getConsole console = getCon...
import os, argparse, sys, shutil, warnings, glob from datetime import datetime import matplotlib.pyplot as plt from math import log2, log10 import pandas as pd import numpy as np from collections import OrderedDict from torchvision import transforms, utils import torchvision import torch.nn.functional as F import torc...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from future.utils import native_str from distutils.version import LooseVersion from sqlalchemy import Column, Integer, String from flexget import db_schema, plugin from flexge...
from autoPyTorch.training.base_training import BaseBatchLossComputationTechnique import numpy as np from torch.autograd import Variable import ConfigSpace import torch class Mixup(BaseBatchLossComputationTechnique): def set_up(self, pipeline_config, hyperparameter_config, logger): super(Mixup, self).set_up...
#!/usr/bin/env python3 # Copyright (c) 2015-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. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author:...
from random import randrange def generateList(start, end, number): if number > end - start: print("Error") return "Error" R = list(range(start, end)) l = [] while number > 0: r = randrange(len(R)) l.append(R[r]) del R[r] number -= 1 return l c...
class HONDA: CIVIC = "HONDA CIVIC 2016 TOURING" ACURA_ILX = "ACURA ILX 2016 ACURAWATCH PLUS" CRV = "HONDA CR-V 2016 TOURING" ODYSSEY = "HONDA ODYSSEY 2018 EX-L" ACURA_RDX = "ACURA RDX 2018 ACURAWATCH PLUS" PILOT = "HONDA PILOT 2017 TOURING" RIDGELINE = "HONDA RIDGELINE 2017 BLACK EDITION" class TOYOTA: ...
from flask import jsonify def error_response(msg, imsg=None, code=None, more=None, **kwargs): return jsonify(dict( success=False, errors=dict( message=msg, internalMessage=imsg, code=code, ...
"""Support for Ness D8X/D16X alarm panel.""" import logging from nessclient import ArmingState import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME, SUPPORT_ALARM_TRIGGER, ) from homeas...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Aug 23 15:15:49 2017 @author: mschull """ import os import subprocess import h5py import numpy as np import csv import pandas as pd import glob import datetime import gzip import shutil from osgeo import gdal,osr import argparse import urllib2, base64 ...
from output.models.nist_data.list_pkg.string.schema_instance.nistschema_sv_iv_list_string_max_length_2_xsd.nistschema_sv_iv_list_string_max_length_2 import NistschemaSvIvListStringMaxLength2 __all__ = [ "NistschemaSvIvListStringMaxLength2", ]
""" This is the setup module for the example project. Based on: - https://packaging.python.org/distributing/ - https://github.com/pypa/sampleproject/blob/master/setup.py - https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure """ # Standard Python Libraries import codecs from glob import glob from os.pa...
### # Copyright (c) 2002-2009, Jeremiah Fincher # Copyright (c) 2009, James Vega # 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 copyri...
import __common__ def keyquery(cdim=None): return( set(['PSDCON']) ) def getval(prob, cdim=None): if prob.psdmapnum == 0: return( 0 ) else: cdim = __common__.parse_cdim(cdim) return( sum([n*(n+1)/2 for n in prob.psdmapdim if cdim(n) ]) )
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class ApiConfig(AppConfig): name = 'api' verbose_name = _('Api')
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/contrib/rpc/python/kernel_tests/test_example.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message ...
import os import sys import platform import datetime from pathlib import Path import skimage.color import imageio import sunpy.io.fits BITFACTOR = 255 def get_created_time(path_to_file): if platform.system() == 'Windows': return os.path.getctime(path_to_file) else: stat = os.stat(path_to_fil...
from SPARQLWrapper import SPARQLWrapper, JSON import argparse parser = argparse.ArgumentParser( description='Fixes labels for French communes.') parser.add_argument("departement", help="The number of a departement") args = parser.parse_args() if args.departement.isdigit(): dept = '"{}"'.format(args.departemen...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def SortSpec(vim, *args, **kwargs): '''Specification of a single sort criterion to be appl...
import numpy as np def truncate(x, n): k = -int(np.floor(np.log10(abs(x)))) # Example: x = 0.006142 => k = 3 / x = 2341.2 => k = -3 k += n - 1 if k > 0: x_str = str(abs(x))[:(k+2)] else: x_str = str(abs(x))[:n]+"0"*(-k) return np.sign(x)*float(x_str) def solve_reduced_monic_cub...
import example.gen.github.v3 as v3 if __name__ == "__main__": client = v3.Github_Requests() rate_limit = client.get_rate_limit() print(rate_limit.resources.core) for g in client.get_gists_for_user("udoprog"): print(g.owner)
from parsl.config import Config from parsl.executors import WorkQueueExecutor config = Config( executors=[WorkQueueExecutor(port=50055, project_name="WQexample", see_worker_output=True, source=True, ...
from django.db import models from django.contrib.auth.models import User from django.utils import timezone class Entry(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) pattern = models.CharField(max_length=255) test_string = models.CharField(max_length=255) date_added = models.Da...
# # PySNMP MIB module ENTERASYS-RTR-ADVERT-NOTIFICATION-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-RTR-ADVERT-NOTIFICATION-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:04:34 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 #...
import torch.nn as nn from fairseq import utils class LearnedPositionalEmbedding(nn.Embedding): """This module learns positional embeddings up to a fixed maximum size. Padding symbols are ignored, but it is necessary to specify whether padding is added on the left side (left_pad=True) or right side (lef...
description = 'Peltier temperature controller TLC40' group = 'optional' includes = ['alias_T'] tango_base = 'tango://phys.kws2.frm2:10000/' devices = dict( T_peltier = device('nicos.devices.tango.TemperatureController', description = 'The regulated temperature', tangodevice = tango_base + 'kws2/...
# -*- coding: utf-8 -*- import ast from itertools import chain from typing import Callable from typing_extensions import final from wemake_python_styleguide import constants from wemake_python_styleguide.constants import FUTURE_IMPORTS_WHITELIST from wemake_python_styleguide.logic import imports, nodes from wemake_p...
import os, sys, math import IECore isRunningInMaya = True try: from maya import cmds, OpenMaya except: isRunningInMaya = False def autoSearchMayaMainJoint(): if not isRunningInMaya: sys.stderr.write('WARNING: the function autoSearchMayaMainJoint cannot be called, because maya is not available in the environment...
from app.api import bp from app.models import TableauDashboardGrade as TDG, PAIRReportsGrade as PRG from app.api.errors import error_response, bad_request from flask import jsonify, g # Filters v2 @bp.route('/v2/sections/<string:campus>/<string:yearsession>/<string:subject>/<string:course>', methods=['GET']) def get_...
from django import template from helper.quick_stat_template import quick_stat_helper_template from helper.icon import Icon register = template.Library() from blogs.models import Blog from bookings.models import Booking from recipes.models import Recipe @register.simple_tag def model_entry_count(): blog_count = ...
# -*- coding: iso-8859-1 -*- """ MoinMoin - jabber bot configuration file @copyright: 2007 by Karol Nowak <grywacz@gmail.com> @license: GNU GPL, see COPYING for details. """ class BotConfig: # Node name (a valid JID) to be used xmpp_node = u"moinbot@jabber.example2.org/wiki" # Server to be u...
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
# Requires io_bazel_rules_docker to exist load( "@io_bazel_rules_docker//container:container.bzl", "container_pull", container_repositories = "repositories" ) # WORKSPACE repository macro to load dependencies to use pyz_image def pyz_image_repositories(): excludes = native.existing_rules().keys() ...
# # PySNMP MIB module OSPFV3-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/OSPFV3-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:22:23 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:...
from langumo.parsers.wikipedia import WikipediaParser from langumo.parsers.jsonstring import EscapedJSONStringParser
import hashlib import os import platform import sys import yaml if sys.platform.startswith("win"): import win32api import win32con import win32evtlog import win32security import win32evtlogutil sys.path.append(os.path.join(os.path.dirname(__file__), '../../../libbeat/tests/system')) from beat.bea...
import hashlib import logging import time from typing import Tuple logger = logging.getLogger(__name__) _startup_time = int(time.time()) logger.info("Startup time: %s", _startup_time) def gen_hash(key: Tuple[str, ...]) -> str: return hashlib.sha256(str(key + (_startup_time,)).encode("utf-8")).hexdigest()
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
from random import randint from ObjectOriented.AlienGame import Scene class Death(Scene): __quips = [ "You died. You kinda suck at this.", "Your mom would be proud...if she were smarter.", "Such a looser.", "I have a small puppy that's better at this.", ] def enter(self)...
import websockets from wsocket.wcthread import WCThread class WSoClient: def __init__(self, **kwargs): self._cli = WCThread(**kwargs) self._flag_running = False def connect(self): self._cli.start() self._flag_running = True def close(self): self._cli.stop_client() ...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import json from django.views.generic import TemplateView, ListView from django.views.generic.detail import DetailView from django.http import HttpResponse, QueryDict from django.shortcuts import redirect from django.utils import translation from djang...
require task, prettytable class TaskGroup: def __init__(self,tasks,name=""): self.name = name self.__tasks = [] for task in tasks: self.task_add(task) def __repr__(self): return self.__tasks.__repr__() def task_list(self,unhide=False): return [task for task in self.__tasks if unhide or not task.tag_c...
# coding: utf-8 from mkdocs import utils from mkdocs.compat import urlparse from mkdocs.exceptions import ConfigurationError import os import yaml DEFAULT_CONFIG = { 'site_name': None, 'pages': None, 'site_url': None, 'site_description': None, 'site_author': None, 'site_favicon': None, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems This module is developed by: Yalin Li <zoe.yalin.li@gmail.com> This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-G...
"""Platzigram middleware catalog.""" # Django from django.shortcuts import redirect from django.urls import reverse class ProfileCompletionMiddleware: """Profile completion middleware. Ensure every user that is interacting with the platform have their profile picture and biography. """ def __in...
import numpy as np def calculate_iou(bbox1, bbox2): """ calculate iou args: - bbox1 [array]: 1x4 single bbox - bbox2 [array]: 1x4 single bbox returns: - iou [float]: iou between 2 bboxes """ xmin = max(bbox1[0], bbox2[0]) # x_left ymin = max(bbox1[1], bbox2[1]) # y_top xmax...
from lib import action class MoveCardAction(action.BaseAction): def run(self, card_id, target_list_id, target_board_id=None, api_key=None, token=None): if api_key: self._set_creds(api_key=api_key, token=token) card = self._client().get_card(card_id) if not target_board_id: ...
from notedrive.lanzou import CodeDetail, LanZouCloud, download downer = LanZouCloud() downer.ignore_limits() downer.login_by_cookie() def example1(): print(downer.login_by_cookie() == CodeDetail.SUCCESS) def example2(): file_path = '/Users/liangtaoniu/workspace/MyDiary/tmp/weights/yolov3.weight' downe...
import unittest from model import prediction_with_model import pandas as pd import numpy as np class PredictionWithModel(unittest.TestCase): def test_prediction(self): d = pd.read_csv(r"C:\Users\Toan\Documents\GitHub\colossi\static\temp\cc7deed8140745d89f2f42f716f6fd1b\out_imac_atlas_expression_v7.1.tsv", ...
# 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 agreed to in writing, ...
import logging import numpy as np from geosolver.diagram.states import PrimitiveParse from geosolver.diagram.computational_geometry import line_length, circumference, \ distance_between_circle_and_point, midpoint, line_unit_vector, line_normal_vector, \ distance_between_points_squared, distance_between_line_a...
""" This module defines tests to run against the fields module. https://docs.djangoproject.com/en/3.0/topics/testing/ """ import random import string from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from...
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation fig = plt.figure() ax = fig.add_subplot(111) N = 10 x = np.random.rand(N) y = np.random.rand(N) z = np.random.rand(N) circles, triangles, dots = ax.plot(x, 'ro', y, 'g^', z, 'b.') ax.set_ylim(0, 1) plt.axis('off') def update(d...
from configs import transforms_config from configs.paths_config import dataset_paths DATASETS = { 'ffhq_encode': { 'transforms': transforms_config.EncodeTransforms, 'train_source_root': dataset_paths['ffhq'], 'train_target_root': dataset_paths['ffhq'], 'test_source_root': dataset_paths['celeba_test'], 'tes...
# -*- coding: utf-8 -*- # # Copyright © 2013 Spyder Project Contributors # Licensed under the terms of the MIT License # (see LICENSE.txt for details) __version__ = '0.2.0.dev0' # ============================================================================= # The following statements are required to register this 3rd...
import setuptools with open("requirements.txt", "r") as fp: required = fp.read().splitlines() setuptools.setup( name="paperwhisperer", version="0.1.0", author="Valerio Velardo", author_email="valerio@thesoundofai.com", description="Speech summaries of arxiv papers retrieved via keyword " ...
#!/usr/bin/env python """Portable email sender. Acts as replacement for mail, Mail, mailx, email (cygwin). Message body is taken from stdin. """ from __future__ import print_function import email.mime.text import getpass import logging import optparse import os import smtplib import socket import sys def main(): ...
from abc import ABC, abstractmethod from typing import Iterable, Tuple, Iterator, List from .._typing import KeyType, LabelType, ItemType from ._Binner import Binner class TwoPassBinner(Binner[KeyType, LabelType], ABC): """ Class for binners which require an initial pass over the set of items being binne...
# Copyright 2013-2019 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 RGetoptlong(RPackage): """This is yet another command-line argument parser which wraps the...
from pathlib import Path import sys TEST_MODE = bool(len(sys.argv) > 1 and sys.argv[1] == "test") def phase1(v): return next(v[i]*v[j] for i in range(len(v)) for j in range(i,len(v)) if v[i]+v[j] == 2020) def phase2(v): return next(v[i]*v[j]*v[k] for i in range(len(v)) for j in range(i,len(v)) for k in range...
import sys, logging, os, random, math, open_color, arcade #check to make sure we are running the right version of Python version = (3,7) assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1]) #turn on logging, in case we have to leave ourselves debugging messa...
from systems.plugins.index import BaseProvider from utility.filesystem import remove_dir import pathlib import os class Provider(BaseProvider('module', 'local')): def initialize_instance(self, instance, created): instance.remote = None instance.reference = 'development' def store_related(s...
# -*- coding: utf-8 -*- class OpenKongqiError(Exception): pass class ConfigError(OpenKongqiError): pass class CacheError(OpenKongqiError): pass class SourceError(OpenKongqiError): pass class FeedError(OpenKongqiError): pass class UUIDNotFoundError(OpenKongqiError): pass class APIKe...
# Copyright 2018 Lukas Jendele and Ondrej Skopek. # Adapted from The TensorFlow Authors, under the ASL 2.0. # # 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/licen...
#!/usr/bin/python3 """ Accepts path to dependency-overrides.yaml file in the project as argument. If dependencies are specified in dependency-overrides.yaml, adds the dependencies to dependency_overrides section in pubspec.yaml This is file is used in GITHub actions to resolve dependencies. """ import argparse import r...
"""ddd_29343 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
#r# ============================================ #r# Controlled half-wave rectifier with an SCR #r# ============================================ #r# This example shows the simulation of a controlled half-wave rectifier with an SCR with an RL load ######################################### IMPORT MODULES #############...
""" Testing for the partial dependence module. """ import numpy as np import pytest import sklearn from sklearn.inspection import partial_dependence from sklearn.inspection._partial_dependence import ( _grid_from_X, _partial_dependence_brute, _partial_dependence_recursion ) from sklearn.ensemble import Gr...
""" PASSENGERS """ numPassengers = 2878 passenger_arriving = ( (2, 9, 4, 1, 1, 0, 6, 7, 6, 7, 2, 0), # 0 (3, 5, 5, 2, 5, 0, 5, 6, 5, 1, 1, 0), # 1 (2, 11, 10, 3, 3, 0, 6, 3, 1, 4, 0, 0), # 2 (4, 2, 5, 3, 4, 0, 5, 10, 7, 5, 2, 0), # 3 (3, 12, 11, 1, 4, 0, 4, 8, 3, 3, 3, 0), # 4 (0, 12, 6, 3, 3, 0, 4, 3, 3, ...
import sqlalchemy as sa from flask_apispec import doc, marshal_with from webservices import args from webservices import utils from webservices import filters from webservices import schemas from webservices.utils import use_kwargs from webservices.common.views import ApiResource from webservices.common import models ...
# Copyright 2021 DeepMind Technologies Limited # # 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 agr...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
from selenium import webdriver import time import math # LINK = 'https://suninjuly.github.io/selects1.html' LINK = 'https://suninjuly.github.io/selects2.html' def calc_sum(num1, num2): return num1 + num2 try: browser = webdriver.Chrome() browser.get(LINK) num1 = browser.find_element_by_id('num1')....
#!c:\users\kryukax1\documents\github\react_django\django-rest-tasking\venv\scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
import io import textwrap from collections import defaultdict, OrderedDict from contextlib import contextmanager from .._utils import bits_for, flatten from ..hdl import ast, rec, ir, mem, xfrm __all__ = ["convert", "convert_fragment"] class ImplementationLimit(Exception): pass _escape_map = str.maketrans({ ...
from __future__ import annotations import glfw import pygame import OpenGL.GL as gl from PIL import Image import os, json from copy import deepcopy from components.data import BBox, ImageInfo def yolo_to_x0y0(yolo_pred, input_w, input_h): # yolo_x = (x+(w/2))/img_w # x_c = (yolo_x) * img_w - (w/2) # yol...
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of th...
#!/usr/bin/env python3 # Copyright 2019 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. """Emits a formatted, optionally filtered view of the list of flags. """ from __future__ import print_function import argparse impor...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function from . import script_util as S import redhawk import redhawk.utils.key_value_store as KVStore import redhawk.utils.util as U import os import optparse usage = "%prog listfiles" description = S.MakeStringFromTemplate( ""...
import numpy as np import pandas as pd from matplotlib import pyplot as plt df = pd.read_csv('data/dataset.csv', encoding='utf-8') def plot_df_counts(df): x_ticks = np.asarray(list(set(df['count']))) xx = np.arange(np.max(x_ticks) + 1) yy = np.bincount(df['count']) for x, y in zip(xx, yy): p...
# 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...
import sys import numpy as np import scipy.optimize as opt class Symbol(object): """ A class representing a single unit in the boolean SAT problem. This can either refer to an atomic boolean, or a constraint based on integer variables """ pass class Boolean(Symbol): def __init__(self, name): ...
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6320, generator: {generator}) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ---------------------------------------...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import time import threading import torch from polymetis import RobotInterface from utils import check_episode_log success = [] exceptions ...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ########################################################################### from collections import OrderedDict import numpy as np def indent(s): return "\n...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Presidentielcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Base class for RPC testing import logging import optparse import os import sys import shutil ...
# This file is part of Neotest # See http://www.neotest.io for more information # This program is published under the MIT license from .wrapper import LogClientBase, LoggerThread, logging __all__ = ["start", "stop", "getLogger", "getQueue", "LogClientBase"] __logth_instance = None def start(level=logging.PRINT): ...
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # See file LICENSE for terms. # This file is a copy of what is available in a Cython demo + some additions from __future__ import absolute_import, print_function import os from distutils.sysconfig import get_config_var, get_python_inc from setuptools im...
import numpy as np import pandas as pd from pathlib import Path from ast import literal_eval def convert_scores_literal(score): try: return literal_eval(score) except: return f'Error: {score}' def pts_diff(row): try: winner_pts = sum(row['winning_team_scores_lst']) loser_...
total_urls = []
from django.apps import AppConfig class TeamConfig(AppConfig): name = 'team'
# -*- coding: utf-8 -*- # Copyright © 2007-2008 Stockholm TreeAligner Project # Author: Torsten Marek <shlomme@gmx.net> # Licensed under the GNU GPLv2 """This module contains classes to create a result builder from a query AST. """ from collections import defaultdict from itertools import count from nltk_contrib.tige...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Google Chrome Preferences file event formatter.""" from __future__ import unicode_literals import unittest from plaso.formatters import chrome_preferences from tests.formatters import test_lib class ChromeContentSettingsExceptionsFormatter( test_...
from glob import glob import pydicom from pydicom import dcmread import os import numpy as np import nibabel as nib def dicom_to_nifti(folder): dicoms = None return def read_a_dicom(dicom_file): ds = dcmread(dicom_file) def get_array(dcm_file): ds = dcmread(dcm_file) location = float(ds[0x0020...
#from MusicTheory.scale.Scale import Scale import MusicTheory.scale.Scale from MusicTheory.scale.ScaleIntervals import ScaleIntervals #from MusicTheory.pitch.PitchClass import PitchClass #from MusicTheory.pitch.OctaveClass import OctaveClass #from Framework.ConstMeta import ConstMeta from MusicTheory.pitch.PitchClass i...
# 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...
import matplotlib.pyplot as plt import seaborn as sns import numpy as np import os from typing import Union import pandas as pd import signatureanalyzer as sa # Cluster Color map COLORMAP={ 0:'#0073C2FF', 1:'#EFC000FF', 2:'#868686FF', 3:'#CD534CFF', 4:'#7AA6DCFF', 5:'#003C67FF', } COLORMAP2={ ...