text stringlengths 2 999k |
|---|
from rkmt.options.base_options import BaseOptions
class RunOptions(BaseOptions):
"""Arguments parser for model inference."""
def initialize(self, parser):
BaseOptions.initialize(self, parser)
parser.add_argument('-m',
'--model_file_path',
... |
#!/usr/bin/python3
# 统计系统文件大小
# 使用方式:
# 1. sudo find $HOME -type f -printf "%s %p\n" > home_file.txt
# 2. ./SystemFileStatic.py home_file.txt
import sys
import argparse
import numpy as np
import matplotlib.pyplot as plt
from math import ceil, log2
from bisect import bisect_left
def numfmt(s):
marks = "KMGTP"
... |
import FWCore.ParameterSet.Config as cms
from SimG4Core.Application.hectorParameter_cfi import *
## HF Raddam Dose Class in /SimG4CMS/Calo
from SimG4CMS.Calo.HFDarkeningParams_cff import *
## This object is used to customise g4SimHits for different running scenarios
common_heavy_suppression = cms.PSet(
NeutronT... |
"""
This file offers the methods to automatically retrieve the graph Macrophomina phaseolina.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
# Copyright (c) 2005-2018, Alexander Belchenko
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain
# the above copyright notice, this list of condi... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
"""
Functions that are general enough to use for any model fitting. The idea is
to untie these from LikelihoodModel so that they may be re-used generally.
"""
from __future__ import print_function
import distutils.version
from scipy import __version__ as scipy_version
import numpy as np
from scipy import optimize
def... |
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for workflow cycle state propagation between tasks and task groups"""
# pylint: disable=invalid-name
import datetime as dtm
from freezegun import freeze_time
from ggrc import db
from ggrc_workflo... |
from nose.tools import *
from ex47.game import Room
def test_room():
gold = Room("GoldRoom",
"""This room has gold in it you can grab. There's a
door to the north.""")
assert_equal(gold.name, "GoldRoom")
assert_equal(gold.paths, {})
def test_room_paths():
center = Room... |
from poodle import Object
from kalc.model.system.primitives import Type, Status
from kalc.model.system.base import ModularKind
import kalc.model.kinds.Deployment as mdeployment
import kalc.model.kinds.Node as mnode
from typing import Set
class GlobalVar(ModularKind):
is_deployment_disrupted: bool
is_deployment... |
import enum
import inspect
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test import support
from ... |
import matplotlib.pyplot as plt
import numpy as np
import os
import gzip
def get_network_constrains():
return (784, 10)
def plot(data):
img_size = int(len(data)**0.5)
plt.imshow(np.matrix(data).reshape(img_size, img_size), cmap='gray')
def _normalize(data):
data = data/np.linalg.norm(data)
data -... |
"""[This is an example unit test class to open Google. This is
meant to demonstrate a simple unit test look and feel.
Example Refernece: https://pypi.python.org/pypi/selenium 1/15/18]"
"""
import unittest
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
""""[Sample tests to ope... |
# 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... |
from datetime import datetime, timedelta, time
from typing import Any, Dict, List, Optional, Union
from uuid import UUID
import pytz
from pydantic import BaseModel, types, validator
from pydantic.schema import date
from utils import time_zones
class SuperModel(BaseModel):
ORIGINAIRPORTCODE: str
D... |
"""Constant."""
IGNORE_REGEX_LIST = [
r'.*HOISS.*',
r'.*HHS.*',
r'.*semmbomeSaqQo.*',
r'.*Honomasenid.*',
r'.*SAwwwy.*',
r'.*\+94.*',
r'.*163, Borgen.*',
r'.*Age Group.*',
r'.*Anexirenen novelas.*',
r'.*ce.*mbme.*',
r'.*cermmboe*',
r'.*dasenrd.*',
r'.*dasombd.*',
... |
from Computer import Computer
from Amplifier import Amplifiers
from SequenceCodes import SequenceCodes
filename = "input.txt"
# PART 1
number_of_amps = 5
sequence_codes=SequenceCodes(0,4,number_of_amps).codes
amps = Amplifiers(filename,number_of_amps,sequence_codes)
max_signal = amps.get_max_thruster_signal()
print(f... |
"""
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
# -*- coding: utf-8 -*-
from django.conf.urls import url
app_name = 'oauth_clients3'
urlpatterns = [
]
|
# -*- coding: utf-8 -*-
"""Test suite for axonius_api_client.tools."""
import logging
import pathlib
import time
import pytest
from axonius_api_client.constants.logs import (
LOG_LEVEL_CONSOLE,
LOG_LEVEL_FILE,
LOG_NAME_FILE,
LOG_NAME_STDERR,
LOG_NAME_STDOUT,
)
from axonius_api_client.exceptions im... |
# pylint: disable=invalid-name,unused-variable,too-many-locals,len-as-condition
"""Schedule for reduce operators"""
from __future__ import absolute_import as _abs
import tvm
from .. import tag
from .. import generic
from .injective import _schedule_injective
def _schedule_reduce(op, sch, is_idx_reduce=False):
if i... |
# -*- 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
'''
Obtain the version number of the current turicreate create.
'''
from __future__ ... |
from configparser import ConfigParser
from contextlib import contextmanager
import csv as csv_
import io
import json as json_
import jsonpath_rw
import os
import pytimeparse
import re
import stat
import time
import urllib.request
def flip_flop(re_on, re_off, include_on, include_off, lines):
on = False
for l in... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
from pymor.core.interfaces import BasicInterface... |
import tensorflow as tf
import pandas as pd
from lib.mutation import *
from lib.sequence_parser_utils import (parse_aggregated_mut_escapes,
parse_gisaid, parse_nih, parse_viprbrc)
np.random.seed(1)
random.seed(1)
AAs = [
'A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H',
'I', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
s = input("Введите предложение: ")
n = int(input("Введите длину: "))
# Проверить требуюемую длину.
if len(s) >= n:
print(
"Заданная длина должна быть больше длины предложения",
file=sys... |
# Copyright (c) 2012 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 traceback
import warnings
# Location where chrome reads command line flags from
CHROME_COMMAND_FILE = '/data/local/tmp/chrome-command-line'
cla... |
# 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... |
#Load dependencies
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from matplotlib import*
import matplotlib.pyplot as plt
from matplotlib.cm import register_cmap
from scipy import stats
from sklearn.decomposition import PCA
import seaborn
import os
import glob
def getPCAEigenPa... |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2022 EntySec
#
# 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... |
from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A short description of the project.',
author='sharvani',
license='MIT',
)
|
# -*- coding: utf-8 -*-
from functools import wraps
from django.core.exceptions import PermissionDenied
from django.contrib.auth.views import redirect_to_login
from django.shortcuts import redirect
from ..conf import settings
def moderator_required(view_func):
@wraps(view_func)
def wrapper(request, *args, ... |
# Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
from datetime import datetime
import pytest
from kingfisher_scrapy.base_spider import PeriodicSpider
from kingfisher_scrapy.util import components, date_range_by_month, date_range_by_year
from . import spider_with_crawler
def _format_urls(arg_type, pattern, arg_start, arg_end):
if arg_type == 'year':
d... |
import decimal
from django.conf import settings
from django.core.management.base import BaseCommand
import stripe
class Command(BaseCommand):
help = "Make sure your Stripe account has the plans"
def handle(self, *args, **options):
stripe.api_key = settings.STRIPE_SECRET_KEY
for plan in set... |
#!/usr/bin/env python3
# coding:utf-8
def get_num(num_lst):
"""一个列表搞定"""
n = len(num_lst)
i, k, m = 0, 0, 0
while m < n-1: # m = n-1 时退出循环
if num_lst[i] != 0: # i 是 num_lst 的标记
k += 1 # k 是满 3 个数的标记
if k == 3:
num_lst[i] = 0 # 给退出者作标记
k = 0
... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
import... |
from ma import ma
from models.lattice import LatticeModel
class LatticeSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = LatticeModel
load_instance = True |
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator import SBXCrossover, PolynomialMutation
from jmetal.problem import Srinivas
from jmetal.util.solutions.comparator import DominanceComparator
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
from jmetal.util.solutions ... |
from django.contrib import admin
|
#! /usr/bin/python3
# -*- encoding: utf-8 -*-
__author__ = 'fyabc'
def truncateAfter(string, substring, stripThis=True):
index = string.rfind(substring)
if index == -1:
index = None
else:
if not stripThis:
index += len(substring)
return string[:index]
class RichStr(str):... |
# Copyright (c) 2015 - 2022, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
"""Manage system files used by the geopm service
Provides secure interfaces for manipulating the files in
/run/geopm-service
that enable the service to be restarted and
/etc/geopm-service
where the access lists are l... |
"""
"""
import logging
import smtplib
import os
from abc import ABC
from datetime import datetime
from email.message import EmailMessage
from queue import Empty, Queue
from threading import Thread
from typing import Any, Sequence
from vnpy.event import Event, EventEngine
from .app import BaseApp
from .event import (
... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import collections
import json
import os
import random
import sys
import time
import uuid
import numpy as np
import torch
import torch.utils.data
from domainbed import datasets
from domainbed import hparams_registry
from domainbed... |
import ray
from tqdm import tqdm
import numpy as np
import tensorflow as tf
import pdb
import time
import matplotlib
#matplotlib.use("MacOSX")
from matplotlib import pyplot as plt
from .config import MuZeroConfig
from .storage import SharedStorage, ReplayBuffer
from .models import Network, Network_FC, Network_CNN
fro... |
import datetime as dt
from typing import Type
import pytest
from sqlalchemy import select
from odata_query.sqlalchemy import apply_odata_query
from .models import Author, Base, BlogPost, Comment
@pytest.fixture
def sample_data_sess(db_session):
s = db_session()
a1 = Author(name="Gorilla")
a2 = Author(n... |
import pytest
from pybind11_tests import ExampleMandA, ConstructorStats
def test_methods_and_attributes():
instance1 = ExampleMandA()
instance2 = ExampleMandA(32)
instance1.add1(instance2)
instance1.add2(instance2)
instance1.add3(instance2)
instance1.add4(instance2)
instance1.add5(instanc... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace NLP 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... |
import torch
import torch.nn.functional as F
from .base import Loss
from .base import Mode
from .base import Reduction
class CrossEntropyLoss(Loss):
"""
CE with optional smoothing and support for multiple positive labels.
Can accept one-hot encoded y_trues
Args:
mode (str): Metric mode {'bina... |
import ast
import json
import collections
import pyspark.sql.functions as f
from tube.utils.general import get_node_id_name
def extract_metadata(str_value, strs):
"""
Get all fields in _props (strs[3] in hadoop file) and node_id field (strs[4])
:param str_value:
:return:
"""
origin_value = str... |
# -*- coding: utf-8 -*-
import io
import json
import os
import re
import sys
import base64
import fnmatch
import hashlib
import contoml
from first import first
import pipfile
import pipfile.api
import six
import toml
from ._compat import Path
from .cmdparse import Script
from .utils import (
atomic_open_for_write... |
import pytest
import time
from load_tests.utils import client_request, stats
@pytest.mark.parametrize('n', range(20))
def test_ramp(n, stats):
"""iterate 20 times, each time increase the number of requests, wait 0.4 secs between iterations"""
delay = 0.4
r = []
for i in range(n+1):
r.append(... |
#!/usr/bin/env python
"""camqadm
.. program:: camqadm
"""
import cmd
import sys
import shlex
import pprint
from itertools import count
from amqplib import client_0_8 as amqp
from carrot.utils import partition
from celery.app import app_or_default
from celery.bin.base import Command
from celery.utils import padlist... |
import os
import numpy as np
from PIL import Image
import cv2
def train_classifier(data_dir):
allImagePaths = [os.path.join(data_dir, f) for f in os.listdir(data_dir)] #this is used to create the relative of all image that are stored in dara_dir all these paths are stored in python list 'allImagePaths'
fa... |
# Import dependencies
from flask import Flask, render_template, redirect, url_for
from flask_pymongo import PyMongo
import scraping
# set up Flask
app = Flask(__name__)
# Use flask_pymongo to set up mongo connection
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
# Set up App Rout... |
"""
The ``mlflow.tensorflow`` module provides an API for logging and loading TensorFlow models.
This module exports TensorFlow models with the following flavors:
TensorFlow (native) format
This is the main flavor that can be loaded back into TensorFlow.
:py:mod:`mlflow.pyfunc`
Produced for use by generic pyfun... |
from collections import namedtuple
# Scales separator chars and tokens
SEPARATOR_CHARACTERS = (
" ",
"\t",
","
)
SEPARATOR_TOKENS = (
'and',
)
# Scale parsing tokens definition
SCALE_TOKEN_ALPHA = 0
SCALE_TOKEN_DIGIT = 1
ScaleRepresentation = namedtuple(
'ScaleRepresentation',
[... |
from model import depth_model
import tensorflow as tf
import numpy as np
from utils import get_args
from config import process_config, get_config_from_json
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.resnet50 import preprocess_input
import matplotlib.pyplot as plt
from model impo... |
from collections import defaultdict
from django.conf.urls import url
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
f... |
import logging
import os
import shutil
import zipfile
from datetime import datetime
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http im... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
'''
暂时出错
装饰类中的方法就会出错
'''
import time
def login_logs(func):
def wrapper(self, *args, **kwargs):
print('write logs begin')
username = args[0]['username']
login_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
log_result = func(... |
"""Added info annotations
Revision ID: 1b342ac080d3
Revises: b41253647ec2
Create Date: 2021-12-06 18:11:52.835815
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "1b342ac080d3"
down_revision = "b41253647ec2"
branch_labels = None
depends_on = None
def upgrade()... |
expected_output = {
"vrf": {
"VRF1": {
"interface": {
"GigabitEthernet2": {
"group": {
"FF15:1::1": {
"up_time": "08:14:20",
"source": {
"2001:DB8:2... |
# Copyright 2022 The Magenta 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 ... |
from scipy.stats import truncnorm
from random import gauss
from math import sqrt
class Gaussian:
""" Gaussian distributed arm """
def __init__(self, mu, sigma2=1, trunc=False, lower=0., upper=1.):
self.sigma2 = sigma2
self.mu = mu
self.trunc = trunc
self.lower = lower
... |
import sqlite3
import urllib
from urllib.request import urlopen
from bs4 import BeautifulSoup, NavigableString
import nltk
nltk.download('punkt')
from nltk import sent_tokenize
def parseRes2(soup, title, url, cur, author, date, collectiontitle):
chapter = 0
sen = ""
num = 1
[e.extract() for e in sou... |
"""
Interpol: Interpol Red Notices API
Interpol Red Notices Website API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
class ApiTypeError(OpenA... |
#!/usr/bin/env python
"""
Authors: Justin Pusztay, Matt Lubas, Griffin Noe
Filename: latticemain.py
Project: Research for Irina Mazilu, Ph.D.
A main file that runs the Monte Carlo simulation and draws a picture
of the Lattice tree.
"""
import Cayley as cy
import Cayley.graphics as cg
import Cayley.research as cr
temp... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('perma', '0004_auto_20160506_1632'),
]
operations = [
migrations.AlterField(
model_name='historicallinkuser',
... |
# Lesson 9 Pages Debugging and Unit Testing in Python
# import unittest
# import pdb
# pdb.set_trace()
# Page 2
# def add_numbers(a, b):
# """This function adds a to b."""
# c = a + b
# print(c)
#
#
# add_numbers(3, 4)
# Page 3
# dog = "Zorro"
# cat = "Tesla"
#
# play = "My dog " + dog + " plays with my c... |
class PlotObject(object):
"""
Base class for objects which can be displayed in
a Plot.
"""
visible = True
def _draw(self):
if self.visible:
self.draw()
def draw(self):
"""
OpenGL rendering code for the plot object.
Override in base ... |
# snowmelt/tests.py
import unittest
import datetime
from context import (
config,
helpers
)
class Test_snodas_get_raw_infile(unittest.TestCase):
def test_infile_type_unmasked(self):
"""unmasked filename is correct"""
dt = datetime.datetime(year=2019, month=1, day=1)
self.assert... |
from .endpoint import ( # noqa: F401
Endpoint,
ConnectionConfig,
)
from .exceptions import ( # noqa: F401
ConnectionAttemptRejected,
UnexpectedResponse,
)
from .misc import ( # noqa: F401
BaseEvent,
BaseRequestResponseEvent,
BroadcastConfig,
Subscription,
)
|
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.11
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path impo... |
# coding=utf-8
# Copyright 2021 {{cookiecutter.authors}} The HuggingFace Inc. team. 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... |
#!/usr/bin/env python
#
# Copyright 2014 Tuenti Technologies S.L.
#
# 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 -*-
exdict = {
'Alyssa Boyd': ('Brownmouth', '09044'),
'Candice Huber': ('New Kimberly', '11698'),
'Dr. Kelli Sharp MD': ('North Rhondashire', '71761'),
'Gary Hernandez': ('Burnshaven', '62267'),
'Hannah Williams': ('North Stacy', '50983'),
'Monique Mcco... |
from discord.ui import Button, View
class Disabled_View:
def __init__(self, view: View) -> None:
self.view = view
def generate(self) -> View:
buttons = [comp for comp in self.view.children if isinstance(comp, Button)]
dis_view = View(timeout=self.view.timeout)
for b in buttons... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nkdsu.settings")
from django.core.wsgi import get_wsgi_application # noqa
application = get_wsgi_application()
|
# -*- 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 or... |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2018 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Authors: Salim Fadhley <salimfadhley@gmail.com>
# Matteo Dell'Amico <matteodellamico@gmail.com>
"... |
#!/usr/bin/python
'''
1) Compare Train feature performance (all features) stratified by resolution and feature type (input vs CNN extracted), across entire train set
2) Compare best features determined by step 1) performance in validation set by sample.
'''
# Set random seed
import numpy as np
np.random.seed(9)
# S... |
#!/usr/bin/env python3
import json
import os
import re
import subprocess
from subprocess import DEVNULL
from tempfile import mkstemp
from typing import List, Optional
from github import Github
from github.PullRequest import PullRequest
from github.Repository import Repository
from semver import VersionInfo
REPO = o... |
import pytest
from thefuck.rules.pip_unknown_command import match, get_new_command
from tests.utils import Command
@pytest.fixture
def pip_unknown_cmd():
return '''ERROR: unknown command "instatl" - maybe you meant "install"'''
@pytest.fixture
def pip_unknown_cmd_without_recommend():
return '''ERROR: unknow... |
from models import *
from utils.utils import *
import numpy as np
from copy import deepcopy
from test import test
from terminaltables import AsciiTable
import time
from utils.prune_utils import *
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--cfg', type=s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2020-02-19 20:56:46
# @Author : ZubinGou (zebgou@gmail.com)
# @Link : https://github.com/ZubinGou
# @Version : $Id$
from __future__ import print_function
import tensorflow as tf
hello = tf.constant("Heyyyy, TensorFlow!")
print(hello)
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from abc import ABCMeta
from inspect import signature
import numpy as np
import astropy.units as u
from astropy.io.registry import UnifiedReadWriteMethod
from astropy.utils import isiterable
from astropy.utils.decorators import classproperty
from astrop... |
# coding: utf-8
from __future__ import print_function
from elasticsearch import Elasticsearch, helpers
import csv
import sys
from datetime import datetime
from tqdm import tqdm
import time
csv.field_size_limit(sys.maxsize)
es = Elasticsearch()
def iso_convert(iso2c):
"""
Takes a two character ISO country cod... |
"""
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is the number of solutions maximised?
"""
from __future__ import annotations
from collections import Counte... |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.macros import settings
from wiki.plugins.macros.mdx.macro import MacroExtension
from wiki.plugins.macros.mdx.toc import WikiTocExtension
fro... |
#!/usr/bin/python3 -i
#
# Copyright (c) 2015-2016, 2019 Valve Corporation
# Copyright (c) 2015-2016, 2019 LunarG, Inc.
# Copyright (c) 2015-2016, 2019 Google 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 cop... |
# Copyright Matus Chochlik.
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
import os
import sys
import subprocess
#------------------------------------------------------------------------------#
def thisDir():
... |
from easy_math import addition
def test_add_amount():
data = [
[0, 0, 0],
[0, 1, 1],
[1, 0, 1],
[1, 1, 2],
[1337, 1337, 2674],
[2500, 4700, 7200],
]
for i, val in enumerate(data):
assert addition.add(val[0], val[1]) == val[2]
|
# Dependencies
from splinter import Browser
from bs4 import BeautifulSoup
import requests
import urllib.parse
import pymongo
import pprint
import pandas as pd
import time
# Initialize browser
def init_browser():
executable_path = {"executable_path": "/usr/local/bin/chromedriver"}
#executable_path = {'executable... |
import os
from flasgger import Swagger
from flask import Flask
from flask.blueprints import Blueprint
import config
import routes
from models import db
# config your API specs
# you can define multiple specs in the case your api has multiple versions
# ommit configs to get the default (all views exposed in /spec url... |
from __future__ import unicode_literals
from frappe import _
import frappe
def get_data():
config = [
{
"label": _("Documents"),
"items": [
{
"type": "doctype",
"name": "Vehicle Info",
"label": "Vehicle Inf... |
# Copyright 2015 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.4 on 2019-08-12 12:02
import diventi.accounts.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0228_auto_20190811_1915'),
]
operations = [
migrations.AlterModelManagers(
name='diventiuser'... |
"""Auto-generated file, do not edit by hand. BY metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BY = PhoneMetadata(id='BY', country_code=375, international_prefix='810',
general_desc=PhoneNumberDesc(national_number_pattern='[1-4]\\d{8}|[89]\\d{9,10}', possible_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.