text stringlengths 3.07k 12.6k |
|---|
from copy import deepcopy
from extra_layers.Clip import Clip
from extra_layers.CustomObjects import extra_custom_objects
from extra_layers.OutputSplit import OutputSplit
from tensorflow.keras.models import Model
def convert_blob(in_item):
if type(in_item) == list:
out_item = in_item
else:
out... |
# Copyright 2016 - Nokia Corporation
#
# 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 ... |
"""Library for curses menus.
Attributes:
KEY_ESC (int): Unicode code point of ``ESC`` key.
"""
# Copyright 2019 IBM Corp.
#
# 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 o... |
import os
import sys
import numpy as np
class Action:
def __init__(self):
# a and b ==> 0 and 1
self.n = 5
# Action VALUES // NORTH, EAST, SOUTH, WEST
self.values = [(0, -1), (1, 0), (0, 1), (-1, 0), (0, 0)]
def sample(self):
s = np.random.randint(0, self.n)
r... |
#Python modules
###wrapper for subprocess command
def runsubprocess(args,verbose=False,shell=False,polling=False,printstdout=True,preexec_fn=None):
"""takes a subprocess argument list and runs Popen/communicate or Popen/poll() (if polling=True); if verbose=True, processname (string giving command call) is printed ... |
import os
import requests
import json
import uuid
import shortuuid
import hashlib
from datetime import date
from .model import add_new_image
from .model import get_images
from .model import get_all_messages
from .model import get_messages
from .model import add_new_message
from .model import current_message_exist
from ... |
################################################
# VIEWS #
# Used for displaying things to users #
# Uses models to get stuff to show #
################################################
from flask import Flask, render_template, request, make_response, redirect,... |
import numpy as np
import time
from library.optimiser import *
from library.post_analysis import *
from library.experiments import *
def do_multiple_exps(obj, opt, zoneParas):
# init multiple experiments
mexps = multiple_experiment()
# init one experiment
exp = single_experiment()
# One exper... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import struct
import onmt
import onmt.markdown
import torch
import argparse
import math
import numpy
import sys
import h5py as h5
import numpy as np
import apex
from scipy.io.wavfile import write
from onmt.model_factory import build_model, b... |
import argparse
import bz2
import csv
import json
import pandas as pd
pd.set_option('display.max_rows', 100)
REMOVE = ['', 'NA', 'na', 'Unknown']
STANDARDIZE = {'top': 'Top',
'Top': 'Top',
'High': 'High',
'high': 'High',
'mid': 'Mid',
'Mid': ... |
import os
import pickle
from argparse import ArgumentParser
from collections import Counter
from datetime import datetime
from typing import Dict, Tuple
import pandas as pd
from preprocessing.compute_occurrences import compute_occurrences
from preprocessing.resolve_entities import resolve_entities
from util import Pr... |
import numpy as np
import metrics
import datasets
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import KFold
from hypothesis import TreeHypothesis
from consistency import MCConsistentTree
from hypothesis_search import MCHypothesisSearch
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@AUTHOR:<NAME>
@CONTACT:<EMAIL>
@HOME_PAGE:joselynzhao.top
@SOFTWERE:PyCharm
@FILE:main.py
@TIME:2020/4/26 19:49
@DES: 衣橱管理
'''
import os
import os.path as osp
import codecs
item_id = 0
# global item_id
class ITEM():
def __init__(self,attr_list,attr_value):
# g... |
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description:
"""
import os
import time
from typing import List, Union, Optional, Dict
from loguru import logger
import numpy as np
from numpy import ndarray
from gensim.models import KeyedVectors
from tqdm import tqdm
from text2vec.utils.get_file import get_file
fr... |
#!/usr/bin/env python3
class Index():
"""
A class for tracking all builders avaliable to Site Wrangler. Each builder
should have a corresponding file in bin/builders. In said file, it should
import this class and call register_builder on itself.
"""
index = []
def register_builder(self, bu... |
#!/usr/bin/env python
import os
import os.path
import sys
import shlex
import hashlib
import inspect
import unittest
import datetime
import filecmp
from io import StringIO
from sharepointcli import main, __version__
from sharepointcli.cli import format_help, ArgumentParser
from collections import namedtuple
Result = ... |
import numpy as np
import pandas as pd
import os
import nltk
from nltk.corpus import stopwords, twitter_samples
from nltk.stem import PorterStemmer
from nltk.tokenize import TweetTokenizer
import re
import pickle
from collections import OrderedDict
import torch
from src.config import cfg
from gensim.models import FastT... |
"""
File to represent catan board as a graph, with nodes as settlements and edges as road positions.
Will need to map nodes to neighbors
Idea is to have classes for nodes and edges, each has values like "is_empty" and "owner", therefore we initialize
board to "empty" nodes to allow easy traversal and contsraint chec... |
# _*_ coding: utf-8 _*_
import os
"""
Original files/folders management
"""
def get_dir_name(full_path, return_prefix=False):
"""
Take full FOLDER path as input, and return the directory name
(won't work is the path contains filepath like "./dirname/file.txt")
Ps.
The command 'os.path.basename' is not con... |
import argparse
import time
from statistics import mean
import struct
from multiprocessing import Process, Queue
from influxdb import InfluxDBClient
user = 'root'
password = '<PASSWORD>'
dbname = 'int_telemetry'
dbuser = 'int'
dbuser_password = '<PASSWORD>'
#~ user = 'dpp_int'
#~ password = '<PASSWORD>'
#~ user = 'g... |
#!/usr/bin/env python
#
# Generate webassembly-opcodes.md containing all the WebAssembly SIMD opcodes.
#
import re
import simdspec
from typing import Tuple, Iterable
spec = simdspec.Specification()
with open('portable-simd.md') as f:
spec.parse(f.read())
# Add load and store operations directly to `v128`.
def ad... |
import os
import csv
import json
import copy
import torch
import warnings
import subprocess
import numpy as np
import typing as t
from math import ceil
from pathlib import Path
from datetime import datetime
import torch.nn.functional as F
import matplotlib.pyplot as plt
from slowMRI.metrics import metrics
def get_lo... |
"""
Healthscapes Geolytics Module
... |
import json
import socket
import requests
from requests.adapters import HTTPAdapter, DEFAULT_POOLSIZE
from app.common.metrics import ErrorType, internal_errors
from app.util.conf.configuration import Configuration
from app.util.decorators import retry_on_exception_exponential_backoff
from app.util.log import get_logg... |
"""Demo code shows how to estimate human head pose.
Currently, human face is detected by a detector from an OpenCV DNN module.
Then the face box is modified a little to suits the need of landmark
detection. The facial landmark detection is done by a custom Convolutional
Neural Network trained with TensorFlow. After tha... |
import time
import os
import json
from datetime import datetime
import requests
from flask import current_app, render_template
from flask_github import GitHub
from . import project_updater
from .util import localfile_tool
from ..models import *
from ..celery import celery
from flask_mail import Message
from .. import ... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
from larch import Group, Parameter, isgroup, Minimizer, parse_group_args
from larch_plugins.math import index_of
from larch_plugins.xray import xray_edge, xray_line, f1_chantler, f2_chantler, f1f2
from larch_plugins.xafs import set_xafsGroup, find_e0
import numpy as np
from scipy.special import erfc
MAXORDER = 6
d... |
#!/usr/bin/env python
# coding: utf-8
# In[5]:
import functools
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# In[3]:
mnist = input_data.read_data_sets("", validation_size=0)
# In[14]:
def differentiable_clip(inputs, alpha, rmin, rmax):
return tf.s... |
from django.utils.translation import ugettext_noop as _
from ecs import bootstrap
from ecs.notifications.models import NotificationType, Notification
from ecs.workflow.patterns import Generic
from ecs.integration.utils import setup_workflow_graph
from ecs.utils import Args
from ecs.notifications.workflow import (
... |
import shlex
import shutil
import logging
import collections
import pytest
from clldutils.misc import nfilter
from pyconcepticon.util import read_all
from pyconcepticon.__main__ import main
@pytest.fixture
def _main(tmprepos):
def f(*args):
if len(args) == 1:
args = shlex.split(args[0])
... |
import sys
from os.path import isfile,join,exists,isdir
from os import listdir
import os
from operator import add
import numpy as np
from functools import reduce
import rasterio
from rasterio.io import MemoryFile
import argparse
import logging
import io
import apache_beam as beam
from apache_beam.pvalue import Tagged... |
"""
CALM
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
import torch
import torch.nn.functional as F
def add_subclass_maps(cams, labels, superclass, mean=False, minmax=False):
output = torch.zeros([cams.size(0), cams.size(2), cams.size(3)],
device=torch.device('cuda:0'))
for ... |
import os
import requests
import tarfile
import zipfile
from flask import *
import urllib.request
import tensorflow as tf
from classes.User import User
from classes.Post import Post
from flask_login import LoginManager, login_user, current_user, login_required, logout_user
from classes.forms import RegistrationForm, Lo... |
#!/usr/bin/env python
# Edit this script to add your team's training code.
# Some functions are *required*, but you can edit most parts of the required functions, remove non-required functions, and add your own functions.
################################################################################
#
# Imported fu... |
# Copyright 2020 Huawei Technologies Co., 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... |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... |
#!/usr/bin/env python
import enum
import os
import sys
DEFAULT_EXECUTOR = None
EVENT_LOOP = None
JINJA2_ENV = None
class DatabaseDeploymentType(enum.Enum):
NOOP = 'noop'
MAP = 'map'
"""
RDS: postgresql
- 20gb volume
- 1x t2.micro
"""
RDS = 'rds'
"""
DynamodbDB
"""
DYNAMODB = 'dynamodb'
clas... |
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
from functools import partial
from random import random
# from threading import Thread
import time
from bokeh.models import ColumnDataSource
from bokeh.plotting import curdoc, figure
from tornado import gen
## Labjack Inputs:
import pandas as pd
import matplotlib.pyplot as plt
from labjackcontroller.labtools import... |
import random, pygetwindow, pyautogui, time,sys, math
from random import random as r
def rr(area=4): return (r()*area - area/2)
from twilio.rest import Client
import sys, os, time
class Bot:
def __init__(self,scriptDIR):
self.dir = scriptDIR
self.center = [296, 220]
self.masterPhone = Clie... |
import logging
import numpy as np
import opt_einsum as oe
import pandas as pd
from scipy.sparse.linalg import svds
logging.basicConfig(
format="%(levelname)s: %(name)s - %(asctime)s.%(msecs)03d %(message)s",
datefmt="%H:%M:%S",
level=logging.INFO,
)
_logger = logging.getLogger(__name__)
def train(
... |
from unittest.mock import Mock, patch
import pytest
from lxml import etree
from opencoverage import parser
def test_get_el_raises_parsing_exception():
dom = etree.fromstring("<div></div>")
with pytest.raises(parser.ParsingException):
parser.get_el(dom, "foobar")
def test_parse_coverage_invalid_xml... |
import base64
import io
import json
import os
import re
from datetime import datetime
import PyPDF2
import lxml.html as html
from PIL import Image
from django.conf import settings
from django.core.files.uploadedfile import InMemoryUploadedFile
from lxml import etree
from lxml.etree import XMLSyntaxError, ParserError
f... |
import logging
import countrynames
from pprint import pprint # noqa
import attr
from normality import stringify, collapse_spaces, slugify
log = logging.getLogger(__name__)
class Base(object):
def to_dict(self):
return attr.asdict(self)
@attr.s
class NameMixIn(Base):
_name = attr.ib(default=None)... |
import numpy as np
import pytest
import nengo
from nengo.builder import Model
from nengo.builder.signal import Signal, SignalDict
from nengo.exceptions import SignalError
from nengo.utils.compat import itervalues
def test_signaldict():
"""Tests SignalDict's dict overrides."""
signaldict = SignalDict()
s... |
# --------------
import pandas as pd
# Code Starts Here
def load_data(path= path):
df= pd.read_csv(path)
df= df[['description', 'variety']]
df= df.iloc[:80000]
print(df.head())
return df
df= load_data()
# Code Ends here
# --------------
from sklearn.preprocessing import LabelEncoder
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import cv2
import numpy as np
import pandas as pd
from progressbar import ProgressBar
from keras import losses, optimizers
from keras.models import model_from_json, Sequential
from keras.callbacks import ModelCheckpoint, EarlyStopping, TensorBoard
import sklear... |
from datetime import datetime
from typedtree.tree import Tree
from typedtree.traversalmode import TraversalMode
from slugify import slugify
from topicdb.core.store.topicstore import TopicStore
from topicdb.core.models.attribute import Attribute
from topicdb.core.models.datatype import DataType
from topicdb.core.mode... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Contains methods for binding novel or manga into epub and mobi"""
import re
import io
import os
import json
import errno
import random
import textwrap
import platform
import urllib
from subprocess import call
from ebooklib import epub
from PIL import Image, ImageFont, I... |
#!/usr/bin/env python3
import collections
import re
import sys
import click
import inflect
import yaml
from clickclick import warning, info
from swagger_spec_validator.validator20 import validate_spec
Issue = collections.namedtuple('Issue', 'location message guideline')
def compatibility_layer(spec):
"""Make s... |
# -*- coding:utf-8 -*-
"""
生成测试用例的代码
当Case的编码方式way使用shiwu的时候,需要把实物组件,转变成代码
"""
import json
import random
from tcase.models import Case, Shiwu
shiwu_data_model = '''
data_{id} = ShiwuDataHandle(body={body}, cycle={cycle})
'''
shiwu_code_model = '''
def shiwu_{id}(l):
data = data_{id}.get()
if data:
l... |
"""
:synopsis: The main npu api
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from . import vision, optim, loss, metrics
from .core import DataLoader
from .version import __version__, _module
from . import core, optim, loss as _loss, metrics as _metrics
def api(token="", project="Default", verbosity=1, deployed=False):
... |
from util.plans import Leg, get_obj_by_name
class CloningLeg(Leg):
primary_handles = [
"Fragment",
"Plasmid",
"Transformed E Coli",
"Plate",
"Overnight",
"Plasmid for Sequencing",
"Assembled Plasmid",
"Gel"
]
def __init__(self, plan_step, cu... |
import logging
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.admin.models import LogEntry, CHANGE
from django.contrib.contenttypes.models import ContentType
from django.utils import translation
from django.utils.module_loading import import_string
from django.utils.... |
import collections
import csv
import os
import sys
from ruamel.yaml import YAML
yaml = YAML()
yaml.width = 4096
province_names = {
'11': 'ACEH',
'12': 'SUMATERA UTARA',
'13': 'SUMATERA BARAT',
'14': 'RIAU',
'15': 'JAMBI',
'16': 'SUMATERA SELATAN',
'17': 'BENGKULU',
'18': 'LAMPUNG',
... |
"""
Given a directory with html files scraped from the NWS website, create a text file
for every html file in that directory containing a list of temperture forecasts for the week. Also write
a single json file with each week stored as an ordered dictionary containing the temperatures
and header information
exam... |
from isitfit.utils import logger
import pandas as pd
import redis
from ..utils import SECONDS_IN_ONE_DAY
SECONDS_IN_10MINS = 60*10
class RedisPandas:
"""
Python class that manages caching pandas dataframes to redis
https://stackoverflow.com/a/57986261/4126114
"""
def __init__(self):
self.redis_args = {... |
import os
import subprocess
from configparser import ConfigParser
from django.utils.functional import cached_property
from jinja2.exceptions import TemplateNotFound
from .data import CONTACT, DEFAULTS
from .rates import Rates
class Invoice:
def __init__(self, storage, data, override=None):
self.name = d... |
from typing import Any, List, Literal, Tuple
import torch
from nagl.features import (
AtomConnectivity,
AtomFeature,
AtomicElement,
AtomIsInRing,
BondFeature,
BondIsInRing,
)
from nagl.lightning import DGLMoleculeLightningModel
from nagl.molecules import DGLMolecule
from nagl.nn import Sequenti... |
"""Tests for the utils module."""
from __future__ import absolute_import
import copy
import pytest
import pysam
from pistis import utils
from six.moves import zip
TEST_FASTQ = 'tests/data/reads.fastq.gz'
@pytest.fixture
def small_fastq():
"""Returns 5 records from test fastq file as an iterator.
Returns:
... |
#
# Copyright (c) 2015-2020 <NAME> <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE... |
# coding=utf-8
# Copyright 2013 by <NAME>
# For Usage see LICENSE in the same folder
# Version 1.0
import os
import sys
import syslog
import stat
import pickle
from collections import deque
keyShift = 131072
keyControl = 262144
keyOption = 524288
keyCommand = 1048576
# globals
path = ""
dict = {}
separator = ""... |
# Copyright 2021 <NAME>.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
#... |
#!/usr/bin/env python
# Copyright (c) 2020 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
from datetime import timedelta
import functools
import inspect
import logging
import os
from pathlib import Path
from traceback import format_exc
from typing import Union, Optional
import arrow
from .timer import Timer
from .slack import post as post_to_slack
logger = logging.getLogger(__name__)
def notify_ok(sub... |
from bauhaus import Encoding, proposition, constraint
from bauhaus.utils import count_solutions, likelihood
import people
import movies
import pprint
# Encoding that will store all of your constraints
E = Encoding()
# PROPOSITIONS
# For a complete module reference, see https://bauhaus.readthedocs.io/en/latest/bauhau... |
# Author: SiliconSloth 18/1/2018
import bluetooth, threading, serial, time, os
import cv2
# PyCharm seems to need this to work properly.
# try:
# from cv2 import cv2
# except:
# pass
# This script is used to record training videos, by manually controlling the robot with the RobleyRemote app.
# Co... |
#!/usr/bin/env python3
"""
* Copyright (C) 2022 Axis Communications AB, Lund, Sweden
*
* 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
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, <NAME> <<EMAIL>>
# BSD 3-Clause License
#
# Copyright (c) 2017, <NAME>
# 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 sourc... |
import logging
import wrapt
from pyasli import wait_for
from pyasli.bys import by_xpath
from pyasli.conditions import enabled, hidden, missing, visible
from pyasli.exceptions import screenshot_on_fail
from integration.tests.helpers.base import Fields, Page, field, on_page
from integration.tests.helpers.fields import ... |
from typing import Set, Dict, Any, Callable, List
import numpy as np
import pluggy
def _full_name(cls: type):
return f"{cls.__module__}.{cls.__qualname__}"
class HookspecMarker:
"""Wrapper around :py:class:`pluggy.HookspecMarker` with minified interface.
Implicitly sets ``firstresult=True`` and ``histo... |
'''
Created on September 22, 2018
@author: <NAME>
'''
# !/usr/bin/python
# -*- coding: utf8 -*-
# -------------------------------------------------------------------------
#
# A simple molecular dynamics solver that simulates the motion
# of non-interacting particles in the canonical ensemble using
# a Langevin ... |
from ikomia import core, dataprocess
import copy
import os
import infer_yolact.yolact_wrapper as yw
# --------------------
# - Class to handle the process parameters
# - Inherits core.CProtocolTaskParam from Ikomia API
# --------------------
class InferYolactParam(core.CWorkflowTaskParam):
def __init__(self):
... |
import curses
import locale
import re
from minesweeper.game import State
class Window(object):
def __init__(self, lines=None, cols=None):
self.window = None
self._dimensions = (lines, cols)
def __enter__(self):
locale.setlocale(locale.LC_ALL, '')
self.window = curses.initscr(... |
"""
Functions for preparing the breast cancer dataset for training and validating ML algorithms
"""
from pathlib import Path
from typing import Tuple, Union
import joblib
import numpy as np
import pandas as pd
import torch
from pandas import DataFrame, Series
from sklearn.datasets import load_breast_cancer
from sklea... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
from utils import weight_init
def compute_keypoints_1d(key_logits, coords=None, temperature=1):
if coords is None:
coords_size = key_logits.size(-1)
coords = torch.linspace(-1, 1, c... |
"""Definition of meta model 'datasources'."""
from functools import partial
import pyecore.ecore as Ecore
from pyecore.ecore import *
from pygeppetto.model import Node, ISynchable
from pyecore.type import String, Boolean
name = 'datasources'
nsURI = 'https://raw.githubusercontent.com/openworm/org.geppetto.model/devel... |
#!/usr/bin/env python
# FROM: https://github.com/aneesha/RAKE
# Copyright (c) 2016
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation th... |
from pypika import Query, Table, Field, Criterion, Order
from api import constants
import json
import csv
import requests
import datetime
from django.db import connection
from api.models import Station
def measurement_sql(where):
station = Table('api_station')
q = Query.from_(station).select(
Field('a... |
import requests
import re
from bs4 import BeautifulSoup
class News:
def __init__(self, link, preview_text, timestamp, official):
self.link = link
self.preview_text = preview_text
self.timestamp = timestamp
self.official = official
class NewsStats:
def __init__(self,... |
# -*- coding: utf-8 -*-
import asyncio
from operator import itemgetter
from ..stream import Mixin
from ..stanzas import Presence
from ..utils import xpathFilter
from .muc import NS_URI_USER as MUC_USER_NS
PRES_SUB_XPATH = "/presence[@type='subscribe']"
PRES_SUBED_XPATH = "/presence[@type='subscribed']"
PRES_UNSUB_XPAT... |
from zope.interface import Interface
class IAPIFactory(Interface):
def __call__(environ):
""" environ -> IRepozeWhoAPI
"""
class IAPI(Interface):
""" Facade for stateful invocation of underlying plugins.
"""
def authenticate():
""" -> {identity}
o Return an authenti... |
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from panda3d.core import AmbientLight, DirectionalLight, KeyboardButton
from panda3d.core import TextNode, NodePath, LightAttrib
from panda3d.core import LVector3
from direct.actor.Actor import Actor
from direct.task.Task import Task
from direc... |
import argparse,os
from multiprocessing import Pool
#import subprocess
from DNBC4tools.tools.utils import logging_call
from DNBC4tools.__init__ import _root_dir
parser = argparse.ArgumentParser(description='QC,star and anno')
parser.add_argument('--name',help='sample name', type=str)
parser.add_argument('--outdir',hel... |
# cli.py
# Copyright (c) 2021 <NAME>
# Licensed under the MIT license
"""The command line interface.
Click is used as backbone for the cli.
An excellent tutorial is found at "https://zetcode.com/python/click".
"""
import click
from pyfiglet import Figlet
from . import settings
# we have to rename stage so it does no... |
from datetime import datetime
import requests
import logging
import json
import time
import sys
import os
_LOGGER = logging.getLogger(__name__)
_LOGGER.addHandler(logging.NullHandler())
class Resy:
def __init__(self, username, password, venue, party, date, times, reserve):
_LOGGER.info('Initializing app... |
# nvd3js module
import logging
class Nvd3js (object):
''' wrapper for emitting nvd3 javascript glue
See http://nvd3.org for more info.
Nearly all class paramaters are pass-throughs to the
javascript. Please refer to the nvd3 documentation on those.
See: https://nvd3-community.gith... |
import matplotlib.pyplot as plt
import time
from skimage.color import hsv2rgb
from flowbias.data_manipulation.extract_minor_flow import compute_secondary_flows
#from flowbias.utils.flow import compute_color
from flowbias.utils.meta_infrastructure import get_available_datasets, load_model_from_meta
from flowbias.utils.... |
# ======================================================================
# Author: TrungNT
# ======================================================================
from __future__ import print_function, division
from .. import logger
from ..trainer import _data, _task, trainer
from ..dataset import dataset
from ..mode... |
import numpy as np
import argparse
import os
color_list = [
'13130240',
'32818',
'56320',
'16711680',
'6579300',
'13158600',
'16711935',
'16776960',
'8388863',
'16763030',
'33023',
'51455',
'16744448'
]
def torgb(r, g, b):
return (int(r) << 16 | int(g) << 8 | ... |
# This file contains the functions needed for solving the Stokes system.
from params import rho_i,g,tol,B,rm2,rho_w,C,eps_p,eps_v,dt,quad_degree,Lngth,sigma_0
from boundaryconds import mark_boundary
from geometry import bed
from hydrology import Vdot
import numpy as np
from dolfin import *
def dPi(u,nu):
# de... |
from epigen.tokenizer import Token
from epigen.tokenizer import Tokenizer
from epigen.tokenizer import TokenType
from enum import Enum, auto, unique
@unique
class IDLSyntaxErrorCode(Enum):
NoMatchingClosingBrace = auto()
NoMatchingOpeningBrace = auto()
NoMatchingClosingBracket = auto()
NoSemicolonOn... |
import tkinter as tk
from PIL import Image
from PIL import ImageTk
import threading
import cv2
from cv2 import aruco
from source.utils.frames import get_frames
from tkinter import scrolledtext
from source.markers import *
import keyboard
cap = cv2.VideoCapture(0)
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250)
... |
import math
import typing
from collections.abc import Mapping, Sequence
from dataclasses import dataclass, fields, is_dataclass
_basic_types = (int, float, str)
class PropertyOp(typing.Protocol):
@property
def key(self) -> typing.Any:
...
def execute(self, obj: typing.Any) -> typing.Tuple[typing... |
import datetime
import sys,os
from netCDF4 import Dataset
from ttide.t_tide import t_tide
from ttide.t_getconsts import t_getconsts
from ttide.t_vuf import t_vuf
from ttide import t_utils as tu
import numpy as np
import copy
import matplotlib.dates as mpld
mpld.set_epoch('0000-12-31T00:00:00')
from matplotlib.dates imp... |
import re
import sys
import datetime
import requests
from collections import defaultdict
from . import botsite
from .botsite import remove_nottext
from .core import EditQueue, Timestamp, now
arc_list_title = 'User talk:WhitePhosphorus/archives'
working_title = 'User talk:WhitePhosphorus'
working_id = '3951371'
days_de... |
#!/usr/bin/python
print("Content-Type: text/html\n\n")
nouns = ['dress', 'elephant', 'battery', 'raincoat', 'bed', 'carpet', 'night', 'rose', 'plastic', 'crayon', 'room', 'whale', 'ghost', 'gas', 'manchester', 'pillow', 'potato', 'glass', 'dream', 'kite', 'kitchen', 'nail', 'stone', 'honey', 'breakfast', 'needle', 'ba... |
from PyQt5.QtCore import (QCoreApplication, QObject, QRunnable, QThread,
QThreadPool, pyqtSignal, pyqtSlot)
import numpy as np
import tempfile, os, sys
import caffe
from collections import OrderedDict
from datetime import datetime
class trainingCore(QThread):
"""This is caffe framwork bas... |
## Centre of Pressure Uncertainty for Virtual Character Control
## McGill Computer Graphics Lab
##
## Released under the MIT license. This code is free to be modified
## and distributed.
##
## Author: <NAME>, <EMAIL>
## Last Updated: Sep 02, 2016
## ------------------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.