text stringlengths 3.07k 12.6k |
|---|
# --------------------------------------------------------
# Tensorflow Phrase Detection
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> based on code from <NAME>,
# <NAME>, and <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from _... |
"""
Internal module containing Robotcomm on-the-wire protocol constants and
helper classes. Some exmples:
>>> msg1 = Datagram(DatagramType.MSG, 'ch1', None, None, None, None)
>>> strmsg = str_from_datagram(msg1)
>>> print(strmsg)
3wIC,MSG,ch1,,,
<BLANKLINE>
>>> msg2 = datagram_from_str(strmsg)
... |
'''
Created on Jun 25, 2021
@author: willg
'''
from typing import List
import os
import discord
import common
import UtilityFunctions
main_help_file_list = ['main_help.txt']
tabling_help_file_list = ['tabling_help_1.txt', 'tabling_help_2.txt']
server_defaults_help_file_list = ['server_defaults_help.txt']
flags_help_... |
"""
3D Engine in Python
Created 16/08/19
Developed by <NAME>
A Simple 3D Engine to display a wire mesh and provide user controls to move and rotate around it.
Use WASD to move forward, backward and to the side. Use Q and E to move up and down.
Rotate around the cube with the mouse ESC to exit.
"""
import ... |
"""
Populate voyage data tables from CSV emails.
"""
from datetime import datetime
import email
import logging
import os
import re
from csv_email import CSVEmailParser
from settings import (
CSV_FOLDER, get_csv_file_types, get_database_client, get_email_client,
LOGGING_FORMAT, LOGGING_LEVEL
)
logger = logging.get... |
#!/usr/bin/python3
"""D-Cube Plotting."""
# Example:
#
# ./dcube.py --suite="rpludp" --x="SF" --y="reliability" --start=1 --end=5 --title="test" --out=home/mike/test
import pandas as pd
import baddplotter as bplot
import matplotlib.pyplot as plt # general plotting
import seaborn as sns
import numpy as np
import argp... |
# Copyright 2017 Open Source Robotics Foundation, 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... |
#
# 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... |
# -*- coding:utf-8 -*-
from itertools import chain
from django.core.urlresolvers import reverse
from django.forms import Select
from django.utils.encoding import force_unicode
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.forms.utils import flatatt, to_current_timezone
from dj... |
import numpy as np
import tensorflow as tf
import datetime, time, scipy.io
from model import *
from util import *
import cv2
# --------------------------------- HYPER-PARAMETERS --------------------------------- #
in_channels = 3
out_channels = 27
def gen_list(filename = ''):
with open( filename , 'r') as f:
... |
# Copyright 2019 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 agreed to in writing, ... |
# -*- coding: utf-8 -*-
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde.model import Config, Expando
from hyde.fs import *
def test_expando_one_level():
d = {"a": 123, "b": "abc"}
x = Expando(d)
assert x.a == d['a']
assert x.b == d['b']
def test_expando_two_levels():
d = {"a": 123, "... |
import random
import inspect
import uuid
# @Author: rchromik
# @Title: Simple example of Machine learning - Perceptron (https://en.wikipedia.org/wiki/Perceptron)
# simplest model of neural network - that contains just one neuron.
# @Description: Problem is simple - classify one point if it's about the y = x line or ... |
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
#FOR ANY D... |
from numba import jit, f8, guvectorize
from numba.types import UniTuple
from util.physics.drive_1d_solutions import (
State,
VelocityNegative,
Velocity0To1400Boost,
Velocity0To1400,
Velocity1400To2300,
BOOST_CONSUMPTION_RATE,
)
def wrap_state_at_velocity_step(cls):
"""Advances the state t... |
from gyomu.json import Json
from enum import Enum
from email.message import EmailMessage
from collections import namedtuple
SimpleTuple = namedtuple('SimpleTuple', ['arg1', 'arg2'])
class _User:
name = ""
def __init__(self, name):
self.name = name
def printName(self):
print("Name = " + s... |
from abyss import abyss_filter_t
import ida_lines, ida_name, ida_hexrays as hr, ida_pro
VAR_ASG_VAR_SUFFIX = "_"
VAR_ASG_CALL_PREFIX = "result_"
# mapping a type string representation to a deterministic name to use
VAR_ASG_CALL_DETERMINISTIC = {
"NTSTATUS": "status",
}
fDebug = False
def debug(msg):
... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import secrets
from .framework import challenge_params, challenge_state
from .framework import CHALLENGE_SUCCESS, CHALLENGE_FAIL
_log = logging.getLogger('liveness-backend')
POSE_EYS = ['OPEN', ... |
import json
import os
from behave import given, then, when
from helpers import (
aws_helper,
console_printer,
emr_step_generator,
file_helper,
invoke_lambda,
)
from datetime import datetime
import operator
CLUSTER_ARN = "ClusterArn"
COMPLETED_STATUS = "COMPLETED"
@given("I start the UC-FEATURE c... |
# Copyright 2020 Soil, Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with t... |
from simple_youtube_api.LocalVideo import LocalVideo
from simple_youtube_api.YouTubeVideo import YouTubeVideo
from simple_youtube_api import youtube_api
import time
import random
import argparse
import http.client
import httplib2
import typing
import os
import sys
import progressbar
from typing import List
from google... |
# lamoda
import numpy as np
from solvers.solver_helpers import NgramManager, morph, AbstractSolver
def parse_sentence(e):
last_word = ""
last_c = ""
arr = []
fl = 0
s = []
for c in e:
if c == "(" and last_c != ")":
fl = 1
if last_word != "":
s[... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
Jobtype class to create GenericJob type objects
"""
import importlib
import inspect
import os
from pyiron_base.job.u... |
#!/usr/bin/env python
"""
This demo implements FastText[1] for sentence classification.
FastText is a simple model for text classification with performance often close
to state-of-the-art, and is useful as a solid baseline.
There are some important differences between this implementation and what
is described in the ... |
# Copyright (c) 2018 Red Hat, Inc.
# All Rights Reserved.
# Python
import logging
# Django
from django.conf import settings
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _
# Django REST Framework
from rest_framework.exce... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 10:37:14 2019
@author: <NAME>
"""
import pandas as pd
import numpy as np
import seaborn as sns
import pickle
def titleNAxis(fig_plot, title, label_x, label_y):
"""enter title and axis labels with standard font sizes.
"""
fig_plot.set_title(... |
import paho.mqtt.client as mqtt
import atexit
import ssl
import json
from block import Block
from blockchain import Blockchain
from transaction import Transaction
from wallet import Wallet
from utility.constants import MQTT, SUN
from utility.verification import Verification
wallet = Wallet(SUN.ID, SUN.PRIVATE_KEY, ... |
from core.advbase import *
from slot.a import *
from slot.d import *
galex_conf = {
'x1.dmg': 82 / 100.0,
'x1.startup': 8 / 60.0,
'x1.recovery': 34 / 60.0,
'x1.hit': 1,
'x2.dmg': 88 / 100.0,
'x2.startup': 0,
'x2.recovery': 28 / 60.0,
'x2.hit': 1,
'x3.dmg': 104 / 100.0,
'x3.star... |
from __future__ import print_function
import abc
import itertools
from collections import namedtuple
import numpy as np
import theano
from theano import sparse as S
from theano import tensor as T
from . import utils
_SUPPORTED_FORMATS = set(["dense", "csc", "csr"])
Weights = namedtuple('Weights', ['w0', 'w1', 'v']... |
# Copyright 2018 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 a... |
import rasterio
import numpy as np
import pandas as pd
import skimage
import fiona
import pyproj
import glob
def to_single_geotiff(path_in, path_out):
""" Convert a folder of multiple geotiff images as a single multiband geotiff
INPUT : path_in (str) -> path to the input folder as (path_to_folder/../*.tiff... |
import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup
import xml.etree.ElementTree as ET
import random
import gzip
import xml.etree.ElementTree as ET
import os
import subprocess
import shutil
import json
import concurrent.futures
def get_valid_urls(url, break_url):
"""
Get valid... |
# -*- coding: utf-8 -*-
# Author : <NAME>
# Date : Feb 22 2014
"""
A set of number generator
"""
from sklearn.utils import check_random_state
from scipy.stats import norm
__all__ = ["NumberGenerator", "IntegerUniformGenerator", "OddUniformGenerator",
"GaussianNumberGenerator", "ClippedGaussianRNG",
... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from . import util
import os
IMAGES = {
# Used to build ChromeOS for Pixelbook in Debian9, to align GLIBC versions.
'Debian9': (
'gcr.io/ski... |
import pandas as pd
import numpy as np
import scipy as sc
from typing import Sequence
ACTIVITIES = ["Hiking","Running","Climbing","Biking","Volleyball","Football","Basketball","Ice-Hockey","Swimming","Kayaking","Sailing","Surfing","Skiing","Gym","Workout","Gymnastics","Acrobatics","Aerobic","Tennis","Yoga","Pilates",... |
# -*- coding: utf-8 -*-
#
# Copyright 2019-2020 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
"""
A neural network with a single layer that is trained to classify
the data using Tensorflow library. Plots the data, the loss function
and the model predictions.
Based on: https://github.com/IvanBongiorni/TensorFlow2.0_Notebooks
How to run
----------
See README.md
"""
import numpy as np
import os
import tensorfl... |
# ~ Area4 Package by RDIL ~
# Imports:
import random
# Package info variables:
name = "area4"
author = "https://github.com/RDIL"
author_email = "<EMAIL>"
description = "Dividers in Python, the easy way! Multiple different divider looks."
# Divider variables:
divider1 = str("------------------------")
divider2 = st... |
from contextlib import contextmanager
from pathlib import Path
from typing import Any, Dict, Iterator, List, Union, Optional, Callable, ContextManager
import os
import tempfile
from test_driver.logger import rootlog
from test_driver.machine import Machine, NixStartScript, retry
from test_driver.vlan import VLan
from t... |
from csv import DictWriter
from io import StringIO
from typing import Any, Dict, Iterable, List, Optional, Union
from flask import Response, jsonify, request, stream_with_context
from flask.json import dumps
import orjson
from ._config import MAX_RESULTS, MAX_COMPATIBILITY_RESULTS
from ._common import app, is_compati... |
from copy import deepcopy
from dataclasses import dataclass, field
import glob
from itertools import cycle
import os
import re
import shutil
from typing import List
import warnings
from pele_platform.Utilities.Parameters import parameters
from pele_platform.Utilities.Helpers import helpers
from pele_platform.Adaptive ... |
import torch
from torch import nn
from torch.nn import functional as F
import torch.utils.data
import torch.utils.data.distributed
from gan_training.models import blocks
class Generator(nn.Module):
def __init__(self,
nlabels,
conditioning,
z_dim=128,
... |
#!/usr/bin/env python
# encoding: utf-8
# <NAME>, 2016 (ita)
"""
Provide a scanner for finding dependencies on d files
"""
import re
from waflib import Utils
def filter_comments(filename):
"""
:param filename: d file name
:type filename: string
:rtype: list
:return: a list of characters
"""
txt = Utils.readf(... |
from collections import defaultdict
import numpy as np
import pandas as pd
import seaborn as sns
from statistics import mean, median, mode, StatisticsError
import matplotlib.pyplot as plt
from matplotlib import cm
def heat_map(df, num_scenarios):
fig, ax = plt.subplots(figsize=[18, 12])
plot = sns.heatmap(
... |
"""base.py: OMF Project and base classes for its components"""
import json
import properties
import properties.extras
class BaseModel(properties.HasProperties):
"""BaseModel is a HasProperties subclass with schema
When deserializing, this class prioritizes schema value over __class__
to decide the class... |
import numpy as np
import time
def timemeasure(func):
def wrapper(*args, **kargs):
start_time = time.perf_counter()
result = func(*args, **kargs)
end_time = time.perf_counter()
execution_time = end_time - start_time
print(f'Proc-time: {execution_time}')
return resul... |
from Data_treatment.DT_1 import StockData
import numpy as np
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from deap import base, creator, tools, algorithms
from scipy.stats import bernoulli
from bitstring import BitArray
from datetime import datetime
from keras.utils import to_cat... |
# Code for Circuit Playground Express Rocket Lamp
# A fun lighting project using Circuit Playground Express and NeoPixels
# Written by <NAME> for Adafruit Industries
# For full instructions see learn.adafruit.com/cpx-rocket-lamp !
# MIT License, see LICENSE for more info.
# import the libraries needed for this proj... |
""" Several utility functions. (1) show for loop progress (2) load color list"""
#!/usr/bin/python
from numpy import double
import sys
from time import time
def rb_perccount(jj,maxjj):
"""
-------------------------------------------------------------------
This code reports the percentage of a for loop d... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import re
import os
from ShaderConsts import ShaderConst
__author__ = 'wangguojin'
class HeaderHandleInfo(object):
headers = []
handled = False
def __init__(self):
pass
def __init__(self,headers,ok):
self.headers = headers
self.handled = ok
class ShaderRex(object):
__incR... |
#!/usr/bin/python3
from osgeo import ogr
import os
import numpy as np
import matplotlib.path as mpath
from collections import defaultdict as dd
import shapefile as pyshp
import matplotlib.path
import matplotlib.patches as mpatches
from methods import function
def open_shape(shapefile):
return pyshp.Reader(shapef... |
# Copyright (c) 2018, Stellapps Technologies Private Ltd.
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
user_email = frappe.get_doc("User",frappe.session.user).email
societyid = fra... |
import turtle
import random #We'll need this later in the lab
turtle.tracer(1,0) #This helps the turtle move more smoothly
SIZE_X=800
SIZE_Y=500
turtle.setup(1000, 1000) #Curious? It's the turtle window
turtle.penup() #size.
bord = turtle.clone()
bord.pensize("10")
bord.penup()
bord.goto(-4... |
"""TF record dataset."""
import contextlib
import math
import os
from distutils.version import LooseVersion
import tensorflow as tf
from ludwig.constants import NAME, PROC_COLUMN
from ludwig.data.batcher.iterable import IterableBatcher
from ludwig.data.dataset.base import Dataset
from ludwig.data.dataset.pandas impor... |
"""
SDSS Stripe 82 Moving Object Catalog
------------------------------------
Figure 1.12.
A multicolor scatter plot of the properties of asteroids from the SDSS Moving
Object Catalog (cf. figure 1.8). The left panel shows observational markers
of the chemical properties of the asteroids: two colors a* and i-z. The
ri... |
# Copyright 2019 The Texar 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 applicable ... |
# Sphinx extension to enable "literate modeling" features for REM.
import sys
import os
import sphinx.addnodes as addnodes
from sphinx.directives.other import TocTree
from sphinx.builders import Builder
from sphinx.util.nodes import inline_all_toctrees
from sphinx.writers.text import TextWriter
from sphinx.writers.htm... |
import sys
import pickle
import numpy as np
import nifty.graph.rag as nrag
import z5py
import luigi
from cremi_tools.viewer.volumina import view
from cluster_tools.morphology import MorphologyWorkflow
sys.path.append('../../')
def make_new_seg():
from paintera_tools import serialize_from_commit
path = '/g/ar... |
from django import forms
from django.forms.fields import EmailField
from django.urls import reverse
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.core.exceptions import ValidationError
from django.contrib.auth import authenticate
from django.contrib.auth.forms import UserCr... |
# ----------------------------------------------------------------------
# send_notifs.py
# Script that wraps core email notification logic - designed to be run
# on a regular interval.
#
# Approximate execution frequency: 2-5 minutes after the previous
# execution completion. The script itself can take a minute or two... |
try:
import gevent
from gevent.monkey import is_module_patched
except ImportError:
def is_module_patched(*_, **__):
return False
from logging import getLogger
import threading # this will be reloaded after patching
import time
import sys
from easypy.humanize import format_thread_stack
from ._... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Select the AMI from specified distro
>>> distro = 'ubuntu'
>>> profile = {'ec2_zone': 'us-west-1a'}
>>> get_ami(distro, profile)
'ami-3f94ca7a'
>>> distro = 'lucid'
>>> get_ami(distro, profile)
'ami-9991cfdc'
>>> distro = 'squeeze'
>>> profile['ec2_architecture'] =... |
from PySide2.QtWidgets import QUndoCommand
from custom_src.global_tools.class_inspection import find_type_in_object
from custom_src.NodeInstance import NodeInstance
class MoveComponents_Command(QUndoCommand):
def __init__(self, flow, items_list, p_from, p_to):
super(MoveComponents_Command, self).__init__... |
import socket
import re
import os
from threading import Thread, Timer
import time
import datetime
from util import trace, letterToCol, settings
from go_game import COLOR_BLACK, COLOR_WHITE, otherColor
from board_overlay import VariationOverlayGenerator
sabakiCom = None
class TwitchBot(Thread):
def __init__(... |
import pysam
import os
import gffutils
import sys
from operator import itemgetter
from itertools import *
import numpy as np
from random import choice
import argparse
#python3
#Given a gff of regions you care about (longest 3UTR, etc.), get conservation metrics on a gene by gene basis
def getexoniccoords(gff):
exo... |
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
import os
from string import ascii_letters
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq
try:
import tables # noqa F401
except ImportError:
pytest.skip(
"PyTabl... |
import math
import sys
from collections import namedtuple
from curses import wrapper
import time
HEIGHT = 30
WIDTH = 120
WIDTH_PLAYER = 5
WIDTH_BRICK = 5
NUM_BRICK_LINES = 6
V_MAX_PLAYER = 9
V_MAX_BALL = 10
A_MAX_PLAYER = 40
A_GAIN_PLAYER = 30
GameState = namedtuple('GameState', ['player', 'ball', 'bricks'])
c... |
from __future__ import print_function
#### BEGIN MOCKING REDDIT PACKAGE
import sys
try:
import rcssmin
except ImportError:
raise RuntimeError("rcssmin.py not downloaded from github@reddit/reddit")
class _i18n(object):
@staticmethod
def N_(arg):
return str(arg)
_ = N_
class _pylons(object... |
from header import *
from .utils import *
from .util_func import *
class BERTFTTimeDataset(Dataset):
def __init__(self, vocab, path, **args):
self.args = args
self.vocab = vocab
self.vocab.add_tokens(['[EOS]'])
self.pad = self.vocab.convert_tokens_to_ids('[PAD]')
self... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0131-Palindrome-Partitioning.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-01-05
===========================... |
"""
Some JSON encoding and decoding utilities
copyright (c) 2012 the icecube collaboration
"""
import json
from datetime import date,datetime,time
import base64
import zlib
import logging
class json_compressor:
"""Used for files and other large things sent over json.
Great for log fi... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import pandas as pd
import time
import csv
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
date = time.strftime("%Y%m", time.localtime())
EASY_PASSWORD = date + "_E... |
# This file is part of pyZohoAPI, Copyright (C) <NAME> 2021.
# Distributed under the MIT License (see http://opensource.org/licenses/MIT).
from pprint import pprint
import pytest
from pyzohoapi.inventory import ZohoInventory
from pyzohoapi.exceptions import ZohoException
from private import testdata
z = ZohoInvent... |
#!/usr/bin/env python3
# encoding: utf-8
from __future__ import annotations
import os
import sys
import json
import urllib.request, urllib.parse
# setup access to the local .site-packages
sys.path.insert(0, os.path.dirname(__file__) + "/.site-packages") # noqa
from workflow import Workflow3, ICON_WEB, ICON_INFO, ... |
"""Common fixes used for multiple datasets."""
import logging
import iris
import numpy as np
from scipy.ndimage import map_coordinates
from .fix import Fix
from .shared import (
add_plev_from_altitude,
add_scalar_typesi_coord,
fix_bounds,
)
logger = logging.getLogger(__name__)
class ClFixHybridHeightCo... |
import os
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
import warnings
import _thread
import skvideo.io
from queue import Queue, Empty
import moviepy.editor
import shutil
def transferAudio(sourceVideo, targetVideo):
tempAudioFileName = "./te... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import libs.common as common
import pandas as pd
import numpy as np
import math
import datetime
import heapq
### 对每日指标数据,进行筛选。将符合条件的。二次筛选出来。
def stat_all_lite(tmp_datetime):
# 要操作的数据库表名称。
table_name = "guess_indicators_lite_buy_daily"
datetime_str = (tmp_... |
# -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
import os
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
module_sema = threading.Semaphore()
def... |
from sympy.solvers import solve
from sympy import Symbol
import os, itertools, copy
import sys
class text_to_change(object):
def __init__(self, locator, text):
self.locator = locator
self.text = text
def __call__(self, driver):
actual_text = _find_element(driver, self.locator).text
... |
#!/usr/bin/env python
# ---------------------------------------------------------------------------
# Licensing Information: You are free to use or extend these projects for
# education or reserach purposes provided that (1) you retain this notice
# and (2) you provide clear attribution to UC Berkeley, including a lin... |
# opcode 1: 1 VARa VARb PTRc => *PTRc = VARa + VARb
# opcode 2: 2 VARa VARb PTRc => *PTRc = VARa * VARb
# opcode 3: 3 PTRa => *PTRa = input()
# opcode 4: 4 VARa => output(VARa)
# opcode 5: 5 VARa VARb => PC = VARb if VARa != 0
# opcode 6: 6 VARa VARb => PC = VARb if VARa == 0
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper module for performing MTSL GWAS inside of MTMLSEM model.
Note that this has little to do with MTMLSEM, it merely fits the classical LMM
model of the kind:
Y = X B + E + U,
where Y and X are deterministic data matrices, B is a matrix of regression
coefficient... |
import os
import sys
import colorama
from colorama import init, Fore
init(convert=True)
import requests
import json
import string
import random
import time
import datetime
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW(f"CC Generator | github.com/TheGodVanis")
class Gen:
def __init_... |
from __future__ import print_function, division, absolute_import
import sys
import numpy as np
from numba import jit, numpy_support, types
from numba import unittest_support as unittest
from numba.compiler import compile_isolated
from numba.utils import IS_PY3
def get_a(ary, i):
return ary[i].a
def get_b(ary,... |
#!/usr/bin/env python
# coding: utf-8
"""
File Name: eval_knn.py
Author: <NAME>
E-mail: <EMAIL>
Created on: Mon Jan 4 10:36:31 2016 CST
"""
DESCRIPTION = """
"""
import os
import argparse
import logging
import numpy as np
from scipy.io import loadmat
from bottleneck import argpartsort
def runcmd... |
from pathlib import Path
from music21 import *
p = Path('/Users/Cuthbert/Desktop/Norman_Schmidt_Chorales')
pOut = p.parent / 'Out_Chorales'
def run():
files = list(p.iterdir())
filenames = [fp.name for fp in files]
pos = 0
for c in corpus.chorales.Iterator():
cName = c.filePath.name
... |
########################################################################
#
# Wrapper for ODD discrimination algorithm build on DEAP library (http://deap.readthedocs.org/en/latest/api/algo.html)
#
########################################################################
# Add main directory to enable imports
if __name_... |
import json
import signal
from functools import wraps
from time import time
import warnings
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
warnings.simplefilter("ignore")
class TimeoutException(Exception):
pass
def timeout_handler(signum, frame):
raise TimeoutException
signal.si... |
# -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 2.1.3
# Copyright (C) 2019-2020 Dell Inc. or its subsidiaries. All Rights Reserved.
# 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_functio... |
import os, time, json, operator, logging
import fresh_eyes_server as fe
import numpy as np
from flask import request
from PIL import Image
from tensorflow.python.keras.applications.resnet50 import ResNet50, preprocess_input
from tensorflow.python.keras.preprocessing import image
import os, glob, io
import base64
print... |
# -*- coding: utf-8 -*-
import psutil
from app.base.utils import tp_timestamp_ms
from app.const import *
from app.base.wss import tp_wss
from app.base.cron import tp_cron
from app.model import stats
class TPStats(object):
_INTERVAL = 5 # seconds
def __init__(self):
super().__init__()
... |
import torch
import torch.nn as nn
import functools
def spectral_norm(module, mode=True):
if mode:
return nn.utils.spectral_norm(module)
return module
class InpaintDiscriminator(nn.Module):
def __init__(self, in_channels, use_sigmoid=True, use_spectral_norm=True, init_weights=True):
super(... |
from typing import *
from flask_unchained.string_utils import pluralize
from py_meta_utils import McsArgs, MetaOption, _missing
from .attr_constants import CONTROLLER_ROUTES_ATTR, REMOVE_SUFFIXES_ATTR
from .constants import ALL_RESOURCE_METHODS, RESOURCE_INDEX_METHODS
from .constants import CREATE, DELETE, GET, LIST,... |
from enigma import *
def print_options(options):
for i, v in enumerate(options):
name = v[0]
print("{0}. {1}".format(i+1, name))
def ask_input(text, maxcount):
while True:
try:
value = input(text)
value = int(value) - 1
if value < 0... |
import random
import math
from typing import List
import numpy as np
import matplotlib.pyplot as plt
from hashSuggested import hash_A
from rhoSuggested import rho
def f(x, m_fit):
res1 = ((x*0xbc164501) & 0x7fffffff) >> m_fit
return res1
A = [0x21ae4036,
0x32435171,
0xac3338cf,
0xea97b40c,
0x... |
from tkinter import *
import sqlite3
from config_database import inserir, deletar
from PIL import ImageTk, Image
root = Tk()
root.geometry("500x300")
root.title("FlashCards")
root.iconbitmap("laptop_computer_files_archive_documents_pc_icon_179700.ico")
# variáveis globais
tu_at = 0 # Tupla Atual
# funções
def carrega... |
"""Main functions for the use by end users.
"""
import pandas as pd
from pathlib import Path
from wbib import queries, render
from wikidata2df import wikidata2df
from jinja2 import Environment, PackageLoader
env = Environment(
loader=PackageLoader("wbib", "templates"),
)
DEFAULT_QUERY_OPTIONS = {
"map of in... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Detection Testing Script.
This scripts reads a given config file and runs the evaluation.
It is an entry point that is made to evaluate standard models in FsDet.
In order to let one script support evaluation of many models,
this script contain... |
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from xgboost import XGBRegressor
from sklearn.pipeline import Pipeline
from sklearn.model_selection import RandomizedSearchCV, cross_validate
import hospice_project.definitions as defs
import hospice_project.data.transformers as t
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.