filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_106_23574 | import os
from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
app_name = 'templatesadmin'
version = __import__(app_name).__version__
# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/co... |
the-stack_106_23575 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
the-stack_106_23576 | # -*- coding: utf-8 -*-
"""
flask envs, based on flask_environments
~~~~~~~~~~~~~~~~~~
Environment tools and configuration for Flask applications
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
import os
import yaml
from flask import current_app
class Envi... |
the-stack_106_23578 | """Transformer for Weisfeiler—Lehman Feature Vector calculations."""
# This code was originally used in the paper 'A Persistent Weisfeiler–Lehman
# Procedure for Graph Classification'. The original author is Christian Bock.
import collections
import copy
import numpy as np
class WeisfeilerLehman:
"""Implement ... |
the-stack_106_23579 | import logging
from easilyb.json_min_db import JsonMinConnexion
from threading import Lock
logger = logging.getLogger(__name__)
NOTHING = object()
def get_config_path(filename='config.yaml', appname=None, appauthor=None, appversion=None,
dirpath=None, app_root_config=None, user_config=None, syste... |
the-stack_106_23580 | import heterocl as hcl
import numpy as np
from hlib.op.extern import create_extern_module, register_extern_ip
import os
dtype = hcl.Int()
@register_extern_ip(vendor="intel")
def byte_swap_rtl(input_vec, ret=None, name=None):
if name is None: name = "my_byteswap"
Len = input_vec.shape[0]
return_tensors =... |
the-stack_106_23581 | """The Flick Electric integration."""
from datetime import datetime as dt
from pyflick import FlickAPI
from pyflick.authentication import AbstractFlickAuth
from pyflick.const import DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CON... |
the-stack_106_23582 | # -*- coding: utf-8 -*-
#
# Jedi documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 26 00:11:34 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... |
the-stack_106_23584 | from discord.ext import commands
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
@bot.event
async def on_command_error(ctx, error):
orig_error = getattr(error, "original", error)
error_msg = ''.join(traceback.TracebackException.from_exception(orig_err... |
the-stack_106_23585 | import os
################ MAKE CHANGES HERE #################
inputDir = "input" # path to the input sequence PNGs
inputFileFormat = "%03d" # name of input files, e.g., %03d if files are named 001.png, 002.png
inputFileExt = "png" # extension of input files (without .), e.g., png, jpg
f... |
the-stack_106_23588 | """options table constraint
Revision ID: b531c6dadfcf
Revises: 8af57a53dc4e
Create Date: 2019-11-15 17:22:40.911136
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b531c6dadfcf'
down_revision = '8af57a53dc4e'
branch_labels = None
depends_on = None
def upgrad... |
the-stack_106_23589 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
from src import InstaBot
from src.check_status import check_status
from src.feed_scanner import feed_scanner
from src.follow_protocol import follow_protocol
from src.unfollow_protocol import unfollow_protocol
bot = InstaBot(
login="ti... |
the-stack_106_23590 | import gym
class ContinuingTimeLimit(gym.Wrapper):
"""TimeLimit wrapper for continuing environments.
This is similar gym.wrappers.TimeLimit, which sets a time limit for
each episode, except that done=False is returned and that
info['needs_reset'] is set to True when past the limit.
Code that cal... |
the-stack_106_23591 | # %% [markdown]
# # Inequality constraints
# %%
import numpy as np
import tensorflow as tf
np.random.seed(1799)
tf.random.set_seed(1799)
# %% [markdown]
# ## The problem
#
# In this tutorial, we replicate one of the results of <cite data-cite="gardner14">[Gardner et al.](http://proceedings.mlr.press/v32/gardner14.ht... |
the-stack_106_23592 | # Copyright 2015 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 ag... |
the-stack_106_23593 | from setuptools import setup
with open('README.rst') as f:
long_description = f.read()
setup(
name="gfwlist2dnsmasq",
version="0.1.0",
license='MIT',
description="convert gfwlist to dnsmasq config file",
author='nucbill',
author_email='nucbill100@gmail.com',
url='https://github.com/nuc... |
the-stack_106_23596 | from rest_framework import serializers
from .models import User, Photo
"""
Code from:
http://stackoverflow.com/questions/28036404/django-rest-framework-upload-image-the-submitted-data-was-not-a-file#28036805
"""
class Base64ImageField(serializers.ImageField):
"""
A Django REST framework field for handling imag... |
the-stack_106_23601 | import torch
import torch.nn.functional as F
from torchvision import models
import numpy as np
import cv2
import os, sys
from torchsummary import summary
######## config #############
test_images_path = sys.argv[1]
classes = ('chair', 'people')
input_shape = (3, 224, 224)
cards_id = [2, 3]
param_save_path = sys.argv[2... |
the-stack_106_23603 | # pulled from the AWSCLI and modified by Globus
# note that this file has also been modified by auotfixers (e.g. black, pyupgrade)
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in com... |
the-stack_106_23604 | import pytest
from eth_utils import (
ValidationError,
)
from eth2.beacon.committee_helpers import (
get_beacon_proposer_index,
)
from eth2.beacon.configs import (
CommitteeConfig,
)
from eth2.beacon.helpers import (
get_epoch_start_slot,
)
from eth2.beacon.types.blocks import (
BeaconBlockBody,
)... |
the-stack_106_23606 | """Prepare a workflow for running on AWS using STORMSeq as a front end.
http://www.stormseq.org/
"""
import argparse
import json
import os
import yaml
from bcbio import utils
from bcbio.upload import s3
from bcbio.workflow import xprize
def parse_args(args):
parser = xprize.HelpArgParser(description="Run STORMS... |
the-stack_106_23607 | """Contains ECG Batch class."""
# pylint: disable=too-many-lines
import copy
from textwrap import dedent
import numpy as np
import pandas as pd
import scipy
import scipy.signal
import matplotlib.pyplot as plt
import pywt
from .. import dataset as ds
from . import kernels
from . import ecg_batch_tools as bt
from .uti... |
the-stack_106_23608 | ## @package gradient_checker
# Module caffe2.python.gradient_checker
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from caffe2.python import core, workspace
from caffe2.proto import caffe2_pb2
c... |
the-stack_106_23609 | ##
## MIT License
##
## Copyright (c) 2016 Luca Angioloni
##
## 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,... |
the-stack_106_23611 | vowels = 'aiyeou'
consonants = 'bkxznhdcwgpvjqtsrlmf'
ans = ''
while True:
try:
text = input()
for t in text:
lowerT = t.lower()
if lowerT in vowels:
tmp = vowels[(vowels.index(lowerT) + 3) % 6]
ans += tmp.upper() if t.isupper() else tmp
... |
the-stack_106_23612 | #!/usr/bin/python
# Representation of logic circuit as AIG
import sys
class AigRef:
node = None
negate = False
def __init__(self, node, negate):
self.node = node
self.negate = negate
def encode(self):
return 2 * self.node.id + (1 if self.negate else 0)
def isZero(self):... |
the-stack_106_23613 | import time
import numpy as np
import cudarray as ca
from ..feed import Feed
from ..parameter import SharedParameter
import logging
log = logging.getLogger(__name__)
class GradientDescent(object):
def __init__(self, model, feed, learn_rule):
self.feed = Feed.from_any(feed)
self.learn_rule = learn... |
the-stack_106_23615 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Mayo Clinic
# 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... |
the-stack_106_23616 | import discord
import src.commands as cmd
import src.config as cfg
from .log import logger
client = discord.Client()
@client.event
async def on_ready(*args, **kwargs) -> None:
logger.info('discord ready')
@client.event
async def on_message(message: discord.Message) -> None:
if message.author.id == client.us... |
the-stack_106_23617 | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the foll... |
the-stack_106_23619 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="youtubedata",
version="1.1.1",
author="ofc",
author_email="support@youtubedata.io",
description="YouTube Data provides comprehensive YouTube video metadata scraping. Results are returned i... |
the-stack_106_23620 | from __future__ import absolute_import
import logging
import six
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from dja... |
the-stack_106_23621 | from django.contrib.auth import get_user_model
from django.core.management import call_command
from qcat.tests import TestCase
User = get_user_model()
def create_new_user(id=1, email='a@b.com', lastname='foo', firstname='bar'):
user, created = User.objects.get_or_create(
id=id, email=email,
defau... |
the-stack_106_23623 | from typing import (
Iterator,
NamedTuple,
)
from async_service import (
as_service,
ManagerAPI,
)
from eth_utils import to_tuple
import psutil
from p2p import trio_utils
from trinity.components.builtin.metrics.registry import HostMetricsRegistry
from trinity.exceptions import MetricsReportingError
... |
the-stack_106_23626 | """The actual implementation."""
import os
from typing import List
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.transforms.post_transforms import SphinxPostTransform
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import NodeMatcher
def setup(app):
"... |
the-stack_106_23631 | '''
Module : Main
Description : The main entry point for the program.
Copyright : (c) Bernie Pope, 16 Oct 2019
License : MIT
Maintainer : bjpope@unimelb.edu.au
Portability : POSIX
A plotting and data analytics program for the command line
'''
import sys
import logging
import pandas as pd
from hatch.com... |
the-stack_106_23633 | import random
from collections import (
deque,
namedtuple,
)
import numpy as np
import torch
class ReplayBuffer:
"""Fixed-size buffer to store experience tuples."""
def __init__(self, buffer_size, batch_size, seed, device):
"""Initialize a ReplayBuffer object.
Params
======
... |
the-stack_106_23635 | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... |
the-stack_106_23637 | #!/usr/bin/env python
"""Trains a classifier for frames from the Simpsons.
Useful for testing data tables.
"""
# we need this so strings are written to bigquery as strings rather than bytes
from __future__ import unicode_literals
import math
import os
import subprocess
import keras
from keras.models import Sequent... |
the-stack_106_23638 | '''Train CIFAR10 with PyTorch.'''
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
import os
import argparse
import csv
from models ... |
the-stack_106_23640 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import re
from frappe import _
from frappe.utils import (flt, getdate, get_first_day, get_last_day, date_diff,
add_months, add_days, form... |
the-stack_106_23642 | # coding: utf-8
import pprint
import re
import six
class ProxyTokenDTO:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is j... |
the-stack_106_23646 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
import pytest
import pickle
from sklearn.linear_model import LinearRegression, Lasso, LassoCV, LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder, Function... |
the-stack_106_23648 | import logging, importlib, sys, os
log = logging.getLogger('genthemall.utils')
def load_class(clazz):
"""
util method for dynamic load class.
"""
dotIdx = clazz.rindex('.')
mod = importlib.import_module(clazz[0:dotIdx])
return getattr(mod, clazz[dotIdx+1:])
def load_function(fn):
"""
... |
the-stack_106_23650 | #!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLe... |
the-stack_106_23651 | from functools import cache, partial, reduce
from math import prod
import pdb
import aoc
from toolz import keyfilter
from tadhg_utils import lcompact, lfilter, lmap, splitstrip, splitstriplines
INPUT, TEST = aoc.get_inputs(__file__)
TA1 = 15
TA2 = 1134
A1 = 530
A2 = 1019494
def process_one(data):
return sum(map... |
the-stack_106_23652 | from __future__ import unicode_literals
import json
from urllib.parse import urlencode
import re
import sure # noqa
import moto.server as server
"""
Test the different server responses
"""
def test_cloudformation_server_get():
backend = server.create_backend_app("cloudformation")
stack_name = "test stack"... |
the-stack_106_23658 | INCLUDE_VALUE_IN_NAME = ["display"]
class StyleMap():
map = {}
def __init__(self, map):
self.map = map
pass
def removeById(self, id):
del self.map[id]
def getElementIds(self):
return set(self.map.keys())
def renameId(self, old_id, new_id):
if... |
the-stack_106_23659 | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import re
import time
from six import string_types
from six.moves.urllib.request import urlopen
from .errors import RetryError
from .structures import LazyFunction
from .subprocess import run_command
from .utils... |
the-stack_106_23660 | from ...plugin import hook
from .trezor import TrezorPlugin
from ..hw_wallet import CmdLineHandler
class Plugin(TrezorPlugin):
handler = CmdLineHandler()
@hook
def init_keystore(self, keystore):
if not isinstance(keystore, self.keystore_class):
return
keystore.handler = self.han... |
the-stack_106_23662 | # -*- coding: utf-8 -*-
"""
Provides support to compose user-defined parse types.
Cardinality
------------
It is often useful to constrain how often a data type occurs.
This is also called the cardinality of a data type (in a context).
The supported cardinality are:
* 0..1 zero_or_one, optional<T>: T or None
*... |
the-stack_106_23663 | from dataclasses import dataclass, field
from functools import partial
import jax
import jax.numpy as jnp
import numpy as np
from braceexpand import braceexpand
from datasets import Dataset, load_dataset
from .text import TextNormalizer
@dataclass
class Dataset:
dataset_repo_or_path: str
train_file: str = N... |
the-stack_106_23665 | import argparse
import gym
from dqn.trainer import Trainer
from dqn.tester import Tester
from envs.env_wrappers import wrap_dqn
def main():
parser = argparse.ArgumentParser(description='Deep Q Network')
# 環境側のパラメータ
parser.add_argument('--env_name', default='PongNoFrameskip-v4', help='Environment name')
... |
the-stack_106_23666 | from reportlab.lib.pagesizes import letter, landscape
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER
from reportlab.lib import color... |
the-stack_106_23668 | #!/usr/bin/env python
"""Setup script for ConferenceScheduler."""
import setuptools
from conference_scheduler import __project__, __version__
import os
if os.path.exists('README.rst'):
README = open('README.rst').read()
else:
README = "" # a placeholder, readme is generated on release
CHANGES = open('CHANG... |
the-stack_106_23670 | # -*- test-case-name: foolscap.test.test_banana -*-
from __future__ import print_function
from twisted.python import log
from twisted.internet.defer import Deferred
from foolscap.tokens import Violation
from foolscap.slicer import BaseSlicer, BaseUnslicer
from foolscap.constraint import OpenerConstraint, Any, IConstra... |
the-stack_106_23671 | from types import SimpleNamespace
from syncx import manage
from syncx import tag
from syncx.manager import Manager
from syncx.manager import ManagerInterface
from syncx.serializer import JsonSerializer
from syncx.serializer import YamlSerializer
def test_get_serializer():
assert Manager.get_serializer('foo') is ... |
the-stack_106_23672 | from warnings import warn
from .Abi import dec_uint
from .JsonRpc import JsonRpc
from .JsonRpc import JsonRpcError
class BlockDataDict(object):
'''
Represents the parsed return of the Block data.
'''
integer_fields = ["nonce", "number", "difficulty", "totalDifficulty", "size", "gasLimit", "gasUsed", "timest... |
the-stack_106_23674 | import numpy as np
from core.variable import Variable
from core.constraint import Constraint
from core.agent_state import AgentState
class Agent:
def __init__(self, name, variables=[], constraints=[], seed=1234):
self.name = name
self.variables = variables.copy()
# the set of constraints in... |
the-stack_106_23675 | import sys
import scipy.io as sio
import glob
## OBJ file
#v -0.3925 -0.8111 2.0260
s = int(sys.argv[1])
with open('scenes', 'r') as fin:
scene_id = fin.readlines()[s].strip()
mats = glob.glob('scannet/%s/*.mat' % scene_id)
for mat_f in mats:
obj = mat_f.replace('.mat', '.obj')
mat = sio.loadmat(mat_f)
#pr... |
the-stack_106_23677 | # search_helpers.py
from typing import List
from pybraries.helpers import sess, extract
from pybraries.make_request import make_request
def search_api(action, *args, **kwargs):
"""
build and call for search
Args:
action (str): function action name
*args (str): positional arguments
... |
the-stack_106_23683 | # coding: utf-8
import pprint
import re
import six
class ListResourceTypesRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the... |
the-stack_106_23684 | import sys, os
import subprocess
#from utilix.rundb import pymongo_collection
from utilix import xent_collection
import re
import time
import datetime
_date = sys.argv[1]
single_calibration = int(sys.argv[2])
date = datetime.datetime(int(_date[:4]), int(_date[4:6]), int(_date[6:]))
runs = sys.argv[3:11]
print('Date:... |
the-stack_106_23685 | from typing import Callable, Optional
from testutils.trees import TreeNode, build_tree
def preorder_string(node: Optional[TreeNode]) -> str:
"""Returns a uniquely identifyable preorder string of the tree"""
if not node:
return ''
return f"# {node.val} {preorder_string(node.left)} {preorder_string... |
the-stack_106_23686 | import configparser
import re
import sys
from loguru import logger as logger
class Config:
def __init__(self, config_file: str):
self.config_file = config_file
def check_setting(self, category: str, option: str) -> str:
config = configparser.ConfigParser()
config.read(self.config_file... |
the-stack_106_23691 | import copy
import logging
from typing import List, Tuple
import torch
import wandb
from torch.utils.data import DataLoader, TensorDataset
from torchvision.utils import make_grid
import torchvision.transforms as tfs
from FID.FIDScorer import FIDScorer
from fedml_api.standalone.fedgdkd.ac_gan_model_trainer import ACGA... |
the-stack_106_23692 | import logging
import spotipy
from interaction_manager.utils import config_helper
logger = logging.getLogger("Spotify Config")
default_spotify_settings = config_helper.get_spotify_settings()
scope = "user-library-read, playlist-read-private, app-remote-control, streaming, " \
"user-read-playback-state, use... |
the-stack_106_23693 | from __future__ import absolute_import, division, print_function
# XXX this is intended to be a simple template for debugging queueing system
# support issues, not a full regression test.
class target(object):
def __init__(self, x):
self.x = x
def __call__(self):
import math
results = []
for n in... |
the-stack_106_23695 | from tqdm import tqdm
import torch
class Trainer:
def __init__(self, cfg, model, criterion, optimizer, loader):
self.cfg = cfg
self.model = model
self.criterion = criterion
self.optimizer = optimizer
self.train_loader = loader['train']
self.val_loader = loader['val'... |
the-stack_106_23697 | import base64
import os
import sys
import threading
from collections import defaultdict
from functools import partial
from io import BytesIO
from mimetypes import guess_extension
from tempfile import mkstemp
from typing import Any, Union
import numpy as np
import six
from PIL import Image
from ...debugging.log import... |
the-stack_106_23699 | """CSC110 Fall 2020: Climate Change and Natural Disaster Sentiment Analysis
This is the main module that converts dataset of ids to tweet sentiments and then plots the results.
Copyright and Usage Information
==============================
This file is Copyright (c) 2020 Akash Ilangovan, Vijay Sambamurthy, Dharmpreet... |
the-stack_106_23702 | from tello import Tello
import sys
from datetime import datetime
import time
# from PIL import Image
import cv2
import numpy as np
import rospy
import std_msgs.msg
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import camera_info_manager as cim
from sensor_msgs.msg import CameraInfo
impo... |
the-stack_106_23703 | # -*- coding: utf-8 -*-
def main():
import sys
input = sys.stdin.readline
x = list(map(int, input().split()))
for index, xi in enumerate(x, 1):
if xi == 0:
print(index)
exit()
if __name__ == '__main__':
main()
|
the-stack_106_23705 | from brownie import interface
from rich.console import Console
from tabulate import tabulate
from helpers.utils import val
from helpers.multicall import Call, as_wei, func
from .StrategyCoreResolver import StrategyCoreResolver
console = Console()
class StrategyDiggRewardsResolver(StrategyCoreResolver):
# ===== ... |
the-stack_106_23707 | #!/usr/bin/env python3
# Foundations of Python Network Programming, Third Edition
# https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter06/test_tls.py
# Attempt a TLS connection and, if successful, report its properties
import argparse, socket, ssl, sys, textwrap
import ctypes
from pprint import pprint
def open... |
the-stack_106_23708 | # -*- coding: utf-8 -*-
import pandas as pd
from functools import wraps
from ..common import _getJson, _dateRange, _strOrDate, _toDatetime
def timeSeriesInventory(token='', version=''):
'''Get inventory of available time series endpoints
Returns:
result (dict)
'''
return _getJson('time-series/... |
the-stack_106_23710 | # coding: utf-8
#
# Copyright 2014 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 requi... |
the-stack_106_23712 | from os import path, mkdir
import numpy as np
np.random.seed(1)
import random
random.seed(1)
import tensorflow as tf
tf.set_random_seed(1)
import timeit
import cv2
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import ModelCheckpoint, LearningRateScheduler #, TensorBoard
from models import... |
the-stack_106_23713 | # Copyright 2018 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... |
the-stack_106_23715 | #
# 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 us... |
the-stack_106_23716 | from __future__ import print_function
import numpy as np
from scipy.sparse.linalg.isolve.utils import make_system
from pyamg.util.linalg import norm
from warnings import warn
__all__ = ['cr']
def cr(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None,
callback=None, residuals=None):
"""Conjugate Re... |
the-stack_106_23718 | import os
import shutil
from bson.json_util import dumps
import numpy as np
from pax import plugin, exceptions, datastructure
from pax.formats import flat_data_formats
class TableWriter(plugin.OutputPlugin):
"""Output data to flat table formats
Convert our data structure to numpy record arrays, one for each... |
the-stack_106_23721 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# repeat.py
# shelly
#
"""
Repeat a command a given number of times (or, infinitely).
"""
import sys
import optparse
import subprocess
def repeat(cmd_args, n=None):
run = lambda: subprocess.Popen([' '.join(cmd_args)], stdout=sys.stdout,
stderr=sys.st... |
the-stack_106_23723 | # Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... |
the-stack_106_23728 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=22
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... |
the-stack_106_23730 | import time
import win32api
import win32con
# https://gist.github.com/chriskiehl/2906125
VK_CODES = {
'backspace': 0x08,
'tab': 0x09,
'clear': 0x0C,
'enter': 0x0D,
'shift': 0x10,
'ctrl': 0x11,
'alt': 0x12,
'pause': 0x13,
'caps_lock': 0x14,
'esc': 0x1B,
'spacebar': 0x20,
... |
the-stack_106_23731 | import os
import numpy as np
import tensorflow as tf
import random
IGNORE_LABEL = 255
IMG_MEAN = np.array((125.0, 114.4, 107.9), dtype=np.float32)
def image_scaling(img, label, edge):
"""
Randomly scales the images between 0.5 to 1.5 times the original size.
Args:
img: Training image to scale.
... |
the-stack_106_23732 | # Copyright 2018-2021 Alvaro Bartolome, alvarobartt @ GitHub
# See LICENSE for details.
import json
import requests
from unidecode import unidecode
from .utils import constant as cst
from .utils.search_obj import SearchObj
from .utils.extra import random_user_agent
from lxml.html import fromstring
def search_quot... |
the-stack_106_23735 | # -*- coding: utf-8 -*-
from .buffer import Buffer
from .timeout import Timeout
from .. import context, term, atexit
from ..util import misc, fiddling
from ..context import context
import re, threading, sys, time, subprocess, logging, string
log = logging.getLogger(__name__)
class tube(Timeout):
"""
Container... |
the-stack_106_23737 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
the-stack_106_23741 | #!/usr/bin/env python
# Copyright (c) 2018 Andy Zeng
import socket
import struct
import time
import numpy as np
import os
import sys
import math
import matplotlib.pyplot as plt
import pybullet as p
import pybullet_data
from datetime import datetime
import gym
from gym import spaces
from gym.utils import seeding
from... |
the-stack_106_23742 | # -*- coding: utf-8 -*-
import scrapy
# from scrapy.shell import inspect_response
from scrapy import signals
from jobcrawl.items import JobItem
from scrapy.http import HtmlResponse
from jobcrawl.selenium_scraper import DrushimScraper
from pydispatch import dispatcher
# from scrapy.xlib.pydispatch import dispatcher
# i... |
the-stack_106_23743 | """Functions to load demo datasets."""
import io
import logging
import os
import urllib.request
from datetime import datetime, timedelta
from zipfile import ZipFile
import numpy as np
import pandas as pd
import scipy as sp
from faker import Faker
from sdv.metadata import Metadata, Table
LOGGER = logging.getLogger(_... |
the-stack_106_23744 | import data_utils
def _get_feed_dict_for_others(model, x_batch, y_batch, x_lens, use_pos=True, use_ner=True, use_deprel=True):
feed = {model.word_inputs:x_batch[data_utils.WORD_FIELD], model.labels:y_batch, model.seq_lens:x_lens}
if use_pos:
feed[model.pos_inputs] = x_batch[data_utils.POS_FIELD]
if... |
the-stack_106_23745 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
the-stack_106_23746 | # Owner(s): ["module: sparse"]
import torch
import itertools
import functools
import operator
import random
import unittest
from torch.testing import make_tensor
from torch.testing._internal.common_dtype import (
all_types_and_complex,
)
from torch.testing._internal.common_utils import TestCase, run_tests, skipIfR... |
the-stack_106_23747 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
the-stack_106_23748 | # Copyright 2013-2022 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 Exempi(AutotoolsPackage):
"""exempi is a port of Adobe XMP SDK to work on UNIX and to be b... |
the-stack_106_23752 | """
File: weather_master.py
Name: Karen Wong
-----------------------
This program should implement a console program that asks weather data from user to compute the average, highest, lowest, cold days among the inputs.
Output format should match what is shown in the sample run in the Assignment 2 Handout.
"""
EXIT = -... |
the-stack_106_23753 | import sys
import os
import numpy as np
import pytest
import keepa
import datetime
py2 = sys.version_info.major == 2
py37 = sys.version_info.major == 3 and sys.version_info.minor == 7
# reduce the request limit for testing
keepa.interface.REQLIM = 2
try:
path = os.path.dirname(os.path.realpath(__file__))
k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.