content
stringlengths
0
894k
type
stringclasses
2 values
from flask import Flask, Request, jsonify, request from src.driver import FirestoreDriverImpl from src.interactor import SolverInteractor from src.repository import RoomRepositoryImpl from src.rest import BaseException, ClientException, SolverResource solver_resource = SolverResource( solver_usecase=SolverInteract...
python
import netifaces import time from collections import namedtuple from aplus import Promise from openmtc_server.exc import InterfaceNotFoundException from openmtc_server.transportdomain.NetworkManager import NetworkManager Interface = namedtuple("Interface", ("name", "addresses", "hwaddress")) Address = namedtuple("Add...
python
import elasticsearch import json import click from toolz import iterate, curry, take from csv import DictReader from elasticsearch.helpers import streaming_bulk nuforc_report_index_name = 'nuforc' nuforc_report_index_body = { "mappings": { "properties": { "text": { "type": "text"...
python
import numpy as np import sys class RobotData: """ Stores sensor data at a particular frame Attributes ---------- position : tuple (x,y) tuple of the robot position rotation : float angle of robot heading clockwise relative to up (north) forward_dir : tuple (x,y) unit vector indicating the forward direct...
python
from makeit.utilities.fastfilter_utilities import Highway_self, pos_ct, true_pos, real_pos, set_keras_backend from makeit.utilities.fingerprinting import create_rxn_Morgan2FP_separately from rdkit import Chem from rdkit.Chem import AllChem, DataStructs from makeit.interfaces.scorer import Scorer import numpy as np impo...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- #from distutils.core import setup import glob from setuptools import setup readme = open('README.md').read() setup( name='ReMoTE', version='0.1', description='Registration of Mobyle Tools in Elixir', long_description=readme, author='Hervé Ménager', ...
python
class StateMachine: """A simple state machine""" def __init__(self): self.__states = {} #:dict[string] -> [(check, event, next)] self.actions = {} #:dict[string] -> action self.currentState = "start" #:string self.addState("start") def addState(self, name): """reg...
python
import numpy as np def meshTensor(value): """**meshTensor** takes a list of numbers and tuples that have the form:: mT = [ float, (cellSize, numCell), (cellSize, numCell, factor) ] For example, a time domain mesh code needs many time steps at one time:: [(1e-5, 30), (1e-4, 30), 1e-3...
python
import numpy C_3 = numpy.array([1, 2]) / 3 a_3 = numpy.array([[3, -1], [1, 1]]) / 2 sigma_3 = numpy.array([[[1, 0], [-2, 1]], [[1, 0], [-2, 1]]]) C_5 = numpy.array([1, 6, 3]) / 10 a_5 = numpy.array([[11, -7, 2], [2, 5, -1], [-1, 5, 2]]) / 6 sigma_5 = numpy.array([[[40, 0, 0], [-124, 100, 0], ...
python
from bs4 import BeautifulSoup import urllib, requests, re import json import datetime from datetime import date def cnt1(): year=datetime.datetime.now().year month=datetime.datetime.now().month month=str(month) day=datetime.datetime.now().day if len(str(month)) == 1 : month="0"+str(month)...
python
"""Time Calculate the time of a code to run. Code example: product of the first 100.000 numbers. """ import time def product(): p = 1 for i in range(1, 100000): p = p * i return p start = time.time() prod = product() end = time.time() print('The result is %s digits long.' % len(str(prod))) print(...
python
from roboclaw import Roboclaw from time import sleep rc = Roboclaw("/dev/ttyACM0",115200) rc.Open() address=0x80 #rc.ForwardM1(address, 50) # sleep (5) rc.ForwardM1(address, 0)
python
from pathlib import Path from typing import Optional import config # type: ignore import hvac from aiohttp_micro import AppConfig as BaseConfig # type: ignore from config.abc import Field from passport.client import PassportConfig class StorageConfig(config.PostgresConfig): host = config.StrField(default="loca...
python
import uuid from operator import attrgetter from typing import List from confluent_kafka import Consumer, TopicPartition from confluent_kafka.admin import AdminClient, TopicMetadata from kaskade.config import Config from kaskade.kafka import TIMEOUT from kaskade.kafka.group_service import GroupService from kaskade.ka...
python
#!/usr/bin/env python from __future__ import print_function, division import os import sys sys.path.append(os.path.dirname(sys.path[0])) try: import cPickle as pickle # python 2 except ImportError: import pickle # python 3 import socket import argparse from random import randint from numpy import unravel_in...
python
from highton.models import Party from highton.highton_constants import HightonConstants class AssociatedParty( Party, ): """ :ivar id: fields.IntegerField(name=HightonConstants.ID) :ivar author_id: fields.IntegerField(name=HightonConstants.AUTHOR_ID) :ivar background: fields.StringField(name=High...
python
import unittest from column import * class ColumnTest(unittest.TestCase): def test_polar2coord(self): # test55 self.assertEqual(polar2coord( (46, 2.808) ), (1.9506007042488642, -2.019906159350932) ) self.assertEqual(polar2coord( (196, 1.194) ), (-1.1477464649503528, 0.32911100284549705) ) ...
python
from helpers import * import shutil league_info_file = 'league_info.json' ros_URL = 'https://5ahmbwl5qg.execute-api.us-east-1.amazonaws.com/dev/rankings' def_expert = 'subvertadown' kick_expert = 'subvertadown' weekly_method = 'borischen' yaml_config_temp = '_config_template.yml' output_file = 'summary.txt' yaml_con...
python
import re from typing import List import pytest from ja_timex.pattern.place import Pattern from ja_timex.tag import TIMEX from ja_timex.tagger import BaseTagger from ja_timex.timex import TimexParser @pytest.fixture(scope="module") def p(): # Custom Taggerで必要となる要素と、TimexParserの指定 def parse_kouki(re_match: ...
python
from patternpieces import PatternPieces from piece import Piece from piecesbank import PiecesBank from ui import UI from board import Board from arbiter import Arbiter from ai import Ai import json import random def main(): pb = PiecesBank() app = UI() ### DO NOT FUCKING REMOVE THIS. I DARE YOU. ### a...
python
import re import wrapt from .bash import CommandBlock class ConfigurationError(Exception): pass def add_comment(action): @wrapt.decorator def wrapper(wrapped, instance, args, kwargs): def _execute(*args, **kwargs): return CommandBlock() + '' + 'echo "{} {}"'.format(action, instance.d...
python
import logging from .registry import Registry from .parsers import RegistryPDFParser from .securityhandler import security_handler_factory from .types import IndirectObject, Stream, Array, Dictionary, IndirectReference, obj_factory from .utils import cached_property, from_pdf_datetime class PDFDocument(object): ...
python
from __future__ import print_function import logging import re from datetime import datetime from collections import Counter from itertools import chain import json import boto3 import spacy import textacy from lxml import etree from fuzzywuzzy import process from django.utils.functional import cached_property from d...
python
#!/usr/bin/env python import time import datetime from web3.exceptions import TransactionNotFound, BlockNotFound from web3.middleware import construct_sign_and_send_raw_middleware from config import ( CONFIRMATIONS, TARGET, TARGET_TIME, ACCOUNT, BASE_PRICE, web3, INSTANCE, ) def get_transa...
python
from pirate_sources.models import VideoSource, URLSource, IMGSource from django.contrib import admin admin.site.register(VideoSource) admin.site.register(URLSource) admin.site.register(IMGSource)
python
import os import sys import numpy as np import cv2 import ailia from logging import getLogger logger = getLogger(__name__) def preprocessing_img(img): if len(img.shape) < 3: img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGRA) elif img.shape[2] == 3: img = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA) e...
python
import sys import os import logging import time import gdb # https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-oracle/rebuild-system-table-indexes.htm if __name__ == '__main__': geodatabase = gdb.Gdb() timestr = time.strftime("%Y%m%d-%H%M%S") targetlog = os.path.join(os.environ['T...
python
#!/usr/bin/python import sys import getopt import random import writer # Increase maximum recursion depth sys.setrecursionlimit(100 * sys.getrecursionlimit()) # Generate CNF, order, and schedule files to compare two trees of xor's over a common set of inputs def usage(name): print("Usage: %s [-h] [-v] [-f] [-...
python
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
python
#!/usr/bin/env python # # Copyright 2012 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 # noti...
python
# -*- coding: utf-8 -*- import tkinter def affiche_touche_pressee(): root.event_generate("<<perso>>", rooty=-5) def perso(evt): print("perso", evt.y_root) root = tkinter.Tk() b = tkinter.Button(text="clic", command=affiche_touche_pressee) b.pack() root.bind("<<perso>>", perso) # on intercepte un é...
python
#!/usr/bin/env python import rospy #importar ros para python from std_msgs.msg import String, Int32 # importar mensajes de ROS tipo String y tipo Int32 from geometry_msgs.msg import Twist # importar mensajes de ROS tipo geometry / Twist class Printer(object): def __init__(self, args): super(Printer, self).__init_...
python
import os import sys from setuptools import setup, find_packages if sys.version_info < (3, 6): print(sys.stderr, "{}: need Python 3.6 or later.".format(sys.argv[0])) print(sys.stderr, "Your Python is {}".format(sys.version)) sys.exit(1) ROOT_DIR = os.path.dirname(__file__) setup( name="py-pdf-pars...
python
""" Copyright (C) king.com Ltd 2019 https://github.com/king/s3vdc License: MIT, https://raw.github.com/king/s3vdc/LICENSE.md """ import tensorflow as tf def _session_config() -> tf.ConfigProto: """Constructs a session config specifying gpu memory usage. Returns: tf.ConfigProto -- session config. ...
python
"""Runtimes manager.""" import logging from contextlib import suppress from importlib import import_module from types import ModuleType from typing import Dict, Optional, Set, Type from .runtime import Process logger = logging.getLogger(__name__) class RegisteredRuntimes: """A list of registered base python pro...
python
# use lists as stack, LIFO (last-in-first-out) stack = [1, 2, 3, 4, 5] print(stack) print('LIFO stack') stack.append(6) stack.append(7) print(stack) print(stack.pop()) print(stack.pop()) print(stack) print("\n") # use lists as FIFO (first-in-first-out) print('FIFO stack') stack.append(6) stack.app...
python
from constance import config from django.http import Http404 from impersonate.decorators import allowed_user_required from impersonate.views import impersonate, stop_impersonate from bitcaster.models import User def queryset(request): return User.objects.exclude(id=request.user.id).exclude(is_superuser=True).ord...
python
import numpy as np class LogisticRegression(object): # setting learning rate and iteration times def __init__(self, alpha=0.0005, lamb=0.1, iters=100): self.iters = iters self.alpha = alpha self.lamb = lamb # add one line for intercept self.theta = np.array([0.0] * (X.sh...
python
import pickle def load( path ): with open(path, 'rb') as ff : model = pickle.load(ff)[0] return model
python
#!/usr/bin/env python36 # -*- coding: utf-8 -*- """ Created on 2018/10/6 11:48 AM @author: Tangrizzly """ from __future__ import print_function from collections import OrderedDict import datetime import cPickle import os from public.GeoIE import GeoIE from public.Global_Best import GlobalBest from public.Load_Data_Ge...
python
import abc import rospy import numpy as np import matplotlib.pyplot as plt import math class JointTrajectoryPlanner(object): def __init__(self, time_i = 0.0, time_step = 0.1, time_f = None, movement_duration = None): self._time_step = time_step self._time_i = time_i self._...
python
from pymongo import MongoClient import datetime def collect_validated_input(prompt, error_msg, validator): user_input = input(prompt) validated = validator(user_input) while not validated: user_input = input(error_msg) validated = validator(user_input) return user_input if __name...
python
import json import unittest # from mayday.utils import query_util, ticket_util from mayday import helpers from mayday.objects import Query, Ticket USER_ID = 12345678 USERNAME = 'Mayday' class Test(unittest.TestCase): def test_init_ticket(self): ticket = Ticket(user_id=USER_ID, username=USERNAME).to_dic...
python
# -*- coding: utf-8 -*- # pylint: disable=invalid-name,missing-docstring,broad-except # Copyright 2018 IBM RESEARCH. 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 # # ...
python
from setuptools import setup, find_packages import byte_api setup( name='byte-api', version=byte_api.__version__, author=byte_api.__author__, url='https://github.com/byte-api/byte-python', download_url='https://github.com/byte-api/byte-python/archive/v{}.zip'.format( byte_api.__version__...
python
'''Provides access to a subset of the NAM-NMM dataset. The North American Mesoscale Forecast System (NAM) is one of the major weather models run by the National Centers for Environmental Prediction (NCEP) for producing weather forecasts. Dozens of weather parameters are available from the NAM grids, fr...
python
from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponse from django.conf import settings from operator import itemgetter from datetime import datetime, timedelta import json import urllib2 import re # Get API user and token from settings user = se...
python
# ここから表面データの処理 import numpy as np # import matplotlib.pyplot as plt import pandas as pd # import os # import itertools # from scipy import signal # import time class Analysis_surface(): def __init__(self,k0) -> None: self.sampling_num_surface = int(1023) # 表面粗さや2DFFTを計算したりする点数 if k0 == 1: ...
python
""" An unofficial native Python wrapper for the LivePerson Messaging Operations API. Documentation: https://developers.liveperson.com/data-messaging-operations-overview.html The Messaging Operations API extracts data according to the search query. The API allows agent managers to extract information about their call ...
python
# Generated by Django 2.2.1 on 2019-05-28 11:15 import jsonfield.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('internet_nl_dashboard', '0030_auto_20190515_1209'), ] operations = [ migrations.AddField( model_name='account', ...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : zerlous # @File : index.py # @Time : 2019-08-26 18:20 # @Desc : print "aaaaa" print ('你好') flag = False if flag: print 'true' else: print 'false'
python
# coding: utf-8 # CarND-Behavioral-Cloning-P3 # In[3]: #Importing Dependencies when required import os import csv samples=[] with open('./data/driving_log.csv') as csvfile: has_header = csv.Sniffer().has_header(csvfile.read(1024)) csvfile.seek(0) # Rewind. reader=csv.reader(csvfile) if has_header...
python
import sys sys.path.insert(1, '../') from selenium.webdriver.common.keys import Keys import random from random import randint from functions import fetchLists, wait, chanceOccured, cleanNumber, updateLists from bot import Bot class ProcessAccountsBot(Bot): def __init__(self, account: str = None): super()....
python
from flask import g def transform(ugc): if not g.netanyahu: return ugc new_ugc = [] for u in ugc: new_u = { 'censored': u.get('censored', False), 'ugcdocid': u['ugcdocid'], 'pages': u['pages'], 'summary': u.get('summary', '').strip(), ...
python
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from erpnext import get_company_currency, get_default_company from erpnext.accounts.report.utils import get_currency, convert_to_pre...
python
from string import ascii_lowercase def destroyer(input_sets): """ takes in a tuple with 1 or more sets of characters and replaces the alphabet with letters that are in the sets First gets the candidates of the alphabets and gets the letters to knock out into a list :param input_sets: :return: str...
python
import mysql.connector from contextlib import closing with closing(mysql.connector.connect( host="localhost", port=3306, user="root", password="sql!DB123!", database="app" )) as db: with closing(db.cursor(dictionary=True)) as cur: sql = "select closing_date, currency_symbol, " \ ...
python
# Copyright 2016 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...
python
from pathlib import Path import torch import torch.nn as nn from torch.autograd import Variable from mnist_efficientnet import io from mnist_efficientnet.network import Network, extract_result root = Path("../input/digit-recognizer") train_x, train_y = io.load_train_data(root) test = io.load_test_data(root) net = ...
python
""" Tests for the pynagios package. """ class TestPyNagios(object): pass
python
import pwndbg.color.theme as theme import pwndbg.config as config from pwndbg.color import generateColorFunction config_prefix = theme.Parameter('backtrace-prefix', '►', 'prefix for current backtrace label') config_prefix_color = theme.ColoredParameter('backtrace-prefix-color', 'none', 'color for prefix of c...
python
import torch import torch.nn as nn import torch.nn.functional as F class network1(nn.Module): def __init__(self): super().__init__() self.cnn1 = nn.Sequential( nn.ReflectionPad2d(1), nn.Conv2d(1, 4, kernel_size=3), nn.ReLU(inplace=True), nn.BatchNorm2...
python
#!/usr/bin/python # # Chrome - Profile Launcher for Chrome # @see http://stackoverflow.com/questions/16410852/keyboard-interrupt-with-with-python-gtk # https://pygobject.readthedocs.io/en/latest/getting_started.html # https://lazka.github.io/pgi-docs/ # http://www.programcreek.com/python/example/9059/gtk.IconView impo...
python
import unittest import os.path import os import sys sys.path.append(".") #from pywinauto.timings import Timings #Timings.Fast() excludes = ['test_sendkeys'] def run_tests(): testfolder = os.path.abspath(os.path.split(__file__)[0]) sys.path.append(testfolder) for root, dirs, files in...
python
import torch from torch import nn from torch.utils.data import DataLoader import os from abc import ABC from ssl_eval import Evaluator from typing import Tuple from .. import pkbar from ..logger import Logger, EmptyLogger from ..utils import AllReduce, after_init_world_size_n_rank from ..scheduler import Scheduler c...
python
"""Domain classes for fulltext extraction service.""" from typing import NamedTuple, Optional, Any from datetime import datetime from pytz import UTC from backports.datetime_fromisoformat import MonkeyPatch from enum import Enum MonkeyPatch.patch_fromisoformat() class Extraction(NamedTuple): # arch: domain "...
python
import bmesh as bm import bpy from bpy_extras import object_utils from mathutils import Matrix import numpy as np from smorgasbord.common.io import get_scalars from smorgasbord.common.mat_manip import make_transf_mat from smorgasbord.common.transf import transf_pts def combine_meshes(obs): """ Returns the me...
python
import time time.perf_counter() from game_mechanics import Player, Simulator from strategies import make_turn_strat import numpy as np import matplotlib.pyplot as plt # A bot plays Incan Gold in single-player mode. # The bot leaves when the turn reaches the Turn Threshold value. # The game is simulated many times for...
python
import logging _logger = logging.getLogger(__name__) import sys #import random import numpy as np from .agent import Agent from .ataristatebuffer import AtariStateBuffer class AtariAgent(Agent): """ This class is an implementation of an Atari agent. The agent interacts with the given environment, organizes ...
python
r""" Optimizing noisy circuits with Cirq =================================== .. meta:: :property="og:description": Learn how noise can affect the optimization and training of quantum computations. :property="og:image": https://pennylane.ai/qml/_images/noisy_circuit_optimization_thumbnail.png .. figure:: ../de...
python
#!/usr/bin/env python # coding=utf-8 import argparse import os import re #功能:输入一个只包含tree文件的目录,不加“/”,以及输入一个label map关系表,原来的标签必须非冗余,即不能一对多映射。然后在当前目录输出所有relabel后的tree文件。 #获取树目录下所有文件名 parser=argparse.ArgumentParser(description = "功能:批量修改nwk文件的label注释。输入一个包含tree文件的目录,和一个tree中老label和要替换的label的对应两列表。在当前目录输出relabel后的各个tree文件"...
python
from os import path from sys import modules from fabric.api import sudo from fabric.contrib.files import upload_template from pkg_resources import resource_filename def restart_systemd(service_name): sudo("systemctl daemon-reload") if sudo( "systemctl status -q {service_name} --no-pager --full".forma...
python
from machine import Pin import utime from ssd1306 import SSD1306_I2C #I/O Configuration led = Pin(28, Pin.OUT) onboard_led = Pin(25, Pin.OUT) button = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_DOWN) #Set Initial Conditions led.low() onboard_led.high() fast_blink = False # attach the interrupt to the buttonPin...
python
import os from setuptools import find_packages, setup with open(os.path.join('.', 'VERSION')) as version_file: version = version_file.read().strip() setup( name='mavelp', version=version, long_description=open('README.md').read(), package_dir={'': 'src'}, packages=find_packages(where='src'), )
python
from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import (QCoreApplication, QPropertyAnimation, QDate, QDateTime, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt, QEvent) from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, ...
python
__author__ = 'Thomas Kountis'
python
# -*- coding: utf-8 -*- """ * Created by PyCharm. * Project: catalog * Author name: Iraquitan Cordeiro Filho * Author login: pma007 * File: api * Date: 2/26/16 * Time: 11:26 * To change this template use File | Settings | File Templates. """ from flask import Blueprint, jsonify from catalog.models import Categ...
python
# # copied from # # https://scikit-learn.org/stable/auto_examples/covariance/plot_lw_vs_oas.html#sphx-glr-auto-examples-covariance-plot-lw-vs-oas-py # # import numpy as np import matplotlib.pyplot as plt from scipy.linalg import toeplitz, cholesky from sklearn.covariance import LedoitWolf, OAS np.random.seed(0) n_...
python
import json import logging import time import datetime as dt from bitbot import services, strategy import pandas as pd class Bot: """ A trading bot that executes a certain strategy Attributes: config (dict[str, any]): the loaded configuration next_action (services.OrderDirection): the nex...
python
import rospy import sys import tf import tf2_ros import geometry_msgs.msg if __name__ == '__main__': if len(sys.argv) < 8: rospy.logerr('Invalid number of parameters\nusage: ' './static_turtle_tf2_broadcaster.py ' 'child_frame_name x y z roll pitch yaw') sy...
python
# Generated by Django 3.2.12 on 2022-03-27 19:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20220328_0004'), ] operations = [ migrations.RenameField( model_name='predication', old_name='avg_...
python
""" Module for time series classification using Bayesian Hidden Markov Model ----------------- Version : 0.2 Date : December, 11th 2019 Authors : Mehdi Bennaceur Phase : Development Contact : _ Github : https://github.com/DatenBiene/Bayesian_Time_Series_Classification """ __version__ = "...
python
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
python
import re from num2words import num2words from word2number.w2n import word_to_num from pycorenlp import StanfordCoreNLP class PostProcess: month_map = { 1:'January', 2:'February', 3:'March', 4:'April', 5:'May', 6:'June', 7:'July', 8:'August', ...
python
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ################################################################################## # File: c:\Projects\KENYA ONE PROJECT\CORE\engines\values.py # # Project: c:\Projects\KENYA ONE PROJECT\CORE\engines # # Created Date: Thur...
python
from .jxa_loader import *
python
import math import numpy as np import torch from torch import nn class MultiheadAttention(nn.Module): """General purpose multihead attention implementation.""" def __init__(self, input_dim, proj_dim, n_heads=1, dropout=0.0, attn_type='cross', initializer='xavier_uniform'): assert pr...
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 # distributed under th...
python
# Copyright 2021 The Private Cardinality Estimation Framework 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 b...
python
""" Shutterstock CLI """ import click from .images import images from .videos import videos from .audio import audio from .editorial import editorial from .cv import cv from .ai_audio import ai_audio from .editor import editor from .contributors import contributors from .user import user from .test import te...
python
try: from SmartFramework.serialize.tools import serializejson_, authorized_classes from SmartFramework.serialize import serialize_parameters except: from serializejson import serialize_parameters from serializejson.tools import serializejson_, authorized_classes import array def serializejson_array(i...
python
import collections import copy import json import os import sys import unittest from ethereum import utils from ethereum import config from ethereum.tools import tester as t from ethereum.utils import mk_contract_address, checksum_encode import rlp import trie import trie.utils.nibbles from test_utils import rec_hex,...
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 1 09:26:03 2022 @author: thejorabek """ '''son=10 print(son,type(son)) son=3.14 print(son,type(son)) son='Salom Foundationchilar' print(son,type(son)) son=True print(son,type(son)) son=int() print(son,type(son)) print("Assalom",123,3.14,True,sep='...
python
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: 17.py @time: 2019/5/29 22:07 @desc: ''' class Solution: def letterCombinations(self, digits: str) -> List[str]: if len(digits) < 1: return [] str...
python
# Copyright (C) 2014-2017 Internet Systems Consortium. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ...
python
from os import stat from re import VERBOSE from request_api.services.commentservice import commentservice from request_api.services.notificationservice import notificationservice from request_api.models.FOIRawRequests import FOIRawRequest from request_api.models.FOIMinistryRequests import FOIMinistryRequest from reque...
python
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
python
# -*- coding: utf-8 -*- import argparse from unittest import mock from unittest.mock import MagicMock, patch import pytest from pytube import cli, StreamQuery, Caption, CaptionQuery parse_args = cli._parse_args @mock.patch("pytube.cli.YouTube") def test_download_when_itag_not_found(youtube): youtube.streams = ...
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # cssyacc/block.py # # class for block # ---------------------------------------------------------------- # copyright (c) 2014 - Domen Ipavec # Distributed under The MIT License, see LICENSE # ------------...
python
# liberate - Add the specified block to the list of available blocks. As part # of the liberation process, check the block's buddy to see if it can be # combined with the current block. If so, combine them, then recursively # call liberate. # @param block The block to be liberated def liberate(block): ...
python