text stringlengths 1 927k |
|---|
"""
Copyright 2017 ARM 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 agreed to in writing, software
dis... |
fin = open('input_12.txt')
p = 0+0j
w = 10+1j
offset = {'E':1+0j,'N':0+1j,'W':-1+0j,'S':0-1j}
rot = {'L':0+1j,'R':0-1j}
for line in fin:
letter = line[0]
number = int(line[1:-1])
d = w-p
if letter in "ENWS":
w += number*offset[letter]
elif letter == "F":
p += number*d
w +=... |
from mmpose.core import wrap_fp16_model
from mmpose.models.detectors.top_down import TopDown
class HRNet(TopDown):
def __init__(self,
backbone,
neck=None,
keypoint_head=None,
train_cfg=None,
test_cfg=None,
pretr... |
import sys
from typing import IO
STDOUT = sys.stdout
class BufferedStream:
def __init__(self, stream: IO):
self.stream = stream
self.data = []
def write(self, data):
self.data.append(data)
def writelines(self, datas):
self.data += datas
def read(self) -> str:
... |
from models.resnet import ResNet18, ResNet50, ResNet101, WideResNet50_2, WideResNet101_2
from models.resnet_cifar import cResNet18, cResNet50, cResNet101
from models.frankle import FC, Conv2, Conv4, Conv6, Conv4Wide, Conv8, Conv6Wide, Net
__all__ = [
"ResNet18",
"ResNet50",
"ResNet101",
"cResNet18",
... |
import argparse
import sys
from typing import List
from .format_manifest import format_manifest_command
from .index import index_command
from .update import update_command
from .channel import build_channel_command
def parse_arguments(argv: List[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
reqs = ['pandas>=0.18.0', 'numpy>=1.11.0', 'docopt>=0.6.0', 'Jinja2>=2.8', 'xlrd>=0.9.4']
setup(
name='vakkenranking',
version='0.2.0',
packages=['vakkenranking'],
install_requires=reqs,
entry_points={
"console_sc... |
"""Utilities for the hang analyzer subcommand."""
from buildscripts.resmokelib.hang_analyzer import dumper
from buildscripts.resmokelib.hang_analyzer import process
from buildscripts.resmokelib.hang_analyzer import process_list
from buildscripts.resmokelib.hang_analyzer.hang_analyzer import HangAnalyzerPlugin |
# Generated by Django 3.0.3 on 2020-03-25 18:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mdi', '0042_auto_20200325_0121'),
]
operations = [
migrations.CreateModel(
name='LegalStatus',
fields=[
... |
"""
Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
"""
Collection of misc tools
"""
import sys
import logging
import inspect
from ibapi.common import UNSET_I... |
# @Author: Antoine Pointeau <kalif>
# @Date: 2017-03-27T01:24:24+02:00
# @Email: web.pointeau@gmail.com
# @Filename: UCSModel.py
# @Last modified by: kalif
# @Last modified time: 2017-04-04T00:50:08+02:00
import os
import yaml
import copy
from ..UCException import *
from ..UCChain import *
from .Interface impor... |
import unittest
import cupy
from cupy import testing
class TestCArray(unittest.TestCase):
def test_size(self):
x = cupy.arange(3).astype('i')
y = cupy.ElementwiseKernel(
'raw int32 x', 'int32 y', 'y = x.size()', 'test_carray_size',
)(x, size=1)
assert int(y[0]) == 3
... |
# NIRSpec specific rountines go here
import os
import numpy as np
from astropy.io import fits
from . import sigrej, background, nircam
from . import bright2flux as b2f
def read(filename, data, meta):
'''Reads single FITS file from JWST's NIRCam instrument.
Parameters
----------
filename: str
... |
import logging
from typing import (
Dict, Awaitable, Callable, Any, Set, List, Optional,
TYPE_CHECKING)
from opentrons.types import Mount, Point, Location
from opentrons.config import feature_flags as ff
from opentrons.hardware_control import ThreadManager, CriticalPoint, Pipette
from opentrons.protocol_api imp... |
# Copyright 2014-2015 The Alive 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 ... |
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from nautobot.dcim.choices import PowerFeedPhaseChoices, PowerFeedSupplyChoices, PowerFeedTypeChoices
from nautobot.dcim.constants impo... |
# -*- coding: utf-8 -*-
"""Implementation of the Scheduler interface. This implementation only
supports sending yos"""
# Pylint rules regarding variable names that are not in PEP8.
# https://www.python.org/dev/peps/pep-0008/#global-variable-names
# pylint: disable=invalid-name
# Scheduled task manager
import sys
fr... |
#
# 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... |
r"""
Interface to MuPAD
AUTHOR:
- Mike Hansen
- William Stein
You must have the optional commercial MuPAD interpreter installed and
available as the command \code{mupkern} in your PATH in order to use
this interface. You do not have to install any optional \sage
packages.
TESTS::
sage: mupad.package('"MuPAD-C... |
import os
import numpy as np
import random
import h5py
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = BASE_DIR
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, '..'))
import show3d_balls
def show_points(point_array, color_array=None, radius=3):
assert isinstance(point_... |
#!/usr/bin/env python
#
# Copyright 2007 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the findDigits function below.
def findDigits(n):
num = n
count = 0
n = str(n)
for i in n:
d = int(i)
if d!=0 and num%d==0:
count+=1
return count
if __name__ == '__main__':
... |
rows = int(input("Enter the no. of rows in A"))
for i in range(rows):
space = rows - i - 1
while space>0:
space = space -1
print(" ",end='')
for j in range(i):
if j == 0 or j == i-1:
print("*",end=' ')
elif i==rows/2:
print("*",end=' ')
else:
... |
from unittest import expectedFailure
from ..utils import TranspileTestCase
class DatetimeModuleTests(TranspileTestCase):
def test_date_constructor_sanity(self):
self.assertCodeExecution("""
import datetime
print(datetime.date(2018, 10, 10))
""")
def test_date_cons... |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from six import iteritems
import frappe
from frappe import _
field_map = {
"Contact": [ "first_name", "last_name", "phone", "mobile_no", "email_id", "is_prima... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis 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 ... |
import util
def run_hostname(stack, value, value2):
name = util.rioRun(stack, value, value2, 'nginx')
return name
def rio_chk(stack, sname):
fullName = (f"{stack}/{sname}")
inspect = util.rioInspect(fullName)
return inspect['hostname']
def kube_chk(stack, service):
fullName = "%s/%s" % ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
from django.urls import include, path, reverse
from rest_framework.test import APITestCase, URLPatternsTestCase, APIRequestFactory
from rest_framework import status
from knox.models import AuthToken
from django.contrib.auth.models import User
class BookTicketsTest(APITestCase):
def setUp(self):
self.userna... |
# -*- coding: utf-8 -*-
import pytest
import sys
from .test_base_class import TestBaseClass
from aerospike import exception as e
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit(1)
class TestLog(object):
def teardown... |
def getFileName(JPEGImagesPath,MainTrainPath,MainValPath):
import os
source_folder = JPEGImagesPath
dest = MainTrainPath
dest2 = MainValPath
file_list = os.listdir(source_folder)
train_file = open(dest, 'a')
val_file = open(dest2, 'a')
for file_obj in file_list:
file_path = os.pa... |
from django.conf import settings
import stripe
from brambling.payment.core import LIVE
def stripe_prep(api_type):
stripe.api_version = '2016-03-07'
if api_type == LIVE:
stripe.api_key = settings.STRIPE_SECRET_KEY
else:
stripe.api_key = settings.STRIPE_TEST_SECRET_KEY
def stripe_test_set... |
from ray.rllib.utils.framework import try_import_tf
tf = try_import_tf()
class GRUGate(tf.keras.layers.Layer):
def __init__(self, init_bias=0., **kwargs):
super().__init__(**kwargs)
self._init_bias = init_bias
def build(self, input_shape):
h_shape, x_shape = input_shape
if x_... |
from django.http import HttpResponse
from django.shortcuts import render
def homepage(request):
# return HttpResponse('home')
return render(request, 'graph.html') |
print("1")
n=0
while n<100:
n+=1
print(n)
print("2") |
# -*- coding: utf-8 -*-
from .exceptions import BadSortFormat
from .models import Field, auto_join, get_default_model, get_model_from_spec
SORT_ASCENDING = "asc"
SORT_DESCENDING = "desc"
class Sort(object):
def __init__(self, sort_spec):
self.sort_spec = sort_spec
try:
field_name = ... |
import socket
import time
class TestIO:
def __init__(self):
# self.ipAddress = "10.20.8.136"
self.ipAddress = "10.20.0.194"
self.port = 63350
def queryServer(self, query):
"""
Private method that sends a command and returns the server's response
in a readable ... |
from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/3199.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
ti... |
__author__ = "Alex Laird"
__copyright__ = "Copyright 2020, Alex Laird"
__version__ = "4.1.6"
import os
from pyngrok.installer import get_ngrok_bin
BIN_DIR = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "bin"))
DEFAULT_NGROK_PATH = os.path.join(BIN_DIR, get_ngrok_bin())
DEFAULT_CONFIG_PAT... |
# Copyright 2013, Big Switch Networks, 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 applic... |
#!/usr/bin/env python
"""
Contains class ModelWrapper and its subclasses, which are wrappers for DeepChem and scikit-learn model classes.
"""
import logging
import os
import shutil
import joblib
import pdb
import deepchem as dc
import numpy as np
import tensorflow as tf
if dc.__version__.startswith('2.1'):
from ... |
import unittest
import numpy as np
import numpy.testing as npt
from scoring.component_parameters import ComponentParameters
from scoring.function import CustomSum
from utils.enums.component_specific_parameters_enum import ComponentSpecificParametersEnum
from utils.enums.scoring_function_component_enum import ScoringF... |
import numpy as np
import cv2
def NMT(u,v, eps=0.2, thr=5.0, smooth_flag=True):
"""
Normalised Median Test, from 'Universal outlier detection for PIV data'
"""
u, v = np.float32(u), np.float32(v)
criterion = 0
for c in [u,v]:
c_median = cv2.medianBlur(c, 5)
residual = np.... |
# Copyright (c) 2013 OpenStack Foundation.
#
# 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... |
#!usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Monkey"
from django.contrib.syndication.views import Feed
from django.urls import reverse
from django.utils.feedgenerator import Rss201rev2Feed
from apps.blog.models import Post
class ExtendedRSSFeed(Rss201rev2Feed):
def add_item_elements(self, handler,... |
#!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import SetupLogging
from cowsnphr_src.install_dependencies import install_deps
from cowsnphr_src.vcf_methods import VCFMethods
from datetime import datetime
from pathlib import Path
import subprocess
import logging
import os
__author__ = 'adamk... |
#!/usr/bin/env python3
import os
import jinja2
from pathlib import Path # python3 only
from dotenv import dotenv_values
import sys
import gitlab
from itertools import product
tpl = r'''# THIS FILE IS AUTOGENERATED -- DO NOT EDIT #
# Edit and Re-run .ci/gitlab/template.ci.py instead #
stages:
- sanity
- ... |
import tkinter as tk
# Create GUI object
app = tk.Tk()
def submit_changes():
print(Submitted)
# Button 1
btn1_text = tk.StringVar()
btn1_label = tk.Label(app, text='Button Name 1', font=('bold', 14), pady=15)
btn1_label.grid(row=0, column=0, sticky=tk.W)
btn1_entry = tk.Entry(app, textvariable=btn1_text)
btn... |
import unittest
from aoc_utils.data import data_lines
def hash_pattern(pattern):
return "".join(pattern)
def cache_result(func):
cache = {}
def inner(pattern):
h = hash_pattern(pattern)
if h not in cache:
cache[h] = func(pattern)
return cache[h]
return inner
@... |
import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class cred():
BOT_TOKEN = os.getenv("BOT_TOKEN") #From botfather
API_ID = os.getenv("API_ID") #"Get this value from my.telegram.org! Please do not steal"
API_HASH = os.getenv("API_HASH") #"Get this value from my.tele... |
# to be generated a package build time
application_paths = {
'assistant': 'Assistant.app',
'designer': 'Designer.app',
'linguist': 'Linguist.app',
'canbusutil': 'canbusutil',
'lconvert': 'lconvert',
'licheck_mac': 'licheck_mac',
'lprodump': 'lprodump',
'lrelease': 'lrelease',
'lrelea... |
# Generated by Django 3.2.9 on 2021-11-03 13:00
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_m... |
"""
Django settings for rushee_30170 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... |
#!/usr/bin/python2
"""
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"); yo... |
import asyncio
import tempfile
from decimal import Decimal
import os
from contextlib import contextmanager
from collections import defaultdict
import logging
import concurrent
from concurrent import futures
import unittest
from typing import Iterable, NamedTuple, Tuple, List
from aiorpcx import TaskGroup, timeout_afte... |
"""
Read AMF spreadsheet TSV files and produce YAML checks that can be used with
IOOS compliance-checker via the cc-yaml plugin and compliance-check-lib
"""
import sys
import os
import argparse
from amf_check_writer.spreadsheet_handler import SpreadsheetHandler
def main():
parser = argparse.ArgumentParser(descri... |
# 116. Populating Next Right Pointers in Each Node
# 117. Populating Next Right Pointers in Each Node II
# ttungl@gmail.com
# Given a binary tree
# struct TreeLinkNode {
# TreeLinkNode *left;
# TreeLinkNode *right;
# TreeLinkNode *next;
# }
# Populate each next pointer to point to its next r... |
#!/usr/bin/env python3
# Copyright (c) 2019-2021 The Danxome Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test danxomed aborts if can't disconnect a block.
- Start a single node and generate 3 blocks.
- Delet... |
from dataTool import ReadLabels, ReadXYZ, VisualizePointCloudClassesAsync, modelPath, DataTool
from imports import *
import math
import numpy as np
from time import time
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.utils import Sequence
from tensorflow.keras.layers impor... |
# 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 ... |
__all__ = [
'Features',
'Motif',
'__Empty__'
]
class Features:
""" Features: features of the motif -
pattern - sequence
rank - rank/priority/id (must be unique)
valid - valid motif or not (only for universal frequency)
"""
__slots__ = ('pattern', 'rank', 'valid')
p... |
import torch
import numpy as np
import torch.nn.functional as F
from ..src.Conv1DT_6 import Conv1DT as NumpyConv1DT
class Tester:
conv1dt_numpy = NumpyConv1DT()
def y_torch(self, x, weight, bias, stride, padding):
x = torch.tensor(x)
weight = torch.tensor(weight)
bias = torch.tensor(b... |
import os
import sys
from telethon.sessions import StringSession
from telethon import TelegramClient
from var import Var
from pylast import LastFMNetwork, md5
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import strtobool as sb
from pySmartDL import SmartDL
from dotenv import load_dotenv
i... |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... |
from configparser import ConfigParser
from appdirs import user_config_dir
from click.testing import CliRunner
from pyfakefs.fake_filesystem import FakeFilesystem
from firebolt_cli.configure import configure
from firebolt_cli.main import main
from firebolt_cli.utils import config_file, config_section, read_config
de... |
class Solution:
def oddCells(self, m: int, n: int, indices: List[List[int]]) -> int:
row=[0]*m
col=[0]*n
for r, c in indices:
row[r]+=1
col[c]+=1
result=0
for r in row:
for c in col:
if (r+c)%2==1:
result... |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 07 17:58:09 2017
@author: B907-LGH
"""
import theano
import theano.tensor as T
import numpy as np
# defining the tensor variables
X = T.matrix("X")
W = T.matrix("W")
b_sym = T.vector("b_sym")
results, updates = theano.scan(lambda v:T.tanh(
T.dot(v, W) + b_s... |
from django.contrib.auth import user_logged_out
from djet import assertions, restframework
from rest_framework import status
import djoser.constants
import djoser.utils
import djoser.views
from .common import create_user
class TokenDestroyViewTest(restframework.APIViewTestCase,
assertions.... |
#!/usr/bin/env python3
import sys
import ssl
import socket
import select
import threading
def connect(addr):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
s.connect((addr, 443))
s = ssl.wrap_socket(s)
return s
def pconnect(addr):
addr = addr.split(":")
s = socket.socket(socket.AF_IN... |
#
# Copyright (c) 2008-2016 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
class LocustError(Exception):
pass
class ResponseError(Exception):
pass
class CatchResponseError(Exception):
pass
class MissingWaitTimeError(LocustError):
pass
class InterruptTaskSet(Exception):
"""
Exception that will interrupt a User when thrown inside a task
"""
def __init__(... |
import re
# PART 1
def get_matching_words():
words = ["aimlessness", "assassin", "baby", "beekeeper", "belladonna", "cannonball", "crybaby", "denver", "embraceable", "facetious", "flashbulb", "gaslight", "hobgoblin", "iconoclast", "issue", "kebab", "kilo", "laundered", "mattress", "millennia", "natural", "obsessive"... |
import logging
import subprocess # nosec
import docker
import json
import os
import time
from checkov.common.bridgecrew.image_scanning.docker_image_scanning_integration import docker_image_scanning_integration
TWISTCLI_FILE_NAME = 'twistcli'
DOCKER_IMAGE_SCAN_RESULT_FILE_NAME = 'docker-image-scan-results.json'
def... |
#!/usr/bin/env python
"""
generate-all-graphs.py
python generate-all-graphs.py | gzip -c > all-graphs.gz
"""
import sys
import json
import itertools
import numpy as np
from tqdm import tqdm
from nasbench.lib import graph_util
from joblib import delayed, Parallel
max_vertices = 7
num_ops = 3
max_edges ... |
# Generated by Django 3.1 on 2020-08-06 19:34
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
import os, time, sys
from Plugins.Configs.Settings import *
def Apps():
clearConsole()
#Banner
Index_Banner()
print(Bright_Red +"Cryptic Hats Hackers Organizations")
print("Use This Apps To Change Members Phone, To")
print("Keep Members Busy With Cool Games, To learn")
print("Programming O... |
from sleekxmpp.test import *
from sleekxmpp.xmlstream.stanzabase import ElementBase
class TestElementBase(SleekTest):
def testFixNs(self):
"""Test fixing namespaces in an XPath expression."""
e = ElementBase()
ns = "http://jabber.org/protocol/disco#items"
result = e._fix_ns("{%s}... |
from typing import Dict, List, Any
import json
from e2e.Classes.Transactions.Data import Data
from e2e.Meros.RPC import RPC
from e2e.Meros.Liver import Liver
from e2e.Tests.Errors import TestError
def LowerHashTieBreakTest(
rpc: RPC
) -> None:
vectors: Dict[str, Any]
with open("e2e/Vectors/Consensus/Families/... |
def read_config_value(section, key):
from dataservices.utils.file_funcs import get_config
config = get_config()
return config[section][key] |
# Copyright (c) 2015 Huawei Technologies Co., Ltd.
# 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
#
# ... |
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compli... |
import re
#from IPython.core.debugger import Tracer
import src.experiment.utilities as util
# the maximum number of words in a sentence
MAX_SENTENCE_WORDS = 18
MAX_TOTAL_WORDS = 30
MAX_TOTAL_CHARS = 150
UPPERCASE_AS_NAMEENTITY = True
paren_patt = re.compile(r'\([^\)]*\)')
paren_patt2 = re.compile(r'\([^\)]{0,7}\)')
... |
# 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 ... |
from typing import Callable
import django
from django.http import HttpRequest
try:
from django.utils.datastructures import CaseInsensitiveMapping
except ImportError:
from .datastructures import CaseInsensitiveMapping
# HttpHeaders copypasted from django 3.0 codebase
class HttpHeaders(CaseInsensitiveMapping)... |
#!python3
import sys
# Used to generate output that my gnuplot will accept
lines = iter(sys.stdin)
next(lines)
lines = map(lambda s: s.split(), lines)
#0 Graph_name vertices edges g_phi h_phi timed_out
#6 spent_time allowed_time read_as_multi CASE best_cut_conductance
#11 best_cut_expansion edges_crossing size1 si... |
import grpc
from feast.protos.feast.serving.ServingService_pb2 import (
FeatureList,
GetOnlineFeaturesRequest,
)
from feast.protos.feast.serving.ServingService_pb2_grpc import ServingServiceStub
from feast.protos.feast.types.Value_pb2 import RepeatedValue, Value
# Sample logic to fetch from a local gRPC java ... |
import os, glob, time
import tensorflow as tf
import numpy as np
from skvideo.io import vread, vwrite
directory = 'test_set_results/'
TEST_RESULT_DIR = './result_MBLLVEN_raw_he2he/test/'
MAX_VAL = 255
sess = tf.Session()
t_vid1 = tf.placeholder(tf.uint8, [None, None, None, None])
t_vid2 = tf.placeholder(tf.uint8,... |
import os
import glob
import math
import hydra
import cv2
import numpy as np
from shapely.geometry import Polygon
import torch
from torch.utils.data import Dataset, DataLoader
import imgaug.augmenters as iaa
import pyclipper
import db_transforms
from utils import dict_to_device, minmax_scaler_img
class BaseDatasetI... |
# Copyright 2016 F5 Networks 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 writi... |
#!/usr/bin/python
#
# 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 ag... |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
import os
from pathlib import Path
from . import modules
from . import cls
from . import det
from . import seg
from .version import __version__, get_version
from .builder import build, build_workflow_hook
from .stage import... |
import os
from pathlib import Path
project_dir = os.path.split(os.path.dirname(__file__))[0]
project_dir_path = Path(project_dir)
src_dir = os.path.join(project_dir, "src")
src_dir_path = Path(src_dir)
ch_src_dir = lambda: os.chdir(src_dir) |
import json
import re
from pathlib import Path
from shutil import rmtree
from subprocess import PIPE, run
from typing import Generator
import pytest
import toml # type: ignore
import yaml # type: ignore
from pypj.exception import Emsg, PypjError
def prepare_tmp_dir(tmp: Path) -> None:
if tmp.exists():
... |
import os
import pandas
from functools import cached_property
from experimentator import StateLogger
import wandb
os.environ["WANDB_SILENT"] = "true"
os.environ["WANDB_START_METHOD"] = "thread"
class LogStateWandB(StateLogger):
best_report = {}
def __init__(self, criterion_metric=None, mode="online"):
... |
import json
import unittest
from secrets import token_bytes
from blspy import AugSchemeMPL, PrivateKey
from thyme.util.keychain import Keychain, bytes_from_mnemonic, bytes_to_mnemonic, generate_mnemonic, mnemonic_to_seed
class TesKeychain(unittest.TestCase):
def test_basic_add_delete(self):
kc: Keychain... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 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... |
# Generated by Django 3.1.4 on 2020-12-12 06:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
# 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 ... |
import os
import platform
import socket
from abc import ABCMeta, abstractmethod
from copy import deepcopy
from ..wptcommandline import require_arg # noqa: F401
here = os.path.dirname(__file__)
def inherit(super_module, child_globals, product_name):
super_wptrunner = super_module.__wptrunner__
child_globals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.