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 |
|---|---|---|---|---|---|---|
src/main/NLP/STRING_MATCH/scopus_ha_module_match.py | alvinajacquelyn/COMP0016_2 | 0 | 9100 | import os, sys, re
import json
import pandas as pd
import pymongo
from main.LOADERS.publication_loader import PublicationLoader
from main.MONGODB_PUSHERS.mongodb_pusher import MongoDbPusher
from main.NLP.PREPROCESSING.preprocessor import Preprocessor
class ScopusStringMatch_HAmodule():
def __ini... | 2.765625 | 3 |
tools/urls.py | Cyberdeep/archerysec | 0 | 9101 | <reponame>Cyberdeep/archerysec
# _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
# /_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# ... | 1.671875 | 2 |
api/vm/base/utils.py | erigones/esdc-ce | 97 | 9102 | from core.celery.config import ERIGONES_TASK_USER
from que.tasks import execute, get_task_logger
from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress
logger = get_task_logger(__name__)
def is_vm_missing(vm, msg):
"""
Check failed command output and return True if VM is not on comp... | 2.140625 | 2 |
993_Cousins-in-Binary-Tree.py | Coalin/Daily-LeetCode-Exercise | 3 | 9103 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isCousins(self, root: TreeNode, x: int, y: int) -> bool:
x_depth = None
x_parent = None... | 3.75 | 4 |
docker-images/taigav2/taiga-back/tests/integration/test_tasks_tags.py | mattcongy/itshop | 1 | 9104 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... | 2.046875 | 2 |
pytorchocr/postprocess/cls_postprocess.py | satchelwu/PaddleOCR2Pytorch | 3 | 9105 | import torch
class ClsPostProcess(object):
""" Convert between text-label and text-index """
def __init__(self, label_list, **kwargs):
super(ClsPostProcess, self).__init__()
self.label_list = label_list
def __call__(self, preds, label=None, *args, **kwargs):
if isinstance(preds, ... | 2.609375 | 3 |
inference_folder.py | aba-ai-learning/Single-Human-Parsing-LIP | 0 | 9106 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import os
import argparse
import logging
import numpy as np
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torchvision import transforms
import cv2
import tqdm
from net.pspnet import PSPNet
models = {
... | 2.078125 | 2 |
src/random_policy.py | shuvoxcd01/Policy-Evaluation | 0 | 9107 | from src.gridworld_mdp import GridWorld
class EquiprobableRandomPolicy:
def __init__(self):
self.world_model = GridWorld()
def get_prob(self, selected_action, state):
assert state in self.world_model.states
assert selected_action in self.world_model.actions
num_all_possible_a... | 2.734375 | 3 |
sktime/classification/feature_based/_summary_classifier.py | Rubiel1/sktime | 1 | 9108 | <filename>sktime/classification/feature_based/_summary_classifier.py
# -*- coding: utf-8 -*-
"""Summary Classifier.
Pipeline classifier using the basic summary statistics and an estimator.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["SummaryClassifier"]
import numpy as np
from sklearn.ensemble import RandomFo... | 3.140625 | 3 |
coding/reverse_bits/starter.py | skumaravelan/tech-interview-questions | 14 | 9109 | class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
| 2.796875 | 3 |
Topics/Submitting data/POST Request With Several Keys/main.py | valenciarichards/hypernews-portal | 1 | 9110 | <reponame>valenciarichards/hypernews-portal
from django.shortcuts import redirect
from django.views import View
class TodoView(View):
all_todos = []
def post(self, request, *args, **kwargs):
todo = request.POST.get("todo")
important = request.POST.get("important")
if todo not in self.... | 2.1875 | 2 |
pypeln/thread/api/to_iterable_thread_test.py | quarckster/pypeln | 1,281 | 9111 | <filename>pypeln/thread/api/to_iterable_thread_test.py
import typing as tp
from unittest import TestCase
import hypothesis as hp
from hypothesis import strategies as st
import pypeln as pl
import cytoolz as cz
MAX_EXAMPLES = 10
T = tp.TypeVar("T")
@hp.given(nums=st.lists(st.integers()))
@hp.settings(max_examples=MA... | 2.578125 | 3 |
pybinsim/pose.py | fkleinTUI/pyBinSim | 0 | 9112 | import logging
from collections import namedtuple
logger = logging.getLogger("pybinsim.Pose")
class Orientation(namedtuple('Orientation', ['yaw', 'pitch', 'roll'])):
pass
class Position(namedtuple('Position', ['x', 'y', 'z'])):
pass
class Custom(namedtuple('CustomValues', ['a', 'b', 'c'])):
pass
cl... | 2.8125 | 3 |
morphocut_server/extensions.py | madelinetharp/morphocut-server | 0 | 9113 | <filename>morphocut_server/extensions.py
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
from flask_migrate import Migrate
# from flask_rq2 import RQ
from rq import Queue
from morphocut_server.worker import redis_conn
database = SQLAlchemy()
redis_store = FlaskRedis()
migrate = Migrate()
r... | 1.523438 | 2 |
acq4/drivers/ThorlabsMFC1/tmcm.py | aleonlein/acq4 | 1 | 9114 | from __future__ import print_function
"""
Low-level serial communication for Trinamic TMCM-140-42-SE controller
(used internally for the Thorlabs MFC1)
"""
import serial, struct, time, collections
try:
# this is nicer because it provides deadlock debugging information
from acq4.util.Mutex import RecursiveMut... | 2.15625 | 2 |
tests/generators/ios/test_core_data.py | brianleungwh/signals | 3 | 9115 | import unittest
from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder
class CoreDataTestCase(unittest.TestCase):
def test_get_current_version(self):
version_name = get_current_version('./tests/files/doubledummy.xcdatamodeld')
self.assertEqual(version_name, 'du... | 2.40625 | 2 |
mcmc/plot_graph.py | hudalao/mcmc | 0 | 9116 | <filename>mcmc/plot_graph.py
# commend the lines for plotting using
import matplotlib.pyplot as plt
import networkx as nx
def plot_graph(G, N, time_point, posi):
#setting up for graph plotting
#setting the positions for all nodes
pos = {}
for ii in range(N):
pos[ii] = posi[ii]
# plt.figure(... | 3.109375 | 3 |
Number Theory/Sieve_of_Eratosthenes.py | mishrakeshav/Competitive-Programming | 2 | 9117 | from sys import stdin
input = stdin.readline
N = int(input())
primes = [1]*(N+1)
primes[0] = 0
primes[1] = 0
for i in range(2,int(N**0.5)+1):
if primes[i]:
for j in range(i*i,N+1,i):
primes[j] = 0
for i in range(N+1):
if primes[i]:
print(i,end = " ")
| 3.40625 | 3 |
powerline/lib/tree_watcher.py | kruton/powerline | 19 | 9118 | <filename>powerline/lib/tree_watcher.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, absolute_import, print_function)
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys
import os
import errno
from time import sleep
from powerline.l... | 2.203125 | 2 |
python/qisys/test/fake_interact.py | PrashantKumar-sudo/qibuild | 0 | 9119 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Fake Interact """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import... | 2.765625 | 3 |
muselsl/cli.py | kowalej/muse-lsl | 2 | 9120 | #!/usr/bin/python
import sys
import argparse
class main:
def __init__(self):
parser = argparse.ArgumentParser(
description='Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset.',
usage='''muselsl <command> [<args>]
Available commands:
... | 2.71875 | 3 |
src/quocspyside2interface/gui/freegradients/GeneralSettingsNM.py | Quantum-OCS/QuOCS-pyside2interface | 1 | 9121 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS Team
#
# 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://ww... | 1.453125 | 1 |
pulsar/datadog_checks/pulsar/check.py | divyamamgai/integrations-extras | 158 | 9122 | <filename>pulsar/datadog_checks/pulsar/check.py
from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheck
EVENT_TYPE = SOURCE_TYPE_NAME = 'pulsar'
class PulsarCheck(OpenMetricsBaseCheck):
"""
PulsarCheck derives from AgentCheck that provides the required check method
"""
def __init__(... | 2.234375 | 2 |
Chapter11/publish_horoscope1_in_another_ipns.py | HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers | 62 | 9123 | import ipfsapi
c = ipfsapi.connect()
peer_id = c.key_list()['Keys'][1]['Id']
c.name_publish('QmYjYGKXqo36GDt6f6qvp9qKAsrc72R9y88mQSLvogu8Ub', key='another_key')
result = c.cat('/ipns/' + peer_id)
print(result)
| 2.09375 | 2 |
magie/window.py | NiumXp/Magie | 1 | 9124 | <filename>magie/window.py<gh_stars>1-10
import pygame
class Window:
def __init__(self, title: str, dimension: tuple):
self.surface = None
self.initial_title = title
self.initial_dimension = dimension
@property
def title(self) -> str:
"""Returns the title of th... | 3.25 | 3 |
tests/optimize/test_newton_raphson_hypo.py | dwillmer/fastats | 26 | 9125 | <gh_stars>10-100
from hypothesis import given, assume, settings
from hypothesis.strategies import floats
from numpy import cos
from pytest import approx
from fastats.optimise.newton_raphson import newton_raphson
def func(x):
return x**3 - x - 1
def less_or_equal(x, compared_to, rel=1e-6):
return ((x < com... | 2.484375 | 2 |
faceRecognition.py | sequery/Face-Recognition-Project | 2 | 9126 | import cv2
import os
import numpy as np
# This module contains all common functions that are called in tester.py file
# Given an image below function returns rectangle for face detected alongwith gray scale image
def faceDetection(test_img):
gray_img = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) # convert color... | 2.921875 | 3 |
evaluation/datasets/build_dataset_images.py | hsiehkl/pdffigures2 | 296 | 9127 | <filename>evaluation/datasets/build_dataset_images.py
import argparse
from os import listdir, mkdir
from os.path import join, isdir
from subprocess import call
import sys
import datasets
from shutil import which
"""
Script to use pdftoppm to turn the pdfs into single images per page
"""
def get_images(pdf_dir, outp... | 3.046875 | 3 |
sympy/physics/__init__.py | utkarshdeorah/sympy | 1 | 9128 | <reponame>utkarshdeorah/sympy
"""
A module that helps solving problems in physics.
"""
from . import units
from .matrices import mgamma, msigma, minkowski_tensor, mdft
__all__ = [
'units',
'mgamma', 'msigma', 'minkowski_tensor', 'mdft',
]
| 1.726563 | 2 |
py.py | avr8082/Hadoop | 0 | 9129 | printf("Hello world")
| 1.25 | 1 |
build/python-env/lib/python2.7/site-packages/elasticsearch/client/xpack/ml.py | imiMoisesEducation/beatcookie-discbot | 1 | 9130 | from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class MlClient(NamespacedClient):
@query_params('from_', 'size')
def get_filters(self, filter_id=None, params=None):
"""
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a num... | 2.375 | 2 |
src/oci/service_catalog/service_catalog_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | 0 | 9131 | <filename>src/oci/service_catalog/service_catalog_client_composite_operations.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apa... | 2.3125 | 2 |
vision/_file_utils.py | BrianOfrim/boja | 7 | 9132 | <filename>vision/_file_utils.py
from typing import List
import os
import re
def create_output_dir(dir_name) -> bool:
if not os.path.isdir(dir_name) or not os.path.exists(dir_name):
print("Creating output directory: %s" % dir_name)
try:
os.makedirs(dir_name)
except OSError:
... | 3.3125 | 3 |
vaccine_allocation/epi_simulations.py | COVID-IWG/epimargin-studies | 0 | 9133 | import dask
import numpy as np
import pandas as pd
from epimargin.models import Age_SIRVD
from epimargin.utils import annually, normalize, percent, years
from studies.vaccine_allocation.commons import *
from tqdm import tqdm
import warnings
warnings.filterwarnings("error")
num_sims = 1000
simulation_range = 1... | 2.15625 | 2 |
src/core/agent_state.py | nandofioretto/py_dcop | 4 | 9134 | '''Every agent has an agent state, which is its local view of the world'''
import numpy as np
import itertools
class AgentState:
def __init__(self, name, agt, seed=1234):
self.name = name
self.prng = np.random.RandomState(seed)
# contains the variable assignment (exploreD) for this agent a... | 3.25 | 3 |
johnny_cache/__init__.py | Sonictherocketman/cache-proxy | 3 | 9135 | from .server import app # noqa
| 1.09375 | 1 |
python_packages_static/flopy/mf6/__init__.py | usgs/neversink_workflow | 351 | 9136 | <gh_stars>100-1000
# imports
from . import coordinates
from . import data
from .modflow import *
from . import utils
from .data import mfdatascalar, mfdatalist, mfdataarray
from .mfmodel import MFModel
from .mfbase import ExtFileAction
| 1.117188 | 1 |
tests/__init__.py | issuu/jmespath | 0 | 9137 | <gh_stars>0
import sys
# The unittest module got a significant overhaul
# in 2.7, so if we're in 2.6 we can use the backported
# version unittest2.
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
import simplejson as json
from ordereddict import OrderedDict
else:
import unittest
im... | 1.929688 | 2 |
src/routes/scoring.py | jtillman20/cfb-data-api | 0 | 9138 | <filename>src/routes/scoring.py
from typing import Union
from flask import request
from flask_restful import Resource
from exceptions import InvalidRequestError
from models import Scoring
from utils import flask_response, rank, sort
class ScoringRoute(Resource):
@flask_response
def get(self, side_of_ball: s... | 3.125 | 3 |
WebPortal/gbol_portal/vars.py | ZFMK/GermanBarcodeofLife | 0 | 9139 | import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option'][... | 1.90625 | 2 |
challenges/Backend Challenge/pendulum_sort.py | HernandezDerekJ/Interview | 0 | 9140 | """
Coderpad solution
"""
def pend(arr):
## arr = [2,3,5,1,4]
## vrr = [0,0,0,0,0]
var = [0] * len(arr)
mid = (len(var) - 1) / 2
## sort_arr = [1,2,3,4,5]
## vrr = [0,0,1,0,0]
sort_arr = sorted(arr)
var[mid] = sort_arr[0]
# ^
# focus... | 3.4375 | 3 |
swagger_server/controllers/threadFactory.py | garagonc/optimization-framework | 0 | 9141 | <gh_stars>0
import os
import configparser
import json
import time
from IO.inputConfigParser import InputConfigParser
from IO.redisDB import RedisDB
from optimization.ModelException import MissingKeysException
from optimization.controllerDiscrete import OptControllerDiscrete
from optimization.controllerMpc import OptC... | 1.945313 | 2 |
ptrace/oop/math_tests.py | xann16/py-path-tracing | 0 | 9142 | <filename>ptrace/oop/math_tests.py<gh_stars>0
"""Unit tests for math-oriented common classes."""
import unittest
import math
import numpy as np
from .vector import Vec3, OrthonormalBasis
from .raycast_base import Ray
from .camera import Camera
class Vec3Tests(unittest.TestCase):
"""Test for Vec3 class."""
... | 2.453125 | 2 |
tests/integration/condition__browser__have_url_test.py | kianku/selene | 0 | 9143 | # MIT License
#
# Copyright (c) 2015-2020 <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, ... | 1.828125 | 2 |
cohesity_management_sdk/models/scheduling_policy.py | chandrashekar-cohesity/management-sdk-python | 1 | 9144 | <reponame>chandrashekar-cohesity/management-sdk-python
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.continuous_schedule
import cohesity_management_sdk.models.daily_schedule
import cohesity_management_sdk.models.monthly_schedule
import cohesity_management_sdk.models.rpo_s... | 2.53125 | 3 |
networking_mlnx/eswitchd/cli/ebrctl.py | mail2nsrajesh/networking-mlnx | 0 | 9145 | #!/usr/bin/python
# Copyright 2013 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2.171875 | 2 |
survos/core/__init__.py | paskino/SuRVoS | 22 | 9146 |
from .launcher import Launcher
from .model import DataModel
from .layers import LayerManager
from .labels import LabelManager
from .singleton import Singleton
| 1.140625 | 1 |
src/FinanceLib/analysis.py | Chahat-M/FinanceLib | 3 | 9147 | from typing import List, Union
import numpy as np
import pandas_datareader as pdr
import pandas as pd
import matplotlib.pyplot as plt
def rsi(symbol :str ,name :str, date :str) -> None :
"""
Calculates and visualises the Relative Stock Index on a Stock of the company.
Parameters:
symbol(str) : Sy... | 3.375 | 3 |
datastore/core/test/test_basic.py | jbenet/datastore | 1 | 9148 | <gh_stars>1-10
import unittest
import logging
from ..basic import DictDatastore
from ..key import Key
from ..query import Query
class TestDatastore(unittest.TestCase):
def subtest_simple(self, stores, numelems=1000):
def checkLength(len):
try:
for sn in stores:
self.assertEqual(len(s... | 3.046875 | 3 |
rooms/models.py | Neisvestney/SentSyncServer | 0 | 9149 | from django.db import models
class Room(models.Model):
code = models.CharField('Code', max_length=128)
tab_url = models.CharField('Tab url', max_length=512, default='', blank=True)
def to_dict(self):
return {
'users': [u.to_dict() for u in self.users.all()],
'tabUrl': self... | 2.328125 | 2 |
colbert/parameters.py | techthiyanes/ColBERT | 421 | 9150 | import torch
DEVICE = torch.device("cuda")
SAVED_CHECKPOINTS = [32*1000, 100*1000, 150*1000, 200*1000, 300*1000, 400*1000]
SAVED_CHECKPOINTS += [10*1000, 20*1000, 30*1000, 40*1000, 50*1000, 60*1000, 70*1000, 80*1000, 90*1000]
SAVED_CHECKPOINTS += [25*1000, 50*1000, 75*1000]
SAVED_CHECKPOINTS = set(SAVED_CHECKPOINTS)... | 2.078125 | 2 |
jarvis/stats.py | aburgd/sheila | 0 | 9151 | <reponame>aburgd/sheila
#!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import pyscp
import textwrap
from dominate import tags as dt
from . import core, lex, ext
... | 2.296875 | 2 |
entry.py | Allenyou1126/allenyou-acme.sh | 0 | 9152 | <filename>entry.py
#!/usr/bin/env python3
import json
from allenyoucert import Cert
def main():
certList = list()
a = json()
main()
| 1.867188 | 2 |
dynts/lib/fallback/simplefunc.py | quantmind/dynts | 57 | 9153 |
from .common import *
def tsminmax(v):
mv = NaN
xv = NaN
for v in x:
if x == x:
if mv == mv:
mv = min(mv,x)
else:
mv = x
if xv == xv:
xv = max(xv,x)
else:
xv = x
retu... | 2.953125 | 3 |
week9/finance/application.py | lcsm29/edx-harvard-cs50 | 0 | 9154 | import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_pa... | 2.296875 | 2 |
users/forms.py | iurykrieger96/alura-django | 0 | 9155 | <filename>users/forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms.utils import ErrorList
class UserForm(forms.Form):
name = forms.CharField(required=True)
email = forms.EmailField(required=True)
password = forms.CharField(required=True)
phone = forms.CharF... | 2.46875 | 2 |
python/manager.py | Kiku-Reise/vsmart | 0 | 9156 | from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, os
from colorama import init, Fore
from time import sleep
init()
n = Fore.RESET
lg = Fore.LIGHTGREEN_EX
r = Fore.RED
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
colors = [lg, r, w, cy, ye]
try:
... | 2.203125 | 2 |
src/m2ee/client_errno.py | rus-kh/m2ee-tools | 23 | 9157 | <reponame>rus-kh/m2ee-tools<filename>src/m2ee/client_errno.py
#
# Copyright (C) 2009 Mendix. All rights reserved.
#
SUCCESS = 0
# Starting the Mendix Runtime can fail in both a temporary or permanent way.
# Some of the errors can be fixed with some help of the user.
#
# The default m2ee cli program will only handle a... | 1.695313 | 2 |
datasets/__init__.py | andrewliao11/detr | 0 | 9158 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch.utils.data
import torchvision
def get_coco_api_from_dataset(dataset_val):
for _ in range(10):
# if isinstance(dataset, torchvision.datasets.CocoDetection):
# break
if isinstance(dataset_val, torch.utils... | 2.265625 | 2 |
dkhomeleague/dkhomeleague.py | sansbacon/dkhomeleague | 0 | 9159 | # dkhomeleague.py
import json
import logging
import os
from string import ascii_uppercase
import pandas as pd
from requests_html import HTMLSession
import browser_cookie3
import pdsheet
class Scraper:
"""scrapes league results"""
def __init__(self, league_key=None, username=None):
"""Creates instan... | 2.96875 | 3 |
Graphing/Example1.py | Wadden12/Semester1 | 0 | 9160 | <gh_stars>0
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2.5 * np.pi * t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('Sine Wave')
plt.grid(True)
plt.show() | 2.953125 | 3 |
Cursoemvideo/desafios/desafio008.py | gentildf/Python | 1 | 9161 | #Escreva um programa que leia um valor em metros e o exiba convertido em centimetros e milimetros.
n = float(input('\033[32mDigite o numero:\033[m'))
print('O número digitado é \033[33m{0:.0f}m\033[m.\n'
'Ele apresentado em centimetros fica \033[33m{0:.2f}cm\033[m.\n'
'Apresentado em milímetros fica \033[33... | 4.0625 | 4 |
publish_fanout.py | Dordoloy/BachelorDIM-Lectures-Algorithms-2019 | 0 | 9162 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 08:47:08 2019
@author: dordoloy
"""
import os
import pika
import config
import getpass
def publish_fanout():
amqp_url=config.amqp_url
# Parse CLODUAMQP_URL (fallback to localhost)
url = os.environ.get('CLOUDAMQP_URL',amqp_url)
params = pika... | 2.734375 | 3 |
orbit/utils.py | xjx0524/models | 0 | 9163 | <<<<<<< HEAD
# Lint as: python3
=======
>>>>>>> a811a3b7e640722318ad868c99feddf3f3063e36
# Copyright 2020 The Orbit 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 ... | 2.40625 | 2 |
python/word-count/word_count.py | whitepeaony/exercism-python | 0 | 9164 | def count_words(sentence):
sentence = sentence.lower()
words = {}
shit = ',\n:!&@$%^&._'
for s in shit:
sentence = sentence.replace(s, ' ')
for w in sentence.split():
if w.endswith('\''):
w = w[:-1]
if w.startswith('\''):
w = w[1:]
words... | 3.640625 | 4 |
examples/multiple_deserializers.py | klauer/apischema | 0 | 9165 | from dataclasses import dataclass
from apischema import deserialize, deserializer
from apischema.json_schema import deserialization_schema
@dataclass
class Expression:
value: int
@deserializer
def evaluate_expression(expr: str) -> Expression:
return Expression(int(eval(expr)))
# Could be shorten into des... | 3.203125 | 3 |
ficheros/CSV/prueba csv (lm)/alumnos.py | txtbits/daw-python | 0 | 9166 | <filename>ficheros/CSV/prueba csv (lm)/alumnos.py<gh_stars>0
# -*- coding: utf-8 -*-
'''
Created on 02/12/2011
@author: chra
'''
import csv
from operator import itemgetter
# ----- Función media de la notas de los alumnos ----------
def media(alumno):
#devuelve la nota media a partir de un diccionario con datos ... | 3.484375 | 3 |
src/interpreter/functions/math/math.py | incrementals/b-star | 2 | 9167 | <reponame>incrementals/b-star
from src.interpreter.functions.math.add import add
from src.interpreter.functions.math.div import div
from src.interpreter.functions.math.mod import mod
from src.interpreter.functions.math.mul import mul
from src.interpreter.functions.math.pow import pow_func
from src.interpreter.functions... | 2.984375 | 3 |
setup.py | monkey2000/pygazetteer | 1 | 9168 | <gh_stars>1-10
from setuptools import setup
setup(name='pygazetteer',
version='0.1.0',
description='Location extractor by looking up gazetteer',
url='https://github.com/monkey2000/pygazetteer',
license='MIT',
packages=['pygazetteer'],
install_requires=[
'pyahocorasick'
... | 1.421875 | 1 |
iqoptionapi/country_id.py | mustx1/MYIQ | 3 | 9169 | <gh_stars>1-10
ID = {"Worldwide":0,
"AF": 1,
"AL": 2,
"DZ": 3,
"AD": 5,
"AO": 6,
"AI": 7,
"AG": 9,
"AR": 10,
"AM": 11,
"AW": 12,
"AT": 14,
"AZ": 15,
"BS": 16,
"BH": 17,
"BD": 18,
"BB": 19,
"BY": 20,
"BZ": 22,
... | 1.148438 | 1 |
pysd/py_backend/external.py | rogersamso/pysd_dev | 0 | 9170 | """
These classes are a collection of the needed tools to read external data.
The External type objects created by these classes are initialized before
the Stateful objects by functions.Model.initialize.
"""
import re
import os
import warnings
import pandas as pd # TODO move to openpyxl
import numpy as np
import xarr... | 3.3125 | 3 |
pirates/piratesgui/ChatBar.py | ksmit799/POTCO-PS | 8 | 9171 | # File: C (Python 2.4)
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from direct.fsm.FSM import FSM
from direct.showbase.PythonUtil import Functor
from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.p... | 1.875 | 2 |
mozmill-env/python/Lib/site-packages/mozlog/logger.py | lucashmorais/x-Bench | 0 | 9172 | <filename>mozmill-env/python/Lib/site-packages/mozlog/logger.py<gh_stars>0
# 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/.
from logging import getLogger as getSysLogger... | 2.34375 | 2 |
CAAPR/CAAPR_AstroMagic/PTS/pts/core/misc/images.py | wdobbels/CAAPR | 7 | 9173 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | 1.914063 | 2 |
venv/Lib/site-packages/rivescript/inheritance.py | Hazemcodes/GimmyBot | 154 | 9174 | # RiveScript-Python
#
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# https://www.rivescript.com/
def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False):
"""Recursively scan a topic and return a list of all triggers.
Arguments:
... | 2.765625 | 3 |
src/dataAccess/Connection.py | mattmillr/utaka | 1 | 9175 | <filename>src/dataAccess/Connection.py
#Copyright 2009 Humanitarian International Services Group
#
#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
... | 2.5625 | 3 |
setup.py | DKorytkin/pylint-pytest | 0 | 9176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as fin:
long_description = fin.read()
setup(
name='pylint-pytest',
version='1.0.3',
author='<NAME>',
... | 1.335938 | 1 |
Shells/Python/Client/TCPReverseShell.py | lismore/OffensiveCyberTools | 1 | 9177 | # Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments
# Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore
#=========================================================================================================================================
# Python... | 2.984375 | 3 |
src/_cffi_src/openssl/engine.py | balabit-deps/balabit-os-6-python-cryptography | 0 | 9178 | <filename>src/_cffi_src/openssl/engine.py<gh_stars>0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#incl... | 1.6875 | 2 |
tests/products/test_products.py | AlexandruScrob/fast_api_proj_2 | 0 | 9179 | <reponame>AlexandruScrob/fast_api_proj_2<gh_stars>0
import pytest
from httpx import AsyncClient
from conf_test_db import app
from tests.shared.info import category_info, product_info
@pytest.mark.asyncio
async def test_new_product():
async with AsyncClient(app=app, base_url="http://test") as ac:
category... | 2.40625 | 2 |
3rdparty/pyviso2/src/viso2.py | utiasSTARS/matchable-image-transforms | 11 | 9180 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | 1.898438 | 2 |
restcord/http.py | Yandawl/restcord.py | 4 | 9181 | # -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import logging
import sys
from typing import Optional
import aiohttp
from aiohttp import ClientSession
from . import __version__
from .errors import (
BadGateway,
BadRequest,
Forbidden,
HTTPException,
InternalServerError,
NotFo... | 2.234375 | 2 |
notes/algo-ds-practice/problems/graph/mother_vertex.py | Anmol-Singh-Jaggi/interview-notes | 6 | 9182 | <reponame>Anmol-Singh-Jaggi/interview-notes
'''
What is a Mother Vertex?
A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v.
How to find mother vertex?
Case 1:- Undirected Connected Graph : In this case, all the vertices are mother vertices as we c... | 3.734375 | 4 |
app/config.py | MoShitrit/kubernetes-controller-example | 0 | 9183 | <filename>app/config.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
class Config:
api_group = os.environ.get('API_GROUP', 'hello-k8s.s5t.dev')
auth_method = os.environ.get("AUTH_METHOD", "cluster")
examples_plural = os.environ.get('API_PLURAL', 'examples')
examples_version = os.environ.get... | 1.835938 | 2 |
mechanical_markdown/parsers.py | greenie-msft/mechanical-markdown | 0 | 9184 | <gh_stars>0
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
"""
import re
import yaml
from html.parser import HTMLParser
from mistune import Renderer
from mechanical_markdown.step import Step
start_token = 'STEP'
end_token = 'END_STEP'
ignore_links_token = 'IGNORE_LINKS'
end_ignore_links_t... | 2.5 | 2 |
cchecker.py | jakepolatty/compliance-checker | 0 | 9185 | <filename>cchecker.py<gh_stars>0
#!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
from compliance_checker.runner import ComplianceChecker, CheckSuite
from compliance_checker.cf.util import download_cf_standard_name_table
from compliance_checker import __version__
def main():
... | 2.53125 | 3 |
apps/articles/cms_apps.py | creimers/djangocms-delete-error | 0 | 9186 | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import gettext as _
class CategoriesAppHook(CMSApp):
name = _("Categories")
def get_urls(self, page=None, language=None, **kwargs):
return ["apps.articles.urls"]
apphook_pool.register(CategoriesA... | 1.921875 | 2 |
bouncer/blacklist/signals.py | sourcelair/bouncer-api | 0 | 9187 | <gh_stars>0
from django.db.models.signals import pre_save
from django.dispatch import receiver
from blacklist import models
from hashlib import sha256
@receiver(pre_save, sender=models.EmailEntry)
def email_entry_handler(sender, instance, **kwargs):
"""
Handler that assigns to lower_case_entry_value the entry... | 2.1875 | 2 |
app/boardgames/migrations/0001_initial.py | collaer/boardgames | 0 | 9188 | # Generated by Django 3.1 on 2020-08-22 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BoardGame',
fields=[
('id', models.AutoField(... | 1.96875 | 2 |
matcher/utils.py | BlueRidgeLabs/slack-meetups | 12 | 9189 | import re
# regex for a user or channel mention at the beginning of a message
# example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>"
# interactive playground: https://regex101.com/r/2Z7eun/2
MENTION_PATTERN = r"(?:^\s?<@(.*?)>\s?)|(?:^\s?<#(.*?)\|.*?>\s?)"
def get_set_element(_set):
"""get the element fr... | 3.25 | 3 |
scripts/quest/q3526s.py | pantskun/swordiemen | 0 | 9190 | # In Search for the Lost Memory [Explorer Thief] (3526)
# To be replaced with GMS's exact dialogue.
# Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere):
# https://kaengouraiu2.blog.fc2.com/blog-entry-46.html
recoveredMemory = 7081
darkLord = 1052001
sm.setSpeakerID(... | 1.554688 | 2 |
student/urls.py | rummansadik/Admission-Automation | 0 | 9191 | from django.contrib.auth.views import LoginView
from django.urls import path
from student import views
urlpatterns = [
path('studentclick', views.studentclick_view, name='student-click'),
path('studentlogin', LoginView.as_view(
template_name='student/studentlogin.html'), name='studentlogin'),
path... | 1.757813 | 2 |
aiida_quantumespresso/parsers/neb.py | lin-cp/aiida-quantumespresso | 0 | 9192 | <gh_stars>0
# -*- coding: utf-8 -*-
from aiida.common import NotExistent
from aiida.orm import Dict
from aiida_quantumespresso.calculations.pw import PwCalculation
from aiida_quantumespresso.parsers import QEOutputParsingError
from aiida_quantumespresso.parsers.parse_raw import convert_qe_to_aiida_structure
from aiida... | 2.046875 | 2 |
foundation/djangocms_submenu/cms_plugins.py | Mindelirium/foundation | 0 | 9193 | <reponame>Mindelirium/foundation
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
class SubmenuPlugin(CMSPluginBase):
model = CMSPlugin
name = _("Submenu")
render_template... | 1.71875 | 2 |
training/horovod/base/horovod_wrapper.py | thehardikv/ai-platform-samples | 418 | 9194 | <reponame>thehardikv/ai-platform-samples
import collections
import datetime
import json
import multiprocessing
import os
import subprocess
import sys
import time
_SSHD_BINARY_PATH = "/usr/sbin/sshd"
EnvironmentConfig = collections.namedtuple(
"EnvironmentConfig",
["hosts", "port", "is_chief", "pools", "job_id... | 2.21875 | 2 |
smaregipy/pos/customer_groups.py | shabaraba/SmaregiPy | 0 | 9195 | import datetime
from pydantic import Field
from typing import (
ClassVar,
List,
Dict,
Optional,
)
from smaregipy.base_api import (
BaseServiceRecordApi,
BaseServiceCollectionApi,
)
from smaregipy.utils import NoData, DictUtil
class CustomerGroup(BaseServiceRecordApi):
RECORD_NAME = 'custo... | 2.3125 | 2 |
StickyDJ-Bot/src/clients/client.py | JCab09/StickyDJ-Bot | 0 | 9196 | #!/usr/bin/env python3
"""
Base-Client Class
This is the parent-class of all client-classes and holds properties and functions they all depend on.
Author: <NAME>
"""
import src.util.debugger as Debugger
import src.util.configmaker as configmaker
class BaseClient(object):
"""Base-Client Class"""
def __init__(... | 3.109375 | 3 |
cryptomon/ascii.py | S0L1DUS/cryptocoinmon | 0 | 9197 | # -*- coding: utf-8 -*-
import sys
from cryptomon.common import Colors
if sys.version_info >= (3, 0):
import io
else:
import StringIO as io
ascii_title = """
/$$$$$$ /$$ /$$ /$$
/$$__ $$ | $$ ... | 2.46875 | 2 |
car & pedestrian_tracker.py | Ishita-2001/Car-And-Pedestrian-prediction | 1 | 9198 | import cv2
video=cv2.VideoCapture(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.mp4')
#pre trained pedestrian and car classifier
car_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\car.xml')
pedestrian_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.x... | 3.234375 | 3 |
saleor/wing/api/serializers.py | glosoftgroup/tenants | 1 | 9199 | <filename>saleor/wing/api/serializers.py<gh_stars>1-10
# site settings rest api serializers
from rest_framework import serializers
from saleor.wing.models import Wing as Table
class TableListSerializer(serializers.ModelSerializer):
update_url = serializers.HyperlinkedIdentityField(view_name='wing:api-update')
... | 2.359375 | 2 |