text stringlengths 2 999k |
|---|
"""
Usage:
# From tensorflow/models/
# Create train data:
python generate_tfrecords.py --csv_input=data/train_labels.csv --output_path=data/records/train.record --image_dir=/Datasets/
# Create test data:
python generate_tfrecords.py --csv_input=data/test_labels.csv --output_path=data/records/test.record --i... |
# Copyright 2014 Cloudera 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 to in writing, so... |
# -*- coding: utf-8 -*-
"""
IBEIS: main package init
TODO: LAZY IMPORTS?
http://code.activestate.com/recipes/473888-lazy-module-imports/
"""
# flake8: noqa
try:
from wbia._version import __version__
except ImportError:
__version__ = '0.0.0'
try:
import utool as ut
from wbia import dtool
except Im... |
# coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... |
class Solution:
def subarraySum(self, nums: List[int], k: int) -> int:
hashmap = defaultdict(int)
sum_tmp, ans = 0, 0
hashmap[sum_tmp] += 1
for num in nums:
sum_tmp += num
if (sum_tmp - k) in hashmap:
ans += hashmap[sum_tmp-k]
hashm... |
# 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... |
from abc import ABCMeta, abstractmethod
class _Response(metaclass=ABCMeta):
multi_line: bool
@abstractmethod
async def from_stream(self, stream: None) -> "_Response":
...
class GREETING(_Response):
multi_line = False
async def from_stream(self, stream: None) -> "GREETING":
retu... |
# Copyright 2021 The Flax 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 wri... |
#window measurements
# HEIGHT = 700
WIDTH, HEIGHT = 600, 700
#BOARD
BOARD_POS = (50,150)
CELL = 55
BOARD_W, BOARD_H = 9*CELL,9*CELL
NUM_FONT = 34
#COLORS
RED = (160,0,0)
WHITE = (255,255,255)
BLACK = (0,0,0)
GRAY = (10,10,10)
LGRAY = (180,180,180)
BLUE = (44,97,202)
TEAL = (128, 203, 164)
YELLOW =... |
# Copyright 2020 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... |
# -*- coding: utf-8 -*-
import base64
import json
import os
import re
import unittest
from collections import namedtuple
from typing import Callable, Optional
from unittest.mock import patch
import xmltodict
from botocore.exceptions import ClientError
from jsonpatch import apply_patch
from requests.models import Respo... |
#==============================================================================
# Copyright (c) 2016 Paul W. Bible
#
# 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)
#================================================... |
# -*- coding: UTF-8 -*-
import sys
from correctores.common.corrector_variables import corrector_variables
########################################################################
#### Esto es lo que hay que cambiar en cada problema: ####
#### - epsilon: para comparar floats y complex, si lo necesitas ... |
from starlette.applications import Starlette
from starlette.responses import HTMLResponse, JSONResponse
from starlette.staticfiles import StaticFiles
from starlette.middleware.cors import CORSMiddleware
import uvicorn, aiohttp, asyncio
from io import BytesIO
from fastai.vision import *
model_file_url = 'https://www.d... |
bind = "0:443" |
from __future__ import absolute_import, division, print_function
import sys
import six
import collections
import networkx
from pyro.distributions.util import scale_and_mask
from pyro.poutine.util import is_validation_enabled
from pyro.util import warn_if_inf, warn_if_nan
class Trace(networkx.DiGraph):
"""
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx.node.services.telemetry.
#------------------------------------------------------... |
import itertools
import logging
import numpy as np
from . import send as _send
from . import recv as _recv
from . import framing, common, stream, detect, sampling
log = logging.getLogger(__name__)
def send(config, src, dst, gain=1.0, extra_silence=0.0):
sender = _send.Sender(dst, config=config, gain=gain)
... |
from datetime import datetime as dt
from time import time
import json, logging, sys
from functools import wraps
import logstash
class log(object):
'''decorator for logging values
This decorator can be used for injecting a
logging function into a particular function.
This takes a function and inje... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 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 the listtransactions API."""
from test_framework.test_framework import BitcoinTestFramework
from ... |
# Copyright 2019 The dm_control 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 i... |
# nlantau, 2022-01-29
from typing import *
"""
A subarray is a contiguous part of an array
Kadane's Algo
"""
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
"""
Notes: 664 ms, 97.63% faster, 28.7 MB, 59.51% better
"""
max_res = nums[0]
curr_sum = 0
... |
"""
Escribe un programa que haga cuente cuantas veces aparece un número en una tupla que añadiremos
de manera DINÁMICA, ya que puede cambiar el valor de entrada.
Guardarla en una tupla de este estilo:
((número-buscado, apariciones), (número-buscado, apariciones), (número-buscado, apariciones))
Usando un ejemplo real:
E... |
from entity.constants import POSITION_ITEMS, POSITION_STATUS
ClaimPositionSample = {
"no": "3",
"name": "Vegetation",
"weight": 0.125,
"amount": 150,
"status": "notarized",
"mpesa_tx": "OB548CGCVB",
"blockchain_tx": "0x07238314ca07a2a890526b27939079773d6515aea4bf4395c56f60395c33a298",
"... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 20, ar_order = 12); |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 09:09:18 2019
@author: CHaithcock
"""
CAR_SYMBOLS = ['Q', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L']
TRUCK_SYMBOLS = ['T', 'R', 'W', 'Z']
CAR_COLORS_RGB = ['7FFF00', '7FFFD4', 'D2691E', '8B008B', 'BDB76B',\
'8B0000', 'FF1493', '1E90FF'... |
'''
Author: Liu Xin
Date: 2021-11-30 16:50:20
LastEditors: Liu Xin
LastEditTime: 2021-11-30 16:53:51
Description: file content
FilePath: /CVMI_Sementic_Segmentation/model/decode_heads/danet/danet.py
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.builder import DECODE_HEAD
class DANe... |
"""
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import io
import json
import logging
import re
import ssl
from u... |
import pytest
from sources.hdlc import hdlc_code
@pytest.fixture()
def own_3257():
hdlc = b'\x10\x02\x00\x01\x02\x00\x00\x00\x1c\x00\x04\xfb\x00\x0e2Wt\x04\xc1\x81/2Wv\xfb>~\xf5`-\x10\x83'
source = "0x0 0x1 0x2 0x0 0x0 0x0 0x1C 0x0 0x4 0xFB 0x0 0xE 0x32 0x57 0x74 0x4 0xC1 0x81 0x2F 0x32 0x57 0x76 0xFB 0x3E 0x... |
import json
JC_SETTINGS_FOLDER_NAME = "javascript_completions"
JC_SETTINGS_FOLDER = os.path.join(PACKAGE_PATH, JC_SETTINGS_FOLDER_NAME)
class JavaScriptCompletions():
def init(self):
self.api = {}
self.API_Setup = sublime.load_settings('JavaScript-Completions.sublime-settings').get('completion_active_list')... |
from Utils import filter_functions, robust_stats
|
# 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... |
from ma import ma
from models.item import ItemModel
from models.store import StoreModel
class ItemSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = ItemModel
load_only = ("store",)
dump_only = ("id",)
include_fk = True
|
"""
Handled exceptions raised by REST framework.
In addition Django's built in 403 and 404 exceptions are handled.
(`django.http.Http404` and `django.core.exceptions.PermissionDenied`)
"""
from __future__ import unicode_literals
import math
from django.http import JsonResponse
from django.utils import six
from djang... |
# python3
# -*- coding:utf-8 -*-
# author:phenix3443+github@gmail.com
import config
if config.RUN_TIME == "develop":
EXAMPLE_DB = {
"host": "127.0.0.1",
"port": 3306,
"user": "root",
"password": "",
"database": "example_database",
}
FALCON = {
"host": "",
... |
#!/usr/bin/env python3
# Template by pypi-mobans
import os
import sys
import codecs
from shutil import rmtree
from setuptools import Command, setup, find_packages
PY2 = sys.version_info[0] == 2
PY26 = PY2 and sys.version_info[1] < 7
NAME = 'moban'
AUTHOR = 'C. W.'
VERSION = '0.3.3'
EMAIL = 'wangc_2011@hotmail.com'
... |
"""Illustrate snapshotting a function and restarting it from an
exception handler.
"""
import copy
import logging
import function_checkpointing.save_restore as save_restore
checkpoints = []
def save_checkpoint():
ckpt = save_restore.save_jump()
if ckpt:
checkpoints.append(copy.deepcopy(ckpt))
e... |
from itertools import izip
from collections import defaultdict
from src.abstract_classifier import AbstractClassifier
import lib.sequence_lib as seq_lib
class CdsGap(AbstractClassifier):
"""
Are any of the CDS introns too short?
Since sqlite3 lacks a BOOL type, reports 1 if TRUE and 0 if FALSE
"""... |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
# externals
import sys, subprocess
# the framework
import pyre
# my superclass
from .Launcher import Launcher
# declaration
class Slurm(Launcher, family='mpi.shells.slurm'):
"""
Encapsulation of launching an ... |
from FreesteelPython import *
"""
Issues:
Crashes when toolflatrad != 0.0
"""
def makeParams(stepdown=15.0, toolcornerrad=3.0, toolflatrad=0.0, retractheight=50.0):
params = MachineParams()
# linking parameters
params.leadoffdz = 0.1
params.leadofflen = 1.1
params.leadoffrad = 2.0
params.retractzheight = ret... |
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Machine Learning Group of the University of Oldenburg.
# Licensed under the Academic Free License version 3.0
import torch as to
import torch.distributed as dist
from torch.utils.data import TensorDataset, DataLoader, Dataset, Sampler
import numpy as np
import tvo
from tvo.... |
# -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
from typing import Tuple, Dict, Any, Optional
from droidlet.memory.memory_nodes import PlayerNode
from droidlet.task.task import ControlBlock, maybe_task_list_to_control_block
from droidlet.interpreter import (
AGENTPOS,
ConditionInterpreter,
get_re... |
import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='marker', parent_name='scattermapbox', **kwargs
):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... |
import pandas as pd
import pytest
from catboost import CatBoostRegressor
from numpy.random import RandomState
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import r2_score
from sklearn.tree ... |
import pytest
from unittest.mock import MagicMock
from django_ontruck.notifiers import AsyncNotifier, Notifier
from ..test_app.notifiers import DummySegmentNotifier, DummySegmentWithIdentityNotifier
@pytest.fixture
def mock_user():
user = MagicMock()
user.uuid = 'uuid'
return user
def test_segment_notif... |
# 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... |
# This file is Copyright (c) 2015 Yann Sionneau <yann.sionneau@gmail.com>
# This file is Copyright (c) 2015-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# License: BSD
from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform, VivadoProgrammer
# IOs --------------------------------... |
import logging
from common.errors import RoomError, ProtocolError
from logic.room.msg_handler import MsgHandlerBase
from logic.room.in_game_logic import InGameLogic
from common.message import *
LOG = logging.getLogger(__name__)
class Room(MsgHandlerBase):
def __init__(self, room_no):
super().__init__()
... |
from data_parsing import *
from postgres_db.bizThreads import *
from mongo_db.bizThreads import *
def FullMigration():
tickerDb = MongoDB_Biz_Ticker_Mentions()
Documents, Count = tickerDb.getAll()
# Get list of all coingecko
geckoCoinList = coinGeckoList()
print("Parsing biz coin data:")
t... |
import inspect
from . import DataFrame
from ..factories_exp import ExperimentalBaseFactory
def read_sql(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
columns=None,
chunksize=None,
partition_column=None,
lower_bound=None,
upper_bound=None,
):
... |
#!/usr/bin/env drgn
#
# Copyright (C) 2019 Tejun Heo <tj@kernel.org>
# Copyright (C) 2019 Facebook
desc = """
This is a drgn script to monitor the blk-iocost cgroup controller.
See the comment at the top of block/blk-iocost.c for more details.
For drgn, visit https://github.com/osandov/drgn.
"""
import sys
import re
... |
# 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 flask_restful import reqparse, Resource
from ..helpers import (
auth_required, role_required, generate_token, TokenType, token_required
)
from ..email import send_email
from ..models import Role
from .. import mongo
from ..models import User
import ast
class HostsAPI(Resource):
def __init__(self):
... |
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
import unittest
from typing import List
import common
class Solution:
def maxProfit(self, prices: List[int]) -> int:
return self._helper(prices)
def _helper(self, prices):
return common.Solution().maxProfit(2, prices)
cl... |
# -*- coding: utf-8 -*-
"""
pyspecific.py
~~~~~~~~~~~~~
Sphinx extension with Python doc-specific markup.
:copyright: 2008-2014 by Georg Brandl.
:license: Python license.
"""
import re
import io
from os import getenv, path
from time import asctime
from pprint import pformat
from docutils.io impor... |
# coding: utf-8
"""
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 20220523
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# ... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 5, transform = "Fisher", sigma = 0.0, exog_count = 0, ar_order = 12); |
# coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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 ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Wil Clouser <clouserw@micropipes.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
# in the Software without restriction, including without limitation the ri... |
# Generated by Django 2.0.1 on 2018-01-16 07:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('links', '0002_link_poste... |
from local_config.program_list import title_list
class Item:
def __init__(self, info):
self.title = info[0].strip().lower().split(" ")
self.resolutions = info[1]
self.releases = info[2]
def __repr__(self):
return "{} with {} from {}".format(" ".join(self.title),
... |
class Converters:
@staticmethod
def as_string(line):
return line
@staticmethod
def as_integer(line):
return int(line)
|
class Graph():
def __init__(self, vertices):
self.V = vertices
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]
# A utility function to check if the current color assignment
# is safe for vertex v
def isSafe(self, v, colour, c):
for i in range(self.V):
if self.graph[v][i... |
"""
Testing for the partial dependence module.
"""
import numpy as np
import pytest
import sklearn
from sklearn.inspection import partial_dependence
from sklearn.inspection._partial_dependence import (
_grid_from_X,
_partial_dependence_brute,
_partial_dependence_recursion
)
from sklearn.ensemble import Gr... |
class Counter(object):
def __init__(self):
self.cnt = 0
def count(self):
self.cnt += 1
def doublecount(self):
self.cnt += 2
def reset(self):
self.cnt = 0
def show(self):
print(self.cnt)
def __repr__(self):
return str(cnt.sel... |
# Copyright 2013 Red Hat, 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... |
from ..quom_error import QuomError
class TokenizeError(QuomError):
def __init__(self, msg: str, it=None):
super().__init__(msg)
self.it = it
|
# Copyright 2020 Kochat. 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... |
#!/usr/bin/env python
from pprint import pprint
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
from sympy import exp
from pyne import nucname
from pyne.material import Material
from pyne import cram
from transmutagen.origen_all import TIME_STEPS
np.set_printoptions(precision... |
class LicenseProviderAttribute(Attribute,_Attribute):
"""
Specifies the System.ComponentModel.LicenseProvider to use with a class. This class cannot be inherited.
LicenseProviderAttribute()
LicenseProviderAttribute(typeName: str)
LicenseProviderAttribute(type: Type)
"""
def Equals(self,value):
... |
from meta_mb.optimizers.base import Optimizer
from meta_mb.optimizers.conjugate_gradient_optimizer import ConjugateGradientOptimizer
from meta_mb.optimizers.maml_first_order_optimizer import MAMLFirstOrderOptimizer |
from datetime import datetime as dt, timedelta
import numpy as np
import os
import torch
from torch.nn import MSELoss
from torch.optim import LBFGS, Adam
from adabelief_pytorch import AdaBelief
from torch_cpo_utils import *
# from cpo_torch import CPO
from buffer_torch import *
from models_torch import MLP_DiagGaussi... |
# -*- coding: utf-8 -*-
__author__ = 'Dheepak Krishnamurthy'
__email__ = 'kdheepak89@gmail.com'
__version__ = '0.1.0'
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
import declxml
import json
from agent.config import EMPTY_JSON_DATACITE
def transform_to_datacite(settings, meta):
# Initialisatio Hack
dc_data = json.loads(json.dumps(EMPTY_JSON_DATACITE))
json_data = meta['json_data']
# Contruct from record
dc_data['name'] = json_data['sceneId']
dc_data['ti... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright ©2011 Andrew D Yates
# andrewyates.name@gmail.com
#
# Modified and redistributed as part of pyXMLSecurity by leifj@mnt.se
# with permission from the original author
#
"""Test RSA cryptographic PEM reader modules using example files.
"""
from datetime import datetime... |
## Get the samples
X_samples = X[0:5]
print("Sample input:", X_samples)
# Do a forward pass of the network
output = model.forward(X_samples)
print("Network output:", output)
# Predict the label of each point
y_predicted = model.predict(X_samples)
print("Predicted labels:", y_predicted) |
#!/usr/bin/env python
# Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This tool will create a json description of the GN build environment that
# can then be used by gen_angle_android_bp.py to b... |
# coding: utf-8
"""
QUBO API solvers
QUBO solvers from Meta Analytics # noqa: E501
OpenAPI spec version: v1
Contact: rajesh@craftingdata.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SolverAsyncRequest(object):... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
# with open('README.md') as readme_file:
# readme = readme_file.read()
#
# with open('HISTORY.rst') as history_file:
# history = history_file.read()
requirements = [ 'scipy',
'k... |
"""
postprocess_batch_results.py
Given a .json or .csv file representing the output from the batch detection API,
do one or more of the following:
* Evaluate detector precision/recall, optionally rendering results (requires
ground truth)
* Sample true/false positives/negatives and render to HTML (requires ground... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="rc4py",
version="0.0.1",
author="Vyacheslav Alexeev",
author_email="alexeev.corp@gmail.com",
description="A small RC4 encoder",
long_description=long_description,
long_description_... |
try:
a,b = [int(x) for x in input("Enter two numbers:").split()]
c = a/b
print(c)
except ZeroDivisionError:
print("Division by zero is not allowed")
print("Please enter a non zero number")
print("Code after that exception") |
import logging
from sqlalchemy.orm import Session
from app.model.list import List as ModelList
from app.repository import list_dao, database_connection
def run(request: int):
"""
Get a list
:param request: A list id
:return: The list
"""
session: Session = database_connection.get_session()
... |
# -*- coding: utf-8 -*-
"""
Returners Directory
:func:`get_returner_options` is a general purpose function that returners may
use to fetch their configuration options.
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
from salt.ext import six
log = logging.getLogger(__name_... |
from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
"""Create a new user in the sy... |
from setuptools import setup, find_packages
setup(
name = 'atrtools',
version='0.1.0',
description = 'Atari 8-bit development tools',
author = 'Gandalf',
author_email = 'grafi71@o2.pl',
license = 'MIT',
packages = find_packages(),
install_requires = ['pillow', 'lz4'],
entry_points =... |
# Copyright (c) MONAI Consortium
# 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, so... |
'''
Created on Dec 29, 2020
@author: mballance
'''
import os
import yaml
from mkdv.job_spec import JobSpec
from mkdv.job_spec_set import JobSpecSet
from mkdv.job_spec_gen import JobSpecGen
from mkdv.yaml_loader import YamlLoader
from yaml.loader import FullLoader
from mkdv.stream_provider import StreamProvider
from ty... |
import os
from nose_parameterized import parameterized
import pandas as pd
from toolz import valmap
import toolz.curried.operator as op
from zipline.assets.synthetic import make_simple_equity_info
from zipline.data.bundles import UnknownBundle, from_bundle_ingest_dirname
from zipline.data.bundles.core import _make_bu... |
def get_partition(A, b, loss, block_size, p_rule):
n_params = int(loss.n_params)
L = loss.lipschitz
# ASSERTIONS
# if p_rule != "Ada" and p_rule != "VB":
# Assert fixed block methods have block size that divides the coordinates
# equally
# assert (n_params % block_size) == 0
if p_rule == "Ad... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/anyex/anyex/blob/master/CONTRIBUTING.md#how-to-contribute-code
from anyex.async.base.exchange import Exchange
import hashlib
from anyex.base.errors import ExchangeError
from anyex.base.errors import N... |
import cv2
#only for 1280 * 720 images (HD images)
img_file = "./images/SlidegameImages/IMGcut" # put where you want to save
cut_file = "./images/SlidegameImages/numpuz/puz-ferrari/ferrari.jpg" # put the file that you want to cut
img_name = "/cuttedimage" ... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
#!/usr/bin/env python -u
##############################################################################
#
# Copyright (c) 2007 Agendaless Consulting and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the BSD-like license at
# http://www.repoze.org/LICENSE.txt. A copy of the lice... |
from os import SEEK_CUR, SEEK_SET, SEEK_END
from re import search, finditer, match
from datetime import datetime
from numpy import (fromfile,
frombuffer,
asmatrix,
array,
arange,
c_,
diff,
... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.