text
stringlengths
957
885k
<filename>fsl_sub/__init__.py #!/usr/bin/env fslpython # fsl_sub python module # Copyright (c) 2018-2021, University of Oxford (<NAME>) import datetime import errno import getpass import logging import os import socket import shlex import warnings from math import ceil from fsl_sub.exceptions import ( BadConfigur...
<gh_stars>10-100 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overlo...
#!/usr/bin/python # Copyright (c) 2020 Red Hat # 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 DOCUMENTATION = r""" module: podman_network author: - "<NAME> (@sshnaidm)" version_added:...
#!/usr/bin/env pnpython3 # # Update a ph5 file from a kef file # # <NAME>, January 2007 # import argparse import logging import os import os.path import time from ph5.core import experiment, kefx, columns PROG_VERSION = '2018.268' LOGGER = logging.getLogger(__name__) # Force time zone to UTC os.environ['TZ'] = 'UTC'...
# -*- coding: utf-8 -*- """ Created on Sat Aug 04 22:18:20 2018 @author0: MIUK @author1: FS Purpose: Deal with the operations on pure bipartite quantum states Bipartite states are represented using kronecker product i.e. with Psi_A = [a,b] Psi_b = [c, d] -> Psi_AB = Psi_A x Psi_B = [ac, ad, bc, bd] (x is a tensor...
<gh_stars>0 #! /usr/bin/env python """A matrix completion solver the implements Algorithm 6 (Matrix Completion via Inexact ALM Method) from "The Augmented Lagrange Multipler Method for Exact Recovery of Corrupted Low-Rank Matrices" by <NAME>, <NAME>, <NAME>, and <NAME> http://arxiv.org/abs/1009.5055 This version is ...
import logging import warnings import click import validators as val from praw.models import Submission from sqlalchemy import sql from tabulate import tabulate from . import extract from . import helper as h from . import paramtypes as types class EBFormatter(logging.Formatter): def format(self, record): ...
import json import logging import re import pytest from origo.auth.auth import Authenticate from origo.auth.credentials.client_credentials import ClientCredentialsProvider from origo.config import Config from origo.exceptions import ApiAuthenticateError from freezegun import freeze_time from tests.origio.auth.client...
# -*- encoding: utf-8 -*- '''Game manager module.''' # pylint: disable=fixme, line-too-long, invalid-name, undefined-variable # pylint: disable=too-many-branches, too-many-statements, too-many-arguments from random import randint import pygame from pygame.locals import * # pylint: disable=wildcard-import, unused-wildca...
from collections import Counter from numpy import log from sklearn.base import BaseEstimator, ClassifierMixin from data.data_examination import make_sig_words from data.pipelines import (tokenize_pipe, lower_pipe, stem_pipe, lemmatize...
import pandas import pdb import matplotlib import numpy as np #matplotlib.use('Agg') #import matplotlib.pyplot as plt import glob import sys #from matplotlib.ticker import MultipleLocator import json import os import math import random import time import BO_functions from termcolor import colored import subprocess from...
<filename>sprox/providerselector.py """ Provider Locator Module a module to help dbsprockets automatically find providers Copyright (c) 2008 <NAME> Original Version by <NAME> 2007 Released under MIT license. """ import inspect try: from sqlalchemy import MetaData from sqlalchemy.engine import Engine from...
<reponame>FIWARE-Ops/devops.Tools<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- from argparse import ArgumentParser from json import load, loads, dumps from os import environ, path from requests import get, post, patch, delete url_description = 'https://api.github.com/repos/{}?access_token={}' url_webh...
#!/usr/bin/env python ## WARNING: This file is generated #!/usr/bin/env python """Create a "virtual" Python installation """ virtualenv_version = "1.4.9" import sys import os import optparse import re import shutil import logging import distutils.sysconfig try: import subprocess except ImportError, e: if sys....
from django.test import TestCase from django.utils.timezone import now from users.models import User, Profile from streamblocks.models import IndexedParagraph, LandscapeGallery from cronache.models import Event, Location #from criterium.models import Race, Athlete class LocationModelTest(TestCase): @classmethod ...
#!/bin/env python3 #code by g1ng3rb1t3 (kevo) try: from telethon.sync import TelegramClient from telethon.tl.functions.messages import GetDialogsRequest from telethon.tl.types import InputPeerEmpty, InputPeerChannel, InputPeerUser from telethon.errors.rpcerrorlist import FloodWaitError from telethon...
#!/usr/bin/env python3 # # vsdev.py: https://github.com/kiyolee/vs-tools.git # # MIT License # # Copyright (c) 2020 <NAME> # # 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 restrictio...
from tensorflow.keras.layers import GlobalAveragePooling2D, GlobalMaxPooling2D, Reshape, Dense, multiply, Permute, Concatenate, Conv2D, Add, Activation, Lambda, Conv1D from tensorflow.keras import backend as K from tensorflow.keras.activations import sigmoid from utils import other_transform import tensorflow as tf imp...
<reponame>twright0/aoc-2021-oneline from aocd import get_data from aocd.transforms import lines from functools import reduce import json nums = lines(get_data(year=2021,day=18)) print((init := (lambda v,d,up: (((i := {}) or True) and i.update({'v': v, 'depth': d, 'up': up, 'right': Non...
<reponame>PacktPublishing/Extending-Machine-Learning-Algorithms<gh_stars>1-10 import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score,classification_report import matplotlib.pyplot as plt hrattr_data = pd.read_csv("WA_Fn-UseC_-HR-Empl...
from functools import wraps as _wraps from itertools import chain as _chain import json from .utils import convert_to, Logger, dec_con from decimal import Decimal import pandas as pd from time import sleep from datetime import datetime, timezone, timedelta import zmq import threading from multiprocessing import Process...
<reponame>shamelmerchant/CanTherm #!/usr/bin/env python """ Copyright (c) 2002-2009 <NAME> and the CanTherm Team 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 wi...
<gh_stars>0 from optimize_circuit.transformations import u_to_zxz_gates, u_to_zyz_gates from optimize_circuit.gates import OneQubitUnitary, X, Y, Z import numpy as np def optimize_one_qubit_circuit(gate_list, hardware): """Optimizes one qubit gate_list :param hardware: HardwareConfiguration :param gate_l...
<gh_stars>100-1000 # Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_allclose from astropy.time import Time from gammapy.data import FixedPointingInfo, PointingInfo from gammapy.utils.testing import assert_time_allclose, requires_data @requires_data() class TestFixedPoin...
<gh_stars>10-100 # Copyright <NAME> 2013. BSD 3-Clause license, see LICENSE file. import os import sys from unittest import TestCase, main, skipUnless try: from unittest.mock import patch except ImportError: from mock import patch from ..ansitowin32 import StreamWrapper from ..initialise import init from .uti...
<reponame>hawkowl/axiom<filename>axiom/test/test_paginate.py<gh_stars>1-10 # Copyright 2006 Divmod, Inc. See LICENSE file for details """ This module contains tests for the L{axiom.store.ItemQuery.paginate} method. """ from twisted.trial.unittest import TestCase from axiom.store import Store from axiom.item import...
import os from collections import defaultdict import gym import numpy as np from ray.rllib import MultiAgentEnv from ray.rllib.utils.typing import MultiAgentDict from griddly import GymWrapper from griddly.util.rllib.environment.observer_episode_recorder import ObserverEpisodeRecorder class RLlibEnv(GymWrapper): ...
import logging import pytest from pcdscalc.pmps import (LFE, KFE, select_bitmask_boundaries, get_bitmask, check_bitmask, check_actual_range, describe_bitmask) logger = logging.getLogger(__name__) # 32 bits, using numbers from 1 to 32 test_boundaries = list(rang...
<filename>sentiment/scripts/pickle_classifiers.py """Contains functionalities to train and pickle classifiers for sentiment classification using default training data.""" import os import pickle from nltk import SklearnClassifier, NaiveBayesClassifier from nltk import classify from sklearn.linear_model import Logistic...
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# linear algebra python # https://www.google.com/search?q=linear+algebra+python&sxsrf=ALeKk00bAclhj18xCwEbKZ27J5UMzPRTfA%3A1621259417578&ei=mXSiYPXXItqNr7wPzoSXsAY&oq=linear+al&gs_lcp=Cgdnd3Mtd2l6EAMYATIECCMQJzIECAAQQzIECAAQQzIECC4QQzICCAAyBQgAEMsBMgUIABDLATICCAAyAggAMgIILjoHCCMQsAMQJzoHCAAQRxCwAzoHCAAQsAMQQzoFCAAQkQI6...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'UserTask' db.delete_table('tasks_usertask') #...
<reponame>related-sciences/nxontology from typing import Dict, Iterable, Optional from networkx.drawing.nx_agraph import to_agraph from pygraphviz.agraph import AGraph from nxontology.ontology import Node, Node_Info, SimilarityIC def create_similarity_graphviz( sim: SimilarityIC[Node], nodes: Optional[Itera...
<filename>ask5.py import string,re #xrishmopoihsa to arxeio license.txt dioti to tales of two cities.txt ekane poly ora sto laptop mou na bgalei apotelesma(pano apo 2 ores),oi le3eis pou emfanizotan perissotero kai h suxnothta tous jtan oi e3hs: 1.the 8241 2.and 5071 3.of 4143 4.to 3653 5.a 3017 6.in 2665 7.it 2082 8....
<reponame>vishalbelsare/python-nnf """Interoperability with `DSHARP <https://github.com/QuMuLab/dsharp>`_. ``load`` and ``loads`` can be used to parse files created by DSHARP's ``-Fnnf`` option. ``compile`` invokes DSHARP directly to compile a sentence. This requires having DSHARP installed. The parser was derived b...
<filename>generators.py import numpy as np import keras from osgeo import gdal class iasi_generator(keras.utils.Sequence): """Class for keras data generation on IASI dataset.""" def __init__(self, files, batch_size=32, selected_channels=None, shuffle=True, dim_red=None, meta=False, norm_coeffs=None): ...
<gh_stars>100-1000 from keras.models import load_model import numpy as np from keras.optimizers import Adam from keras.models import Model from keras.layers import Dense, Conv2DTranspose, Conv2D, BatchNormalization, \ Activation, Concatenate, Input, MaxPool2D,\ UpSampling2D, ZeroPadding2D, Lambda, Add from...
<filename>magpysv/denoise.py<gh_stars>10-100 # -*- coding: utf-8 -*- # Copyright (C) 2016 <NAME> (University of Liverpool) # # Released under the MIT license, a copy of which is located at the root of # this project. """Module containing functions to remove external signal from geomagnetic data. Part of the ...
<reponame>ungleich/mri-connect import logging from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.gis.db.models import F, Q, Value from django.contrib.sites.shortcuts import get...
import gzip import json import os import time from pathlib import Path import boto3 COGNITO_STAGING_POOL = os.getenv("COGNITO_STAGING_POOL", "eu-west-1_mAQcge0PR") DATA_LOCATION = os.getenv("BIOMAGE_DATA_PATH", "./data") PULL = "PULL" class Summary(object): """ Utility singleton class used to report which ...
import time import ctypes from multiprocessing import Process, Manager from multiprocessing.sharedctypes import Array ARQUIVO = "BASEPROJETO.txt" PESOS_CPF_PRIMEIRO_DIGITO = [10, 9, 8, 7, 6, 5, 4, 3, 2] PESOS_CPF_SEGUNDO_DIGITO = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2] PESOS_CNPJ_PRIMEIRO_DIGITO = [5, 4, 3, 2, 9, 8, 7, 6, ...
<gh_stars>0 # -*- coding: utf-8 -*- """ This module provides functions to obtain the stationary state solutions. """ import numpy as np from .ode import * from scipy.integrate import ode from scipy.optimize import brentq from numba import jit import numba as nb def stable_branch(beta, state_meta, param_init, param_var...
<gh_stars>0 from django.shortcuts import render, get_object_or_404 from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from .models import Project from .forms import DataForm from django.contrib.auth.models import User from django.views.generic import ListView, DetailView, CreateView, UpdateV...
<reponame>nrupatunga/pytorch-deaf """ File: test_new.py Author: Nrupatunga Email: <EMAIL> Github: https://github.com/nrupatunga Description: Test script """ import argparse import cv2 import matplotlib.pyplot as plt import numpy as np import torch from scipy.fftpack import fft2, ifft2 from litdeaf import deafLitModel...
<reponame>ad3002/Lyrebird #!/usr/bin/env python # -*- coding: utf-8 -*- # #@created: 07.09.2011 #@author: <NAME> #@contact: <EMAIL> from PyExp import AbstractModel from trseeker.seqio.tab_file import sc_iter_tab_file class BlastResultModel(AbstractModel): """ Class for blast result data. Attr...
import abc import datetime import itertools import sys import time from dataclasses import dataclass from types import TracebackType from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type import humanize from rich import box from rich.console import Console, ConsoleRenderable, RenderableType, RenderH...
# -*- coding: utf-8 -*- """Commands for managing security groups.""" import click from ...jobs import securitygroups as sg_jobs from ...jobs.exceptions import AwsError from ...jobs.exceptions import MissingKey from ...jobs.exceptions import Non200Response from ...jobs.exceptions import PermissionDenied from ...jobs...
<reponame>krasnova19/technowlogger<filename>TestKeylogger/test_key.py import pynput.keyboard, threading, platform try: import win32gui as w except Exception: pass log = "" interval = 10 victim_system = platform.system() lastWindow = "" def append_to_log(string): global log log = lo...
import unittest import json import os import sys sys.path.append('../') from tasks.utils import task_utils class TestTaskUtils(unittest.TestCase): """Test case for testing the processing task utility functions.""" @classmethod def setUpClass(self): self.fl = '&fl=id,name:[name],format,path,fullpat...
<filename>india/COVID_Model.py import numpy as np from math import sqrt, floor, exp import copy import matplotlib.pyplot as plt class City: def __init__(self, opt): self.units_num = opt['units'] self.L = int(sqrt(self.units_num)) assert self.L ** 2 == self.units_num self.unit_dist ...
<reponame>pmansukhani/mpf """Classes which manage BCP transports.""" import asyncio from typing import Union from mpf.core.bcp.bcp_client import BaseBcpClient MYPY = False # noqa if MYPY: from mpf.core.machine import MachineController # pylint: disable-msg=cyclic-import,unused-import class BcpTransportManage...
<reponame>Keesiu/meta-kaggle #!/usr/bin/env python import json, sys, argparse from chess import * from chess.pgn import * # returns "NE", "SW" etc for a move, from the players perspective # and also the distance moved def move_direction_and_distance(board, move): from_file = file_index(move.from_squa...
<filename>guotai_brats17/data_process.py # -*- coding: utf-8 -*- # Implementation of Wang et al 2017: Automatic Brain Tumor Segmentation using Cascaded Anisotropic Convolutional Neural Networks. https://arxiv.org/abs/1709.00382 # Author: <NAME> # Copyright (c) 2017-2018 University College London, United Kingdom. All r...
<reponame>dfalveargOT/CropApp #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 5 15:45:11 2019 Copyright © 2019 DataRock S.A.S. All rights reserved. @author: DavidFelipe Second Module Matching each object with the corresponding coordinates """ try: import numpy as np import cv2 import ...
<reponame>AccelexTechnology/Company2Vec import pandas as pd import pickle revised_month_stock_df_dict = pickle.load(open("../dataset/revised_month_stock_df_dict.pkl","rb")) use_ticker_list_sec = [] use_stock_price_list = [] sector_array = [] industry_array = [] use_text_data = [] stock_size = 58 use_ticker_list_limit ...
import pytest from dbt.tests.util import run_dbt from tests.functional.graph_selection.fixtures import SelectionFixtures def run_schema_and_assert(project, include, exclude, expected_tests): # deps must run before seed run_dbt(["deps"]) run_dbt(["seed"]) results = run_dbt(["run", "--exclude", "never...
<reponame>TranXuanHoang/Python import json from blockchain import Blockchain from utility.verification import Verification from wallet import Wallet class NodeConsole: """ Initialize starting point of the app and provide console and/or terminal based commands for interacting with users. Attri...
<filename>src/mainwindow.py import os import shutil from PySide2 import QtCore, QtWidgets, QtUiTools class DropWidget(QtWidgets.QWidget): def __init__(self, *args, **kwargs): super(DropWidget, self).__init__(*args, **kwargs) self.setAcceptDrops(True) def dragEnterEvent(self, e): if e....
<reponame>pershint/reacdb from __future__ import print_function import matplotlib.pyplot as plt import seaborn as sns sns.set(font_scale=2) import numpy as np import scipy as sp import sys def dNdEPlot_pts(energies,numSpec,bin_left,bin_right,sst12,m12,PID=None): num_points = len(energies) opacity = 0.9 fi...
<filename>app/app.py import os import urllib.request import pandas as pd import numpy as np from flask import Flask, flash, request, redirect, render_template from werkzeug.utils import secure_filename import json import plotly import plotly.figure_factory as ff import plotly.offline as py import plotly.graph_objs as g...
<reponame>comnetsAD/ALCC import json import random import socket import subprocess import sys import time import traceback import analyze_pcap std_ports = { "ctrl": 6000, "udp_punch": 6001 } MAX_CTRL_MSG_SIZE = 1024 * 1024 run_time=30 res_dir="results" server_config = { "available_cong_algs": ["copa", "c...
<reponame>livlikwav/Algorithms ''' 7 7 2 0 0 0 1 1 0 0 0 1 0 1 2 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 ''' import copy N, M = map(int, input().split()) data = [list(map(int, input().split())) for _ in range(N)] temp = [[0] * M for _ in range(N)] result = 0 dx = [0, 0, -1, +1] dy = [...
#!/usr/bin/env python # -*- coding: utf8 -*- """ =^.^= WEBCAT =^.^= webcat is a simple website scanner for interesting files / directories. webcat was written while attending a pentesting class, therefore it's really quite simple. Version: 0.3 + added status filter + hea...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cs3/ocm/core/v1beta1/resources.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflect...
from dataclasses import replace import atlas.common as common import json def observation_coordinates(square_id): url = f"https://api.laji.fi/v0/warehouse/query/unit/list?selected=gathering.conversions.wgs84CenterPoint.lat%2Cgathering.conversions.wgs84CenterPoint.lon%2Cgathering.coordinatesVerbatim&pageSize=1000...
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#%% import numpy as np from itertools import repeat from itertools import starmap from scipy.stats import norm class ABCer: def __init__(self, iterations, particles, observations): self.iterations = iterations self.particles = particles self.observations = observations def initialize_...
<reponame>wangkua1/BDMC from __future__ import print_function import numpy as np from tqdm import tqdm import torch from torch.autograd import grad as torchgrad from BDMC import hmc from BDMC import utils # import matplotlib.pylab as plt import torchvision.utils as vutils import os def ais_trajectory(model, ...
import os from urllib.parse import urlparse import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key use...
# -*- coding: utf-8 -*- """ This module have serializing methods for data persistence so to let the package "save" custom objects session module made by Davtoh and powered by dill Dependency project: https://github.com/uqfoundation/dill """ try: # for security reason read this: http://www.benfrederickson.com/don...
<gh_stars>0 #!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _...
# -*- coding: utf-8 -*- import numpy as np import scipy.sparse as sp import torch import random import argparse import os import warnings warnings.filterwarnings("ignore") from utils import process from utils import aug from modules.gcn import GCNLayer from net.merit import MERIT from sklearn.linear_model import Logist...
import logging logging.debug("loading pyami.py") import sys import os import re import glob import lxml.etree as etree import pprint import ast from collections import Counter import traceback from pathlib import Path #from cmd_runner import CommandRunner from dict_lib import AmiDictionary from file_lib import FileLib...
#!/usr/bin/env python # copied from http://www.metaltoad.com/blog/plotting-your-load-test-jmeter from pylab import * import numpy as na import matplotlib.font_manager import csv import sys elapsed = {} timestamps = {} starttimes = {} errors = {} # Parse the CSV files for file in sys.argv[1:]: threads = int(file....
import store import unittest from flask import json class StoreTestCase(unittest.TestCase): def setUp(self): # TODO: setup fixture data, test revision bumps store.app.config['TESTING'] = True self.c = store.app.test_client() self.headers = { 'X-Ubuntu-Series': 16, ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\conta\Documents\script\Wizard\App\work\ui_files\email_confirm_dialog.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui...
<filename>onlinejudge/service/yukicoder.py # Python Version: 3.x # -*- coding: utf-8 -*- """ the module for yukicoder (https://yukicoder.me/) :note: There is the official API https://petstore.swagger.io/?url=https://yukicoder.me/api/swagger.yaml """ import json import posixpath import urllib.parse from typing import ...
from __future__ import absolute_import, division, print_function import tensorflow as tf import numpy as np from tensorflow.python.ops import variable_scope as vs from tensorflow.python.ops import math_ops, array_ops from tensorflow.python.util import nest from tensorflow.python.ops.nn import rnn_cell RNNCell = rnn_c...
# scheduler.py is used to submit, schedule, run jobs on the cluster. import os,sys,fcntl,subprocess,random,traceback,errno from time import sleep,time,ctime import ujson sys.path.append('/home/ben/code') sys.path.append('/home/ben/file_transfer') from manage_cluster import ManageCluster from file_transfer import Fil...
<filename>scheduleServer.py from flask_login import UserMixin, current_user, LoginManager, login_required, login_user, logout_user from flask import Flask, render_template, request, jsonify, redirect, url_for from flask_dance.consumer.backend.sqla import OAuthConsumerMixin, SQLAlchemyBackend from flask_dance.contrib.go...
<reponame>alexeyknorre/PyVK # -*- coding: utf-8 -*- """ Script for downloading, parsing and saving to CSV public user data from VK.com. """ import os import csv import random import requests import ast # Input variables basic_parameters = ["uid", "first_name", "last_name"] result_file = "../results/profiles.csv" ...
from ipaddress import summarize_address_range import os from tqdm import tqdm import numpy as np import time # import envs.env_v2 as env import envs.fixed_env_real_bw_v2 as env_oracle_v2 # import envs.env as env import envs.fixed_env as env_test import envs.fixed_env_real_bw as env_oracle from envs import load_trace ...
import pygame from random import randint, choice import config # tutorial: import tutorial tutorial.__dict__ # because flake8 ;-; # Boiler-plate: pygame.init() window = pygame.display.set_mode((config.window_width, config.window_height)) pygame.display.set_caption(config.window_title) clock = pygame.time.Clock() all...
<reponame>jagoPG/-restaurant-ml-inspector #!/usr/bin/env # -*- coding: utf-8 -*- """ Copyright 2017-2018 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LI...
import os import logging import types import numpy as np from glob import glob from types import TupleType, StringType from aeon import timer logger = logging.getLogger(name='finmag') class Tablewriter(object): # It is recommended that the comment symbol should end with a # space so that there is no danger th...
# Copyright 2021 QHAna plugin runner contributors. # # 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 ...
#!/usr/bin/env python import startup import pdb import os import time import torch from torch.utils.tensorboard import SummaryWriter from models import model_pc_to as model_pc from run.ShapeRecords import ShapeRecords from util.app_config import config as app_config from util.system import setup_environment #from ut...
# This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This file follows the # PEP8 Python style guide and uses a max-width of 120 characters per line. # # Author(s): # <NAME> <www.cedricnugteren.nl> import utils import matplotlib matplotlib.use('Agg') from matplotlib import r...
""" Gradcam visualization ref modified from implementation by fchollet (https://keras.io/examples/vision/grad_cam) """ import cv2 import numpy as np import os import sys import argparse import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers # Displa...
#!/usr/bin/env python3 from environments import SimulatorKinovaGripper, SimulatorKinovaGripperInverseJacobian, MultiPointReacher, FullDOFKinovaReacher, TwoJointPlanarKinova from environments import TwoJointVisualPlanarKinova, FOURDOFKinovaReacher import sys sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-package...
#!/usr/bin/env python3 # Python primary Helper to generate PWM audio signals to control a servos # Current setup involves sending a mono audio PWM signal from the left (or right) channel to control a servo # We use a USB soundcard/default audio jack to output audio waveform, but since it is usually 2V peak DC, we nee...
import os os.system("clear") os.system("cowsay ShellC0de - Tegal1337 | lolcat") # Take users TCP port as input port = raw_input("Enter TCP Port Number: ") # Convert input string to an integer deciPort = int(port) # Format the integer to Hex Integer hexPort = "{:02x}".format(deciPort) #print "Hex value of Decimal Numbe...
<filename>train_synth/dataloader.py<gh_stars>0 from torch.utils import data import matplotlib.pyplot as plt import numpy as np import cv2 import os import train_synth.config as config from src.utils.data_manipulation import resize, normalize_mean_variance, generate_affinity, generate_target """ globally generating ga...
<gh_stars>0 import logging from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.http import Http404 from django.urls import reverse from django.views.generic import UpdateView...
import sys sys.path.append('../') import bz2, os import random, string import importlib import _pickle as pickle from datetime import datetime, timedelta # ~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~< # OS & list MANAGEMENT FUNCTIONS <~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<~<...
#!/usr/bin/env python ''' Access will always be in control values (maybe value?) ''' import pickle from matplotlib import use use('TkAgg') from matplotlib import rcParams rcParams['ps.useafm'] = True rcParams['pdf.use14corefonts'] = True from matplotlib.pyplot import gca, grid, subplots_adjust,figure, xlabel, ylabel,...
""" Sponge Knowledge Base Using rules - immediate, duration """ from org.openksavi.sponge.examples.util import CorrelationEventsLog from org.openksavi.sponge.core.event import EventId def onInit(): global defaultDuration, correlationEventsLog defaultDuration = 2 # Variables for assertions onl...
# -*- coding: utf-8 -*- # # Finite State Machine # # Written in 2021 by Moky <<EMAIL>> # # ============================================================================== # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining...
import datetime import os from collections import OrderedDict import requests from unicodecsv import DictReader from unicodecsv import writer as Writer ERROR_MSG = "Script failed to process all files." API_DIR = os.path.abspath( os.path.dirname(os.path.dirname(__file__)) ) DATA_DIR = "{}/data".format(API_DIR) CSV...