max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
ros_packages/qd_control/src/benchmark_trajectory.py | Chrispako990210/S4H2022-QuadrUS-V2 | 7 | 12775851 | <reponame>Chrispako990210/S4H2022-QuadrUS-V2
#! /usr/bin/env python3
import roslib
#roslib.load_manifest('joint_trajectory_test')
import rospy
import actionlib
from std_msgs.msg import Float64
import trajectory_msgs.msg
import control_msgs.msg
from trajectory_msgs.msg import JointTrajectoryPoint
from control_msgs.msg ... | 2.296875 | 2 |
src/backend/libro/solicitar/app.py | gpeitzner/SA_EZREAD | 0 | 12775852 | <reponame>gpeitzner/SA_EZREAD<gh_stars>0
import os
import time
import json
from werkzeug.utils import secure_filename, send_file
from bson import ObjectId
from flask import Flask, request, jsonify
import pymongo
from flask_cors import CORS
import boto3
app = Flask(__name__)
CORS(app)
db_host = os.environ["db_host"]... | 2.03125 | 2 |
src/Engine/Trajectory/__init__.py | MiguelReuter/Volley-ball-game | 4 | 12775853 | <reponame>MiguelReuter/Volley-ball-game
# encoding : UTF-8
from .trajectory_solver import *
from .thrower_manager import ThrowerManager
from .trajectory import Trajectory
| 1.265625 | 1 |
src/routes.py | budavariam/activity-visualizer | 0 | 12775854 | from flask import send_from_directory
from appserver import app
@app.server.route('/static/<path>')
def serve_static(path):
return send_from_directory('assets', path) | 2.09375 | 2 |
azure-devops/azext_devops/dev/common/config.py | vijayraavi/azure-devops-cli-extension | 0 | 12775855 | <reponame>vijayraavi/azure-devops-cli-extension
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------... | 1.882813 | 2 |
ip_interceptor/middleware.py | jasonqiao36/django-forbidden-ip | 0 | 12775856 | <gh_stars>0
from django.http import HttpResponseForbidden
from django.utils.deprecation import MiddlewareMixin
from .models import ForbiddenIP
class IPInterceptorMiddleware(MiddlewareMixin):
def __init__(self, get_reqponse):
self.get_response = get_reqponse
def validate_ip(self, remote_ip):
... | 2.203125 | 2 |
ptbaselines/algos/ddpg/models.py | KongCDY/baselines_pytorch | 0 | 12775857 | <reponame>KongCDY/baselines_pytorch<gh_stars>0
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import numpy as np
from ptbaselines.algos.common.models import get_network_builder
from ptbaselines.algos.common.torch_utils import init_weight
class Actor(nn.Module):
def ... | 2.15625 | 2 |
jobboard/messages.py | OnGridSystems/RobotVeraWebApp | 11 | 12775858 | from django.utils.translation import ugettext_lazy as _
MESSAGES = {
'VacancyChange': _('Vacancy status change now pending...') + ' <span data-uk-spinner="ratio: 0.5"></span>',
'Not_VacancyChange':
'<span class="red-text" data-uk-icon="ban"></span> To add new pipeline action you have to disab... | 1.796875 | 2 |
src/simplempu2.py | k323r/roller | 0 | 12775859 | import machine
class MPUSimple():
def __init__(self, i2c, address=0x69):
self._i2c = i2c
self._addr = address
self._i2c.start()
self._i2c.writeto(self._addr, bytearray([107, 0]))
self._i2c.stop()
def _get_raw_values(self):
self._i2c.start()
raw_data = se... | 2.609375 | 3 |
adventure_anywhere/s3_bucket_saves.py | zhammer/adventure-anywhere | 0 | 12775860 | import io
from typing import Optional
import boto3
import botocore
from adventure_anywhere.definitions import SavesGateway
s3 = boto3.resource("s3")
class S3BucketSavesGateway(SavesGateway):
bucket_name: str
def __init__(self, bucket_name: str) -> None:
self.bucket_name = bucket_name
def fetc... | 2.296875 | 2 |
actrie/__init__.py | ifplusor/actrie | 8 | 12775861 | #!/usr/bin/env python
# encoding=utf-8
from .matcher import Matcher, Context, PrefixMatcher
__all__ = ["Matcher", "Context", "PrefixMatcher"]
__version__ = "3.2.4"
| 1.195313 | 1 |
fym/models/quadrotor.py | JungYT/fym | 14 | 12775862 | import numpy as np
from fym.core import BaseEnv, BaseSystem
from fym.utils import rot
def hat(v):
v1, v2, v3 = v.squeeze()
return np.array([
[0, -v3, v2],
[v3, 0, -v1],
[-v2, v1, 0]
])
class Quadrotor(BaseEnv):
"""
Prof. <NAME>'s model for quadrotor UAV is used.
- ht... | 2.734375 | 3 |
app.py | mattfeltonma/azure-tenant-activity-logs | 0 | 12775863 | import os
import sys
import logging
import json
import requests
import datetime
from msal import ConfidentialClientApplication
# Reusable function to create a logging mechanism
def create_logger(logfile=None):
# Create a logging handler that will write to stdout and optionally to a log file
stdout_handler = l... | 2.578125 | 3 |
cnn_train.py | sg-nm/Operation-wise-attention-network | 102 | 12775864 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.utils.data import DataLoader
import torchvision.transforms as transfor... | 2.3125 | 2 |
smc-monitoring/smc_monitoring/wsocket.py | gabstopper/smc-python | 30 | 12775865 | <reponame>gabstopper/smc-python
import os
import ssl
import json
import select
import logging
import threading
from pprint import pformat
from smc import session
import websocket
logger = logging.getLogger(__name__)
def websocket_debug():
websocket.enableTrace(True)
class FetchAborted(Exception):
pass
c... | 2.5 | 2 |
IssueTypes.py | ckelleyRH/3age | 0 | 12775866 | from enum import Enum
class IssueTypes(Enum):
REGRESSIONS = "REGRESSIONS"
NEW = "NEW"
OLD = "OLD"
| 2.296875 | 2 |
sampler/Sampler.py | epistoteles/unlearning-fairness | 0 | 12775867 | <filename>sampler/Sampler.py
from statistics import harmonic_mean
from scipy.interpolate import CubicSpline
import random
class Sampler:
def __init__(self, strategy=None):
if strategy is None:
strategy = ['age', 'gender', 'race']
if not set(strategy).issubset({'age', 'gender', 'race'})... | 3.03125 | 3 |
app/__init__.py | rockyCheung/pursoul | 2 | 12775868 | <gh_stars>1-10
#coding:utf-8
from flask import Flask, request, redirect
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_migrate import Migrate
from datetime import datetime
from config import config, Config
bootstrap = Bootstrap()
db = SQL... | 2.5 | 2 |
stringFunctions.py | marcos8896/Python-Crash-Course-For-Beginners | 0 | 12775869 | <filename>stringFunctions.py
#String functions
myStr = 'Hello world!'
#Capitalize
print(myStr.capitalize())
#Swap case
print(myStr.swapcase())
#Get length
print(len(myStr))
#Replace
print(myStr.replace('world', 'everyone'))
#Count
sub = 'l'
print(myStr.count(sub))
#Startswith
print(myStr.startswith('Hello'))
#E... | 3.828125 | 4 |
cogrun.py | dribnet/ResearchPortfolioCode | 0 | 12775870 | <filename>cogrun.py<gh_stars>0
# Prediction interface for Cog ⚙️
# Reference: https://github.com/replicate/cog/blob/main/docs/python.md
import os
import cog
import pathlib
from pathlib import Path
from explorer import do_setup, perform_analysis, prepare_folder
# https://stackoverflow.com/a/6587648/1010653
import temp... | 2.609375 | 3 |
rsHRF/rsHRF_GUI/datatypes/timeseries/bold_preprocessed.py | BIDS-Apps/rsHRF | 16 | 12775871 | <reponame>BIDS-Apps/rsHRF
import numpy as np
from scipy.io import savemat
from copy import deepcopy
from ...datatypes.misc.parameters import Parameters
from .timeseries import TimeSeries
from .bold_raw import BOLD_Raw
class BOLD_Preprocessed(TimeSeries):
"""
This s... | 2.390625 | 2 |
magmap/atlas/edge_seg.py | kaparna126/magellanmapper | 0 | 12775872 | <gh_stars>0
# Segmentation based on edge detection
# Author: <NAME>, 2019
"""Re-segment atlases based on edge detections.
"""
import os
from time import time
import SimpleITK as sitk
import numpy as np
from magmap.atlas import atlas_refiner
from magmap.settings import config
from magmap.cv import chunking, cv_nd, seg... | 2.234375 | 2 |
teeth_overlord/tests/unit/util.py | rackerlabs/teeth-overlord | 0 | 12775873 | <reponame>rackerlabs/teeth-overlord
"""
Copyright 2013 Rackspace, 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 l... | 1.804688 | 2 |
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_resource_management_client_enums.py | rsdoherty/azure-sdk-for-python | 2,728 | 12775874 | <reponame>rsdoherty/azure-sdk-for-python<filename>sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_resource_management_client_enums.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved... | 2.03125 | 2 |
Blackjack2.py | gusghrlrl101/BlackJack-AI | 0 | 12775875 | import random
import numpy as np
import matplotlib.pyplot as plt
import copy
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib import colors
##
counting = [0 for i in range(12)]
counting_temp = [0 for i in range(12)]
def refresh_counting(num):
global counting
counting[num] += 1... | 3.125 | 3 |
predictor.py | RKJenamani/La_Liga_Predictor_ML | 0 | 12775876 | <reponame>RKJenamani/La_Liga_Predictor_ML<filename>predictor.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from sklearn.preprocessing import scale
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SV... | 2.984375 | 3 |
baselines/deepq/prediction/example/atari-gray/example.py | yenchenlin/rl-attack-detection | 66 | 12775877 | import tensorflow as tf
import numpy as np
import cv2
import argparse
import sys, os
import logging
def get_config(args):
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
return config
def get_cv_image(img, mean, scale):
return img
def main(args):
from tfacvp.model import Actio... | 2.546875 | 3 |
src/pywebapp/www/app.py | WalsonTung/pywebapp | 0 | 12775878 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
'''
async web application
'''
import logging;logging.basicConfig(level=logging.INFO)
import asyncio,os,json,time
from datetime import datetime
from aiohttp import web
from jinja2 import Environment,FileSystemLoader
from config import configs
impo... | 2.078125 | 2 |
main.py | DaveLorenz/DeepLearningApp | 3 | 12775879 | <gh_stars>1-10
# load Flask
import flask
app = flask.Flask(__name__)
from flask import Flask, render_template,request
# load model preprocessing
import numpy as np
import pandas as pd
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import keras.models
f... | 2.765625 | 3 |
scripts/bin2hex.py | buehlerIBM/microwatt | 0 | 12775880 | #!/usr/bin/python
#!/usr/bin/python3
import sys
import subprocess
import struct
with open(sys.argv[1], "rb") as f:
while True:
word = f.read(8)
if len(word) == 8:
print("%016x" % struct.unpack('Q', word));
elif len(word) == 4:
print("00000000... | 2.96875 | 3 |
models/folder.py | tranquilitybase-io/tb-houston-service | 1 | 12775881 | from config import db, ma
class Folder(db.Model):
__tablename__ = "folder"
__table_args__ = {"schema": "eagle_db"}
id = db.Column(db.Integer, primary_key=True)
parentFolderId = db.Column(db.String(45))
folderId = db.Column(db.String(45))
folderName = db.Column(db.String(100))
sta... | 2.40625 | 2 |
tests/conftest.py | jajimer/sinergym | 23 | 12775882 | <filename>tests/conftest.py
import os
import shutil
from glob import glob # to find directories with patterns
import pkg_resources
import pytest
from opyplus import Epm, Idd, WeatherData
from sinergym.envs.eplus_env import EplusEnv
from sinergym.simulators.eplus import EnergyPlus
from sinergym.utils.config import Co... | 1.734375 | 2 |
pixAssist.py | vinicius9141/pixAssistInformatica | 0 | 12775883 | import sqlite3
# import win32api
banco = sqlite3.connect('pixClientes.db')
cursor = banco.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS registros (
data_pagamento_pix DATE,
valor_pix NUMERIC (10,2)
);''')
#criando a função que insere um pix
def inserirPix... | 3.53125 | 4 |
CursoEmVideo/Mundo3/Exercicios/ex106.py | rafaelgama/Curso_Python | 1 | 12775884 | <filename>CursoEmVideo/Mundo3/Exercicios/ex106.py
# Faça um mini-sistema que utilize o Interactive Help do Python. O usuário vai digitar o comando e o manual vai aparecer.
# Quando o usuário digitar a palavra 'FIM', o programa se encerrará. Importante: use cores.
c = ('\033[m','\033[1;32m','\033[1;31m','\033[7:30m')... | 3.921875 | 4 |
src/predict_emotions.py | sorizeta/face-emotion-recognition | 0 | 12775885 | <gh_stars>0
CUDA_VISIBLE_DEVICES=0
import csv
import numpy as np
import cv2
import glob
from tensorflow.keras.models import load_model
from facial_analysis import FacialImageProcessing
imgProcessing=FacialImageProcessing(False)
INPUT_SIZE = (224, 224)
model=load_model('../models/affectnet_emotions/mobilenet_7.h5')
m... | 2.390625 | 2 |
master/TaskMaster.py | MaastrichtU-BISS/PyTaskManager | 6 | 12775886 | <filename>master/TaskMaster.py
from flask import Flask, Response, request
import json
from DbDao import DbDao
import signal
import sys
import time
# Init configuration file
configFile = open("config.json")
config = json.load(configFile)
configFile.close()
time.sleep(10)
app = Flask('TaskMaster')
dbDao = DbDao(config... | 2.40625 | 2 |
models/component/attention_cell_sequence.py | foocker/Image2Katex | 3 | 12775887 | '''
File: attention_cell_sequence.py
Project: component
File Created: Friday, 28th December 2018 6:05:05 pm
Author: xiaofeng (<EMAIL>)
-----
Last Modified: Friday, 28th December 2018 6:50:40 pm
Modified By: xiaofeng (<EMAIL>>)
-----
Copyright 2018.06 - 2018 onion Math, onion Math
'''
import collections
import numpy a... | 2.671875 | 3 |
dataworkspace/dataworkspace/apps/explorer/utils.py | uktrade/jupyterhub-data-auth-admin | 1 | 12775888 | <filename>dataworkspace/dataworkspace/apps/explorer/utils.py
import json
import logging
import re
from contextlib import contextmanager
from datetime import timedelta
import psycopg2
import sqlparse
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.forms im... | 2 | 2 |
algorithms/djb2_nokoyawa.py | CryptEncrypt/hashdb | 0 | 12775889 | #!/usr/bin/env python
DESCRIPTION = "Variant of djb2 hash in use by Nokoyawa ransomware"
# Type can be either 'unsigned_int' (32bit) or 'unsigned_long' (64bit)
TYPE = 'unsigned_int'
# Test must match the exact has of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
TEST_1 = 3792689168
def ... | 2.875 | 3 |
plotting.py | peterwinter/boxcluster_tutorial | 0 | 12775890 | import matplotlib.pyplot as plt
def add_cuts(ax, cuts, N):
if cuts[-1] != N:
cuts.append(N)
print(len(cuts))
c_last = 0
for c in cuts:
color = 'k'
ax.plot([c, c], [c, c_last], color)
ax.plot([c, c_last], [c, c], color)
ax.plot([c, c_last], [c_last, c_last], colo... | 2.640625 | 3 |
test/BaseCurrencyAdjustmentTest.py | harshal-choudhari/books-python-wrappers | 1 | 12775891 | #$Id$#
from books.model.BaseCurrencyAdjustment import BaseCurrencyAdjustment
from books.service.ZohoBooks import ZohoBooks
import os
access_token = os.environ.get('ACCESS_TOKEN')
organization_id = os.environ.get('ORGANIZATION_ID')
zoho_books = ZohoBooks(access_token, organization_id)
base_currency_adjustment_api = z... | 1.976563 | 2 |
track3/utils/vis/vis_split.py | NVIDIAAICITYCHALLENGE/2018AICITY_Beihang | 4 | 12775892 | <reponame>NVIDIAAICITYCHALLENGE/2018AICITY_Beihang
import numpy as np
import sys
import os
import cv2
#version_num = sys.argv[1]
root_path = 'home_directory/VIC/track3/new/tracklets'
track_res_file = os.path.join(root_path, 'track_res_idx_v5_1_0.4_nodate.txt') #'track_res_idx_' + version_num + '.txt')
with open(trac... | 2.046875 | 2 |
CODE/run_dapt_task.py | Zaaachary/CSQA | 0 | 12775893 | #! -*- encoding:utf-8 -*-
"""
@File : run_dapt_task.py
@Author : <NAME>
@Contact : <EMAIL>
@Dscpt :
"""
import argparse
import logging
import os
import time
from pprint import pprint
from transformers import AlbertTokenizer, BertTokenizer
from dapt_task.data import *
from dapt_task.controller import... | 2.140625 | 2 |
sip/execution_control/configuration_db/sip_config_db/states/tests/test_services.py | SKA-ScienceDataProcessor/integration-prototype | 3 | 12775894 | # coding=utf-8
"""Unit testing for the states.services module."""
from ..service_state import ServiceState
from ..services import get_service_state_list
from ... import ConfigDb
DB = ConfigDb()
def test_states_get_service_list():
"""Get the list of known services."""
DB.flush_db()
service = ServiceState(... | 2.421875 | 2 |
Pyscripts/ShortPaper/1.GriddingData/GD05_LandCoverData.py | ArdenB/fireflies | 0 | 12775895 | """
Script goal,
Open land cover data and build a simple cover map
"""
#==============================================================================
__title__ = "LandCover"
__author__ = "<NAME>"
__version__ = "v1.0(12.03.2021)"
__email__ = "<EMAIL>"
#=================================================... | 2.515625 | 3 |
anime/demo/demo9.py | SodaCookie/pygame-animations | 14 | 12775896 | import pygame
import anime
import random
pygame.init()
screen = pygame.display.set_mode((800, 600))
squares = []
entrance = {
'x' : -50,
'y' : 300
}
exit = {
'x' : 850,
'y' : 300
}
episode = anime.Episode(entrance, exit)
playing = True
while playing:
mx, my = pygame.mouse.get_pos()
for e in p... | 2.75 | 3 |
1D-Burger-SWAG/utils/post.py | tailintalent/ar-pde-cnn | 51 | 12775897 | import torch
import matplotlib as mpl
mpl.use('agg')
import numpy as np
import os
import scipy.integrate as integrate
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.lines import Line2D
from matplotlib import rc
def plotPred(args, t, xT, uPred, uTarget, epoch, bidx=0):
'''
Plots a s... | 2.1875 | 2 |
bsbang-suggester.py | buzzbangorg/bsbang-indexer | 0 | 12775898 | #!/usr/bin/env python3
import argparse
import requests
from bioschemas_indexer import indexer
# MAIN
parser = argparse.ArgumentParser('Run a test query against the Solr instance')
parser.add_argument('query')
args = parser.parse_args()
_, solr = indexer.read_conf()
solrSuggester = 'http://' + solr['SOLR_SERVER'] + ... | 2.609375 | 3 |
2021/8b.py | combatopera/advent2020 | 2 | 12775899 | #!/usr/bin/env python3
from itertools import permutations
from pathlib import Path
class Figure(frozenset):
@classmethod
def parse(cls, text):
lines = [l for l in text.splitlines() if l]
for digit in range(10):
digittext = ''.join(l[3 * digit:3 * (digit + 1)] for l in lines)
... | 3.03125 | 3 |
mgn/datasets/clevr_questions.py | realRaBot/mgn | 13 | 12775900 | <filename>mgn/datasets/clevr_questions.py
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File: clevr_questions.py
# Author: anon
# Email: <EMAIL>
# Created on: 2020-05-18
#
# This file is part of MGN
# Distributed under terms of the MIT License
import logging
import os
import os.path as osp
import sys
from itertoo... | 1.9375 | 2 |
DiffTRe/custom_space.py | moradza/difftre | 10 | 12775901 | <reponame>moradza/difftre<filename>DiffTRe/custom_space.py
from jax_md import space
from jax import ops
import jax.numpy as jnp
def rectangular_boxtensor(box, spacial_dim):
return ops.index_update(jnp.eye(spacial_dim), jnp.diag_indices(spacial_dim), box)
def scale_to_fractional_coordinates(R_init, box):
spa... | 2.21875 | 2 |
process.py | GBLin5566/An-Automated-Traditional-Chinese-Dialogue-Generating-System | 4 | 12775902 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import range
import utils
import argparse
import time
import os
import sys
import random
import math
import json
import codecs
import numpy as np
import utils
from util... | 2.328125 | 2 |
improved_DNS_lookup.py | ThanosGkara/improved_DNS_lookup | 0 | 12775903 | #!/usr/bin/python
"""
Author: <NAME>
email: <EMAIL>
The script is written on python >=2.6
Script to resolve hostnames and ips from DNS
Depends on python-dns " yum install python-dns "
"""
import sys
import argparse
import ipaddress
from pprint import pprint
try:
import dns.resolver
import dns.reversename
... | 3.25 | 3 |
LeetCodeSolutions/LeetCode_0286.py | lih627/python-algorithm-templates | 24 | 12775904 | class Solution:
def wallsAndGates(self, rooms: List[List[int]]) -> None:
"""
Do not return anything, modify rooms in-place instead.
"""
if not rooms:
return
INF = 2 ** 31 - 1
m, n = len(rooms), len(rooms[0])
from collections import deque
qu... | 3.078125 | 3 |
tests/test_core.py | astromancer/pyshoc | 0 | 12775905 | import more_itertools as mit
import functools as ftl
from recipes.testing import Expect
from astropy.io.fits.hdu.base import _BaseHDU
from pathlib import Path
from pySHOC import shocCampaign, shocHDU, shocNewHDU, shocBiasHDU, shocFlatHDU
import pytest
import numpy as np
import os
import tempfile as tmp
# TODO: old + n... | 1.859375 | 2 |
list_files/rootpath.py | alepuzio/listfiles | 0 | 12775906 | import sys
import os
from tests.test_single_file import PhysicalData
from tests.test_single_file import SingleFile
import pytest
class Rootpath:
"""
@overvieww: class of the absolute path of root directory
"""
def __init__(self, opts):
self.rootpath = opts[1] #TODO study how to resolve the cons... | 2.96875 | 3 |
Experiments/Aljazeera/web_scrap/wlog.py | Ahmad-Fahad/Web-Scraping | 0 | 12775907 | import logging
def set_custom_log_info(file):
logging.basicConfig(filename=file , level=logging.INFO)
def report(e:Exception):
logging.exception(str(e)) | 2.5625 | 3 |
build/SCA/script/x_developer/developer_tools.py | oliverpatrick/python-screen_click_ai | 26 | 12775908 | <filename>build/SCA/script/x_developer/developer_tools.py
import threading
import random
import os
import time
import smtplib
import socket
from os import walk
from pynput.keyboard import Controller,Key
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from script.x_modules import send... | 2.046875 | 2 |
python/caffe/test/test_draw.py | Julian-He/caffe | 0 | 12775909 | <reponame>Julian-He/caffe
#-*- coding: utf-8 -*-
"""
All modification made by Cambricon Corporation: © 2018 Cambricon Corporation
All rights reserved.
All other contributions:
Copyright (c) 2014--2018, the respective contributors
All rights reserved.
For the list of contributors go to https://github.com/BVLC/caffe/blob... | 1.460938 | 1 |
api/lastfm.py | notnola/pinybot | 0 | 12775910 | <filename>api/lastfm.py<gh_stars>0
import logging
import web_request
import youtube
log = logging.getLogger(__name__)
def get_lastfm_chart(chart_items=5):
"""
Finds the currently most played tunes on last.fm and turns them in to a youtube list of tracks.
:param chart_items: int the amount of tracks we wa... | 3.171875 | 3 |
test_libs/pyspec/eth2spec/test/helpers/block_header.py | prestonvanloon/eth2.0-specs | 1 | 12775911 | <reponame>prestonvanloon/eth2.0-specs
from eth2spec.utils.bls import bls_sign
from eth2spec.utils.ssz.ssz_impl import signing_root
def sign_block_header(spec, state, header, privkey):
domain = spec.get_domain(
state=state,
domain_type=spec.DOMAIN_BEACON_PROPOSER,
)
header.signature = bls_s... | 2 | 2 |
sahara_dashboard/content/data_processing/data_plugins/tabs.py | hejunli-s/sahara-dashboard | 33 | 12775912 | <reponame>hejunli-s/sahara-dashboard
# 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 writ... | 1.78125 | 2 |
regex_tester.py | ewhalan/IFB104 | 1 | 12775913 | #-----Description----------------------------------------------------#
#
# REGULAR EXPRESSION TESTER
#
# This program provides a simple Graphical User Interface that
# helps you develop regular expressions. It allows you to enter a
# block of text and a regular expression and see what matches
# are found. (Simil... | 3.65625 | 4 |
cloth_segmentation.py | Ericcsr/ClothFromDepth | 0 | 12775914 | import numpy as np
import open3d as o3d
import os
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("--red", type = float, default = 0.5)
parser.add_argument("--blue", type = float, default = 0.4)
parser.add_argument("--green", type = float, default = 0.4)
parser.add_argument("--source_... | 2.515625 | 3 |
workflow_demo.py | KhunWasut/chempython | 0 | 12775915 | <reponame>KhunWasut/chempython<filename>workflow_demo.py<gh_stars>0
### necessary imports ###
import kpython_path as kp
import os, re
# Read necessary data from our workspace scheme
# These arrays need to be sorted!
x_snapshot_filelist = os.listdir('./x-snapshots')
f_snapshot_filelist = os.listdir('./f-snapshots')
... | 2.359375 | 2 |
biliob_to_mysql/move_data.py | ProgramRipper/biliob-spider | 2 | 12775916 | from db import cursor
from db import db as mongodb
from pymongo import ASCENDING
import bson
import datetime
mongo_user = mongodb['user']
mongo_video = mongodb['video']
mongo_author = mongodb['author']
# 用户相关
INSERT_USER_SQL = """
INSERT INTO `user` (`name`, `password`, `credit`, `exp`, `gmt_create`, `role`)
VALUES (... | 2.9375 | 3 |
world-1/desafio-011.py | udanielnogueira/Python.CursoEmVideo | 0 | 12775917 | <filename>world-1/desafio-011.py
'''
Faça um programa que leia a largura e a altura de uma parede
em metros, calcule a sua área e a quantidada de tinta
necessária para pintá-la. Sabendo que cada litro de
tinta, pinta uma área de 2m quadrados.
'''
l = float(input('Digite o valor da largura: '))
h = float(input('Digite... | 3.578125 | 4 |
library/rainbowhat/touch.py | Corteil/rainbow-hat | 72 | 12775918 | """Rainbow HAT GPIO Touch Driver."""
try:
import RPi.GPIO as GPIO
except ImportError:
raise ImportError("""This library requires the RPi.GPIO module.
Install with: sudo pip install RPi.GPIO""")
PIN_A = 21
PIN_B = 20
PIN_C = 16
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
class Button(object):
"""Repr... | 2.796875 | 3 |
flow2ml/Data_Augumentation.py | yvkrishna/Flow2ML | 1 | 12775919 | <reponame>yvkrishna/Flow2ML
import cv2
import os
import imutils
import numpy as np
import matplotlib.pyplot as plt
from skimage import transform as tf
from matplotlib.transforms import Affine2D
import random
class Data_Augumentation:
'''
Class containing methods to apply Data Augumentation operations
to ima... | 3.09375 | 3 |
phase1/parser_indexer.py | mallika2011/Maze-Search-Engine | 1 | 12775920 | #!/usr/bin/python
import xml.sax
import sys
import os
import nltk
from nltk import sent_tokenize
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
from nltk.tokenize import TreebankWordTokenizer,ToktokTokenizer
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from nltk.... | 2.734375 | 3 |
wouso/games/challenge/urls.py | AlexandruGhergut/wouso | 117 | 12775921 | <gh_stars>100-1000
from django.conf.urls.defaults import *
urlpatterns = patterns('wouso.games.challenge.views',
url(r'^$', 'index', name='challenge_index_view'),
url(r'^(?P<id>\d+)/$', 'challenge', name='view_challenge'),
url(r'^launch/(?P<to_id>\d+)/$', 'launch', name='challenge_launch'),
url(r'^refu... | 1.5625 | 2 |
talk_like/_nbdev.py | devacto/talk_like | 0 | 12775922 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"Scraper": "00_scraper.ipynb",
"Scraper.get_facebook_posts": "00_scraper.ipynb",
"print_something": "00_scraper.ipynb"}
modules = ["scraper.py"]
doc_url = "https://devacto.github.io/talk_l... | 1.757813 | 2 |
iota/commands/extended/send_trytes.py | plenarius/iota.lib.py | 62 | 12775923 | <filename>iota/commands/extended/send_trytes.py
# coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from typing import List
import filters as f
from iota import TransactionTrytes, TryteString
from iota.commands import FilterCommand, RequestFilter
from iota.commands.co... | 2.03125 | 2 |
project3/films/admin.py | Codetype/Django-application | 0 | 12775924 | from django.contrib import admin
from .models import Category, Movie, Comment
class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'slug']
prepopulated_fields = {'slug': ('name',)}
admin.site.register(Category, CategoryAdmin)
class FilmAdmin(admin.ModelAdmin):
list_display = ['name', 'slug', ... | 2.140625 | 2 |
etl-scripts/slice/convert_to_parquet/parquet_writer.py | aculich/openmappr | 19 | 12775925 | <gh_stars>10-100
# Databricks notebook source exported at Sat, 7 May 2016 16:46:36 UTC
# MAGIC %md
# MAGIC Sanitized csv file to paraquet file writer
# MAGIC #NOTES
# MAGIC here, I read the temp data and split out parquet data for the given file.
# MAGIC
# MAGIC also, if the file has already been processed, then we do... | 2.84375 | 3 |
study/chainer_study/chainer_study-4.py | strawsyz/straw | 2 | 12775926 | # Initial setup following http://docs.chainer.org/en/stable/tutorial/basic.html
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
import chain... | 2.90625 | 3 |
Easy/Flipping_an_Image/Flipping_an_Image.py | nitin3685/LeetCode_Solutions | 0 | 12775927 | <gh_stars>0
class Solution:
def flipAndInvertImage(self, A: List[List[int]]) -> List[List[int]]:
FI_A = list()
for row in A:
row = [0 if i else 1 for i in row[::-1]]
FI_A.append(row)
return FI_A
| 2.9375 | 3 |
contacts/forms.py | intherenzone/CRM | 2 | 12775928 | from django import forms
from contacts.models import Contact
from common.models import Comment
class ContactForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
assigned_users = kwargs.pop('assigned_to', [])
contact_org = kwargs.pop('organization', [])
super(ContactForm, ... | 2.453125 | 2 |
normalize_data.py | aubreychen9012/cAAE | 19 | 12775929 | import nibabel as nib
import glob
import os
import numpy as np
import tensorlayer as tl
'''
Before normalization, run N4 bias correction (https://www.ncbi.nlm.nih.gov/pubmed/20378467),
then save the data under folder ./CamCAN_unbiased/CamCAN
'''
modalities = ['T1w', 'T2w']
BraTS_modalities = ['T1w']
folders = ['HGG'... | 2.1875 | 2 |
multi-process.py | lidongyv/PSSM | 0 | 12775930 | # -*- coding: utf-8 -*-
# @Author: yulidong
# @Date: 2018-08-30 16:47:51
# @Last Modified by: yulidong
# @Last Modified time: 2018-08-30 21:13:04
import torch
import torch.multiprocessing as mp
import time
def add(a,b,c):
start=time.time()
d=a+b
c+=d
print(time.time()-start)
def selfadd(a):
prin... | 2.71875 | 3 |
autodraft/draftHost/models.py | gnmerritt/autodraft | 0 | 12775931 | from django.db import models
from django.utils import timezone
class NflConference(models.Model):
name = models.TextField()
abbreviation = models.TextField(max_length=5)
def __unicode__(self):
return self.name
class NflDivision(models.Model):
name = models.TextField()
conference = models... | 2.46875 | 2 |
pkt/pkt_gsheet.py | queeniekwan/Seaquake | 0 | 12775932 | <reponame>queeniekwan/Seaquake
from googleapiclient.discovery import build
from google.oauth2 import service_account
from pool_metrics import metrics_comparison
from balance import get_seaquake_balance, get_steward_stats
from explorer_webscrap import get_pkt_metrics
from datetime import datetime
# define the scope
SCO... | 2.703125 | 3 |
visualization/prepare_intervals.py | icelu/GI_Cluster | 3 | 12775933 | <reponame>icelu/GI_Cluster
#!/usr/bin/env python
# Create interval files for visualization in Circos
#
# Author: <NAME>
# Affiliation : National University of Singapore
# E-mail : <EMAIL>
#
import os
import optparse
def getGenomeSize(genomefile):
firstLine = open(genomefile).readline()
assert ('>' in first... | 3.171875 | 3 |
templates/compiler/BUILD.tmpl.bzl | iocat/rules_rescript | 1 | 12775934 | <filename>templates/compiler/BUILD.tmpl.bzl
{{AUTO_GENERATED_NOTICE}}
load("@{{REPO_NAME}}//:rules.bzl", "rescript_compiler")
rescript_compiler(
name = "darwin",
bsc = ":darwin/bsc.exe",
bsb_helper = ":darwin/bsb_helper.exe",
visibility = ["//visibility:public"],
)
rescript_compiler(
name = "linux... | 1.171875 | 1 |
qutip/core/data/constant.py | jakelishman/qutip | 0 | 12775935 | <reponame>jakelishman/qutip<gh_stars>0
# This module exists to supply a couple of very standard constant matrices
# which are used in the data layer, and within `Qobj` itself. Other matrices
# (e.g. `create`) should not be here, but should be defined within the
# higher-level components of QuTiP instead.
from . impor... | 2.59375 | 3 |
tests/example_handlers.py | svenhartmann/mediatr_py | 0 | 12775936 | from tests.example_queries import GetArrayQuery, GetArrayQuery1
async def get_array_handler(request: GetArrayQuery):
items = list()
for i in range(0, request.items_count):
items.append(i)
return items
def get_array_handler_sync(request: GetArrayQuery):
items = list()
for i in range(0,... | 2.4375 | 2 |
jp.atcoder/abc090/abc090_b/11471132.py | kagemeka/atcoder-submissions | 1 | 12775937 | import sys
def cnt(n):
m = str(n)
l = len(m)
if l == 1:
return n + 1
tot = 0
tot += pow(10, (l - 1) // 2) * (int(m[0]) - 1)
tot += pow(10, l // 2) - 1 - pow(10, l // 2 - 1) * (l & 1 ^ 1)
while l >= 2:
l -= 2
if l == 0:
tot += m[1] >= m[0]
... | 2.921875 | 3 |
UnitTest/MNIST_Test.py | Mostafa-ashraf19/TourchPIP | 0 | 12775938 | from DLFrameWork.forward import NetWork
from DLFrameWork.dataset import FashionMNIST,DataLoader
if __name__ == '__main__':
FMNIST = FashionMNIST(path='MNIST_Data',download=False,train=True)
dLoader = DataLoader(FMNIST,batchsize=100,shuffling=False,normalization={'Transform':True})
# (784,256),(256,12... | 3.203125 | 3 |
data-science-master/Section-2-Basics-of-Python-Programming/Lec-2.15-Creating-Python-Modules-and-Packages/module-files/myscript.py | Hamid-Ali-99/Python_Just_Python | 0 | 12775939 | def myFunction():
print('The value of __name__ is ' + __name__)
def main():
myFunction()
if __name__ == '__main__':
main() | 3.046875 | 3 |
build/setenv.py | simonaoliver/metageta | 0 | 12775940 | <reponame>simonaoliver/metageta
import os,sys
#General vars
CURDIR=os.path.dirname(os.path.abspath(__file__))
TOPDIR=os.path.dirname(CURDIR)
DOWNLOAD_DIR=TOPDIR+'\\downloads'
#Default vars
PY_VER='Python27'
BIN_DIR=TOPDIR+'\\bin'
PY_DIR=BIN_DIR+'\\'+PY_VER #Don't mess with PYTHONHOME
####################... | 2.328125 | 2 |
__init__.py | challenger-zpp/dataflow | 0 | 12775941 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 2 10:39:47 2019
@author: ldh
"""
# __init__.py | 1.078125 | 1 |
log_decorator/log.py | Pavel-Egorov/log_decorator | 0 | 12775942 | <gh_stars>0
import inspect
import json
import logging
import re
import time
from copy import deepcopy
from uuid import uuid1
from wrapt import decorator
HIDE_ANNOTATION = 'hide'
HIDDEN_VALUE = 'hidden'
SECONDS_TO_MS = 1000
LOGS_COUNTER = {}
def get_logger(logger_name='service_logger'):
logger = logging.getLo... | 2.25 | 2 |
extraPackages/matplotlib-3.0.3/examples/lines_bars_and_markers/vline_hline_demo.py | dolboBobo/python3_ios | 130 | 12775943 | <reponame>dolboBobo/python3_ios
"""
=================
hlines and vlines
=================
This example showcases the functions hlines and vlines.
"""
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 5.0, 0.1)
s = np.exp(-t) + np.sin(2 * np.pi * t) + 1
nse = np.random.normal(0.0, 0.3, t.shape) *... | 3.515625 | 4 |
cbotami.py | sciutrux/cbotami | 0 | 12775944 | <reponame>sciutrux/cbotami<filename>cbotami.py<gh_stars>0
from chatterbot import ChatBot
from chatterbot.comparisons import LevenshteinDistance, JaccardSimilarity, SpacySimilarity
from chatterbot.response_selection import get_first_response, get_most_frequent_response, get_random_response
from chatterbot.filters import... | 2.484375 | 2 |
process_metrics/metrics/tsv_metric.py | tmooney/qc-metric-aggregator | 1 | 12775945 | <reponame>tmooney/qc-metric-aggregator
import re
import csv
import glob
import os.path
from typing import Dict
from abc import ABC, abstractmethod
class TSVMetric:
@abstractmethod
def metric_file_pattern(self) -> str:
pass
@abstractmethod
def metric_column_name(self) -> str:
pass
... | 2.578125 | 3 |
Entry Widget & Grid Layout In Tkinter/Code-1.py | Ranjan2104/Tkinter-GUI--Series | 2 | 12775946 | <gh_stars>1-10
from tkinter import *
def getvals():
print(f"The value of username is {uservalue.get()}")
print(f"The value of password is {passvalue.get()}")
root = Tk()
root.geometry("655x333")
user = Label(root, text="Username")
password = Label(root, text="Password")
user.grid()
password.grid(row=1)
# ... | 3.25 | 3 |
dash_website/utils/graphs.py | SamuelDiai/Dash-Website | 0 | 12775947 | <filename>dash_website/utils/graphs.py
import numpy as np
import plotly.graph_objs as go
from plotly.figure_factory import create_dendrogram
from dash_website import GRAPH_SIZE
from dash_website.utils import BLUE_WHITE_RED, MAX_LENGTH_CATEGORY
def heatmap_by_clustering(table_correlations, hovertemplate, customdata, ... | 2.78125 | 3 |
machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 2 | 12775948 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
__maintainer__ = "<NAME>"
__email__ = '<EMAIL>'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 26, 2018'
"""
single inheritance
"""
class Person:
"""
define a CLASS Person with three methods
"""
def speak(self):
... | 3.78125 | 4 |
python/examples/kaitai/icc_4.py | carsonharmon/binaryninja-api | 20 | 12775949 | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
from .kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
import collections
from enum import Enum
if parse_version(ks_version) < parse_version('0.... | 1.984375 | 2 |
votesystem/vote/form.py | majaeseong/votesystem | 0 | 12775950 | <reponame>majaeseong/votesystem<filename>votesystem/vote/form.py
from django import forms
from . import models
from datetime import datetime
class FormCandi(forms.ModelForm):
class Meta:
model = models.Candidate
fields=(
'name',
'area'
)
class DateInput(forms.Date... | 2.1875 | 2 |