content
stringlengths
5
1.05M
from __future__ import division import sklearn.datasets as ds from DSTK.ProjectedGradientDescentLogit import ProjectedGradientDescentLogit import numpy as np from sklearn.metrics import accuracy_score cancer_ds = ds.load_breast_cancer() data = cancer_ds['data'] target = 1-cancer_ds['target'] means = data.mean(axis...
import sys, os sys.path.insert(0, '../..') from models.components.encoders.SimpleSlotEncoder import SimpleSlotEncoder from models.components.decoders.LSTMDecoderWithAttentionAndSelfAttention import LSTMDecoderWithAttentionAndSelfAttention import torch.nn as nn import torch class NLG_SimpleEncoder_LSTMDecoderWithAtten...
import json import os import torch from torch.utils.data import Dataset, DataLoader from torch.nn.utils.rnn import pad_sequence from transformers import AutoTokenizer from torchfly.text.datasets import Seq2SeqDataset # pylint:disable=no-member class TextRLCollator: def __init__(self, config, tokenizer): ...
# -*- coding: utf-8 -*- """ Created on Tue Jan 5 12:57:02 2021 @author: Brandon Caron2 """ import winreg def foo(hive, flag): aReg = winreg.ConnectRegistry(None, hive) aKey = winreg.OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, winreg.KEY_READ | flag) ...
# -*- coding: utf-8 -*- # # malcolm documentation build configuration file import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, l...
#!/usr/bin/python # -*- coding: utf-8 -*- import os from os.path import abspath, dirname, join, exists import shutil import time from jinja2 import FileSystemLoader, Environment from tornado.options import parse_config_file # required for importing configuration import thumbor.app import thumbor.handlers # NOQA R...
import sys from twitterbot.twitterfeed import * import twitterbot_config # Send a tweet send_text_tweet(twitterbot_config, sys.argv[1])
#!/usr/bin/env python3 # # Copyright 2019 Canonical 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 o...
import sys, os, inspect if '/home/ubuntu/shared/GitHub' in sys.path: sys.path.remove('/home/ubuntu/shared/GitHub') try: import generative_playground except: import sys, os, inspect my_location = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # sys.path.append('../../../....
import sys from collections import Counter lines = open(sys.argv[1], 'r') for line in lines: line = line.replace('\n', '').replace('\r', '') if len(line) > 0: parts = line.split(' | ') names = parts[0].split(' ') countsInPattern = Counter(parts[1]) matching = [] ...
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Ingredient from recipe.serializers import IngredientSerializer INGREDIENTS_URL = reverse('recipe:ingred...
import numpy as np import pytest import stockroom.cli as cli from click.testing import CliRunner from stockroom import StockRoom def test_version(): import stockroom runner = CliRunner() res = runner.invoke(cli.stock, ["--version"]) assert res.exit_code == 0 assert res.stdout == f"stock, version ...
from typing import * import shlex def shell_join(argv: Iterable[str]) -> str: '''See [shlex.join][] in the Python stdlib. Playbook usage: some_cmd: "{{ ('blah', 'arg one', 'arg two') | shell_join }} # => "blah 'arg one' 'arg two'" [shlex.join]: https://docs.python.org/3.8/lib...
# coding: utf-8 # Author: Leo BRUNEL # Contact: contact@leobrunel.com # This file is part of Wizard # MIT License # Copyright (c) 2021 Leo brunel # 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 So...
import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm import json from bc_requests import get_chain from argparse import ArgumentParser from pprint import pprint def get_time_diff(filename): """ Finds and returns all the (block timestamp - transaction timestamp) differences in the c...
from setuptools import setup setup( name='social-auth-liu', version='0.0.4', py_modules=['social_liu'], url='https://github.com/Baljan/python-social-auth-liu', license='MIT', author='Olle Vidner', author_email='olle@vidner.se', description='', install_requires=[ 'social-auth...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ About: Basic example to test quantum connection with Qontainernet """ import time import csv import os import numpy as np from itertools import filterfalse from comnetsemu.cli import CLI from comnetsemu.net import Containernet from mininet.link impo...
# flake8: noqa: F401 import argparse, logging, sys log = logging.getLogger(__name__) def setup_logging(args): """setup_logging checks the given arg for the "default" flag and sets up logging""" if getattr(args,'debug', False): level = logging.DEBUG else: level = logging.INFO ...
import mxnet as mx import numpy as np class MultiBoxMetric(mx.metric.EvalMetric): """Calculate metrics for Multibox training """ def __init__(self, eps=1e-8): super(MultiBoxMetric, self).__init__('MultiBox') self.eps = eps self.num = 2 self.name = ['CrossEntropy', 'SmoothL1'] ...
# 人脸识别 import matplotlib.pyplot as plt import face_recognition import cv2 as cv import pathlib import time import os image = face_recognition.load_image_file(r"D:\Github\DL\face_recognition-master\tests\test_images\obama.jpg") feature_1 = face_recognition.face_encodings(image)[0] features = [] for d, sub_d, file_name...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Esse módulo é responsável por criar IT Services dentro do Zabbix a partir dos hosts e triggers cadastradas dentro do Mesmo. Utiliza-se do módulo util para iniciar a conexão um servidor Zabbix e requer que as bibliotecas presentes no arquivo requirements.txt esteja ins...
import numpy as np import sys sys.path.append('../tools/') import tools class Dense(): """ Dense Layer used for the DNN object Parameters: weights: numpy array() weight matrix output: output of the layer deriv: derivative of activation activation_name: name of activation, us...
from math import sqrt from typing import List, Tuple from opt_einsum_fx import jitable, optimize_einsums_full import torch from torch import fx from e3nn import o3 from e3nn.util import prod from ._instruction import Instruction def _sum_tensors(xs: List[torch.Tensor], shape: torch.Size, like: torch.Tensor): i...
import bpy import arm.utils import arm.make_state as make_state import arm.material.cycles as cycles import arm.log as log add_mesh_contexts = [] def disp_linked(output_node): linked = output_node.inputs[2].is_linked if not linked: return False # Armory PBR with unlinked height socket l = outp...
# -*- coding: utf-8 -*- """ Created on Tue Sep 14 18:52:59 2021 @author: Gerry """ def skriv_firkant(størrelse): for j in range(størrelse): for i in range(størrelse): print("*", end="") print() høyde = int(input("Høyde: ")) #bredde = int(input("Bredde: ")) skriv_firkant(3) p...
from models.imports import * from imports import * """ The Input is a flatten image so if the img shape is 3,112,112 the input for this model if 3*112*112 """ class Clf(Module): def __init__(self) -> None: super().__init__() """ Intialization """ output = config["output"] ...
def get_model(): """ Creates our model with access to intermediate layers. This function will load the VGG19 model and access the intermediate layers. These layers will then be used to create a new model that will take input image and return the outputs from these intermediate layers from the VGG model. ...
import itertools import pathlib import uuid def interleave(*iterables): for item in zip(*iterables): yield from item def unique(prefix=''): return f'{prefix}{uuid.uuid4().int}' def multiline(*lines): return '\n'.join(str(line) for line in lines if line is not None) def indent(text, indt=4): ...
__version__ = "2020.11.18"
#! /usr/bin/env python3 import sys, re state = "outer" name = "unknown" data = bytearray() for line in sys.stdin: if state == "outer" and line.startswith("/*"): state = "comment" elif state == "comment": if "*/" in line: state = "outer" elif "Fontname:" in line: ...
# 作者:匿名用户 # 链接:https: // www.zhihu.com/question/22083486/answer/20449598 # 来源:知乎 # 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 import sys def ip_to_str(ip): _ip = [None] * 4 _ip[0] = (ip & 0xff000000) >> 24 _ip[1] = (ip & 0x00ff0000) >> 16 _ip[2] = (ip & 0x0000ff00) >> 8 _ip[3] = (ip & 0x000000ff) re...
""" The partition module provides a way of finding tiles a unit can reach. """ from .common import tile_is_solid def partition(stage, location): """ Return the region of a stage that is accessible from a location. The location is always reachable from itself. Arguments: stage: a Stage whose s...
from cluster_pack.uploader import ( upload_env, upload_zip, upload_spec ) from cluster_pack.packaging import ( zip_path, get_editable_requirements, get_non_editable_requirements, get_default_fs, detect_packer_from_file, Packer, CONDA_PACKER, PEX_PACKER )
""" 721. Accounts Merge Example 1: Input: accounts = [["John", "johnsmith@mail.com", "john00@mail.com"], ["John", "johnnybravo@mail.com"], ["John", "johnsmith@mail.com", "john_newyork@mail.com"], ["Mary", "mary@mail.com"]] Output: [["John", 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com'], ["J...
import numpy as np import xarray from marques_utils import gen_sample from brainio_collection.packaging import package_data_assembly from brainio_base.assemblies import DataAssembly ASSEMBLY_NAME = 'schiller.Schiller1976c' SPATIAL_FREQUENCY_STIM_NAME = 'dicarlo.Marques2020_spatial_frequency' def collect_data(): ...
import nltk,re,time,sys ,codecs,os,requests import xml.etree.ElementTree as ET from lxml import etree from nltk.corpus import stopwords from textblob import TextBlob from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common.keys...
"""Project: Eskapade - A python-based package for data analysis. Macro: esk602_read_csv_to_spark_df Created: 2017/05/31 Description: Tutorial macro for reading CSV files into a Spark data frame Authors: KPMG Advanced Analytics & Big Data team, Amstelveen, The Netherlands Redistribution and use in source an...
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # 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 modifications or derivative wo...
#!/usr/bin/python # -*- coding: utf-8 -*- # moldynplot.cpptraj2hdf5.py # # Copyright (C) 2012-2017 Karl T Debiec # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. See the LICENSE file for details. """ """ ################################### MODULES ...
#!/usr/bin/env python3 # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """A script to replace deprecated uses of `globs`, `rglobs`, and `zglobs` in BUILD files with a direct list of files and globs. Run `python3 fix_deprecated_globs_us...
from backend.common.consts.suggestion_state import SuggestionState from backend.common.consts.suggestion_type import SuggestionType from backend.common.models.account import Account from backend.common.models.suggestion import Suggestion from backend.common.queries.suggestion_query import SuggestionQuery def test_sug...
import numpy as np import lookup from toolbox import loop3d from krakenUtils import mdist2d, idx2coord ## PARAMETERS FOODGATHERED = 20 MAXSTEPS = 50 PHEROMONEDECAY = 0.8 ## BLOCK HARDNESS IMPASSABLE = ("minecraft:stone", "minecraft:granite", "minecraft:diorite", "minecraft:andesite") AIR = ("minecraft:water",) + look...
# Python Version: 3.x """ the module for yosupo's Library Checker (https://judge.yosupo.jp) """ import os import re import subprocess import sys import urllib.parse from typing import * import requests import toml import onlinejudge._implementation.logging as log import onlinejudge._implementation.testcase_zipper im...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian from a2c_ppo_acktr.utils import init class Flatten(nn.Module): def forward(self, x): return x.view(x.size(0), -1) class Policy(nn.Module): ...
import gepy test_job = gepy.job(name="test") test_job.workload.append(gepy.serial_command()) test_job.workload.append(gepy.user_script('echo HELLO')) test_job.workload.append(gepy.parallel_command(binary='lmp_any', args=['-in', 'in.lammps'])) test_job.modules.append('lammps') test_job.make_parallel(mode='mpi', slots='1...
import operator from typing import List, NamedTuple, Union __all__ = ["Import", "ImportFrom", "Name"] class Import(NamedTuple): lineno: int column: int name: str package: str def __len__(self) -> int: return operator.length_hint(self.name.split(".")) def is_match_sub_packages(self, ...
from typing import Callable, Optional, Tuple, Union import numpy as np from dataflow.datasets import TransformedDataset, get_train_dataset, get_train_noval_sbdataset, get_val_dataset from torch.utils.data import DataLoader from torch.utils.data.dataset import ConcatDataset, Subset import ignite.distributed as idist ...
#!/usr/bin/python import sys, getopt import os.path import os import sys import cgi sys.path.append("/var/www/converter/scripts/") from daeConverter import * import string import zipfile from cStringIO import StringIO import time import kmzConverter import shutil if __name__ == '__main__': inputfile = '' ...
from src.adb import adb from src.screen_shot import screen_shot from src.config import config # 无限循环 def loop(device): while True: user_answer = input("是否需要截图 y/n:\n") if user_answer == 'y': shot.screen_shot(adb, device, config.save_path, config.delete_shot) elif user_answer ==...
from __future__ import absolute_import, division, print_function from iotbx import pdb from mmtbx.conformation_dependent_library.testing_utils import get_geometry_restraints_manager from mmtbx.regression import model_1yjp from six.moves import range answers = {'omegas' : [ 171.5156431406436, -1...
a = True or False
from django.contrib import admin from .models import Message class MessageAdmin(admin.ModelAdmin): """留言消息管理 """ list_display = ('name', 'email', 'active', 'posted') #后台管理呈现字段 list_filter = ('active', 'posted') #留言过滤条件 时间/有效性 search_fields = ('name', 'message') #留言消息搜索 ordering = ('-poste...
# class Torrent9Item(): INCREMENT = 0 def __init__(self, type, url, name, size, seed, leech): self.id = Torrent9Item.incrementId() self.type = type self.url = url self.name = name.replace("<span style=\"color:#337ab7\">", "").replace("</span>", "") # Search add "blue text"...
import json import logging import os from typing import Any, Dict, List, Optional, Tuple import helpers.dbg as dbg import helpers.old.user_credentials as houser import helpers.system_interaction as hsyste _LOG = logging.getLogger(__name__) def conda_system(cmd: str, *args: Any, **kwargs: Any) -> int: """ Wh...
# Copyright 2020 The HuggingFace Team. 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 applicabl...
#!/usr/bin/env python """ @package mi.core.instrument.instrument_dict @file mi/core/instrument/instrument_dict.py @author Steve Foley @brief A package for classes that provides some base behavior for manages metadata and content for parameters, commands and drivers for the driver or protocol classes. """ __author__ =...
from __future__ import division from setuptools import find_packages from setuptools import setup, Extension from setuptools.command.build_ext import build_ext import setuptools import sys import os # Official trick to avoid pytest-runner as requirement if not needed needs_pytest = {"pytest", "test", "ptr"}.intersect...
from array import array from IPython.display import display from traitlets import ( Unicode, List, Instance, Float, Int, Bool, Union, Enum, observe ) from traittypes import Array from ipywidgets import ( widget_serialization, DOMWidget, Widget, register, Color, ColorPicker, Dropdown, FloatText...
from django.conf.urls import include, url from .views import home # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = [url(r'^$', home, name='home'), # Uncomment the admin/doc line below to enable admin documentation: ...
from rest_framework import viewsets, status from rest_framework.decorators import action from rest_framework.response import Response from core.customer.dto import UserSerializer, PasswordSerializer from core.customer.models import User class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() ...
from rbw import np from . import pybullet import inspect import functools from abc import ABC, abstractmethod phys_keys = ['lateralFriction', 'mass', 'restitution', 'rollingFriction', 'linearDamping'] def clean_params(phys_params): return {k:v for k,v in phys_params.items() if k in phys_keys} class...
import discord from discord.ext import commands from helpers import checks class ReactionRoles(commands.Cog): """For adding roles utility.""" def __init__(self, bot): self.bot = bot @commands.group(invoke_without_command=True, aliases=("rm",)) @checks.is_community_manager() async def rol...
# Python-functions2 # 1. Define a function to compute the square of a number def squares(a): squared = a*a return squared print(squares(10))
import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation def example1(): fig, ax = plt.subplots() xdata, ydata = [], [] ln, = ax.plot([], [], 'r-', animated=False) def init(): ax.set_xlim(0, 2 * np.pi) ax.set_ylim(-1, 1) return ln, ...
from dataclasses import dataclass from typing import List from aiohttp import web from openapi.data.db import dataclass_from_table from openapi.db.path import SqlApiPath from openapi.pagination import cursorPagination, offsetPagination from openapi.spec import op from .db import DB series_routes = web.RouteTableDef...
#!/usr/bin/env python3 #coding:utf-8 from zencad import * #Размеры платы. plate_x = 56 plate_y = 85 plate_z = 1 #толщина стенок t = 1.5 #Внутренний размер коробки. in_x = plate_x + 1 in_y = plate_y + 1 #Габаритные размеры x = in_x + 2 * t y = in_y + 2 * t z = 5 hole_coords = [ (3.5, 3.5), (plate_x - 3.5, 3.5), ...
#!/usr/bin/env python3 """Simulate the Monty Hall problem. Before opening door, add a new contestant -Martian- that can choose randomly between the two closed doors """ import argparse, \ random def simulate(num_doors, switch, verbose): """(int, bool [,bool]): [bool, bool] Carry out the game fo...
class A(object): def __init__(self): print("A is called.") class B(object): def __init__(self): print("B is called.") class C(A, B): def __init__(self): super(C, self).__init__() c = C()
# Copyright (c) 2016 Thomas Nicholson <tnnich@googlemail.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 # notice, t...
# -*- coding: utf-8 -*- # PyContourlet # # A Python library for the Contourlet Transform. # # Copyright (C) 2011 Mazay Jiménez # # 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 ...
import matplotlib.pyplot as plt import numpy as np from matplotlib.font_manager import FontProperties colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'] fig, ax = plt.subplots(figsize=(8, 8)) bar_width = 0.35 def create_figure(title): fig.suptitle('Classification: ' + title) plt.show(block=False) def create...
import json import timeit import nltk from HanTa import HanoverTagger as ht from tqdm import tqdm from word import * import os from nltk.corpus import stopwords from spacy.lang.de.stop_words import STOP_WORDS BOOK = 'books/12mo/Meine Sachen.txt' # BOOK = 'books/18mo/Gute Nacht, kleiner Löwe!.txt' # BOOK = 'books/12mo/...
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pt_law_parser.converter import LAOrganizer, LawConverter def parse_document(file_name): rsrcmgr = PDFResourceManager(caching=True) fp = file(file_name, 'rb') device = LawConverter(rsrcmgr, l...
import multiprocessing, os from django.conf import settings bind = "backend:8000" workers = multiprocessing.cpu_count() * 2 + 1 worker_class = "gevent" worker_connections = 1000 accesslog = os.path.join(settings.RUN_DIR, 'gunicorn-access.log') access_log_format = '%(t)s|"%(r)s"|%(s)s|%(T)s'
# -*- coding: utf-8 -*- """ # Log record to a file logging.basicConfig(filename='logging.txt') # more complex logging.getLogger() # etc """ import logging logging.basicConfig(level=logging.INFO) # Logging rank logging.debug('Hello world!') logging.info('Hello world!') logging.warning('Hello world!') logging.err...
import taichi as tc def create_scene(): downsample = 1 width, height = 960 / downsample, 540 / downsample camera = tc.Camera('thinlens', width=width, height=height, fov=50, origin=(1, 1, 3), look_at=(0, -0.6, 0), up=(0, 1, 0), focus=(0, 0, 0), aperture=0.08) scene = tc.Scene() ...
import utils, SMF import numpy as np train_data = utils.read('train_user_item_score.txt') valid_data = utils.read('validation_user_item_score.txt') edge_list = utils.read('users_connections.txt') MAX_ID = int(np.max(train_data, axis=0)[0]) LIMIT = 1 network, network_transpose = utils.edge_list_to_adj_list(MAX_ID, e...
import subprocess class SBEBatchFile: def __init__(self, paths=None, processing_paths=None): """ :param file_paths: SBEProsessingPaths """ self._paths = paths self._processing_paths = processing_paths def create_file(self): with open(self._processing_paths('file...
#coding:utf-8 from __future__ import unicode_literals from django.db import models # Create your models here. class StockBasics(models.Model): """ 获取沪深上市公司基本情况 code,代码 name,名称 industry,所属行业 area,地区 pe,市盈率 outstanding,流通股本 totals,总股本(万) totalAssets,总资产(万) liquidAssets,流动资产 fixedAssets,固定资产 reserved,公积金...
from itertools import chain def cat_key(c): categories = {' ': None, string.ascii_lowercase: 'lower', string.ascii_uppercase: 'upper'} for key in categories: if c in key: return categories[key] else: return 'other' print(cat_key('a'), cat_key('A'), cat_...
# flake8: noqa from .v5 import *
import re from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connection from django.db.models import Count, Q from devel.models import UserProfile from main.utils import cache_function from main.models import Packag...
from collections import deque def main(): express = input().split() stack = deque([]) for i in express: if i.isdecimal(): stack.append(i) else: output = stack.pop() output = stack.pop() + i + output stack.append(str(eval(output))) output...
# Copyright (C) 2021 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, ...
try: from cStringIO import StringIO except ImportError: # pragma: no cover from StringIO import StringIO INDENT = ' ' * 4 class DedentException(Exception): """ Raised to signify that decreasing the indent level beyond zero is impossible. """ class IndentManager(object): """ A conte...
from __future__ import print_function import cv2 import numpy as np import argparse import os src = None erosion_size = 0 max_elem = 2 max_kernel_size = 21 title_trackbar_element_shape = 'Element:\n 0: Rect \n 1: Cross \n 2: Ellipse' title_trackbar_kernel_size = 'Kernel size:\n 2n +1' title_erosion_window = 'Erosion D...
from pathlib import Path import lingpy as lp from clldutils.misc import slug from pylexibank import Dataset as BaseDataset from pylexibank.util import getEvoBibAsBibtex from pylexibank import progressbar from pylexibank import Concept, Language import attr #from pyconcepticon import Concepticon @attr.s class CustomC...
from re import compile, match REGEX = compile('www\.\w+\.[^#]+') def remove_url_anchor(url): return match(REGEX, url).group(0) # def remove_url_anchor(url): # return url.split('#')[0]
import os import typing from typing import Any from ruamel.yaml import YAML from conda_forge_tick.xonsh_utils import indir from conda_forge_tick.migrators.core import MiniMigrator if typing.TYPE_CHECKING: from ..migrators_types import AttrsTypedDict class CondaForgeYAMLCleanup(MiniMigrator): # if you add a ...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from future.builtins import super from iris_sdk.models.base_resource import BaseResource from iris_sdk.models.data.rate_centers import RateCentersData XML_NAME_RATE_CENTERS = "RateCenterResponse" XPATH_RATE_CENTERS = "/ratecenters...
import unittest from uwsgi_tools import uwsgi_structs as uw class TestUwsgiPacketHeader(unittest.TestCase): header = uw.UwsgiPacketHeader(0, 166, 0) header_bytes = b'\x00\xa6\x00\x00' def test_packet_header_serializes(self): expected = self.header_bytes self.assertEqual(expected, bytear...
#!/usr/bin/python # # Installs useful dependencies for dfplayer development. import os import shutil import subprocess import sys _PILLOW_DEPS = [ 'libfreetype6-dev', 'libjpeg8-dev', 'liblcms2-dev', 'libtiff4-dev', 'libwebp-dev', 'tcl-dev', 'tk-dev', 'zlib1g-dev', ] _PLAYER_DEPS =...
#!/usr/bin/env python3 # Copyright (C) 2020 Unbabel # # 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 o...
from .pipeline import FeatureJoin __all__ = [ "FeatureJoin" ]
# 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...
""" LanXin+ OpenAPI LanXin+ OpenAPI Platform # noqa: E501 Generated by: https://openapi.lanxin.cn """ import re # noqa: F401 import sys # noqa: F401 from lanxinplus_openapi.api_client import ApiClient, Endpoint as _Endpoint from lanxinplus_openapi.model_utils import ( # noqa: F401 check_allowed...
import numpy as np def print_statistics(processing_times, batch_size): print('\nprocessing time for all iterations') print('average time: {:.2f} ms; average speed: {:.2f} fps' .format(round(np.average(processing_times), 2), round(1000 * batch_size / np.average(processing_times), 2))...
from GUI import Window, Label, Font, application from GUI.StdColors import red from GUI.StdFonts import system_font from testing import say num_rows = 6 italic_font = Font("Times", 2 * system_font.size, ['italic']) def dump_font(caption, f): say(caption, f.family, f.size, f.style) dump_font("System font:", system_...
#!/usr/bin/env python import os from setuptools import setup dir_path = os.path.dirname(os.path.realpath(__file__)) with open("README.md", "r") as fh: long_description = fh.read() setup(name='demo_extension', version='1.0.0', author='Kodexa', description='An example of creating an extension p...
#!/usr/bin/python import os import sys import subprocess import re import shutil import getopt import pydas import logging from logsetting import getHandler, StreamToLogger # create logger logger = logging.getLogger('server') logger.setLevel(logging.INFO) stdout_logger = logging.getLogger('STDOUT') stdout_logger.set...