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 |
|---|---|---|---|---|---|---|
a301/landsat/toa_radiance.py | Pearl-Ayem/ATSC_Notebook_Data | 0 | 12784151 | """
ported from https://github.com/NASA-DEVELOP/dnppy/tree/master/dnppy/landsat
"""
# standard imports
from .landsat_metadata import landsat_metadata
from . import core
import os
from pathlib import Path
import numpy as np
import rasterio
__all__ = ['toa_radiance_8', # complete
'toa_radiance_457',... | 2.28125 | 2 |
fkie_node_manager/src/fkie_node_manager/nmd_client/__init__.py | JOiiNT-LAB/multimaster_fkie | 194 | 12784152 | <filename>fkie_node_manager/src/fkie_node_manager/nmd_client/__init__.py
# Software License Agreement (BSD License)
#
# Copyright (c) 2018, Fraunhofer FKIE/CMS, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | 1.25 | 1 |
makeadditions/transform/llvm/__init__.py | hutoTUM/MakeAdditions | 0 | 12784153 | <reponame>hutoTUM/MakeAdditions<filename>makeadditions/transform/llvm/__init__.py
"""
Import all modules from this directory
Needed for automatic transformer registration
"""
from os.path import dirname, basename, isfile, join
from glob import glob
__all__ = [basename(f)[:-3] for f in glob(join(dirname(__file__), "*.... | 1.84375 | 2 |
desafio021.py | RickChaves29/Desafios-Python | 0 | 12784154 | <reponame>RickChaves29/Desafios-Python
import pygame
pygame.int()
pygame.mixer.music.load('mus.wav')
pygame.mixer.music.play()
pygame.event.wait()
| 2.21875 | 2 |
Logistic_regression_classifier.py | polasha/Logistic-Regression-with-a-Neural-Network-mindset | 0 | 12784155 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
import h5py #s a common package to interact with
# a dataset that is stored on an H5 file.
#from lr_utils import load_dataset
#load datasets
#Load lr_utils for loading train and testinng datasets
def load_dataset():
t... | 3 | 3 |
dagbo/models/gp_factory.py | hgl71964/dagbo | 0 | 12784156 | import botorch
import gpytorch
from torch import Tensor
from gpytorch.kernels.kernel import Kernel
from gpytorch.mlls.exact_marginal_log_likelihood import ExactMarginalLogLikelihood
from gpytorch.priors.torch_priors import GammaPrior
from botorch.models import SingleTaskGP
from botorch.fit import fit_gpytorch_model
fr... | 2.078125 | 2 |
poly2.py | peter-koufalis/quadratic_equation_solver | 0 | 12784157 | import math
def poly2(a,b,c):
''' solves quadratic equations of the
form ax^2 + bx + c = 0 '''
x1 = (-b + math.sqrt(b**2 - 4*a*c))/(2*a)
x2 = (-b - math.sqrt(b**2 - 4*a*c))/(2*a)
return x1, x2
| 3.5 | 4 |
lintcode/41.3.py | jianershi/algorithm | 1 | 12784158 | <reponame>jianershi/algorithm
"""
41. Maximum Subarray
https://www.lintcode.com/problem/maximum-subarray/description?_from=ladder&&fromId=37
continuously check prefix sum
o(n)
"""
import sys
class Solution:
"""
@param nums: A list of integers
@return: A integer indicate the sum of max subarray
"""
... | 3.609375 | 4 |
Lessons/Lesson2.py | MatthewDShen/ComputingInCivil | 0 | 12784159 | <reponame>MatthewDShen/ComputingInCivil
def Sets():
var1 = {3,2.1,'red',2.1}
#gets rid of duplicates
print(var1)
def Dictionaries():
var9 = {'name': 'Julia', 'age': 25, 'hobbies': ['ski', 'music', 'blog']}
var9['name'] #output is Julia
def Index():
var1 = [1,2,3,4,5,6]
print(var1[2]) ... | 3.875 | 4 |
reel_miami/models.py | deadlyraptor/reel-miami | 0 | 12784160 | # models.py
from flask import abort, redirect, request, url_for
from flask_admin import form
from flask_admin.contrib.sqla import ModelView
from flask_security import current_user, RoleMixin, UserMixin
from wtforms import SelectField, TextAreaField
from reel_miami import db
# Database models
class Venue(db.Model):... | 2.3125 | 2 |
tests/test_util.py | briandleahy/embryovision | 0 | 12784161 | import os
import unittest
import torch
import numpy as np
from PIL import Image
from embryovision import util
from embryovision.tests.common import get_loadable_filenames
class TestReadImage(unittest.TestCase):
def test_read_image_returns_numpy(self):
filename = get_loadable_filenames()[0]
image... | 2.546875 | 3 |
bindings/python/idocp/mpc/__init__.py | z8674558/idocp | 43 | 12784162 | from .mpc_quadrupedal_walking import *
from .mpc_quadrupedal_trotting import * | 1.101563 | 1 |
wcm_spiders/philosophers/spiders/plato.py | cakiki/philosophy-graph | 3 | 12784163 | <gh_stars>1-10
import scrapy
class PlatoSpider(scrapy.Spider):
name = 'plato'
start_urls = ['https://plato.stanford.edu/contents.html']
def parse(self, response):
entry_links = response.xpath('//a[contains(@href, "entries")]/@href').getall()
yield from response.follow_all(entry_links... | 2.890625 | 3 |
python/venv/lib/python2.7/site-packages/keystoneauth1/loading/opts.py | sjsucohort6/openstack | 0 | 12784164 | <gh_stars>0
# 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 agreed to in writing, software
# distrib... | 2.03125 | 2 |
clubhub/main/templatetags/add_class.py | geosir/clubhub | 0 | 12784165 | <gh_stars>0
# add_class - A template tag to add the given classes to a DOM object's classes.
from django import template
register = template.Library()
@register.filter(name='add_class')
def addclass(value, arg):
return value.as_widget(attrs={'class': arg})
| 2.375 | 2 |
vis_3d/fusion_3d.py | JHZ-2326/3d_detection_kit | 23 | 12784166 | <gh_stars>10-100
"""
converting between lidar points and image
"""
import numpy as np
class LidarCamCalibration(object):
"""
3x4 p0-p3 Camera P matrix. Contains extrinsic
and intrinsic parameters.
3x3 r0_rect Rectification matrix, required to transform points
... | 2.765625 | 3 |
tests/test_hpoo.py | rubenjf/oo_cli | 0 | 12784167 | <reponame>rubenjf/oo_cli
import unittest
from mock import Mock, patch, call
from oo_client.hpoo import OOClient
import oo_client.errors as errors
class TestHPOO(unittest.TestCase):
"""Unittest tool for hpoo"""
def setUp(self):
pass
@patch('oo_client.hpoo.OORestCaller.put')
@patch('oo_client.... | 2.484375 | 2 |
Q-learning-control/sumo_speed_limit.py | KaguraTart/SUMO-RL-ramp-control | 6 | 12784168 | <reponame>KaguraTart/SUMO-RL-ramp-control
from tqdm import tqdm
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import math
from dateutil.relativedelta import relativedelta
from datetime import datetime, date
import os, sys
import time#绘图图式
plt.rcParams['figure.figsize']=(30,10... | 2.0625 | 2 |
airflow/providers/amazon/aws/example_dags/example_quicksight.py | holly-evans/airflow | 3 | 12784169 | <reponame>holly-evans/airflow
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 1.84375 | 2 |
lambda/ppe_detection_lambda.py | mfakbar/meraki-ppe-detection | 0 | 12784170 | import boto3
import json
import requests
from webex_lambda import *
import io
from PIL import Image, ImageDraw
from pymongo import MongoClient
# AWS access key and secret key
ACCESS_KEY = ""
SECRET_KEY = ""
# Mongo DB database
Database = "mongodb+srv://youraccount:<EMAIL>@<EMAIL>.xxxx.mongodb.net/xxxx" # db name
Clu... | 2.453125 | 2 |
server/toolz_swap_app/migrations/0004_auto_20211211_0853.py | minerva-university/cs162-toolz-swap-service | 0 | 12784171 | <gh_stars>0
# Generated by Django 3.2.9 on 2021-12-11 16:53
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('toolz_swap_app', '0003_auto_20211209_0903'),
]
operations = [
migrations.RemoveField(
... | 1.65625 | 2 |
PySide2extn/examples/rpb/initPos.py | anjalp/PySide2extn | 25 | 12784172 | <reponame>anjalp/PySide2extn
import sys
from PySide2 import QtCore, QtWidgets, QtGui
from PySide2extn.RoundProgressBar import roundProgressBar
class MyWidget(QtWidgets.QWidget):
def __init__(self):
QtWidgets.QWidget.__init__(self)
self.rpb = roundProgressBar()
self.rpb2 = roundProgressBar(... | 2.6875 | 3 |
tv-script-generation/script.py | dmh2000/deep-learning | 0 | 12784173 | import tensorflow as tf
import numpy as np
import helper
import problem_unittests as tests
# Number of Epochs
num_epochs = 2
# Batch Size
batch_size = 64
# RNN Size
rnn_size = 256
# Embedding Dimension Size
embed_dim = 300
# Sequence Length
seq_length = 100
# Learning Rate
learning_rate = 0.001
# Show stats for every ... | 2.609375 | 3 |
glow/test/run_metrics.py | arquolo/ort | 0 | 12784174 | <gh_stars>0
from __future__ import annotations
import torch
from matplotlib import pyplot as plt
from torch import nn
from tqdm.auto import tqdm
import glow.nn
from glow import metrics as m
metrics: tuple[m.Metric, ...] = (
m.Lambda(m.accuracy_),
m.Confusion(
acc=m.accuracy,
accb=m.accuracy_b... | 2.15625 | 2 |
tests/djangokeys/core/djangokeys/test_secret_key.py | alanverresen/django-keys | 0 | 12784175 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Contains tests for accessing env vars as Django's secret key.
import pytest
from djangokeys.core.djangokeys import DjangoKeys
from djangokeys.exceptions import EnvironmentVariableNotFound
from djangokeys.exceptions import ValueIsEmpty
from tests.files import EMPTY_EN... | 2.609375 | 3 |
app.py | LandRegistry-Attic/concept-homepage | 0 | 12784176 | <reponame>LandRegistry-Attic/concept-homepage<gh_stars>0
import os
from flask import Flask, redirect, render_template, request
from flask.ext.basicauth import BasicAuth
import logging
from raven.contrib.flask import Sentry
app = Flask(__name__)
# Auth
if os.environ.get('BASIC_AUTH_USERNAME'):
app.config['BASIC_AU... | 1.90625 | 2 |
examplepackage/tests/test_badmodule.py | dionysisbacchus/python-project-template | 0 | 12784177 | from examplepackage.badmodule import bad_function
def test_bad_function():
assert bad_function(1) == 1
| 1.960938 | 2 |
lib/logic/persistence_handler.py | SBC2000/excel-scripts | 0 | 12784178 | import os
import pickle
from lib.model.model import Model
class PersistenceHandler:
def __init__(self, folder):
self.__model_file_name = os.path.join("model.bin")
def store_model(self, model):
"""
@type model: Model
@return: None
"""
with open(s... | 3.0625 | 3 |
ICPC/10-20-30_1996_A/Cardgame.py | otkaverappa/AdventureOfCode | 0 | 12784179 | <reponame>otkaverappa/AdventureOfCode
import unittest
from collections import deque
class Cardgame:
WIN, LOSS, DRAW = 'Win', 'Loss', 'Draw'
def __init__( self, deckState ):
self.cardDeck = deque( deckState )
self.numberOfTurns = 0
totalSlots = 7
self.cardSlots = list()
for _ in range( totalSlots ):
se... | 3.5 | 4 |
commands/HelpCommand.py | WeeTomatoBall/pentest | 6 | 12784180 | import discord
from commands.framework.CommandBase import CommandBase
class HelpCommand(CommandBase):
def __init__(self):
super(HelpCommand, self).__init__('help')
async def execute(self, client, message, args):
embed = discord.Embed(
title="Help Page",
description="... | 2.65625 | 3 |
jobhunter/admin.py | alexhyang/portfolio | 0 | 12784181 | <reponame>alexhyang/portfolio
from django.contrib import admin
from .models import Posting
# Register your models here.
admin.site.register(Posting) | 1.203125 | 1 |
m2/beats2audio/cli.py | m2march/beats2audio | 0 | 12784182 | <gh_stars>0
import argparse
import sys
import os
import numpy as np
import m2.beats2audio
from m2.beats2audio import create_beats_audio
from m2.beats2audio import defaults, ACCEPTABLE_MP3_SAMPLE_RATES
FORMAT_OPTIONS = ['wav', 'mp3']
def main():
parser = argparse.ArgumentParser(
description=('Produce an a... | 3.078125 | 3 |
plot_results.py | Bhaskers-Blu-Org1/SIC | 12 | 12784183 | from os import listdir
from os.path import isdir, isfile, join
from itertools import chain
import numpy as np
import matplotlib.pyplot as plt
from utils import shelf
def dlist(key, dat):
r"""Runs over a list of dictionaries and outputs a list of values corresponding to `key`
Short version (no checks): ret... | 2.625 | 3 |
utils/wfuzzbasicauthbrute/wfuzz/framework/core/myexception.py | ismailbozkurt/kubebot | 171 | 12784184 |
class FuzzException(Exception):
FATAL, SIGCANCEL = range(2)
def __init__(self, etype, msg):
self.etype = etype
self.msg = msg
Exception.__init__(self, msg)
| 2.390625 | 2 |
test/python/quantum_info/operators/test_measures.py | EnriqueL8/qiskit-terra | 2 | 12784185 | <filename>test/python/quantum_info/operators/test_measures.py
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source ... | 2.3125 | 2 |
cogs/city.py | Greenfoot5/Discord-City | 2 | 12784186 | <filename>cogs/city.py
import discord
from discord.ext import commands
import cairocffi as cairo
from io import BytesIO
import random
import math
def PolarToCartesian(coord):
angle = coord[0]
magnitude = coord[1]
x = magnitude*math.cos(angle)+512
y = magnitude*math.sin(angle)+512
return [x,y]
... | 2.890625 | 3 |
python/qtools/respond.py | ssorj/qtools | 12 | 12784187 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 1.96875 | 2 |
sample_style_img.py | AustinXY/super-res-stylegan2 | 1 | 12784188 | import argparse
import math
import random
import os
import copy
from numpy.core.fromnumeric import resize
import dnnlib
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torch.utils import data
import torch.distributed as dist
from torchvision import trans... | 1.890625 | 2 |
conway.py | dvtate/single-file-programs | 2 | 12784189 | <gh_stars>1-10
from tkinter import *;
from random import randint;
from time import sleep;
WIDTH = 500;
HEIGHT = 500;
# create the cells matrix
def init_cells(window, population):
global HEIGHT;
global WIDTH;
cells = [[0 for x in range(WIDTH)] for y in range(HEIGHT)]; # declare matrix
# populate
for cell i... | 3.390625 | 3 |
pgm/inference/MetropolisHastings.py | koriavinash1/pgm | 4 | 12784190 | <reponame>koriavinash1/pgm
import numpy as np
import math
import pandas as pd
import matplotlib.pyplot as plt
def proposalDistribution(sigma=2):
"""
Describes example proposal distribution
considers gaussion distribution with fixed sigma
as the mean keeps changing it's made an inner func... | 3.609375 | 4 |
remarshal/remarshal.py | sseveran/rules_poetry | 39 | 12784191 | import remarshal
if __name__ == '__main__':
remarshal.main()
| 1.046875 | 1 |
tests/core/trio/test_trio_endpoint_compat_with_asyncio.py | gsalgado/lahja | 400 | 12784192 | <filename>tests/core/trio/test_trio_endpoint_compat_with_asyncio.py<gh_stars>100-1000
import asyncio
import multiprocessing
import pytest
from lahja.asyncio import AsyncioEndpoint
from lahja.common import BaseEvent, ConnectionConfig
class EventTest(BaseEvent):
def __init__(self, value):
self.value = val... | 1.9375 | 2 |
slicer/slicer_internal.py | interpretml/slicer | 23 | 12784193 | """ Lower level layer for slicer.
Mom's spaghetti.
"""
# TODO: Consider boolean array indexing.
from typing import Any, AnyStr, Union, List, Tuple
from abc import abstractmethod
import numbers
class AtomicSlicer:
""" Wrapping object that will unify slicing across data structures.
What we support:
Ba... | 3.171875 | 3 |
getWhalePortfolio.py | J700070/WhalePortfolioAnalyzer | 1 | 12784194 | <reponame>J700070/WhalePortfolioAnalyzer
import requests
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
def getData(holding_ticker):
# Data Extraction
# We obtain the HTML from the corresponding fund in Dataroma.
html = requests.get(
"https://www.dataroma.com/m/holdings.php?... | 3.09375 | 3 |
pylark/api_service_bitable_table_batch_create.py | chyroc/pylark | 7 | 12784195 | # Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class BatchCreateBitableTableReqTable(object):
name: str = attr.ib(
default="", me... | 1.757813 | 2 |
openmdao.gui/src/openmdao/gui/test/functional/pageobjects/component.py | swryan/OpenMDAO-Framework | 0 | 12784196 | import random
import string
from selenium.webdriver.common.by import By
from dialog import DialogPage
from elements import ButtonElement, GridElement, TextElement, InputElement
from workflow import find_workflow_component_figures
from util import ArgsPrompt, NotifierPage
class ComponentPage(DialogPage):
""" Com... | 2.484375 | 2 |
django/prof_education/students/migrations/0003_auto_20210418_0504.py | sergeymirasov/h-edu | 0 | 12784197 | # Generated by Django 3.2 on 2021-04-18 02:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('students', '0002_auto_20210418_0405'),
]
operations = [
migrations.AlterField(
model_name='student',
name='admitted_at... | 1.53125 | 2 |
app/gbi_server/model/log.py | omniscale/gbi-server | 2 | 12784198 | # This file is part of the GBI project.
# Copyright (C) 2013 Omniscale GmbH & Co. KG <http://omniscale.com>
#
# 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/licens... | 1.953125 | 2 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/TessellatedBuildIssueType.py | YKato521/ironpython-stubs | 0 | 12784199 | class TessellatedBuildIssueType(Enum, IComparable, IFormattable, IConvertible):
"""
Issues,which can be encountered while building a polymesh,
or a shell,or a solid from data,describing
tessellated shapes.
enum TessellatedBuildIssueType,values: AllFine (0),DegenOriginalLoop (18),EdgeTraver... | 1.882813 | 2 |
src/models.py | akkapakasaikiran/fooling-NNs | 0 | 12784200 | from torch import nn
class NeuralNetwork(nn.Module):
def __init__(self, h1, h2, num_classes=10, name='NN'):
super().__init__()
self.name = name
self.flatten = nn.Flatten()
self.linear_relu_stack = nn.Sequential(
nn.Linear(28*28, h1),
nn.ReLU(),
nn.Linear(h1, h2),
nn.ReLU(),
nn.Linear(h2, 10)... | 3.28125 | 3 |
osarchiver/destination/db/__init__.py | pcibot/osarchiver | 18 | 12784201 | <reponame>pcibot/osarchiver<filename>osarchiver/destination/db/__init__.py
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The OSArchiver Authors. All rights reserved.
"""
init file that allow to import Db from osarchiver.destination.db whithout
loa... | 1.179688 | 1 |
hqca/opts/gradient/bfgs.py | damazz/HQCA | 0 | 12784202 | <reponame>damazz/HQCA
from hqca.opts.core import *
import numpy as np
from functools import reduce
from copy import deepcopy as copy
from math import pi
from hqca.opts.gradient.linesearch import BacktrackingLineSearch
def para(xs):
# row vector to
return xs.tolist()[0]
class BFGS(OptimizerInstance):
'''
... | 2.75 | 3 |
lib/WindowParent.py | aganders3/python-0.9.1 | 116 | 12784203 | # A 'WindowParent' is the only module that uses real stdwin functionality.
# It is the root of the tree.
# It should have exactly one child when realized.
import stdwin
from stdwinevents import *
from TransParent import ManageOneChild
Error = 'WindowParent.Error' # Exception
class WindowParent() = ManageOneChild():... | 2.625 | 3 |
src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/_help.py | viananth/azure-cli | 0 | 12784204 | <reponame>viananth/azure-cli
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------... | 1.601563 | 2 |
ribosome/rpc/args.py | tek/ribosome-py | 0 | 12784205 | import inspect
from typing import Callable, Any, Tuple, get_type_hints
from amino import Maybe, _, Just, Boolean, Lists, Nothing, Either, L, List, Nil, Map, Left
from amino.dat import Dat
from amino.state import StateT
from amino.util.tpe import first_type_arg, type_arg, is_subclass
from ribosome.rpc.data.nargs impor... | 2.1875 | 2 |
2020/day6/day6.py | dasm/AdventOfCode | 2 | 12784206 | #!/usr/bin/env python3
with open("input") as file_:
lines = file_.read()
groups = lines.split("\n\n")
suma = 0
for group in groups:
group = group.replace("\n", "")
group = set(group)
suma += len(group)
print(suma)
suma = 0
for group in groups:
group = group.split()
result = set(group[0]).in... | 3.625 | 4 |
jobs.py | honmaple/flask-apscheduler | 1 | 12784207 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2017 jianglin
# File Name: jobs.py
# Author: jianglin
# Email: <EMAIL>
# Created: 2017-02-02 14:28:16 (CST)
# Last Update: Sunday 2018-09-30 17:50:05 (CST)
# By:
# Descriptio... | 2.5625 | 3 |
src/unicon/plugins/hvrp/setting.py | mibotiaf/unicon.plugins | 0 | 12784208 | <reponame>mibotiaf/unicon.plugins
"""
Module:
unicon.plugins.hvrp
Authors:
<NAME> (<EMAIL>), <NAME> (<EMAIL>)
Description:
This module defines the HVRP settings to setup the unicon environment required for generic based unicon connection.
"""
from unicon.plugins.generic import GenericSettings
class Hvr... | 1.882813 | 2 |
ansible/roles/lib_gcloud/build/src/gcloud_compute_projectinfo.py | fahlmant/openshift-tools | 164 | 12784209 | # pylint: skip-file
class GcloudComputeProjectInfoError(Exception):
'''exception class for projectinfo'''
pass
# pylint: disable=too-many-instance-attributes
class GcloudComputeProjectInfo(GcloudCLI):
''' Class to wrap the gcloud compute projectinfo command'''
# pylint allows 5
# pylint: disable=... | 2.40625 | 2 |
BOJ/dp_boj/file_sum.py | mrbartrns/swacademy_structure | 0 | 12784210 | <gh_stars>0
# BOJ 11066
import sys
si = sys.stdin.readline
INF = 1e9
t = int(si())
for _ in range(t):
# 챕터의 갯수 및 챕터의 크기를 배열로 만들기
k = int(si())
cost = [0] + list(map(int, si().split()))
# 만들수 있는 최대 배열의 크기로 dp 배열 만들기
dp = [[0 for _ in range(k + 1)] for _ in range(k + 1)]
psum = [0] * 501
f... | 2.453125 | 2 |
setup.py | tarrow/queryCitefile | 0 | 12784211 | #!/usr/bin/env python
from distutils.core import setup
setup(name='queryCitefile',
install_requires=[],
version='0.1',
description='Simple tool to process mwcites output',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/tarrow/queryCiteFile',
py_modules=['que... | 1.203125 | 1 |
src/camera/test_run.py | jphacks/TK_1804 | 1 | 12784212 | <reponame>jphacks/TK_1804
import numpy as np
from head_vector import HeadVector
from select_speakers import SelectSpeakers
if __name__ == '__main__':
face_landmark_path = './src/camera/shape_predictor_68_face_landmarks.dat'
K = [6.523417721418979909e+02, 0.0, 3.240992613348381610e+02,
0.0, 6.314784883... | 1.84375 | 2 |
bfg9000/builtins/find.py | jmgao/bfg9000 | 0 | 12784213 | import fnmatch
import os
import posixpath
import re
from enum import IntEnum
from . import builtin
from ..file_types import File, Directory
from ..iterutils import iterate, listify
from ..backends.make import writer as make
from ..backends.ninja import writer as ninja
from ..backends.make.syntax import Writer, Syntax
... | 2.109375 | 2 |
python/qisys/test/test_worktree.py | aldebaran/qibuild | 51 | 12784214 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Automatic testing for worktree """
from __future__ import absolute_import
from __future__ import unicode_literals
from ... | 2.0625 | 2 |
endorsement/dao/uwnetid_supported.py | uw-it-aca/service-endorsement | 3 | 12784215 | <filename>endorsement/dao/uwnetid_supported.py
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
"""
This module encapsulates the interactions with
the UW NeTID Subscription code 60
"""
import logging
import traceback
from uw_uwnetid.supported import get_supported_resources
from en... | 1.890625 | 2 |
cube5.py | Horia73/MultiCuberX | 0 | 12784216 | <filename>cube5.py
from subprocess import check_output
from time import sleep
import logging
import imutils
import serial
import time
import cv2
global Down, elevator1, elevator2, Up, FlUp, FlDown, coord, l,start,i
start = True
i = 0
l = []
coord = []
log = logging.getLogger(__name__)
Down=True
elevator1=False
medi... | 2.359375 | 2 |
reference_submissions/imagenet/imagenet_pytorch/submission.py | ClashLuke/algorithmic-efficiency | 2 | 12784217 | <gh_stars>1-10
"""Training algorithm track submission functions for ImageNet."""
from typing import Iterator, List, Tuple
import torch
from torch.optim.lr_scheduler import CosineAnnealingLR
from torch.optim.lr_scheduler import LinearLR
from torch.optim.lr_scheduler import SequentialLR
from algorithmic_efficiency impo... | 2.0625 | 2 |
dev/local/optimizers/__init__.py | KeremTurgutlu/fast-kaggle | 8 | 12784218 | <reponame>KeremTurgutlu/fast-kaggle
from .radam import *
from .novograd import *
from .ranger import *
from .ralamb import *
from .rangerlars import *
from .lookahead import *
from .lamb import * | 0.835938 | 1 |
addons/source-python/plugins/warcraft/extensions/levelbank/__init__.py | ThomasVieth/WCS-Remastered | 0 | 12784219 | """
"""
## source.python imports
from commands import CommandReturn
from commands.client import ClientCommand
from commands.say import SayCommand
from listeners import OnClientFullyConnect
## warcraft.package imports
from warcraft.database import session
from warcraft.players import player_dict
## extension impor... | 2.296875 | 2 |
examples/optimizers/swarm/create_ffoa.py | anukaal/opytimizer | 528 | 12784220 | from opytimizer.optimizers.swarm import FFOA
# Creates a FFOA optimizer
o = FFOA()
| 1.460938 | 1 |
converter.py | MelomanCool/telegram-audiomemes | 1 | 12784221 | <gh_stars>1-10
from pydub import AudioSegment
from io import BytesIO
def convert_to_ogg(f):
bio = BytesIO()
(AudioSegment.from_file(f)
.set_channels(1) # for compatibility with Android
.export(bio, format='ogg', codec='libopus'))
bio.seek(0)
return bio
| 2.71875 | 3 |
pypint/solvers/parallel_sdc.py | DiMoser/PyPinT | 0 | 12784222 | # coding=utf-8
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from copy import deepcopy
import warnings as warnings
from collections import OrderedDict
import numpy as np
from pypint.solvers.i_iterative_time_solver import IIterativeTimeSolver
from pypint.solvers.i_parallel_solver import IParallelSolver
from pypint.commu... | 1.976563 | 2 |
base/grouped_estimator.py | palicand/mi-pdd | 0 | 12784223 | <reponame>palicand/mi-pdd<gh_stars>0
import sklearn.base as base
class GroupedEstimator(base.BaseEstimator):
"""GroupedClassifier is meant to group together classifiers
that should run be fitted to the same data. It is meant
to make scoring of many classifiers easier"""
def __init__(self, estim... | 3.046875 | 3 |
minical/__init__.py | grimpy/minical | 0 | 12784224 | from .minical import Calendar
__all__ = ["Calendar"]
| 1.054688 | 1 |
surround/experiment/file_storage_driver.py | agrantdeakin/surround | 1 | 12784225 | import os
import shutil
from .storage_driver import StorageDriver
class FileStorageDriver(StorageDriver):
def __init__(self, path):
super().__init__(path)
os.makedirs(path, exist_ok=True)
def pull(self, remote_path, local_path=None, override_ok=False):
if not self.exists(remote_path):
... | 3.03125 | 3 |
www/server/panel/class/panelAuth.py | mickeywaley/bt_panel_docker_vlome | 0 | 12784226 | <reponame>mickeywaley/bt_panel_docker_vlome<filename>www/server/panel/class/panelAuth.py<gh_stars>0
#coding: utf-8
#-------------------------------------------------------------------
# 宝塔Linux面板
#-------------------------------------------------------------------
# Copyright (c) 2015-2019 宝塔软件(http:#bt.cn) All rights ... | 2 | 2 |
Curso de Cisco/Actividades/Ejemplos de tuplas.py | tomasfriz/Curso-de-Cisco | 0 | 12784227 | # Ejemplo 1
t1 = (1, 2, 3)
for elem in t1:
print(elem)
# Ejemplo 2
t2 = (1, 2, 3, 4)
print(5 in t2)
print(5 not in t2)
# Ejemplo 3
t3 = (1, 2, 3, 5)
print(len(t3))
# Ejemplo 4
t4 = t1 + t2
t5 = t3 * 2
print(t4)
print(t5) | 3.78125 | 4 |
tflmlib/InputData.py | bjascob/SmartLMVocabs | 10 | 12784228 | <reponame>bjascob/SmartLMVocabs<gh_stars>1-10
# Copyright 2018 <NAME>
#
# 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 ... | 2.078125 | 2 |
Week6/pandas-intro.py | aliahari/python-lecture | 1 | 12784229 | <gh_stars>1-10
import pandas as pd
data = pd.read_csv('grades.csv')
data["Total"]= (0.25*data["Final"]+0.75*data["MidTerm"])
print(data)
data.to_csv("new-grades.csv")
| 3.109375 | 3 |
michelson_kernel/docs.py | baking-bad/imichelson | 16 | 12784230 | docs = {
'ABS': 'ABS\nABS :: int : A => nat : A\nObtain the absolute value of an integer',
'ADD': 'ADD\n'
'ADD :: nat : nat : A => nat : A\n'
'ADD :: nat : int : A => int : A\n'
'ADD :: int : nat : A => int : A\n'
'ADD :: int : int : A => int : A\n'
'ADD ::... | 1.945313 | 2 |
primer_moulo/models/models.py | Ghabrielince/demoodoo_20200719 | 0 | 12784231 | # -*- coding: utf-8 -*-
from odoo import models, fields
class MascotasMascotas(models.Model):
_name = "mascotas.mascotas"
# Lista de campos de la tabla.
name = fields.Char(string="Nombre")
tipo_id = fields.Many2one("mascotas.tipos", string="Tipo")
raza_id = fields.Many2one("mascotas.razas", stri... | 2.09375 | 2 |
cottonformation/res/imagebuilder.py | gitter-badger/cottonformation-project | 0 | 12784232 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
This module
"""
import attr
import typing
from ..core.model import (
Property, Resource, Tag, GetAtt, TypeHint, TypeCheck,
)
from ..core.constant import AttrMeta
#--- Property declaration ---
@attr.s
class ImagePipelineImageTestsConfiguration(Property):
"""
AWS O... | 1.984375 | 2 |
all_time_graph.py | JupyterJones/LBRYnomics | 0 | 12784233 | """
Get the timestamps of all claims and plot the cumulative number vs. time!
"""
import datetime
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import requests
import sqlite3
import time
def make_graph(mode, show=True):
"""
mode must be "claims" or "channels"
"""
if mode != ... | 2.609375 | 3 |
localutils/timetools.py | maxmouchet/rtt | 5 | 12784234 | <reponame>maxmouchet/rtt
"""
timetools.py provides functions that perform conversion among these types: second since epoch, string, datetime
"""
import datetime
import pytz
from dateutil.parser import parse
epoch = datetime.datetime.utcfromtimestamp(0)
epoch = epoch.replace(tzinfo=pytz.UTC)
TIME_FORMAT = '%Y-%m-%d %H... | 3.015625 | 3 |
part2/test4.py | ultimus11/Carbon-Emission-Calculator | 4 | 12784235 | <reponame>ultimus11/Carbon-Emission-Calculator<filename>part2/test4.py
import re
import os
import cv2
import time
import pyautogui
import pytesseract
import numpy as np
from PIL import Image
from grabScreen import grab_screen
#Create Black window and show instructions on it
image=np.zeros(shape=[200,800,3],... | 2.984375 | 3 |
Taller 2/S.py | simondavilas/analisis-numerico | 1 | 12784236 | from matplotlib import pyplot as pl
def factorial(n):
if n==0:
return 1
else:
return n*factorial(n-1)
def C(n,i):
return factorial(n)/(factorial(n-i)*factorial(i))
def Spline(n,puntos):
coeficientesx = []
coeficientesy = []
for i in range(n+1):
Coef = C(n,i)
... | 3.28125 | 3 |
wapps/migrations/0007_add_static_page.py | apihackers/wapps | 7 | 12784237 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-12 00:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail.wagtailcore.fields
from wapps.utils import get_image_mo... | 1.726563 | 2 |
tests/test_qrcodes.py | dwisulfahnur/python-xendit-client | 4 | 12784238 | <filename>tests/test_qrcodes.py
from .context import XenditClient, QRCodesClient
def test_qrcode_class():
xendit_client = XenditClient(api_key='apikey')
qrcode = QRCodesClient(xendit_client)
assert qrcode
assert isinstance(qrcode, QRCodesClient)
assert isinstance(qrcode.client, XenditClient)
de... | 2.625 | 3 |
pyorient/ogm/vertex.py | spy7/pyorient | 142 | 12784239 | <reponame>spy7/pyorient
from .element import GraphElement
from .broker import VertexBroker
class Vertex(GraphElement):
Broker = VertexBroker
# TODO
# Edge information is carried in vertexes retrieved from database,
# as OrientBinaryObject. Can likely optimise these traversals
# when we know how to... | 2.578125 | 3 |
embeddings.py | mertkosan/spectral-clustering | 0 | 12784240 | import numpy as np
import scipy.sparse as sp
import datasets
import utils
import argparse
# argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', default='cora', help='Datasets: cora, email, ssets')
parser.add_argument('--version', default='1', help='version for ssets, default 1 for others')
a... | 2.265625 | 2 |
PythonStarter/6_7_1_1.py | fsbd1285228/PythonCodes | 0 | 12784241 | <reponame>fsbd1285228/PythonCodes
'''Programme for Exercise 6.1 - Lists'''
'''write a small database and some code to query it using lists'''
#import numpy
#Construct the List
FriendList = ['Jack','Lucy','Beta','Sophie','Luella','Audrey','Allen','Will','Jason','Ashe']
FriendYear = [1992,1986,1974,1969,1965,1995,2001... | 3.828125 | 4 |
exec_replication.py | takutakahashi/z8r | 0 | 12784242 | <reponame>takutakahashi/z8r<filename>exec_replication.py<gh_stars>0
from lib.k8s import Replication
import subprocess
import os
repl = Replication()
print(repl.make_repl_dataset())
for replset in repl.make_repl_dataset():
src_host, src_pool = replset["master"].split(":")
dst_host, dst_pool = replset["replica"]... | 2.140625 | 2 |
external_push/admin.py | fossabot/fermentrack | 114 | 12784243 | <reponame>fossabot/fermentrack
from django.contrib import admin
from external_push.models import GenericPushTarget, BrewersFriendPushTarget, BrewfatherPushTarget, ThingSpeakPushTarget, GrainfatherPushTarget
@admin.register(GenericPushTarget)
class GenericPushTargetAdmin(admin.ModelAdmin):
list_display = ('name',... | 1.726563 | 2 |
train.py | swapnamoy17/EAST-DenseNet | 0 | 12784244 | <filename>train.py
import time
import os
import io
import shutil
import numpy as np
from PIL import Image
import tensorflow as tf
import argparse
from keras.callbacks import LearningRateScheduler, TensorBoard, ModelCheckpoint, Callback
try:
from keras.utils.training_utils import multi_gpu_model
except ImportError:
... | 2.171875 | 2 |
tasks/__phantom_web_app.py | Dan6erbond/anti-crypto-scammer | 1 | 12784245 | <gh_stars>1-10
import requests
from lib.exponential_runner import run_exponential
from lib.scam_logger import get_logger, get_test_logger
from lib.seed_phrase import generate_curse_seed_phrase
logger = get_logger(__name__.lstrip("tasks."))
root = "https://cloudrun.vercel.app/"
@run_exponential()
def main(runs):
... | 2.390625 | 2 |
conclusion_of_the_squares_in_a_spiral.py | FoxProklya/Step-Python | 0 | 12784246 | <filename>conclusion_of_the_squares_in_a_spiral.py
n = int(input())
max_n = n*n
a = [[0 for j in range(n)] for i in range(n)]
step = 1
i, j = 0, 0
i_min, j_min = 0, 0
i_max, j_max = n, n
while step <= max_n:
while j < j_max: #вправо
a[i][j] = step
j += 1
step += 1
j -=1
i +=1
whi... | 3.484375 | 3 |
_sadm/plugin/skel/__init__.py | jrmsdev/pysadm | 1 | 12784247 | # Copyright (c) <NAME> <<EMAIL>>
# See LICENSE file.
### from _sadm.configure import register
### register(__name__, __file__)
| 1.195313 | 1 |
stores/api/urls.py | ryan-blunden/restful-coffee | 0 | 12784248 | <gh_stars>0
from django.conf.urls import url
from stores.api.views import ClosestStoresList
urlpatterns = [
url(r'^closest/$', ClosestStoresList.as_view(), name='api-closest-stores'),
]
| 1.46875 | 1 |
soup_follow_scraper.py | RonKbS/web_scraping | 0 | 12784249 | # https://teamtreehouse.com/library/everyone-loves-charlotte
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
site_links = []
def internal_links(linkURL):
html = urlopen('https://treehouse-projects.github.io/horse-land/{}'.format(linkURL))
soup = BeautifulSoup(html, 'html.parser')
... | 3.15625 | 3 |
word2vec.py | MirunaPislar/Word2vec | 13 | 12784250 | import glob
import random
import numpy as np
import os.path as op
import cPickle as pickle
from utils.treebank import StanfordSentiment
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import time
# Softmax function, optimized such that larger inputs are still feasible
# softmax(x + c) = softmax... | 2.546875 | 3 |