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 |
|---|---|---|---|---|---|---|
arc/queues.py | arc-repos/arc-functions-python | 4 | 34700 | <gh_stars>1-10
import boto3
import json
import urllib.request
import os
from . import reflect
def publish(name, payload):
if os.environ.get("NODE_ENV") == "testing":
try:
dump = json.dumps({"name": name, "payload": payload})
data = bytes(dump.encode())
handler = urllib... | 2.25 | 2 |
format_database.py | CS3244-Group10/NameABird | 0 | 34701 | <gh_stars>0
import os
import numpy as np
from scipy.misc import imread, imresize
def load_image_labels(dataset_path=''):
labels = {}
with open(os.path.join(dataset_path, 'image_class_labels.txt')) as f:
for line in f:
pieces = line.strip().split()
image_id = pieces[0]
... | 2.5625 | 3 |
tools/tflitefile_tool/parser/tflite_parser.py | YongseopKim/ONE | 0 | 34702 | <filename>tools/tflitefile_tool/parser/tflite_parser.py
#!/usr/bin/env python
# Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | 2.4375 | 2 |
modules/text/text_generation/plato2_en_base/module.py | AK391/PaddleHub | 8,360 | 34703 | # coding:utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 1.953125 | 2 |
Uncuffed/web/routes.py | WckdAwe/Uncuffed | 2 | 34704 | # ------ [ API ] ------
API = '/api'
# ---------- [ BLOCKCHAIN ] ----------
API_BLOCKCHAIN = f'{API}/blockchain'
API_BLOCKCHAIN_LENGTH = f'{API_BLOCKCHAIN}/length'
API_BLOCKCHAIN_BLOCKS = f'{API_BLOCKCHAIN}/blocks'
# ---------- [ BROADCASTS ] ----------
API_BROADCASTS = f'{API}/broadcasts'
API_BROADCASTS_NEW_BLOCK =... | 1.3125 | 1 |
autumn/infrastructure/tasks/utils.py | emmamcbryde/AuTuMN-1 | 0 | 34705 | <filename>autumn/infrastructure/tasks/utils.py
import logging
import logging.config
import socket
import os
from autumn.core.utils.runs import read_run_id
from autumn.core.project import Project, get_project
def get_project_from_run_id(run_id: str) -> Project:
app_name, region_name, _, _ = read_run_id(run_id)
... | 2.03125 | 2 |
lib/datasets/wider_face.py | thesuperorange/face-faster-rcnn.pytorch | 14 | 34706 | <gh_stars>10-100
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __futur... | 2.203125 | 2 |
locale/pot/api/core/_autosummary/pyvista-ExplicitStructuredGrid-compute_implicit_distance-1.py | tkoyama010/pyvista-doc-translations | 4 | 34707 | # Compute the distance between all the points on a sphere and a
# plane.
#
import pyvista as pv
sphere = pv.Sphere()
plane = pv.Plane()
_ = sphere.compute_implicit_distance(plane, inplace=True)
dist = sphere['implicit_distance']
type(dist)
# Expected:
## <class 'numpy.ndarray'>
#
# Plot these distances as a heatmap
#
p... | 3.28125 | 3 |
web_Project/Data_Predict/predict_lead.py | mscenter1/pigpriceML | 8 | 34708 | # -*- coding: utf-8 -*-
# 系统模块
import sys
# 数据处理模块
import pandas as pd
# 引入外部模块
# 整理数据
from predict_prepare import Predict_Prepare as Prepare
# 获取价格预测结果
from predict_predict import Predict_Predict as Predict
class Predict_Lead:
def __init__(self):
pass
# 其他包调用的函数
def predict_result(self):
... | 2.921875 | 3 |
aerforge/text.py | Aermoss/AerForge | 2 | 34709 | <gh_stars>1-10
import pygame
from aerforge.color import *
from aerforge.error import *
class Text:
def __init__(self, window, text, font_size = 24, font_file = None, font_name = "arial", bold = False, italic = False, underline = False, color = Color(240, 240, 240), x = 0, y = 0, parent = None, add_to_object... | 2.9375 | 3 |
xchange/__init__.py | jrgparkinson/ouccc | 0 | 34710 | default_app_config = 'webapp.apps.WebAppConfig' | 1.085938 | 1 |
setup.py | ruivieira/python-als | 2 | 34711 | from distutils.core import setup
setup(
name='als',
packages=['als'],
version='0.0.2',
description='Python library for Alternating Least Squares (ALS)',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/ruivieira/python-als',
download_url='https://github.com/'
... | 1.320313 | 1 |
echolab2/instruments/util/bottom_data.py | iambaim/pyEcholab | 0 | 34712 | # coding=utf-8
# National Oceanic and Atmospheric Administration (NOAA)
# Alaskan Fisheries Science Center (AFSC)
# Resource Assessment and Conservation Engineering (RACE)
# Midwater Assessment and Conservation Engineering (MACE)
# THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLI... | 2.484375 | 2 |
npy2f32.py | shaun95/LPCNet | 0 | 34713 | <reponame>shaun95/LPCNet
import numpy as np
import argparse
import sys
import os
dir_name = os.path.dirname(os.path.realpath(__file__))
npy_data = np.load(os.path.join(dir_name, sys.argv[1]))
npy_data = npy_data.astype(np.float32)
npy_data = npy_data.reshape((-1,))
npy_data.tofile(os.path.join(dir_name, sys.argv[1].sp... | 2.234375 | 2 |
scripts/generator/filter_domains.py | kcappieg/metronome | 0 | 34714 | <gh_stars>0
#!/usr/bin/env python3
import os
import sys
from shutil import copyfile, move
import argparse
from glob import glob
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from Metronome import distributed_execution
def generate_astar_configs(domain_paths, domain_type):
config_... | 2.03125 | 2 |
Controller/controleTelas.py | IuriBritoDev/TKINO | 0 | 34715 | from View import telaRelatorio, telaNovoProjeto, telaAbrirProjeto, telaCadastro, telaConfigura, telaConexao, telaEditarControle, telaPopUp
from View.Painel import painelSensores, painelControladores, painelConexao
from View.Conexao import telaConAnalogAnalog, telaConAnalogDigit, telaConDigitAnalog, telaConDigitDigit
... | 1.742188 | 2 |
paul_analysis/Python/util/hdf5lib_param.py | lzkelley/arepo-mbh-sims_analysis | 0 | 34716 | <gh_stars>0
#tables or h5py
libname="h5py" #tables"
#libname="tables"
def setlib(name):
global libname
libname = name
| 1.429688 | 1 |
setup_project.py | WindfallLabs/setup_project | 1 | 34717 | <filename>setup_project.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup_project.py -- GIS Project Setup Utility
<NAME>; May 2014/May 2016
This script creates a project folder-environment for GIS projects as follows:
<project_name>/
data/
raw/
<project_name>.gdb
design/
fonts/... | 2.28125 | 2 |
tests/format_directory_test.py | garysb/dismantle | 2 | 34718 | <reponame>garysb/dismantle
import os
from pathlib import Path
import pytest
from dismantle.package import DirectoryPackageFormat, PackageFormat
def test_inherits() -> None:
assert issubclass(DirectoryPackageFormat, PackageFormat) is True
def test_grasp_exists(datadir: Path) -> None:
src = datadir.join('dire... | 2.3125 | 2 |
labour/helpers.py | darkismus/kompassi | 13 | 34719 | <reponame>darkismus/kompassi
from functools import wraps
from django.contrib import messages
from django.shortcuts import get_object_or_404, redirect
from access.cbac import default_cbac_required
from core.models import Event
from .views.admin_menu_items import labour_admin_menu_items
def labour_admin_required(vie... | 2.015625 | 2 |
mnist/knows.py | huangjunxiong11/TF2 | 0 | 34720 | import tensorflow as tf
import numpy as np
a = np.arange(15)
out = a.reshape(5, 3)
c = np.arange(15) / 2
y_onehot = c.reshape(5, 3)
out_tensor = tf.convert_to_tensor(out, dtype=tf.float32)
y_onehot_tensor = tf.convert_to_tensor(y_onehot, dtype=tf.float32)
# y_onehot = tf.one_hot(y_onehot_tensor, depth=3) # one-hot... | 2.734375 | 3 |
belady.py | EstebanGS13/operating-system-algorithms | 0 | 34721 | <reponame>EstebanGS13/operating-system-algorithms<filename>belady.py
if __name__ == "__main__":
pages = [5, 4, 3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5]
faults = {3: 0, 4: 0}
for frames in faults:
memory = []
for page in pages:
out = None
if page not in memory... | 3.34375 | 3 |
dictvaluesortt.py | Srinivassan-Ramamurthy/python_programs | 0 | 34722 | a={'a':'hello','b':'1','c':'jayalatha','d':[1,2]}
d={}
val=list(a.values())
val.sort(key=len)
print(val)
for i in val:
for j in a:
if(i==a[j]):
d.update({j:a[j]})
print(d)
| 3.609375 | 4 |
papermerge/core/urls.py | ebdavison/papermerge | 0 | 34723 | <filename>papermerge/core/urls.py<gh_stars>0
from django.urls import path, include
from django.contrib.auth.decorators import login_required
from papermerge.core.views import documents as doc_views
from papermerge.core.views import access as access_views
from papermerge.core.views import api as api_views
document_pa... | 1.914063 | 2 |
Ene-Jun-2021/flores-fernandez-fernando/Primer Parcial/Ejercicio 2/Ejercicio_2.py | bryanbalderas/DAS_Sistemas | 41 | 34724 | import abc
#inteface Component creamos la funcion buscador que es la que buscara alguna PaginaWeb en el SitioWeb
class ISitioWebComponent(metaclass=abc.ABCMeta):
@abc.abstractmethod
def buscador(self):
pass
# Concrete Component
class SitioWebConcreteComponent(ISitioWebComponent):
def __init__(s... | 3.515625 | 4 |
DeBERTa/data/data_sampler.py | tirkarthi/DeBERTa | 7 | 34725 | #
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Author: <NAME> (<EMAIL>)
# Date: 05/15/2019
#
import os
import numpy as np
import math
import sys
from torch.utils.data import Sampler
__all__=['BatchSampler', 'DistributedBatchSampler', '... | 2.15625 | 2 |
full_simulation/my_code/physics.py | kvmu/KURRI-workterm | 0 | 34726 | <reponame>kvmu/KURRI-workterm
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 04 17:37:37 2015
@author: Kevin
"""
| 0.742188 | 1 |
tests/__init__.py | contentstack/contentstack-utils-python | 0 | 34727 | <gh_stars>0
# pytest --html=tests/report/test-report.html
# above command runs tests and test reports generates in tests/report location.
# nosetests --with-coverage --cover-html
# clean all the .pyc files
# find . -name \*.pyc -delete
# nosetests --with-coverage --cover-html
# pytest --cov=contentstack_utils
# pytest... | 2.078125 | 2 |
sorting/builtin.py | umd-coding-workshop/algorithms | 0 | 34728 | <reponame>umd-coding-workshop/algorithms
#!/usr/bin/env python3
''' Use the python built-in sort for comparison
against other implementations.'''
import sys
def merge(a, b):
sorted = []
while len(a) > 0 and len(b) > 0:
if a[0] < b[0]:
sorted.append(a.pop(0))
else:
... | 3.9375 | 4 |
moq4/repo.bzl | tomaszstrejczek/rules_dotnet_3rd_party | 1 | 34729 | load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resx", "core_xunit_test")
core_resx(
name = "core_resource",
src = ":src/Moq/Properties/Resources.resx",
identifier = "Moq.Properties.Resources.resources",
)
core_library(
name = "Moq.dll",
srcs = glob(["src/Moq/**/*.cs"]),
... | 1.375 | 1 |
soaplib/core/test/type/test_clazz.py | divaliu1408/overfit | 0 | 34730 | #!/usr/bin/env python
#
# soaplib - Copyright (C) Soaplib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... | 2.21875 | 2 |
code/strats/npctt.py | yasirroni/PrisonersDilemmaTournament | 0 | 34731 | <reponame>yasirroni/PrisonersDilemmaTournament
from decimal import Decimal
import numpy
def strategy(history, memory):
"""
Nice Patient Comparative Tit for Tat (NPCTT):
1. Nice: Never initiate defection, else face the wrath of the Grudge.
2. Patient: Respond to defection with defection, unless... | 3.6875 | 4 |
onadata/apps/api/tests/permissions/test_permissions.py | childhelpline/myhelpline | 1 | 34732 | <filename>onadata/apps/api/tests/permissions/test_permissions.py<gh_stars>1-10
from django.contrib.auth.models import User
from mock import MagicMock
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models import Instance, XForm
from onadata.apps.api.permissions import MetaDataObjectPerm... | 1.976563 | 2 |
Exercicios - Mundo3/Ex109/teste.py | BrianMath/ExerciciosPythonCeV | 0 | 34733 | import moeda
preco = float(input("Digite o preço: R$"))
por100 = float(input("Digite a porcentagem: "))
formatar = str(input("Deseja formatar como moeda [S/N]? ")).upper()
if "S" in formatar:
formatado = True
else:
formatado = False
print(f"\nA metade de {moeda.moeda(preco)} é {moeda.metade(preco, formatado)... | 3.609375 | 4 |
api/companies/urls.py | anjaekk/CRM-internship- | 1 | 34734 | from django.urls import path, include
from .views import CompanyAPIView
# urlpatterns = [
# path("",include(router.urls)),
# ] | 1.492188 | 1 |
src/waldur_auth_saml2/utils.py | geant-multicloud/MCMS-mastermind | 26 | 34735 | <filename>src/waldur_auth_saml2/utils.py<gh_stars>10-100
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from djangosaml2.conf import get_config
from djangosaml2.utils import available_idps
from saml2.attribute_converter import ac_factory
from saml2.mdstore import InMemoryMetaData... | 2.0625 | 2 |
pvcontrol/__main__.py | stephanme/pv-control | 0 | 34736 | import logging
# configure logging before initializing further modules
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s - %(message)s")
logging.getLogger("urllib3.connectionpool").setLevel(logging.INFO)
import argparse
import json
import flask
import flask_compress
from werkzeug.m... | 2.078125 | 2 |
Python/binary-trees-with-factors.py | xiaohalo/LeetCode | 9 | 34737 | # Time: O(n^2)
# Space: O(n)
# Given an array of unique integers, each integer is strictly greater than 1.
# We make a binary tree using these integers and each number may be used for
# any number of times.
# Each non-leaf node's value should be equal to the product of the values of
# it's children.
# How many binary... | 3.6875 | 4 |
jtr/load/embeddings/__init__.py | mitchelljeff/SUMMAD4.3 | 1 | 34738 | # -*- coding: utf-8 -*-
from jtr.load.embeddings.embeddings import Embeddings, load_embeddings
from jtr.load.embeddings.word_to_vec import load_word2vec, get_word2vec_vocabulary
from jtr.load.embeddings.glove import load_glove
from jtr.load.embeddings.vocabulary import Vocabulary
__all__ = [
'Embeddings',
'lo... | 1.289063 | 1 |
src/account/models.py | opnfv/laas | 2 | 34739 | ##############################################################################
# Copyright (c) 2016 <NAME> and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#... | 2.203125 | 2 |
Chapter06/Blurring_Sharpening.py | AzureCloudMonk/Raspberry-Pi-3-Cookbook-for-Python-Programmers-Third-Edition | 22 | 34740 | # Blurring and Sharpening Images
# Import Computer Vision package - cv2
import cv2
# Import Numerical Python package - numpy as np
import numpy as np
# Read the image using imread built-in function
image = cv2.imread('image_6.jpg')
# Display original image using imshow built-in function
cv2.imshow("Orig... | 4.15625 | 4 |
webapp/python/isuda.py | akawashiro/isucon6-qualify | 0 | 34741 | from flask import Flask, request, jsonify, abort, render_template, redirect, session, url_for
import MySQLdb.cursors
import hashlib
import html
import json
import math
import os
import pathlib
import random
import re
import string
import urllib
import sys
from werkzeug.contrib.profiler import ProfilerMiddleware, MergeS... | 1.828125 | 2 |
todo/apps.py | arthtyagi/gettit | 6 | 34742 | <filename>todo/apps.py<gh_stars>1-10
from django.apps import AppConfig
class TodoConfig(AppConfig):
name = 'todo'
| 1.304688 | 1 |
Segundo nivel - condicionales/4.py | OscarPalominoC/RetosPlatziProgramaci-n | 0 | 34743 | def run():
animal = str(input('¿Cuál es tu animal favorito? '))
if animal.lower() == 'tortuga' or animal.lower() == 'tortugas':
print('También me gustan las tortugas.')
else:
print('Ese animal es genial, pero prefiero las tortugas.')
if __name__ == '__main__':
run() | 3.796875 | 4 |
data-structure/registration_with_binary_tree/src/Registration.py | gvalves/unifesp | 0 | 34744 | from enum import Enum
class Registration(Enum):
ID_SERVIDOR_PORTAL = 1
NOME = 2
CPF = 3
MATRICULA = 4
DESCRICAO_CARGO = 5
CLASSE_CARGO = 6
REFERENCIA_CARGO = 7
PADRAO_CARGO = 8
NIVEL_CARGO = 9
SIGLA_FUNCAO = 10
NIVEL_FUNCAO = 11
FUNCAO = 12
CODIGO_ATIVIDADE = 13
... | 2 | 2 |
repos/system_upgrade/el7toel8/actors/checkacpid/actor.py | sm00th/leapp-repository | 21 | 34745 | from leapp.actors import Actor
from leapp.models import InstalledRedHatSignedRPM
from leapp.libraries.common.rpms import has_package
from leapp.reporting import Report, create_report
from leapp import reporting
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
class CheckAcpid(Actor):
"""
Check if acpid i... | 2.25 | 2 |
crypto_config/cryptoconfigparser.py | x-ware-ltd/CryptoConfig | 1 | 34746 | from crypto_config import (ConfigParser, ParsingError, Crypt)
import re
class CryptoConfigParser(ConfigParser):
def __init__(self, *args, **kwargs):
key = kwargs.pop('crypt_key', None)
if key != None:
self.crypt_key = key
else:
self.crypt_key = None
Config... | 2.765625 | 3 |
networks/multiclass/CNN2D/InceptionNet/multiclass_InceptionNet.py | so2liu/CNNArt | 22 | 34747 | import os.path
import scipy.io as sio
import numpy as np # for algebraic operations, matrices
import keras.models
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout # , Layer, Flatten
# from keras.layers import containers
from keras.models import model_from_json,Mode... | 1.960938 | 2 |
python/sort_list_by_multiple_keys.py | julianespinel/trainning | 0 | 34748 | class reversor:
def __init__(self, value):
self.value = value
def __eq__(self, other):
return self.value == other.value
def __lt__(self, other):
"""
Inverted it to be able to sort in descending order.
"""
return self.value >= other.value
if __name__ == '__... | 4.0625 | 4 |
labs-code/python/standard-product-track/get_followers.py | aod2004/getting-started-with-the-twitter-api-v2-for-academic-research | 282 | 34749 | from twarc import Twarc2, expansions
import json
# Replace your bearer token below
client = Twarc2(bearer_token="<PASSWORD>")
def main():
# The followers function gets followers for specified user
followers = client.followers(user="twitterdev")
for page in followers:
result = expansions.flatten(p... | 3.09375 | 3 |
machine-learning/QiWei-Python-Chinese/function/function_02.py | yw-fang/MLreadingnotes | 2 | 34750 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
__maintainer__ = "<NAME>"
__email__ = '<EMAIL>'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 25, 2018'
"""
This example shows the functionality
of positional arguments and keyword ONLY arguments.
The positional arguments correspond to... | 3.953125 | 4 |
Python/Problem#8.py | Wolfy7/DailyCodingProblem | 0 | 34751 | """
A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value.
Given the root to a binary tree, count the number of unival subtrees.
For example, the following tree has 5 unival subtrees:
0
/ \
1 0
/ \
1 0
/ \
1 1
"""
class Node... | 4.1875 | 4 |
Prefixr.py | tribhuvanesh/dyna-snip | 1 | 34752 | <filename>Prefixr.py<gh_stars>1-10
import sublime
import sublime_plugin
import urllib
import urllib2
import threading
import re
from dyna_snip_helpers import get_snippet_list, inc_snippet_object
COMMENT_MARKER_JAVA = '//'
COMMENT_MARKER_PYTHON = "#"
class PrefixrCommand(sublime_plugin.TextCommand):
def run(self,... | 2.71875 | 3 |
zeus/common/ipc/uni_comm.py | wnov/vega | 6 | 34753 | <gh_stars>1-10
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | 1.742188 | 2 |
srv/tools/import_lemuria.py | Nekohime/lemuria | 13 | 34754 | #!/usr/bin/env python3
# encoding: utf-8
"""Easily create ../app.db and import ../lemuria.json"""
import asyncio
from db_tools import init_db
from db_tools import import_world
asyncio.run(init_db())
asyncio.run(import_world('../atlemuria.txt', '../proplemuria.txt'))
| 1.296875 | 1 |
Handwritten_Numeral_Image_Classification.py | yjnanan/lab3 | 1 | 34755 | import numpy as np
import random
import matplotlib.pyplot as plt
from load_data import loadLabel,loadImage
def der_activation_function(x,type):
if type==1:
return 1 - np.power(np.tanh(x), 2)
elif type==2:
return (1/(1+np.exp(-x)))*(1-1/(1+np.exp(-x)))
else:
x[x<=0]=0.25
x[x>... | 3 | 3 |
catalog/bindings/gmd/cylindrical_cs.py | NIVANorge/s-enda-playground | 0 | 34756 | <reponame>NIVANorge/s-enda-playground<filename>catalog/bindings/gmd/cylindrical_cs.py
from dataclasses import dataclass
from bindings.gmd.cylindrical_cstype import CylindricalCstype
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class CylindricalCs(CylindricalCstype):
"""gml:CylindricalCS is a three-dim... | 2.125 | 2 |
preprocessing.py | tjiho/PoemesProfonds | 6 | 34757 | <reponame>tjiho/PoemesProfonds<filename>preprocessing.py
import pandas as pd
from collections import Counter
def import_lexique_as_df(path=r".\lexique3832.xlsx"):
"""importe le lexique
:param path: lexique3832.xlsx chemin du fichier
:return pd.dataframe
"""
df = pd.read_excel(path)
df.iloc[:... | 2.890625 | 3 |
src/mlpy-3.5.0/mlpy/dimred.py | xuanxiaoliqu/CRC4Docker | 1 | 34758 | <reponame>xuanxiaoliqu/CRC4Docker
## This code is written by <NAME>, <<EMAIL>>.
## (C) 2011 mlpy Developers.
## 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 version 3 of the Lice... | 1.53125 | 2 |
polls/views.py | Parth-Shah-99/Polling-Project | 1 | 34759 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.contrib.auth.forms import UserCreationForm
from django.contrib import messages
from django.urls import reverse
from .forms import UserSignupForm, CreatePollForm, UserUpdateForm
fro... | 2.203125 | 2 |
src/katas/alphabet_position.py | Thavarshan/python-code-katas | 14 | 34760 | import re
class AlphabetPosition:
alphabet = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9,
'j': 10,
'k': 11,
'l': 12,
'm': 13,
'n': 14,
'o': 15,
'p': 16,
... | 3.984375 | 4 |
FreeCodeCamp/Scientific Computing with Python/Python for Everybody/09.py | saulpaiva/Code | 1 | 34761 | <filename>FreeCodeCamp/Scientific Computing with Python/Python for Everybody/09.py
# Iterations: Definite Loops
'''
Use the 'for' word
there is a iteration variable like 'i' or 'friend'
'''
# for i in [5, 4, 3, 2, 1] :
# print(i)
# print('Blastoff!')
# friends = ['matheus', 'wataru', 'mogli']
# for friend in fri... | 4.1875 | 4 |
keras-version/main.py | bzantium/EA-LSTM | 16 | 34762 | from utils import (load_data, data_to_series_features,
apply_weight, is_minimum)
from algorithm import (initialize_weights, individual_to_key,
pop_to_weights, select, reconstruct_population)
from sklearn.metrics import mean_squared_error, mean_absolute_error
from tensorflow.ker... | 2.328125 | 2 |
start.py | Wrdle/BertieBotV3 | 3 | 34763 | <gh_stars>1-10
import threading
from discord.ext import commands
import discord
from website import create_app
from cogs import generalCommands, events, leaderboard
from settings import configFunctions
global client
client = commands.Bot(command_prefix=commands.when_mentioned_or(configFunctions.getCommandPrefix()), ... | 2.46875 | 2 |
flearn/common/strategy/lg.py | wnma3mz/flearn | 6 | 34764 | <filename>flearn/common/strategy/lg.py
# coding: utf-8
from .avg import AVG
class LG(AVG):
"""
Fed Think locally, act globally, https://github.com/pliang279/LG-FedAvg
References
----------
.. [1] <NAME>, <NAME>, <NAME>, et al. Think locally, act globally: Federated learning with local and global ... | 2.265625 | 2 |
kamarl/ppo.py | kandouss/kamarl | 4 | 34765 | <gh_stars>1-10
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import pickle
import warnings
from collections import defaultdict
import gym
from kamarl.modules import ConvNet, SeqLSTM, make_mlp, device_of, PixelDropout
from kamarl.buffers import RecurrentReplayMemory,... | 1.929688 | 2 |
comm/udpserver.py | mickvangelderen/bikesim | 2 | 34766 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import socketserver
from lxml import etree
class UdpHandler(socketserver.BaseRequestHandler):
def handle(self):
data = self.request[0].strip()
print("{} wrote:".format(self.client_address[0]))
print(data)
self.server.decode_... | 3.0625 | 3 |
tests/metrics/test_compute_kid.py | alexmlamb/mimicry | 1 | 34767 | import os
import shutil
import tensorflow as tf
import torch
from torch_mimicry.metrics import compute_kid
from torch_mimicry.metrics.inception_model import inception_utils
from torch_mimicry.nets.gan import gan
class ExampleGen(gan.BaseGenerator):
def __init__(self,
bottom_width=4,
... | 2.15625 | 2 |
t_system/remote_ui/modules/identity.py | sevgiun/T_System | 7 | 34768 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: identity
:platform: Unix
:synopsis: the top-level submodule of T_System's remote_ui that contains the functions for realizing identity process of T_System.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from t_system.administration import is_admin
from t_sy... | 2.625 | 3 |
kit/form_layout/formin.py | AsociTon/Dot_Bot | 0 | 34769 | class formstruct():
name = str()
while True:
name = input("\n.bot >> enter your first name:")
if not name.isalpha():
print(".bot >> your first name must have alphabets only!")
continue
else:
name = name.upper()
break
city = str()
while True:
c... | 4.1875 | 4 |
core/migrations/0004_auto_20210502_0503.py | Armestrong/resale_api | 0 | 34770 | <filename>core/migrations/0004_auto_20210502_0503.py<gh_stars>0
# Generated by Django 2.2 on 2021-05-02 08:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20210502_0459'),
]
operations = [
migrations.AlterField(
... | 1.421875 | 1 |
test/test_tile.py | MiroK/tieler | 1 | 34771 | <filename>test/test_tile.py
import unittest
from tieler.tile import powers2, TileMesh
from tieler.tile_data import mf_from_data, load_data
from dolfin import (UnitSquareMesh, MeshFunction, CompiledSubDomain,
SubsetIterator)
import numpy as np
class TestTile(unittest.TestCase):
def test_powers... | 2.484375 | 2 |
src/demo.py | wenksi/pren-robo-cube-ipcv | 0 | 34772 | <reponame>wenksi/pren-robo-cube-ipcv<gh_stars>0
import logging
import pyttsx3
from src.a_detect_pictogram import course_detect_pictogram
from src.common.communication.serial_handler import *
from src.common.movement.drive import *
from src.common.movement.direction import *
from src.common.movement.climb import *
ts ... | 2.328125 | 2 |
saleor/product/migrations/0168_fulfil_digitalcontenturl_orderline_token.py | eanknd/saleor | 1,392 | 34773 | # Generated by Django 3.2.12 on 2022-04-12 14:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("product", "0167_digitalcontenturl_order_line_token"),
("order", "0140_alter_orderline_old_id_and_created_at"),
]
operations = [
migrations.... | 1.734375 | 2 |
thtml/__main__.py | cariad/tohtml | 0 | 34774 | from argparse import ArgumentParser
from sys import stdin, stdout
from tempfile import NamedTemporaryFile
from time import sleep
from webbrowser import open as open_web
from naughtty import NaughTTY
from thtml import get_version
from thtml.cli import write_html
from thtml.options import Scope
def cli_entry() -> Non... | 2.640625 | 3 |
python3/719.find-k-th-smallest-pair-distance.214267100.ac.py | Diego-Zulu/leetcode_answers | 0 | 34775 | <filename>python3/719.find-k-th-smallest-pair-distance.214267100.ac.py
#
# @lc app=leetcode id=719 lang=python3
#
# [719] Find K-th Smallest Pair Distance
#
# https://leetcode.com/problems/find-k-th-smallest-pair-distance/description/
#
# algorithms
# Hard (30.99%)
# Likes: 827
# Dislikes: 30
# Total Accepted: 29... | 3.828125 | 4 |
openapiart/openapiartprotobuf.py | open-traffic-generator/openapiart | 3 | 34776 | import os
import jsonpath_ng
from .openapiartplugin import OpenApiArtPlugin
class OpenApiArtProtobuf(OpenApiArtPlugin):
def __init__(self, **kwargs):
super(OpenApiArtProtobuf, self).__init__(**kwargs)
self._filename = os.path.normpath(os.path.join(self._output_dir, "{}.proto".format(self._protobuf... | 2.25 | 2 |
dashboard/app.py | katabaticwind/learn-vue | 0 | 34777 | from flask import Flask, render_template, url_for
import os
app = Flask(__name__)
# Homepage
@app.route('/')
def index():
return render_template('index.html')
# Domestic Dashboards
@app.route('/domestic/')
@app.route('/domestic/<model>')
def domestic(model=None):
return render_template('domestic.html', mod... | 2.671875 | 3 |
pepdb/tasks/elastic_models.py | dchaplinsky/pep.org.ua | 7 | 34778 | <filename>pepdb/tasks/elastic_models.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from elasticsearch_dsl import Q, Keyword, Text, DocType, Date
class EDRPOU(DocType):
"""EDRPOU."""
status_order = (
"зареєстровано",
"зареєстровано, свідоцтво про державну реєстрацію недійс... | 2.375 | 2 |
paprika/restraints/plumed.py | slochower/pAPRika | 16 | 34779 | <gh_stars>10-100
import logging
import os
import numpy as np
from openff.units import unit as pint_unit
from parmed.structure import Structure as ParmedStructureClass
from paprika.build.dummy import extract_dummy_atoms
from paprika.restraints.utils import get_bias_potential_type, parse_window
from paprika.utils impor... | 2.28125 | 2 |
modules/GEM_500_COM3.py | ZeppW/ODMRGUI | 0 | 34780 | import pyvisa
import time
import numpy as np
from struct import unpack
import matplotlib.pyplot as plt
rm = pyvisa.ResourceManager()
rm.list_resources()
GEM = rm.open_resource('ASRL3::INSTR')
def Turn_on():
GEM.write('ON')
GEM.write('POWER=001')
print('Laser has initialized!!!')
def SetPower(pw_mw):
... | 2.609375 | 3 |
data_loading/sets/oxford_flowers.py | yyx1994/pytorch.repmet | 4 | 34781 | """
Oxford Flowers dataset loader
1020 samples spanning 102 classes (avg 10 per class)
http://www.robots.ox.ac.uk/~vgg/data/flowers
"""
from __future__ import print_function
import numpy as np
from PIL import Image, ImageFile
from os.path import join
import os
import scipy.io
import tarfile
import shutil
from torc... | 3.0625 | 3 |
custom_uss/vims_main.py | shuanet/dss | 2 | 34782 | #!/usr/bin/python3
import re
from custom_vims import VIMS
import json
"""
commands:
$ create_vims id port
$ create_vertiport ENAC
$ create_vertiport LFBO
$ get_vertiport vertiport_name
$ delete_vertiport vertiport_name
"""
def is_uuid(uuid):
"""
UUID encription.
"""
match = re.match('[a-fA-F0-9]{8}-[a-fA-F0-9]{... | 2.734375 | 3 |
src/softforest/routing.py | Zayn484/softForest-rest-api | 0 | 34783 | from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.urls import re_path
from chat.consumers import ChatConsumer
from teams.consumers import InvitationConsumer
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter([
... | 1.875 | 2 |
src/spaceone/inventory/manager/pricing_manager.py | jihyungSong/plugin-aws-price-info | 1 | 34784 | import json
from spaceone.inventory.libs.manager import AWSManager
from spaceone.inventory.connector.pricing import PricingConnector
from spaceone.inventory.model.pricing.cloud_service_type import CLOUD_SERVICE_TYPES
class PricingManager(AWSManager):
conn = None
def __init__(self, transaction=None, **kwargs)... | 2.171875 | 2 |
CatMap/statistics_cat/src/main/python/merge_rdf.py | QCAPI-DRIP/eVRE-ENVRI_Blocks | 1 | 34785 | <reponame>QCAPI-DRIP/eVRE-ENVRI_Blocks
#! /usr/bin/env python
from rdflib import Graph, RDF, BNode, URIRef, Namespace, ConjunctiveGraph, Literal
from pathlib import Path
import sys
import ftplib
import tempfile
import shutil
import os
import json
import urllib
import base64
import pika
import urlparse
def get_deg... | 2.203125 | 2 |
django_drf_filepond/migrations/0003_add_storedupload.py | alarivas/django-drf-filepond | 81 | 34786 | # Generated by Django 2.1.3 on 2019-02-13 13:00
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_drf_filepond', '0002_add_upload_dir'),
]
operations = [
migrations.CreateModel(
name='Stored... | 1.929688 | 2 |
portal/apps/memcached/views.py | Artis-Physis/utopia-cms | 8 | 34787 | <filename>portal/apps/memcached/views.py
# -*- coding: utf-8 -*-
from memcached_status import view
def memcached_status(request):
return view(request)
| 1.40625 | 1 |
encrypted_fields_test/migrations/0003_demomigrationmodel_add_more_fields.py | bishtamit/django-searchable-encrypted-fields | 1 | 34788 | # Generated by Django 2.1 on 2020-10-08 10:05
import datetime
from django.db import migrations
import encrypted_fields.fields
class Migration(migrations.Migration):
dependencies = [
('encrypted_fields_test', '0002_demomigrationmodel_add_test_record'),
]
operations = [
migrations.AddFiel... | 2.015625 | 2 |
home/GroG/ContinuousServo.py | rv8flyboy/pyrobotlab | 63 | 34789 | from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# create mouth arduino and servo
ear = Runtime.createAndStart("ear","Sphinx")
arduino = Runtime.createAndStart("arduino","Arduino")
arduino.connect("COM4")
servo... | 3.359375 | 3 |
dstools/tests/preprocessing/test_FeatureConverter.py | Diadochokinetic/DataScienceTools | 0 | 34790 | <filename>dstools/tests/preprocessing/test_FeatureConverter.py
import pandas as pd
import numpy as np
import unittest
from dstools.preprocessing.FeatureConverter import FeatureConverter
class TestFeatureConverter(unittest.TestCase):
"""
=======================
=== type conversion ===
=================... | 3.40625 | 3 |
MixPanel_daily_DataPipeline/bin/mixpanel_daily_datapipeline.py | ThiagoBarsante/DataEngineer_projects | 0 | 34791 | <reponame>ThiagoBarsante/DataEngineer_projects<gh_stars>0
""" This program run one complete datapipeline with raw data from mixpanel (json files API)
and generate one structured file format to be used in a Data Science project
Resume
- validate startup process
-... | 2.5625 | 3 |
imageai/dnnFaceProcessor.py | eusholli/image-pipeline | 1 | 34792 | <reponame>eusholli/image-pipeline
import traceback
import io
import numpy as np
import sys
import time
import cv2
import datetime
import jsonpickle
import argparse
import asyncio
import os
from common.imagebusutil import FrameDetails, ImagebusTopic # noqa
from common.natsclient import create, subscribe_handler # no... | 2.625 | 3 |
npbench/benchmarks/polybench/durbin/durbin_dace.py | frahlg/npbench | 27 | 34793 | import numpy as np
import dace as dc
M, N = (dc.symbol(s, dtype=dc.int64) for s in ('M', 'N'))
@dc.program
def flip(A: dc.float64[M]):
B = np.ndarray((M, ), dtype=np.float64)
for i in dc.map[0:M]:
B[i] = A[M - 1 - i]
return B
@dc.program
def kernel(r: dc.float64[N]):
y = np.empty_like(r)
... | 2.234375 | 2 |
tests/greedy/test_oblate_system.py | rodluger/starry | 116 | 34794 | import starry
import numpy as np
import matplotlib.pyplot as plt
import pytest
@pytest.mark.parametrize("ydeg,nw", [[0, None], [0, 10], [1, None], [1, 10]])
def test_system(ydeg, nw):
# Oblate map
map = starry.Map(udeg=2, ydeg=ydeg, oblate=True, nw=nw)
map[1] = 0.5
map[2] = 0.25
map.omega = 0.5
... | 2.3125 | 2 |
spammer.py | Traftmine/SPAMMER | 0 | 34795 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 15 19:41:48 2021
@author: Traftmine
"""
import time
import pyautogui
START = time.time()
time.sleep(5)
SCRIPT = open("beescript.txt", 'r')
for word in SCRIPT:
pyautogui.typewrite(word)
pyautogui.press("enter")
SCRIPT.close()
END = time.time()
pri... | 2.859375 | 3 |
src/interface.py | team-crescendo/3rd-anniversary-bot | 5 | 34796 | <reponame>team-crescendo/3rd-anniversary-bot
import asyncio
from typing import List
import discord
from discord.ext import commands
async def is_confirmed(ctx: commands.Context, message: discord.Message) -> bool:
emojis = ["⭕", "❌"]
for emoji in emojis:
await message.add_reaction(emoji)
def _che... | 2.71875 | 3 |
mine/chess_knight.py | NigrumAquila/py_checkio | 0 | 34797 | def chess_knight(start, moves):
def knight_can_move(from_pos, to_pos):
return set(map(lambda x: abs(ord(x[0]) - ord(x[1])), zip(from_pos, to_pos))) == {1, 2}
def knight_moves(pos):
return {f + r for f in 'abcdefgh' for r in '12345678' if knight_can_move(pos, f + r)}
# till ... | 3.5 | 4 |
backend/home/migrations/0003_auto_20220225_1628.py | crowdbotics-apps/myclub-33848 | 0 | 34798 | # Generated by Django 2.2.26 on 2022-02-25 16:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("home", "0002_listecategorie_utilisateurs"),
]
operations = [
migrations.CreateModel(
name="Listerole",
fields=[
... | 1.59375 | 2 |
GoogleColab/InteligenciaAnalitica/Ex5/downloadbase.py | AlexandroLuis/ComputerScience | 2 | 34799 | <gh_stars>1-10
# https://www.kaggle.com/datatattle/covid-19-nlp-text-classification
!gdown --id 1Hd0ytKZrR3s22FheUJt4EZOpZ4eWyTrN
!unzip tweets_corona_virus.zip
| 1.1875 | 1 |