text
stringlengths
957
885k
<filename>src/tiden/apps/ignite/components/ignitestaticinitmixin.py #!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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:/...
<gh_stars>0 # -*- coding: utf-8 -*- import sys import time import os import json import argparse from torch.autograd import Variable from utils.logger import setup_logger sys.path.insert(0, '../') sys.dont_write_bytecode = True import dataset import torch import torch.nn.functional as F import torch.nn as nn from torch...
<reponame>YosefLab/SingleCellLineageTracing<gh_stars>10-100 import unittest import networkx as nx import numpy as np from cassiopeia.data.CassiopeiaTree import CassiopeiaTree from cassiopeia.simulator.LeafSubsampler import LeafSubsamplerError from cassiopeia.simulator.UniformLeafSubsampler import UniformLeafSubsample...
<gh_stars>10-100 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.ops import gradient_checker from tensor...
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Team 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-...
from __future__ import print_function, division import numpy from west.propagators import WESTPropagator from west.systems import WESTSystem from westpa.binning import RectilinearBinMapper PI = numpy.pi from numpy import sin, cos, exp from numpy.random import normal as random_normal pcoord_len = 21 pcoord_dtype = num...
<filename>visualize_json.py import sys import cv2 import json if len(sys.argv) < 4: print("Usage: python visualize_json.py json_annotation input_im output_im") exit() def find_by_id(_id, objs): for obj in objs: if obj['id'] == _id: return obj return None in_json_file = sys.argv[1...
<gh_stars>10-100 import torch import argparse import os import os.path as osp import numpy as np import torch.nn as nn from datetime import datetime from torch.autograd import Variable import torch.optim as optim import warnings from torch.utils import model_zoo warnings.filterwarnings("ignore") #=========== import ne...
document_class_array = ['article','ieeetran','proc','minimal','report','book','slides','memoir','letter','beamer'] color = ['apricot','aquamarine','bittersweet','black','blue','bluegreen','blueviolet','brickred','brown','burntorange','cadetblue','carnationpink','cerulean','cornflowerblue','cyan','dandelion','darkorch...
<reponame>Lucas-Nieto/Laboratorio_Fisica_Moderna # -*- coding: utf-8 -*- """ Created on Tue Feb 15 21:56:02 2022 Experimento 1: Espectrometría Objetivo: Determinar la constante de Rydberg con datos de las líneas espectrales de la serie de Balmer exportados por Astrosurf IRIS Updated on Sat Feb 26 07:23:59 ...
<filename>Train_cifar.py from __future__ import print_function import sys import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import random import os import argparse import numpy as np from PreResNet import * from sklearn.mixture import Gau...
<gh_stars>1-10 #!/usr/bin/python3 """ This module test the maximal number of TXs in one block. """ import math import logging import sys from collections import deque from bitcoinrpc.authproxy import AuthServiceProxy import socket from eval import get_txnum_eval_path from protocol import State from generate_keys impor...
<reponame>jamesbowman/py-eve<filename>loadable/grave.py import sys import datetime from datetime import timezone import time import math import struct import numpy as np from PIL import Image from gameduino_spidriver import GameduinoSPIDriver import registers as gd3 import common import gameduino2.prep import gamedui...
# coding=utf-8 import os import shutil import unittest import pyid3tagger class ID3v1Test(unittest.TestCase): def compare_files(self, file_path_1, file_path_2): file_1_content = open(file_path_1).read() file_2_content = open(file_path_2).read() self.assertEqual(file_1_content, file_2_co...
<reponame>wrobstory/reconciler # -*- coding: utf-8 -*- """ Reconciler: reconcile messages in S3 to those that have been loaded in Redshift --------------------------- Given a list of S3 buckets, determine if any of the data has already been loaded into redshift (via a successful COMMIT in the stl_load_commits tbl) and...
<filename>arhuaco/analysis/generative/rnn_gen.py<gh_stars>1-10 # Copyright (c) 2019 <NAME>. # All Rights Reserved. from __future__ import print_function from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM from keras.optimizers import RMSprop from keras.utils.dat...
import pytest from django.test import RequestFactory from va_explorer.users.forms import ( ExtendedUserCreationForm, UserSetPasswordForm, UserUpdateForm, ) from va_explorer.users.tests.factories import ( GroupFactory, LocationFactory, NewUserFactory, ) pytestmark = pytest.mark.django_db clas...
<reponame>TheWardoctor/wardoctors-repo # -*- coding: utf-8 -*- ''' Bubbles Add-on Copyright (C) 2016 Bubbles 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 3 of the License, or ...
<reponame>mpoiitis/iSpine<gh_stars>1-10 from tensorflow.keras.layers import Layer import tensorflow as tf class Sampling(Layer): """Uses (z_mean, z_log_var) to sample z, the vector encoding a digit.""" def call(self, inputs, **kwargs): z_mean, z_log_var = inputs batch = tf.shape(z_mean)[0] ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ MAST Portal =========== This module contains various methods for querying the MAST Portal. """ from __future__ import print_function, division import warnings import json import time import os import keyring import threading import uuid import nump...
import os import time from urllib.parse import urlparse import requests from auth import get_auth def get_resource_list(url): """ Returns a list of HC resources specified by the url basename (such as .../articles.json) :param url: A full endpoint url, such as 'https://support.zendesk.com/api/v2/help_cent...
<gh_stars>0 from os.path import exists, dirname, join, abspath from datetime import datetime import pandas as pd from two_thinning.environment import run_strategy_multiple_times from two_thinning.strategies.always_accept_strategy import AlwaysAcceptStrategy from two_thinning.strategies.local_reward_optimiser_strategy...
import numpy as np arr = np.arange(0, 11) print(arr) # [ 0 1 2 3 4 5 6 7 8 9 10] print(arr[8]) # 8 print(arr[1:5]) # [1 2 3 4] # change elements arr[0:5] = 100 print(arr) # [100 100 100 100 100 5 6 7 8 9 10] # reset original array arr = np.arange(0, 11) # slicing slice1 = arr[0:6] print(slice...
<gh_stars>10-100 from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import datetime from functools import partial import json import traceback import imlib as im import numpy as np import pylib import tensorflow as tf import tensorflow.contrib....
# -*- coding:utf-8 -*- # ########################### # File Name: hdataset.py # Author: geekinglcq # Mail: <EMAIL> # Created Time: 2020-12-28 20:17:47 # ########################### import pandas as pd import os import logging from collections import defaultdict from torch.utils.data import DataLoader, Dataset from .e...
import copy import os import yaml from utils import write_conf def get_expelled_srv_conf(uuid): return {uuid: "expelled"} def get_srv_conf(uuid, rpl_uuid, uri=None, disabled=False): return { uuid: { 'disabled': disabled, 'replicaset_uuid': rpl_uuid, 'uri': uri if...
import time from copy import deepcopy import torch import torch.optim as optim from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from torch.distributions import kl_divergence import numpy as np from rl.algos import PPO from rl.policies.actor import GaussianMLP_Actor from rl.policies.critic import ...
# -*- coding: utf-8 -*- """ Created on Tue Feb 12 23:01:53 2019 @author: <NAME> <EMAIL> """ from sklearn.datasets import load_digits, load_breast_cancer, load_diabetes import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.cluster import KMeans ...
#------------------------------------------------------------------------------- # # Project: EOxServer <http://eoxserver.org> # Authors: <NAME> <<EMAIL>> # #------------------------------------------------------------------------------- # Copyright (C) 2011 EOX IT Services GmbH # # Permission is hereby granted, free o...
import logging import time import os import importlib import WorkManager import FileManager from pandayoda.common import MessageTypes from pandayoda.common.yoda_multiprocessing import Process, Event logger = logging.getLogger(__name__) config_section = os.path.basename(__file__)[:os.path.basename(__file__).rfind('.')...
<reponame>seblee97/student_teacher_catastrophic import abc import math from typing import List from typing import Union import torch from cata import constants from cata.teachers import classification_teacher from cata.teachers import regression_teacher class BaseTeacherEnsemble(abc.ABC): """Base class for sets/...
<reponame>JBurkinshaw/ogc-api-fast-features import os from asyncio import get_event_loop from typing import Type from unittest.mock import patch from uuid import uuid4 from oaff.app.configuration.data import get_layer, get_layers from oaff.app.configuration.frontend_configuration import FrontendConfiguration from oaff...
#!/usr/bin/env python """Simple script to package cache folder into GeoPackage. Includes GlobalGeodetic class from gdal2tiles.py by <NAME>, klokan at klokan dot cz licensed under MIT. """ __author__ = '<NAME>' __copyright__ = "Copyright 2015, Esri" __license__ = "ASL 2.0" __version__ = "1.1" __credits__...
<reponame>miquelramirez/tulip-control """ Tests for the abstraction from continuous dynamics to logic """ import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) # logging.getLogger('tulip').setLevel(logging.ERROR) logger.setLevel(logging.DEBUG) from nose.tools import assert_raises ...
''' Created on Nov 15, 2010 @author: octi ''' import dbbgm_batch import multiprocessing import Queue from bbgm_utils import saveImg,dbvalue,openImage,frameSuffix,frameSuffixWrite class GUIInvoker(multiprocessing.Process): def __init__(self,model,inv_model,fwd_model,pMap): self.mdl=mod...
<filename>vpc.py import boto3 import pprint import sys ec2_client = boto3.client('ec2') ec2_res = boto3.resource('ec2') def createVpc(offset): vpc = ec2_res.create_vpc(CidrBlock = '10.' + str(offset) + '.0.0/16') vpc.create_tags( Tags = [ { 'Key': 'Name', 'Value': 'VPC-' + str(offset) }, ] ) ...
""" This is a script to test a particle simulation. Please change any ..._path to your corresponding file path. """ import sys sys.path.append('..') import numpy as np import matplotlib.pyplot as pp from flow import Flow from animationparticles import AnimationParticles from text.text_particles import read_partic...
import datetime import logging import Mollie from django.conf import settings from django.contrib.auth.decorators import login_required from django.template.context_processors import csrf from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts impor...
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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...
# Copyright 2013 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
<reponame>ska-sa/tango-simlib ######################################################################################### # Author: <EMAIL> # # Copyright 2018 SKA South Africa (http://ska.ac.za/) # # ...
<filename>matterapi/endpoints/sync_api/webhooks.py """ Module to access the Webhooks endpoints """ # pylint: disable=too-many-lines,too-many-locals,too-many-public-methods,too-few-public-methods from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel from ...models import ( CreateIncom...
# Copyright (c) 2019 Juniper Networks, Inc. All rights reserved. import json import uuid from cfgm_common.tests import test_utils from keystonemiddleware import auth_token import mock from vnc_api.vnc_api import Project from vnc_api.vnc_api import VncApi from vnc_cfg_api_server.tests import test_case def get_token...
<filename>cellular/cellular.py import collections import itertools import random from .util import util from fractions import Fraction from PIL import Image, ImageDraw from math import log2 class TotalisticCellularAutomaton: def __init__(self, width, states=5, radius=1, colors=None, rules=None): self.n_...
#!/usr/bin/env python import os import numpy as np import tables import pandas from opty.utils import parse_free def compute_gain_error(filename): # root mean square of gain error df = load_results_table(filename) rms = [] for run_id, sim_dur, sample_rate in zip(df['run_id'], ...
''' Module containing Univariate Function Noise Generators. Classes embody Stochastic Noise Distributions, combined additively or multiplicatively with function gradient. ''' import numpy from . import univariate class Beta: ''' Beta Probability Distribution Function Mathematically, p(x) = x ^ (p1 - 1) * (1 - ...
<gh_stars>10-100 # Copyright (c) 2016 Uber Technologies, Inc. # # 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 the rights # to use, copy, mo...
# Copyright 2014 ETH Zurich # # 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, sof...
import click, os, sys, tempfile from sqlalchemy.orm import relationship from lah.db import LahDb from lah.models import * from lah.haplotig_iters import HaplotigIterator @click.command(short_help="generate haplotig seqfile") @click.argument("hid", type=click.STRING) @click.option("--output", required=False, type=clic...
<filename>awsbw/awsbw.py<gh_stars>0 #!/usr/bin/env python3 import boto3 import curses from curses import wrapper from curses import panel import sys import argparse import time from datetime import datetime class AWSBW(): def __init__(self, stdscr, jobQueues): self.__currentJobs__ = [] self.__max_...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
<gh_stars>0 import copy import re class Player: """ A class to represent the player. - Constructor Parameters :param token: :type str: - The player's token in the board. :param name: :type str: - The player's name. """ def __init__(self, token, name, *arg...
# Copyright 2018 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
import pygame from pygame.locals import * import random # Generate Food Dot def GenerateFood(): global screen, add global height, width global startX, startY global positionHistory RED = (255, 0, 0) while True: w = random.randint(0, height - add) h = random.randint(0, width - a...
<gh_stars>0 import glob import os import subprocess import unittest import netCDF4 import numpy as np import bald from bald.tests import BaldTestCase from rdflib import Graph # a module level graph, to share for memory and performance thisGraph = [Graph()] loaded_boolean = [] class Test(BaldTestCase): def setU...
<filename>talking_heads/network_ops.py<gh_stars>1-10 # -*- coding: utf-8 -*- #/usr/bin/python3 import tensorflow as tf ################################################################################## # Initialization ################################################################################## # Xavier : tf_c...
######################################################################## # ___ _ _____________ # / | / | / /_ __/ ___/ # / /| | / |/ / / / \__ \ # / ___ |/ /| / / / ___/ / # /_/ |_/_/ |_/ /_/ /____/...
<gh_stars>1-10 import numpy as np import tensorflow as tf class ClockworkRNN(object): ''' A Clockwork RNN - Koutnik et al. 2014 [arXiv, https://arxiv.org/abs/1402.3511] The Clockwork RNN (CW-RNN), in which the hidden layer is partitioned into separate modules, each processing inputs at its own temp...
#!/usr/bin/python import csv import sys import json import logging from util import django_utils from optparse import OptionParser django_utils.SetupDjango() from gibbs import models from gibbs import constants # Column names KEGG_ID = '!MiriamID::urn:miriam:kegg.compound' NAME = '!Name' INCHI = '!InChI' SOURCE = ...
import torch import torch.nn.functional as F import numpy as np from utils.proxy import proxy_reward def test(args, policy_net, env): device = next(policy_net.parameters()).device width, height = 84, 84 num_ales = args.evaluation_episodes if args.use_openai_test_env: observation = torch.fro...
<filename>zbuilder.py<gh_stars>1-10 #!/usr/bin/python import argparse import docker import json import logging import os import shutil import sys logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO) class zbuilder(): def __init__(self, config): js = json.load(config) ...
<gh_stars>0 # (c) 2017, Red Hat, inc # # This file is part of Ansible # # Ansible 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 3 of the License, or # (at your option) any later version. # # ...
# -*- coding: iso-8859-1 -*- """ MoinMoin - RenamePage action This action allows you to rename a page. @copyright: 2002-2004 <NAME> <<EMAIL>>, 2006-2007 MoinMoin:ThomasWaldmann, 2007 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ import re from Moi...
import sys import os import threading import multiprocessing import multiprocessing.pool import traceback from . import logger class SafeProcess( multiprocessing.Process, ): def __init__( self, *args, **kwargs ): super().__init__( *args, **kwargs ...
<reponame>MrHamdulay/rsa-chat import socket import threading import SocketServer from protocol import Protocol from time import time protocol = Protocol() global_lock = threading.Lock() public_keys = {} sockets = {} class ServerServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): ''' Server that doesn't c...
import functools import time from typing import List, Dict, Any, Iterable, Set, Tuple, Optional from dbt.logger import ( GLOBAL_LOGGER as logger, TextOnly, HookMetadata, UniqueID, TimestampNamed, DbtModelState, ) from dbt.exceptions import InternalException from dbt.node_types import NodeType, ...
<filename>line_analysis_BSNIP.py ''' TODO: Write a function to calculate the initial flux errors (to be used in the spline weighting) by heavily smoothing the spectrum and calculating the stddev of the points around the smoothed flux ''' import os from collections import namedtuple from astropy.io import fits from ast...
<reponame>d02d33pak/PyQt5-Apps<filename>calculator/ui.py """ UI Doc for Calculator App """ from PyQt5 import QtWidgets as qtw from PyQt5 import QtGui as qtg class MainUI: def init_ui(self): self.lcd_display = qtw.QLCDNumber() self.lcd_display.setDigitCount(10) self.lcd_display.setMinimumH...
<reponame>dpa-newslab/livebridge-liveblog # -*- coding: utf-8 -*- # # Copyright 2016 dpa-infocom GmbH # # 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/LIC...
#!/usr/bin/env python3 import numpy as np from scipy.io import netcdf import sys, os def main(file): print() print("Usage: "+file+" quasisymmetry_out.*.nc") #if len(sys.argv) != 2: # print("Error! You must specify 1 argument: the quasisymmetry_out.*.nc file") # exit(1) def toString(ncVar): temp = [c.decode(...
<reponame>ablancha/gppath<gh_stars>1-10 import numpy as np import time import GPy from .augmented_inputs import AugmentedInputs from gpsearch.core.kernels import * from gpsearch.core.acquisitions.check_acquisition import check_acquisition class OptimalPath(object): """A class for Bayesian path-planning algorithm....
<reponame>stephen-w-bailey/fast-n-deep-faces import logging try: import maya.api.OpenMaya as om import pymel import pymel.core usingMaya = True except: logging.warning('PoseGenerator not running in maya') usingMaya = False import functools import numpy as np import random import socket import st...
#!/usr/bin/env python # coding: utf-8 # # QDA + Pseudo Labeling + Gaussian Mixture = LB 0.975 # The dataset for Kaggle competition "Instant Gratification" appears to be 512 datasets concatenated where each sub dataset is believed to be created by Sklearn's `make_classification`. EDA suggests the following parameters: ...
#!/usr/bin/env python2 # If you have virtualenv installed: # # $ python2 virtualenv.py venv # $ venv/bin/pip install pygit2 dateparser # To run: # $ venv/bin/python tools/get_commits.py $HOME/ipfs_stuff/repos # Pass this tool a folder that contains all of the IPFS repos you wish to scan # It will output a list of au...
######################################### # Programmers: <NAME>, <NAME>, <NAME> # File Name: PreviewTimetable.py # Description: Contains UI code for the PreviewTimetableFrame ######################################### from tkinter import * from SQLWrapper import * from Timetable import * sqlWrapper = SQLWrapper() cla...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 7 20:55:52 2020 @author: zhouziyi """ real = [] imag = [] i = 0 with open("00_Data.txt") as Data: readCSV = csv.reader(Data, delimiter=',') next(readCSV) for row in readCSV: betar = float(row[1].split(",")[0]) #if (be...
# -*- coding: utf-8 -*- from collections import OrderedDict import six from fixtures_mongoengine import FixturesMongoengineException from fixtures_mongoengine.fixture import Fixture, get_fixture_class, BaseFixture """ Metaclass idea and parts of code taken from https://github.com/croach/Flask-Fixtures """ TEST_SETU...
<reponame>SepioSystems/demisto-sdk<filename>demisto_sdk/commands/update_release_notes/tests/update_rn_test.py import os import shutil import unittest from demisto_sdk.commands.common.git_tools import git_path class TestRNUpdate(unittest.TestCase): FILES_PATH = os.path.normpath(os.path.join(__file__, f'{git_path(...
<reponame>thesteau/Portfolio-Janggi # All pieces that are used in the game of Janggi class Pieces: """ Represents the Janggi pieces. Each piece will hold its individual information.""" def __init__(self, player): """ Initializes the Janggi pieces. Data member: play...
# -*- coding: UTF-8 -*- import os import sys import json import re import sqlite3 import time from selenium import webdriver from utils.common import * if PY3: import urllib.request import _thread else: import urllib2 import thread driver = webdriver.Chrome() REQ_HEADERS = { "Accept": "*/*", ...
import os #to use the OS structure commands import gtts #to translate text to speech import random #for the random integer generator from playsound import playsound #to play the output sound #converts text to speech def text_speech(speech): speech_file = gtts.gTTS(speech) #converting text to speech using google t...
import skrf import tkinter as tk from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import numpy as np import CircuitFig from PIL import ImageTk, Image, ImageDraw import io import MatchCal l2z = lambda l: l[0] + 1j * l[1] s4cmp = lambda sf: 'nH' if sf == 'l' else 'pF'...
<reponame>spmuppar/Adaptive-Tabulated-real-fluid-thermo<filename>quadtree_table_t.py from quadtree_t import Node, QuadTree #from quad_plot import draw_rectangle import sys import random from pdb import set_trace as keyboard from matplotlib.patches import Rectangle import matplotlib.pyplot as plt import NIST_reader as...
<gh_stars>1-10 """ Contains all the machinery to register and load plugins. """ from __future__ import annotations import importlib import inspect import sys from abc import ABC from dataclasses import dataclass from pathlib import Path from typing import Callable, List, Optional, Type import wx from .logging import...
<gh_stars>10-100 """SQLite based metrics repositories.""" import logging from typing import Optional, Iterable, List, Final from sqlalchemy import insert, MetaData, Table, Column, Integer, Boolean, DateTime, String, Unicode, \ ForeignKey, Float, UnicodeText, JSON, update, select, delete from sqlalchemy.engine impo...
<filename>differdb.py ''' Copyright (c) 2012 Lolapps, 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: 1. Redistributions of source code must retain the above copyright notice, this list of ...
<gh_stars>1-10 # Train multiple images per person # Find and recognize faces in an image using a SVC with scikit-learn """ Structure: <test_image>.jpg <train_dir>/ <person_1>/ <person_1_face-1>.jpg <person_1_face-2>.jpg . . ...
import xarray as xr import glob import numpy as np import pandas as pd import os import json from netCDF4 import Dataset, stringtochar from .aux.file_to_radar_object import file_to_radar_object from .aux.get_var_arrays_from_radar_object import get_var_arrays_from_radar_object from .iah_filter import iah_filter_ppi, iah...
""" Test extensions """ import os import unittest from cement.core import handler from cement.utils import shell from scilifelab.pm.core.production import ProductionController from test_default import PmTest filedir = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) class PmShellTest(PmTest): def tes...
<filename>streaming_event_compliance/services/build_automata/case_thread.py<gh_stars>1-10 from streaming_event_compliance import app from streaming_event_compliance.objects.variable.globalvar import gVars, CL, T, C from streaming_event_compliance.objects.automata import automata from streaming_event_compliance.objects....
# Copyright (c) 2006-2008 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. """Some utility methods for getting paths used by run_webkit_tests.py. """ import errno import os import platform_utils import subprocess import sy...
<reponame>bopopescu/fantastico # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, l...
import sys import spotipy import yaml import spotipy.util as util from pprint import pprint import json import argparse import matplotlib.pyplot as plt import numpy as np def load_config(): global user_config stream = open('config.yaml') user_config = yaml.load(stream, Loader=yaml.FullLoader) def get_play...
<filename>app/main.py import base64 from pathlib import Path import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import pandas as pd import dash_bootstrap_components as dbc from dotenv import load_dotenv from apps.dataset_page import generate...
# Copyright (c) OpenMMLab. All rights reserved. import itertools import logging import os.path as osp from collections import OrderedDict from typing import Dict, List, Optional, Sequence, Union import mmcv import numpy as np from mmcv.utils import print_log from mmdet.datasets.api_wrappers import COCO, COCOeval from ...
<gh_stars>0 import argparse import csv from datetime import datetime, timedelta import json import os from progress.spinner import Spinner import requests import time def lookup_channel_id_by_name(token, channel_name): r = requests.get("https://slack.com/api/channels.list?token=" + token) ...
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is...
<filename>lib/svtplay_dl/service/viaplay.py # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # pylint has issues with urlparse: "some types could not be inferred" # pylint: disable=E1103 from __future__ import absolute_import import re import json import copy import os from sv...
<reponame>ArtObr/indy-node import json from collections import OrderedDict from plenum.common.constants import TXN_TYPE, TARGET_NYM, \ DATA, ENC, RAW, HASH, ALIAS, TXN_ID, TRUSTEE, STEWARD, \ TXN_TIME, VERKEY from plenum.common.types import f from indy_common.constants import NYM, ATTRIB, GET_ATTR, \ ROLE,...
<gh_stars>0 import time from datetime import datetime, date import pandas as pd import sqlalchemy as sa from sqlalchemy.exc import InternalError from analysis.utils.db import engine, session from analysis.utils.db import DailyDiagnosticChangeModel from analysis.utils.db import IndividualReportModel from analysis.util...