text
stringlengths
2
999k
from fabric.api import * import fabric.contrib.project as project import os import shutil import sys import SocketServer from pelican.server import ComplexHTTPRequestHandler # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'output' DEPLOY_PATH = env.deploy_path # Remote server co...
''' This module contains the function calls to execute command line scipts ''' import os import salt import salt.cli import salt.log def salt_master(): ''' Start the salt-master. ''' master = salt.Master() master.start() def salt_minion(): ''' Kick off a salt minion daemon. ''' ...
# -*- coding: utf-8 -*- """ Copyright 2016 Marivi Pelaez Alonso. This file is part of BicingBot. 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 Un...
# 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 may ...
"""Direct softposit arithmetic. No emulation with MPFR. """ import math from sfpy import Posit8, Posit16, Posit32 from . import interpreter from . import evalctx from ..titanic import gmpmath softposit_precs = { (0, 8): Posit8, (1, 16): Posit16, (2, 32): Posit32, } class Interpreter(interpreter.SimpleI...
def as_str_any(value): """Converts to `str` as `str(value)`, but use `as_str` for `bytes`. Args: value: A object that can be converted to `str`. Returns: A `str` object. """ if isinstance(value, bytes): return as_str(value) else: return str(value) def as_text(bytes_or...
import sys, shutil sys.path.insert(1, "../../../") import h2o import random def milsong_checkpoint(ip,port): milsong_train = h2o.upload_file(h2o.locate("bigdata/laptop/milsongs/milsongs-train.csv.gz")) milsong_valid = h2o.upload_file(h2o.locate("bigdata/laptop/milsongs/milsongs-test.csv.gz")) distribution...
#!/usr/bin/python2 # -*- coding: utf-8 -*- # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistri...
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from geometry_msgs/Wrench.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import geometry_msgs.msg class Wrench(genpy.Message): _md5sum = "4f539cf138b23283b520fd271b567...
# Copyright 2020 ZenKey, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
import contextlib import io import shutil from zipfile import ZipFile def open_zip(fileobj, mode): return _Zip(ZipFile(fileobj, mode)) class _Zip(object): def __init__(self, zip_file): self._zip_file = zip_file def __enter__(self): return self def __exit__(self, *args): ...
from functools import partial import numpy as np import pytest from pandas.compat.numpy import np_version_gte1p22 import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.api.types import is_extension_array_dtype dtypes = [ "int64", "Int64", {"A": "int64", "...
# Copyright 2021 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import codecs import enum import logging import re import time import serial # Timeout for the unresponding serial console. SERIAL_CONSOLE_TIMEOUT = 1 #...
import pandas as pd import glob import csv import os import cv2 import json import numpy as np import os import time import glob from matplotlib import pyplot as plt import csv import sys import train from model import efficientdet from utils import preprocess_image, postprocess_boxes from utils.draw_boxes import dra...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import typing from cryptography import utils from cryptography import x509 from cryptography.hazmat.backends import _get_backend from cryp...
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test sending and receiving coins """ import copy import time from decimal import Decimal from test_...
"""Houses the classes used to transfer request and response data between components. """ from urllib.parse import parse_qs, urlsplit from .utils import CaseInsensitiveDict class Request: """Represents an HTTP request.""" def __init__(self, *, method, url, headers, body=b''): """Initialise a new Req...
from abc import abstractmethod from .typing import IGameComponent, IGameObject class GameComponent(IGameComponent): _owner: IGameObject = None @property def game_object(self) -> IGameObject: return self._owner @game_object.setter def game_object(self, g: IGameObject) -> None: se...
import django, os, sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "techtest.settings") sys.path.append(os.path.join(os.path.realpath(os.path.dirname(__file__)), "..", "..")) django.setup() from techtest.articles.models import Article from techtest.regions.models import Region from django.core import management ...
import torch def repeat_parameter(parameter, *sizes): parameter.data = parameter.data.repeat(*sizes) if parameter.grad is not None: parameter.grad = parameter.grad.repeat(*sizes) def qkv_weight_repeat(parameter, ratio): q, k, v = torch.chunk(parameter, 3, dim=0) q = q.repeat(ratio, ratio) ...
# -*- coding: utf-8 -*- import scrapy from locations.items import GeojsonPointItem class ScrewfixSpider(scrapy.Spider): name = "screwfix" allowed_domains = ["www.screwfix.com"] download_delay = 0.1 start_urls = ( "https://www.screwfix.com/jsp/tradeCounter/tradeCounterAllStoresPage.jsp", ) ...
# 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...
# NeHe Tutorial Lesson: 42 - Multiple Viewports # # Ported to PyOpenGL 2.0 by Brian Leair 18 Jan 2004 # # This code was created by Jeff Molofee 2000 # # The port was based on the PyOpenGL tutorials and from # PyOpenGLContext (tests/glprint.py) # # If you've found this code useful, feel free to let me know # at (Brian L...
import base64 import gzip import json import logging import os import random import string import unittest from io import BytesIO from logging.config import fileConfig import httpretty import python3.cloudwatch.src.lambda_function as worker # CONST BODY_SIZE = 10 STRING_LEN = 10 PYTHON_EVENT_SIZE = 3 NODEJS_EVENT_SIZE...
"""Create Docker TLSConfig from CertificateKeyPair""" from os import unlink from pathlib import Path from tempfile import gettempdir from typing import Optional from docker.tls import TLSConfig from authentik.crypto.models import CertificateKeyPair class DockerInlineTLS: """Create Docker TLSConfig from Certific...
MODEL_PATH_DEFAULT = "train.py" CLOUD_DEFAULT = "local" CPU_COUNT_DEFAULT = 16 MEMORY_SIZE_DEFAULT = 8 GPU_COUNT_DEFAULT = 0 GPU_TYPE_DEFAULT = 'NVIDIA_TESLA_P4' REGION_DEFAULT = 'us-west2' IMAGE_TAG_DEFAULT = '' IMAGE_URL_DEFAULT = '' OPTIONS_DEFAULT = {}
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! import os from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets # noinspection PyUnresolvedReferences import resources...
"""Module defining inputters. Inputters implement the logic of transforming raw data to vectorized inputs, e.g., from a line of text to a sequence of embeddings. """ from onmt.inputters.inputter import \ load_old_vocab, get_fields, OrderedIterator, \ build_vocab, old_style_vocab, filter_example from onmt.input...
import json import random from hashlib import md5 import pytz from django.conf import settings from django.contrib.auth.models import ( AbstractBaseUser, BaseUserManager, PermissionsMixin, ) from django.contrib.contenttypes.models import ContentType from django.db import models, transaction from django.db.models i...
# django-salesforce # # by Phil Christensen # (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org) # See LICENSE.md for details # from typing import Optional import types import django from django.conf import settings from salesforce import models if not getattr(settings, 'SF_EXAMPLE_EXTENDED_MODELS', F...
from __future__ import division from __future__ import print_function import cv2 import numpy as np import mxnet as mx from queue import Queue from threading import Thread from operator_py.cython.bbox import bbox_overlaps_cython from operator_py.bbox_transform import nonlinear_transform as bbox_transform class Dete...
from mbuild.tests.base_test import BaseTest from mbuild.formats.json_formats import compound_to_json, compound_from_json import mbuild as mb class TestJSONFormats(BaseTest): def test_loop(self, ethane): for part in ethane: part.element = part.name compound_to_json(ethane, 'ethane.json...
import torch import time from torch.autograd import Variable import scipy.io as sio import pandas as pd import gzip import bz2 import csv from random import shuffle torch.set_default_tensor_type('torch.DoubleTensor') def loadSavedMatFile(x): data = sio.loadmat(x) # populate each column of array #convert from nump...
# Copyright 2019 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, ...
import os import sys import warnings BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # print(BASE_DIR) # /home/xuel/xw/guohaoyu/taivision/tests/test_examples/Imagenet sys.path.append(BASE_DIR) warnings.filterwarnings('ignore') import argparse import random import numpy as np import torch impor...
# Copyright (c) 2020 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 app...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Morphe - Modular Forms Library Navtej Singh <singhnav@umich.edu> ''' # Imports # from __future__ import print_function import requests from time import sleep # Parameters # ps = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71...
import logging from django.contrib.contenttypes.models import ContentType from django.db.models.signals import post_save, post_delete, pre_delete from django.dispatch import receiver from .choices import LinkStatusChoices from .models import Cable, CablePath, Device, PathEndpoint, PowerPanel, Rack, Location, VirtualC...
from pathlib import Path import pandas as pd from pandas_profiling import ProfileReport from pandas_profiling.utils.cache import cache_file if __name__ == "__main__": file_name = cache_file( "websites.csv", "https://raw.githubusercontent.com/berkmancenter/url-lists/master/lists/et.csv", ) ...
default_app_config = ( 'wshop.apps.dashboard.promotions.config.PromotionsDashboardConfig')
#!/usr/bin/python class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ length = 0 i = 0 j = 0 substring = set() while i < len(s) and j < len(s): ...
# EXECUTION TIME: 6m22s # Python 3 ImportError import sys sys.path.append('.') import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter import seaborn as sns import typing import time import pickle from sklearn.ensemble import RandomForestClassifier from...
# -*- coding:utf8 -*- # File : utils.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 3/18/17 # # This file is part of TensorArtist. from .base import ProxyRLEnvironBase from tartist.core import get_logger from tartist.core.utils.meta import run_once import functools import collections import n...
# # 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...
# -*- coding: utf-8 -*- from ..base.account import BaseAccount class Ftp(BaseAccount): __name__ = "Ftp" __type__ = "account" __version__ = "0.07" __status__ = "testing" __pyload_version__ = "0.5" __description__ = """Ftp dummy account plugin""" __license__ = "GPLv3" __authors__ = [(...
""" DenseNet for CIFAR, implemented in Gluon. Original paper: 'Densely Connected Convolutional Networks,' https://arxiv.org/abs/1608.06993. """ __all__ = ['CIFARDenseNet', 'densenet40_k12_cifar10', 'densenet40_k12_cifar100', 'densenet40_k12_bc_cifar10', 'densenet40_k12_bc_cifar100', 'densenet40_k24_...
#!/usr/bin/env python COPY_GOOGLE_DOC_KEY = '1khyDJzKWdKMO_6HqcqKhQsa9dAABsW2fcXg7csON1CM'
#!/usr/bin/python import smtplib # The smtp module (Simple Mail Transfer Protocol) enables sending emails in python # The sender's email must be configured to less secure apps. # This configuration can be made on visiting account information. # Under the category security, less secure apps must turned on def send_c...
# 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...
# Copyright 2018 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. import mock import unittest from telemetry.internal.backends import android_browser_backend_settings as \ backends from devil.android.sdk import versio...
"""Routines for batch processing of cells (v2).""" import logging import pathlib import shutil import warnings import os import pandas as pd from cellpy import prms from cellpy import log from cellpy.utils.batch_tools.batch_exporters import CSVExporter from cellpy.utils.batch_tools.batch_experiments import CyclingEx...
from django.contrib import admin # Register your models here. from .models import Category, Post class PostInline(admin.StackedInline): model = Post class CategoryAdmin(admin.ModelAdmin): inlines = [PostInline,] # pass admin.site.register(Post) admin.site.register(Category, CategoryAdmin)
# -*- coding: utf-8 -*- """ 31. Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replacement must be in-plac...
#!/usr/bin/env python3 import argparse import pickle # ============================================================================= def generate_clkmap_csv(connections, tile_grid): """ Generates a map of GMUX locations for CLOCK pad locations """ csv_lines = [] # Get connection objects represen...
# matlab的方法如下 ''' J = (checkerboard(300,3,4)>0.5); %生成黑白棋盘图像 figure, imshow(J) %显示黑白棋盘图像 imwrite(J,'plate.jpg');%保存黑白棋盘图像 ''' import cv2 import numpy as np width = 1000*5 height = 700*5 length = 100*5 image = np.zeros((width,height),dtype = np.uint8) print(image.shape[0],image.shape[1]) for j in range(height): ...
def factorial(n): if n==0: result=1 else: result=n*factorial(n-1) return result print(factorial(3))
import argparse from pyteomics import mzxml import numpy as np def main(sample): print "Reading " + sample scans = [] r = mzxml.read(sample) while True: try: scans.append(r.next()) except: break print str(len(scans)) + " scans found in " + sample min1 = 10000000000 max1 = 0 scans = {} for sca...
from datetime import datetime from contextlib import contextmanager from sqlalchemy import Column, Integer, SmallInteger from flask import current_app from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy, BaseQuery __all__ = ['db', 'Base'] class SQLAlchemy(_SQLAlchemy): @contextmanager def auto_commit(self...
from .flash_memory import Block class FTL: def __init__(self, config): Block.idx = 0 self.block_num = int(config['block_num']) self.block_num_contain_op = int(self.block_num / (1 - float(config['op_ratio']))) self.page_per_block = int(config['page_per_block']) self.page_num ...
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause ''' This module defines the SFrame class which provides the ability to create, acces...
#!/usr/bin/env python # -*- coding: utf-8 -*- from webbreaker.common.webbreakerlogger import Logger # Okay - this will not look nice future person reading this. This needs to be fixed again after we # get our testing in a nicer spot - currently some tests check for logging output (not anything we've refactored # ...
from urllib.request import urlopen from bs4 import BeautifulSoup import re import pandas as pd from datetime import datetime, timedelta # https://search.shopping.naver.com/best100v2/detail.nhn?catId=50000190 category_df = pd.DataFrame({ 'category' : ['스킨케어', '베이스메이크업', '색조메이크업', '클렌징', '마스크/팩'...
# Made by Kerberos v1.0 on 2009/04/25 # this script is part of the Official L2J Datapack Project. # Visit http://www.l2jdp.com/forum for more details. import sys from com.l2jserver.gameserver.datatables import SkillTable from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.mo...
# -*- coding: utf-8 -*- # # Author: Tomi Jylhä-Ollila, Finland 2013-2016 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # class ...
# 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 ...
import torch import torch.nn as nn class QuadraticVF(nn.Module): def __init__(self, d_obs): super(QuadraticVF, self).__init__() self.d_obs = d_obs self.d_input = int(d_obs + (d_obs * (d_obs+1))/2 + 1) #linear + quadratic + time self.linear = nn.Linear(self.d_input, 1) torch...
from .interfaces import * from .ground_stations import * from .tles import * from .isls import * from .dynamic_state import * from .description import * from .post_analysis import * from .distance_tools import * from .dynamic_mcnf_paper_code import (instance_mcnf, interface, k_shortest_path, launch_dataset_dynamic,mcnf...
# 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 __a...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.core.exceptions import ValidationError from django.test import TestCase from django.utils import six from django.utils.functional import lazy from fancy_cronfield.fields import CronField from fancy_cronfield.widgets import CronWidget class CronFieldTests...
""" Django settings for rbapi project. Generated by 'django-admin startproject' using Django 2.2.4. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os # Bu...
from html.parser import HTMLParser from urllib.request import urlopen from urllib.parse import urljoin, urlparse from urllib.error import HTTPError from http.client import InvalidURL from ssl import _create_unverified_context class AnchorParser(HTMLParser): "Basic HTML parser that gathers a set of all href values ...
import os from time import sleep from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys import pyperclip class Utils: def __init__(self): self.chrome_driver_path = os.getcwd() + "/drivers/chromedriver" self.fire...
# -*- encoding: utf-8 -*- """ Description. """ __author__ = 'ZJlblDEHb' import datetime from sqlalchemy.orm.collections import InstrumentedList from config import DATETIME_FORMAT def form_output(data, keys): if isinstance(data, (list, tuple)): return generate_objects_list(data, keys) else: ...
# Simple example of how to log to a file # amwhaley@cisco.com # twitter: @mandywhaley # http://developer.cisco.com # http://developer.cisco.com/learning # Jan 15, 2015 # * THIS SAMPLE APPLICATION AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY # * OF ANY KIND BY CISCO, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT ...
#!/usr/bin/env python3 """ Module Docstring """ __author__ = "Brian McIlwain" __version__ = "0.1.0" __license__ = "MIT" import argparse from summarizer.summarizer import summarize def main(args): """ Main entry point of the app """ summarize(args.text) if __name__ == "__main__": """ This is executed w...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2022/5/1 19:15 Desc: 港股-基本面数据 https://emweb.securities.eastmoney.com/PC_HKF10/FinancialAnalysis/index?type=web&code=00700 """ import pandas as pd import requests def stock_financial_hk_report_em( stock: str = "00700", symbol: str = "现金流量表", indicator: str = "...
# Copyright (c) Neil Booth, ElectrumX developers '''An enum-like type with reverse lookup. Source: Python Cookbook, http://code.activestate.com/recipes/67107/ ''' class EnumError(Exception): pass class Enumeration: def __init__(self, name, enumList): self.__doc__ = name lookup = {} ...
# -*- coding: utf-8 -*- from django.db import models # nothing to see here... # vim:ai:et:ts=4:sw=4:sts=4:fenc=utf8:
# This is a sample commands.py. You can add your own commands here. # # Please refer to commands_full.py for all the default commands and a complete # documentation. Do NOT add them all here, or you may end up with defunct # commands when upgrading ranger. # A simple command for demonstration purposes follows. # ---...
# Copyright 2010-2019 Dan Elliott, Russell Valentine # # 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 appl...
from functools import partial from PyQt5 import QtCore, QtWidgets from PyQt5.QtGui import QPalette, QColor from PyQt5.QtWidgets import QFileDialog, QVBoxLayout, QFormLayout, QLineEdit, QDialogButtonBox import client_ui import connect_ui import private_ui import time import sys import socket import random from chat_roo...
#!/usr/bin/env python """Copyright (c) 2005-2019, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in s...
print(100 * "A")
import torch import torch.nn.functional as F import torch.autograd import a3t.diffai.helpers as h def catNonNullErrors(op, ref_errs=None): # the way of things is ugly def doop(er1, er2): erS, erL = (er1, er2) sS, sL = (erS.size()[0], erL.size()[0]) if sS == sL: # TODO: here we know we...
# Copyright 2015 IBM Corp. # # 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 t...
""" """ __version__ = "0.3-dev"
# 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...
import scrapy from joao_scrap.tools.cleanHTML import CustonTools from joao_scrap.tools.apiController import ApiRequest def get_data(response): for item in response.xpath('//ol[@class="u-list-unstyled c-search"]').xpath('li'): try: try: descricao = item.css('p.c-headline__stan...
import sys from os import path from bs4 import BeautifulSoup sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from src.stats.player_stats import ( STAT_RECS, get_player_stats_from_pfr, get_stat_for_season, ) # Feel free to change this to the URL of your favorite player PLAYER_PFR_URL ...
#!/usr/bin/env python3 # Copyright (c) 2019-2021 WAZN Project # Copyright (c) 2019-2020 The Monero Project # # 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 so...
"""A parser for reading NASA JPL GipsyX timeseries file Example: -------- from analyx import parsers p = parsers.parse_file(parser_name='gipsyx_series', file_path='NYA1.series') data = p.as_dict() Description: ------------ Reads data from files in GipsyX timeseries format. """ # Standard library import...
import os def memoize(f): """ Cache function results, similar to py3.7 functools.lru_cache """ memo = {} def helper(*args): key = tuple(args) if key not in memo: memo[key] = f(*args) return memo[key] return helper @memoize def get_project_path(): """ Returns (...
import FWCore.ParameterSet.Config as cms # -*-TCL-*- from RecoMuon.MuonIsolationProducers.isoDepositProducerIOBlocks_cff import * from RecoMuon.MuonIsolationProducers.trackExtractorBlocks_cff import * muIsoDepositTk = cms.EDProducer("MuIsoDepositProducer", IOPSet = cms.PSet( MIsoDepositViewIOBlock ), ...
import unittest from transformers import is_torch_available from .utils import require_torch if is_torch_available(): from transformers.activations import _gelu_python, get_activation, gelu_new import torch @require_torch class TestActivations(unittest.TestCase): def test_gelu_versions(self): ...
from .base import Piece, PieceRepresentation import numpy as np class Rook(Piece): def __init__(self, color, *args, **kwargs): """Initialise bishop, sets color of piece.""" # Initialise bishop with correct symbol super().__init__( color, symbol = PieceRepresentation...
# Copyright 2011 OpenStack Foundation # 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 requ...
my_foods = ['pizza', 'falafel', 'carrot cake'] friend_foods = my_foods[:] print("My favorite foods are:") print(my_foods) print("\nMy friend's favorite foods are:") print(friend_foods)
from .classes import Hashable from .functions.sequence_ops import Sequence from .syd import SydData, SydContainer, SydDataType
# This is the Twisted Get Poetry Now! client, version 2.0. # NOTE: This should not be used as the basis for production code. import datetime, optparse from twisted.internet.protocol import Protocol, ClientFactory def parse_args(): usage = """usage: %prog [options] [hostname]:port ... This is the Get Poetry No...