text
stringlengths
2
999k
from invoke import task @task def dist(context): context.run("python setup.py bdist_wheel") @task def test(context): context.run("tox")
"""Neural network operations.""" from __future__ import absolute_import as _abs from ...expr import TupleWrapper from . import _make def conv2d(data, weight, strides=(1, 1), padding=(0, 0), dilation=(1, 1), groups=1, channels=None, kernel_si...
import pathlib from bs4 import BeautifulSoup HTML_LEAF_PAGE_SAMPLE_PATH = pathlib.Path('tests', 'fixtures', 'html', 'leaf_page_sample.html') HTML_TEXT = '' def setup(): global HTML_TEXT with open(HTML_LEAF_PAGE_SAMPLE_PATH, "rt", encoding="utf-8") as handle: HTML_TEXT = handle.read() def teardown()...
import datetime from django.db import models from django.utils import timezone class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question_text def was_published_recently(self): ...
# -*- coding: utf-8 -*- import os, json if os.name == 'nt': SLASH = '\\' else: SLASH = '/' def makeOutputFolder(folder_name,counter): try: if counter is not None: write_folder_name = folder_name + ' (' + str(counter) + ')' else: write_folder_name = folder_name write_folder = os.mkdir(write_folder_name...
''' Coding our First Game in PyGame - Creating Ground for Snakes ''' import pygame pygame.init() # print(x) # All 6 pygame modules successfully imported # Colors white = (255, 255, 255) red = (255, 0, 0) black = (0, 0, 0) # Creating Game Window screen_width = 900 screen_height = 600 gameWindow = pygame...
from .Assembly import Assemble, AssembleForces, AssembleInternalTractionForces, AssembleExplicit, AssembleMass, AssembleForm
import pgzrun import gameinput import gamemaps from random import randint from datetime import datetime WIDTH = 600 HEIGHT = 660 player = Actor("pacman_o") # Load in the player Actor image player.score = 0 player.lives = 3 level = 0 SPEED = 3 def draw(): # Pygame Zero draw function global pacDots, player scre...
#pylint: disable=missing-module-docstring,missing-function-docstring,missing-class-docstring,no-self-use,too-few-public-methods def first(): # First should be defined after second, too keep call order pass def second(): first() class Example: def first(self): # First should be defined after second, to...
import logging class Calculator(object): def __init__(self, config): self.config = config
import json import os import pytest from flask import Flask, url_for from pyquery import PyQuery as pq from flask_jsondash import charts_builder, utils from flask_jsondash import db URL_BASE = 'http://127.0.0.1:80' app = Flask('test_flask_jsondash', template_folder='../flask_jsondash/example_app/templat...
import json import pytest import os import sys abs_path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(f'{abs_path}/../..') sys.path.append(f'{abs_path}/../../..') print(sys.path[-1]) from moto import mock_dynamodb2 from redirect_handler import app import boto_utils from constants import TABLE_NAME import...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from timeit import time import warnings import cv2 import numpy as np from PIL import Image from yolo import YOLO from deep_sort import preprocessing from deep_sort import nn_matching from deep_sort.detect...
# Copyright 2013-2021 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 PyMypy(PythonPackage): """Optional static typing for Python.""" homepage = "http://ww...
# 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...
# -*- coding: utf-8 -*- """ Ebay Trading API """ import xmltodict import requests from . import app_settings as settings class TradingAPIWarning(Exception): pass class TradingAPIFailure(Exception): pass class TradingAPIInvalidResponse(Exception): pass class TradingAPI(object): _last_response = ...
import pathlib import re import pytest from typer.testing import CliRunner from taipo.__main__ import app from taipo.common import nlu_path_to_dataframe runner = CliRunner() @pytest.mark.parametrize( "path_in,path_out", [("nlu.yml", "nlu.yml"), ("foobar.yml", "foobar.yml")] ) def test_keyboard_augment(tmp_path...
from scirpy.util import ( _is_na, _is_false, _is_true, _normalize_counts, _is_symmetric, _reduce_nonzero, _translate_dna_to_protein, ) from scirpy.util.graph import layout_components from itertools import combinations import igraph as ig import numpy as np import pandas as pd import numpy.te...
"""File path encryption. Put files to public directory by encryption. And this anchers of relationship. This module anable change the anchers. """ import glob import logging import os import shutil try: from . import filename from .anchor.anchor import Anchor except: import filename from anchor.anchor ...
import copy import logging from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union import numpy as np from skimage.segmentation import felzenszwalb, quickshift, slic from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR from alibi.api.interfaces i...
import os import sys import time import hashlib import zlib import random import string import subprocess as sb import redis import json from collections import Counter digestsize = 20 class RedisDataStore: def __init__(self, loc, db=0): self.conn = redis.StrictRedis(loc, db=db) def post_experiment(...
# coding=utf-8 # Copyright 2019 The Tensor2Tensor 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...
import random from sklearn.datasets import fetch_mldata from util import open_file_in_directory MNIST_DIR = './tmp/mnist' MNIST_TRAIN_DIR = './mnist/train' MNIST_TEST_DIR = './mnist/test' MNIST_SAMPLE_DIR = './mnist/sample' TEST_CASES = 60000 def mnist_img_to_file(mnist_img, file): for x in range(28): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Abstract Transport """ import typing import abc from apt.transport.directorylisting import DirectoryListing class Transport: """ Abstract class for retrieving information from repos The functions 'exists' and 'open_read' are required to be implemented...
""" CPDParser parses the ConsensusPathDB_human_PPI data file and yields a generated dictionary of values. Source Project: biothings.interactions Author: Greg Taylor: greg.k.taylor@gmail.com """ import hashlib import re from hub.dataload.BiointeractParser import BiointeractParser class CPDParser(BiointeractParser...
import pytest from distributed_asgi import create_path_distributor def test_path_distributor(): dist = create_path_distributor(routes={ "/api/([a-z-]+)": r"\1" }) for path, expected_key in [ ("/api/banana", "banana"), ("/banana", None), () ]: instance = dist({"p...
import ast import importlib import logging import os import sys from typing import Dict, Any # noqa: F401 from flask import Flask, Blueprint from flask_restful import Api from metadata_service.api.column import ColumnDescriptionAPI from metadata_service.api.healthcheck import healthcheck from metadata_service.api.po...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy 2008-2018 (ita) """ MacOSX related tools """ import os, shutil, platform from waflib import Task, Utils from waflib.TaskGen import taskgen_method, feature, after_method, before_method app_info = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "f...
# 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...
from django.shortcuts import render, redirect, get_object_or_404 from django.views.generic import ListView, DetailView, DeleteView, UpdateView from django import forms from django.urls import reverse_lazy, reverse from django.views import View from django.contrib.auth import authenticate, login, logout from django.cont...
# 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 req...
from random import randint from tnnp import nn as tnnp nn = tnnp.NeuralNetwork(2, 2, 1) if nn is None: raise Exception("Initialization failed!", m.matrix) nn = tnnp.NeuralNetwork(2, 2, 1) input = [1, 0] output = nn.feedforward(input) if output < [-1] or output > [1]: raise Exception(".feedforward function fa...
import tensorflow as tf from tensorflow import layers as tfl from .base_model import BaseModel, Mode class SimpleClassifier(BaseModel): input_spec = { 'image': {'shape': [None, None, None, 1], 'type': tf.float32} } required_config_keys = [] default_config = {'data_format': 'channels_first...
#!/usr/bin/env python # Copyright 2020 Informatics Matters Ltd. # # 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...
""" Function taken from IceCube astro package. """ import numpy as np def angular_distance(lon1, lat1, lon2, lat2): """ calculate the angular distince along the great circle on the surface of a shpere between the points (`lon1`,`lat1`) and (`lon2`,`lat2`) This function Works for equatorial coordin...
from django.contrib import admin from .models import Action @admin.register(Action) class ActionAdmin(admin.ModelAdmin): list_display = ('user', 'verb', 'target', 'created') list_filter = ('created',) search_fields = ('verb',)
# Copyright 2021-present citharus # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use utils.py 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 ...
""" Pipeline for text processing implementation """ from pathlib import Path import re import pymorphy2 from pymystem3 import Mystem from constants import ASSETS_PATH from core_utils.article import Article, ArtifactType class EmptyDirectoryError(Exception): """ No data to process """ class Inconsiste...
import os from setuptools import ( find_packages, setup ) __version__ = open("VERSION", 'r').read().strip() REQUIREMENTS_FOLDER = os.getenv('REQUIREMENTS_PATH', '') requirements = [line.strip() for line in open(os.path.join(REQUIREMENTS_FOLDER, "requirements.txt"), 'r')] setup( name='ninjin', versi...
""" ************** SparseGraph 6 ************** Read graphs in graph6 and sparse6 format. Format ------ "graph6 and sparse6 are formats for storing undirected graphs in a compact manner, using only printable ASCII characters. Files in these formats have text type and contain one line per graph." http://cs...
# Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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 a...
'''define the config file for cocostuff and resnet101os8''' import os from .base_cfg import * # modify dataset config DATASET_CFG = DATASET_CFG.copy() DATASET_CFG.update({ 'type': 'cocostuff', 'rootdir': os.path.join(os.getcwd(), 'COCO'), }) # modify dataloader config DATALOADER_CFG = DATALOADER_CFG.copy() # ...
from .base import Controller from .base import Action import numpy as np import pandas as pd import pkg_resources import logging from collections import namedtuple logger = logging.getLogger(__name__) CONTROL_QUEST = '/source/dir/simglucose/params/Quest.csv' PATIENT_PARA_FILE = '/source/dir/simglucose/params/vpatient_...
# Copyright 2014 Google 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 law or a...
from __future__ import division from thorpy.elements.element import Element from thorpy.miscgui.constants import STATE_NORMAL class OneLineText(Element): def __init__(self, text="", elements=None, normal_params=None): Element.__init__(self, text, elements, normal_params) def finish(self): s...
# -*- coding: utf-8 -*- """ @FileName: __init__.py @Time: 2020/2/7 20:11 @Author: zhaojm Module Description """
from django.db import models from djangae import patches class CounterShard(models.Model): count = models.PositiveIntegerField() label = models.CharField(max_length=500) class Meta: app_label = "djangae"
# Generated by Django 3.2.5 on 2021-11-11 05:59 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('galeria', '0005_auto_20211111_0052'), ] operations = [ migrations.AlterField( model_name='post', nam...
from scrapy import Spider class AuthorSpider(Spider): name = 'author' start_urls = [ 'http://quotes.toscrape.com/', ] def parse(self, response): #follow links to author pages for href in response.css('.author + a::attr(href)'): yield response.follow(href, ca...
from PyQt5 import QtCore from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialogButtonBox from . import get_main_window, close_application NO_OF_ENVIRONMENTS = 5 NO_OF_ENVIRONMENTS_TO_DELETE = 3 NO_OF_ENVIRONMENTS_TO_RE_ADD = 1 def get_toolbar_environments_combo(window): return window.environment_list_v...
""" Integration tests for __main__.py """ # pragma pylint: disable=redefined-outer-name from click.testing import CliRunner import pytest from traveling_salesperson import __main__ as main def test_main_runs(mocker, filename_fixture): """Ensures that main() runs smoothly over a test file.""" mock_etl = mocke...
#!_PYTHONLOC # # (C) COPYRIGHT 2020 Ahasuerus # ALL RIGHTS RESERVED # # The copyright notice above does not evidence any actual or # intended publication of such source code. # # Version: $Revision: 418 $ # Date: $Date: 2019-05-15 10:10:07 -0400 (Wed, 15 May 2019) $ import cgi import sys i...
""" TODO Module docstring """ # Threshold value under which a float will be treated as zero MAX_ZERO_THRESHOLD_VALUE = 1.0e-14 # Minimum integration step size, in seconds MINIMUM_STEP_SIZE_IN_SECONDS = 1.0e-9 # Number of whole nanoseconds per second NANOSECONDS_PER_SECOND = int(1e9) # Number of seconds per mean so...
'''data_load module is for loading individual genedocs from various data sources.''' from __future__ import print_function import sys import copy import types import time import datetime import importlib from biothings.utils.mongo import get_src_conn, get_src_dump, get_data_folder from biothings.utils.common import get...
"""Rendering Related Tasks""" from celery import shared_task import newrelic.agent from rendering.render_email import compose_email from mailer.mailserver import deliver @shared_task def sample_email(to_address, user_id, email_id, election_id, district_ids): """Sample an email to an end user""" result = comp...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: idcrack_unit_info.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
from Jumpscale import j class Package(j.baseclasses.threebot_package): def prepare(self): """ is called at install time :return: """ pass def start(self): """ called when the 3bot starts :return: """ ## TODO: BAD # self.d...
from django.apps import AppConfig class Classworkapp1Config(AppConfig): name = 'classworkApp1'
#!/usr/bin/python import sys def to_claim(line): cid, _, location, dimensions = line.split() cid = int(cid[1:]) x, y = map(int, location[:-1].split(',')) w, h = map(int, dimensions.split('x')) return cid, x, y, w, h claims = map(to_claim, sys.stdin) # build bitmap bitmap = [None] * (1000 * 1...
#!/usr/bin/python # -*- coding: utf-8 -*- from .util import load_module class TermParserFactory(object): @staticmethod def build_from_conf(conf): args = {k: conf[k] for k in ['default_fields', 'aliases', 'integer_as_string'] if k in conf} return TermParser(**args) if not 'class' in conf else...
from django.contrib.postgres.fields import JSONField from django.db import models from django_pgviews import view as pgviews from cove.input.models import SuppliedData from .bluetail_models import Flag class OCDSPackageDataJSON(models.Model): """ Model to store OCDS JSON package data. """ package_dat...
# # # Copyright (C) 2014 Google 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
# -*- coding: utf-8 -*- """ meraki This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ from meraki.api_helper import APIHelper from meraki.configuration import Configuration from meraki.controllers.base_controller import BaseController from meraki.http.au...
class Credential: ''' Class that generates instances of a users credentials ''' # Empty list of credentials credential_list = [] def __init__(self, user_password, credential_name, credential_password): ''' __init__ method to define the properties of a User object Args: ...
import matplotlib.pyplot as plt import numpy as np from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel from brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable from brancher import inference import brancher.functions as BF # Probabilistic model # T = 100 nu ...
########################################################################################## # # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors # # This file is a part of the MadGraph5_aMC@NLO project, an application which # automatically generates Feynman diagrams and matrix elements for arb...
# # Copyright (c) 2021 Citrix Systems, 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...
import functools import inspect import warnings string_types = (type(b''), type(u'')) def warn_deprecation(text): warnings.simplefilter('always', DeprecationWarning) warnings.warn( text, category=DeprecationWarning, stacklevel=2 ) warnings.simplefilter('default', DeprecationWa...
# Copyright 2019 The TensorFlow Hub 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...
import os import sys def check_ret(ret): if(ret != 0): os.system('git checkout -B develop remotes/origin/develop') os.system('git clean -xdf -f') sys.exit(1) branchs = ['develop', 'master'] for item in branchs: os.system('git clean -xdf -f') os.system('git checkout -B ' + item + ' remotes/origin/' +...
""" Name: Tkinter Exercise - a simple calculator Description: iOS calculator simulator Date: 2/21/2018 Author: Haowei Wu """ import tkinter class Calculator: # Params app_title = "A simple calculator" disp_font = ("Helvetica", 25, "bold") btn_font = ("Helvetica", 20, "bo...
import unittest import pandas as pd import os from kmall_player import * class KmallPlayerTest(unittest.TestCase): def setUp(self) -> None: file_name = "data/MRZ_LARGE_SIZE.kmall" self.f = open(file_name, "rb") self.file_size = os.fstat(self.f.fileno()).st_size self.player = KmallP...
from flask import Blueprint fs_api=Blueprint('fs_api',__name__,template_folder='templates') from .views import configuration,dialplan,directory,vars,update_cdr
#!/usr/bin/env python3 import threading import typing import warnings from collections import defaultdict from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast import torch from captum._utils.common import ( _reduce_list, _run_forward, _sort_key_list, _verify_select_neuron, ) from ...
#https://finance.yahoo.com/screener/6039bb71-c189-4b62-ab6d-6dbd659495bb?count=200 import requests from bs4 import BeautifulSoup # import json my_screener = requests.get(f'https://finance.yahoo.com/screener/6039bb71-c189-4b62-ab6d-6dbd659495bb?count=200') #print(my_screener) with open('code/reit-data/reits-screene...
from collections import defaultdict import logging import random from faker import Faker import requests logger = logging.getLogger(__file__) def test_create_user(): fake = Faker() user_info = { 'username': fake.first_name() + str(random.randint(1, 1000)), 'common_name': fake.name(), ...
from abc import ABC, abstractmethod import logging import os from typing import Optional, Union, Iterable, Dict import h5py import numpy as np import torch from PIL import Image from tqdm import tqdm from brainio.stimuli import StimulusSet from model_tools.activations import ActivationsModel from model_tools.activati...
# -*- coding: utf-8 -*- """ Created on Thu Jul 9 18:03:39 2020 @author: akanksha """ import pandas as pd import numpy as np import joblib from itertools import combinations import sklearn from functools import reduce import argparse import os parser = argparse.ArgumentParser(description = 'Predict...
# coding: utf-8 from __future__ import unicode_literals import itertools import random import re from ..compat import compat_str from ..utils import (ExtractorError, determine_ext, int_or_none, parse_duration, str_or_none, try_get, url_or_none, urljoin) from .common import In...
#!/usr/bin/env python """ Configure folder for sCMOS testing. Hazen 09/17 """ import numpy import os import storm_analysis import storm_analysis.sa_library.parameters as parameters import storm_analysis.simulator.emitters_on_grid as emittersOnGrid import storm_analysis.simulator.emitters_uniform_random as emittersUn...
from unicorn import * from unicorn.x86_const import * from capstone import * from importlib import import_module from emulation.syscall import clean_stack import argparse import emulation.syscall as winsyscall import pefile import struct import sys import ast import os #TODO: Deal with SEH structure #TODO: Randomize T...
import sqlite3 from app import app from flask import g DATABASE = 'db/trackpants.db' def get_db(): db = getattr(g, '_database', None) if db is None: db = g._database = sqlite3.connect(DATABASE) return db @app.teardown_appcontext def close_db(exception): db = getattr(g, '_database', None)...
import argparse, re, sys, os import pandas as pd import matplotlib.pyplot as plt import numpy as np path = '' flname = sys.argv[1] try: chartType = sys.argv[2] except: chartType = 'ch1_vload' print('chartType:'+chartType) fl = flname.split('/') for i in fl[:-1]: path = path+i+'/' fw = open(flname, 'r') rawdata = ...
from __future__ import absolute_import import collections import contextlib import copy import typing as tp # NOQA import warnings import numpy import six import chainer from chainer import backend from chainer.backends import cuda from chainer import device_resident from chainer import initializers from chainer imp...
from flask import Flask, render_template, request, flash, redirect, url_for, session from flask_sqlalchemy import SQLAlchemy from flask_mail import Message, Mail from passlib.hash import sha256_crypt from functools import wraps import requests import time # create the flask app from config file and instantiate db appl...
from pkg_resources import resource_filename from .base import set_base_parser from .helper import add_arg_group from ..helper import get_random_identity def set_hw_parser(parser=None): if not parser: parser = set_base_parser() gp = add_arg_group(parser, title='General') gp.add_argument('--workdi...
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
import matplotlib.pyplot as plt import numpy as np import os import pandas as pd # Find path for cases curr_dir_path = os.path.dirname(os.path.realpath(__file__)) # print(curr_dir_path) # cases = os.listdir(curr_dir_path + '/Cases') # pop = cases.index('baseCase') # cases.pop(pop) # Label graph with bold characters f...
from github.interfaces import Type class LicenseRule(Type): """ Represents a license rule. """ __slots__ = () _repr_fields = [ "key", ] _graphql_fields = [ "description", "key", "label", ] @property def description(self): """ ...
# Copyright (c) 2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2016-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2016 Glenn Matthews <glmatthe@cisco.com> # Copyright (c) 2018 Ville Skyttä <ville.skytta@iki.fi> # Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com> #...
import os, sys import math import hydra import torch import timm from hydra.utils import instantiate from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy from timm.utils import NativeScaler import models from data import create_dataloader from utils import MetricLogger, SmoothedValue from utils im...
#Copyright 2021 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,...
# 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. # Convert data to textflint format and run transform functions in textflint import glob import json import os from textflint import Engine CO...
import requests import pyfiglet ascii_banner = pyfiglet.figlet_format("SMSARCH") print(ascii_banner) import requests while True: kime = input("kim:") mesaj = input("mesaj:") if " " in kime or mesaj == "": break resp = requests.post('https://textbelt.com/text', { 'phone': '{}'.format(kime...
# PYTHON_ARGCOMPLETE_OK """The command line interface to pipx""" import argparse import logging import logging.config import os import re import shlex import sys import textwrap import time import urllib.parse from pathlib import Path from typing import Any, Callable, Dict, List import argcomplete # type: ignore fr...
# -*- coding: utf-8 -*- # import numpy from .. import helpers def integrate(f, rule, dot=numpy.dot): flt = numpy.vectorize(float) return dot(f(flt(rule.points).T), flt(rule.weights)) def show(scheme, backend="mpl"): """Displays scheme for E_3^r quadrature. """ helpers.backend_to_function[backen...
# Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and # Tobias Kessler # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. from .agent_state_geometry_config_readers import * from .behavior_model_config_readers import * from .controlle...
# Copyright 2019 The Oppia 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 applicable ...
""" Copyright 2020 Tianshu AI Platform. 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 law ...
#!/usr/bin/env python3 import json import os import sys import uuid from alphad3m.automl import AutoML if __name__ == '__main__': if len(sys.argv) != 3: sys.stderr.write('Usage: %s <config> <pipeline_uuid>\n' % sys.argv[0]) sys.exit(1) with open(sys.argv[1]) as config_file: config = ...