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 |
|---|---|---|---|---|---|---|
libs/python_scripts/MetaPathways_MLTreeMap_hits.py | ariahahn/MetaPathways_Python.3.0 | 0 | 12784751 | #!/usr/bin/python
# File created on 27 Jan 2012.
from __future__ import division
__author__ = "<NAME>"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "<NAME>"
__status__ = "Release"
try:
import os
import re
from os import makedirs, sys, remove, l... | 2.453125 | 2 |
common/tests/test_configuration.py | vaginessa/irma | 0 | 12784752 | #
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... | 2.046875 | 2 |
a.py | JuYeong98/st-gcn | 2 | 12784753 | <filename>a.py
import os
print("before: %s"%os.getcwd())
os.chdir("/work_dir")
print("after: %s"%os.getcwd()) | 2.65625 | 3 |
torchopt/optim/constraint.py | r-papso/torch-accelerator | 0 | 12784754 | <reponame>r-papso/torch-accelerator
from abc import ABC, abstractmethod
from typing import Any
from torch import nn
from ..prune.pruner import Pruner
from .cache import Cache
class Constraint(ABC):
"""Abstract class representing a constraint in optimization problems."""
def __init__(self) -> None:
... | 3.078125 | 3 |
py-scripts/scripts_deprecated/lf_check_jbr.py | alexman69420/lanforge-scripts | 11 | 12784755 | #!/usr/bin/python3
'''
NAME:
lf_check.py
PURPOSE:
lf_check.py will run a series of tests based on the test TEST_DICTIONARY listed in lf_check_config.ini.
The lf_check_config.ini file is copied from lf_check_config_template.ini and local configuration is made
to the lf_check_config.ini.
EXAMPLE:
lf_check.py
NOTES:
B... | 2.390625 | 2 |
python/867.transpose-matrix.py | fengbaoheng/leetcode | 1 | 12784756 | #
# @lc app=leetcode.cn id=867 lang=python3
#
# [867] 转置矩阵
#
from typing import List
class Solution:
def transpose(self, A: List[List[int]]) -> List[List[int]]:
if A is None:
return []
rows = len(A)
if rows == 0:
return []
cols = len(A[0])
if cols ... | 3.484375 | 3 |
CS6900/Assignment05/tdbptay.py | aashishyadavally/MS_AI_Coursework | 0 | 12784757 | """
Name: <NAME>
"""
import heapq
g4 = [('S',['a','S','S']),
('S',[])]
def tdpstep(g, input_categories_parses): # compute all possible next steps from (ws,cs)
global n_steps
(ws,cs,p) = input_categories_parses
if len(cs)>0:
cs1=cs[1:] # copy of predicted categories except cs[0]
p1... | 2.8125 | 3 |
functions.py | justinhohner/python_basics | 0 | 12784758 | #!/usr/local/bin/python3
# https://www.tutorialsteacher.com/python/python-user-defined-function
"""
functions are an abstraction that make code easier to read and follow.
breakg up code into discrete pieces of logic or functionality that are reusable
"""
"""
def function_name(parameters):
"function docstring... | 4.375 | 4 |
src/djangoreactredux/djrenv/lib/python3.5/site-packages/disposable_email_checker/fields.py | m2jobe/c_x | 46 | 12784759 | <reponame>m2jobe/c_x<gh_stars>10-100
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core import validators
from .validators import validate_disposable_email
from .forms import DisposableEmailField as DisposableEmailFormField
class DisposableE... | 2.078125 | 2 |
test_tree_creator.py | mmokko/aoc2017 | 0 | 12784760 | from unittest import TestCase
from day7 import TreeCreator
INPUT = '''pbga (66)
xhth (57)
ebii (61)
havc (66)
ktlj (57)
fwft (72) -> ktlj, cntj, xhth
qoyq (66)
padx (45) -> pbga, havc, qoyq
tknk (41) -> ugml, padx, fwft
jptl (61)
ugml (68) -> gyxo, ebii, jptl
gyxo (61)
cntj (57)'''
class TestTreeCreator(TestCase):
... | 3.34375 | 3 |
rainbow_walker.py | 343max/led_lamp | 0 | 12784761 | <gh_stars>0
from process_pixel import process_pixel
from rpi_ws281x import Color
import asyncio
from helpers import hls_to_color
async def rainbow_walker(strip, wait_ms=10):
hue = 0
num_pixels = strip.numPixels()
badge_width = 60
while True:
for r in [
range(num_pixels - badge_width),
range(num... | 2.859375 | 3 |
witness/test_widgets2.py | robdelacruz/boneyard | 0 | 12784762 | import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Pango, Gdk, GLib
import datetime
import ui
import conv
def icon_image(icon_name):
theme = Gtk.IconTheme.get_default()
icon = theme.load_icon(icon_name, -1, Gtk.IconLookupFlags.FORCE_SIZE)
img = Gtk.Image.new_from_pixbuf(icon)
re... | 2.6875 | 3 |
modern_logic_client/models/customer.py | latourette359/modern_logic_client | 0 | 12784763 | # coding: utf-8
"""
Modern Logic Api
Manage and version your customer decision logic outside of your codebase # noqa: E501
OpenAPI spec version: 1.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class C... | 1.476563 | 1 |
scripts/preprocess.py | uiucsn/phast | 0 | 12784764 | <reponame>uiucsn/phast<filename>scripts/preprocess.py
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import glob
import extinction
from astropy.cosmology import Planck13 as cosmo
#The limiting magnitude of your survey
MAG_LIM = 33.0
ZPT = 30.0
wvs = np.asarray([3600, 4760,... | 2.40625 | 2 |
connect/cli/plugins/project/validators.py | cloudblue/product-sync | 12 | 12784765 | from interrogatio.core.exceptions import ValidationError
from interrogatio.validators import Validator
class PythonIdentifierValidator(Validator):
def validate(self, value, context=None):
if not value:
return
if not value.isidentifier():
raise ValidationError('Introduced d... | 2.765625 | 3 |
ontask/action/payloads.py | LucasFranciscoCorreia/ontask_b | 0 | 12784766 | # -*- coding: utf-8 -*-
"""Classes capturing the payloads used when running actions."""
import collections
from typing import Dict, Mapping, Optional
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.contrib.sessions.models import Session
action_session_dicti... | 2.25 | 2 |
examples/basic_observer.py | ddunmire/python-bleson | 103 | 12784767 | <reponame>ddunmire/python-bleson
#!/usr/bin/env python3
import sys
from time import sleep
from bleson import get_provider, Observer
# Get the wait time from the first script argument or default it to 10 seconds
WAIT_TIME = int(sys.argv[1]) if len(sys.argv)>1 else 10
def on_advertisement(advertisement):
print(ad... | 2.671875 | 3 |
_python/python_stack/_python/assignments/forloop_basic_1.py | fatimaalheeh/python_stack | 0 | 12784768 | <filename>_python/python_stack/_python/assignments/forloop_basic_1.py
#1.
for onehundredfifty in range(151):
print(onehundredfifty)
#2.
for thousandFives in range(5,1001,5):
print(thousandFives)
#3.
for hundred in range(1,101):
if hundred%5==0:
print("Coding")
elif hundred%5!=0:
print("C... | 3.96875 | 4 |
dogen/plugins/dist_git.py | jboss-dockerfiles/dogen | 14 | 12784769 | import os
import re
import subprocess
from dogen.tools import Tools, Chdir
from dogen.plugin import Plugin
class DistGitPlugin(Plugin):
@staticmethod
def info():
return "dist-git", "Support for dist-git repositories"
@staticmethod
def inject_args(parser):
parser.add_argument('--dist-g... | 2.1875 | 2 |
cpc/entity/Entity.py | U-Ar/Cpresto | 1 | 12784770 | from abc import ABCMeta,abstractmethod
from abst.Dumpable import Dumpable
class Entity(Dumpable):
def __init__(self,priv,t,name):
self._name = name
self._is_private = priv
self._type_node = t
self.n_refered = 0
self._memref = None
self._address = None
def na... | 3.1875 | 3 |
usaspending_api/download/tests/unit/test_zip_file.py | g4brielvs/usaspending-api | 217 | 12784771 | <filename>usaspending_api/download/tests/unit/test_zip_file.py
import os
import zipfile
from tempfile import NamedTemporaryFile
from usaspending_api.download.filestreaming.zip_file import append_files_to_zip_file
def test_append_files_to_zip_file():
with NamedTemporaryFile() as zip_file:
with NamedTempor... | 3.09375 | 3 |
data_model.py | SinaKhorami/Titanic-Survival-Prediction | 0 | 12784772 | <reponame>SinaKhorami/Titanic-Survival-Prediction
#author: <NAME>
#date: Tue 29 Nov 2016
import numpy as np
import pandas as pd
class Data():
"""docstring for Data"""
def __init__(self):
self.train_df = pd.read_csv('data/train.csv', header = 0)
self.test_df = pd.read_csv('data/test.csv', header = 0)
def getCl... | 3.234375 | 3 |
100DaysOfDays/Dia01/ex04.py | giselemanuel/programming-challenges | 0 | 12784773 | """
Dissecando uma variável:
Faça um programa que leia algo pelo teclado e mostre na tela o
seu tipo primitivo e todas as informações possíveis sobre ele.
"""
print("-------- DISSECANDO UMA VARIÁVEL --------")
entrada = input("Digite algo: ")
print("O tipo primitivo deste valor é: ", type(entrada))
print("Só tem espaç... | 4.40625 | 4 |
migration_test.py | MathiasSeguy-Android2EE/MigrationProjetsA2ee | 2 | 12784774 | from sys import path, stdout
path.insert(0, './git_management')
path.insert(0, './gradle_management')
from git_management import git_init
from gradle_management import migrateFromEclipseToAS
from os import path
from os import scandir
from os import remove
import migration
import errno, os, stat, shutil
import subproces... | 2 | 2 |
main.py | dz-s/dejavu | 0 | 12784775 | from pydub import AudioSegment
import parselmouth
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def draw_pitch(pitch):
# Extract selected pitch contour, and
# replace unvoiced samples by NaN to not plot
pitch_values = pitch.selected_array['frequency']
pitch_values[pitch_va... | 3.171875 | 3 |
model/engine/inference.py | giorgiovaccarino/CSSR | 0 | 12784776 | <reponame>giorgiovaccarino/CSSR
import os
from tqdm import tqdm
import torch
import torchvision.transforms as transforms
import numpy as np
import pandas as pd
import wandb
from model.utils.estimate_metrics import PSNR, SSIM, IoU
def inference_for_ss(args, cfg, model, test_loader):
"""
aiu_scoures : test_ca... | 2.15625 | 2 |
busca_em_largura.py | abiassantana/busca-em-largura | 1 | 12784777 | graph = {'joao pessoa':['itabaiana', 'campina grande', 'santa rita'],
'itabaiana': ['joao pessoa','campina grande'],
'campina grande': ['joao pessoa','itabaiana','areia','coxixola', 'soledade'],
'santa rita': ['joao pessoa','mamanguape'],
'mamanguape': ['santa rita','guarabira'],
... | 3.171875 | 3 |
setup.py | ADACS-Australia/PyFHD | 2 | 12784778 | from setuptools import setup
setup(
name = "PyFHD",
version = 1.0,
author = "ADACS - Astronomy Data and Computing Services",
url = "https://github.com/ADACS-Australia/PyFHD",
python_requires=">=3.7",
packages = ['PyFHD'],
description = 'Python Fast Holograhic Deconvolution: A Python package... | 1.226563 | 1 |
setup.py | flatironinstitute/reactopy | 7 | 12784779 | import setuptools
import os
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'reactopya', 'VERSION')) as version_file:
version = version_file.read().strip()
setuptools.setup(
name="reactopya",
version=version,
author="<NAME>",
author_email="<EMAIL>",
description="",
pack... | 1.40625 | 1 |
initialization_routines/initialize_hcp.py | kolbt/whingdingdilly | 4 | 12784780 | import sys
sys.path.append('/Users/kolbt/Desktop/compiled/hoomd-blue/build')
import hoomd
from hoomd import md
from hoomd import dem
from hoomd import deprecated
import numpy as np
# Simulation box mesh into grid delimit by particle diameter
# list of mesh indices random number generator to select index
# remove index... | 2.328125 | 2 |
tests/client/test_tracer.py | bernhardkaindl/pjrpc | 0 | 12784781 | <gh_stars>0
import json
from xjsonrpc.common import BatchRequest, BatchResponse, Request, Response
from xjsonrpc import client
import pytest
@pytest.mark.parametrize(
'req, resp, exc', [
(
Request(id=1, method='method', params=[1, '2']),
Response(id=1, result='result'),
... | 2.140625 | 2 |
access_audit/middleware.py | cforlando/intake | 51 | 12784782 | from intake.middleware import MiddlewareBase
from easyaudit.middleware.easyaudit import clear_request
class ClearRequestMiddleware(MiddlewareBase):
def process_response(self, response):
clear_request()
| 1.6875 | 2 |
object_segmentation.py | lyclyc52/nerf_with_slot_attention | 1 | 12784783 | from object_segmentation_helper import *
os.environ['CUDA_VISIBLE_DEVICES'] = '2,3'
base_dir = '/data/yliugu/ONeRF/results/testing_clevrtex_animal2'
datadir = '/data/yliugu/ONeRF/data/nerf_synthetic/clevrtex_animal2'
input_size = 400
images, poses, depth_maps, render_poses, hwf, i_split = load_data(
da... | 1.96875 | 2 |
archive/nexus-api-v2/Database/Utilities/Discord/Enumerations/Channel.py | cloud-hybrid/delta | 0 | 12784784 | """
...
"""
from . import *
class Type(Integer, Enumeration):
"""
...
"""
TEXT = 0x0
PRIVATE = 0x1
VOICE = 0x2
GROUP = 0x3
CATEGORTY = 0x4
NEWS = 0x5
STORE = 0x6
def __str__(self):
""" String Representation of Enumeration """
return self.name
__all__ = [... | 2.953125 | 3 |
LSTM.py | niyazed/violence-video-classification | 9 | 12784785 | <filename>LSTM.py
import numpy as np
import os
import cv2
import keras
import sklearn
import pandas
from time import time
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.utils import to_categorical
from keras.models import load_model
from keras.layers impor... | 2.90625 | 3 |
sensores/server/application.py | luyisimiger/proyecto_sensores | 0 | 12784786 | """server docstring"""
import json
import random
import time
from datetime import datetime
from flask import Flask, Response, render_template, redirect, url_for
from flask_mongoengine import MongoEngine
from sensores.db.models import Sensor, Medition
from sensores.db import util
from .businesslogic import get_sensors... | 2.203125 | 2 |
tknb/queue_message.py | TimonLukas/tknb | 0 | 12784787 | from enum import Enum
from typing import Tuple, Any
class MessageType(Enum):
METHOD_CALL = 0
CUSTOM_EVENT = 1
QueueMessage = Tuple[MessageType, str, Any]
| 2.90625 | 3 |
Montecarlo_.py | boodahDEV/Python_shoes | 0 | 12784788 | import matplotlib.pyplot as plt
plt.rcParams['toolbar'] = 'None'
import numpy as np # importando numpy
def genera_montecarlo(N=100000):
plt.figure(figsize=(6,6))
x, y = np.random.uniform(-1, 1, size=(2, N))
interior = (x**2 + y**2) <= 1
pi = interior.sum() * 4 / N
error = abs((pi - np.pi) / ... | 2.9375 | 3 |
alien.py | cmotek/python_crashcourse | 0 | 12784789 | <reponame>cmotek/python_crashcourse
alien_0 = {'x_position': 0, 'y_position': 25, 'speed': 'medium'}
print(f"Original position: {alien_0['x_position']}")
if alien_0['speed'] == 'slow':
x_increment = 1
elif alien_0['speed'] == 'medium':
x_increment = 2
else:
x_increment = 3
alien_0['x_position'] = alien_0['x_po... | 2.921875 | 3 |
notebooks/utils.py | yangarbiter/wilds | 0 | 12784790 | import sys
sys.path.append("../")
sys.path.append("../examples/")
import argparse
from configs import supported
from configs.utils import populate_defaults
import wilds
# Taken from https://sumit-ghosh.com/articles/parsing-dictionary-key-value-pairs-kwargs-argparse-python/
class ParseKwargs(argparse.Action):
def... | 2.609375 | 3 |
e2e_testing/torchscript/elementwise_comparison.py | pashu123/torch-mlir | 0 | 12784791 | <filename>e2e_testing/torchscript/elementwise_comparison.py
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
impo... | 1.96875 | 2 |
gokart/utils.py | ujiuji1259/gokart | 0 | 12784792 | <reponame>ujiuji1259/gokart<gh_stars>0
import os
import luigi
def add_config(file_path: str):
_, ext = os.path.splitext(file_path)
luigi.configuration.core.parser = ext
assert luigi.configuration.add_config_path(file_path)
| 2.109375 | 2 |
layers.py | pearsonlab/tf_gbds | 0 | 12784793 | """
The MIT License (MIT)
Copyright (c) 2017 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 1.898438 | 2 |
vendor/mo_math/stats.py | klahnakoski/auth0-api | 0 | 12784794 | # encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: <NAME> (<EMAIL>)
#
from __future__ import absolute_import, division, unicode_literals
... | 1.984375 | 2 |
et_micc2/static_vars.py | etijskens/et-micc2 | 0 | 12784795 | # -*- coding: utf-8 -*-
"""
Module et_micc2.static_vars
===========================
A decorator for adding static variables to a function.
see https://stackoverflow.com/questions/279561/what-is-the-python-equivalent-of-static-variables-inside-a-function
"""
def static_vars(**kwargs):
"""Add static variables to a m... | 3.609375 | 4 |
django_project/polls/models.py | Jeffhabs/cs2450 | 0 | 12784796 | <filename>django_project/polls/models.py
import uuid
from django.db import models
from django.contrib.auth.models import User
class Question(models.Model):
user = models.ForeignKey(User)
question_text = models.CharField(max_length=128)
pub_date = models.DateTimeField(auto_now_add=True)
private = model... | 2.5 | 2 |
src/music_crawler.py | AlexanderTankov/Music-player | 0 | 12784797 | <gh_stars>0
from mutagen.mp3 import MP3
import pygame
from song import Song
from playlist import Playlist
import os
NUM = 0
PATH_TO_MUSIC_LIB = "/home/alexandar/Documents/Programming-101/Week2/Music Library"
class MusicCrawler():
def __init__(self, path):
self.path = path
def generate_playlist(self... | 3.078125 | 3 |
data/datasplit.py | hktxt/CBI | 1 | 12784798 | # organize data, read wav to get duration and split train/test
# to a csv file
# author: Max, 2020.08.05
import os
import librosa
from tqdm import tqdm
import pandas as pd
from sklearn.model_selection import StratifiedKFold
def main(root_pth):
if not os.path.exists('df.csv'):
data = []
folds = os... | 2.984375 | 3 |
pictures/models.py | Waithera-m/collage_life | 0 | 12784799 | from django.db import models
# Create your models here.
class Location(models.Model):
"""
class facilitates the creation of location objects
"""
location_name = models.CharField(max_length=70)
def __str__(self):
return self.location_name
def save_location(self):
"""
me... | 2.84375 | 3 |
pybot/whatsapp/feature/WelcomePageFeature.py | iren86/whatsapp-pybot | 4 | 12784800 | <reponame>iren86/whatsapp-pybot<filename>pybot/whatsapp/feature/WelcomePageFeature.py
# -*- coding: utf-8 -*-
from functools import partial
from selenium.webdriver.common.by import By
from pybot.whatsapp.feature.BaseFeature import BaseFeature
from pybot.whatsapp.util import WaitUtil
WAIT_FOR_QR_CODE_TIMEOUT_IN_SEC =... | 2.828125 | 3 |
excel_text/__init__.py | AutoActuary/excel-text | 0 | 12784801 | from excel_text.factory import get_text_function
text = get_text_function({"decimal": ".", "thousands": ",", "raise": True})
| 2.03125 | 2 |
lib/python/mastermind/algorithms/simple.py | JBierenbroodspot/mastermind | 1 | 12784802 | <gh_stars>1-10
# ----------------------------------------------------------------------------------------------------------------------
# SPDX-License-Identifier: BSD 3-Clause -
# Copyright (c) 2022 <NAME>. ... | 3.78125 | 4 |
iceworm/tests/plugins/env.py | wrmsr0/iceworm | 0 | 12784803 | import os
import typing as ta
from omnibus import lang
from ._registry import register
@lang.cached_nullary
def _load_dot_env() -> ta.Optional[ta.Mapping[str, str]]:
fp = os.path.join(os.path.dirname(os.path.dirname(__file__)), '../../.env')
if not os.path.isfile(fp):
return None
with open(fp, '... | 1.976563 | 2 |
client_linux/helpers/aesthetics.py | carlosgprado/BrundleFuzz | 90 | 12784804 | ##################################################################
# Aesthetics.py
# It is not only pretty but legible too
##################################################################
try:
import colorama
from colorama import Fore, Back, Style
COLORAMA = True
except ImportError:
print "[!] COLOR... | 2.71875 | 3 |
holidata/holidays/sv-SE.py | vice/holidata | 0 | 12784805 | # coding=utf-8
from dateutil.easter import EASTER_WESTERN
from holidata.utils import SmartDayArrow
from .holidays import Locale, Holiday
"""
source: https://www.riksdagen.se/sv/dokument-lagar/dokument/svensk-forfattningssamling/lag-1989253-om-allmanna-helgdagar_sfs-1989-253
source: https://www.riksdagen.se/sv/dokumen... | 2.8125 | 3 |
barry/samplers/__init__.py | AaronGlanville/Barry | 13 | 12784806 | from barry.samplers.dynesty_sampler import DynestySampler
from barry.samplers.ensemble import EnsembleSampler
from barry.samplers.metropolisHastings import MetropolisHastings
__all__ = ["EnsembleSampler", "DynestySampler", "MetropolisHastings"]
| 1.0625 | 1 |
twitter_streaming_collecter.py | jeanmidevacc/french-presidential-election-2022-data-collecter | 1 | 12784807 | import json
from datetime import datetime
import pandas as pd
import argparse
import boto3
import os
import itertools
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from urllib3.exceptions import ProtocolError
class StdOutListener(StreamListener):
def __in... | 2.9375 | 3 |
M01_Robocar/04. Environment Sensing/exercises/ultrasonic.py | acrobotic/EduKit | 3 | 12784808 | """
09/01/2015
Author: Makerbro
Platforms: Raspberry Pi (Raspbian)
Language: Python
File: ultrasonic.py
------------------------------------------------------------------------
Description:
Define a simple class for using an HC-SR04 ultrasonic distance sensor.
----------------------------------------... | 3.390625 | 3 |
nxsdk_modules_ncl/csp/tests/__init__.py | event-driven-robotics/models | 54 | 12784809 | <reponame>event-driven-robotics/models
###############################################################
# INTEL CORPORATION CONFIDENTIAL AND PROPRIETARY
#
# Copyright © 2018-2021 Intel Corporation.
# This software and the related documents are Intel copyrighted
# materials, and your use of them is governed by the... | 0.988281 | 1 |
aulas_secao_16_atributos.py | Romuloro/Curso_udemy_geek_academy_python | 0 | 12784810 | <reponame>Romuloro/Curso_udemy_geek_academy_python<filename>aulas_secao_16_atributos.py
"""
Atributos -
Em python, dividimos os tributos em 3 grupos:
- De instância
- De classe
- Dinâmicos
Atributos de instância: São atribuitos declarados dentro do método construtor.
Obs.: Método construtor: È um método ... | 4.15625 | 4 |
app.py | RuFalcon/password_generator | 0 | 12784811 | <reponame>RuFalcon/password_generator
from PyQt5.QtWidgets import (
QWidget,
QSlider,
QLabel,
QApplication,
QMainWindow,
QCheckBox,
QLineEdit)
from PyQt5 import uic
from PyQt5.QtGui import QIcon
import sys
import random
import string
class Window(QMainWindow):
def __init__(self):
... | 2.890625 | 3 |
tests/strategies.py | Padawan00123/pipsqueak3 | 0 | 12784812 | import typing
import hypothesis
from hypothesis import strategies
from src.packages.rescue import Rescue as _Rescue
from src.packages.rat import Rat as _Rat
from src.packages.utils import sanitize, Platforms as _Platforms
import string
# Anything that isn't a whitespace other than the space character, and isn't a con... | 2.78125 | 3 |
cloudrunner_server/db/versions/2ba9ac1cbd43_added_unique_for_name_in_tiers.py | ttrifonov/cloudrunner-server | 2 | 12784813 | """Added unique for name in Tiers
Revision ID: <KEY>
Revises: 330568e8928c
Create Date: 2015-02-06 12:05:09.151253
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '330568e8928c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic... | 0.925781 | 1 |
kgx/rdf_transformer.py | RTXteam/kgx | 0 | 12784814 | from collections import defaultdict
from typing import Union, Set, List
import click
import logging
import networkx as nx
import os
import rdflib
import uuid
from prefixcommons.curie_util import read_remote_jsonld_context
from rdflib import Namespace, URIRef
from rdflib.namespace import RDF, RDFS, OWL
from kgx.prefix... | 2.25 | 2 |
final_project/machinetranslation/translator.py | moosaei/xzceb-flask_eng_fr | 0 | 12784815 | <filename>final_project/machinetranslation/translator.py<gh_stars>0
"Taranslator using IBM watson"
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
auth... | 2.71875 | 3 |
blatann/nrf/nrf_driver_types.py | teeheee/blatann | 40 | 12784816 | #
# Copyright (c) 2016 Nordic Semiconductor ASA
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of con... | 1.328125 | 1 |
scraper.py | aday913/web-scraper | 0 | 12784817 | <gh_stars>0
from requests_html import HTMLSession
from bs4 import BeautifulSoup
from mailer import Emailer
class Scraper(object):
'''
Main web scraping object. Takes in a URL and requested data point such as
price or title of the object and returns a string of that data.
'''
def __init__(self):
... | 3.390625 | 3 |
src/api/spreadsheet.py | Dr4kk0nnys/django-schedule-api | 2 | 12784818 | """
This whole file is dedicated to the creation of spreadsheets. It's existence is for marketing related
stuff. It does involve programming, but it's more related to marketing.
Note: This code is not accessible through normal runtime
"""
from datetime import date, timedelta
from .models import User
def get_user(t... | 3.09375 | 3 |
src/assign1.py | jude-arokiam-uoit/csci-4610-assignment-1 | 0 | 12784819 | <filename>src/assign1.py
from Tkinter import *
import struct
import xml.etree.ElementTree as ET
from Queue import *
import math
import logging
# bounds of the window, in lat/long
LEFTLON = -78.9697000
RIGHTLON = -78.9148000
TOPLAT = 43.9187000
BOTLAT = 43.8843000
WIDTH = RIGHTLON-LEFTLON
HEIGHT = TOPLAT-BOTLAT
# ratio... | 3.171875 | 3 |
pose_integrated_gradient.py | QY-H00/hand_pose | 0 | 12784820 | <gh_stars>0
import argparse
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '4,5,6,7'
import numpy as np
import torch
import time
import cv2
import pickle
from pathlib import Path
from kornia.geometry.dsnt import spatial_softmax_2d, spatial_softargmax_2d
from IG.SaliencyModel.BackProp import attribution_objective
from I... | 1.867188 | 2 |
src/app.py | nthienan/watcher | 0 | 12784821 | <filename>src/app.py
import logging
import logging.handlers
import os
import time
import pyinotify
import functools
from subprocess import Popen, PIPE
def init_logger(cfg):
logger = logging.getLogger()
logger.setLevel(cfg.log_level)
formatter = logging.Formatter('%(asctime)s %(levelname)s - %(... | 2.421875 | 2 |
src/Schema/src/schema.py | OakInn/protoargs | 7 | 12784822 | import sys
import schema_pa
class ArgsParser:
def parse(self, argv):
self.config = schema_pa.parse("schema",
"Test schema", argv)
if __name__ == "__main__":
parser = ArgsParser()
parser.parse(sys.argv[1:])
print(parser.config)
| 2.703125 | 3 |
src/493. Reverse Pairs.py | rajshrivastava/LeetCode | 1 | 12784823 | class Solution:
def reversePairs(self, nums: List[int]) -> int:
def merge(left, mid, right):
p1, p2 = left, mid+1
while p1 <= mid and p2 <=right:
if nums[p1] > nums[p2]*2:
self.count += mid-p1+1
p2+=1
else:
... | 3.453125 | 3 |
machinelearning-benchmark/dl/mixture-of-experts/ConvolutionalMoE.py | YyongXin/tf-mets | 0 | 12784824 | <reponame>YyongXin/tf-mets<filename>machinelearning-benchmark/dl/mixture-of-experts/ConvolutionalMoE.py
# -*- coding: utf-8 -*-
"""Convolutional MoE layers. The code here is based on the implementation of the standard convolutional layers in Keras.
"""
import numpy as np
import tensorflow as tf
from tensorflow.keras im... | 2.265625 | 2 |
c.ppy.sh/databaseHelper.py | Kreyren/ripple | 53 | 12784825 | <gh_stars>10-100
import pymysql
import bcolors
import consoleHelper
import threading
class db:
"""A MySQL database connection"""
connection = None
disconnected = False
pingTime = 600
def __init__(self, __host, __username, __password, __database, __pingTime = 600):
"""
Connect to MySQL database
__host -- ... | 2.953125 | 3 |
tests/cases/stats/tests/__init__.py | murphyke/avocado | 0 | 12784826 | from .agg import *
from .kmeans import *
| 1.039063 | 1 |
Professor_Dados/Core/views.py | Francisco-Carlos/Site-Professor | 1 | 12784827 | from django.shortcuts import render, redirect, get_object_or_404
from .models import Conteudos
from django.contrib.auth.models import User,auth
from pytube import YouTube
# Create your views here.
def Index(request):
arquivo = Conteudos.objects.all()
dados = {'arquivo':arquivo}
return render(request,'inde... | 2.390625 | 2 |
indra/indra.py | Madjura/text-entailment | 0 | 12784828 | <filename>indra/indra.py
import time
import requests
import json
from requests import HTTPError
from urllib3.exceptions import MaxRetryError, NewConnectionError
"""
pairs = [
{'t1': 'house', 't2': 'beer'},
{'t1': 'car', 't2': 'engine'}]
data = {'corpus': 'googlenews',
'model': 'W2V',
'langua... | 2.53125 | 3 |
lib/SurfacingAlgorithms/huji-rich-Elad3DFast/visualisation/two_dimensional/python/hdf5_voronoi_plot.py | GalaxyHunters/Vivid | 0 | 12784829 | <gh_stars>0
import h5py
import pylab
import numpy
import matplotlib
import sys
import argparse
parser = argparse.ArgumentParser(description='Displays snapshot of the hydrodynamic simualation')
parser.add_argument("file_name",
help="path to snapshot file")
parser.add_argument("field",
... | 2.09375 | 2 |
src/workers/dialer.py | Macsnow14/Thrive-voice | 0 | 12784830 | <reponame>Macsnow14/Thrive-voice
# -*- coding: utf-8 -*-
# @Author: Macsnow
# @Date: 2017-05-15 15:14:46
# @Last Modified by: Macsnow
# @Last Modified time: 2017-05-19 16:17:19
import socket
from src.workers.base_worker import BaseWorker
class Dialer(BaseWorker):
def __init__(self, service, mainbo... | 2.234375 | 2 |
tests/weight_converter/keras/test_tensorflow.py | bioimage-io/python-core | 2 | 12784831 | <filename>tests/weight_converter/keras/test_tensorflow.py
import zipfile
def test_tensorflow_converter(any_keras_model, tmp_path):
from bioimageio.core.weight_converter.keras import convert_weights_to_tensorflow_saved_model_bundle
out_path = tmp_path / "weights"
ret_val = convert_weights_to_tensorflow_sa... | 2.453125 | 2 |
backend/tools/srt2ass.py | eritpchy/video-subtitle-extractor | 2 | 12784832 | <reponame>eritpchy/video-subtitle-extractor
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import re
import time
import sys
import os
import pysrt
codings = ["utf-8", "utf-16", "utf-32", "gbk", "gb2312", "gb18030", "big5", "cp1252"]
def readings(filename='', content='', encoding=''):
"""
获取文件内容
filename... | 2.6875 | 3 |
kerbmon.py | Retrospected/kerbmon | 38 | 12784833 | <reponame>Retrospected/kerbmon
#!/usr/bin/env python
#
# Author:
# @__Retrospect
# https://github.com/Retrospected/kerbmon/
import argparse
import sys
import os
import logging
import sqlite3
import datetime
import random
from binascii import hexlify, unhexlify
import subprocess
from pyasn1.codec.der import decoder,... | 1.851563 | 2 |
skssl/predefined/mlp.py | YannDubs/Semi-Supervised-Neural-Processes | 5 | 12784834 | import warnings
import torch.nn as nn
from skssl.utils.initialization import linear_init
from skssl.utils.torchextend import identity
__all__ = ["MLP", "get_uninitialized_mlp"]
def get_uninitialized_mlp(**kwargs):
return lambda *args, **kargs2: MLP(*args, **kwargs, **kargs2)
class MLP(nn.Module):
"""Gene... | 2.640625 | 3 |
corona.py | yarinl3/Corona-Update | 2 | 12784835 | <gh_stars>1-10
import json
import requests
import tkinter as Tk
from tkinter import messagebox
from tkinter import simpledialog
from difflib import SequenceMatcher
import os
def similar(a, b):
return SequenceMatcher(None, a, b).ratio()
def main():
while True:
try:
try:
ap... | 3.203125 | 3 |
cogs/preferences.py | MiningMark48/Tidal-Bot | 6 | 12784836 | from discord.ext import commands
from util.data.user_data import UserData
from util.decorators import delete_original
class Preferences(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="botdms", aliases=["botdm"])
@commands.cooldown(1, 2, commands.BucketType.user)
... | 2.390625 | 2 |
easy/swap_case.py | Amin-Abouee/code_eval | 0 | 12784837 | import sys
with open(sys.argv[1],'r') as test_cases:
for test in test_cases:
res = ''
for s in test:
if s.islower():
res += str(s.upper())
elif s.isupper():
res += str(s.lower())
else:
res += str(s)
print res, | 3.59375 | 4 |
HumanRace/calc.py | InamdarAbid/PythonTutorial | 1 | 12784838 | <gh_stars>1-10
def human_age(age):
if age < 18:
return "Human is child"
elif age < 60:
return "Human is adult"
else:
return "Human is old."
def area(side):
are = side ** 2
return f'Area of square is {are}' | 3.625 | 4 |
run.py | fkinyae/passwordLocker | 0 | 12784839 | <gh_stars>0
#!/usr/bin/env python3.9
from credential import Credential
from user import User
def create_new_user(username, password):
'''
Function that creates a user
'''
new_user = User(username, password)
return new_user
def save_user(user):
'''
function to save user
'''
user.sav... | 4.28125 | 4 |
plots.py | martinaviggiano/textsent_project | 0 | 12784840 | import plotly.graph_objects as go
from plotly.subplots import make_subplots
def plot_freq_labels(data, template="plotly"):
X = ["Non Hate Speech", "Hate Speech"]
Y = data["label"].value_counts().values
fig = go.Figure()
fig.add_trace(
go.Bar(
x=X,
y=Y,
tex... | 2.828125 | 3 |
src/Bubot/OcfResource/OcfResource.py | businka/bubot_Core | 0 | 12784841 | from Bubot.Helpers.ExtException import ExtException, KeyNotFound
from Bubot_CoAP.resources.resource import Resource
class OcfResource(Resource):
def __init__(self, name, coap_server=None, visible=True, observable=True, allow_children=True):
super().__init__(name, coap_server=None, visible=True, observable... | 2.125 | 2 |
blog/views.py | pavanasri-nyros/blog-app-pavana | 0 | 12784842 | from django.shortcuts import render, get_object_or_404, redirect
from .models import Post
from django.views.generic import ListView, DetailView
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth.models import User
from django.db import IntegrityError
from django.contrib... | 2.34375 | 2 |
irspack/utils/id_mapping.py | Random1992/irspack | 0 | 12784843 | from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
)
import numpy as np
import scipy.sparse as sps
from irspack.definitions import DenseScoreArray, UserIndexArray
from irspack.utils._util_cpp import retrieve_recommend_from_score
from ir... | 2.109375 | 2 |
src/pyrin/security/session/component.py | wilsonGmn/pyrin | 0 | 12784844 | # -*- coding: utf-8 -*-
"""
session component module.
"""
from pyrin.application.decorators import component
from pyrin.security.session import SessionPackage
from pyrin.security.session.manager import SessionManager
from pyrin.application.structs import Component
@component(SessionPackage.COMPONENT_NAME)
class Sess... | 1.71875 | 2 |
preprocessing.py | AsgerAndersen/ByOurOwnDevices | 0 | 12784845 | <gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# ## Load libraries
# In[3]:
import os
projpath = 'H:/workdata/705805/'
os.chdir(projpath)
# In[4]:
import pandas as pd
import numpy as np
from datetime import datetime as dt
import cns
# ## Global parameters
# In[5]:
timebin_len = 900
# ## Check the time... | 2.703125 | 3 |
src/283. Move Zeroes.py | rajshrivastava/LeetCode | 1 | 12784846 | <filename>src/283. Move Zeroes.py
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
ptr1 = 0
for num in nums:
if num:
nums[ptr1] = num
ptr1 += 1
for ... | 3.5625 | 4 |
apps/Testings/migrations/0004_auto_20170925_1703.py | ulibn/BlueXolo | 21 | 12784847 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-25 22:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Testings', '0003_collection'),
]
operations = [
migrations.RenameField(
... | 1.679688 | 2 |
wowgic/old_builds/wowgic_flask_3Mar/config/celeryconfig.py | chelladurai89/wowgicbackend2.0 | 0 | 12784848 | import os
from celery.schedules import crontab
CELERY_BROKER_URL='amqp://guest@localhost//'
CELERY_RESULT_BACKEND = 'mongodb://localhost:27017/'
CELERY_MONGODB_BACKEND_SETTINGS = {
'database': 'wowgicflaskapp',
'taskmeta_collection': 'my_taskmeta_collection',
}
#CELERY_ACCEPT_CONTENT = ['pickle', '... | 1.882813 | 2 |
appzoo/apps_gradio/demo.py | SunYanCN/AppZoo | 5 | 12784849 | <filename>appzoo/apps_gradio/demo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : AppZoo.
# @File : demo
# @Time : 2021/9/6 上午9:51
# @Author : yuanjie
# @WeChat : 313303303
# @Software : PyCharm
# @Description :
# /Users/yuanjie/Library/Python/3.7/lib/python/site-pack... | 1.484375 | 1 |
config.py | corbinmcneill/bonkbot | 1 | 12784850 | import boto3
#class Command:
# def __init__(self, description,
class Config:
dynamodb = boto3.resource('dynamodb')
def __init__(self, table_name):
self.table = self.dynamodb.Table(table_name)
def get(self, key):
response = self.table.get_item(Key = {'Key' : key}, ConsistentRe... | 2.5625 | 3 |