text stringlengths 957 885k |
|---|
<gh_stars>0
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import enqueue_events
from frappe.celery_app import get_celery, celery_task, task_logger, LONGJOBS_PREFIX, ASYNC_TASKS_PREFIX... |
<reponame>Patechoc/xyz2top
#!/usr/bin/env python
import sys, os
import argparse
import numpy as np
import xyz2molecule as xyz
import math
import elements
class atomEntity(object):
def __init__(self, atomInfos, atomIndex):
self.atomIndex = atomIndex
self.atomInfos = atomInfos
self.neighbour... |
<reponame>hardbyte/sorting-gym<gh_stars>1-10
import pytest
from gym.spaces import flatten
from sorting_gym.agents.scripted import bubble_sort_agent, insertion_sort_agent, quicksort_agent
from sorting_gym.envs.functional_neural_sort_interface import FunctionalNeuralSortInterfaceEnv
from tests.util import _test_sort_age... |
<reponame>Vman45/app
import os
from email.message import EmailMessage, Message
from email.utils import make_msgid, formatdate
from smtplib import SMTP
import dkim
from jinja2 import Environment, FileSystemLoader
from app.config import (
SUPPORT_EMAIL,
ROOT_DIR,
POSTFIX_SERVER,
NOT_SEND_EMAIL,
DKIM... |
# Lesson 6. Loops
print("\n--- Print out numbers from 0, 1, ... 10")
x = 1
while x <= 10:
print(x)
x +=1
# while x > 0: # always true -> endless loop
# print(x) # endless loop
# x +=1
print("\n--- Print out num in order reverce 8,7 .... 1")
x = 8
while x >= 1:
print(x)
x -= 1
print()
# 2, 4, 6 ... 20
x... |
# -*- coding: utf-8 -*-
import os
"""
General Django settings for FST webservice
"""
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ROOT = os.path.abspath(os.path.dirname(__file__))
make_root_path = lambda *args: os.path.join(ROOT, *args)
# Read SECRET_KEY from file at project level
# To repla... |
<gh_stars>0
# coding: utf-8
# In[1]:
import networkx as nx
# In[2]:
def createDict(dataset):
authors_dict = {}
authors_dict_reference = {}
publications_dict = {}
conferences_dict = {}
for publication in dataset:
publications_dict[publication["id_publication"]] = []
if publicati... |
import numpy as np
import torch
import torch.nn as nn
from data.datasets.LowResHighResDataset import region_geometry
from networks.modular_downscaling_model.base_modules import ParametricModule
class LocalizedLinearModel(ParametricModule):
__options__ = {
"input_channels": None,
"output_channels"... |
"""
Component that will help set the microsoft face for verify processing.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/image_processing.microsoft_face_identify/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core impo... |
<reponame>MervmessInc/sfdx-scratch-org-builder<gh_stars>1-10
# org_manager.py
__version__ = '0.0.1'
import json
import logging
import os
import sys
import threading
import traceback
import sfdx_cli_utils as sfdx
# Set the working directory to the location of the file.
#
dir_path = os.path.dirname(os.path.realpath(__... |
import unittest
import os
import shutil
from LF2CRLF import LF2CRLF
class LF2CRLF_Tests(unittest.TestCase):
def test_ansi_windows_line_ending(self):
lf2crlf = LF2CRLF(os.path.join('Test Files', 'ANSI Windows.txt'))
self.assertEqual(lf2crlf.win_line_end, b'\r\n')
self.assertEqua... |
<reponame>THU-luvision/Occuseg
import torch, numpy as np, glob, math, torch.utils.data, scipy.ndimage, multiprocessing as mp
from functools import partial
import torch.nn.functional as F
import logging
from sklearn.neighbors import KDTree
import pdb
from torch_scatter import scatter_mean,scatter_std,scatter_add,scatter... |
#!/usr/bin/env python
import sys, argparse
import csv
import os
import matplotlib.pyplot as plt
import numpy as np
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("csv_file", default=None, help="CSV file with level runtimes")
parser.add_argument("--scale_size", default=False, acti... |
<reponame>aforalee/RRally<filename>tests/unit/verification/test_config.py
# Copyright 2014: Mirantis 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
#
# ... |
from os import stat
from re import VERBOSE
from request_api.models.FOIRequestComments import FOIRequestComment
from request_api.models.FOIMinistryRequests import FOIMinistryRequest
from request_api.models.FOIRawRequestComments import FOIRawRequestComment
from request_api.models.FOIRawRequests import FOIRawRequest
impo... |
<filename>tests/test_mqttplugin.py<gh_stars>10-100
"""test_restapiplugin.py :: Tests for Fauxmo's `RESTAPIPlugin`."""
import json
import time
from unittest.mock import MagicMock, patch
from mqttplugin import MQTTPlugin
config_path_str = "tests/test_mqttplugin_config.json"
def test_mqttplugin_mosquitto_dot_org() ->... |
<reponame>shivamashtikar/i3-dot-files<gh_stars>1-10
#!/usr/bin/env python3
# script copied from https://github.com/KJoke70/i3-tools
import i3ipc
import argparse
parser = argparse.ArgumentParser(
description='rotate clockwise or counterclockwise.')
parser.add_argument('direction', type=int,
... |
#!/usr/bin/env python3
"""Easy installation and configuration of Linux/Mac/Windows apps.
"""
import os
import logging
import shutil
from pathlib import Path
from argparse import Namespace
from .utils import (
HOME,
USER,
BASE_DIR,
run_cmd,
add_subparser,
update_apt_source,
brew_install_safe,... |
import datetime
import PIL.Image as Image
from data import ImShow as I
import numpy as np
import tensorflow as tf
from model import l21RobustDeepAutoencoderOnST as l21RDA
import os
from collections import Counter
from sklearn.metrics import precision_score as precision
from sklearn.metrics import f1_score
from sklearn... |
# encoding=utf8
from __future__ import unicode_literals
from ..log import user_data_log, log_with_user
from .base import boolean, date_time, to_string, string_agg, format_size
from .base import format_mimetype, parse_date
from io import BytesIO
from pyramid.response import FileIter
from pyramid.view import view_config
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
<gh_stars>0
import tkinter as tk # Note: for Python 2.x, use "import Tkinter as tk"
from PIL import ImageTk, Image
import math
import random
import os
import glob
company_name = 'Company\nName\n' # replace with actual company name
canvas_color = '#FDF5E6' # choose background color of canvas
text_color = '#8B8B83' # c... |
import sys
import pandas as pd
from relational_querier import RelationalQuerier
# Loads dadtaSUS info into a single .csv
def loadcsv():
srag_2013 = pd.read_csv(
"https://opendatasus.saude.gov.br/dataset/e6b03178-551c-495c-9935-adaab4b2f966/resource/4919f202-083a-4fac-858d-99fdf1f1d765/download/influd13_limpo... |
<reponame>shenyunhang/CSC<filename>tools/ssd/generate_noise_gt.py<gh_stars>10-100
import argparse
import os
import shutil
import subprocess
import sys
import _init_paths
from caffe.proto import caffe_pb2
from google.protobuf import text_format
from xml.etree.ElementTree import parse, Element
import cv2
import numpy as... |
#!/usr/bin/env python
#
# Copyright 2005,2007,2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... |
"""Miscellaneous morphology functions."""
import numpy as np
import functools
from scipy import ndimage as ndi
from .._shared.utils import warn
from .selem import _default_selem
# Our function names don't exactly correspond to ndimages.
# This dictionary translates from our names to scipy's.
funcs = ('erosion', 'dilat... |
####################################
# Driftwood 2D Game Dev. Suite #
# areamanager.py #
# Copyright 2014-2017 #
# <NAME> & <NAME> #
####################################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and... |
<reponame>menta78/alphaBetaLab<filename>alphaBetaLab/abBathyDataGridder.py
import numpy as np
import matplotlib
#from matplotlib.mlab import griddata
from scipy.interpolate import griddata
import multiprocessing as mp
from warnings import warn
from shapely import geometry as g
import sys
from .abUtils import *
class... |
import pytest
from django.core import mail as djmail
from django.utils.timezone import now
from pretix.base.models import Event, Organizer, Team, User
@pytest.fixture
def organizer():
return Organizer.objects.create(name='Dummy', slug='dummy')
@pytest.fixture
def event(organizer):
event = Event.objects.cre... |
#!/usr/bin/env python
# coding: utf-8
# # Bimodal distribution (mixture of two 1d Gaussians)
# In[1]:
import os
try:
import seaborn as sns
except:
get_ipython().run_line_magic('pip', 'install seaborn')
import seaborn as sns
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_ma... |
<reponame>EulerWong/director
from director import lcmUtils
from director import objectmodel as om
from director import visualization as vis
from director.utime import getUtime
from director import transformUtils
from director.debugVis import DebugData
from director import ioUtils
from director import robotstate
from di... |
<gh_stars>1-10
import random
import threading
from coapthon.messages.message import Message
from coapthon import defines
from coapthon.client.coap import CoAP
from coapthon.messages.request import Request
from coapthon.utils import generate_random_token
__author__ = '<NAME>'
class _RequestContext(object):
def __i... |
<filename>src/runners.py<gh_stars>0
from tqdm import trange
from src import metrics
import numpy as np
import torch
import os
from torch.utils.tensorboard import SummaryWriter
def train(
net,
criterion,
optimizer,
lr_scheduler,
train_dataloader,
test_dataloader,
n_epochs,
device,
s... |
# Copyright 2018 Amazon Research Cambridge
#
# 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... |
# Copyright (c) 2010-2013, Regents of the University of California.
# All rights reserved.
#
# Released under the BSD 3-Clause license as published at the link below.
# https://openwsn.atlassian.net/wiki/display/OW/License
import logging
import threading
from openvisualizer.bspemulator.bspmodule import BspModule
cl... |
from django.db import models
from django.utils import timezone
from users.models import User
from teams.models import Team
from datetime import datetime, timedelta
class ContestManager(models.Manager):
"""
Helper method used to fetch all unstarted, active or past contests.
"""
def unstarted(self):
... |
#! /bin/env python
"""
This script will return the paths that distutils will use for installing
a package. To use this script, execute it the same way that you would
execute setup.py, but instead of providing 'install' or 'build' as the
command, specify 'purelib' or 'platlib' and the corresponding path
will be printe... |
#!/usr/bin/env python
# coding: utf-8
# # >>>>>>>>>>>>>>>>>>>>Tarea número 3 <<<<<<<<<<<<<<<<<<<<<<<<
# # Estudiante: <NAME>
# # Ejercicio #1
# In[2]:
import os
import pandas as pd
import numpy as np
from math import pi
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
from scipy.cluster... |
# Generated by Django 2.2.14 on 2020-09-01 10:25
from django.db import migrations
def create_initial_owners(apps, schema_editor):
Owner = apps.get_model("traffic_control", "Owner")
initial_owners = (
("City of Helsinki", "<NAME>"),
("State", "Valtio"),
("Private", "Yksityinen"),
... |
# Code works stable with environment.yml
from pylab import *
import numpy as np
import copy
z,x,y = genfromtxt('U.dat').T
N = int(sqrt(x.shape[0]))
x = x.reshape(N, N)
y = y.reshape(N, N)
z = z.reshape(N, N)
mark_11 = copy.deepcopy(z)
mark_12 = copy.deepcopy(z)
for i in range (0, N-1):
z_point = z[i] * z[i+1]
... |
import base64
import datetime
import io
import json
import zipfile
from functools import wraps
import flask
import urllib.parse
import config
from api import make_eps_api_metadata_request
from app import app, fernet
from auth import exchange_code_for_token, get_access_token, login, set_access_token_cookies, get_authori... |
#!/usr/bin/env python
import os, sys
if sys.hexversion < 0x2040400:
sys.stderr.write("pysync.py needs python version at least 2.4.4.\n")
sys.stderr.write("You are using %s\n" % sys.version)
sys.stderr.write("Here is a guess at where the python executable is--\n")
os.system("/bin/sh -c 'type python>&2'... |
from __future__ import division
import sys
import albow # used for translation update
from pygame import Rect, Surface, image
from pygame.locals import K_RETURN, K_KP_ENTER, K_ESCAPE, K_TAB, KEYDOWN, SRCALPHA
from pygame.mouse import set_cursor
from pygame.cursors import arrow as arrow_cursor
from pygame.transform impo... |
<filename>nnet/core_layers.py
from .layer import Layer
import numpy as np
import math
class Linear(Layer):
def __init__(self, nout, name=None, lid=None):
Layer.__init__(self, name=name, lid=lid)
self.NOut = nout
def init(self, inputs):
assert len(inputs) == 1
inp =... |
import os
import yaml
from string import Template
from copy import deepcopy
from .plugins import ArgcountChecker, OptionalArguments, ArgumentReferences, \
BeforeAfterCall, ConstantArguments, ReturnArguments, GILRelease
from ..shared import cwrap_common
class cwrap(object):
BASE_INDENT_SIZE = 6
RETURN_WRA... |
import datetime
import os
import requests
from flask import Flask, jsonify, abort
from flask_sqlalchemy import SQLAlchemy
import opentracing
from flask_opentracing import FlaskTracing
from sqlalchemy.sql import func
from elasticapm.contrib.flask import ElasticAPM
from elasticapm.contrib.opentracing import Tracer
B... |
<filename>MaximizeHField.py
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed in th... |
<reponame>NIC619/pyethereum
import pytest
import ethereum.messages as messages
import ethereum.transactions as transactions
import ethereum.meta as meta
from ethereum.transaction_queue import TransactionQueue
import rlp
from rlp.utils import decode_hex, encode_hex
import ethereum.pow.ethpow as ethpow
import ethereum.ut... |
<reponame>skandupmanyu/facet
"""
Projection of SHAP contribution scores (i.e, SHAP importance) of all possible
pairings of features onto the SHAP importance vector in partitions of for synergy,
redundancy, and independence.
"""
import logging
from abc import ABCMeta, abstractmethod
from typing import Any, Iterable, Lis... |
# Copyright (c) 2010-2013, Regents of the University of California.
# All rights reserved.
#
# Released under the BSD 3-Clause license as published at the link below.
# https://openwsn.atlassian.net/wiki/display/OW/License
import logging
import os
import sys
import threading
from openvisualizer.opentun.opentun import... |
import argparse
from pathlib import Path
import numpy as np
from model.embedder import SpeechEmbedder
import torch
from utils.hparams import HParam
import librosa
from utils.audio import Audio
#python encoder_inference.py --in_dir ../vox1_test/wav/ --out_dir spkid --gpu_str 0 (eval)
#python encoder_inference.py --in_d... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 6 11:42:29 2019
@author:
"""
import math
import numpy
#from scipy.linalg.blas import daxpy
#from scipy.linalg.blas import ddot
#from scipy.linalg.blas import dscal
#from scipy.linalg.blas import idamax
#from Documents.ChromaStarPy.GAS.blas.Daxpy import dax... |
<reponame>tycoer/rfvision-1
from rfvision.models.builder import HEADS
from rfvision.components.utils.dct_utils import dct_2d, idct_2d
from rfvision.components.roi_heads.mask_heads import FCNMaskHead
from rflib.cnn import ConvModule
import torch.nn as nn
import numpy as np
import torch
from torch.nn import functional as... |
# pylint: disable=R0201
# R0201: For testing methods which could be functions are fine.
#
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#Redistribution and use in source and binary forms, with or without... |
'''
# fastly-blocklist #
Configure request blocking on a Fastly service.
'''
from pathlib import Path
from argparse import ArgumentParser, RawTextHelpFormatter
import lib
def main(args):
'''
run fastly-blocklist
'''
# setup our environment
env = lib.Environment(args)
state = lib.State()
... |
from pathlib import Path
import ruamel.yaml
from ..model import AutojailArch, AutojailConfig, AutojailLogin
from .base import BaseCommand
class InitCommand(BaseCommand):
""" Initializes an autojail project
init
{--f|force : if set overwrites existing autojail.yml}
{--name= : name of the proje... |
# Submit a request via cURL:
# curl -X POST -F audio=@salli.wav 'http://localhost:5000/predict'
# import the necessary packages
# -*- coding: utf-8 -*-
import sugartensor as tf
import numpy as np
import librosa
from model import *
import data
import flask
import io
from datetime import datetime
from werkzeug import se... |
#!/usr/bin/env python3
from typing import Tuple
import rsa
from sympy import Symbol, solve
from ContinuedFraction import ContinuedFraction
from libs.RSAvulnerableKeyGenerator import generateKeys
class Wiener:
def __init__(self,
n: int or None = None,
e: int or None = None,
... |
#!/usr/bin/env python3
# TODO:
# - Apply bitmask on opcodes to zero out variant bits (e.g. relative and absolute addresses or nops)
# - Hash resulting instruction bytes instead of mnemonics
# - https://www.hex-rays.com/products/ida/tech/flirt/in_depth/#Variability
import filterdiff
import ratio
import r2pipe... |
import concurrent.futures
import tempfile
import uuid
from data_deploy.thirdparty.sshconf import *
import logging
import remoto
from data_deploy.internal.util.printer import *
class RemotoSSHWrapper(object):
'''Simple wrapper containing a remoto connection and the file it is using as ssh config.'''
def __i... |
"""
Copyright [2017-2020] EMBL-European Bioinformatics Institute
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 ... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# --------------------------------------------------------------------------
import sys
from .. import utils
from .trace import EventTypes
logger = utils.get_logger()
def merge_ra... |
<reponame>tanaysh7/Youtube_Inspector
"""
This code parses flatfile data containing timestamps and youtube subtitles
and creates a JSON file from it.
"""
from os import path, listdir
import re
import json
# def remove_timestamps():
# import os
# dirPath = os.path.dirname(os.path.realpath(__file__))+"/data"
# ... |
<reponame>allbuttonspressed/pyjs
#!/usr/bin/env python
# example progressbar.py
import pygtk
pygtk.require('2.0')
import gtk, gobject
# Update the value of the progress bar so that we get
# some movement
def progress_timeout(pbobj):
if pbobj.activity_check.get_active():
pbobj.pbar.pulse()
else:
... |
"""
This module tests element_agent.py
"""
import numpy as np
import sys
# Check the version of Python
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
import threading
import unittest
# agent and stream and helper_control are in ../core
from IoTPy.core.agent import... |
# STRING DATA TYPE
# strings are arrays of bytes representing unicode characters
s1="text" # string is created with double quotation marks
s2='this is also a string' # single quotation marks are the same thing
s3='abc123!# "/(@£$.. ""abc123ABC' # strings can contain any characters
s4="""one liner""" # three " or '-ch... |
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
# 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 u... |
<filename>matchstrings.py
import numpy as np
from weighted_levenshtein import lev
class MatchString:
def __init__(self):
self.insert_costs = np.ones(128,
dtype=np.float64) # make an array of all 1's of size 128, the number of ASCII characters
# Insert Weight D... |
<reponame>skelleher/subtitled
import torch
import torch.nn as nn
import torchvision.models as models
class EncoderCNN(nn.Module):
def __init__(self, embed_size):
super(EncoderCNN, self).__init__()
resnet = models.resnet50(pretrained=True)
for param in resnet.parameters():
param... |
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# These xcode_settings affect stripping:
# "Deployment postprocessing involves stripping the binary, and setting
# its file mode, owner, and group."
#'DEPLO... |
__all__ = ['print_context', 'write', 'iwrite', 'details', 'plt2html', 'set_dir', 'textbox',
'image','svg','format_html','format_css','alert','colored','keep_format',
'source','raw','enable_zoom','html_node','sig','doc']
__all__.extend(['rows','block'])
__all__.extend([f'block_{c}' for c in ['r',... |
from typing import Callable, Optional
import jax
import jax.numpy as np
import objax
from chex import Array, dataclass
from rbig_jax.transforms.block import InitRBIGBlock, RBIGBlockParams
from rbig_jax.utils import get_minimum_zeroth_element, reverse_dataclass_params
from rbig_jax.information.total_corr import init_in... |
<reponame>gisce/esios
# -*- coding: utf-8 -*-
from datetime import datetime
from dateutil import relativedelta
from libsaas import http, parsers, port
from libsaas.services import base
from esios.utils import translate_param, serialize_param
LIQUICOMUN_PRIORITY = [
'C7', 'A7', 'C6', 'A6', 'C5', 'A5', 'C4', 'A4'... |
<reponame>tenet-ac-za/NZ-ORCID-Hub<filename>orcid_hub/__init__.py<gh_stars>0
# -*- coding: utf-8 -*- # noqa
"""
ORCID-Hub
~~~~~~~~~
The New Zealand ORCID Hub allows all Consortium members to productively engage with ORCID
regardless of technical resources. The technology partner, with oversight from
... |
import numpy as np
import os
import string
import re
import tensorflow as tf
from Bio import SeqIO
from Bio.PDB.DSSP import DSSP
from Bio.PDB import PDBParser
tf.compat.v1.enable_eager_execution()
mapping = np.array([0, 4.001, 6.001, 8.001, 10.001, 12.001, 14.001, 16.001, 18.001, 20.001])
def probability(n):
try:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''oldpf.py - <NAME> (<EMAIL>) - Jan 2017
This contains deprecated and incomplete period-finding tools from periodbase.py:
- dworetsky period finder
- scipy LSP
- townsend LSP
Kept around just in case.
'''
#############
## LOGGING ##
#############
import logging
from... |
<filename>infra/ci/worker/run_job.py
#!/usr/bin/env python3
# Copyright (C) 2019 The Android Open Source Project
#
# 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... |
<filename>app.py
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import *
from get_jav_girls import *
from return_one_question import *
from database_king import *
import os
import json
impor... |
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QWidget, QLabel, QGraphicsPixmapItem, QGraphicsView, QGraphicsScene
import pyqtgraph as pg
from mGesf import workers
from utils.GUI_main_window import init_container
from utils.img_utils import array_to_colormap_qim
class... |
from abc import ABC, abstractmethod
from collections import defaultdict
from functools import partial
from itertools import chain
from typing import List, Optional, Union, Callable
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.cluster import KMeans
from sklearn.feature_extraction.text import Coun... |
<reponame>Jay-9912/ACSConv<filename>experiments/mylib/utils.py<gh_stars>0
import os
from sklearn.metrics import roc_auc_score
from tqdm import tqdm
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import torch
import torch.nn as nn
import pandas as pd
import os
import time
import ran... |
<reponame>datalogics-kam/conan
import unittest
import os
from conans.test.utils.test_files import temp_folder
from conans.client.remote_registry import RemoteRegistry, migrate_registry_file, dump_registry, \
default_remotes
from conans.model.ref import ConanFileReference, PackageReference
from conans.errors import ... |
<gh_stars>0
from sublime_db.core.typecheck import (
Any,
Callable,
Optional
)
import sublime
import sublime_plugin
from . import view_drag_select
command_id = 0
command_data = {}
sublime_command_visible = False
is_running_input = False
class SublimeDebugInputCommand(sublime_plugin.WindowCommand):
def run(self, ... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urlparse, urllib2, urllib
import string
from BeautifulSoup import NavigableString, BeautifulSoup as bs
import re
import socket
from werkzeug import url_fix
import json
from random import choice
socket.setdefaulttimeout(5)
class album_metadata:
c... |
<reponame>vishalbelsare/pycobra<filename>pycobra/visualisation.py
# Licensed under the MIT License - https://opensource.org/licenses/MIT
import math
import itertools
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import random
from scipy.spatial... |
<reponame>enwawerueli/footprints
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'forms/category_details.ui',
# licensing of 'forms/category_details.ui' applies.
#
# Created: Fri Feb 8 19:39:07 2019
# by: pyside2-uic running on PySide2 5.11.2
#
# WARNING! All changes made in this fi... |
#!/usr/bin/env python3
import argparse
import errno
import select
import signal
import socket
import sys
import threading
class Server:
'''
Server is the passive side of client-server architecture model. It binds
to one or more local interface and listens for incoming connection on some
port.
Ar... |
import csv
import sys
from nltk import word_tokenize, pos_tag
from nltk.corpus import wordnet
from nltk.stem import WordNetLemmatizer
data_type = sys.argv[1]
def read_csv(input_file):
"""Reads a csv file."""
lines = []
with open(input_file, 'r') as csv_file:
reader = csv.DictReader(csv_file)
... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import itertools
import math
from collections import defaultdict
import numpy as np
import torch
from PIL import Image
from toolz import compose, curry
from toolz import partition_all
from torch.utils.data import Dataset
from torchvision.dataset... |
<gh_stars>10-100
import time, math, re
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import torch
def savePlot(points, outpath):
plt.figure()
fig, ax = plt.subplots()
# this locator puts ticks at regular intervals
loc = ticker.MultipleLocator... |
<gh_stars>10-100
# global
import numpy as np
# local
from ivy_vision_tests.data import TestData
from ivy_vision import single_view_geometry as ivy_svg
class SingleViewGeometryTestData(TestData):
def __init__(self):
super().__init__()
# bilinear sampling
self.simple_image = np.tile(np.ar... |
<filename>polya/interface/example.py<gh_stars>10-100
####################################################################################################
#
# example.py
#
# Authors:
# <NAME>
# <NAME>
# <NAME>
#
# Class to easily construct examples.
#
#
###################################################################... |
<reponame>liangyongxiang/vsf-all-in-one<filename>source/component/3rd-party/btstack/raw/port/mtk/docs/scripts/plot_scan.py
#!/usr/bin/env python3
import matplotlib.pyplot as plt
#from pylab import *
import pickle
import pylab as P
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.... |
<reponame>robertwb/collapsing-thread-pool-executor
import atexit
import sys
import threading
import weakref
from concurrent.futures import _base
from logging import getLogger
from uuid import uuid4
try: # Python3
import queue
except Exception: # Python2
import Queue as queue
try: # Python2
from concurr... |
<reponame>charlesblakemore/opt_lev_analysis<gh_stars>0
import os, sys, time, h5py
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
import scipy.optimize as opti
import scipy.constants as constants
from obspy.signal.detrend import polynomial
import bead_util as bu
import dill as pick... |
<filename>examples/hand_pose_estimation/unit_tests.py
from backend_SE3 import build_rotation_matrix_x, build_rotation_matrix_y
from backend_SE3 import build_rotation_matrix_z, build_affine_matrix
from backend_SE3 import rotation_from_axis_angles
from backend_SE3 import to_homogeneous_coordinates, build_translation_matr... |
"""
Entry point for Libretto runtime mode
Runtime mode is unattended mode for "one-click" model deployment
"""
from __future__ import annotations
#
# 220221 early venv detection
#
if __name__ == "__main__":
from configparser import ConfigParser
from libretto.venv import Venv
config = ConfigParser()
co... |
<filename>gnd-sys/app/cfsinterface/telecommand.py
"""
Copyright 2022 Open STEMware Foundation
All Rights Reserved.
This program is free software; you can modify and/or redistribute it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation; version 3 wi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file belong to https://github.com/snolfi/evorobotpy
and has been written by <NAME>, <EMAIL>
coevo2.py include an implementation of an competitive co-evolutionary algorithm analogous
to that described in:
<NAME> and <NAME>. (2019). Long-Term Progress an... |
<gh_stars>1-10
# Copyright 2019 Regents of the University of Minnesota.
#
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.