text stringlengths 957 885k |
|---|
<gh_stars>0
"""
ADVANCED KEYBOARD AND MOUSE-CLICK LOGGING PROGRAM
by <NAME>
1/26/2019
Required Modules: Pywin32, Requests, Pynput
"""
from pynput.keyboard import Key, Listener
import os
import random
import requests
import smtplib
import socket
import threading
import time
import win32gui
from email import encoders
fr... |
from argparse import ArgumentParser, RawTextHelpFormatter
from filetype import is_image
from os import path
def _consent(args, output):
if path.exists(args[output]):
args[output] = path.abspath(args[output])
consent_ = input(f"Warning!!! \nThe '{args[output]}' file already exists."
... |
from recogym import env_1_args
from models.models_organic_bandit import RecoModelRTAEWithBanditTF, RecoModelRTAEWithBanditTF_Full
from models.models_organic import RecoModelRTAE, RecoModelItemKNN
from models.liang_multivae import MultiVAE
from recogym.agents import organic_user_count_args
from recogym.agents import Ra... |
<reponame>TiRoX/bi2018<filename>BI/0807_BI_GBDT.py
# -*- coding: utf-8 -*-
'''
@author: TheUniverse
'''
#Module importieren
import pandas as pd
import scipy.stats as stats
import lightgbm
import os
import numpy as np
from sklearn import preprocessing
from sklearn.preprocessing import LabelEncoder
from sklearn import... |
import argparse
import random
import shutil
import tensorflow as tf
import tensorflow.keras as keras
import os
import Data
import Model
import time
from tensorflow.keras import backend as K
def makeDataList(files):
train = []
val = []
test = []
for file in files:
with open(file, 'r') as f:
... |
"""grid.py. row and col facets."""
import stemgraphic.alpha as alpha
import stemgraphic.num as num
from stemgraphic.num import density_plot
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from warnings import warn
def small_multiples(
df,
var,
aggregation=False,
axes=None,
... |
<gh_stars>1-10
import datetime
import os
from io import BytesIO, StringIO
from logging import error
import pandas as pd
import psycopg2
import streamlit as st
from matplotlib import pyplot as plt
from pandas import DataFrame as df
from PIL import Image
# streamlit run /Users/apple/Documents/GitHub/SummerSession_2021/... |
<filename>torchbnn/modules/conv.py
import math
import torch
import torch.nn.init as init
from torch.nn import Module, Parameter
import torch.nn.functional as F
from torch.nn.modules.utils import _single, _pair, _triple
class _BayesConvNd(Module):
r"""
Applies Bayesian Convolution
Argument... |
from typing import Dict, Union
import logging
from overrides import overrides
import numpy as np
from allennlp.common.checks import ConfigurationError
from allennlp.common.file_utils import cached_path
from allennlp.common.util import START_SYMBOL, END_SYMBOL
from allennlp.data.dataset_readers.dataset_reader import D... |
<gh_stars>0
# Gráficos interativos com o *plotly*
## Gráficos de linha
Vamos começar criando gráficos de linha.
Primeiramente utilizaremos um pacote rápido e eficiente para a construção de gráficos interativos: o **plotly.express**
Para este tipo de plot é conveniente ter apenas um valor possível para a coordenada ... |
#!/usr/bin/env python3
"""
This example shows usage of mono camera in crop mode with the possibility to move the crop.
Uses 'WASD' controls to move the crop window, 'T' to trigger autofocus, 'IOKL,.' for manual exposure/focus:
Control: key[dec/inc] min..max
exposure time: I O 1..33000 [us]
sensi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017, <NAME>
# 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/LICEN... |
from abc import ABCMeta, abstractmethod
import numpy as np
from sklearn.base import (MetaEstimatorMixin,
is_classifier,
clone,)
from sklearn.utils import check_scalar
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_s... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 00:20:32 2015
@author: konrad
"""
import numpy as np
import pandas as pd
import datetime
import xgboost as xgb
if __name__ == '__main__':
## settings
projPath = './'
dataset_version = "kb8"
model_type = "xgb"
seed_value = 260
... |
<filename>drf_batch_requests/request.py
import json
import re
from io import BytesIO
from urllib.parse import urlsplit
from django.http import HttpRequest
from django.http.request import QueryDict
from django.utils.encoding import force_text
from rest_framework.exceptions import ValidationError
from drf_batch_reques... |
<reponame>sequana/sequanix
from PyQt5 import QtCore, Qt
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage, QWebEngineSettings
# potential resources for improvements:
# https://github.com/ralsina/devicenzo/blob/master/devicenzo.py
class Browser(Qt.QMainWindow):... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
<reponame>jakearchibald/pystache
# coding: utf-8
"""
Unit tests of renderengine.py.
"""
import cgi
import unittest
from pystache.context import Context
from pystache.parser import ParsingError
from pystache.renderengine import RenderEngine
from tests.common import assert_strings
class RenderEngineTestCase(unittes... |
<gh_stars>0
# Lint as: python2, python3
# Copyright 2017 Google 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pycocotools.coco as coco
from pycocotools.cocoeval import COCOeval
import numpy as np
import json
import os
import torch.utils.data as data
class ARC(data.Dataset):
num_classes = 40
default_res... |
<filename>src/restclientaio/manager.py
from collections import defaultdict
from typing import Any, AsyncIterable, AsyncIterator, Dict, Sequence, Type, \
TypeVar, cast
from weakref import WeakValueDictionary
from aiostream import stream
from .hydrator import Hydrator
from .request import Requester
from .resource ... |
<reponame>julemai/EEE-DA
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
"""
Provides physical, mathematical, computational, and isotope constants.
Definition
----------
Pi = 3.141592653589793238462643383279502884197
...
Define the following constants:
Ma... |
<filename>opusxml/core/opus.py
from __future__ import annotations
from collections import OrderedDict
import logging
from lxml import etree
import pint
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class Solution:
def __init__(self, filename: str):
tree = etree.parse(file... |
<reponame>openalto/network-simulator-data<gh_stars>0
#!/usr/bin/env python3
# import csv
import sys
# from sfp_eval.draw_bin.flow_loss_stat import Result
import numpy as np
import matplotlib.pyplot as plt
def generate_plots(data, filename):
N = 3
# drop_cgfp_vec= [0.11501636056812128, 0.20516286710563422, ... |
<gh_stars>1-10
from __future__ import print_function
from __future__ import unicode_literals
import sys
if sys.version_info[0] == 2: # python 2.x
def byte2int(b):
return ord(b)
else:
def byte2int(b):
return b[0]
import struct
class ProtocolParser:
def __init__... |
import csv, pickle, operator, os, sys
import collections
from functools import reduce
# parsing the arguments
args=sys.argv
if len(args)<2:
pathTBRuns=(os.path.dirname(os.getcwd()))
instats="*.csv"
pathPatterns="/home/richard/MyScripts/BovTB-nf/references/Stage1_patterns"
refName="Mycbovis... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to Systerel under one or more contributor license
# agreements. See the NOTICE file distributed with this work
# for additional information regarding copyright ownership.
# Systerel licenses this file to you under the Apache
# License, Version 2.0 (the "License... |
<reponame>13952522076/diffvg
"""
CUDA_VISIBLE_DEVICES=0 python visualize.py --model ResNetAE --msg demo1 --image ../data/emoji_rgb/train/0/240px-Emoji_u1f60d.svg.png
"""
import argparse
import os
import datetime
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torc... |
#!/usr/bin/env python
# coding: utf-8
# Experiment Configs
from debugprov.validity import Validity
from debugprov.divide_and_query import DivideAndQuery
from debugprov.single_stepping import SingleStepping
from debugprov.visualization import Visualization
from debugprov.heaviest_first import HeaviestFirst
from debugpr... |
"""Driver class for cloning all of the install modules
The clone driver uses git, wget, tar and zip to download all modules specified in install configuration
to the local machine.
"""
import os
from subprocess import Popen, PIPE
import shutil
from sys import platform
import installSynApps.DataModel.install_config as... |
<reponame>Oceancolour-RG/wagl<filename>wagl/brdf.py<gh_stars>0
#!/usr/bin/env python
"""
BRDF data extraction utilities
------------------------------
The :ref:`nbar-algorithm-label` and :ref:`tc-algorithm-label` algorithms
require estimates of various atmospheric parameters, which are produced using
`MODTRAN <http:/... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import logging
import numpy as np
import six
import time
from jiminy import vectorized
from jiminy.utils import display
logger = logging.getLogger(__name__)
extra_logger = logging.getLogger('jiminy.extra.'+__name__)
def stats(count):
flat = [e for vals in count for e in va... |
<reponame>TaixMiguel/ouroboros<filename>pyouroboros/dockerclient.py
from time import sleep
from logging import getLogger
from docker import DockerClient, tls
from os.path import isdir, isfile, join
from docker.errors import DockerException, APIError, NotFound
from pyouroboros.helpers import set_properties, remove_sha_... |
# IPND Stage 2 Final Project
# Titles for the story
titles = ["A Bunny Story", "Kites", "The Cat"]
# A Bunny Story fill-in-the-blanks and its corresponding answers.
bunny_story = "Once there was an ugly __1__ named Kevin. He was __2__ and nobody liked him. One day there was a Bhutan Marathon and the ugly bunny __3__ ... |
<reponame>Sentienz/datacollector-tests
import pytest
from streamsets.testframework.decorators import stub
@stub
@pytest.mark.parametrize('stage_attributes', [{'add_unsupported_fields_to_records': False},
{'add_unsupported_fields_to_records': True}])
def test_add_unsuppor... |
#!/usr/bin/python3 Bash
""" RapScore Flask routing file """
from flask import Flask, render_template, request, redirect, jsonify
from models import storage
from models.address import Address
from models.contact_info import Contact_info
from models.investment import Investment
from models.tourist import tourist
from mod... |
__author__ = 'swebb'
"""
This is a test to determine whether the two-body Coulomb attraction between
an electron and a positron is correct.
"""
from opal.fields import discrete_fourier_electrostatic as dfe
from opal.interpolaters_depositers import tent_dfes as depinterp
from opal.particles import non_rel_ptcl as ptcls... |
COLORCODE = {'Spades': 'black', 'Clubs': 'black', 'Diamonds': 'red', 'Hearts': 'red'}
class Card:
"""
Represents an individual card in the deck. Also controls the value of the cards.
"""
def __init__(self, facevalue, suit, basevalue, learner=False):
self.facevalue = facevalue
self.suit... |
#written by <NAME>
#What does this script do, you may ask.
#Good question!
#Its purpose is to take raw STMP data from the stmp TSV and properly format it for drawing by the STMP visualization program itself.
#This involves reading through the tsv, selecting values of interest, and converting them into proper "drawing... |
<filename>src/ksc/macos.py
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 <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 restriction, including without limitation the righ... |
import os, numpy as np
from scipy import ndimage
from matplotlib import pyplot as plt, cm
from pymicro.file.file_utils import HST_read, HST_write, HST_info
data_dir = '../../examples/data'
scan_name = 'steel_431x431x246_uint8'
scan_path = os.path.join(data_dir, scan_name + '.raw')
print('reading volume...')
data = HS... |
<reponame>fraserloch/hermes-protocol<filename>platforms/hermes-python/hermes_python/ontology/injection/__init__.py
from typing import Optional, Text, List, Mapping
from ...ffi.ontology.injection import InjectionKind, CInjectionRequestMessage, CInjectionResetCompleteMessage, CInjectionResetRequestMessage, CInjectionComp... |
<gh_stars>0
from core.search_engine import SearchEngine
from core.asr import ASR
class Finder:
'''
Take a segment and find if a chapter beginning is in it
try to get the location of the beginning
'''
def __init__(self):
super().__init__()
self.EXAMINE_DURATION = 30 # seconds... |
# Copyright 2018 Luddite Labs Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
<reponame>jvel07/ast
# -*- coding: utf-8 -*-
# @Time : 10/19/20 5:15 AM
# @Author : <NAME>
# @Affiliation : Massachusetts Institute of Technology
# @Email : <EMAIL>
# @File : prep_esc50.py
import numpy as np
import json
import os
import zipfile
import pandas as pd
import wget
# label = np.loadtxt('/data/s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, subprocess, shutil, sys, uuid, time, base64
from pyspark import SparkConf, SparkContext
from string import Formatter
import socket
try:
from kubernetes import config, client
from kubernetes.client.rest import ApiException
except ImportError:
pass
... |
<gh_stars>0
import os
import stat
import argparse
import json
import re
import subprocess
import eosfactory
import eosfactory.core.errors as errors
import eosfactory.core.logger as logger
import eosfactory.core.utils as utils
VERSION = "3.3.0"
EOSIO_VERSION = "1.8.0"
EOSIO_CDT_VERSION = "1.6.1"
PYTHON_VERSION = "3.5... |
"""Classes and functions for the human interface for the Driver Assistant env.
The human interface is designed to allow a human user manually control
the assistant system. This includes modifying the signal sent to the
driver (i.e. 'x', 'y', 'vx', 'vy') as well as the recommended
acceleratio and steering.
Specifical... |
<reponame>take-a-number/api<filename>take_a_number/tests/test_queue.py
from django.test import TestCase
from take_a_number.utils.class_queue import ClassQueue, QueueMember, QueueTA
class QueueTest(TestCase):
def create_member1(self, name="Name1", id=1):
return QueueMember(name, id)
def create_member2... |
import sys
import csv
import argparse
from pathlib import Path
from collections import defaultdict
from typing import Dict, Iterable, Set, Tuple
from tqdm import tqdm
from ranking_utils.dataset import ParsableDataset
from ranking_utils.datasets.trec import read_qrels_trec, read_top_trec
# some documents are longer ... |
import copy
import datetime
import warnings
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
import prefect
from prefect.client import Client
from prefect.core import Edge, Task
from prefect.engine.cloud.utilities import prepare_state_for_cloud
from prefect.engine.result import NoResult, ... |
# constants of db start
DID_INFO_DB_NAME = "hive_manage_info"
DID_INFO_REGISTER_COL = "auth_register"
USER_DID = "userDid" # compatible with v1
APP_ID = "appDid"
APP_INSTANCE_DID = "appInstanceDid"
DID_INFO_NONCE = "nonce"
DID_INFO_TOKEN = "token"
DID_INFO_NONCE_EXPIRED = "nonce_expired"
DID_INFO_TOKEN_EXPIRED = "tok... |
<gh_stars>0
from kw_tests.common_class import CommonTestClass
from kw_tests.support import Files, Dirs, DataRam, InfoRam
from kw_upload.data_storage import VolumeBasic
from kw_upload.data_storage import AStorage as DataStorage
from kw_upload.uploader.essentials import Calculates, Hashed, TargetSearch
from kw_upload.exc... |
<gh_stars>0
# coding: utf-8
# In[1]:
import numpy as np
from __future__ import division
filename = 'glove.6B.100d.txt'
def loadEmbeddings(filename):
vocab = []
embd = []
file = open(filename,'r')
for line in file.readlines():
row = line.strip().split(' ')
vocab.append(row[0])
... |
<reponame>foozmeat/hotline<gh_stars>1-10
import json
from pathlib import Path
import requests
from fivecalls.networking import http_get_json
from fivecalls.singleton import Singleton
class FiveCallsModel:
def __init__(self, **kwargs):
if kwargs:
for key, val in kwargs.items():
... |
import argparse
import time
import math
import torch
import torch.nn as nn
import torch.optim as optim
import data
parser = argparse.ArgumentParser(description='PyTorch Language Modeling')
parser.add_argument('--data', type=str, default='penn',
help='data corpus (penn, wikitext-2, wikitext-103)')... |
<gh_stars>1-10
from importer import *
import os
import numpy as np
from datetime import datetime as dt
import re
def gen_logfile_name(plateifu):
plate, ifu = plateifu.split('-')
status_file_dir = os.path.join(
os.environ['PCAY_RESULTSDIR'], plate)
status_file = os.path.join(status_file_dir, '{}.lo... |
<filename>2020/17.py
import time
def calc_neighbours(coordinates, state, expand=True, four_d = False):
new_cells = dict()
live_neighbours = 0
w_range = range(-1, 2) if four_d else [0]
for dx in range(-1, 2):
for dy in range(-1, 2):
for dz in range(-1, 2):
for dw in w... |
<reponame>blallen/CodePractice<gh_stars>0
from sklearn.preprocessing import MinMaxScaler
from sklearn.compose import make_column_transformer
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.colors as mcolors
import numpy
import pandas
import sklearn
import matplotlib.pyplot as plot
import matplotlib.patches ... |
"""
The `compat` module provides support for backwards compatibility with older
versions of django/python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django... |
import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
from sklearn.utils import shuffle
from hparams import HParams
import jax
from flax import jax_utils
try:
from ..utils.normalizer import Normalizer
from ..utils.utils import compute_latent_dimension
except (ImportError, ValueError):
... |
<filename>oaprogression/training/lgbm_tools.py
import warnings
from functools import partial
import lightgbm as lgb
import numpy as np
import pandas as pd
from hyperopt import hp, fmin, tpe, STATUS_OK, Trials, space_eval
from tqdm import tqdm
def fit_lgb(params, train_folds, feature_set, metric, return_oof_res=False... |
<filename>code/main_sensitivity_analyses.py
import pandas as pd
from utils.functions import psa_function, lognormal
from utils.parameters import Params
from models.no_screening import NoScreening
from models.no_screening_noMRI import NoScreeningNoMRI
from models.age_screening import AgeScreening
from models.age_screeni... |
<gh_stars>0
"""Test class for ProvStore service.
"""
# Copyright (c) 2015 University of Southampton
#
# 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 ... |
<filename>brav0/utils.py
import glob
import pickle
import warnings
from datetime import datetime
from pathlib import Path
from typing import Optional, Union
import numpy as np
import pandas as pd
import yaml
from astropy.table import Table
from box import Box
from pandas.core.frame import DataFrame
from pandas.core.se... |
<filename>benchmark/R2/bm-R2.py
import numpy as np
import numpy.linalg as LA
from classo import classo_problem, random_data
import cvxpy as cp
from time import time
import os
my_path = os.path.dirname(__file__)
l = [1, 2, 5, 7]
def huber(r, rho):
F = abs(r) >= rho
h = r**2
h[F] = 2*rho*abs(r)[F] - rho*... |
<gh_stars>0
import os
import re
import json
import logging
from bot import LOGGER
from time import sleep
from tenacity import *
import urllib.parse as urlparse
from bot.config import Messages
from mimetypes import guess_type
from urllib.parse import parse_qs
from bot.helpers.utils import humanbytes
from googleapiclient... |
<filename>srcWatteco/_ValidationTests.py
#!python
# -*- coding: utf-8 -*-
# TODO: Continuer ce fichier de tests automatisés (pour Non reg ou autres ...)
from _TestsTools import *
WTCParseInit()
# XYZAcceleration
WTCParseBuildTest(STDFrame, "11 05 800F 8000 41 17 0064 03E8 0003 1B58 0136 0136 0136 0000 03E8 4E20 90 ... |
# BSD-3-Clause License
#
# Copyright 2017 Orange
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the followi... |
<reponame>MagiCzOOz/signallike-embedding<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 31 13:33:35 2020
@author: prang
Usage:
train.py [-h | --help]
train.py [--version]
train.py [--gpu] [--gpudev GPUDEVICE] [--lr LR] [--maxiter MITER]
[--runname RNAME] [-... |
"""
Class and functions for dealing with credentials in UNC connections on Windows.
"""
from win_unc.errors import InvalidUsernameError
from win_unc.cleaners import clean_username
from win_unc.validators import is_valid_username
class UncCredentials(object):
"""
Represents a set of credentials to be used wit... |
import sys
import pymysql as mysql
from flask import abort
from config import OPENAPI_AUTOGEN_DIR, DB_HOST, DB_USER, DB_PASSWD, DB_NAME
sys.path.append(OPENAPI_AUTOGEN_DIR)
from openapi_server import models
def db_cursor():
return mysql.connect(host=DB_HOST,user=DB_USER,passwd=<PASSWORD>,db=DB_NAME).cursor()
... |
<gh_stars>1-10
# Copyright 2021 National Technology & Engineering Solutions
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS,
# the U.S. Government retains certain rights in this software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except... |
<filename>app/main.py
#!flask/bin/python
# Python
import os
import requests
import json
import MySQLdb
from datetime import date, datetime, timedelta
# FLASK
from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
# Data Science
import pandas as pd
import numpy as np
from scipy import stats
... |
<reponame>idimitrakopoulos/illuminOS
import lib.toolkit as tk
from lib.toolkit import log
class Board:
pin_mapping = []
button_click_counter = {}
# @timed_function
def __init__(self, pin_mapping):
self.pin_mapping = pin_mapping
# @timed_function
def get_pin_mapping(self):
ret... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json,time
from django.contrib.auth.models import User
from django.conf import settings
from django.http import HttpResponse as response
from django.http import HttpResponseRedirect as redirect
from django.shortcuts import render
from paypal.standard.forms import PayPalPa... |
<reponame>ngageoint/mrgeo<gh_stars>100-1000
from __future__ import print_function
import re
import sys
import traceback
from py4j.java_gateway import JavaClass, java_import
from pymrgeo.code_generator import CodeGenerator
from pymrgeo.instance import is_instance_of
from pymrgeo.java_gateway import is_remote
from pym... |
from __future__ import absolute_import
import torch as t
from torch import nn
from torchvision.models import vgg16
from model.region_proposal_network import RegionProposalNetwork
from model.faster_rcnn import FasterRCNN
from model.roi_module import RoIPooling2D
from utils import array_tool as at
from utils.config impo... |
# python script that recalculates rating of imdb listing
# coded using python 3.6 with Spyder by <NAME> on 2017
import requests
import math
from bs4 import BeautifulSoup # html parser
# temporary algorithm to determine better score
def adjustExtremes(num10, num1, numPos, numNeg, numTotal):
if numTotal <= 0:
... |
<filename>tests/api/cli.py
import unittest
import os
from click.testing import CliRunner
from devo.common import Configuration
from devo.api.scripts.client_cli import query
from devo.api.client import ERROR_MSGS, DevoClientException
class TestApi(unittest.TestCase):
def setUp(self):
self.query = 'from dem... |
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
options = webdriver.ChromeOptions()
options.add_argument('headless')
options.add_argument("user-data-dir=C:\\Users\\anila\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 7\\")
options.add_argument(r'--profi... |
<gh_stars>10-100
#!/usr/bin/python -tt
#
# Copyright 2009-2010 Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
<reponame>buildfail/frontera
from __future__ import absolute_import
import copy
import logging
import time
import collections
import six
from kafka.client_async import KafkaClient
from kafka import errors as Errors, TopicPartition
from kafka.future import Future
from kafka.protocol.commit import GroupCoordinatorRequest... |
<filename>01_DataType.py
# +, * 연산자
print('py''thon') # python - 중간에 + 생략되어 있다.
print('py' * 3) # pypypy
# 문자 인덱싱 & 슬라이싱
tempStr = 'python'
print(tempStr[0]) # p
print(tempStr[5]) # n
print(tempStr[1:4]) # yth
print(tempStr[-2:]) # on
# 유니코드
print('가')
print(type('가'))
print('가'.encode('utf-8'))
print(type('가... |
<filename>train_scrna.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import argparse
import os
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import lib.utils as utils
from lib.visualize_flow import visualize_transform, visualize... |
<filename>jobs/script.py
# spark-submit --packages org.apache.spark:spark-avro_2.12:3.0.1 script.py csv random_batch
# spark-submit --packages org.apache.spark:spark-avro_2.12:3.0.1 script.py parquet write
# du prints kb
# orc 191332 kb
# avro 286628 kb
# parquet 202772 kb
# csv 483432 kb
# json 1292192 kb
# write spe... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
import os
import re
import json
import random
reload(sys)
sys.setdefaultencoding("utf8")
def endCase(turlFile, case):
caseStr = ""
caseStr += "curl -X" + case["method"] + " 'http://default-host" + case["path"] + "?1=1"
for param in case["params"]:
... |
<reponame>mattWheeler1/spin-1<filename>diagnostics/plots/kibble-zurek/1d_spin-nematic_eigenvalues.py
import h5py
import numpy as np
import matplotlib.pyplot as plt
from numpy import conj
from numpy.fft import fft, ifft, ifftshift
# Load in data
filename_prefix = '1d_polar-BA-FM_5000'
data_file = h5py.File('../../../da... |
# -*- coding: utf-8 -*-
import xarray as xr
import numpy as np
import pandas as pd
import pathlib
class BaselineDatabase(object):
def __init__(self):
self.line_table = pd.DataFrame(columns=['site','install', 'line', 'instrument_id', 'comment'])
self.instrument_table = pd.DataFrame(columns = ['inst... |
from typing import Any, Iterable, Optional, Type
from blessed import Terminal
from pydantic import BaseModel
from app import constants as const
from app.actions import Action, Move, action_from_str
from app.entities import Exit, MovingWall, Patrol, PatrolVision, Player, Wall
from app.types.events import Event
from ap... |
# -*- coding: utf-8 -*-
__author__ = ["chrisholder"]
from typing import Tuple
import numpy as np
from numba import njit
from sktime.clustering.metrics.medoids import medoids
from sktime.distances import distance_alignment_path_factory
from sktime.distances.base import DistanceAlignmentPathCallable
def dba(
X: ... |
<filename>src/govsw/api/vswapi/vswapi_pb2_grpc.py<gh_stars>100-1000
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import vswapi_pb2 as vswapi__pb2
class VswApiStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Co... |
<filename>CS-383_Cloud-Computing_2020-Spring/prophet-forecasting/CloudProjectCode1.py
# import libraries
import boto3, re, sys, math, json, os, sagemaker, urllib.request
from sagemaker import get_execution_role
import numpy as np
import pandas as pd
import ... |
<reponame>isLinXu/DatasetMarkerTool<gh_stars>1-10
# -*-coding:utf-8-*-
'''使用walk方法递归遍历目录文件,walk方法会返回一个三元组,分别是root、dirs和files。
其中root是当前正在遍历的目录路径;dirs是一个列表,包含当前正在遍历的目录下所有的子目录名称,不包含该目录下的文件;
files也是一个列表,包含当前正在遍历的目录下所有的文件,但不包含子目录。
'''
import os
from PIL import Image
import cv2
from utils.fileHelper import os_mkdir
def ... |
<reponame>FriendlyUser/price-prediction
# Hold off on prophet image generation, probably not useful since I buy small caps
import sys
import argparse as ap
import pathlib
import glob
import shutil
from jinja2 import Template
from datetime import date, datetime
from stocks.util import get_config
from stocks.report imp... |
# coding: utf-8
# AUTOGENERATED BY gen_script.sh from kp4.py
# Copyright (C) <NAME>, Sun Aug 13 05:04:25 EAT 2017
from sqlalchemy import func
from flask_appbuilder import Model
from flask_appbuilder.models.mixins import AuditMixin, FileColumn, ImageColumn, UserExtensionMixin
from flask_appbuilder.models.decorators imp... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Last Update: 2016.1.25 12:20PM
'''Module for DOI and journal record operation
Also include the journal pdf function'''
import os,sys,re,glob
import time,random,gc
import requests
requests.packages.urllib3.disable_warnings()
from bs4 import BeautifulSoup
try:
from .d... |
<filename>feature_extraction_deep_learning/custom_module/extract_cqt_mel_spect_fma.py
import numpy
from audioread import NoBackendError
import pandas
import sys
MODULE_PATH = '/home/macbookretina/automatic-music-genre-classification/feature_extraction_deep_learning'
sys.path.insert(1, MODULE_PATH)
from custom_module.ut... |
<gh_stars>1-10
import re
import os
import mpld3
import base64
import plotly
import matplotlib
from io import BytesIO
from mpld3._server import serve
from matplotlib import pyplot as plt
import pandas as pd
current_path = os.path.dirname(__file__)
resources_path = os.path.abspath(
os.path.join(
current_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.