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 |
|---|---|---|---|---|---|---|
utils/crop_image.py | Mhaiyang/iccv | 2 | 47300 | """
@Time : 203/21/19 17:11
@Author : TaylorMei
@Email : <EMAIL>
@Project : iccv
@File : crop_image.py
@Function:
"""
import os
import numpy as np
import skimage.io
input_path = '/media/iccd/TAYLORMEI/depth/image'
output_path = '/media/iccd/TAYLORMEI/depth/crop'
if not os.path.exists(output_path):
... | 2.359375 | 2 |
configs/data/kittimots_motion_supp.py | MSiam/video_class_agnostic_segmentation | 15 | 47301 | <filename>configs/data/kittimots_motion_supp.py<gh_stars>10-100
from configs.data.kittimots_motion import *
data = dict(
imgs_per_gpu=2,
workers_per_gpu=0,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/KITTIMOTS_MOSeg_train.json',
img_prefix=data_root + 'images/',... | 1.523438 | 2 |
tests/parlaclarin/parse_test.py | welfare-state-analytics/pyriksprot | 0 | 47302 | import os
import pytest
from pyriksprot import interface
from pyriksprot.corpus import parlaclarin
from ..utility import RIKSPROT_PARLACLARIN_FAKE_FOLDER, RIKSPROT_PARLACLARIN_FOLDER
jj = os.path.join
def test_to_protocol_in_depth_validation_of_correct_parlaclarin_xml():
protocol: interface.Protocol = parlac... | 2.359375 | 2 |
youtube_easy_api/test_easy_wrapper.py | elichou/youtube_api_wrapper | 2 | 47303 | from youtube_easy_api.easy_wrapper import *
PROJECT_PATH = os.path.abspath(os.path.join(os.path.abspath(__file__), os.pardir))
CREDENTIALS_PATH = '../../../Secrets/YouTube'
f = open(os.path.join(CREDENTIALS_PATH, 'api.txt'), "r")
API_KEY = f.read()
def test_get_metadata_01():
easy_wrapper = YoutubeEasyWrapper()... | 2.296875 | 2 |
dienstplan/dienste/admin.py | MikeTsenatek/DienstplanV2 | 0 | 47304 | from django.contrib import admin
# Register your models here.
from .models import DpDienste,DpBesatzung
class BesatzungInline(admin.TabularInline):
model = DpBesatzung
extra = 0
class DiensteAdmin(admin.ModelAdmin):
list_display = ('tag', 'schicht', 'ordner', 'ordner_name')
list_filter = ('ordner_... | 1.679688 | 2 |
ideal_spot/__init__.py | rosspalmer/IdealSpot | 1 | 47305 |
from ideal_spot.evaluate import EvaluateSpots
from ideal_spot.spots import Spot
from ideal_spot.targets import WeatherTarget | 1.101563 | 1 |
qiushibaike/middlewares.py | MarvinShawn/-luffy | 1 | 47306 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from scrapy.http import HtmlResponse
class JSMiddleware(objec... | 2.3125 | 2 |
query.py | IntimateMerger/dockerfile-aql | 0 | 47307 | <reponame>IntimateMerger/dockerfile-aql<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import aerospike
from aerospike import predicates as p
if __name__ == "__main__":
if len(sys.argv) == 6:
as_host = str(sys.argv[1])
ns_name = str(sys.argv[2])
st_name = s... | 2.28125 | 2 |
parallel.py | ambimanus/demand-response-cohda | 1 | 47308 | <gh_stars>1-10
# coding=utf-8
from __future__ import division
import sys
import os
import pickle
from configuration import Configuration
import main
def run(cfg_dict):
cfg = main.main(Configuration(**cfg_dict))
fn = str(os.path.join(cfg.basepath, '.'.join(
('cfg', cfg.title, str(cfg.seed), 'pick... | 2.1875 | 2 |
cleanup_instances.py | MISP/dockerized_training_environment | 7 | 47309 | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from misp_instances import MISPInstances
if __name__ == '__main__':
instances = MISPInstances()
instances.cleanup_all_blacklisted_event()
| 1.375 | 1 |
venv/lib/python3.5/site-packages/coalib/bears/meta.py | prashant0598/CoffeeApp | 0 | 47310 | from collections import defaultdict
from coalib.bearlib.aspects.collections import aspectlist
class bearclass(type):
"""
Metaclass for :class:`coalib.bears.Bear.Bear` and therefore all bear
classes.
Pushing bears into the future... ;)
"""
# by default a bear class has no aspects
aspects... | 2.546875 | 3 |
code/utils/__init__.py | mrbarbasa/kaggle-spooky-author | 1 | 47311 | from .format_time_str import format_time_str
from .get_time_elapsed import get_time_elapsed
from .load_data import load_data
from .load_dictionary_from_file import load_dictionary_from_file
from .save_dictionary_to_file import save_dictionary_to_file
from .save_line_to_file import save_line_to_file
| 1.882813 | 2 |
pyail/api.py | ail-project/PyAIL | 5 | 47312 | <filename>pyail/api.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import logging
import requests
import sys
import traceback
from datetime import date, datetime
from urllib.parse import urljoin
from . import __version__, everything_broken
from .core import encode_and_compress_data, get_... | 2.640625 | 3 |
object_detector_app/utils/worker_utils.py | edrickwong/w3p | 0 | 47313 | import cv2
import multiprocessing
import socket
import tensorflow as tf
import time
from defaults import *
from multiprocessing import Queue, Pool, Process
from object_detector_utils import ObjectDetector
from utils.app_utils import WebcamVideoStream
from reference_objects_utils import ReferenceObjectsHelper
# logger... | 2.375 | 2 |
avalon/web/__init__.py | tshlabs/avalonms | 1 | 47314 | <gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Avalon Music Server
#
# Copyright 2012-2015 TSH Labs <<EMAIL>>
#
# Available under the MIT license. See LICENSE for details.
#
"""Avalon web endpoint handler package."""
from __future__ import absolute_import, unicode_literals
| 0.855469 | 1 |
mbs_app.py | megnergit/MunichBusService_Streamlit_S1 | 0 | 47315 | from pathlib import Path
import pandas as pd
import config
from mbs.mbs import *
import streamlit as st
from streamlit_autorefresh import st_autorefresh
import yaml
# ====================================
# Authentication
# ====================================
AK = config.API_KEY # not really necessary
AKS = config.AP... | 1.90625 | 2 |
harvest/trader/tester.py | tfukaza/harvest | 83 | 47316 | <reponame>tfukaza/harvest<gh_stars>10-100
# Builtins
import datetime as dt
from typing import Any, Dict, List, Tuple
import os.path
from pathlib import Path
# External libraries
import pandas as pd
import numpy as np
from tqdm import tqdm
import pytz
# Submodule imports
from harvest.storage import PickleStorage
impor... | 2.390625 | 2 |
babysploit/wpseku/lib/printer.py | kevinsegal/BabySploit | 0 | 47317 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# WPSeku - Wordpress Security Scanner
# by <NAME> (m4ll0k)
from lib.colors import *
def decode(string):
return string.encode('utf-8')
def plus(string):
print("{}[ + ]{} {}{}{}".format(
GREEN%1,RESET,GREEN%0,string,RESET))
def test(string):
print("{}[ * ]{} {}{... | 2.234375 | 2 |
healthbuddy_backend/rapidpro/serializers.py | Asfak06/health-buddy | 0 | 47318 | from rest_framework import serializers
from .models import (
Flow,
DailyFlowRuns,
Group,
DailyGroupCount,
Channel,
DailyChannelCount,
Label,
)
class FlowSerializer(serializers.ModelSerializer):
class Meta:
model = Flow
fields = ["uuid", "name", "is_active"]
rea... | 2.25 | 2 |
modeling/utils.py | juan-rodriguez-rivas/covmut | 0 | 47319 | import numpy as np
import gzip
from Bio import SeqIO
from pathlib import Path
import os
import subprocess
import tarfile
from io import BytesIO
#for parallel computing
from joblib import Parallel, delayed
import multiprocessing
num_cores_energy = multiprocessing.cpu_count()
from tqdm import tqdm
import pandas as pd
imp... | 2.015625 | 2 |
cogdl/layers/gine_layer.py | li-ziang/cogdl | 1,072 | 47320 | import torch
import torch.nn.functional as F
from cogdl.utils import spmm
from . import BaseLayer
class GINELayer(BaseLayer):
r"""The modified GINConv operator from the `"Graph convolutions that can finally model local structure" paper
<https://arxiv.org/pdf/2011.15069.pdf>`__.
Parameters
---------... | 2.78125 | 3 |
twistdl/cli.py | JFryy/twist-moe-downloader | 33 | 47321 | <reponame>JFryy/twist-moe-downloader<filename>twistdl/cli.py<gh_stars>10-100
import re
import sys
from PyInquirer import prompt
from argparse import ArgumentParser
from pathlib2 import Path
from six.moves import filter
from six.moves import input
from six.moves import map
from six.moves import range
from tqdm import t... | 2.65625 | 3 |
isiscb/isisdata/migrations/0061_auto_20170324_1929.py | bgopalachary/IsisCB | 4 | 47322 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-24 19:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('isisdata', '0060_auto_20170324_1741'),
]
operations = [
migrations.RemoveField(
... | 1.421875 | 1 |
qemu/tests/qemu-iotests/qcow2.py | hyunjoy/scripts | 44 | 47323 | <filename>qemu/tests/qemu-iotests/qcow2.py
#!/usr/bin/env python3
#
# Manipulations with qcow2 image
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either... | 2.03125 | 2 |
app/config/secure.py | xiaojieluo/flask_restapi_template | 0 | 47324 | SQLALCHEMY_DATABASE_URI = \
'mysql+cymysql://root:00000000@localhost/ucar'
SECRET_KEY = '***'
SQLALCHEMY_TRACK_MODIFICATIONS = True
MINA_APP = {
'AppID': '***',
'AppSecret': '***'
}
| 0.996094 | 1 |
db/models.py | hnzlmnn/dora | 6 | 47325 | import base64
import binascii
from typing import Union
from peewee import DatabaseProxy, Model, CharField, BooleanField, DateTimeField, IntegerField, ForeignKeyField, \
CompositeKey, DoesNotExist
from db.fields import BytesField
database_proxy = DatabaseProxy()
class BaseModel(Model):
class Meta:
d... | 2.34375 | 2 |
Platforms/Web/Processing/Api/__init__.py | The-CJ/Phaazebot | 2 | 47326 | <gh_stars>1-10
import Platforms.Web.Processing.Api.Account as Account
import Platforms.Web.Processing.Api.Admin as Admin
import Platforms.Web.Processing.Api.Discord as Discord
import Platforms.Web.Processing.Api.Twitch as Twitch
import Platforms.Web.Processing.Api.errors as errors
| 0.9375 | 1 |
onepanman_api/views/api/code.py | Capstone-onepanman/api-server | 0 | 47327 | <reponame>Capstone-onepanman/api-server
import django_filters
from rest_framework import viewsets
from onepanman_api.models import Code
from onepanman_api.serializers.code import CodeSerializer
from rest_framework.mixins import ListModelMixin
from rest_framework.response import Response
from rest_framework.views impor... | 2.359375 | 2 |
others/wordcloud/chinese.py | K-ona/template | 0 | 47328 | <gh_stars>0
import jieba
from os import path
from imageio import imread
import matplotlib.pyplot as plt
import os
from wordcloud import WordCloud, ImageColorGenerator
# get data directory (using getcwd() is needed to support running example in generated IPython notebook)
d = os.getcwd()
stopwords_path = d + '/wc_cn/s... | 2.453125 | 2 |
api/api.py | Loupeznik/python-snippets | 0 | 47329 | import requests
'''
Makes a request to an API endpoint
Takes authorization header if needed
'''
url = "http://127.0.0.1:8000/api/test"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'token' # Specify an access token if needed
}
response = requests.request("GET", url, headers=headers, data... | 3.25 | 3 |
dex/dexinfo.py | callmejacob/dexfactory | 7 | 47330 | # -- coding: utf-8 --
import numpy as np
import hashlib
import zlib
from section import *
class DexInfo(object):
"""
dex信息
"""
def __init__(self, dex_path, dex_bytes = None):
"""
初始化
dex_path: dex的文件路径
self.dex_bytes: dex的字节数组
self.header: 头部信息的字节数组
"""
# 记录文件路径
self.dex_path = dex_path
... | 2.28125 | 2 |
launch.py | rugleb/cad | 3 | 47331 | <filename>launch.py<gh_stars>1-10
#!/usr/bin/env python
import sys
from PyQt5.QtWidgets import QApplication
from cad.application import Application
if __name__ == '__main__':
app = QApplication(sys.argv)
workspace = Application()
workspace.show()
sys.exit(app.exec_())
| 1.710938 | 2 |
events/migrations/0010_auto_20180528_2033.py | Akash1S/meethub | 428 | 47332 | <reponame>Akash1S/meethub
# Generated by Django 2.0.4 on 2018-05-28 20:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0009_auto_20180428_0845'),
]
operations = [
migrations.RemoveField(
model_name='comment',
... | 1.59375 | 2 |
clone_scanner.py | m42e/weechat_scripts | 0 | 47333 | <filename>clone_scanner.py<gh_stars>0
# -*- coding: utf-8 -*-
#
# Clone Scanner, version 1.3 for WeeChat version 0.3
# Latest development version: https://github.com/FiXato/weechat_scripts
#
# A Clone Scanner that can manually scan channels and
# automatically scans joins for users on the channel
# with multipl... | 2.078125 | 2 |
tests/base/models.py | uditarora/pytorch-lightning | 1 | 47334 | <filename>tests/base/models.py
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tests.base.datasets import TrialMNIST
try:
from test_tube import HyperOptArgumentParser
except ImportError:
# T... | 2.34375 | 2 |
blog/views.py | KoukiNAGATA/kouchan-blog | 0 | 47335 | <filename>blog/views.py<gh_stars>0
from django.views.generic import DetailView, ListView
from blog.models import Post
class CommonListView(ListView):
"""ListViewのテンプレート"""
model = Post
template_name = "post_list.html"
paginate_by = 10
def get_context_data(self, **kw):
# 下書き以外で最新の10件を表示
... | 2.46875 | 2 |
Acqiris_U1084A/Acqiris_U1084A-UpgradeCfg.py | roniwinik/Drivers | 48 | 47336 | <reponame>roniwinik/Drivers
#!/usr/bin/env python
def upgradeDriverCfg(version, dValue={}, dOption=[]):
"""Upgrade the config given by the dict dValue and dict dOption to the
latest version."""
# the dQuantUpdate dict contains rules for replacing missing quantities
dQuantReplace = {}
# update quant... | 2.5 | 2 |
tests/integration/test_integration_firewall_policy.py | joshuaguite/cloudpassage-halo-python-sdk | 8 | 47337 | import cloudpassage
import json
import os
policy_file_name = "firewall.json"
config_file_name = "portal.yaml.local"
tests_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
config_file = os.path.join(tests_dir, "configs/", config_file_name)
policy_file = os.path.join(tests_dir, 'policies/', policy_f... | 1.953125 | 2 |
objmodel/step00_get_set_field/objmodel.py | suensky/500lines-rewrite | 80 | 47338 | class Class:
def __init__(self, name: str):
self.name = name
class Instance:
def __init__(self, cls: Class):
self.cls = cls
self._fields = {}
def get_attr(self, name: str):
if name not in self._fields:
raise AttributeError(f"'{self.cls.name}' has no attribute {... | 3.5625 | 4 |
aioes/client/cat.py | DavidCloudfind/aioes | 90 | 47339 | import asyncio
from .utils import NamespacedClient
from .utils import _make_path
default = object()
def _decode_text(s):
return s
class CatClient(NamespacedClient):
@asyncio.coroutine
def aliases(self, *, name=default, h=default, help=default,
local=default, master_timeout=default, v=... | 2.46875 | 2 |
toad/nn/trainer/__init__.py | brianWeng0223/toad | 0 | 47340 | <reponame>brianWeng0223/toad
from .history import History
from .callback import callback
from .earlystop import earlystopping
from .trainer import Trainer
| 1.03125 | 1 |
examples/simple.py | hippke/pysyzygy | 8 | 47341 | <reponame>hippke/pysyzygy<filename>examples/simple.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`simple.py` - A simple light curve
------------------------------------------
Plots a simple light curve, the planet orbit
as seen from the top and from the observer's
viewpoint, and the orbital elements as ... | 2.484375 | 2 |
returns/pointfree/__init__.py | internetimagery/returns | 0 | 47342 | <reponame>internetimagery/returns<filename>returns/pointfree/__init__.py
from __future__ import absolute_import
from returns.pointfree.alt import alt as alt
from returns.pointfree.apply import apply as apply
from returns.pointfree.bimap import bimap as bimap
from returns.pointfree.bind import bind as bind
from returns.... | 1.734375 | 2 |
Tkinter_Aula11_Gerenciador_de_Layout_GRID.py | LeandroTeodoroRJ/CursoTkinter | 0 | 47343 | <filename>Tkinter_Aula11_Gerenciador_de_Layout_GRID.py
#*************************************************************************************************
# GERENCIADOR DE LAYOUT GRID
#*************************************************************************************************
#INCLU... | 3.640625 | 4 |
misc/tools/multitest/mconfig.py | zeehio/META-SHARE | 11 | 47344 | <reponame>zeehio/META-SHARE
'''
Author: <NAME>
Create a configuration of Metashare nodes for testing.
For each node appropriate features are collected in
order to make them run on a single machine.
'''
import os
CONFIGS = []
class mconfig:
db_base = 'metashare'
solr_port_base = 4444
solr_stop_port_base = 33... | 2.390625 | 2 |
Pell_Sequence/pell.py | RayhanHagel/Sequence | 0 | 47345 | # Pell Numbers
class Pell:
def __init__(self):
self.limiter = 1000
self.numbers = [0, 1]
self.path = r'./Pell_Sequence/results.txt'
def void(self):
with open(self.path, "w+") as file:
for i in range(self.limiter):
self.numbers.append(2 * sel... | 3.1875 | 3 |
aip_site/jinja/ext/tab.py | odsod/site-generator | 13 | 47346 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 2.125 | 2 |
modules/monte_carlo/bin/onramp_run.py | elise-baumgartner/onramp | 2 | 47347 | #!/usr/bin/env python
#
# Curriculum Module Run Script
# - Run once per run of the module by a user
# - Run inside job submission. So in an allocation.
# - onramp_run_params.cfg file is available in current working directory
#
import os
import sys
from subprocess import call
from configobj import ConfigObj
#
# Read t... | 2.640625 | 3 |
base/site-packages/mobileadmin/templatetags/mobile_admin_media.py | edisonlz/fastor | 285 | 47348 | <filename>base/site-packages/mobileadmin/templatetags/mobile_admin_media.py
from django.template import Library
register = Library()
def mobileadmin_media_prefix():
"""
Returns the string contained in the setting MOBILEADMIN_MEDIA_PREFIX.
"""
try:
from mobileadmin.conf import settings
exce... | 2.0625 | 2 |
pdfmetadata.py | Phexcom/pdfmetadata | 0 | 47349 | <reponame>Phexcom/pdfmetadata
#!/usr/bin/env python3
from PyPDF2 import PdfFileReader, PdfFileWriter
import pprint
import pickle
def get_metadata(filename):
# reading data from pdf file
fin = open(filename, 'rb')
# initializing pyPDF2
reader = PdfFileReader(fin)
metadata = reader.getDocumentIn... | 3.203125 | 3 |
contrib/tools/templates/extensions/extension/extension.py | Khan/reviewboard | 1 | 47350 | <reponame>Khan/reviewboard
# {{extension_name}} Extension for Review Board.
from django.conf import settings
from django.conf.urls.defaults import patterns, include
from reviewboard.extensions.base import Extension
{%- if dashboard_link is not none %}
from reviewboard.extensions.hooks import DashboardHook, URLHook
{% e... | 1.953125 | 2 |
08.Iterators_and_generators/Lab/squares.py | nmoskova/Python-OOP | 0 | 47351 | <gh_stars>0
def squares(n):
i = 1
while i <= n:
yield i * i
i += 1
print(list(squares(5))) | 3.34375 | 3 |
apps/protein_function_prediction/DeepFRI/test.py | kanz76/PaddleHelix | 0 | 47352 | import os
import random
import argparse
import time
from datetime import datetime
from tqdm import tqdm
import paddle
paddle.disable_static()
import paddle.nn.functional as F
import paddle.optimizer as optim
from pgl.utils.data import Dataloader
import numpy as np
from models import DeepFRI
from data_preprocessing i... | 2.1875 | 2 |
kernel/examples/handler/__init__.py | rinceyuan/WeFe | 39 | 47353 |
from pathlib import Path
from ruamel import yaml
with Path(__file__).parent.parent.joinpath("config.yaml").resolve().open("r") as fin:
__DEFAULT_CONFIG: dict = yaml.safe_load(fin)
def set_default_config(ip: str, port: int, log_directory: str):
global __DEFAULT_CONFIG
__DEFAULT_CONFIG.update(dict(ip=... | 2.359375 | 2 |
kravatte/kravatte.py | inmcm/kravatte | 13 | 47354 | """
Kravatte Achouffe Cipher Suite: Encryption, Decryption, and Authentication Tools based on the Farfalle modes
Copyright 2018 <NAME>
see LICENSE file
"""
from multiprocessing import Pool
from math import floor, ceil, log2
from typing import Tuple
from os import cpu_count
from ctypes import memset
import numpy as np
... | 2.46875 | 2 |
radar/models/user.py | J4LP/radar | 0 | 47355 | <filename>radar/models/user.py
import arrow
from sqlalchemy_utils import IPAddressType, ArrowType
from radar.models import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String, unique=True)
main_character = db.Column(db.String)
main_character_id = db.Colu... | 2.421875 | 2 |
sermar/utils.py | dennereed/paleocore | 0 | 47356 | <reponame>dennereed/paleocore
from sermar.models import *
def update_biology_fk():
"""
Update collection foreign key in Biology objects
:return:
"""
# Get all Biology Occurrences
bios = Biology.objects.all()
# Iterate through all bio objects
counter = 0
for b in bios:
# Fo... | 2.375 | 2 |
cal.py | chapmanjacobd/everydayvirtualvacation | 32 | 47357 | from ics import Calendar, Event
from datetime import date, timedelta
from db import fetchall_dict
from rich import print
from flag import flag
c = Calendar()
def add_allday_event(c, event_start, event_name, event_description):
e = Event()
e.name = event_name
e.description = event_description
e.begin... | 2.921875 | 3 |
src/algo/api_nfdomains.py | jumperavocado/staketaxcsv | 140 | 47358 | import logging
import requests
from settings_csv import ALGO_NFDOMAINS
# API documentation: https://editor.swagger.io/?url=https://api.testnet.nf.domains/info/openapi3.yaml
class NFDomainsAPI:
session = requests.Session()
def get_address(self, name):
endpoint = f"nfd/{name}"
para... | 2.46875 | 2 |
gant/main.py | kshlm/gant | 0 | 47359 | <filename>gant/main.py<gh_stars>0
#! /usr/bin/env python
from __future__ import unicode_literals, print_function
from .utils.gant_ctx import GantCtx
import os
import click
helpStr = """
Gant : The Gluster helper ant
Creates GlusterFS development and testing environments using Docker
Usage:
gant [options] build... | 2.421875 | 2 |
ancfindersite/admin.py | kevko/ancfinder | 0 | 47360 | # -*- coding: utf-8
from django.contrib import admin
from ancfindersite.models import *
@admin.register(CommissionerInfo)
class CommissionerInfoAdmin(admin.ModelAdmin):
list_display = ['id', 'latest', 'created', 'author', 'anc', 'smd', 'field_name', 'field_value', 'linkage']
raw_id_fields = ['author']
re... | 1.945313 | 2 |
csse290-server/mainserver.py | RHIT-CSSE/SecurityClub | 0 | 47361 | # Author: <NAME>
# Date: January 29, 2017
import tornado.ioloop
import tornado.web
import tornado.httpserver
import hashlib
import base64
import json
import mysql.connector as sql
dbuser = 'csse'
# Register a new user
class UserHandler(tornado.web.RequestHandler):
def set_default_headers(self):
self.set_header... | 2.265625 | 2 |
packets/Reader/PacketResolver.py | osukurikku/kuriso | 6 | 47362 | from typing import List, Tuple
from objects.TypedDicts import TypedPresence, TypedReadMatch
from objects.constants.GameModes import GameModes
from objects.constants.Modificators import Mods
from objects.constants.Slots import SlotStatus, SlotTeams
from objects.constants.multiplayer import MatchTypes, MatchScoringTypes... | 1.976563 | 2 |
01_Language/01_Functions/python/preg_replace_callback.py | cliff363825/TwentyFour | 3 | 47363 | # coding: utf-8
import re
def preg_replace_callback(pattern, callback, subject):
return re.sub(pattern, callback, subject)
if __name__ == '__main__':
text = 'April fools day is 04/01/2002\n' + \
'Last christmas was 12/24/2001\n'
print(preg_replace_callback(r'(\d{2}/\d{2}/)(\d{4})', lambda m... | 3.28125 | 3 |
XMAS2018/Krampus/solve.py | flawwan/CTF-Writeups | 27 | 47364 | <filename>XMAS2018/Krampus/solve.py
python
from pwn import *
import base64
import sys
def convertstr(convert, debug=False):
if debug:
print convert
output = ""
for i in convert:
output+= "chr(%d)+" % ord(i)
return output[:-1]
if len(sys.argv) == 2 and sys.argv[1] == "local":
r = remote("0.0.0.0",2000)
else:
... | 2.671875 | 3 |
oxasl_ve/veaslc_cli_wrapper.py | ibme-qubic/oxasl_ve | 1 | 47365 | from fsl.wrappers import LOAD
from oxasl_ve.wrappers import veaslc
def veaslc_wrapper(wsp, data, roi):
"""
"""
# Run the C code
ret = veaslc(data, roi, out=LOAD,
diff=wsp.iaf == "vediff",
method=wsp.ifnone("veasl_method", "map"),
veslocs=wsp.veslocs,
... | 2.078125 | 2 |
AMICO-NODDI/tool.py | RicardoRios46/microsuite | 0 | 47366 | <filename>AMICO-NODDI/tool.py
import os
import amico
import numpy as np
from dipy.io.gradients import read_bvals_bvecs
from dipy.core.geometry import normalized_vector
import shutil
# AnalysisContext documentation: https://docs.qmenta.com/sdk/sdk.html
def run(context):
###########################################... | 2.140625 | 2 |
conans/client/generators/pkg_config.py | wahlm/conan | 3 | 47367 | from conans.model import Generator
"""
PC FILE EXAMPLE:
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: my-project
Description: Some brief but informative description
Version: 1.2.3
Libs: -L${libdir} -lmy-project-1 -linkerflag
Cflags: -I${includedir}/my-project-1
Requi... | 2.515625 | 3 |
regular_expressions/web_scraper.py | jeffbarnette/Python-One-Liners | 0 | 47368 | """Example of a Web Scraper using Regular Expressions"""
# Dependencies
import re
# Data
text_1 = "crypto-bot that is trading Bitcoin and other currencies"
text_2 = "cryptographic encryption methods that can be cracked easily with quantum computers"
# One-Liner
pattern = re.compile("crypto(.{1,30})coin")
# Result
p... | 3.609375 | 4 |
for in.py | MrAnonymous5635/CSCircles | 17 | 47369 | def prod(L):
p = 1
for i in L:
p *= i
return p
| 2.546875 | 3 |
.history/app/scrape_20201229173546.py | Super-Web112/python-scraping-for-hosting | 0 | 47370 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, JsonResponse
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import WebDriverWait
f... | 2.265625 | 2 |
iris-model/get_data.py | eddymarts/Melbourne-Housing-ML | 0 | 47371 | <filename>iris-model/get_data.py
import pandas as pd
pd.options.display.max_columns = None
from sklearn.preprocessing import OrdinalEncoder
from sklearn import datasets
import plotly.express as px
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.ap... | 2.796875 | 3 |
flask_web/config/default.py | Max-PJB/python-learning2 | 0 | 47372 | <reponame>Max-PJB/python-learning2
# coding: utf-8
import os
class Config(object):
RESULT_ERROR = 0
RESULT_SUCCESS = 1
MONGODB_SETTINGS = {'ALIAS': 'default',
'DB': 'facepp',
'host': 'localhost',
'username': 'admin',
... | 2.125 | 2 |
sample_pointcloud.py | jiameng1010/pointNet | 0 | 47373 | from pyntcloud import PyntCloud
import pyembree
import numpy as np
import trimesh
from trimesh import sample, ray, triangles
from trimesh.ray.ray_pyembree import RayMeshIntersector
import pandas as pd
cloud = PyntCloud.from_file("/home/mjia/Documents/ShapeCompletion/test.ply")
sample = cloud.get_sample(name='mesh_ran... | 2.09375 | 2 |
packages/asv_perception_segmentation/src/kaffe/caffe/resolver.py | rolker/asv_perception | 11 | 47374 | """
# License
Each contributor holds copyright over their contributions to Caffe-Tensorflow. In particular:
- Any included network model is provided under its original license.
- Any portion derived from Caffe is provided under its original license.
- Caffe-tensorflow is provided under the MIT license, as specified... | 1.53125 | 2 |
n_step_sarsa.py | SuperSaiyan-God/Reinforcement-Learning | 0 | 47375 | import numpy as np
import gym
poleThetaSpace = np.linspace(-0.209, 0.209, 10)
poleThetaVelSpace = np.linspace(-4, 4, 10)
cartPosSpace = np.linspace(-2.4, 2.4, 10)
cartVelSpace = np.linspace(-4, 4, 10)
def get_state(observation):
cartX, cartXdot, cartTheta, cartThetaDot = observation
cartX = int(np.digitize(ca... | 2.71875 | 3 |
codeTest.py | horknfbr/random | 0 | 47376 | <gh_stars>0
#!/bin/env python3
pathString = ["PDX-SFO", "SEA-JFK", "SFO-SEA", "LAX-PDX"]
def breakPairs(pairList):
toFrom = {}
fromTo = {}
srca = ''
dsta = ''
src = ''
dst = ''
for i in pairList:
airports = i.split('-')
toFrom[airports[0]] = airports[1]
fromTo[airp... | 3.125 | 3 |
ASAConfigUsingREST/asa/ASA.py | g-ser/pythonNetworking | 0 | 47377 | <reponame>g-ser/pythonNetworking
import requests
from requests.auth import HTTPBasicAuth
from enum import Enum, auto
import json.tool
# suppress the message which comes from the self-signed certificate of ASA
requests.packages.urllib3.disable_warnings()
def sendrequest(verb, headers, url, auth, data=''):
"""
... | 2.9375 | 3 |
Python Programs/count_nummber_in_web.py | Chibi-Shem/Hacktoberfest2020-Expert | 77 | 47378 | import urllib.request, urllib.parse, urllib.error
import xml.etree.ElementTree as ET
url= input('Enter - ')
data= urllib.request.urlopen(url).read().decode()
#print(type('data'))
#data ='''<commentinfo>tag</commentinfo>'''
#print("~~~",data)
c=0
commentsinfo = ET.fromstring(data)#starting tag. ie is "commentinfo" in ... | 3.171875 | 3 |
spaceshooter.py | emBrileg08/Space-Shooter | 0 | 47379 | """
spaceshooter.py
Author: emBrileg08
Credit: Spacewar Source Code
www.pythoncentral.io for information on random number generation
Assignment:
Write and submit a program that implements the spacewar game:
https://github.com/HHS-IntroProgramming/Spacewar
"""
from ggame import App, Sprite, ImageAsset, Frame
import ran... | 3.765625 | 4 |
user/authentication.py | cavidanhasanli/TaskManager | 0 | 47380 | <gh_stars>0
import bcrypt
from fastapi_jwt_auth import AuthJWT
from passlib.context import CryptContext
from .schemas import UserInDB, UserPassword
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
class Authenticate:
def create_salt_and_hashed_password(
self, *, plaintext_password: str
... | 2.46875 | 2 |
ddtruss/__init__.py | deeepeshthakur/ddtruss | 1 | 47381 | from .__about__ import __author__, __email__, __license__, __status__, __version__
from .solver import DataDrivenSolver
from .truss import Truss
__all__ = [
"__author__",
"__email__",
"__license__",
"__version__",
"__status__",
"Truss",
"DataDrivenSolver",
]
| 1.132813 | 1 |
01 - EstruturaSequencial/13ex.py | lucasbraga10/ListaDeExerciciosPython | 0 | 47382 | '''13 - Tendo como dado de entrada a altura (h) de uma pessoa, construa um algoritmo que calcule seu peso ideal,
utilizando as seguintes fórmulas:
* Para homens: (72.7*h) - 58
* Para mulheres: (62.1*h) - 44.7
'''
altura = float(input('Digite a sua altura em metros: '))
print(f'O peso ideal para homens é de {(72.7*... | 4.0625 | 4 |
tools/preprocess-rcnn-leaf.py | bernardcwj/FYP_2017 | 0 | 47383 | import argparse
import os
import glob
import shutil
import json
import re
import hashlib
import numpy as np
import sys
import imgaug as ia
from imgaug import augmenters as iaa
from multiprocessing import Pool, Value, Manager
from lxml import etree
from PIL import Image, ImageFile, ImageDraw, ImageFont
ImageFile.LOAD_T... | 2.203125 | 2 |
examples/test01.py | pyrate-build/pyrate-build | 41 | 47384 | <reponame>pyrate-build/pyrate-build
import logging
assert(pyrate_version > (0, 1, 9))
assert(pyrate_version >= '0.1.10')
assert(pyrate_version != '0.0.1')
assert(pyrate_version == pyrate_version)
match('*.cpp', recurse = True)
exe = executable('test.bin', ['test.cpp'])
exe = executable('test.bin', ['test.cpp'])
try:
... | 2.125 | 2 |
pshychocloud/WAPPMessageAnalyzer.py | partu18/pshychocloud | 0 | 47385 | from MessageAnalyzer import MessageAnalyzer
class WAPPMessageAnalyzer(MessageAnalyzer):
WAPP_DATE_REGEX = "[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,2}"
WAPP_TIME_REGEX = "[0-9]{1,2}:[0-9]{1,2}"
WAPP_EXTRACT_PARTICIPANT_REGEX = r"{date}\s*,\s*{time}\s*-\s*(.+?)\s*:\s*"\
.format(... | 2.859375 | 3 |
ros/src/twist_controller/twist_controller.py | mohamedameen93/An-Autonomous-Vehicle-System-For-Udacity-s-Carla | 11 | 47386 | <reponame>mohamedameen93/An-Autonomous-Vehicle-System-For-Udacity-s-Carla
import rospy
from pid import PID
from yaw_controller import YawController
from lowpass import LowPassFilter
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, wheel_base, wheel_radius, steer_ratio, max_lat... | 3.0625 | 3 |
test_normalize_sentences.py | Alienmaster/german-asr-lm-tools | 11 | 47387 | import normalize_sentences
import spacy
nlp = spacy.load('de_core_news_sm')
test_sentence = 'Der schlaue Fuchs sagte "Treffen um 16:20 Uhr!" aber war schon 20 Minuten früher da. Im Jahre 1995 schuf er das Gedicht.'
def test_sent(test_sentence):
result = normalize_sentences.normalize(nlp, test_sentence)
prin... | 3.015625 | 3 |
apps/product/migrations/0001_initial.py | wasim2263/super-shop-management | 0 | 47388 | <gh_stars>0
# Generated by Django 3.1.12 on 2021-06-17 19:29
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.C... | 1.703125 | 2 |
webapp/test/app_test2.py | PratikMahajan/Recipe-Management-Webapp-And-Infrastructure | 0 | 47389 | from app import app
import unittest
import base64
import json
class TestLogin(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.app = app.test_client()
self.user_name = "<EMAIL>"
self.password = "<PASSWORD>"
self.valid_credentials = base64.b64encode(b'<... | 2.921875 | 3 |
Python/Sets/symmertic_diffrence.py | abivilion/Hackerank-Solutions- | 0 | 47390 | <reponame>abivilion/Hackerank-Solutions-<gh_stars>0
# a,b = [set(input().split()) for i in range(4)][1::2]
# print ('\n'.join(sorted(a^b, key=int)))
a,b=(int(input()),input().split())
c,d=(int(input()),input().split())
x=set(b)
y=set(d)
p=y.difference(x)
q=x.difference(y)
r=p.union(q)
print ('\n'.join(sorted(r... | 2.78125 | 3 |
prototype-scripts/src/check_dependencies.py | thomaslienbacher/one-man-rps | 0 | 47391 | """
Diese Script kann genutzt werden, um zu überprüfen ob alle Python Bibliotheken installiert wurden.
Wenn am Ende ein Smiley kommt ist höchst wahrscheinlich alles korrekt installiert.
"""
print("Loading...")
import numpy
import matplotlib
import cv2
from picamera import mmal
import tensorflow
print("Versions insta... | 2.375 | 2 |
mpilot/libraries/eems/basic.py | consbio/MPilot | 0 | 47392 | from __future__ import division
import copy
from functools import reduce
import numpy
import six
from mpilot import params
from mpilot.commands import Command
from mpilot.libraries.eems.exceptions import (
MismatchedWeights,
MixedArrayLengths,
DuplicateRawValues,
)
from mpilot.libraries.eems.mixins impor... | 2.375 | 2 |
backend/api/migrations/0022_auto_20200610_0618.py | luizfilipezs/lousher | 0 | 47393 | # Generated by Django 3.0.5 on 2020-06-10 06:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0021_auto_20200606_0449'),
]
operations = [
migrations.AlterField(
model_name='endereco',
name='bairro',
... | 1.554688 | 2 |
app/view.py | ordinem-net/core | 0 | 47394 | <reponame>ordinem-net/core
from app.app import app
from flask import render_template, redirect, url_for, Markup, request
from app.mage import Mage
from const import const
from essense.user import User
from essense.secondary.fs.json_files import JsonFiles
import os
@app.route('/', methods=['POST', 'GET'])
@app.route('... | 1.773438 | 2 |
run.py | LuxuriaP/editsql | 0 | 47395 | <filename>run.py
"""Contains a main function for training and/or evaluating a model."""
import os
import sys
import numpy as np
import random
import shutil
import copy
from parse_args import interpret_args
import data_util
from data_util import atis_data
from model.schema_interaction_model import SchemaInteractionA... | 2.59375 | 3 |
app/messages.py | mjogodnik22/mini-amazon | 0 | 47396 | from flask import render_template, redirect, url_for, flash, request
from werkzeug.urls import url_parse
from flask_login import login_user, logout_user, current_user
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import V... | 2.375 | 2 |
telluric/constants.py | FlorianPignol/telluric | 81 | 47397 | """Useful constants.
"""
from rasterio.crs import CRS
WGS84_SRID = 4326
#: WGS84 CRS.
WGS84_CRS = CRS.from_epsg(WGS84_SRID)
WEB_MERCATOR_SRID = 3857
#: Web Mercator CRS.
WEB_MERCATOR_CRS = CRS.from_epsg(WEB_MERCATOR_SRID)
# Best widely used, equal area projection according to
# http://icaci.org/documents/ICC_procee... | 2.015625 | 2 |
benzhu/file.py | xiaozhu-CHN/virmach | 2 | 47398 | <filename>benzhu/file.py
import json
import os
import time
class JsonFile:
path = os.path.split(os.path.realpath(__file__))[0]
#保存本次读取到的数据
def setJsonFile(slef,response):
filename = os.path.join(JsonFile.path,'data','data.json')
with open(filename, "w", encoding="utf-8") as f:
... | 3.046875 | 3 |
trees/Path Sum 3/Solution.py | shahbagdadi/py-algo-n-ds | 0 | 47399 | <reponame>shahbagdadi/py-algo-n-ds
# Definition for a binary tree node.
import sys , os
sys.path.append(os.path.abspath('../TreeUtil'))
from util import drawtree , deserialize, serialize
from collections import defaultdict
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
... | 3.40625 | 3 |