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 |
|---|---|---|---|---|---|---|
goldberg/benchmark.py | daberg/goldberg | 0 | 12782951 | <filename>goldberg/benchmark.py
import goldberg.algo as algo
import graph_tool.flow
import time
import memory_profiler
def benchmark_all(graph, source, target, capacity):
graph.edge_properties["capacity"] = capacity
original_g = graph
results = []
print("Running benchmarks for all implementations")... | 2.5625 | 3 |
stepik/3559/66578/step_2/script.py | tshemake/Software-Development | 0 | 12782952 | print(12345678987654321 + 98765432123456789) | 1.25 | 1 |
askme/askme_api/views.py | seattlechem/askme | 0 | 12782953 | """Rest Api views."""
from rest_framework.views import APIView
from rest_framework.response import Response
from .rectotext import rec_to_text
from .search import find
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decor... | 2.359375 | 2 |
monero_glue/protocol/tsx_sign_state.py | ph4r05/monero-agent | 20 | 12782954 | <filename>monero_glue/protocol/tsx_sign_state.py
from monero_glue.compat.micropython import const
class TState(object):
"""
Transaction state
"""
START = const(0)
INIT = const(1)
INP_CNT = const(2)
INPUT = const(3)
INPUT_DONE = const(4)
INPUT_PERM = const(5)
INPUT_VINS = const... | 2.203125 | 2 |
oldScripts/merged_model.py | hanzy1110/ProbabilisticFatigue | 0 | 12782955 | <filename>oldScripts/merged_model.py
#%%
import pymc3 as pm
import arviz as az
import pandas as pd
import numpy as np
from pymc3.gp.util import plot_gp_dist
from scipy import stats
from typing import Dict
import theano.tensor as tt
import matplotlib.pyplot as plt
def basquin_rel(N, B,b):
return B*(N**b)
B = 10... | 1.929688 | 2 |
Modulo_1/semana2/Estructura-de-Datos/list/listas-remove.py | rubens233/cocid_python | 0 | 12782956 | <reponame>rubens233/cocid_python<filename>Modulo_1/semana2/Estructura-de-Datos/list/listas-remove.py
a=["a", "b", "c"]
a.remove("a")
print(a) | 3.171875 | 3 |
app/workers/search/schemas/indices.py | d3vzer0/reternal-backend | 6 | 12782957 | from pydantic import BaseModel, validator, Field
from typing import List, Dict
from datetime import datetime
class IndicesIn(BaseModel):
index: str
source: str
sourcetype: str
class IndiceList(BaseModel):
indices: List[IndicesIn]
integration: str
execution_date: datetime
@validator('exec... | 2.53125 | 3 |
trexplot_oldcode.py | hammytheham/trexplot | 0 | 12782958 | <reponame>hammytheham/trexplot
# coding: utf-8
# Plotting script for TREACTMECH files written by <NAME> - hr0392 at bristol.ac.uk
#
# Run the script within the directory containing the flowdata, flowvector, stress strain, displacement files. Output by default is within same directory.
#
# Displacement gives the corne... | 2.359375 | 2 |
solutions_automation/vdc/dashboard/monitoring.py | threefoldtech/js-sdk | 13 | 12782959 | from solutions_automation.vdc.dashboard.common import CommonChatBot
from jumpscale.packages.vdc_dashboard.chats.monitoringstack import InstallMonitoringStack
class MonitoringStackAutomated(CommonChatBot, InstallMonitoringStack):
pass
| 1.15625 | 1 |
002-V2rayPool/core/conf.py | xhunmon/PythonIsTools | 18 | 12782960 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import os
class Config:
__v2ray_core_path = None
__v2ray_node_path = None
def __init__(self):
self.config = configparser.ConfigParser()
parent_dir = os.path.dirname(os.path.abspath(__file__))
self.config_path = os... | 2.75 | 3 |
src/update_all_courses_utils.py | PrincetonUSG/tigersnatch | 1 | 12782961 | <gh_stars>1-10
# ----------------------------------------------------------------------
# update_all_courses_utils.py
# Contains utilities for update_all_courses.py for the purpose of
# multiprocessing (top-level functions required).
# ----------------------------------------------------------------------
from mobilea... | 2.34375 | 2 |
examples/ws_subscriptions.py | PetrZufan/cryptoxlib-aio | 90 | 12782962 | import logging
import os
import asyncio
from cryptoxlib.CryptoXLib import CryptoXLib
from cryptoxlib.PeriodicChecker import PeriodicChecker
from cryptoxlib.Pair import Pair
from cryptoxlib.clients.binance.BinanceClient import BinanceClient
from cryptoxlib.clients.binance.BinanceWebsocket import OrderBookSymbolTickerS... | 2.25 | 2 |
get_sim_face_net.py | chenyu3050/fullbboxrestoration | 3 | 12782963 | <filename>get_sim_face_net.py
from facenet_pytorch import MTCNN, InceptionResnetV1
import torch
import numpy as np
import os
from PIL import Image
import torch.nn as nn
def preprocess(path=None,im=None):
if path is not None:
tmp = np.array(Image.open(path))
else:
tmp = im
if len(tmp.sh... | 2.5625 | 3 |
pyptv/client.py | Sumedh-k/pyptv | 0 | 12782964 | <reponame>Sumedh-k/pyptv
#!/usr/bin/env python
from datetime import datetime
import hmac
from hashlib import sha1
import json
import urlparse # TODO: remove in favour of better lib
import urllib
import requests
from pyptv.platform_ import Platform # don't clobber the builtin platform
from pyptv.direction import Di... | 2.25 | 2 |
roboticstoolbox/mobile/ParticleFilter.py | Russ76/robotics-toolbox-python | 0 | 12782965 | #!/usr/bin/env python3
"""
Python EKF Planner
@Author: <NAME>, original MATLAB code and Python version
@Author: <NAME>, initial MATLAB port
Based on code by <NAME>, Oxford University,
http://www.robots.ox.ac.uk/~pnewman
"""
from collections import namedtuple
import numpy as np
import scipy as sp
import matplotlib.... | 2.6875 | 3 |
pytorch/AdaBoost/ada_boost.py | OpenSourceAI/Algorithm | 1 | 12782966 | <filename>pytorch/AdaBoost/ada_boost.py<gh_stars>1-10
# -*- coding: UTF-8 -*-
# File Name:ada_boost_torch
# Author : <NAME>
# Date:2019/2/18
# Description :
__author__ = '<NAME>'
import torch
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# 单层决策树
cl... | 2.34375 | 2 |
web/pipeline/migrations/0064_auto_20200826_2058.py | stevenstuber/CIT | 10 | 12782967 | # Generated by Django 2.2.13 on 2020-08-26 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0063_merge_20200826_2021'),
]
operations = [
migrations.RenameField(
model_name='censussubdivision',
ol... | 1.617188 | 2 |
src/node_manger.py | TillJohanndeiter/quorum-cluster | 0 | 12782968 | <reponame>TillJohanndeiter/quorum-cluster
"""
Provides NodeManger which is responsible for events in network
"""
import time
from synchronized_set import SynchronizedSet
from observer import Observer
from src.message_dict import MessageDict, DEFAULT_MESSAGE, DISPATCH_MESSAGE, \
JSON_SEPARATOR, HANDSHAKE_MESSAGE, ... | 2.390625 | 2 |
kata/odds.py | PauloBernal/Codewars | 0 | 12782969 | # Solution by PauloBA
def odds(values):
oddNums = []
for i in values:
if i % 2 == 1:
oddNums.append(i)
return oddNums | 3.578125 | 4 |
app/routes/api.py | skielred/osmosis | 2 | 12782970 | from datetime import datetime
import logging
from flask import jsonify, request
from app import app, db
from app.models import Player, Chart, Score
from app.ranking import update_pb_for_score, update_player_osmos
from app.lazer import process_lazer_payload
from . import dumb_decryption
@app.route('/versions')
def ve... | 2.359375 | 2 |
mdso/data/gen_toeplitz_Rmat.py | artk2019/AISTAT_2019_107 | 0 | 12782971 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Generate various Similarity matrix
through the MatrixGenerator methods
gen_matrix for synthetic data, and
gen_E_coli_matrix for DNA data.
"""
import numpy as np
# from scipy import sparse as sp
from scipy.linalg import toeplitz
def gen_lambdas(type_matrix, n):
''... | 2.875 | 3 |
core/templatetags/team.py | 6ba/bbgo | 22 | 12782972 | <filename>core/templatetags/team.py
from django import template
# from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from teams.models import Team
register = template.Library()
@register.inclusion_tag('teams/show_team.html', takes_context=True)
def show_team(context, id):
... | 1.953125 | 2 |
mapeo/migrations/0002_auto_20151117_1648.py | shiminasai/plataforma_FADCANIC | 0 | 12782973 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mapeo', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='organizaciones',
name='sl... | 1.742188 | 2 |
00_TrackerApp/backend/repositories/user.py | JADSN/ReactCodes | 0 | 12782974 | <filename>00_TrackerApp/backend/repositories/user.py
# from datetime import datetime, timezone
# from schemas import UserItem
# from models import UserItem
# from dependencies import Session, Depends, HTTPException, status, get_db, oauth2_scheme
# from tokenizer import TokenData, SECRET_KEY, ALGORITHM
# from hasher ... | 2.28125 | 2 |
dit_helpdesk/hierarchy/migrations/0011_auto_20200910_1653.py | uktrade/dit-helpdesk | 3 | 12782975 | # Generated by Django 2.2.13 on 2020-09-10 15:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hierarchy", "0010_auto_20200910_1650")]
operations = [
migrations.AlterUniqueTogether(
name="subheading",
unique_together={("commodity_c... | 1.476563 | 1 |
src/ghutil/cli/gist/clone.py | jwodder/ghutil | 6 | 12782976 | <reponame>jwodder/ghutil
import click
from ghutil.git import clone_repo
from ghutil.types import Gist
@click.command()
@click.option('--https', 'url', flag_value='https', help='Clone over HTTPS')
@click.option('--ssh', 'url', flag_value='ssh', default=True,
help='Clone over SSH [default]')
@Gist.ar... | 2.78125 | 3 |
data_structures/binary_search_tree.py | dushyantss/william-fiset-data-structures-playlist | 0 | 12782977 | <reponame>dushyantss/william-fiset-data-structures-playlist
from typing import Optional
class Node:
def __init__(self, value, /, *, left: Node = None, right: Node = None):
self.value = value
self.left = left
self.right = right
class BinarySearchTree:
def __init__(self):
self.... | 3.71875 | 4 |
python programs/variable.py | saddam-gif/Python-crushcourse | 0 | 12782978 | print("Hello World")
message = "Be humble"
print(message)
message = "Be humble to the Everyone"
print(message) | 2.6875 | 3 |
modules/objectdetection/object_detection.py | tcastel-ippon/object-detection-serverless | 5 | 12782979 | <filename>modules/objectdetection/object_detection.py<gh_stars>1-10
import cv2
import numpy as np
def get_output_layers(net):
layer_names = net.getLayerNames()
output_layers = [layer_names[i[0] - 1]
for i in net.getUnconnectedOutLayers()]
return output_layers
def draw_prediction(
... | 2.640625 | 3 |
dvc/fs/_callback.py | dtrifiro/dvc | 0 | 12782980 | from contextlib import ExitStack
from functools import wraps
from typing import TYPE_CHECKING, Any, Dict, Optional, TypeVar, overload
import fsspec
from funcy import cached_property
if TYPE_CHECKING:
from typing import BinaryIO, Callable, TextIO, Union
from typing_extensions import ParamSpec
from dvc.pr... | 2.125 | 2 |
azure-de10nano-document/sensor-aggregation-reference-design-for-azure/sw/software-code/modules/RfsModule/test/suite_test.py | daisukeiot/terasic-de10-nano-kit | 0 | 12782981 | <reponame>daisukeiot/terasic-de10-nano-kit
# Copyright (C) 2021 Intel Corporation
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import sys
sys.path.append('../')
import unittest
import gsensor_test as g_test
import rfssensor_test as rfs_test
import sensor_test ... | 1.960938 | 2 |
python/ossid/utils/bop_utils.py | r-pad/OSSID_code | 1 | 12782982 | <gh_stars>1-10
from datetime import time
import os
import csv
import numpy as np
import pandas as pd
import subprocess
from ossid.config import BOP_TOOLKIT_PATH
def saveResultsBop(
results, output_folder, result_name, dataset_name,
split_name='test', pose_key = 'pose', score_key='score', time_key = '... | 2.4375 | 2 |
gui.py | nehal2000/spell-checker | 0 | 12782983 | <filename>gui.py
from tkinter import*
import subprocess
from subprocess import*
def end():
screen.destroy()
def clear():
inputT.delete("1.0",END)
outputT.delete("1.0",END)
def check():
a= inputT.get("1.0","end")
m=len(a)
a=a[:m-1]
if " " in a or not a.isalpha():
def exit_popup():
... | 3.390625 | 3 |
test/test_npu/test_ne.py | Ascend/pytorch | 1 | 12782984 | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 2.109375 | 2 |
web.py | mukul-git/dbms | 1 | 12782985 | <reponame>mukul-git/dbms
from flask import Flask, escape, request
app = Flask(__name__)
@app.route('/')
def hello():
name = request.args.get("name", "World")
return f'Hello, {escape(name)}!'
@app.route('/stats')
def stats():
name = request.args.get("table", None)
if name is not None:
return ... | 2.265625 | 2 |
Lib/site-packages/win32/Demos/win32console_demo.py | raychorn/svn_Python-2.5.1 | 0 | 12782986 | <gh_stars>0
import win32console, win32con
import traceback, time
virtual_keys={}
for k,v in win32con.__dict__.items():
if k.startswith('VK_'):
virtual_keys[v]=k
free_console=True
try:
win32console.AllocConsole()
except win32console.error, err_tuple:
if err_tuple[0]!=5:
raise
... | 2.328125 | 2 |
filters/puzzle.py | s3h10r/egw-plugins | 1 | 12782987 | <filename>filters/puzzle.py
#!/usr/bin/env python
#coding=utf-8
"""
usage example:
egw --generator psychedelic -o /tmp/2.png --filter puzzle -c ./einguteswerkzeug/einguteswerkzeug.conf --template ./einguteswerkzeug/templates/square/roland-deason-tPWHTBzQVIM-unsplash.jpg -s 200 --alpha-blend 0.8 --border-size 1 --nopo... | 2.09375 | 2 |
solutions/python3/1202.py | sm2774us/amazon_interview_prep_2021 | 42 | 12782988 | <filename>solutions/python3/1202.py
class Solution:
def smallestStringWithSwaps(self, s: str, pairs: List[List[int]]) -> str:
class UF:
def __init__(self, n): self.p = list(range(n))
def union(self, x, y): self.p[self.find(x)] = self.find(y)
def find(self, x):
... | 3.359375 | 3 |
pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_python_scalar.py | wangyum/anaconda | 0 | 12782989 | <filename>pkgs/dynd-python-0.7.2-py27_0/lib/python2.7/site-packages/dynd/tests/test_python_scalar.py<gh_stars>0
import sys
import unittest
from dynd import nd, ndt
from datetime import date
if sys.version_info >= (3, 0):
unicode = str
class TestPythonScalar(unittest.TestCase):
def test_bool(self):
# B... | 2.609375 | 3 |
exalt/search.py | DeepDarkOdyssey/exalt | 0 | 12782990 | <reponame>DeepDarkOdyssey/exalt<gh_stars>0
from typing import Iterable, Union, List, TypeVar
from collections import OrderedDict
import re
Node = TypeVar("TrieNode")
class TrieNode(object):
def __init__(self, key: str = ""):
self.key = key
self.next = {}
self.is_word = False
... | 2.8125 | 3 |
tests/potential/test__get_symbol_pairs.py | eragasa/mexm-base | 1 | 12782991 | <reponame>eragasa/mexm-base
import pytest
from collections import OrderedDict
from mexm.potential import get_symbol_pairs
cases = OrderedDict()
cases['1sym_str'] = OrderedDict([
('symbols','Ni'),
('expected_pairs',[['Ni','Ni']])
])
cases['1sym_list'] = OrderedDict([
('symbols', ['Ni']),
('expected_pai... | 2.265625 | 2 |
assessment_plan_modeling/ap_parsing/augmentation_lib_test.py | pedersor/google-research | 0 | 12782992 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2.234375 | 2 |
INEGIpy/setup.py | andreslomeliv/DatosMex | 1 | 12782993 | <filename>INEGIpy/setup.py
# -*- coding: utf-8 -*-
from setuptools import setup
NAME = 'INEGIpy'
DESCRIPTION = 'Wrap de Python para los APIs del INEGI'
URL = 'https://github.com/andreslomeliv/DatosMex/tree/master/INEGIpy'
EMAIL = '<EMAIL>'
AUTHOR = '<NAME>'
REQUIRES_PYTHON = '>=3.6.0'
VERSION = '0.1.0'
# librerías re... | 1.148438 | 1 |
svbench/loaders.py | kcleal/svbench | 10 | 12782994 | <reponame>kcleal/svbench
from svbench import CallSet, Col
import numpy as np
from sys import stderr
__all__ = ["load_dysgu", "load_lumpy", "load_delly", "load_manta", "load_sniffles", "load_whamg"]
def load_dysgu(pth, dataset, caller="dysgu"):
c = Col("FORMAT", "PROB", bins=np.arange(0, 1.01, 0.025))
k = Col... | 2.078125 | 2 |
Modules/LeetCode/Task9.py | Itsuke/Learning-Python | 0 | 12782995 | <gh_stars>0
'''
https://leetcode.com/discuss/interview-question/1667337/FacebookMeta-or-Phone-Screen-or-New-Grad-or-Binary-Tree-%2B-Backtrack-problem
https://leetcode.com/problems/expression-add-operators/
123456789 = 100
Using standard integer arithmetic operators +, -, what are those different solutions you can find... | 3.59375 | 4 |
tests/unit/core/test_test_helpers_unit.py | pranav-byte/tight | 9 | 12782996 | # Copyright (c) 2017 lululemon athletica Canada 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 o... | 1.984375 | 2 |
relevanceai/dataset/io/export/dict.py | RelevanceAI/RelevanceAI | 21 | 12782997 | from relevanceai.utils.decorators.analytics import track
from relevanceai.dataset.read import Read
class DictExport(Read):
@track
def to_dict(self, orient: str = "records"):
"""
Returns the raw list of dicts from Relevance AI
Parameters
----------
None
Returns... | 3.03125 | 3 |
models/modules.py | LaudateCorpus1/learning-compressible-subspaces | 6 | 12782998 | <filename>models/modules.py
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2021 Apple Inc. All Rights Reserved.
#
from typing import Union
import torch
import torch.nn as nn
import torch.nn.functional as F
# Convolutions
StandardConv = nn.Conv2d
class SubspaceConv(nn.Conv2d):
def forward(self,... | 2.671875 | 3 |
scripts/gen_chainercv_test.py | disktnk/chainer-compiler | 116 | 12782999 | <reponame>disktnk/chainer-compiler
"""Tests for ChainerCV related custom ops."""
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
import onnx
import onnx_script
import test_case
_has_chnainercv = True
try:
import chainercv_rpn
except ImportError:
_has_chnainercv = F... | 2.1875 | 2 |
project/server/__init__.py | mjhea0/flask-challenge | 2 | 12783000 | # project/server/__init__.py
import os
from flask import Flask, make_response, jsonify
app = Flask(__name__)
app_settings = os.getenv(
'APP_SETTINGS',
'project.server.config.DevelopmentConfig'
)
app.config.from_object(app_settings)
from project.server.api.routes import api_blueprint
app.register_bluepr... | 2.546875 | 3 |
src/full_constraint.py | LC-John/RangeAnalysis | 4 | 12783001 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 3 13:10:21 2018
@author: DrLC
"""
from symtab import build_symtab
import constraint
import cfg
import os, sys
from interval import interval
class FCG(object):
def __init__(self, _cfg={}, _main="", _symtab={}):
assert _main in _cfg.keys()
... | 2.265625 | 2 |
setup.py | FrankLeeeee/powerpack | 0 | 12783002 | <reponame>FrankLeeeee/powerpack
#!/usr/bin/env python
import os
import subprocess
import time
from setuptools import find_packages, setup
import omnipack
def readme():
with open('README.md', encoding='utf-8') as f:
content = f.read()
return content
if __name__ == '__main__':
setup(
name=... | 1.382813 | 1 |
Python/DP/ Word Break II/Word Break II DP BOTTOM UP.py | khanhhuynguyenvu/LeetcodeDaily | 0 | 12783003 | <filename>Python/DP/ Word Break II/Word Break II DP BOTTOM UP.py
from functools import lru_cache
class Solution(object):
def wordBreak(self, s, wordDict):
wordDict = set(wordDict)
n = len(s)
dp = [[] for i in range(n + 1)]
dp[n] = [[]]
ans = []
for i in range(n - 1,... | 3.484375 | 3 |
dleamse/dleamse_faiss_index_writer.py | luoxi123/DLEAMSE | 3 | 12783004 | <gh_stars>1-10
# -*- coding:utf-8 -*-
import os
import sys
import unittest
import numpy as np
import pandas as pd
import faiss
import ast
import click
DEFAULT_IVF_NLIST = 100
class FaissWriteIndex:
def __init__(self):
self.tmp = None
print("Initialized a faiss index class.")
def create_index_for_embed... | 2.515625 | 3 |
flyrc/numeric.py | mrflea/flyrc | 0 | 12783005 | # This is based upon numerics returned from the Charybdis ircd, which
# complies with RFC numerics.
# Numerics 001 .. 099 are sent from the server to a local client.
RPL_WELCOME = "001"
RPL_YOURHOST = "002"
RPL_CREATED = "003"
RPL_MYINFO = "004"
RPL_ISUPPORT = "005"
RPL_SNOMASK = "008"
RPL_REDIR = "010"
RPL_MAP = "015... | 1.625 | 2 |
crc/scripts/failing_script.py | sartography/cr-connect-workflow | 2 | 12783006 | from crc.scripts.script import Script
from crc.services.failing_service import FailingService
class FailingScript(Script):
def get_description(self):
return """It fails"""
def do_task_validate_only(self, task, *args, **kwargs):
pass
def do_task(self, task, *args, **kwargs):
Fai... | 2.359375 | 2 |
booktoshare.py | gozik/booktoshare | 0 | 12783007 | <filename>booktoshare.py
import click
from flask import current_app
from app import db, create_app
from app.models.auth import User, Role
from app.models.books import Book
def register(app):
@app.cli.command("create_admin")
@click.argument("password")
def create_admin(password):
pass # TODO
ap... | 2.09375 | 2 |
distances/migrations/0001_initial.py | tkettu/rokego | 0 | 12783008 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-21 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
na... | 1.78125 | 2 |
server/models/base.py | AndrewIjano/distributed-tic-tac-toe | 0 | 12783009 | class BaseModel:
@property
def key(self):
raise NotImplementedError()
def serialize(self):
return vars(self)
| 2.296875 | 2 |
matrix operation.py | Arjitg450/Python-Programs | 0 | 12783010 | <reponame>Arjitg450/Python-Programs<filename>matrix operation.py<gh_stars>0
import numpy as np
names=['arjit','brett','chetan','deval','farukh','govind','harshit']
ndict={'arjit':'0','brett':'1','chetan':'2','deval':'3','farukh':'4',
'govind':'5','harshit':'6'}
year=['2010','2011','2012','2013','2014','2015','... | 2.953125 | 3 |
libhandy/lists/switches.py | jeteokeeffe/gtk-python-examples | 0 | 12783011 | import gi
gi.require_version('Handy', '0.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Handy
class MyWindow(Gtk.Window):
def __init__(self):
# https://lazka.github.io/pgi-docs/Gtk-3.0/classes/Window.html
Gtk.Window.__init__(self)
self.set_title("Switches Exam... | 2.671875 | 3 |
convert sph.py | mn270/Recognition-phenomena-TIMIT- | 0 | 12783012 | <reponame>mn270/Recognition-phenomena-TIMIT-<filename>convert sph.py
from sphfile import SPHFile
import glob
import os
""""Convert SPH file to wav"""
dialects_path = "/home/marcin/Pobrane/TIMIT"
root_dir = os.path.join(dialects_path, '**/*.WAV')
wav_files = glob.glob(root_dir, recursive=True)
for wav_file in wav_file... | 3.078125 | 3 |
background/urls.py | Ultimatum22/MediaPanel | 0 | 12783013 | <reponame>Ultimatum22/MediaPanel<filename>background/urls.py
from django.conf.urls import url, patterns
from background import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^update/', views.update),
) | 1.6875 | 2 |
arachne/resources/interface.py | shrine-maiden-heavy-industries/arachne | 3 | 12783014 | <filename>arachne/resources/interface.py<gh_stars>1-10
# SPDX-License-Identifier: BSD-3-Clause
from amaranth.build import *
from . import assert_width
__all__ = (
'JTAGResource',
'EthernetResource',
'CANResource',
)
def JTAGResource(*args, tck, tms, tdi, tdo, conn = None, attrs = None):
ios = [
Subs... | 1.96875 | 2 |
src/common/lie/numpy/__init__.py | yewzijian/MultiReg | 3 | 12783015 | from .liegroupbase import LieGroupBase
from .so3 import SO3
from .so3q import SO3q
from .se3 import SE3
from .se3q import SE3q
| 1.007813 | 1 |
events/migrations/0001_initial.py | Akash1S/meethub | 428 | 12783016 | # Generated by Django 2.0.4 on 2018-04-21 15:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.867188 | 2 |
src/validate_plist_xml/__init__.py | jgstew/validate_plist_xml | 0 | 12783017 | """
To support validate_plist_xml as module
"""
from .validate_plist_xml import main
__version__ = "1.0.4"
| 1.164063 | 1 |
kenchi/plotting.py | Y-oHr-N/kenchi | 19 | 12783018 | <filename>kenchi/plotting.py
import numpy as np
from scipy.stats import gaussian_kde
from sklearn.metrics import auc, roc_curve
from sklearn.utils.validation import check_array, check_symmetric, column_or_1d
__all__ = [
'plot_anomaly_score', 'plot_graphical_model',
'plot_partial_corrcoef', 'plot_roc_curve'
]
... | 2.578125 | 3 |
django_backend/fleet/serializers.py | CapacitacionDesoft/travels-log | 2 | 12783019 | from rest_framework import serializers
from .models import Driver, Vehicle
class DriverSerializers(serializers.ModelSerializer):
class Meta:
model = Driver
fields = '__all__'
class VehicleSerializers(serializers.ModelSerializer):
class Meta:
model = Vehicle
fields = '__all__'... | 2.15625 | 2 |
first.py | FilipCvetko/Testingrepo | 0 | 12783020 | <gh_stars>0
print("H222I.")
| 1.101563 | 1 |
easistrain/func_get_image_matrix.py | woutdenolf/easistrain | 0 | 12783021 | <gh_stars>0
import h5py
import numpy as np
### This function get the image matrix from the h5 file and convert it to float64 ###
### root_data: the path of the folder where the h5 file is saved
### h5file: The name of the h5 file from which the matrix of the image will be extracted
### scan: The name of the gr... | 3.265625 | 3 |
useful/text_to_mp3/test04.py | xmark2/practice | 0 | 12783022 | <gh_stars>0
from gtts import gTTS
import os
import glob
from pathlib import Path
def readfile(file):
with open(file, encoding="utf-8") as f:
data = f.read()
return data
def list_files(path,file_type):
# path = './input'
# files = [f for f in glob.glob(path + "**/*."+file_type, recursive=True)]
files = glob.gl... | 3.078125 | 3 |
src/lib/interfaces/iqueueprocessor.py | itsmylin/wechat-robinhood | 13 | 12783023 | <filename>src/lib/interfaces/iqueueprocessor.py
# Define an interface for possible future implementations of queue processors for other messenger platforms
class IQueueProcessor(object):
def process_message(self, message):
raise Exception('Not implemented')
| 2.5 | 2 |
tencect_s_class/pg03_excel/excel.py | ww35133634/chenxusheng | 0 | 12783024 | """
python 操作 Excel
"""
import xlrd
import xlwt
# #读取Excel文件
# workbook = xlrd.open_workbook(filename)
# #获取所有表名
# sheet_names = workbook.sheets()
#
# # #通过索引顺序获取一个工作表
# sheet0 = workbook.sheets()[0]
# # # or
# sheet1 = workbook.sheet_by_index(1)
# # #通过表名获取一个工作表
# sheet3 = workbook.sheet1
# # for i in sheet_names:... | 3.71875 | 4 |
zoinks/cogs/coolsville.py | geoffhouy/zoinks | 0 | 12783025 | <reponame>geoffhouy/zoinks
import zoinks.bot
from zoinks.bot import ZOINKS
import discord
from discord.ext import commands
import logging
logger = logging.getLogger(__name__)
COOLSVILLE_GUILD_ID = 0
COOLSVILLE_RULES_CHANNEL_ID = 0
COOLSVILLE_NOTIFICATIONS_CHANNEL_ID = 0
COOLSVILLE_GUEST_ROLE_ID = 0
COOLSVILLE_CONT... | 2.828125 | 3 |
source/slask/denavit_hartenberg_symbolic.py | johnsjob/master-thesis | 0 | 12783026 | from __future__ import division
#--------------------------#
import sys
#--------------------------#
import sympy as s
from sympy import cos, sin, pi
from sympy.matrices import Matrix as mat
#=====================================================#
from helperfunctions import matmul_series
sys.path.append("../in... | 2.109375 | 2 |
learning_object/collection/manager/modify_one.py | dsvalenciah/ROAp | 4 | 12783027 | <gh_stars>1-10
"""
Contains utility functions to works with learning-object modify.
"""
from datetime import datetime
from manager.exceptions.learning_object import (
LearningObjectNotFoundError, LearningObjectSchemaError,
LearningObjectMetadataSchemaError
)
import re
from marshmallowjson.marshmallowjson im... | 2.109375 | 2 |
packs/reamaze/actions/article_create.py | userlocalhost2000/st2contrib | 164 | 12783028 | <gh_stars>100-1000
from lib.actions import BaseAction
class ArticleCreate(BaseAction):
def run(self, title, body, topic=None, status=0):
if topic:
topic = self._convert_slug(topic)
path = '/topics/%s/articles' % topic
else:
path = '/articles'
payload = s... | 2.515625 | 3 |
day-08/part-1/silvestre.py | badouralix/adventofcode-2018 | 31 | 12783029 | from tool.runners.python import SubmissionPy
class SilvestreSubmission(SubmissionPy):
def run(self, s):
arr = list(map(int, s.splitlines()[0].split()))
def sum_meta(arr, i_node):
n_child = arr[i_node]
n_meta = arr[i_node + 1]
i_next = i_node + 2
re... | 2.453125 | 2 |
ABC/181/C.py | yu9824/AtCoder | 0 | 12783030 | # list(map(int, input().split()))
# int(input())
import sys
sys.setrecursionlimit(10 ** 9)
from itertools import combinations
def main(*args):
N, XY = args
def difference(p1, p2):
return p2[0] - p1[0], p2[1] - p1[1]
for c in combinations(XY, r = 3):
p1, p2, p3 = c # p = (x, y)
... | 2.671875 | 3 |
Preprocessor.py | beckylum0216/MurdochNet_Yale_tf | 0 | 12783031 | <reponame>beckylum0216/MurdochNet_Yale_tf
import cv2
import numpy as np
class ProcessImage(object):
def __init__(self, imgWidth, imgHeight, rawImage):
self.a = 0
self.b = 0
self.c = self.a + imgWidth
self.d = self.b + imgHeight
self.width = imgWidth
self.height = im... | 2.90625 | 3 |
setup.py | VJftw/invoke-tools | 2 | 12783032 |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from os import path
from subprocess import check_output
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from c... | 1.695313 | 2 |
transformer_anatomy/downstream_multi_head_exp.py | heartcored98/Trasnformer_Anatomy | 16 | 12783033 | import sys
import time
import pandas as pd
from os import listdir
from os.path import isfile, join
import json
from .tasks import *
PATH_BERT = '/home/users/whwodud98/pytorch-pretrained-BERT'
sys.path.insert(0, PATH_BERT)
PATH_SENTEVAL = '/home/users/whwodud98/bert/SentEval'
PATH_TO_DATA = '/home/users/whwodud98/ber... | 2.0625 | 2 |
blog/urls.py | shinnlove/datacheck | 1 | 12783034 | <filename>blog/urls.py<gh_stars>1-10
from django.urls import path,include
import blog.views
from django.conf.urls import url
urlpatterns=[
path('hello_world',blog.views.hello_world),
path('content',blog.views.article_content),
url(r'^index/', blog.views.index),
url(r'^index2/', blog.views.index2),
... | 1.898438 | 2 |
apps/core/models/photos.py | CosmosTUe/Cosmos | 1 | 12783035 | <gh_stars>1-10
from django.db import models
from django.urls import reverse
class PhotoAlbum(models.Model):
title = models.CharField(max_length=255)
date = models.DateField()
album_cover = models.ImageField(upload_to="photos")
def get_absolute_url(self):
return reverse("cosmos_core:photo_albu... | 2.21875 | 2 |
test_Reader.py | mgood13/bme590hrm | 0 | 12783036 | def test_csvfinder():
"""Tests that the finder finds all the correct files
:returns test_files: List of .csv files
"""
from Reader import csvfinder
test_files = csvfinder()
assert test_files.count('poorform') == 0
assert test_files.count('wrongend') == 0
assert test_files.count('false.... | 3.625 | 4 |
scripts/validate_schemas.py | slebras/sample_service_validator_config | 0 | 12783037 | import sys
import yaml
from jsonschema import validate
if len(sys.argv) != 3:
raise RuntimeError(f'Please provide validation file and json schema file as arguments to validate_schemas.py')
merged_file = sys.argv[1]
json_schema_file = sys.argv[2]
with open(json_schema_file) as f:
_META_VAL_JSONSCHEMA = yaml.s... | 2.328125 | 2 |
setup.py | tudou0002/NEAT | 1 | 12783038 | <filename>setup.py
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt', 'r') as f:
install_requires = list()
for line in f:
re = line.strip()
if re:
install_requires.append(re)
setuptools.setup(
name="nameextractor... | 1.953125 | 2 |
util/util.py | LSnyd/MedMeshCNN | 15 | 12783039 | from __future__ import print_function
import torch
import numpy as np
import os
# from torch_scatter import scatter_add
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
MESH_EXTENSIONS = [
'.obj',
]
def is_mesh_file(filename):
return any(filename.endswith(extension) for extensi... | 2.203125 | 2 |
kitsune/questions/urls_api.py | AndrewDVXI/kitsune | 929 | 12783040 | from rest_framework import routers
from kitsune.questions.api import QuestionViewSet, AnswerViewSet
router = routers.SimpleRouter()
router.register(r"question", QuestionViewSet)
router.register(r"answer", AnswerViewSet)
urlpatterns = router.urls
| 1.632813 | 2 |
tenable.py | rohit-k-das/vulnerability-management-reporter | 0 | 12783041 | import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import datetime
import logging
import time
import concurrent.futures
from dataclasses import dataclass, field
from typing import List, Tuple, Dict
import re
import netaddr
import ConfigParser
import os
logg... | 2.25 | 2 |
migrations/versions/26dbeb68791e_.py | gesiscss/binder_gallery | 4 | 12783042 | <reponame>gesiscss/binder_gallery
"""empty message
Revision ID: 2<PASSWORD>
Revises: <PASSWORD>
Create Date: 2019-08-05 11:09:30.843900
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '2<PASSWORD>'
down_revision = '<PAS... | 1.195313 | 1 |
tests/test_modify_group.py | bloodes/adressbook | 0 | 12783043 | from models.model_group import Group
import random
def test_modify_some_group(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create_new_group(Group(group_name='a', group_header='b', group_footer='c'))
old_groups = db.get_group_list()
group = random.choice(old_groups)
new_group... | 2.4375 | 2 |
main4.py | tamurata/E04a-Sprites | 0 | 12783044 | #!/usr/bin/env python3
import utils, os, random, time, open_color, arcade
utils.check_version((3,7))
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Sprites Example"
class MyGame(arcade.Window):
def __init__(self):
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
file_path = ... | 2.9375 | 3 |
train.py | dogydev/COVID-Efficientnet-Pytorch | 5 | 12783045 | import logging
import os
import numpy as np
from sklearn.metrics import classification_report
import torch
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.nn import CrossEntropyLoss
from data.dataset import COVIDxFolder
from data import transforms
from torch.utils.data i... | 2.03125 | 2 |
minos/auth_token/exceptions.py | minos-framework/minos-auth-token | 5 | 12783046 | class TokenConfigException(Exception):
"""Base Api Gateway Exception."""
class NoTokenException(TokenConfigException):
"""Exception to be raised when token is not available."""
class ApiGatewayConfigException(TokenConfigException):
"""Base config exception."""
| 1.992188 | 2 |
scripts/appsetup.py | tdude92/pengumoneymaker | 0 | 12783047 | <gh_stars>0
import pyautogui
import time
print("Please move your mouse to the icon of an open browser running club penguin on the task bar.")
print("Capturing in...")
for i in range(10, 0, -1):
print("", i, " ", end = "\r")
time.sleep(1)
mouse_pos = pyautogui.position()
print("Position successfully captured.... | 2.828125 | 3 |
waymo_kitti_converter/tools/lidar_to_image_test.py | anhvth/Pseudo_Lidar_V2 | 0 | 12783048 | import cv2
import numpy as np
from calibration import get_calib_from_file
# kitti
# name = '000000'
# pc_pathname = '/home/alex/github/waymo_to_kitti_converter/tools/kitti/velodyne/'+name+'.bin'
# img_pathname = '/home/alex/github/waymo_to_kitti_converter/tools/kitti/image_2/'+name+'.png'
# calib_pathname = '/home/ale... | 2.515625 | 3 |
app.py | DARK-art108/Cotton-Leaf-Disease-Detection | 11 | 12783049 | from __future__ import division, print_function
# coding=utf-8
import sys
import os
import glob
import re
import numpy as np
import tensorflow as tf
import pathlib
import wget
# from tensorflow.compat.v1.compat import ConfigProto
# from tensorflow.compat.v1 import InteractiveSession
#from tensorflow.pyt... | 2.203125 | 2 |
cell_imaging_utils/__init__.py | lionben89/BGU_cell_imaging_utils | 0 | 12783050 | <reponame>lionben89/BGU_cell_imaging_utils
from cell_imaging_utils.datasets_metadata.table.datasetes_metadata_csv import DatasetMetadataSCV
from cell_imaging_utils.datasets_metadata.dict.datasetes_metadata_pickle import DatasetMetadataPickle
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = "1.0.0"
def get_m... | 1.492188 | 1 |