text
stringlengths
2
999k
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
# coding: utf-8 """ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 20220523 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # ...
# The MIT License (MIT) # # Copyright (c) 2015 University of East Anglia, Norwich, UK # # 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 r...
#!/usr/bin/env python """ Writer for Clustal format. """ from copy import copy from cogent3.core.alignment import SequenceCollection __author__ = "Jeremy Widmann" __copyright__ = "Copyright 2007-2019, The Cogent Project" __credits__ = ["Jeremy Widmann"] __license__ = "BSD-3" __version__ = "2019.12.6a" __maintainer__...
import collections import datetime from unittest.mock import MagicMock import mock from testifycompat import assert_equal from testifycompat import assert_not_equal from testifycompat import setup from testifycompat import setup_teardown from testifycompat import TestCase from tests.assertions import assert_call from...
from flask import jsonify,request,current_app,url_for from flask.views import MethodView from linktodapp.apis.v1 import api_v1 class IndexAPI(MethodView): def get(self): return jsonify({ "api_version":"1.0", "api_base_url":"api.linktodapp.com/v1" }) api_v1.add_url_rule('/'...
import scipy.io as sio import time # import tensorflow as tf import numpy as np import scipy.sparse as sp from sklearn.cluster import KMeans, SpectralClustering from metrics import clustering_metrics from sklearn.metrics.pairwise import euclidean_distances from sklearn.feature_extraction.text import TfidfTransformer fr...
""" Library Features: Name: lib_plot_point Author(s): Fabio Delogu (fabio.delogu@cimafoundation.org) Date: '20180918' Version: '1.0.0' """ ####################################################################################### # Library from numpy import arange import matplotlib.pylab as ...
# # Copyright (c) 2009-2016, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # import El m = 1000 n = 2000 testMehrotra = True testIPF...
from django.conf.urls import include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static import profiles.urls import accounts.urls import seats.urls from . import views urlpatterns = [ url(r'^$', views.HomePage.as_view(), name='home'), url(r'^about/...
""" Support to use flic buttons as a binary sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.flic/ """ import logging import threading import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant....
import unittest import mock from pyhpecw7.features.portchannel import Portchannel, InvalidPortType, AggregationGroupError from base_feature_test import BaseFeatureCase R_GROUP_ID = '101' B_GROUP_ID = '100' class PortChannelTestCase(BaseFeatureCase): @mock.patch('pyhpecw7.comware.HPCOM7') def setUp(self, mo...
from PySide2.QtCore import QObject, Signal from ..services.dsp import get_time_of_recording class NewProjectModel(QObject): """ The model class stores program data and state and some minimal logic for announcing changes to this data """ project_name_changed = Signal(str) project_location_chan...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class CreateAnimatedGraphicsTaskRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map ...
import re from typing import Text import requests from bs4 import BeautifulSoup url = requests.get('https://www.timesjobs.com/candidate/job-search.html?searchType=Home_Search&from=submit&asKey=OFF&txtKeywords=&cboPresFuncArea=35').text soup = BeautifulSoup(url, 'lxml') # find_all --> matches all of the pr...
import collections import textwrap from .base import Alignment from ...helpers.files import read_alignment_alignio from ...helpers.calculate_character_frequencies import calculate_character_frequencies class AlignmentSummary(Alignment): def __init__(self, args) -> None: super().__init__(**self.process_ar...
""" Copyright (C) 2018-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 law or agreed to i...
try: import psutil except ImportError as e: print(f'package not found\n{e}\n') try: from PyQt5 import QtCore, QtWidgets except ImportError as e: print( f'package PyQt5 Not Found\n{e}\ntry :\npip3 install --user pyqt5\nOR\ndnf install python3-pyqt5, yum install python3-pyqt5\n') try: from m...
#!/usr/bin/python3 # -*- coding:utf-8 -*- from docx import Document import re import os workpath = os.getcwd() # 同其他 class CheckWin: # windows的把raw中的命令执行原始结果,一项项进行判断是否合规,然后输出成word报告。 checkresult = [''] * 29 # 定义了一个存放是否合格的结果列表 def __init__(self, ipfilepath, theorder, ipfile): self....
"""Build validation functions.""" import jsonschema from .util import load_schema def validate(instance, component, trapi_version=None): """Validate instance against schema. Parameters ---------- instance instance to validate component : str component to validate against trapi...
from django.contrib.postgres.fields import ArrayField from django.db.models import Aggregate, BooleanField, JSONField, Value from .mixins import OrderableAggMixin __all__ = [ 'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'JSONBAgg', 'StringAgg', ] class ArrayAgg(OrderableAggMixin, Aggregate): function...
from os import makedirs, path from typing import Union import pandas as pd from .filetype import FileType class DataReader(object): def __init__(self): """ Stores all dataframes and provides methods to feed data into the dataframes. """ self.bus_lines = pd.DataFrame(columns=['id', 'name', 'color', 'card_on...
# Generated by Django 3.1.1 on 2020-10-18 11:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('UUID', '0006_20201010_allow_empty_latex_time'), ] operations = [ migrations.AddField( model_name='uuid_tree_edge', n...
import pathlib import shutil import tempfile from typing import Dict, Optional, Union import libpantab # type: ignore import numpy as np import pandas as pd import tableauhyperapi as tab_api import pantab._types as pantab_types from pantab._hyper_util import ensure_hyper_process, forbid_hyper_process TableType = Un...
from colosseum.constants import AUTO, INLINE from colosseum.declaration import CSS from ...utils import LayoutTestCase, TestNode class WidthTests(LayoutTestCase): def test_no_horizontal_properties(self): node = TestNode( name='span', style=CSS(display=INLINE) ) nod...
#!/usr/bin/env python # # Copyright (c) 2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # """ A basic AD agent using CARLA waypoints """ import sys import time from std_msgs.msg import Float64 # pylint: disable=import-error f...
#!/usr/bin/env python3 # Dependencies from lxml import html, etree import requests import numpy as np import pandas as pd import datetime as dt class _GetDataFromURL(object): """This "private" class does all the heavy lifting of fetching data from the URL provided, and then returns data to the main `rightmove...
import gym import numpy as np from baselines.common.vec_env import VecEnvWrapper from baselines.common.running_mean_std import RunningMeanStd from baselines.common.trex_utils import preprocess #import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F class AtariNet(nn.Module...
import re import rope.base.pynames from rope.base import (pynames, pyobjects, codeanalyze, evaluate, exceptions, utils, worder) class Finder(object): """For finding occurrences of a name The constructor takes a `filters` argument. It should be a list of functions that take a sing...
import json import httplib import urllib # GET Method : # Github request (https://developer.github.com/v3/repos/#list-contributors) # ------------------------------------------------------------------------------ # # Inputs: # === HEADERS # - Authorization: {String: [a-f0-9]{8} - [a-f0-9]{4} - [a-f0-9]{4} - [a-f0-9]{4...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.OrderExtInfo import OrderExtInfo class JourneyLocation(object): def __init__(self): self._aoi_id = None self._city = None self._ext_info = None ...
import datetime def convert_to_korean(number, datetime_type=""): chinese_character_number = ["영", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구"] pure_korean_number = ["영", "한", "두", "세", "네", "다섯", "여섯", "일곱", "여덟", "아홉", "열"] result = "" if number / 1000 >= 1: if int(number / 1000) == 1: ...
from nltk.stem import SnowballStemmer from nltk.tokenize import sent_tokenize from utils.list_files import list_of_files from nltk.tokenize import word_tokenize from tf_idf import tf_idf_stat if __name__ == '__main__': # Receive the input from the user corpus_folder_path = input('Insert the path to the corpu...
""" Widgets for sending feedback reports """ from ..external.six.moves.urllib.request import Request, urlopen from ..external.six.moves.urllib.parse import urlencode import sys from ..external.qt.QtGui import QTextCursor from .qtutil import load_ui __all__ = ['submit_bug_report'] def _send_feedback(report): """...
#!/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 # ...
from ..Animal import Animal class Wolf(Animal): def __init__(self, strength, initiative, symbol, position, world, color): super(Wolf, self).__init__(strength, initiative, symbol, position, world, color)
import grpc import grpc_testing import unittest import json from pkg.apis.manager.v1beta1.python import api_pb2_grpc from pkg.apis.manager.v1beta1.python import api_pb2 from pkg.suggestion.v1beta1.nas.darts.service import DartsService class TestDarts(unittest.TestCase): def setUp(self): servicers = { ...
""" This file offers the methods to automatically retrieve the graph Ferrimonas balearica. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protein a...
from django.contrib import admin from django.contrib.auth.models import Group from .models import User # Register your models here. admin.site.unregister(Group) admin.site.register(User) admin.site.site_header = 'Musofirlar.uz Adminsitration' admin.site.site_title = 'Musofirlar.uz Adminsitration'
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Reading the file data=pd.read_csv(path) #Code starts here # Step 1 #Reading the file #Creating a new variable to store the value counts loan_status=data['Loan_Status'].value_counts() loan_status.plot(...
import os import matplotlib.pyplot as plt import numpy as np import strax import straxen @straxen.mini_analysis(requires=('raw_records',), warn_beyond_sec=5) def plot_pulses_tpc(context, raw_records, run_id, time_range=None, plot_hits=False, plot_median=False, max_plots=20, st...
from pathlib import Path from decouple import config from uimodules.pluralize import Pluralize BASE_DIR = Path(__file__).resolve().parent SETTINGS = dict( template_path=BASE_DIR / "templates", cookie_secret=config("COOKIE_SECRET"), xsrf_cookie=config("XSRF_COOKIE"), db=config("DB"), login_url="/a...
# encoding: utf-8 from datetime import datetime from django.db import models import inspect def get_table_for_field(model, field_name): for field in model._meta.fields: if field_name == field.attname: return field.model._meta.db_table return None class LatestQuerySet(models.query.QueryS...
#!/usr/bin/env python import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = '2' import sys import csv import numpy as np import pandas as pd import random from time import time, strftime, gmtime from optparse import OptionParser from pylsl import StreamInlet, resolve_byprop from sklearn.linear_model import LinearRegression i...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
from aliyunsdkcore.acs_exception.exceptions import ClientException from utils import * from aliyunsdkalidns.request.v20150109.DescribeDomainRecordsRequest import DescribeDomainRecordsRequest from aliyunsdkalidns.request.v20150109.UpdateDomainRecordRequest import UpdateDomainRecordRequest from aliyunsdkalidns.requ...
#Zeliha Döner 160401004 import socket from ftplib import FTP import os import select import time buf=1024 def dosya_listele(): msg = "Liste getir komutu" msgEn = msg.encode('utf-8') s_s.sendto(msgEn, adres) print("Sunucuda listeleniyor..") F=os.listdir() Lists = [] for ...
# -*- coding: utf-8 -*- name = 'arnold' version = '5.0.0' author = ['solidangle'] tools = [] requires = [] variants = [ ['platform-windows'], ] def commands(): """ """ import os env.solidangle_LICENSE.set("5053@rlm.cashmere.com") module_path = getenv("MAYA_MODDULE_PATH") arnol...
from dataclasses import dataclass from threading import Thread from typing import List, Type, Set, Any, Dict, Optional, TypeVar, Callable from ludere.reflection import resolve_constructor_parameter_types, resolve_function_parameter_types, has_return_type T = TypeVar("T") class Ludere: def __init__(self): ...
# -*- coding: utf-8 -*- """ src.utils ~~~~~~~~~~~~~~~~~~~ This module contains the set of CoffeeMachine's utility functions and definitions. """ from typing import Union Mililiters = int Grams = int Refillable = Union[Mililiters, Grams] Beverage = str Serving = str Material = str
#!/usr/bin/env python2 from __future__ import (absolute_import, division, print_function, unicode_literals) __version__ = 0.01 __author__ = 'Vlad Popovici' import os import argparse as opt import xml.etree.ElementTree as ET from xml.dom import minidom import skimage.io import skimage.exposure #from stain.he impor...
import pytest import numpy as np from landlab import RasterModelGrid from landlab.data_record import DataRecord grid = RasterModelGrid((3,3)) @pytest.fixture def dr_time(): time=[0.] data_vars={'mean_elevation' : (['time'], np.array([100]))} attrs={'time_units' : 'y'} return DataRecord(grid=grid, ...
#!/usr/bin/env python3 # # __init__.py """ Wrapper around flake8 providing a formatted count at the end. """ # # Copyright © 2020 Dominic Davis-Foster <dominic@davis-foster.co.uk> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (...
import os import requests import csv import datetime import time import json from tqdm import tqdm from dotenv import load_dotenv load_dotenv() token = os.environ.get("COIN_CAP_API_KEY") start_date = datetime.date(2018, 1, 1) end_date = datetime.date(2021, 11, 1) delta = datetime.timedelta(days=1) range = end_date -...
import torch import torch.nn as nn import torchvision import time import numpy as np import sys def get_model_op(model_,print_flag = False): print('/********************* modules *******************/') op_dict = {} idx = 0 for m in model_.modules(): idx += 1 if isinstan...
# # -*- coding: utf-8 -*- # # Copyright (c) 2018 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 app...
# coding: utf-8 """ AusSeabed product catalogue The API description for the Ausseabed product catalogue inventory # noqa: E501 The version of the OpenAPI document: 0.2.2 Contact: AusSeabed@ga.gov.au Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import ...
# coding=utf-8 from wagtail.wagtailimages.models import SourceImageIOError def get_rendition_or_not_found(image, specs): """ Tries to get / create the rendition for the image or renders a not-found image if it does not exist. :param image: AbstractImage :param specs: str or Filter :return: Rendit...
''' Tests for commands module Nick Mathewson ''' import unittest import os, tempfile, re from test.test_support import run_unittest, reap_children, import_module, \ check_warnings # Silence Py3k warning commands = import_module('commands', deprecated=True) # The modul...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# coding: utf-8 # flake8: noqa from __future__ import absolute_import # import models into model package from asposewordscloud.models.api_error import ApiError from asposewordscloud.models.available_fonts_response import AvailableFontsResponse from asposewordscloud.models.bmp_save_options_data import BmpSaveOptionsD...
from typing import List, Union, Iterator import h5py import numpy as np from contextlib import contextmanager h5root = Union[h5py.File, h5py.Group] def find_by_nx_class(nx_class_name: str, root: h5root) -> List[h5py.Group]: """ Find groups in the HDF5 file or group which have the requested NX_class attri...
import logging import time from rcon.recorded_commands import RecordedRcon from rcon.extended_commands import CommandFailedError from rcon.user_config import AutoVoteKickConfig from rcon.audit import online_mods, ingame_mods from rcon.map_recorder import MapsRecorder logger = logging.getLogger(__name__) def toggle_v...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
"""socialwebsite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/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...
# This sample tests support for callback protocols (defined in PEP 544). from typing import Optional, List, Protocol class TestClass1(Protocol): def __call__(self, *vals: bytes, maxlen: Optional[int] = None) -> List[bytes]: return [] def good_cb(*vals: bytes, maxlen: Optional[int] = None) -> List[bytes...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 from ... import _utilities, _tables from...
#!/usr/bin/env python # Copyright 2014 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. '''Uses the closure compiler to check the ChromeVox javascript files. With no arguments, checks all ChromeVox scripts. If any argume...
""" This function takes two lists and returns the node they have in common, if any. In this example: 1 -> 3 -> 5 \ 7 -> 9 -> 11 / 2 -> 4 -> 6 ...we would return 7. Note that the node itself is the unique identifier, not the value of the node. """ import...
import os import flask import joblib PATH = os.path.dirname(os.path.abspath(__file__)) app = flask.Flask(__name__) model_fname = "constant.joblib" app.my_model = joblib.load(os.path.join(PATH, f"models/{model_fname}")) @app.route("/") def info(): return flask.jsonify({"model_instance": model_fname}) @app.ro...
import logging import pkg_resources import json from gym.envs.registration import register logger = logging.getLogger(__name__) resource_package = __name__ env_json = pkg_resources.resource_filename(resource_package, '/'.join(('envs', 'available_envs.json'))) with open(env_json) as f: envs = json.load(f) f...
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from ansible_collections.community....
import gurobipy model = gurobipy.read('/Library/gurobi651/mac64/examples/data//afiro.mps') model.optimize() model.printAttr('X')
""" Django settings for mybooks project. Generated by 'django-admin startproject' using Django 3.2.7. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib...
''' This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de). PM4Py 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, either version 3 of the License, or (at your option) any late...
import sklearn.discriminant_analysis from autotabular.pipeline.components.classification.lda import LDA from .test_base import BaseClassificationComponentTest class LDAComponentTest(BaseClassificationComponentTest): __test__ = True res = dict() res['default_iris'] = 1.0 res['default_iris_iterative'...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
""" Slack Invite Flow Rudimentary workflow to automate slack team invitations """ import argparse import yaml import activities import flow import models def request_user_stdin(key): return models.User( short=raw_input('[{}] short name: '.format(key)), first=raw_input('[{}] first name: '.format...
# Copyright (c) Open-MMLab. All rights reserved. import copy import logging import os.path as osp import warnings from abc import ABCMeta, abstractmethod import torch from torch.optim import Optimizer import mmcv from ..parallel import is_module_wrapper from .checkpoint import load_checkpoint from .dist_utils import ...
from tenable.errors import * from .fixtures import * def get_vulns(sc, **kw): kw['pages'] = 2 kw['limit'] = 50 vulns = sc.analysis.vulns(**kw) return vulns def test_vulns_cceipdetail_tool(sc): vulns = get_vulns(sc, tool='cceipdetail') for v in vulns: assert isinstance(v, dict) def t...
import numpy import sympy from mpmath import mp from ..helpers import article, fsd, pm, untangle, z from ._helpers import DiskScheme _citation = article( authors=["J. Albrecht"], title="Formeln zur numerischen Integration über Kreisbereiche", journal="ZAMM", volume="40", number="10-11", year="...
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
class Solution: def calculateTax(self, brackets: List[List[int]], income: int) -> float: if income <= brackets[0][0]: return income * brackets[0][1] / 100 idx = 0 res = 0 while income > 0: # if idx != 0: # print(income, res, brackets[idx][0] - ...
from __future__ import unicode_literals import frappe def execute(): navbar_settings = frappe.get_single("Navbar Settings") duplicate_items = [] for navbar_item in navbar_settings.settings_dropdown: if navbar_item.item_label == "Toggle Full Width": duplicate_items.append(navbar_item) if len(duplicate_item...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals try: from dawg import DAWG, RecordDAWG except ImportError: mssg = ("Install dawg package!") raise NotImplementedError(mssg) class LexiconDawg(RecordDAWG): """ Dag for storing the lexicon Keys are words, valuea ...
from django.core import validators from rest_framework.fields import EmailField from rest_framework.serializers import ModelSerializer from members.models import Member class MemberSerializer(ModelSerializer): class Meta: model = Member fields = ('pk', 'first_name', 'last_name', 'phone', 'profes...
# 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...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import shortestKey as sk import re import math from sys import argv def str_rshift(str, n): n = n % len(str) n = len(str) - n return str[n:] + str[:n] def calc_match(input1, input2): matches = 0 for idx in range(len(input1)): if input1[idx] == ...
#Main auth script from time import time_ns as nanos from argon2 import PasswordHasher from argon2.exceptions import VerifyMismatchError import json import sys import hashlib import os.path as path import mongo common = {} #Load the 10.000 most common passwords list with open('common.json', 'r') as f: common =...
import cv2 img = cv2.imread(r"HUNKAR\OPENCV\resim.png") cv2.imshow("Ilk Resim",img) cv2.waitKey(0) cv2.destroyAllWindows()
'''workflows: chained and orchestrated sets of transforms''' import json from drench_sdk.utils import get_arn from drench_sdk.states import ChoiceState, FailState, PassState, SucceedState, State, TaskState from drench_sdk.transforms import Transform SETUP = '__setup' FAILED = '__failed' FINISHED = '__finished' END_...
from __future__ import print_function, absolute_import import time from collections import OrderedDict import numpy as np from sklearn.preprocessing import normalize from sklearn.metrics import pairwise_distances import torch import torch.nn.functional as F import torch.distributed as dist import torch.multiprocessing...
from collections import namedtuple from VintageousPlus.vi.utils import modes from VintageousPlus.tests import set_text from VintageousPlus.tests import add_sel from VintageousPlus.tests import get_sel from VintageousPlus.tests import first_sel from VintageousPlus.tests import second_sel from VintageousPlus.tests impo...
#!/usr/bin/env python """Functions for test_tester.py""" from shatter.solver import * __author__ = 'juan pablo isaza' @solve() def collision(a): pass @solve() def non_collision(a, b, c, d): pass @solve() def basic_if(a, b): pass
# Copyright (c) 2021 PaddlePaddle 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 appli...
#! /usr/bin/env python # coding=utf-8 # Copyright (c) 2020 Uber Technologies, 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 # # Unles...
import os def list_files(dir): arr = os.listdir(dir) return arr #if __name__ == "__main__":
#import ast from .translator import CrystalTranslator class PySys(CrystalTranslator): attribute_map = { "__stdin__": "PySys.__stdin__", "__stdout__": "PySys.__stdout__", "__stderr__": "PySys.__stderr__", "stdin": "PySys.stdin", "stdout": "PySys.stdout", "stderr": "Py...
import logging import pandas as pd from typing import List import unittest from decimal import Decimal from math import floor, ceil from nose.plugins.attrib import attr from hummingbot.core.clock import Clock, ClockMode from hummingbot.core.data_type.limit_order import LimitOrder from hummingbot.core.data_type.order_...