text stringlengths 3.07k 22.1k |
|---|
#############################
# <NAME> #
# 191524023 #
#############################
# NEEDED TO BE UPDATED
# - Refactor code
# - Load gif in canvas
# import needed package
import cv2, os, imageio, numpy as np
from tkinter import *
from tkinter import filedialog
from PIL import ImageTk, Image
from sv... |
from datetime import datetime
from bioseq.models.Taxon import Taxon
from django.db import models
# class CustomBinaryCharField(models.CharField):
# def db_type(self, connection):
# return super(CustomBinaryCharField, self).db_type(connection) + ' binary'
class PDB(models.Model):
id = models.AutoFie... |
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2021-12-31T02:45:53+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Annotated, Any, List, Optional
from pydantic import BaseModel, Field, SecretStr
class BadRequestException(... |
#!/usr/bin/env python
"""Backend s3 uses a S3 interface to store the dataset and chunks data"""
import logging
import numpy as np
import boto3
from botocore.exceptions import ClientError
from dosna.backends import Backend
from dosna.backends.base import (BackendConnection, BackendDataChunk,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is the main module for adding photometry information given a spectrum(grism id)
@author: caganze
"""
from .initialize import *
from astropy.io import ascii
from astropy.table import hstack, Table, vstack
import glob
from .spectrum_tools import *
from .imag... |
from math import pi
import time
from random import uniform as r_uni
from random import triangular as r_tri
from random import choice as r_choice
import pandas as pd
import numpy as np
import odrive
from odrive.enums import *
import robo
import calibrate
import configure
import trajectory
import plots
### EXECUTION TI... |
import json
import argparse
import sys
import glob
import os
import datetime
from pycocotools import mask
import imagesize
import random
import shutil
from PIL import Image, ImageDraw
def parse_args():
parser = argparse.ArgumentParser(description='End-to-end inference')
parser.add_argument('--afp_image_dir', ... |
import os
import json
import logging
import numpy as np
from abc import *
from typing import *
from cfdata.tabular import task_type_type
from cfdata.tabular import parse_task_type
from cfdata.tabular import KRandom
from cfdata.tabular import TabularDataset
from cftool.misc import update_dict
from cftool.misc import ... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys
sys.path.append("../scripts/")
from robot import *
from scipy.stats import multivariate_normal
import random
import copy
# In[2]:
class Particle:
def __init__(self, init_pose, weight):
self.pose = init_pose
self.weight = weight
... |
"""Classes to describe different kinds of possible event."""
import asyncio
import io
import logging
from abc import ABCMeta
from collections import defaultdict
from datetime import datetime
from random import randrange
import aiohttp
import puremagic
from get_image_size import get_image_size_from_bytesio
from opsdro... |
#!/usr/bin/env python
try:
import http.server as server
except ImportError:
import BaseHTTPServer as server
import getopt
import re
import sys
try:
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError, URLError
from urllib.... |
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import matplotlib.pyplot as plt
import ete3, os, subprocess
from ete3 import Tree, faces, TreeStyle
def group_color(name):
name = name.lower()
if name in ["heterocephalus_glaber", "fukomys_damarensis", "cavia_porcellus... |
"""Test arg parser combinators."""
import collections
import math
import shlex
import typing as t
from hypothesis import given, strategies as st
import pytest
from genbu import combinators as comb
def as_tokens(source: t.Union[str, t.Iterable[str]]) -> comb.Tokens:
"""Convert source into Tokens."""
if isin... |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
from PIL import ImageGrab, Image
import random
import csv
import copy
import pandas as pd
import pyautogui
import collections
import cv2
import numpy as np
from itertools import product
random.seed(0)
HIGHT, WIDTH = 15, 23
# ! TODO
# スクショ範囲を実行時に指定
# 1マスのサイズと左上の初期位置を実行時に指定する
# durationを変更可能にする
# --init: オプションで各座標を取得... |
from code import app
from flask import request
from code.sql_query_builder import SQLQueryBuilder as query
from code.database import Database as database
class Main():
def __init__(self):
self.html = self.buildHTML()
def buildHTML(self):
return """
<!DOCTYPE html>
<html lang="e... |
# DJ Hero 2 IMG Extractor
# Original code from ArchiveExplorer by maxton
# https://github.com/maxton/GameArchives/
# Ported to Python by shockdude
import os, sys
import struct
import time
IMG_EXT = ".img"
PART0_EXT = ".part0"
PART1_EXT = ".part1"
def usage():
filename = os.path.basename(sys.argv[0])
... |
#!/usr/bin/env python3
# adpated from https://github.com/lzx551402/contextdesc/blob/master/image_matching.py
"""
Copyright 2019, <NAME>, HKUST.
Image matching example.
"""
import sys
sys.path.append("../../")
import config
config.cfg.set_lib('contextdesc',prepend=True)
contextdesc_base_path='../../thirdparty/contex... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sudoku import (is_valid, find_next_position, find_empty_cell,
solve_sudoku, board_to_str, row_to_pretty_str, board_to_pretty_str)
import unittest, copy
class IsValidTest(unittest.TestCase):
def setUp(self):
self.board = [[None for i in range(9)] for ... |
#Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... |
# -*- coding: utf-8 -*-
import datetime
import pathlib
import pickle
import numpy as np
import torch as t
from torch.optim import Adagrad, lr_scheduler, AdamW, Adam
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from ai2v_model import AttentiveItemToVe... |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""
Generate HTML documentation from validated dashboard Hjson tree
"""
import html
import logging as log
import os.path
import re
import sys
import hjson
import mistletoe... |
"""
Physics engines for top-down or platformers.
"""
# pylint: disable=too-many-arguments, too-many-locals, too-few-public-methods
import math
# import time
from arcade import check_for_collision_with_list
from arcade import check_for_collision
from arcade import Sprite
from arcade import SpriteList
from ... |
#!/usr/bin/env python
# coding: utf-8
# # Fetch and export SNOTEL sites and daily time series data
# In[1]:
from collections import OrderedDict
import numpy as np
import pandas as pd
import geopandas as gpd
from shapely import geometry as sgeom
import ulmo
import json
import requests
# In[2]:
##################... |
#!/usr/bin/python3
# <NAME> Twitter Bot
# Written by: <NAME>
# Last Revision: 3/11/17
import tweepy, sys, os, json, random, time, re, pyjokes
# Retrieve credentials from environment variables
consumer_key = os.environ.get('consumer_key')
consumer_secret = os.environ.get('consumer_secret')
access_token = os.environ.g... |
from flask import Flask, request, jsonify
import os, sys
import logging
import config
from flask import jsonify, g
import sqlite3
import uuid
##############
# INIT CONFIG
##############
CONFIG = config.load_config(os.environ.get('ENVIRONMENT', "DEBUG"))
app = Flask(__name__)
handler = logging.StreamHandler(stream=sys... |
import subprocess, sys, shutil, os
from art import text2art
from prompt_toolkit import Application
from prompt_toolkit.layout import WindowAlign
from prompt_toolkit.widgets import MenuContainer, TextArea
from prompt_toolkit.layout.containers import Window, HSplit, VSplit
from prompt_toolkit.layout.controls import Form... |
#!/usr/bin/env python3
# 6.0001
# Problem Set 5 Test Suite
import unittest
from ps5 import *
from datetime import timedelta
class ProblemSet5NewsStory(unittest.TestCase):
def setUp(self):
pass
def testNewsStoryConstructor(self):
story = NewsStory('', '', '', '', datetime.now())
def testN... |
import collections
import os
import time
import threading
import numpy as np
import pytest
from jina import Document, Flow, Executor, requests
cur_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture
def config(tmpdir):
os.environ['JINA_REPLICA_DIR'] = str(tmpdir)
yield
del os.environ['JINA... |
# Copyright 2014-2021 The aiosmtpd Developers
# SPDX-License-Identifier: Apache-2.0
import asyncio
import logging
import multiprocessing as MP
import os
import time
from contextlib import contextmanager
from multiprocessing.synchronize import Event as MP_Event
from smtplib import SMTP as SMTPClient
from smtplib import... |
import sys
import os
import time
from math import floor
import psutil
import startin
import numpy as np
from heapq import heappop, heapify
from multiprocessing import cpu_count, Process, Queue, current_process, Lock
from scipy.spatial import KDTree
RECALCULATION_INTERVAL_STEP_SIZE = 1/2
RECALCULATION_INTERVAL_UPPE... |
from argon2 import low_level
from nacl.secret import SecretBox
from nacl.exceptions import CryptoError
from hashlib import blake2b
from base64 import urlsafe_b64encode, b64encode, b64decode
import json
from zlib import decompress as inflate, compressobj as deflate_obj, MAX_WBITS, Z_BEST_COMPRESSION
from novelai_api.K... |
#!/usr/bin/python
# Library for PiMotor Shield V2
# Developed by: SB Components
# Author: Ankur
# Project: RPi Motor Shield
import RPi.GPIO as GPIO #Import GPIO library
import time
from time import sleep
GPIO.setmode(GPIO.BOARD) #Set GPIO pin numbering
GPIO.setwarnings(Fa... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import deque
from numbers import Number
import numpy as np
from mo.graph.graph import Graph, Node
def compare_node(node_ref, node, ref_attr_value, attr_value, attr, errors_list: list):
from mo.utils.ir_engine.ir_... |
import abc
from datetime import timedelta
from .opcodes import OpCode
from .events import Event
from .exception import WebSocketLoginFailure
from .utils import split_skip_empty_parts
from .message import Message
from .channel import Channel
from .tags import Tags
from.capability import Capability, CapabilityConfig
LF... |
# -*- coding: utf-8 -*- #
"""
Created on Sat Aug 13 16:00:19 2016
@author: wcgrizolli
"""
#==============================================================================
# %%
#==============================================================================
import numpy as np
from numpy.fft import fft2, ifft2, fftfreq... |
# -*- coding: utf-8 -*-
"""lpjguesstools._tpi: topographic position index computations according to Weiss 2001."""
# (T)opographic (P)osition (I)ndex calculations
#
# according to: <NAME>.: Topographic position and landforms analysis, pp. 200–200. 2001.
import logging
import math
import numpy as np
import os
from sci... |
"""
Creates a MobileNetV2 Model as defined in:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>. (2018).
MobileNetV2: Inverted Residuals and Linear Bottlenecks
arXiv preprint arXiv:1801.04381.
import from https://github.com/tonylins/pytorch-mobilenet-v2
"""
import torch.nn as nn
import math
import torch
import torch.nn as nn
i... |
###
# (C) Copyright [2019-2020] Hewlett Packard Enterprise Development LP
#
# 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 ... |
import os, copy, torch
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torch.nn.functional as F
from torch.autograd import Variable
from collections import OrderedDict
import torchvision
from torchvision import datasets, mo... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 10:22:55 2020
@author: cheritie
"""
from AO_modules.calibration.CalibrationVault import calibrationVault
from AO_modules.calibration.InteractionMatrix import interactionMatrix,interactionMatrixFromPhaseScreen
from AO_modules.MisRegistration import MisRegistr... |
"""
SmileBot
@egregors, @cpro29a 2019
https://github.com/egregors/smile-bot
"""
import datetime
import functools
import logging
import os
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, BaseFilter
from telegram.ext.dispatcher import run_async
DEBUG = os.getenv("DEBUG", False)
... |
from sympy.combinatorics.graycode import GrayCode
from itertools import permutations
import numpy as np
import warnings
import pyphi
import pandas as pd
import time
import sys
start = time.time()
################
# Terminal input:
# **.py start end total filename
# Note: the end is not included
################
star... |
import baselines.common.tf_util as U
from baselines.common.mpi_running_mean_std import RunningMeanStd
import tensorflow as tf
import gym
from baselines.common.distributions import make_pdtype
import numpy as np
import pdb
import datetime
def dense3D2(x, size, name, option, num_options=1, weight_init=None, bias=True):... |
#!/usr/bin/env python3
#
# Copyright 2016 Red Hat, Inc.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
import urllib.request, urllib.parse, urllib.error
from django.shortcuts import render
from django.template i... |
import sys
sys.path.insert(0, '/home/emmanuel/projects/2019_sakame/src/')
sys.path.insert(0, '/home/emmanuel/code/py_esdc')
from data.make_dataset import ESDCData
from models.esdc_sampling import SamplingModel
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error, mean_squ... |
import cv2
import threading
from copy import deepcopy
from screen import convert_screen_to_monitor, grab
from typing import Union
from dataclasses import dataclass
import numpy as np
from logger import Logger
import time
import os
from config import Config
from utils.misc import cut_roi, load_template, list_files_in_fo... |
from collections import namedtuple
from datetime import date, timedelta
import os
import tempfile
import shutil
import filecmp
from pandas import to_numeric
from django.test import TestCase
from django.conf import settings
import numpy as np
from funding.models import FundingSource
from priority.management.commands.... |
from __future__ import absolute_import
from itertools import chain
from six.moves import range, reduce
import os
import re
import numpy as np
import tensorflow as tf
import codecs
import sys
from tqdm import tqdm
import pickle
import logging
class Dataset():
def __init__(self, data='data/tasks_1-20_v1-2/en/',ts_num... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
from fractions import Fraction as Q
from sys import stderr, stdin
from parsimonious.grammar import Grammar, NodeVisitor
grammar = Grammar(r"""
program = line*
line =
space? (label space?)?
(statement (space? ',' space? statement)* space?)?
comment? end_of_line
statement = constan... |
# ------------------------------------------------------------------------------
# IMPORTS
# ------------------------------------------------------------------------------
import win32com.client
from win32com.client import constants
import traceback
from static import *
from common import *
# -------------... |
import rospy
import rospkg
import argparse
import bisect
import numpy as np
import pylab as pl
import time
import logging
import pickle
import os
import progressbar
from planner_comparison.plan_scoring import *
from planner_comparison.RosbagInterface import *
# Deep motion planner
from deep_motion_planner.tensorflow... |
import itertools
import pathlib
import re
import subprocess
import sys
import tempfile
import dwys
from invoke import task
import known
substitutions = {
"# nolint": "",
"prob.solve(pulp.apis.PULP_CBC_CMD(msg=False))": "prob.solve()",
", warn.conflicts = FALSE, quietly = TRUE)": ")",
... |
import torch
import cv2
import base64
import numpy as np
import yaml
from statistics import median
from easydict import EasyDict
def load_setting(setting):
with open(setting, 'r', encoding='utf8') as f:
cfg = yaml.load(f, Loader=yaml.FullLoader)
return EasyDict(cfg)
class CTCLabelConverter(object):
... |
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
import bisect
import imp
import warnings
import six
from .compat import lru_cache
from .extern import semver
from . import tagged
from . import... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: EDEF file handler
Endpoint Description Extender Format (EDEF) is specified in OSGi Compendium
specifications, section 122.8.
:author: <NAME>
:copyright: Copyright 2020, <NAME>
:license: Apache License 2.0
:version: 1.0.1
..
Copyrig... |
# -*- coding: utf-8 -*-
# This code is a part of BELA package: https://github.com/letuananh/bela
# :developer: <NAME> <<EMAIL>>
# :license: MIT, see LICENSE for more details.
"""
Lexical Analyser
"""
import logging
from pathlib import Path
from collections import defaultdict as dd
from collections import Counter
fr... |
# coding: utf-8
import json
from bottle import Bottle
from flask import Flask
from pyramid.config import Configurator
import pytest
from webtest import TestApp
from example.fake_api.bottle_api import BottleController
from example.fake_api.flask_api import FlaskController
from example.fake_api.pyramid_api import Pyram... |
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from tqdm import tqdm
# In[2]:
# make dictionarys for input and output
def make_dictionary (fname):
content = []
with open(fname, 'r') as f:
content = [line.rstrip() for line i... |
import json
import os
from pathlib import Path
import jmespath
import logging
import re
import yaml
from yaml import YAMLError
from checkov.cloudformation.parser import cfn_yaml
from checkov.cloudformation.context_parser import ContextParser
from checkov.common.parsers.node import DictNode, StrNode
logger = logging... |
#81115 <NAME>
#Algoritmo de Luhn
def last_digit(cc):
'''Recebe uma cadeia de caracteres que representa um numero e devolve o ultimo digito'''
last = eval(cc)%10
return last
def remove(cc):
'''Primeiro passo do Algoritmo de Luhn: Recebe como argumento uma cadeia de caracteres que representa um numero ... |
import os
import weakref
import numpy as np
from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch
from yt.data_objects.static_output import Dataset
from yt.funcs import just_one, setdefaultattr
from yt.geometry.grid_geometry_handler import GridIndex
from yt.units.dimensions import dimensionless as symp... |
#!/usr/bin/env python
#
# Upgrade the OpenStack with Clustering Status Control.
# Usage: $ ./do-upgrade.py -o cloud:xenial-newton [application-name]
#
import argparse
import logging
import six
import subprocess
import time
import yaml
logging.basicConfig(
filename='os-upgrade.log',
level=logging.DEBUG,
f... |
import re
from django.db import models
from django.db.models import QuerySet, Q
from django.utils import timezone
from django.contrib.postgres.fields import ArrayField
from dateutil.parser import parse as parse_date
from backend.models import PlayerCube, EditableModel
INTERVAL_REGEXP = re.compile(r'^((?P<days>-?\d+)... |
from __future__ import print_function
import logging
import pytest
try: # python 3.3+
from inspect import signature, Parameter
except ImportError:
from funcsigs import signature, Parameter
from decopatch import function_decorator, WRAPPED, F_ARGS, F_KWARGS, DECORATED
from makefun import wraps, add_signatur... |
import numpy as np
import cv2
import os
from keras.applications import VGG19
from keras.models import Model
from keras.optimizers import Adam
from keras.layers import Input, Conv2D, LeakyReLU, BatchNormalization, Dense, PReLU, Add, UpSampling2D
from tqdm import tqdm
def plot_images(lr_images,
sr_imag... |
#!/usr/bin/python
from array import array
from fcntl import ioctl
import struct
from collections import namedtuple
import io
import os.path
EVIOCGID = 0x80084502
EVIOCGNAME = 0x80ff4506 # len=255
Event = namedtuple('Event', 'tv_sec tv_usec evtype code value')
class Device(object):
_event_struct = struct.Str... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
import numpy as np
import matplotlib.pyplot as plt
import torch
import cv2
from tensorboardX import SummaryWriter
label_colors_list = []
def set_colors_list(colors_list):
global label_colors_list
label_colors_list = colors_list
# all the classes that are present in the dataset
ALL_CLASSES = []
def set_all_cl... |
# -*- coding: utf-8 -*-
import ast
from typing import ClassVar, Mapping, Optional, Sequence, Union
from typing_extensions import final
from wemake_python_styleguide.compat.aliases import ForNodes, FunctionNodes
from wemake_python_styleguide.logic.collections import normalize_dict_elements
from wemake_python_stylegui... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to using quantities/units on parameters of models.
"""
import numpy as np
import pytest
from ..core import Model, Fittable1DModel, InputParameterError
from ..parameters import Parameter, ParameterDefinitionError
from ..models impo... |
from modules import *
import pkgutil
import re
def make_views():
view_str = "# This is an autogenerated file. DO NOT EDIT!!!\n\n"
view_str += "from flask import Response, make_response, Request, request, session, stream_with_context\n"
view_str += "from application import application\n"
view_str += "im... |
# Copyright (c) 2020 UT Longhorn Racing Solar
import csv
import random
import os
import threading
import fcntl
import config
import ltc6811
import logging
"""
This module generates Voltage and Temperature
values as they would be read by the LTC6811s
"""
# path/name of file
# POV is of BSP_SPI, not SPI.py so that's w... |
import asyncio
from io import StringIO
from unittest import mock, TestCase
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from aries_cloudagent import messaging
from aries_cloudagent.messaging.connections.models.diddoc import (
DIDDoc,
PublicKey,
PublicKeyType,
... |
# -*- coding: utf-8 -*-
# Owner(s): ["module: unknown"]
import itertools
import logging
import re
import torch
from torch import nn
from torch.ao.sparsity import BaseSparsifier, WeightNormSparsifier, FakeSparsity
from torch.nn.utils.parametrize import is_parametrized
from torch.testing._internal.common_utils import ... |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import numpy as np
from typing import Dict, List, Optional, Tuple
import torch
from torch import nn
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.data.detection_utils import convert_image_to_... |
import numpy as np
#import random
#import os, sys
#import dill
#import IPython
#import datetime, time
#from datetime import datetime
#from time import gmtime, strftime
# Load MIR Libries
#import librosa # MIR library
#import madmom # MIR Library
#import pydub # MIR Libra... |
from flask import Flask,render_template,request
import os
import sys,tweepy,csv,re
from textblob import TextBlob
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS
import pandas as pd
import urllib.request
import urllib.parse
#import shutil
app = Flask(__name__)
def percentage(part, whol... |
#!/usr/bin/env python
"""
Unofficial Python API for ThePirateBay.
@author <NAME>
@email <EMAIL>
"""
from __future__ import unicode_literals
import datetime
import dateutil.parser
from functools import wraps
from lxml import html
import os
import re
import sys
import time
from .utils import URL
from requests impor... |
# coding: utf-8
import os
import time
import math
import argparse
import traceback
import subprocess
import numpy as np
from jamo import h2j
import tensorflow as tf
from datetime import datetime
from functools import partial
from hparams import default_hparams, hparams_debug_string
from tacotron2 import ... |
#!/usr/bin/env python
#
# Copyright (C) 2009 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 ... |
import textwrap
import string
from .. import restrictions
from .. import errors
from . import nodes
# to accept "inf" and "-inf"
NUMBER_VALID_VALS = string.digits + "-" + "inf"
VARIABLE_VALID_VALS = NUMBER_VALID_VALS + string.ascii_letters + "-_"
# basically, if something cannot be parsed as a number,
# we assume it ... |
"""Symbolic JME model common code."""
import collections
import functools
import numpy as np
import sym2num.model
import sym2num.var
import sympy
from ceacoest import utils, rk
class ModelSubclass(sym2num.model.Base):
"""Symbolic LGL-collocation JME model base."""
@property
def derivatives(self):... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Backward compatibility of configs.
Instructions to bump version:
+ It's not needed to bump version if iOD keys are added.
It's only needed when backward-incompatible changes happen
(i.e., some existing keys disappear, or the meaning of a ke... |
from sympy import symbols, Mul, sin, Integral, oo, Eq, Sum
from sympy.core.expr import unchanged
from sympy.stats import (Normal, Poisson, variance, Covariance, Variance,
Probability, Expectation)
from sympy.stats.rv import probability, expectation
def test_literal_probability():
X = Norm... |
# Copyright 2018, <NAME>, mailto:<EMAIL>
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
#!/usr/bin/env python
import sys
sys.path.append("..")
from dataloader import dataloader_dist
from models import magface_dist
from utils import utils
from torch.cuda.amp import autocast
from torch.cuda.amp import GradScaler
import numpy as np
import torchshard as ts
from collections import OrderedDict
from termcolor i... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import requests
import json
import random
import shutil
import os
import functools
SEND_API_ENDPOINT = "https://graph.facebook.com/v11.0/me/messages"
class Message(object):
"""
Message class to encapsulate a message.
:param type: Type of message. Valid values are 'RESPONSE', 'UPDATE' and 'MESSAGE... |
#!/usr/bin/python2.4
#
# Copyright 2009 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... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 ... |
from uqcsbot import bot, Command
from uqcsbot.utils.command_utils import loading_status
from urllib.request import urlopen
import xml.etree.ElementTree as ET
from datetime import datetime as DT
from typing import Union, Tuple
def get_xml(state: str) -> Union[None, ET.Element]:
"""
Get BOM data as an XML for a... |
"""
Klassifizieren der Seiten durch eine SVM:
"""
import config
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score, make_scorer
from sklearn.metrics i... |
"""S6 services management.
"""
import abc
import errno
import logging
import os
import sys
import enum
from treadmill import fs
from ._utils import (
data_read,
data_write,
environ_dir_read,
environ_dir_write,
script_read,
script_write,
set_list_read,
set_list_write,
value_read,
... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import re
from typing import List, NamedTuple
import numpy as np
from iopath.common.file_io import g_pathmgr
from vi... |
#!/usr/bin/env python3
import argparse
import os
import jsonlines
from tqdm import tqdm
import json
import pprint
import pandas as pd
import gzip
def is_gzipped(path):
with open(path, "rb") as f:
return f.read(2) == b'\x1f\x8b'
def main(args):
open_fn = gzip.open if is_gzipped(args.input_file) else ... |
"""
.. currentmodule:: cockatoo.utilities
.. autosummary::
:nosignatures:
blend_colors
break_polyline
map_values_as_colors
tween_planes
is_ccw_xy
resolve_order_by_backtracking
"""
# PYTHON STANDARD LIBRARY IMPORTS ---------------------------------------------
from __future__ import absolu... |
from ctypes import CDLL, c_bool, c_wchar_p, c_int, c_ubyte, sizeof, c_void_p
from logging import getLogger
from os import environ
from platform import architecture
from sys import maxsize
from typing import List, Tuple, Optional
from PIL import Image
LOG = getLogger(__name__)
# LCD types
TYPE_MONO = 1
TYPE_COLOR = 2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.