text
stringlengths
1
927k
import logging from github import Github from typing import Dict, Tuple, List import os import argparse import traceback from collections import Counter from tenacity import retry, stop_after_attempt, wait_exponential from time import sleep import pandas as pd logging.basicConfig(format='%(asctime)s,%(msecs)d %(leveln...
from django.db import models from django_extensions.db.fields import AutoSlugField from apps.core.models import BaseData from django.contrib.auth.models import User, Group from django.utils.html import escape import pytz import datetime import bleach from django.utils import timezone class Language(BaseData): nam...
""" AWS module - Keep the aws services adpaters Version: 1.0.0 """ def change_endpoint(cls): endpoint_url = cls.config.get('LOCALSTACK_ENDPOINT', None) # Fix para tratar diff entre docker/local if endpoint_url == 'http://0.0.0.0:4566' or \ endpoint_url == 'http://localstack:4566': old_...
#!/usr/bin/env python # # ============================================================================= # # Consume Avro messages to Kafka getting the schema from the Confluent registry # Using Confluent Python Client # # ============================================================================= from confluent_kafk...
import gym import numpy as np import gym_reacher from stable_baselines.ddpg.policies import MlpPolicy from stable_baselines.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise, AdaptiveParamNoiseSpec from stable_baselines import DDPG # env = gym.make('MountainCarContinuous-v0') env = gym.make('Reacher...
""" Copyright (c) 2017, Battelle Memorial Institute 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, this list of conditions a...
# Copyright 2013-2022 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) import contextlib import os import sys import pytest import spack.cmd import spack.config import spack.extensions import...
''' ''' # 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");...
import os import tempfile from collections import namedtuple from multiprocessing import Queue import unittest import numpy as np from ray.tune import Trainable from ray.tune.function_runner import wrap_function from ray.tune.integration.wandb import ( WandbLoggerCallback, _WandbLoggingProcess, WANDB_ENV_...
import numpy as np from unittest import TestCase from diffprivlib.accountant import BudgetAccountant from diffprivlib.tools.histograms import histogramdd from diffprivlib.utils import global_seed, PrivacyLeakWarning, BudgetError class TestHistogramdd(TestCase): def test_no_params(self): a = np.array([1, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 4 21:39:12 2020 @author: pengning This is part of the grad/Hess engine for spatial projection versions of the original global constraint <S|T>-<T|U|T>. The Lagrangian multipliers are distributed in the order alphaP0_1, alphaP0_2, alphaP1_1, alph...
from typing import List from fastapi import APIRouter from samey.table_crud import * from .models import * router = APIRouter() @router.get("/", response_model=List[Stack]) def list_stacks(): return query(tables.Stack) @router.post("/", response_model=Stack, status_code=201) def create_stack(stack_in: Stack...
from typing import Optional from django.core.exceptions import ValidationError from django.core.management import BaseCommand, CommandError from django.db import IntegrityError from django.utils.translation import gettext_lazy as _ from django_fsm import TransitionNotAllowed from getin.models import Invitation, Invit...
############################# Helper ################################# ## This file was created to support the lock-in program ## ###################################################################### ## These functions can be imported using: import lockin-auxiliary as aux ## and put aux.<name of the functi...
import pytest import os import logging logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) from pathlib import Path from dselib.context import DSEContext from dselib.ntpx import NTPX def context(varfile=None): """returns the DSE context object for this script.""" try: ...
import pytest from dredis import config from dredis.db import DB_MANAGER from dredis.keyspace import Keyspace @pytest.fixture def keyspace(): DB_MANAGER.setup_dbs('', backend='memory', backend_options={}) original_configs = config.get_all('*') yield Keyspace() for option, value in zip(original_config...
# encoding=utf-8 import os import sys import math from util_tool import * import numpy def categorization_files(path): files = search_directory(path,'vec') for input_name in files: categorization_file(input_name) # compute only once, the same to them if using topic model for sample feather break def categori...
#!/usr/bin/env python3 import numpy as np from random import random import crank_nicolson ################################################# ### Functions Definitions ################################################# def get_data(test_letter): if test_letter == "a": ut_array, uk_matrix, x_array, N = test...
from C3_Decorator_Pattern.StarBuzzWithSize.Beverages.Beverages import Beverages from C3_Decorator_Pattern.StarBuzzWithSize.Beverages.Size import Size from C3_Decorator_Pattern.StarBuzzWithSize.Condiments.Condiments import Condiments class Mocha(Condiments): def __init__(self, beverage: Beverages): self.b...
################################################################################ # # __init__.py # """ KHR-1 Brains Subpackage Public Modules: Author: Robin D. Knight Email: robin.knight@roadnarrowsrobotics.com URL: http://www.roadnarrowsrobotics.com Date: 2007.11.28 Copyright (C) 2007. RoadNarrows LLC. """ ...
''' Exercise 6: Scrap more information about TripAdvisor reviews url = "https://www.tripadvisor.com/Restaurant_Review-g227613-d3531819-Reviews-Le_Jardin_Napolitain-Jouy_en_Josas_Versailles_Yvelines_Ile_de_France.html" Please write a code that prints out review content, numeric ra...
class Workspace: def __init__(self, name: str = None): #PK self.name = name self.members = [] self.member_ids= [] self.roles = {} #{owners:[user1], administrators:[user5, user8], etc} self.channels = [] #name def getName(self): return self.na...
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
# -*- coding: utf-8 -*- # 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 o...
# coding: utf-8 import pprint import re import six from huaweicloudsdkcore.sdk_response import SdkResponse class CreateBindingDeviceResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_ma...
from typing import Any, Callable from rx import defer, from_future, of from rx.core import Observable from rx.core.typing import Accumulator from rx.disposable import CompositeDisposable, SingleAssignmentDisposable from rx.internal.concurrency import synchronized from rx.internal.utils import NotSet, is_future def _...
""" sentry.coreapi ~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ # TODO: We should make the API a class, and UDP/HTTP just inherit from it # This will make it so we can more easily control logging with various # m...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2017 Rapptz 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 u...
from scrape_utils import retrieveWebpage from sportsreview_importer import retrieveLinks, bulkDownloadData, collateData def saveSportReviewWebpage(): baseURL = 'https://www.sportsbookreviewsonline.com/scoresoddsarchives/nba/nbaoddsarchives.htm' saveFile = 'data/sportsbookreview_nba_odds_archive.html' element = '...
from doit import create_after from glob import glob from itertools import chain def reltouch(source_filename, dest_filename): from os import stat, utime stat_res = stat(source_filename) utime(dest_filename, ns=(stat_res.st_atime_ns, stat_res.st_mtime_ns)) def resize_image(basename, width, image_format):...
#Imports from house_prices_regression_model.train_pipeline import run_training from house_prices_regression_model.processing.data_manager import load_pipeline from house_prices_regression_model.config.core import ROOT, TRAINED_MODEL_DIR,load_config_file,SETTINGS_PATH from house_prices_regression_model import __version_...
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Project information ---------------------------------------------------...
from distutils.core import setup setup( name='palindrome', version='1.0', py_modules=['palindrome'], # metadata author='Austin Bingham', author_email='austin@sixty-north.com', description='A module for finding palindromic numbers', license='Public domain', keywords='example', )
import os import re import pickle as pkl import soundfile as sf import numpy as np def safeAdd(src, key, val): if key in src: src[key].update(val) else: src[key] = val source_dir = "clone_hero_data/clonehero-win64/songs" def main(): for (dirpath, dirnames, filenames) in os.walk(source_dir)...
import glob import torch import numpy as np from skimage import io, transform from torchvision import transforms import torchvision.transforms.functional as F from torch.utils.data import Dataset from PIL import Image import random class ClusterDataset(Dataset): def __init__(self, cluster_list, dir_name, transfor...
def test(admin_client, syncgateway_version_str): result = admin_client.get_server() assert isinstance(result, dict) assert sorted(list(result)) == [ "ADMIN", "couchdb", "vendor", "version", ] assert result["ADMIN"] is True assert result["version"].startswith("Cou...
# encoding: utf-8 """ A mixin for :class:`~IPython.core.application.Application` classes that launch InteractiveShell instances, load extensions, etc. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import glob from itertools import chain import os import sys ...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="Gavl-Ignacio-Garrido-Botella", # Replace with your own username version="1.0.1", author="Ignacio Garrido Botella", author_email="ignaciogabo95@gmail.com", description="Framework to launch ...
import json import os import re import sys import time import unittest import click import vmraid import requests from .test_runner import (SLOW_TEST_THRESHOLD, make_test_records, set_test_email_config) click_ctx = click.get_current_context(True) if click_ctx: click_ctx.color = True class ParallelTestRunner(): def...
# # Copyright 2020 Logical Clocks AB # # 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 ag...
for letter in "Syed": print(letter) print("--------------------------------------------------------") friends=["Tom","Ali"] for fr in friends: print(fr) print("--------------------------------------------------------") for num in range(4): print(num) print("------------------------------------------------...
# 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 json import warnings import pulumi import pulumi.runtime from .. import utilities, tables class RegexPatternSet(pulumi.CustomRe...
# coding: utf-8 """ Copyright 2016 SmartBear Software 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...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
""" Copyright 2020, The Regents of the University of California. 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, this ...
from flask import Flask, jsonify from flask_pymongo import PyMongo app = Flask(__name__) app.config["MONGO_URI"] = "mongodb://localhost:27017/obsco" mongo = PyMongo(app) @app.route('/users/<int:userId>', methods=['GET']) def get_user(name = '', userId = -1): users = mongo.db.users results = [] #N...
## Load necessary librairies import numpy as np import tensorflow as tf import tensorflow_probability as tfp tfk = tf.keras tfkl = tfk.layers tfd = tfp.distributions tfb = tfp.bijectors import time import sys sys.path.insert(0,'') from flow import * import utils_vae # IPU from tensorflow.compiler.plugin.poplar.ops ...
""" Test file for nameserver. """ import multiprocessing import os import random import time from threading import Timer import pytest from osbrain import Agent from osbrain import AgentProcess from osbrain import NameServer from osbrain import NSProxy from osbrain import Proxy from osbrain import SocketAddress from ...
#! /usr/bin/env python3 # Copyright (c) 2021, NVIDIA CORPORATION. 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 # # ...
import logging import pyodbc from django.conf import settings from django.core.management.base import BaseCommand, CommandError from aspc.coursesearch.tasks import smart_update as update_task logger = logging.getLogger(__name__) class Command(BaseCommand): args = '' help = """Performs a conditional update of ...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
# 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...
""" File Name: test_masked_genome_dataset.py Project: bioseq-learning File Description: """ import os import time import random import logging import unittest from typing import List from torch.utils.data import DataLoader from src import E_COLI_GENOME_PARENT_DIR_PATH from src.datasets.genome_da...
from core.himesis import Himesis class HeannotationOUTdetailsSolveRefEAnnotationEStringToStringMapEntryEAnnotationEStringToStringMapEntry(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HeannotationOUTdetailsSolveRefEAnnotationEStringToStringMapEntryEAnnotat...
import json from unittest import TestCase from app import create_app, db as test_db from app.config import TestConfig from app.models import User, Verification test_app = create_app(TestConfig) class TestAuth(TestCase): def setUp(self): context = test_app.app_context() context.push() s...
#!/usr/bin/env python2 import time import nxt.usbsock import nxt.locator class CommunicatorNXT(object): def __init__(self): self.remote_inbox = 1 self.local_inbox = 2 self.mac_address = '00:16:53:01:B8:C3' # self.brick = nxt.usbsock.USBSock(self.mac_address).connect() self...
# Copyright (c) 2015 Supakorn Yukonthong import logging import struct class Parser: def __init__(self, log_level=None): self.logger = logging self.logger.basicConfig(level=log_level) self.logger.debug("DEBUG MODE ON") def parse(self, bc): self.logger.debug("Input Byte code : ...
from typing import List class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: if not nums: return [-1, -1] N = len(nums) left = 0 right = N - 1 while left < right: mid = (left + right) // 2 if nums[mid] == targ...
# Copyright (C) 2015-2016 Regents of the University of California # # 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...
import csv import pandas as pd from django.core.management import BaseCommand from ...models import Movie class Command(BaseCommand): help = 'Load a movie csv file into the database' def add_arguments(self, parser): parser.add_argument('--path', type=str) def handle(self, *args, **kwargs): ...
import spacy # Import the Matcher from spacy.matcher import Matcher nlp = spacy.load("en_core_web_sm") doc = nlp("New iPhone X release date leaked as Apple reveals pre-orders by mistake") # Initialize the Matcher with the shared vocabulary matcher = Matcher(nlp.vocab) # Create a pattern matching two tokens: "iPhone...
from .camera import ConfigurableCamera
from __future__ import absolute_import import json import re import six from collections import defaultdict from django.conf import settings from django.db.models import Q from sentry import http from sentry.api.base import Endpoint from sentry.incidents.models import Incident from sentry.models import Group, Projec...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Documentation for Mako templates: # http://www.makotemplates.org/docs/syntax.html import os, sys, re sys.path.append(os.path.join("codegen", "rabbitmq-codegen")) from amqp_codegen import * try: from mako.template import Template except ImportError: print "Mako...
import json import re import time import requests from ..codes import MSG_FIELD, NODE_EVENTS, WORKER_PROPERTIES from ..utils.wrappers import threaded class Worker(object): """Worker class for running PySyft models for training and inference.""" def __init__(self, id: str, socket): """ Args: ...
# -*- coding: utf-8 -*- # Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2008, Benjamin Kampmann <ben.kampmann@googlemail.com> """ This is a Media Backend that allows you to access the cool and cute pictures from lolcats.com. This is mainly meant as a Sample Media Backend...
# # Copyright 2020 Antoine Sanner # 2020 Lars Pastewka # 2015-2016 Till Junge # # ### MIT license # # 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, in...
from abc import ( ABC, abstractmethod ) from typing import ( Any, Callable, ContextManager, Dict, Iterable, Iterator, MutableMapping, Optional, Sequence, Tuple, Type, TypeVar, Union, ) from uuid import UUID import rlp from eth_bloom import BloomFilter from ...
""" The MIT License (MIT) Copyright (c) 2021-present tag-epic 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, merg...
__author__ = 'Giulio Rossetti' __license__ = "BSD-Clause-2" __email__ = "giulio.rossetti@gmail.com" import unittest import networkx as nx try: import igraph as ig except ModuleNotFoundError: ig = None from netdispatch import AGraph def from_nx_to_igraph(g, directed=False): """ :param g: :param...
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from dataclasses import dataclass from pathlib import Path from pants.base.build_root import BuildRoot from pants.engine.rules import collect_rules, rule from pants.option.global_options ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of my-weather-indicator # # Copyright (c) 2012 Lorenzo Carbonell Cerezo <a.k.a. atareao> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'tt.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', in...
import yaml import os # 获取当前文件路径 filePath = os.path.dirname(__file__) # 获取当前文件的Realpath fileNamePath = os.path.split(os.path.realpath(__file__))[0] # 获取配置文件的路径 yamlPath = os.path.join(fileNamePath, 'config.yml') # 加上 ,encoding='utf-8',处理配置文件中含中文出现乱码的情况 yml_read = yaml.load(open(yamlPath, 'r', encoding='utf-8').read(),...
# Copyright 2019 The Cirq Developers # # 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 ...
# -*- coding: utf-8 -*- # Copyright: (c) 2019, XLAB Steampunk <steampunk@xlab.si> # # 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 sys import pytest from ansible_collections.sen...
import rlp from typing import ( Iterable, Optional, Tuple, ) from eth_utils.toolz import ( curry, ) from eth_utils import ( to_tuple, ValidationError, ) from eth.rlp.blocks import ( BaseBlock, ) @to_tuple def diff_rlp_object(left: BaseBlock, right: BaseBlock) -> Opti...
# Packages import streamlit as st import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches import util # Configure page st.set_page_config(page_title='End of Game NBA Simulator', page_icon='https://raw.githubusercontent.com/papagorgio23/Python10...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
import asyncio from unittest import IsolatedAsyncioTestCase from aiodiskdb import exceptions from aiodiskdb.aiodiskdb import AioDiskDB from aiodiskdb.local_types import EventsHandlers class TestEventsHandlerStrictTyping(IsolatedAsyncioTestCase): def setUp(self) -> None: self.sut = EventsHandlers() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from optparse import OptionParser import os __author__ = "Raony Guimarães" __copyright__ = "Copyright 2012, Filter Analysis" __credits__ = ["Raony Guimarães"] __license__ = "GPL" __version__ = "1.0.1" __maintainer__ = "Raony Guimarães" __email__ = "raonyguimaraes@gmail.co...
""" Support for HomeMatic devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/homematic/ """ import asyncio from datetime import timedelta from functools import partial import logging import socket import voluptuous as vol from homeassistant.const...
""" function for analyzing molecules """ from .measure import calculate_distance from .atom_data import atomic_weights def build_bond_list(coordinates, max_bond=1.5, min_bond=0): # Find the bonds in a molecule (set of coordinates) based on distance criteria. bonds = {} num_atoms = len(coordinates) ...
from sympy.core.singleton import S from sympy.sets.sets import Set from sympy.calculus.singularities import singularities from sympy.core import Expr, Add from sympy.core.function import Lambda, FunctionClass, diff, expand_mul from sympy.core.numbers import Float, oo from sympy.core.symbol import Dummy, symbols, Wild f...
#!/usr/bin/env python # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division,print_function,unicode_literals import biplist from ds_store import DSStore...
from .misc import Registry, ensure_dir, load_cfg
#! /usr/bin/env python # -*- mode: python; coding: utf-8 -*- # Copyright 2016 the HERA Team. # Licensed under the BSD License. """Tell the Librarian to assign any recent Observations to grouped "observing sessions". You should only do this if no data are currently being taken, because otherwise the currently-active se...
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/03_data_pipeline.ipynb (unless otherwise specified). __all__ = ['get_func', 'Func', 'Sig', 'compose_tfms', 'batch_to_samples', 'mk_transform', 'Pipeline', 'TfmdBase', 'TfmdList', 'TfmdDS'] #Cell from ..torch_basics import * from ..test import * from .transform...
from peering_manager.api import OrderedDefaultRouter from . import views router = OrderedDefaultRouter() router.APIRootView = views.PeeringRootView router.register("autonomous-systems", views.AutonomousSystemViewSet) router.register("bgp-groups", views.BGPGroupViewSet) router.register("communities", views.CommunityV...
import bytecode, objects, errors import ast as ast_objects class Context(object): """Shamelessly plundered from Cycy""" def __init__(self): self.instructions = [] self.constants = [] self.variables = {} #self.NULL = self.register_constant(objects.Null()) #s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict EpochsInHour = 120 EpochsInDay = 2880 FIL_PRECISION = 10**18 class RunTime(object): def __init__(self): self.epoch = 0 self.caller = "" self.amount = 0 class VestingSpec(object): def __init__(self, ve...
# coding=utf-8 # Copyright 2022 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...
#!/usr/bin/env python import random import string import ftplib import zipfile import os import re import sys import socket def genRandomString(length): # генерирует и возвращает строку случайных символов заданой длины в нижнем регистре rS = ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)...
# import libraries from pyspark.sql import SparkSession from pyspark import SparkConf from pyspark.sql.types import * from pyspark.sql.functions import col, count, when from pyspark.ml.classification import LinearSVC import pandas as pd ################################################# # spark config ##############...
#!/usr/bin/env python2 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test spending coinbase transactions. # The coinbase transaction in block N can appear in block # N+10...
# Copyright 2013-2020 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 Ray(CMakePackage): """Parallel genome assemblies for parallel DNA sequencing""" homep...
# Copyright 2019 DeepMind Technologies 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.org/licenses/LICENSE-2.0 # # Unless required by ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
#!/usr/bin/env python # # Copyright 2018 VMware, Inc. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO...
# -*- coding:utf-8 -*- # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import numpy as np import yaml ...