text stringlengths 957 885k |
|---|
"""
closed-loop MILP solved to determine optimal ordering defined by ADG
"""
import sys
import yaml
import time
import matplotlib.colors as mcolors
import matplotlib
import matplotlib.pyplot as plt
import random
import logging
import time
import networkx as nx
import csv
import statistics as stat
import os
import ... |
from watson_machine_learning_client import WatsonMachineLearningAPIClient
from flask import request
from flask import jsonify
import os
from flask import Flask,render_template,request,jsonify
import io
import xarray as xr
import datetime
import pandas as pd
import numpy as np
from sklearn.preprocessing import... |
<filename>awacs/mobiletargeting.py
# Copyright (c) 2012-2013, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon Pinpoint'
prefix = 'mobiletargeting'
class Action(BaseAction):
def __init__(self, actio... |
from __future__ import annotations
import logging
import random
from typing import TYPE_CHECKING
from scripts.scenes.combat.elements.commander import Commander
from scripts.scenes.combat.elements.unit import Unit
if TYPE_CHECKING:
from typing import Dict, List, Optional, Tuple
from scripts.core.game import ... |
<reponame>joakimzhang/qtest
from django.contrib import admin
# Register your models here.
from .models import TestlinkCase, TestlinkDB, TestlinkReport, TestlinkBuild,BlogComment,ReportPicture
#admin.site.register(TestlinkCase)
from django.contrib.admin.options import *
from django.utils.translation import (
ove... |
import os
import sys
import time
import argparse
import unicodedata
import librosa
import numpy as np
import pandas as pd
from tqdm import tqdm
from hparams import hparams
def run_prepare(args, hparams):
def normalize_wave(wave, sample_rate):
"""normalize wave format"""
wave = librosa.resample(w... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
<gh_stars>1-10
#!/usr/bin/python
from NanoTCAD_ViDES import *
from pylab import *
# atoms per slice (or cell)
atoms=1;
#N=46;
N=5;
slices=4*N;
thop=-2.7;
#4*pi/(3*sqrt(3)*0.144);
delta=0.144*sqrt(3);
#kmin=-pi/delta;
kmin=8;
k=kmin;
Np=30;
#kmax=pi/delta
kmax=9.0
#kmax=10
dk=(kmax-kmin)/Np;
GNR=nanoribbon(1,N*2.5*0.1... |
<filename>uitester/ui/case_manager/tag_editor.py
# -*- encoding: UTF-8 -*-
import os
from PyQt5 import uic
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtWidgets import QWidget, QMessageBox
from uitester.case_manager.database import DBCommandLineHelper
from uitester.config import Config
class TagEditorWidget(Q... |
from all_imports import *
from numpy import array
from numpy import argmax
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
def get_data(spatial = True):
annotation_zip = tf.keras.utils.get_file('captions.zip',
cache_subd... |
<gh_stars>1-10
import cv2
def draw_landmarks(image, landmark_point):
if len(landmark_point) > 0:
# Thumb
cv2.line(image, tuple(landmark_point[2]), tuple(landmark_point[3]),
(0, 0, 0), 6)
cv2.line(image, tuple(landmark_point[2]), tuple(landmark_point[3]),
(... |
from urllib import request
from xml.dom.minidom import parseString
def subdata(node):
name = ''
for cnode in node.childNodes:
if cnode.nodeType == cnode.TEXT_NODE:
name = name + cnode.nodeValue
else:
name = name + subdata(cnode)
return nam... |
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# AWS only documentation fragment... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\ruiri\Desktop\alarm-clock\Tests\listtest.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
in... |
<filename>src/layer_activation_with_guided_backprop.py
"""
Created on Thu Oct 26 11:23:47 2017
@author: <NAME> - github.com/utkuozbulak
"""
import torch
from torch.nn import ReLU
from src.misc_functions import (get_example_params,
convert_to_grayscale,
save_grad... |
<reponame>danwent/python-quantumclient
# Copyright 2012 OpenStack LLC.
# 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/license... |
<filename>sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root f... |
"""The functions for converting to and from the Hyperbolic simplex basis"""
from copy import deepcopy
import logging
import numpy as np
#from psych_metric.distrib.simplex.euclidean import EuclideanSimplexTransform
def cart2polar(vectors):
"""Convert from 2d Cartesian coordinates to polar coordinates.
Param... |
# A simple graph representing a series of cities and the connections between
# them.
map = {
"Seattle": {"San Francisco", "Washington D.C."},
"San Francisco": {"Seattle", "Los Angeles", "Denver"},
"Los Angeles": {"San Francisco", "Phoenix"},
"Phoenix": {"Los Angeles", "Denver"},
"Denver": {"Phoenix... |
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from main import models
class PostAnalyticAnonTestCase(TestCase):
"""Test post analytics for non logged in users."""
def setUp(self):
self.user = models.User.objects.create(username="alice")
sel... |
<filename>nebpyclient/api/etickets.py
#
# Copyright 2020 Nebulon, Inc.
# All Rights Reserved.
#
# DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN N... |
<filename>utils.py
import torch
from torchvision.transforms import ToTensor
from torch.autograd import Variable
import numpy as np
import torchvision
import importlib
from PyQt5 import QtCore, QtGui, QtWidgets, uic
def GetIndexRangeOfBlk(height, width, blk_row, blk_col, blk_r, blk_c, over_lap = 0):
blk_h_size = heigh... |
<gh_stars>1-10
# !/usr/bin/python3
"""
The Gene Ontology Categories Suite (GOcats)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides methods for the creation of directed acyclic concept subgraphs of Gene Ontology, along with methods
for evaluating those subgraphs.
"""
import os
import sys
import re
impo... |
#!/usr/bin/env python
# coding: utf8
# ____ _____
# ________ _________ ____ / __ \/ ___/
# / ___/ _ \/ ___/ __ \/ __ \/ / / /\__ \
# / / / __/ /__/ /_/ / / / / /_/ /___/ /
# ... |
<filename>libs/strings.py
#!/usr/bin/env python3
"""Strings based routines"""
import os
import logging
import me.libs.decorators
import string
logger = logging.getLogger("STRINGS")
def strings(args=None):
logger.debug("strings")
system_string_funcs()
lc_alphabet()
uc_alphabet()
str_digits()
... |
<filename>2019/25/py/run.py
#! /usr/bin/python3
import sys
import os
import time
from typing import Dict, List, Tuple
from collections import defaultdict
import re
from itertools import combinations
class IntCodeComputer():
def __init__(self, memory: List[int], inputs: List[int] = [], defaultInput: bool = False,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `precisionmapper` package."""
# To be tested with : python3 -m pytest -vs tests/test_precisionmapper.py
import pytest
import os
from precisionmapper import Survey, PrecisionMapper
from requests import ConnectionError
# Get useful environment variables
_LOGI... |
<reponame>danielfrascarelli/esys-particle
#############################################################
## ##
## Copyright (c) 2003-2017 by The University of Queensland ##
## Centre for Geoscience Computing ##
## http://earth.uq.edu.au/cent... |
# Generated by Django 4.0.2 on 2022-02-12 20:03
from django.db import migrations
def seed(apps, schema_editor):
Player = apps.get_model('blacktop', 'Player')
Player(name="<NAME>",
nickname="<NAME>",
height=78,
attributes={
'offense': {
'layup... |
"""
Mandelbrot & Julia set class for tkinter application.
This handles the computation of the Mandelbrot or Julia set as a numpy rgb array
which is loaded into a ImageTk.PhotoImage (and ultimately into a Tk.Canvas
for viewing in the GUI).
NB: use of Numba @jit decorators and pranges to improve performance.
For more i... |
<reponame>jakgel/clusterbuster
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 15 18:54:38 2017
@author: jakobg
"""
#!/usr/bin/env python
# Some classes for the relic lsit
# ...
from __future__ import division,print_function
import csv
import numpy as np
import clusterbuster.surveyclasses as c... |
import pandas as pd
import pyodbc
import omfn.xdttm as odt
import omfn.vbafn as vbf
import requests
TOKEN = '<KEY>'
def custom_msg_sender(chatid, msg):
url = "https://api.telegram.org/bot" + TOKEN + "/sendMessage?chat_id=" + str(chatid) + "&text=" + msg
requests.get(url)
class mssq:
def __init__(self):
... |
from math import atan2
import numpy as np
from functools import partial
import dask.array as da
from numba import cuda
import xarray as xr
from xrspatial.utils import ngjit
from xrspatial.utils import cuda_args
from xrspatial.utils import ArrayTypeFunctionMapping
from xrspatial.utils import not_implemented_func
f... |
<gh_stars>1-10
from numpy.core.multiarray import normalize_axis_index
from scipy import ndimage
import tensorflow as tf
import numpy as np
def random_rotation(
image,
rotation_range,
channel_axis=2,
fill_mode='nearest',
cval=255,
interpolation_order=1
):
"""
:param image: image as num... |
<reponame>abstractvector/python-victron<filename>victron/__init__.py
"""Python API wrapper for Victron"""
from json import loads as decode
import logging
import re
from victron.gateway_mqtt import MQTTGateway
from victron.system import System
_LOGGER = logging.getLogger(__name__)
class Victron:
"""Victron clie... |
<reponame>krakan/plocka<filename>main.py
import kivy
kivy.require('1.11.0') # replace with your current kivy version !
from kivy.app import App
from kivy.base import runTouchApp
from kivy.clock import Clock
from kivy.utils import platform
from kivy.uix.stacklayout import StackLayout
from kivy.uix.scrollview import Sc... |
<gh_stars>1-10
#!/usr/bin/env python
"""Unique Crater Distribution Functions
Functions for extracting craters from model target predictions and filtering
out duplicates.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import h5py
import sys
import utils.template_match_target as... |
<filename>code/ffi_tools.py
import numpy as np
#import fitsio
import matplotlib.pyplot as plt
import sep
from matplotlib.patches import Rectangle
def preprocess_dFFI(raw_data):
"""Preprocess the driftscan FFI
Currently performs these pre processing steps:
- Trims the edges to remove dark rows and collate... |
<filename>insights/parsers/sctp.py
"""
SCTP Socket State Parser
========================
Parsers provided by this module include:
SCTPEps - file ``/proc/net/sctp/eps``
-------------------------------------
SCTPAsc - file ``/proc/net/sctp/assocs``
----------------------------------------
"""
from insights import Par... |
try:
import ax
except ImportError:
ax = None
import logging
from ray.tune.suggest import Searcher
logger = logging.getLogger(__name__)
class AxSearch(Searcher):
"""Uses `Ax <https://ax.dev/>`_ to optimize hyperparameters.
Ax is a platform for understanding, managing, deploying, and
automating a... |
<reponame>mverleg/notex_package
from datetime import datetime
from inspect import isclass
from collections import OrderedDict
from copy import copy
from sys import stderr
from json_tricks.nonp import load
from os import listdir, walk, remove
from os.path import join, relpath, exists
from package_versions import Versio... |
<filename>apps/user_accounts/migrations/0001_initial.py
# Generated by Django 4.0.3 on 2022-03-31 21:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
class Migration(migrations.Migration):
initial = True
dependenci... |
<reponame>ShengyuH/Scene-Recognition-in-3D
import torch
import torch.utils.data
import torch.optim as optim
from tensorboardX import SummaryWriter
import os,sys
import MinkowskiEngine as ME
import time
from sklearn.metrics import jaccard_score,accuracy_score
import numpy as np
import pandas as pd
sys.path.append('..')
... |
import datetime
import logging
import uuid
import marshmallow as ma
from flask import url_for, g, jsonify
from flask.views import MethodView
from flask_smorest import Blueprint, abort
import http.client as http_client
from drift.core.extensions.jwt import current_user, requires_roles
from drift.core.extensions.urlreg... |
class Zoo:
def __init__(self, name, budget, animal_capacity, workers_capacity):
self.name = name
self.animals = []
self.workers = []
self.__animal_capacity = animal_capacity
self.__workers_capacity = workers_capacity
self.__budget = budget
def is_capacity_animals... |
# ## Tutorial
#
# This guide can help you start working with NetworkX.
#
# ### Creating a graph
#
# Create an empty graph with no nodes and no edges.
import networkx as nx
G = nx.Graph()
# By definition, a `Graph` is a collection of nodes (vertices) along with
# identified pairs of nodes (called edges, links, etc). ... |
<gh_stars>1000+
# Copyright 2019 gRPC 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 agre... |
__author__ = '<NAME>'
import time
import boto3
from flow.core.abstract_cluster import AbstractCluster, ClusterError
from flow.core.s3_filesystem import S3Filesystem
# `http://boto3.readthedocs.io/en/latest/reference/services/emr.html#EMR.Client.describe_cluster`_
CLUSTER_STATE_TERMINATED_WITH_ERRORS = 'TERMINATED_W... |
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
... |
<gh_stars>10-100
"""
Run CellO on a gene expression matrix
Authors: <NAME> <<EMAIL>>
"""
from optparse import OptionParser
import os
from os.path import join
import pandas as pd
from anndata import AnnData
import dill
import subprocess
import sys
from . import cello
from . import ontology_utils as ou
from . import lo... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Tests for node activation propagation and gate arithmetic
"""
from micropsi_core import runtime as micropsi
def prepare(test_nodenet):
nodenet = micropsi.get_nodenet(test_nodenet)
netapi = nodenet.netapi
source = netapi.create_node("Register", None, "S... |
<filename>scripts/M030.py
"""
Created by: <NAME>
Sep 21
IEEE Fraud Detection Model
- FE009
- Adding raddar user level features
- Add first, second, third digit of addr1 and addr2 features
- Drop only DOY features with low importance
"""
import numpy as np # linear algebra
import pandas as pd # data processing, CSV ... |
<reponame>RetailMeNotSandbox/dart
from abc import abstractmethod
import base64
import json
import logging
from pydoc import locate
import random
from boto.regioninfo import RegionInfo
from boto.sqs.connection import SQSConnection
from boto.sqs.jsonmessage import JSONMessage
from dart.model.message import MessageState
f... |
<filename>dtool_lookup_gui/views/log_window.py<gh_stars>0
#
# Copyright 2021-2022 <NAME>
#
# ### MIT license
#
# 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 w... |
<reponame>RT-Team/rt-bot
# RT AUtoMod - Mod Utils
from __future__ import annotations
from typing import TYPE_CHECKING, Union, Any
from datetime import timedelta
from re import findall
from time import time
import discord
from difflib import SequenceMatcher
from emoji import emoji_lis
if TYPE_CHECKING:
from .d... |
<reponame>zwgraham/Demand-as-Frequency-Response<filename>sbc/loads.py
import atexit
from serial import Serial
from xbee import XBee
from time import sleep
from ts7250v2 import dio
class LoadBase(object):
''' Virtual parent class for loads '''
def __init__(self):
pass
# priority (0 highest ------- lo... |
<filename>thingsdb/model/thing.py
import asyncio
import logging
from .prop import Prop
def checkevent(f):
def wrapper(self, event_id, *args):
if self._event_id > event_id:
logging.warning(
f'ignore event because the current event `{self._event_id}` '
f'is greath... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.append('./')
import six
import os
import os.path as osp
import math
import argparse
parser = argparse.ArgumentParser(description="Softmax loss classification")
# data
parser.add_argument('... |
<gh_stars>1-10
import SimpleHTTPServer
import SocketServer
import os
from threading import Thread
import unittest
from twitter.common.contextutil import pushd, temporary_dir, temporary_file
from twitter.common.dirutil import safe_mkdir
from twitter.pants.base.build_invalidator import CacheKey
from twitter.pants.cache ... |
<filename>ffthompy/tensorsLowRank/objects/sparseTensorWrapper.py
import numpy as np
from tt.core.vector import vector
from ffthompy.tensorsLowRank.objects.tucker import Tucker
from ffthompy.tensorsLowRank.objects.canoTensor import CanoTensor
from ffthompy.tensorsLowRank.objects.tensorTrain import TensorTrain
from fftho... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 15 14:12:02 2019
@author: itamar
"""
import bs4 as bs
import pickle
import datetime as dt
import pandas as pd
import os
import matplotlib.pyplot as plt
from matplotlib import style
import pandas_datareader as web
import requests
#First of all you n... |
import os
import ast
import math
import torch
import stable_nalu
import argparse
import stable_nalu.functional.regualizer as Regualizer
from decimal import Decimal
import numpy as np
import misc.utils as utils
import random
# Parse arguments
parser = argparse.ArgumentParser(description='Runs the simple function static... |
<reponame>rr-/termi
import argparse
import json
import sys
import time
from PIL import Image
from termi import term
from termi import term_settings
from termi import renderer
def positive_int(value):
value = int(value)
if value < 1:
raise argparse.ArgumentTypeError('Only positive integers allowed')
... |
import hashlib
import hmac
from io import BytesIO
from struct import unpack, pack
from zlib import crc32
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
import scapy.modules.six as six
from scapy.modules.six.moves import range
from ... |
<filename>batchflow/models/tf/inception_v1.py
""" <NAME>. et al "`Going Deeper with Convolutions
<https://arxiv.org/abs/1409.4842>`_"
"""
import tensorflow as tf
from .inception_base import Inception
from .layers import conv_block
_DEFAULT_V1_ARCH = {
'b': {'filters': [
[64, 96, 128, 16, 32, 32],
... |
import sys
from collections import Counter
from io import StringIO
import numpy as np
import gym
import gym.spaces
class TimeTable (gym.Env):
"""
-1 配置不可の枠
0 未配置の枠
1 現代文 毎日
2 数学 毎日
3 英語 毎日
"""
CLASS_SIZE = 2
WEEK_SIZE = 5
DAY_SIZE = 3
TIME_TABLE = np.zeros((CLASS_SIZE, WEEK_SIZE ... |
import os, sys, math
sys.path.insert(0, '../../..')
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy.stats
class Attention(nn.Module):
def __init__(self, encoder_size, decoder_size, device, type="additive"):
""" Attention module.
T... |
<reponame>gigforks/python-prompt-toolkit
"""
Highlighters for usage in a BufferControl.
Highlighters are very similar to processors, but they are applied after the
BufferControl created a screen instance. (Instead of right before creating the screen.)
Highlighters can't change the content of the screen, but they can m... |
from eclcli.common import command
from eclcli.common import utils
from ..networkclient.common import utils as to_obj
class ListStaticRoute(command.Lister):
def get_parser(self, prog_name):
parser = super(ListStaticRoute, self).get_parser(prog_name)
parser.add_argument(
'--name',
... |
<filename>Day 1/system.py
from SIRmodel import SIR
import matplotlib.pyplot as plt
# STD: April 22, 2021
N = 674635
I = 687
R = 660 + 25018 + 1 # recovered + vaccination + dead
S = N - I
def simulateWithNoQuarantine():
model = SIR(S, I, R, 1, 1./30)
ds = [[], [], [], []] # [date, S, I, R]
for i in rang... |
<gh_stars>1-10
# ===== IMPORTS =====
# === Standard library ===
from collections import defaultdict, Counter
import logging
import pathlib
from pathlib import Path
import json
# === Thirdparty ===
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
i... |
<reponame>kanokkorn/watering_robot
from gps3 import gps3
import serial
import math
import time
import csv
import os
# setup gps socket
ser = serial.Serial('/dev/ttyUSB0', 9600)
gps_socket = gps3.GPSDSocket()
data_stream = gps3.DataStream()
gps_socket.connect()
gps_socket.watch()
#read csv files
def tra... |
<gh_stars>0
import argparse
import os
import numpy as np
import scipy.spatial.qhull as qhull
import pandas as pd
from mpi4py import MPI
import stk
import utilities
from scipy.interpolate import griddata
if __name__ == "__main__":
# Parse arguments
parser = argparse.ArgumentParser(description="A simple post-p... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import datetime
from django.utils.functional import cached_property
from corehq.apps.hqwebapp.decorators import use_nvd3
from corehq.apps.locations.models import SQLLocation
from corehq.apps.... |
"""Find/replace widget."""
# FIXME: finding 'as' or 'asa' from 'asasasasa' is broken
import re
import sys
import tkinter as tk
from tkinter import ttk
import weakref
from porcupine import actions, get_tab_manager, images, tabs
# keys are tabs, values are Finder widgets
finders = weakref.WeakKeyDictionary()
class... |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
#!/usr/bin/env python3
import gi
import os
import sys
import uuid
import json
import signal
import socket
import warnings
import threading
from threading import Thread
gi.require_version("Notify", "0.7")
gi.require_version('Gtk', '3.0')
from gi.repository import Notify, GObject
def exit():
if(listenerThread):
... |
<gh_stars>0
class ShareCalendar:
def __init__(self):
try:
self.__server = smtplib.SMTP('smtp.gmail.com', 587)
self.__server.ehlo()
self.__server.starttls()
self.__server.ehlo()
# Next, log in to the server
self.__server.login("<EMAIL>"... |
<filename>equivalence/actions/get.py<gh_stars>0
# -*- coding: utf-8 -*-
from equivalence.AstraRastr import RASTR
from equivalence.tools.tool import changing_number_of_semicolons
class GettingParameter:
f"""
Класс предназначен для работы с ячейками таблиц в RastrWin3.\n
1.Метод "get_cell_row" - воз... |
import bpy
import math
from . import selection_sets
from bpy.types import Scene
from bpy.props import (
FloatProperty,
BoolProperty
)
"""
**********************************************************************
* def section *
*******************************... |
<reponame>vanhoefm/apbleed
# Scanning tests
# Copyright (c) 2013, <NAME> <<EMAIL>>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import time
import logging
logger = logging.getLogger()
import os
import subprocess
import hostapd
def check_scan(dev, params, oth... |
from queue import SimpleQueue
from file_ops import FileOps
class Node(FileOps):
"""
A node is representative of the vertices in a graph.
"""
def __init__(self, uuid, data, file):
"""
Initialize a Node object with uuid and data.
Args:
uuid (str): The uuid of the No... |
# -*- coding: utf-8 -*-
"""Using continuations as an escape mechanism."""
from ...syntax import macros, tco, continuations, call_cc
from ...ec import call_ec
def test():
# basic strategy using an escape continuation
def double_odd(x, ec):
if x % 2 == 0: # reject even "x"
ec("not odd")
... |
<reponame>iltempe/osmosi
#!/usr/bin/env python
"""
@file runner.py
@author <NAME>
@date 2007-07-26
@version $Id$
test different traffic_light types
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2007-2017 DLR (http://www.dlr.de/) and contributors
This file is part of SUMO.
SUMO is f... |
<filename>Image_cls/Original/experiments/classification.py
import os
from pprint import pprint
import torch
import torch.optim as optim
import passport_generator
from dataset import prepare_dataset, prepare_wm
from experiments.base import Experiment
from experiments.trainer import Trainer, Tester
from experiments.tra... |
"""
Testing bebin histogram values.
"""
import numpy as np
from numpy.random import uniform
from numpy.testing import assert_allclose
from scipy.interpolate import splrep, splint
import uncertainties.unumpy as unp
import rebin
from bounded_splines import BoundedUnivariateSpline, BoundedRectBivariateSpline
# -----... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import os, sys
os.environ['GLOG_minloglevel'] = '3'
import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test import im_detect
from fast_rcnn.test import vis_detections
from fast_rcnn.nms_wrapper import nms
from utils.timer import Timer
import matplotlib.pyplo... |
<reponame>bdevl/PGMCPC
import numpy as np
import torch
from fawkes.Expressions import FastRadialBasisFunction
from bottleneck.flux import FluxConstraintReducedOrderModel
import dolfin as df
class QuerryPoint(object):
def __init__(self, physics, x, bc):
assert isinstance(x, np.ndarray)
assert not... |
<reponame>jkhenning/autokeras
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.python.util import nest
from autokeras.engine import adapter as adapter_module
CATEGORICAL = 'categorical'
NUMERICAL = 'numerical'
class InputAdapter(adapter_module.Adapter):
def check(self, x):
... |
<gh_stars>0
""" Movable AABBs in space.
Classes:
Body
"""
from __future__ import annotations # NOTE: This is necessary below Python 3.10
from .aabb import AABB
from .collision import (CollisionData, get_axis_collision_distances,
get_axis_collision_times, get_collision_normals)
from .obj... |
<gh_stars>1-10
import mlrun.api.schemas
import mlrun.utils.singleton
from mlrun.api.utils.clients import nuclio
from mlrun.config import config, default_config
from mlrun.runtimes.utils import resolve_mpijob_crd_version
from mlrun.utils import logger
class ClientSpec(metaclass=mlrun.utils.singleton.Singleton,):
d... |
import os
import numpy
from subprocess import Popen, PIPE
import pymesh
import tempfile
from default_config.global_vars import apbs_bin, pdb2pqr_bin, multivalue_bin
import random
"""
Modified from:
computeAPBS.py: Wrapper function to compute the Poisson Boltzmann electrostatics for a surface using APBS.
<NAME> - LPD... |
<reponame>bryantChhun/napari-gui<filename>napari/components/_viewer/view/main.py
from qtpy.QtCore import QCoreApplication, Qt, QSize
from qtpy.QtWidgets import QWidget, QSlider, QVBoxLayout, QSplitter
from qtpy.QtGui import QCursor, QPixmap
from vispy.scene import SceneCanvas, PanZoomCamera
from ..._dims.view import Q... |
#!/usr/bin/env python
# ** The MIT License **
#
# Copyright (c) 2007 <NAME> (aka Insanum)
#
# 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 ... |
from collections import deque
from hwt.hdl.constants import DIRECTION
from hwt.hdl.types.bits import Bits
from hwt.interfaces.std import Clk, Signal, VectSignal
from hwt.interfaces.tristate import TristateSig
from hwt.simulator.agentBase import SyncAgentBase
from hwt.synthesizer.interface import Interface
from hwt.syn... |
#Draws PRC and ROC curves for predicted and true values
import argparse
from sklearn.metrics import precision_recall_curve,average_precision_score,roc_curve
import matplotlib.pyplot as plt
import h5py
import pickle
import numpy as np
from random import random
from operator import add
from pylab import rcParams
rcParam... |
<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ====================================================================
# @author: <NAME>
# @since: 11/02/2017
# @summary: A module with angle and coordinate transformations.
# @note: Parts of this file came from angle_utilities.py written by <NAME> of PCG at Cornell... |
# Run a whole brain searchlight
# Import libraries
import nibabel as nib
import numpy as np
from mpi4py import MPI
from brainiak.searchlight.searchlight import Searchlight
from sklearn.model_selection import StratifiedShuffleSplit, GridSearchCV
from sklearn.svm import SVC
from scipy.spatial.distance import euclidean
i... |
<reponame>Madision-Jack/blade-build
# Copyright (c) 2012-2014 <NAME> and contributors
# pylint: skip-file
# type: ignore
import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
import time
from collections import Sequence
from contextlib import contextmanager
from errno ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.