text
stringlengths
1
927k
#!/usr/bin/env python3 """ Converts the LibreOffice `download.lst` file into a Nix expression. Requires an environment variable named `downloadList` identifying the path of the input file, and writes the result to stdout. todo - Ideally we would move as much as possible into derivation dependencies. """ import colle...
"""Utility methods for marshmallow.""" import collections import functools import datetime as dt import inspect import json import re import typing from collections.abc import Mapping from email.utils import format_datetime, parsedate_to_datetime from pprint import pprint as py_pprint from marshmallow.base import Fiel...
# coding: utf-8 import pprint import re import six from huaweicloudsdkcore.sdk_response import SdkResponse class DeleteInstanceResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (di...
import re SPLIT_RE = re.compile(r'[\.\[\]]+') class JsonSchemaException(ValueError): """ Base exception of ``fastjsonschema`` library. """ class JsonSchemaValueException(JsonSchemaException): """ Exception raised by validation function. Available properties: * ``message`` containing huma...
# encoding: utf-8 # module NationalInstruments.Restricted calls itself Restricted # from NationalInstruments.Common, Version=19.0.40.49152, Culture=neutral, PublicKeyToken=dc6ad606294fc298 # by generator 1.145 # no doc # no imports # functions def IAnalogWaveformService(*args, **kwargs): # real signature unknown ...
""" Copyright (c) 2019 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 in writing,...
# Copyright 2021 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Engine shouldn't explode when step_test_data gets functools.partial. This is a regression test for a bug caused by this revision: http://src.c...
from setuptools import setup setup( name = 'PyWebmo', packages = ['PyWebmo'], version = '0.1', description = 'Webmo client library for Python', author = 'Cidre Interaction Design Inc.', author_email = 'info@cidre.tokyo', url = 'https://github.com/cidreixd/webmo-library-python', download_url = 'https://g...
import re import requests from scrapers.models.dog import Dog #Small reverse engineering of the pet finder api class PetFinderApi(): def __init__(self, zip_code): self.zip_code = zip_code @staticmethod def _get_api_key(): response = requests.get('https://www.petfinder.com/wp-content/th...
# -------------- # Import packages import numpy as np import pandas as pd from scipy.stats import mode # code starts here #Load Dataset bank = pd.read_csv(path) # Display categorical variable categorical_var=bank.select_dtypes(include='object') #print("Categorical variables : ",categorical_var) #Co...
""" main app entrypoint """ import terminal def application(editor_ns): """ load application into editor namespace """ exec(""" null = None true = True false = False from context import Context self = Context() """, editor_ns) terminal.onload(callback=application)
"""Generated message classes for gkemulticloud version v1. Anthos Multi-Cloud provides a way to manage Kubernetes clusters that run on AWS and Azure infrastructure using the Anthos Multi-Cloud API. Combined with Connect, you can manage Kubernetes clusters on Google Cloud, AWS, and Azure from the Google Cloud Console....
# 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...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load(":envoy_http_archive.bzl", "envoy_http_archive") load(":repository_locations.bzl", "REPOSITORY_LOCATIONS") def api_dependencies(): envoy_http_archive( "bazel_skylib", locations = REPOSITORY_LOCATIONS, ) envoy_http_arc...
#!/usr/bin/env python # 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 # "L...
from chill import * source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/jacobi-1d/kernel.c') destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/jacobi-1d/tmp_files/613.c') procedure('kernel_jacobi_1d') loop(0) tile(0,2,32,2) tile(1,2,32,2)
print("Welcome to Micropython on EDU-CIAA-NXP")
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function AUTHOR = u'Adrian Sampson' # General configuration extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks'] exclude_patterns = ['_build'] source_suffix = '.rst' master_doc = 'index' project = u'beets' copyright = u'2016, Ad...
import telegram from sqlalchemy import Column, Integer, String, Boolean from sqlalchemy.orm import relationship from . import Base class Chat(Base): __tablename__ = 'chats' db_id = Column(Integer, primary_key=True) type = Column(String) title = Column(String) username = Column(String, unique=True) first_name ...
class TestPost: def test_create_and_delete_post(self, driver_login): pass
import json from datetime import datetime, timezone from faust.exceptions import ValueDecodeError from faust.types.tuples import Message import pytest from assertpy import assert_that from faust_avro import Record from faust_avro import context as ctx class Key(Record): idx: int class Person(Record): name...
import pytest from unyt.unit_object import define_unit from unyt.unit_registry import UnitRegistry from unyt.array import unyt_quantity def test_define_unit(): define_unit("mph", (1.0, "mile/hr")) a = unyt_quantity(2.0, "mph") b = unyt_quantity(1.0, "mile") c = unyt_quantity(1.0, "hr") assert a =...
# Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='product-info']/h2[@class='title']", 'price' : "//span[@class='price']", 'category' : "//div[@class='br']/a", 'de...
from flask import request from flask_restful import Resource, reqparse from ..models import db from ..services.hotel_display import get_hotel_data import jwt from ..settings import key import datetime # Route for HotelDisplay class HotelDisplay(Resource): parser = reqparse.RequestParser() @classmethod def...
"""Climate sensors for Heatzy.""" import logging from heatzypy.exception import HeatzyException from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( HVAC_MODE_HEAT, HVAC_MODE_OFF, PRESET_AWAY, PRESET_COMFORT, PRESET_ECO, PRESET_NONE, ...
from django.test import TestCase from adminplus.sites import AdminSitePlus class AdminPlusTests(TestCase): def test_decorator(self): """register_view works as a decorator.""" site = AdminSitePlus() @site.register_view(r'foo/bar') def foo_bar(request): return 'foo-bar'...
import jax import jax.numpy as jnp import os # Load models & tokenizer from dalle_mini.model import DalleBart, DalleBartTokenizer from vqgan_jax.modeling_flax_vqgan import VQModel from transformers import CLIPProcessor, FlaxCLIPModel import wandb from transformers import CLIPProcessor, CLIPModel from dalle_mini.model i...
#!/usr/bin/env python3 def ceil_div(n, k): return n//k + (n%k!=0) def lowbit(x): return x & (-x) def sum_until(rs, n): c = 0 while n > 0: c += rs[n] n -= lowbit(n) return c def increase(rs, n): while n < len(rs): rs[n] += 1 n += lowbit(n) def method_a(ls...
# Copyright 2020 The Vertizee 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 or agreed to in ...
import numpy as np from itertools import product from itertools import permutations import matplotlib.pyplot as plt import pickle import os import stimulus import parameters import analysis class Motifs: def __init__(self, data_dir, file_prefix, N = None): self.motifs = {} self.motif_sizes = [2,...
from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class POP_RETR_1(Base): __slots__ = () _SDM_NAME = 'POP_RETR_1' _SDM_ATT_MAP = { 'Request command': 'POP_RETR_1.REQUESTX.Request command', 'Space7': 'POP_RETR_1.REQUESTX.Space7', 'Request parameter': 'P...
""" This package enables easy single-scale and multi-scale optimization support. """ from __future__ import print_function from __future__ import absolute_import # from builtins import zip # from builtins import str # from builtins import range # from builtins import object from abc import ABCMeta, abstractmethod impo...
import os import networkx as nx import geonetworkx as gnx import geopandas as gpd def get_copenhagen_street_net(): """Reads dataset geojson and return the corresponding geograph.""" dir_path = os.path.dirname(os.path.realpath(__file__)) nodes_path = os.path.join(dir_path, "copenhagen_streets_net_nodes.geo...
# You are a renowned thief who has recently switched from stealing precious metals to stealing cakes because of the insane profit margins. # You end up hitting the jackpot, breaking into the world's largest privately owned stock of cakes—the vault of the Queen of England. # While Queen Elizabeth has a limited number of...
"""Entry point of the project """ import json import settings as _ # Loader script for initializing things. from conf import config from src.logger import logger def main(): """Main function Run this file with `python app.py` """ print("\n") logger.info("Success! Here is you're config:\n") l...
from functools import wraps import os import pandas as pd def _read_csv(name, **kw): path = os.path.join(os.path.dirname(__file__), 'data', name) return pd.read_csv(path, **kw) def apply_one_hot(fun): @wraps(fun) def wrapper(*args, **kw): X, y = fun(*args, **kw) X = pd.get_dummies(X,...
import boto3 from botocore.exceptions import ClientError import json import os import time from datetime import datetime, timezone from dateutil import tz from antiope.aws_account import * from common import * import logging logger = logging.getLogger() logger.setLevel(getattr(logging, os.getenv('LOG_LEVEL', default=...
import numpy as np def calculate_distance(rA, rB): """ This function calculates the distance between two points. Parameters ---------- rA, rB : np.ndarray The coordinates of each point. Returns ------- distance : float The distance between two points. Examples ...
#!/usr/bin/env python COPY_GOOGLE_DOC_KEY = '1nXqNsO6ZbUpAxKpFe7eWM8x7SQKd7MDcH6AT0fWyNaY'
from abc import ABC, abstractmethod class MeltanoExtractor(ABC): @abstractmethod def extract(self): pass
# -*- coding: utf-8 -*- from deprecation import deprecated from square.api_helper import APIHelper from square.http.api_response import ApiResponse from square.api.base_api import BaseApi from square.http.auth.o_auth_2 import OAuth2 class LaborApi(BaseApi): """A Controller to access Endpoints in the square API....
# Generated by Django 3.1 on 2020-08-18 18:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('application', '0001_initial'), ] operations = [ migrations.CreateModel( name='Neighbourhood', fields=[ ...
from nomad.api.base import Requester class Client(object): def __init__(self, **kwargs): self.ls = ls(**kwargs) self.cat = cat(**kwargs) self.stat = stat(**kwargs) self.stats = stats(**kwargs) self.allocation = allocation(**kwargs) self.read_at = read_at(**kwargs) ...
import warnings import numpy as np from joblib import Parallel, delayed from sklearn.base import MetaEstimatorMixin, clone from sklearn.multiclass import OneVsRestClassifier as _SKOvR from sklearn.multiclass import _ConstantPredictor from sklearn.pipeline import Pipeline from sklearn.preprocessing import LabelBinarize...
# The Parser is a recursive descent parser that takes some input program and recursively parses the text starting at # the program level, until an EOF token or an error is found. Variable names and values are stored and updated in a # dictionary representing a symbol table. # # To construct a recursive descent pars...
from kivy.app import App from kivy.factory import Factory from kivy.lang import Builder Factory.register('QRScanner', module='electroncash_gui.kivy.qr_scanner') class QrScannerDialog(Factory.AnimatedPopup): __events__ = ('on_complete', ) def on_symbols(self, instance, value): instance.stop() ...
from auxiliar import receberInt, receberFixo import moeda def receberPreco(): preco = float(input(f'\n\tDigite o preço: {md}')) return preco def receberPorcentagem(): preco = float(input('\n\tDigite a porcentagem (10 para 10%, 5 para 5%, etc): ')) return preco # main menu = f""" \t {'=~'*20}= \t :{...
from typing import List from config import IRC import requests import ipaddress import fido from modules.access import require_permission, Levels from models import SessionManager, config from modules import configmanager import logging log = logging.getLogger(__name__) @require_permission(level=Levels.OP, message=...
#!/usr/bin/env python3 import json import requests from openpyxl import Workbook, load_workbook from openpyxl.utils import datetime from openpyxl.styles import numbers from requests.packages.urllib3.exceptions import InsecureRequestWarning import warnings import pickle import os import sys import argparse #import ppri...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): from djangopypi.models import Package for package in Package.objects.iterator(...
"""Default variable filters.""" import random as random_module import re import types from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation from functools import wraps from operator import itemgetter from pprint import pformat from urllib.parse import quote from django.utils import formats from django....
"""Benchmark for figureeight0. Trains a fraction of vehicles in a ring road structure to regulate the flow of vehicles through an intersection. In this example, the last vehicle in the network is an autonomous vehicle. Action Dimension: (1, ) Observation Dimension: (28, ) Horizon: 1500 steps """ from flow.core.par...
# (C) Datadog, Inc. 2021-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ....fs import ( chdir, dir_exists, ensure_parent_dir_exists, file_exists, path_join, read_file, read_file_lines, write_file_lines, ) from ...configuration...
import pytest import os from pyutils import here def test_here_default(): assert here(__file__) == os.path.dirname(__file__) def test_here_appends_paths(): assert here(__file__, "a", "path") == os.path.join(os.path.dirname(__file__), "a", "path") def test_here_gets_abs_path(): assert here(__file__, "..")...
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req...
import pickle import matplotlib.pyplot as plt import numpy as np import Levenshtein import math import pandas as pd from sklearn.metrics import silhouette_score ,calinski_harabasz_score,davies_bouldin_score from scipy.spatial import distance from sklearn.preprocessing import StandardScaler, Normalizer, MinMaxScaler im...
from __future__ import absolute_import from django.http import HttpResponse, HttpRequest from typing import List, Text from zerver.decorator import authenticated_json_post_view from zerver.lib.actions import do_set_muted_topics from zerver.lib.request import has_request_variables, REQ from zerver.lib.response import ...
# Copyright 2017 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...
# Generated by Django 2.2.2 on 2020-02-11 05:37 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('residentadvisor', '0013_auto_20200211_0535'), ] operations = [ migrations.AlterField( ...
# coding: utf-8 """ Pure Storage FlashBlade REST 1.6 Python SDK Pure Storage FlashBlade REST 1.6 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.6 Contact: i...
from datetime import datetime, timedelta, timezone import twitter from creds import TWITTER_KEY, TWITTER_KEY_SECRET, TWITTER_TOKEN, TWITTER_TOKEN_SECRET from dateutil import tz # twitter api object api = twitter.Api(consumer_key=TWITTER_KEY, consumer_secret=TWITTER_KEY_SECRET, acce...
from django.urls import path, include from rest_framework.routers import DefaultRouter from profiles_api import views router = DefaultRouter() router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset') router.register('profile', views.UserProfileViewSet) router.register('feed', views.UserProfil...
# -*- coding: utf-8 -*- """ The :mod:`coclust.coclustering.coclust_mod` module provides an implementation of a co-clustering algorithm by direct maximization of graph modularity. """ # Author: Francois Role <francois.role@gmail.com> # Stanislas Morbieu <stanislas.morbieu@gmail.com> # License: BSD 3 clause i...
# # Copyright 2019, Couchbase, Inc. # 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 applicable l...
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver import Firefox, Chrome, PhantomJS ...
# -*- coding: UTF8 -*- # vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 foldmethod=marker: # import json # 本地 db 规则: # # /data/group_name/node_id/database_name/table_name/partition_id/ # /source_data/base/database_name/table_name/partition_id/version # /source_data/delta/database_name/table_name/partition_id...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets 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 appl...
import functools @functools.cache def play(pos1, pos2, score1=0, score2=0): if score2 >= 3: return 0, 1 wins1, wins2 = 0, 0 for move, n in (3,1),(4,3),(5,6),(6,7),(7,6),(8,3),(9,1): pos1_ = (pos1 + move) % 10 or 10 w2, w1 = play(pos2, pos1_, score2, score1 + pos1_) wins1, wins2 = wins1 + n*w1,...
"""change_keys_of_facters_and_violations_to_separated_table Revision ID: 4cf3e398a81f Revises: 21087e990aa8 Create Date: 2013-12-04 17:42:02.709200 """ # revision identifiers, used by Alembic. revision = '4cf3e398a81f' down_revision = '21087e990aa8' from alembic import op import sqlalchemy as sa def upgrade(): ...
# 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...
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup setup_args = generate_dis...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
#!/usr/bin/env python # # GrovePi Project for a Plant monitoring project. # * Reads the data from moisture, light, temperature and humidity sensor # and takes pictures from the Pi camera periodically and logs them # * Sensor Connections on the GrovePi: # -> Grove Moisture sensor - Port A1 # -> Grove light sensor ...
# --------------------------------------------------------------------- # Cisco.NXOS.get_lldp_neighbors # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # P...
####################################################################### # Copyright (C) # # 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) # # 2016 Kenta Shimada(hyperkentakun@gmail.com) # # Permission given to modify the...
import logging import sys from re import sub from pyscilog.filter import LogFilter from pyscilog.writer import Writer from pyscilog.state import State state = State() log_filter = LogFilter() fmt = "%(asctime)s - %(shortname)-18.18s %(subprocess)s%(memory)s%(separator)s%(message)s" datefmt = '%H:%M:%S' # '%H:%M:%S.%f...
# Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# -*- 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 from __future__ import print_function as _ from __future__ import division as _ from...
""" Tests for list_util module """ # Import package, test suite, and other packages as needed import sermacs_workshop as acs import pytest import sys def test_title_case(): """Sample test, will always pass so long as import statement worked""" test_string = 'this IS a Test sTrinG' title_string = acs.title...
# Copyright 2012 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...
class Solution: def isHappy(self, n: int) -> bool: x=[] def Happy(n,x): t,k=0,0 while n>0: t=n%10 n=n//10 k=k+t*t if k==1: return True else: if k in x: ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
from ktane.directors import BombSolver, from_pool from ktane.mods.f import FollowTheLeader from ktane.vanilla import Wires, ComplicatedWires, WireSequence BombSolver( Wires(), ComplicatedWires(), WireSequence(), FollowTheLeader(), *from_pool(Wires, ComplicatedWires) ).solve()
from flask_wtf import FlaskForm from wtforms import TextField from wtforms.validators import DataRequired, Length from wtforms.fields.html5 import DateField class BooksForm(FlaskForm): title = TextField('Title', validators=[DataRequired(), Length(min=1, max=254)]) autho...
# MIT License # # Copyright (c) 2019 Red Hat, Inc. # # 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...
# Generated by Django 2.1.15 on 2020-01-19 20:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0008_auto_20200119_2142'), ] operations = [ migrations.AlterField( model_name='user', name='office_telephon...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz> # Copyright (C) 2016 Manas Ranjan Kar <manasrkar91@gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """This script allows to convert GloVe vectors into the word2vec. Both fi...
from __future__ import division, print_function, absolute_import import subprocess import time import os import sys import errno from pyqtgraph.pgcollections import OrderedDict from pyqtgraph.python2_3 import basestring path = os.path.abspath(os.path.dirname(__file__)) examples = OrderedDict([ ('Command-line usa...
"""Implementation for Brink-Home Cloud""" import asyncio import async_timeout import logging import aiohttp from ..const import API_URL, NAMES, MODES, MODE_TO_VALUE _LOGGER = logging.getLogger(__name__) class BrinkHomeCloud: """Interacts with Brink Home via public API.""" def __init__(self, session: aiohtt...
from django.core.management import call_command from django.test import TestCase from django.utils.six import StringIO import os from django.contrib.auth.models import User from students.models import Student, Group from django.test import override_settings class FillDBTest(TestCase): """Test fill_db command""" ...
from parsl.channels import SSHChannel from parsl.providers import SlurmProvider from parsl.launchers import SingleNodeLauncher from parsl.config import Config from parsl.executors.ipp import IPyParallelExecutor from parsl.executors.ipp_controller import Controller # This is an example config, make sure to # re...
import httpx from anilist.types import Anime from pyrogram import filters from pyrogram.types import CallbackQuery from pyromod.helpers import ikb from pyromod.nav import Pagination from amime.amime import Amime @Amime.on_callback_query(filters.regex(r"^winter_2022 anime (?P<page>\d+)")) async def anime_suggestions(...
# Подсчитайте результат вычисления выражения 213169^{123} и запишите его 10 раз подряд, а затем возведите получившееся # число в квадрат. # # Подсказка: воспользуйтесь функцией int. print(int(str(213169 ** 123) * 10) ** 2)
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import torch import onnxruntime_pybind11_state as torch_ort import os class OrtEPTests(unittest.TestCase): def get_test_execution_provider_path(self): return os.path.join('.', 'libtest_execution_provi...
#52 Faça um programa que leia um número inteiro e diga se ele é ou não um número primo. contador = 0 numero = int(input('Digite um número: ')) x = numero for x in range(1,numero+1): if numero % x == 0: contador += 1 print(f'O número {numero} foi divisível {contador} vezes') if contador == 2: print(f'E ...
#!/usr/bin/env python """ Installation script: To release a new version to PyPi: - Ensure the version is correctly set in oscar.__init__.py - Run: make release """ import os import re import sys from setuptools import find_packages, setup PROJECT_DIR = os.path.dirname(__file__) sys.path.append(os.path.join(PROJECT_...
# encoding: utf-8 # Variables for setup (these must be string only!) __module_name__ = u'timingsutil' __description__ = u'A collection of timing utilities.' __version__ = u'1.7.0' __author__ = u'Hywel Thomas' __authorshort__ = u'HT' __authoremail__ = u'hywel.thomas@mac.com' __license__ = u'MIT' __githost__ = u'bit...
#!/usr/bin/env python # encoding: utf-8 # This code has been adapted from https://gist.github.com/yanofsky/5436496 import sys import tweepy # https://github.com/tweepy/tweepy import csv import api_keys import xlsxwriter import tweet_cleaner import json import argparse parser = argparse.ArgumentParser(description='co...