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 |
|---|---|---|---|---|---|---|
vitrage/evaluator/template_data.py | HoonMinJeongUm/Hunmin-vitrage | 0 | 5100 | <reponame>HoonMinJeongUm/Hunmin-vitrage<filename>vitrage/evaluator/template_data.py
# Copyright 2016 - Nokia
#
# 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/lic... | 1.9375 | 2 |
scripts/summarize-kmer-counts.py | rpetit3/anthrax-metagenome-study | 0 | 5101 | #! /usr/bin/env python3
"""Parse through the simulated sequencing group specific kmer counts."""
import argparse as ap
from collections import OrderedDict
import glob
import gzip
import os
import sys
import time
import numpy as np
import multiprocessing as mp
SAMPLES = OrderedDict()
KMERS = {}
HAMMING = OrderedDict()
... | 2.1875 | 2 |
movies/exceptions.py | te0dor/netguru-movies | 0 | 5102 | <filename>movies/exceptions.py
from marshmallow.exceptions import ValidationError
class ObjectDoesNotExist(Exception):
"""Exception if not found results"""
pass
class CommunicationError(Exception):
"""Exception for diferents problem with communications."""
pass
__all__ = ('ValidationError', 'Objec... | 2.3125 | 2 |
music_api/apps/music_app/admin.py | fejiroofficial/Simple_music | 0 | 5103 | from django.contrib import admin
from .models import Songs
admin.site.register(Songs)
# Register your models here.
| 1.390625 | 1 |
scripts/generate_image_series.py | JIC-Image-Analysis/senescence-in-field | 0 | 5104 | # Draw image time series for one or more plots
from jicbioimage.core.image import Image
import dtoolcore
import click
from translate_labels import rack_plot_to_image_plot
from image_utils import join_horizontally, join_vertically
def identifiers_where_match_is_true(dataset, match_function):
return [i for i i... | 2.390625 | 2 |
pytpp/properties/response_objects/system_status.py | Venafi/pytpp | 4 | 5105 | <gh_stars>1-10
from pytpp.properties.response_objects.dataclasses import system_status
from pytpp.tools.helpers.date_converter import from_date_string
class SystemStatus:
@staticmethod
def Engine(response_object: dict):
if not isinstance(response_object, dict):
response_object = {}
... | 2.375 | 2 |
src/data/dataModule.py | mikkelfo/Title-prediction-from-abstract | 0 | 5106 | <gh_stars>0
from typing import Optional
import pytorch_lightning as pl
import torch
from omegaconf import OmegaConf
from torch.utils.data import DataLoader, random_split
from transformers import T5Tokenizer
from src.data.PaperDataset import PaperDataset
class ArvixDataModule(pl.LightningDataModule):
def __init_... | 2.171875 | 2 |
shs/gui/RootFrame.py | ansobolev/shs | 1 | 5107 | # -*- coding: utf-8 -*-
import os
import sys
import time
import subprocess
import wx
import ConfigParser
from wx.lib.mixins.listctrl import getListCtrlSelection
from wx.lib.pubsub import pub
from gui.RootGUI import RootGUI
from StepsDialog import StepsDialog
from PlotFrame import PlotFuncFrame, PlotCorrFrame
import i... | 2.125 | 2 |
saleor/order/migrations/0015_auto_20170206_0407.py | acabezasg/urpi-master | 6 | 5108 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 10:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_prices.models
class Migration(migrations.Migration):
dependencies = [
... | 1.523438 | 2 |
testrail_client/api/configurations.py | tonybearpan/testrail-lib | 0 | 5109 | <reponame>tonybearpan/testrail-lib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .base import TestRailAPIBase
class Config(TestRailAPIBase):
"""
Use the follow... | 2.3125 | 2 |
tests/asserts_wrapper.py | QARancher/k8s_client | 0 | 5110 | def assert_not_none(actual_result, message=""):
if not message:
message = f"{actual_result} resulted with None"
assert actual_result, message
def assert_equal(actual_result, expected_result, message=""):
if not message:
message = f"{actual_result} is not equal to expected " \
... | 3.265625 | 3 |
srl/simulation_test.py | google/simple-reinforcement-learning | 60 | 5111 | <gh_stars>10-100
# Copyright 2017 Google 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 or agree... | 2.53125 | 3 |
src/xmltollvm.py | Tejvinder/thesis-ghidra | 101 | 5112 | from llvmlite import ir
import xml.etree.ElementTree as et
int32 = ir.IntType(32)
int64 = ir.IntType(64)
int1 = ir.IntType(1)
void_type = ir.VoidType()
function_names = []
registers, functions, uniques, extracts = {}, {}, {}, {}
internal_functions = {}
memory = {}
flags = ["ZF", "CF", "OF", "SF"]
pointers = ["RSP", "R... | 2.296875 | 2 |
modules/WPSeku/modules/discovery/generic/wplisting.py | Farz7/Darkness | 18 | 5113 | #/usr/bin/env python
# -*- Coding: UTF-8 -*-
#
# WPSeku: Wordpress Security Scanner
#
# @url: https://github.com/m4ll0k/WPSeku
# @author: <NAME> (M4ll0k)
import re
from lib import wphttp
from lib import wpprint
class wplisting:
chk = wphttp.UCheck()
out = wpprint.wpprint()
def __init__(self,agent,proxy,redir... | 2.015625 | 2 |
tw2/jit/widgets/__init__.py | toscawidgets/tw2.jit | 1 | 5114 | <gh_stars>1-10
from tw2.jit.widgets.chart import (AreaChart, BarChart, PieChart)
from tw2.jit.widgets.graph import (ForceDirectedGraph, RadialGraph)
from tw2.jit.widgets.tree import (SpaceTree, HyperTree, Sunburst,
Icicle, TreeMap)
from tw2.jit.widgets.ajax import AjaxRadialGraph
from... | 1.296875 | 1 |
bot.py | tiianprb/TikTok-Downloader-Bot | 0 | 5115 | <filename>bot.py
import json, requests, os, shlex, asyncio, uuid, shutil
from typing import Tuple
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery
# Configs
API_HASH = os.environ['API_HASH']
APP_ID = int(os.environ['APP_ID'])
BOT_TOKEN = ... | 2.421875 | 2 |
frontend-gui/rpanel.py | skyu0221/660-iot | 0 | 5116 | import wx
import wx.adv
import random
import util
import config
import time
import datetime
import threading
import requests
import json
from functools import partial
class ReqeusterThread(threading.Thread):
# https://www.oreilly.com/library/view/python-cookbook/0596001673/ch06s03.html
def __init__(self, ... | 2.28125 | 2 |
webapp/search.py | henchan/memfinity | 0 | 5117 | <gh_stars>0
"""High-level search API.
This module implements application-specific search semantics on top of
App Engine's search API. There are two chief operations: querying for
entities, and managing entities in the search facility.
Add and remove Card entities in the search facility:
insert_cards([models.Card])... | 3 | 3 |
Bot/Bot/board.py | Baidi96/AI-Agent-for-Light-Rider | 1 | 5118 | import copy
import sys
PLAYER1, PLAYER2, EMPTY, BLOCKED = [0, 1, 2, 3]
S_PLAYER1, S_PLAYER2, S_EMPTY, S_BLOCKED, = ['0', '1', '.', 'x']
CHARTABLE = [(PLAYER1, S_PLAYER1), (PLAYER2, S_PLAYER2), (EMPTY, S_EMPTY), (BLOCKED, S_BLOCKED)]
DIRS = [
((-1, 0), "up"),
((1, 0), "down"),
((0, 1), "right"),
((0, ... | 2.953125 | 3 |
baekjoon/1012.py | wonnerky/coteMaster | 0 | 5119 | import sys
sys.setrecursionlimit(10000)
def dfs(r, c):
global visit
visit[r][c] = True
mov = [(-1, 0), (0, -1), (1, 0), (0, 1)]
for i in range(4):
dr, dc = mov[i]
nr, nc = r + dr, c + dc
if 0 <= nr < N and 0 <= nc < M and visit[nr][nc] == False and board[nr][nc] == 1:
... | 2.71875 | 3 |
collection/cp/algorithms-master/python/binary_tree.py | daemonslayer/Notebook | 1 | 5120 | <reponame>daemonslayer/Notebook
"""
Binary Tree and basic properties
1. In-Order Traversal
2. Pre-Order Traversal
3. Post-Order Traversal
4. Level-Order Traversal
"""
from collections import deque
class BinaryTree(object):
"""
Representation of a general binary tree
data: value of element
left: Left s... | 3.84375 | 4 |
custom_components/vaddio_conferenceshot/const.py | rohankapoorcom/vaddio_conferenceshot | 0 | 5121 | import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PATH, CONF_USERNAME
DOMAIN = "vaddio_conferenceshot"
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_USERNAME): cv.string,... | 1.859375 | 2 |
lightonml/opu.py | lightonai/lightonml | 27 | 5122 | <gh_stars>10-100
# Copyright (c) 2020 LightOn, All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
"""
This module contains the OPU class
"""
import time
from math import sqrt
import pkg_resources
from lightonml.encoding.b... | 1.882813 | 2 |
example/shovel/bar.py | demiurgestudios/shovel | 202 | 5123 | from shovel import task
@task
def hello(name='Foo'):
'''Prints "Hello, " followed by the provided name.
Examples:
shovel bar.hello
shovel bar.hello --name=Erin
http://localhost:3000/bar.hello?Erin'''
print('Hello, %s' % name)
@task
def args(*args):
'''Echos back all the ar... | 4.03125 | 4 |
scripts/external_libs/scapy-2.4.3/scapy/config.py | timgates42/trex-core | 956 | 5124 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
"""
Implementation of the configuration object.
"""
from __future__ import absolute_import
from __future__ import print_function
import functo... | 2.0625 | 2 |
tests/base/test_server.py | Prodigy123/rasa_nlu_zh | 4 | 5125 | <filename>tests/base/test_server.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import tempfile
import pytest
import time
from treq.testing import StubTreq
from rasa_nlu.config import Ras... | 2.171875 | 2 |
bugsnag/configuration.py | ForroKulcs/bugsnag-python | 0 | 5126 | <filename>bugsnag/configuration.py<gh_stars>0
import os
import platform
import socket
import sysconfig
from typing import List, Any, Tuple, Union
import warnings
from bugsnag.sessiontracker import SessionMiddleware
from bugsnag.middleware import DefaultMiddleware, MiddlewareStack
from bugsnag.utils import (fully_quali... | 1.945313 | 2 |
secret_injector/secret.py | failk8s/failk8s-operator | 0 | 5127 | import kopf
from .functions import global_logger, reconcile_secret
@kopf.on.event("", "v1", "secrets")
def injector_secret_event(type, event, logger, **_):
obj = event["object"]
namespace = obj["metadata"]["namespace"]
name = obj["metadata"]["name"]
# If secret already exists, indicated by type bein... | 2.109375 | 2 |
src/py/gee/utils.py | openforis/collectearthonline | 0 | 5128 | <filename>src/py/gee/utils.py
import datetime
import os
import ee
import math
import sys
import json
from ee.ee_exception import EEException
from gee.inputs import getLandsat, getS1
########## Helper functions ##########
def initialize(ee_account='', ee_key_path=''):
try:
if ee_account an... | 2.0625 | 2 |
userManagement/management/urls.py | shubhamguptaorg/user_managementl | 0 | 5129 | from django.contrib import admin
from django.urls import path,include
from django.views.generic import TemplateView
from .views import Index,SignUp,UserDashboard,AdminDashboard,logout,showAdminData,deleteuser,activeUser,deactiveUser,UserDetailEdit,uploadImage
# from .views import Index,UserDashboard,SignUp,AdminDashboa... | 1.84375 | 2 |
sickbeard/lib/hachoir_parser/container/riff.py | Branlala/docker-sickbeardfr | 0 | 5130 | <reponame>Branlala/docker-sickbeardfr
# -*- coding: UTF-8 -*-
"""
RIFF parser, able to parse:
* AVI video container
* WAV audio container
* CDA file
Documents:
- libavformat source code from ffmpeg library
http://ffmpeg.mplayerhq.hu/
- Video for Windows Programmer's Guide
http://www.opennet.ru/docs/forma... | 2.03125 | 2 |
Utils.py | MartinEngen/NaiveBayesianClassifier | 0 | 5131 | <filename>Utils.py
import os
import re
def get_subfolder_paths(folder_relative_path: str) -> list:
"""
Gets all subfolders of a given path
:param folder_relative_path: Relative path of folder to find subfolders of
:return: list of relative paths to any subfolders
"""
return [f.path for f in os... | 3.28125 | 3 |
tools/ldbc_benchmark/neo4j/load_scripts/time_index.py | carlboudreau007/ecosys | 245 | 5132 | from datetime import datetime
with open('/home/neo4j/neo4j-community-3.5.1/logs/debug.log', 'r') as log:
begin = []
end = []
for line in log:
if 'Index population started' in line:
begin.append(line[:23])
elif 'Index creation finished' in line:
end.append(line[:23])
if len(begin) == 0 or le... | 2.671875 | 3 |
zf-setup.py | Ziki2001/new-school-sdk | 0 | 5133 | <filename>zf-setup.py<gh_stars>0
# -*- coding: utf-8 -*-
'''
:file: setup.py
:author: -Farmer
:url: https://blog.farmer233.top
:date: 2021/09/20 11:11:54
'''
from os import path
from setuptools import setup, find_packages
basedir = path.abspath(path.dirname(__file__))
with open(path.join(basedir, "RE... | 1.578125 | 2 |
RunIt/airt/poker_cards.py | antx-code/funcode | 3 | 5134 | <gh_stars>1-10
# Square 方片 => sq => RGB蓝色(Blue)
# Plum 梅花 => pl => RGB绿色(Green)
# Spade 黑桃 => sp => RGB黑色(Black)
# Heart 红桃 => he => RGB红色(Red)
init_poker = {
'local': {
'head': [-1, -1, -1],
'mid': [-1, -1, -1, -1, -1],
'tail': [-1, -1, -1, -1, -1],
... | 1.9375 | 2 |
main.py | reflective21/iportfolio | 0 | 5135 | name = "<NAME>"
print(name) | 1.484375 | 1 |
tcex/services/api_service.py | kdeltared/tcex | 0 | 5136 | <filename>tcex/services/api_service.py
"""TcEx Framework API Service module."""
# standard library
import json
import sys
import threading
import traceback
from io import BytesIO
from typing import Any
from .common_service import CommonService
class ApiService(CommonService):
"""TcEx Framework API Service module... | 2.296875 | 2 |
mmpose/core/optimizer/builder.py | vsatyakumar/mmpose | 1 | 5137 | <reponame>vsatyakumar/mmpose
from mmcv.runner import build_optimizer
def build_optimizers(model, cfgs):
"""Build multiple optimizers from configs.
If `cfgs` contains several dicts for optimizers, then a dict for each
constructed optimizers will be returned.
If `cfgs` only contains one optimizer confi... | 2.9375 | 3 |
register/views.py | angel-vazquez25/My-Backlog-Handler | 3 | 5138 | <reponame>angel-vazquez25/My-Backlog-Handler
import datetime
from django.contrib.auth import logout
from django.shortcuts import render, redirect
from .forms import RegisterForm
from django.http import HttpResponse
from django.contrib.auth.forms import AuthenticationForm
from django.conf import settings
from django.co... | 2.15625 | 2 |
forum/migrations/0001_initial.py | Aerodlyn/mu | 1 | 5139 | <filename>forum/migrations/0001_initial.py
# Generated by Django 3.1.7 on 2021-03-26 01:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Community',
fiel... | 1.882813 | 2 |
custom_train.py | shirley-wu/text_to_table | 3 | 5140 | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import collections
import logging
import math
import os
im... | 1.835938 | 2 |
src/ucar/unidata/idv/resources/python/griddiag.py | JessicaWiedemeier/IDV | 1 | 5141 | """
This is the doc for the Grid Diagnostics module. These functions
are based on the grid diagnostics from the GEneral Meteorological
PAcKage (GEMPAK). Note that the names are case sensitive and some
are named slightly different from GEMPAK functions to avoid conflicts
with Jython built-ins (e.g. st... | 3.140625 | 3 |
app.py | DevilBit/Twitter-Bot | 0 | 5142 | from selenium import webdriver #to get the browser
from selenium.webdriver.common.keys import Keys #to send key to browser
import getpass #to get password safely
import time #to pause the program
#a calss to store all twetter related objects and functions
class twitter_bot:
def __init__(self, username, pas... | 3.1875 | 3 |
visualization.py | shyhyawJou/GradCAM-pytorch | 0 | 5143 | import torch
import torch.nn as nn
from torch.nn import functional as F
from PIL import Image
import cv2 as cv
from matplotlib import cm
import numpy as np
class GradCAM:
"""
#### Args:
layer_name: module name (not child name), if None,
will use the last layer befor... | 2.609375 | 3 |
frame_2D_alg/alternative versions/intra_blob_xy.py | Mechachleopteryx/CogAlg | 0 | 5144 | <filename>frame_2D_alg/alternative versions/intra_blob_xy.py<gh_stars>0
'''
2D version of 1st-level algorithm is a combination of frame_blobs, intra_blob, and comp_P: optional raster-to-vector conversion.
intra_blob recursively evaluates each blob for two forks of extended internal cross-comparison and sub-clus... | 2.1875 | 2 |
examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_terrain_randomizer.py | felipeek/bullet3 | 9,136 | 5145 | """Generates a random terrain at Minitaur gym environment reset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path... | 3.15625 | 3 |
polecat/db/sql/expression/values.py | furious-luke/polecat | 4 | 5146 | <reponame>furious-luke/polecat
from functools import partial
from polecat.db.query import query as query_module
from psycopg2.sql import SQL, Placeholder
from .expression import Expression
class Values(Expression):
def __init__(self, values, relation=None):
self.values = values
self.relation = r... | 2.75 | 3 |
python/day3p1.py | swilcox/2019adventofcode | 1 | 5147 | # 2019 advent day 3
MOVES = {
'R': (lambda x: (x[0], x[1] + 1)),
'L': (lambda x: (x[0], x[1] - 1)),
'U': (lambda x: (x[0] + 1, x[1])),
'D': (lambda x: (x[0] - 1, x[1])),
}
def build_route(directions: list) -> list:
current_location = (0, 0)
route = []
for d in directions:
directio... | 3.671875 | 4 |
examples/demo/python/catalog.py | JavDomGom/mist | 1 | 5148 | import asyncio
async def searchDomains(domain, q):
domains = []
proc = await asyncio.create_subprocess_shell(f"dnsrecon -d {domain} -t crt", stdout=asyncio.subprocess.PIPE)
line = True
while line:
line = (await proc.stdout.readline()).decode('utf-8')
fields = line.split()
if len... | 2.8125 | 3 |
tests/api/v3_1_0/test_security_groups_acls.py | CiscoISE/ciscoisesdk | 36 | 5149 | <reponame>CiscoISE/ciscoisesdk
# -*- coding: utf-8 -*-
"""IdentityServicesEngineAPI security_groups_acls API fixtures and tests.
Copyright (c) 2021 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwa... | 1.625 | 2 |
geomstats/geometry/riemannian_metric.py | stefanheyder/geomstats | 0 | 5150 | """Riemannian and pseudo-Riemannian metrics."""
import math
import warnings
import autograd
import geomstats.backend as gs
from geomstats.geometry.connection import Connection
EPSILON = 1e-4
N_CENTERS = 10
TOLERANCE = 1e-5
N_REPETITIONS = 20
N_MAX_ITERATIONS = 50000
N_STEPS = 10
def loss(y_pred, y_true, metric):... | 3.0625 | 3 |
app/main/pages/instrument/hrs/red/order/plots.py | hettlage/salt-data-quality-site | 0 | 5151 | import pandas as pd
from bokeh.models import HoverTool
from bokeh.models.formatters import DatetimeTickFormatter
from bokeh.palettes import Plasma256
from bokeh.plotting import figure, ColumnDataSource
from app import db
from app.decorators import data_quality
# creates your plot
date_formatter = DatetimeTickFormatt... | 2.625 | 3 |
p6e8.py | yannickbf-prog/python | 0 | 5152 | <reponame>yannickbf-prog/python
#<NAME>6e8 Escribe un programa que te pida primero un número y luego te pida números hasta que la suma de los números introducidos coincida con el número inicial. El programa termina escribiendo la lista de números.
limite = int(input("Escribe limite:"))
valores = int(input("Escrib... | 3.953125 | 4 |
.venv/lib/python3.8/site-packages/cleo/application.py | RivtLib/replit01 | 1 | 5153 | <gh_stars>1-10
from typing import Optional
from typing import Tuple
from clikit.console_application import ConsoleApplication
from .commands import BaseCommand
from .commands.completions_command import CompletionsCommand
from .config import ApplicationConfig
class Application(ConsoleApplication, object):
... | 2.796875 | 3 |
simone/person/management.py | zuhalcakir/simone | 16 | 5154 | #from django.dispatch import dispatcher
#def UserProfilePostInsert(sender, instance, signal, *args, **kwargs):
#"""
#Inserts a blank imap server entry (if necessary) and associates it with the user
#"""
#user = instance
#i = user.get_profile().imap_servers.create()
#user.get_profile().about = '... | 2.328125 | 2 |
watcher/fly.py | cog-isa/htm-rl | 1 | 5155 | <filename>watcher/fly.py
from utils.drawer import Drawer
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("name", help="the name of the datafile")
parser.add_argument("--size", help="width,height")
args = parser.parse_args()
if args.size is None:
... | 3 | 3 |
test/unit/test_structures.py | ourobouros/aws-encryption-sdk-python | 0 | 5156 | <filename>test/unit/test_structures.py
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.... | 1.703125 | 2 |
codes/utils/mygraph.py | CristianLazoQuispe/Datathon-Interbank-2020 | 0 | 5157 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
path_results = '../results/images/'
# this function receives a dataset with binary target and it will graph a hist of values
def graph_target(data,name="target",figsize=(6,4),title_name=None,color_text="white",save=False,name... | 3.09375 | 3 |
src/pretix/base/validators.py | td00/pretix | 0 | 5158 | from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
class BlacklistValidator:
blacklist = []
def __call__(self, value):
# Validation logic
if value in self.blacklist:
raise... | 2.21875 | 2 |
fortnitepy/ext/commands/bot.py | gfdb/fortnitepy | 127 | 5159 | <filename>fortnitepy/ext/commands/bot.py<gh_stars>100-1000
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, includi... | 1.796875 | 2 |
LeetCodeSolutions/python/64_Minimum_Path_Sum.py | ChuanleiGuo/AlgorithmsPlayground | 1 | 5160 | <filename>LeetCodeSolutions/python/64_Minimum_Path_Sum.py
class Solution(object):
def minPathSum(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
m, n = len(grid), len(grid[0])
dp = [[0] * n for _ in range(m)]
for i in range(m):
for j i... | 3.5 | 4 |
paths_win.py | tankbusta/rescache | 15 | 5161 | import _winreg
import os
def get_shared_cache_folder():
"""
Look in the registry for the configured cache folder.
If there is no entry, then we create one.
:return:
"""
_winreg.aReg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
try:
key = _winreg.OpenKey(_winreg.aReg, ... | 2.703125 | 3 |
venv/lib/python3.8/site-packages/dateparser/data/date_translation_data/ebu.py | yuta-komura/vishnu | 1 | 5162 | <reponame>yuta-komura/vishnu
# -*- coding: utf-8 -*-
info = {
"name": "ebu",
"date_order": "DMY",
"january": [
"mweri wa mbere",
"mbe"
],
"february": [
"mweri wa kaĩri",
"kai"
],
"march": [
"mweri wa kathatũ",
"kat"
],
"april": [
... | 1.679688 | 2 |
deepa2/preptrain/__init__.py | debatelab/deepa2 | 0 | 5163 | """Preprocessing DeepA2 datasets for LM training"""
# flake8: noqa
from deepa2.preptrain.t2tpreprocessor import T2TPreprocessor
| 1.109375 | 1 |
setup.py | martinfarrow/awspk | 0 | 5164 | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(name='awspk',
version='0.1',
description='A aws cli pen knife with loads of interested stuff',
author='<NAME>',
author_email='<EMAIL>',
py_modules=['awspk'],
license='LICENSE',
)
| 1.15625 | 1 |
pyclicker/lib/python3.7/site-packages/Xlib/display.py | JayRovacsek/pyautoclick | 1 | 5165 | # Xlib.display -- high level display object
#
# Copyright (C) 2000 <NAME> <<EMAIL>>
#
# 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 o... | 1.726563 | 2 |
Others/qupc/qupc2014/c/main.py | KATO-Hiro/AtCoder | 2 | 5166 | <reponame>KATO-Hiro/AtCoder<filename>Others/qupc/qupc2014/c/main.py
# -*- coding: utf-8 -*-
def main():
from string import ascii_uppercase
n, m, q_large = map(int, input().split())
s = [list(input()) for _ in range(n)]
q = [input() for _ in range(q_large)]
pos = [None for _ in range(26)]
for... | 3.0625 | 3 |
NetCatKS/DProtocol/api/interfaces/subscribers/__init__.py | dimddev/NetCatKS-CP | 0 | 5167 | <filename>NetCatKS/DProtocol/api/interfaces/subscribers/__init__.py<gh_stars>0
__author__ = 'dimd'
from zope.interface import Interface, Attribute
class IBaseResourceSubscriber(Interface):
"""
IBaseResourceSubscriber provides functionality for comparison of the signature on
a incoming request against a... | 2.484375 | 2 |
analysis/notebooks/helper/anova.py | dpedrosac/DBSgait | 1 | 5168 | <reponame>dpedrosac/DBSgait<gh_stars>1-10
import numpy as np
import pandas as pd
from scipy.stats import f_oneway
from typing import Dict, Tuple, Set
def extract_significant_p(df: pd.DataFrame, p_value_limit: float):
"""Return a df, which replaces values that are above p_value_limit with `None`"""
return (
... | 2.953125 | 3 |
bux_recorder/utils.py | roaldarbol/bux | 0 | 5169 | <gh_stars>0
import os
import platform
import time
import csv
import serial
import cv2
import tkinter as tk
from tkinter.filedialog import askdirectory
from serial.tools import list_ports
# From https://raspberrypi.stackexchange.com/a/118473
def is_raspberrypi():
try:
with io.open('/sys/firmware/devicetree/... | 2.953125 | 3 |
a2e/optimizer/hpbandster/_model_worker.py | maechler/a2e | 1 | 5170 | <filename>a2e/optimizer/hpbandster/_model_worker.py
from hpbandster.core.worker import Worker
from a2e.model import AbstractModel
from a2e.optimizer import EvaluationResultAggregator
from a2e.utility import inf_nan_to_float_max
class ModelWorker(Worker):
def __init__(
self,
model: AbstractModel,
... | 2.203125 | 2 |
xagents/__init__.py | schissmantics/xagents | 37 | 5171 | from xagents import a2c, acer, ddpg, dqn, ppo, td3, trpo
from xagents.a2c.agent import A2C
from xagents.acer.agent import ACER
from xagents.base import OffPolicy
from xagents.ddpg.agent import DDPG
from xagents.dqn.agent import DQN
from xagents.ppo.agent import PPO
from xagents.td3.agent import TD3
from xagents.trpo.ag... | 1.90625 | 2 |
IsraeliQueue/__init__.py | YonLiud/Israeli-Queue | 2 | 5172 | from .IsraeliQueue import IsraeliQueue, Item, IsraeliQueueByType
| 1.109375 | 1 |
examples/MMPT/mmpt_cli/localjob.py | Este1le/fairseq | 0 | 5173 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from mmpt.utils import recursive_config
class BaseJob(object):
def __init__(self, yaml_file, dryrun=False):
self.yaml_... | 1.859375 | 2 |
tron/Nubs/deprecated/tcc25m-old.py | sdss/tron | 0 | 5174 | import os.path
from tron import g, hub
from tron.Hub.Command.Encoders.ASCIICmdEncoder import ASCIICmdEncoder
from tron.Hub.Nub.TCCShellNub import TCCShellNub
from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder
name = 'tcc'
def start(poller):
stop()
initCmds = ('show version', 'show us... | 2.015625 | 2 |
src/PtDb/test.py | ptphp/PyLib | 1 | 5175 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding=utf-8 -*-
'''
Created on 2013-3-31
@author: Joseph
'''
import PtDb
if __name__ == '__main__':
PtDb.config = {
'sqlite':{
'type':'sqlite',
'dbname':"data1.db"
... | 2.40625 | 2 |
services/object_storage/tests/integ/test_object_storage_bulk_operations.py | honzajavorek/oci-cli | 0 | 5176 | # coding: utf-8
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
import filecmp
import json
import pytest
import oci
import services.object_storage.src.oci_cli_object_storage as oci_cli_object_storage
import os
import random
import shutil
import six
import string
from tests import util
fr... | 2.140625 | 2 |
Extras/benchmark/simple-benchmark.py | yunhaom94/redis-writeanywhere | 0 | 5177 | #!/usr/bin/python3
import random
import string
import time
import subprocess
import os
import redis
import threading
def generate_string(string_size, size, dict):
'''
https://stackoverflow.com/questions/16308989/fastest-method-to-generate-big-random-string-with-lower-latin-letters
'''
for i in ran... | 3.125 | 3 |
challenges/015-setintersection.py | Widdershin/CodeEval | 0 | 5178 | <reponame>Widdershin/CodeEval
"""
https://www.codeeval.com/browse/30/
Set Intersection
Challenge Description:
You are given two sorted list of numbers (ascending order). The lists
themselves are comma delimited and the two lists are semicolon
delimited. Print out the intersection of these two sets.
Inp... | 4.1875 | 4 |
python/arch/api/table/session.py | GentleWang1011/eggroll | 1 | 5179 | <gh_stars>1-10
#
# Copyright 2019 The FATE 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 re... | 1.84375 | 2 |
experiments/vitchyr/vaes/learn_swirl_vae.py | Asap7772/rail-rl-franka-eval | 0 | 5180 | """
VAE on the swirl task.
Basically, VAEs don't work. It's probably because the prior isn't very good
and/or because the learning signal is pretty weak when both the encoder and
decoder change quickly. However, I tried also alternating between the two,
and that didn't seem to help.
"""
from torch.distributions import... | 2.53125 | 3 |
litex/build/openfpgaloader.py | JosephBushagour/litex | 0 | 5181 | #
# This file is part of LiteX.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.tools import write_to_file
from litex.build.generic_programmer import GenericProgrammer
# openFPGAloader ------------------------------------------------------------------------------------... | 2.296875 | 2 |
NutriBuddiAPIServices/ImageClassifier/NutriBuddiClassifier/Classifier/FoodClassifier.py | NutriBuddi/NutriBuddi | 2 | 5182 | class FoodClassifier:
#Class Attributes:
#model - the underlying keras model
#labels - the labels to be associated with the activation of each output neuron.
#Labels must be the same size as the output layer of the neural network.
def __init__(self, modelpath, labels, min_confidence =... | 3.359375 | 3 |
freehackquest_libclient_py/__init__.py | freehackquest/libfhqcli-py | 0 | 5183 | <reponame>freehackquest/libfhqcli-py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 FreeHackQuest Team <<EMAIL>>
"""This file was automatically generated by fhq-server
Version: v0.2.47
Date: 2022-01-01 07:15:35
"""
from freehackquest_libclient_py.freehackquest_client import FreeHackQuestClient... | 0.855469 | 1 |
exchange_sockets/bitstamp_websocket.py | SpiralDevelopment/crypto-hft-data | 31 | 5184 | from exchange_sockets.exchange_websocket import ExchangeWebSocket
from singletones.custom_logger import MyLogger
import websocket
import threading
from time import sleep
from time import time
import json
import ssl
logger = MyLogger()
class BitstampWebsocket(ExchangeWebSocket):
def __init__(self, pairs_n_stream... | 2.375 | 2 |
src/data_loading.py | katerakelly/pytorch-maml | 565 | 5185 | <gh_stars>100-1000
import numpy as np
import random
import torch
from torch.utils.data import DataLoader
from torch.utils.data.sampler import Sampler
import torchvision.transforms as transforms
from dataset import Omniglot, MNIST
'''
Helpers for loading class-balanced few-shot tasks
from datasets
'''
class ClassBal... | 2.65625 | 3 |
DoChaP-db/UnusedScripts/main.py | Tal-Shay-Group/DoChaP | 2 | 5186 | <filename>DoChaP-db/UnusedScripts/main.py<gh_stars>1-10
#!/usr/bin/python
import sys
import os
sys.path.append(os.getcwd())
from Director import Director
from OrthologsBuilder import *
from SpeciesDB import *
if __name__ == "__main__":
inputDict = {}
for inarg in sys.argv[1:]:
try:
splitAr... | 2.28125 | 2 |
tests/constants.py | eigenein/sqlitemap | 4 | 5187 | # See also: https://stackoverflow.com/questions/3694276/what-are-valid-table-names-in-sqlite
good_table_names = [
'foo',
'123abc',
'123abc.txt',
'123abc-ABC.txt',
'foo""bar',
'😀',
'_sqlite',
]
# See also: https://stackoverflow.com/questions/3694276/what-are-valid-table-names-in-sqlite
bad_... | 1.53125 | 2 |
TWLight/settings/base.py | amire80/TWLight | 0 | 5188 | <filename>TWLight/settings/base.py
# -*- coding: utf-8 -*-
"""
Base settings for twlight project.
This is not intended to be used as the live settings file for a project and will
not work as one. You should instead use production.py, local.py, heroku.py, or
another file that you write. These files should live in the s... | 1.742188 | 2 |
modelator_py/util/tla/_optable.py | informalsystems/modelator-py | 0 | 5189 | <reponame>informalsystems/modelator-py
"""Table of operators."""
# Copyright 2020 by California Institute of Technology
# Copyright (c) 2008-2013 INRIA and Microsoft Corporation
# All rights reserved. Licensed under 3-clause BSD.
#
# This module is based on the file:
#
# <https://github.com/tlaplus/tlapm/blob/main/src... | 2.171875 | 2 |
DIE/UI/FunctionViewEx.py | a1ext/DIE | 5 | 5190 | <filename>DIE/UI/FunctionViewEx.py<gh_stars>1-10
import networkx as nx
from awesome.context import ignored
import sark
import idaapi
import idautils
import idc
from idaapi import PluginForm
from sark.qt import QtGui, QtCore, QtWidgets, form_to_widget, use_qt5
if use_qt5:
_QSortFilterProxyModel = QtCore... | 1.929688 | 2 |
peerbot/PeerBot.py | danerprog/PeerHostedDiscordBot | 0 | 5191 | <reponame>danerprog/PeerHostedDiscordBot
from peerbot.PeerBotStateMachine import PeerBotStateMachine
from utils.Logger import Logger
import discord
class PeerBot(discord.Client):
def __init__(self, args):
self.args = args
self.isBotReady = False
super().__init__()
async d... | 2.421875 | 2 |
dags/oss_know/oss_know_dags/dags_github/dag_github_init_issues_timeline.py | ynang/airflow-jobs-1 | 4 | 5192 | from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator
# v0.0.1
from oss_know.libs.base_dict.variable_key import NEED_INIT_GITHUB_ISSUES_TIMELINE_REPOS, GITHUB_TOKENS, \
OPENSEARCH_CONN_DATA, PROXY_CONFS
from oss_know.libs.util.proxy import KuaiProxyService, Prox... | 2.21875 | 2 |
conans/conan.py | laundry-96/conan | 2 | 5193 | <reponame>laundry-96/conan
import sys
from conans.client.command import main
def run():
main(sys.argv[1:])
if __name__ == '__main__':
run()
| 1.390625 | 1 |
tests/apps/persons/test_cms_plugins_person.py | lunika/richie | 0 | 5194 | # -*- coding: utf-8 -*-
"""
Unit tests for the Person plugin and its model
"""
from django import forms
from django.conf import settings
from django.test import TestCase
from cms.api import add_plugin, create_page
from cmsplugin_plain_text.cms_plugins import PlaintextPlugin
from djangocms_picture.cms_plugins import Pi... | 2.359375 | 2 |
mathics/core/subexpression.py | Mathics3/mathics-core | 90 | 5195 | # cython: language_level=3
# -*- coding: utf-8 -*-
from mathics.core.expression import Expression
from mathics.core.symbols import Atom, Symbol
from mathics.core.atoms import Integer
from mathics.builtin.base import MessageException
"""
This module provides some infrastructure to deal with SubExpressions.
"""
def... | 2.765625 | 3 |
pyopenproject/business/services/command/configuration/find.py | webu/pyopenproject | 5 | 5196 | <filename>pyopenproject/business/services/command/configuration/find.py<gh_stars>1-10
from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.get_request import GetRequest
from pyopenproject.business.exception.business_error import BusinessError
from... | 2.609375 | 3 |
lib/python/treadmill/tests/api/cell_test.py | vrautela/treadmill | 1 | 5197 | <gh_stars>1-10
"""Cell API tests.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import mock
from treadmill import admin
from treadmill.api import cell
class ApiCellTest(unittest.TestCase):
... | 2.46875 | 2 |
src/python_package/__init__.py | microsoft/ai-python-package | 3 | 5198 | <filename>src/python_package/__init__.py<gh_stars>1-10
# -------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in project root for information.
# ----------------------------------------------------... | 1.804688 | 2 |
tests/test_integration_partition.py | themoodymann/piChain | 8 | 5199 | <gh_stars>1-10
"""Integration test: Test partition of piChain nodes.
Note: run tests with default setting values in config.py.
"""
import time
from tests.util import MultiNodeTest
class MultiNodeTestPartition(MultiNodeTest):
def test_scenario30_partition(self):
self.start_processes_with_test_scenario(3... | 2.5 | 2 |