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 |
|---|---|---|---|---|---|---|
tests/test_lp_objective.py | LovisAnderson/flipy | 25 | 12799251 | <reponame>LovisAnderson/flipy
import pytest
from flipy.lp_objective import LpObjective, Minimize, Maximize
@pytest.fixture
def objective(name='', expression=None, constant=0):
return LpObjective(name, expression, constant)
class TestLpExpression(object):
def test_init(self):
obj = LpObjective(name=... | 2.515625 | 3 |
Packs/SecurityAdvisor/Integrations/SecurityAdvisor/SecurityAdvisor_test.py | diCagri/content | 799 | 12799252 | <reponame>diCagri/content<filename>Packs/SecurityAdvisor/Integrations/SecurityAdvisor/SecurityAdvisor_test.py
import SecurityAdvisor
URL_SUFFIX = 'apis/coachuser/'
BASE_URL = 'https://www.securityadvisor.io/'
CONTEXT_JSON = {
"SecurityAdvisor.CoachUser": {
"coaching_date": "2019-10-04T21:04:19.480425",
... | 1.945313 | 2 |
utils/preprocess.py | jfilter/tmip | 0 | 12799253 | <gh_stars>0
# The preprocessing steps all in one
import logging
import math
import os
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
# Input:
PATH_ARTICLES = '/mnt/data/datasets/newspapers/guardian/articles.csv'
PATH_ORIG_COMMENTS = '/mnt/data/datasets/newspapers/guardian... | 3.15625 | 3 |
planetary_nebula_calculator/radial velocity calculator.py | Woosang-Cho/Planetary_nebula_calculator | 0 | 12799254 | <filename>planetary_nebula_calculator/radial velocity calculator.py
'''
21cm 전파를 보내는 행성상성운과 우리 은하 사이 상대적 속도를 계산합니다.
21cm 전파의 lamda_0 는 5006.84 A 이고,관측된 파장 lamda 와 적색편이 z가 주어졌을 때 시선속도 V_r 은 다음과 같이 주어집니다.
V_r = z * c = (lambda_obsereved - lamda_0/lambda_0)*c
'''
from astropy import constants as const
import math
lambd... | 2.921875 | 3 |
helpers/consts.py | victor-iyiola/folktales | 1 | 12799255 | """
@author <NAME>
A.I. Engineer & Software developer
<EMAIL>
Created on 27 December, 2017 @ 12:40 AM.
Copyright © 2017. Victor. All rights reserved.
"""
import os
APP_NAME = 'folktales'
PROJECT_DIR = os.getcwd()
STATIC_DIR = os.path.join(PROJECT_DIR, 'static')
DATASET_DIR = os.path.join(STATIC_DIR,... | 1.515625 | 2 |
src/settings.py | carlomazzaferro/facet | 0 | 12799256 | RAW_DATA_PATH = 'data/raw'
PROCESSED_DATA_PATH = 'data/processed'
OUTPUT_DATA_PATH = 'data/output'
MODELS_PATH = 'models'
REPORTS_PATH = 'reports'
| 1.125 | 1 |
content/tests/test_models.py | chris64bit/pyEditorial2 | 0 | 12799257 | <gh_stars>0
from content.views import Index
from content.models import BlogCategory, VideocastCategory, PodcastCategory, Blog
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.templatetags.static import static
from django.test import TestCase
import en... | 2.28125 | 2 |
detectionModules/wifi/frame/__init__.py | Impeekay/shop-analytics-pi | 1 | 12799258 | from .main import Frame
| 1.078125 | 1 |
searching/binary_search.py | EashanKaushik/Data-Structures | 0 | 12799259 | # best time compleity- O(1)
# worst time compleity_ O(logn)
# space compleity- O(1)
# use when list is sorted
def binary_search(arr, value):
length = len(arr)
start = 0
end = length - 1
mid = (start + end) // 2
while mid != start:
if arr[mid] == value:
return True
e... | 3.875 | 4 |
polling_stations/apps/data_importers/management/commands/import_basildon.py | smsmith97/UK-Polling-Stations | 29 | 12799260 | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "BAI"
addresses_name = "2021-03-16T14:11:49.270209/Democracy_Club__06May2021.csv"
stations_name = "2021-03-16T14:11:49.270209/Democracy_Club__06May2021.csv"
... | 2.109375 | 2 |
utils.py | reetawwsum/Language-Model | 1 | 12799261 | <reponame>reetawwsum/Language-Model
import os
import zipfile
import numpy as np
import tensorflow as tf
from collections import Counter
class Dataset():
'''Load dataset'''
def __init__(self, config, dataset_type):
self.config = config
self.file_name = os.path.join(config.dataset_dir, config.dataset + '.' + datas... | 2.53125 | 3 |
test/integration/dppl/inference/test_neal_funnel.py | deepppl/stanc3 | 17 | 12799262 | <filename>test/integration/dppl/inference/test_neal_funnel.py
from .harness import MCMCTest, Config
from pprint import pprint
def test_neal_funnel(config=Config()):
test_neal_funnel = MCMCTest(
name='neal_funnel',
model_file='good/neal_funnel.stan',
config=config
)
return test_nea... | 1.765625 | 2 |
python/py_gapic_repositories.bzl | vam-google/rules_gapic | 239 | 12799263 | <filename>python/py_gapic_repositories.bzl<gh_stars>100-1000
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#... | 1.742188 | 2 |
code/mlr_gridsearch.py | xingzix/Membership_Inference | 0 | 12799264 | import csv
import time
import numpy as np
import argparse
import warnings
warnings.filterwarnings('ignore')
from sklearn.preprocessing import scale
from sklearn.model_selection import GridSearchCV
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import train_test_split
from sklearn.feature_... | 2.53125 | 3 |
official/audio/ecapa_tdnn/train_data_prepare.py | mindspore-ai/models | 77 | 12799265 | <reponame>mindspore-ai/models
# Copyright 2022 Huawei Technologies Co., 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 ... | 1.953125 | 2 |
utils/geo.py | ZakariaELHAJOUY/Remote-sensing- | 13 | 12799266 | <gh_stars>10-100
# geo.py
import warnings
from typing import Union, Dict
import numpy as np
from geopandas import GeoDataFrame as GDF
from pandas import DataFrame as DF
import shapely
from shapely.geometry import Polygon
import rasterio.crs
import geopandas as gpd
from tqdm import tqdm
import utils.img
def buffer_... | 2.3125 | 2 |
src/uri/basic/basic_1004.py | gabrielDpadua21/code-challenges | 0 | 12799267 | class SimpleProduct:
def solution(self, value1, value2):
return "PROD = " + str(value1 * value2) | 2.890625 | 3 |
venv/Lib/site-packages/traits/observation/tests/test_expression.py | richung99/digitizePlots | 1 | 12799268 | # (C) Copyright 2005-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 2.28125 | 2 |
backend/lib/tests/transport/test_requests.py | isaiah-solo/Droptalk | 35 | 12799269 | # Copyright 2016 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 agreed to in writing,... | 2.28125 | 2 |
Stats/Scripts/ethnicity_stats.py | cltl/DutchDescriptions | 2 | 12799270 | import csv
import matplotlib.pyplot as plt
# pip install matplotlib-venn
from matplotlib_venn import venn3
with open('../../Data/Annotations/ethnicity.csv') as f:
reader = csv.DictReader(f)
entries = list(reader)
images_per_language = {'dutch': set(), 'german': set(), 'english': set()}
for entry in entries:... | 2.890625 | 3 |
extlinks/settings/local.py | suecarmol/externallinks | 6 | 12799271 | <reponame>suecarmol/externallinks<gh_stars>1-10
from .base import *
from .logging import *
DEBUG = True
SERVER_EMAIL = "Wikilink Local <<EMAIL>>"
DEFAULT_FROM_EMAIL = SERVER_EMAIL
# Django Debug Toolbar config
# ------------------------------------------------------------------------------
# Sometimes, developers ... | 1.898438 | 2 |
GUI_Working/New Folder/loader2.py | mkhuzaima/CS261F21PID39 | 0 | 12799272 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'loader2.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGu... | 2.140625 | 2 |
pose-tools.py | TheDuckCow/pose-tools | 36 | 12799273 | <reponame>TheDuckCow/pose-tools
#### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.... | 1.71875 | 2 |
commands/automated.py | DaleNaci/AUC | 0 | 12799274 | <gh_stars>0
import asyncio
import discord
from discord.ext.commands import Bot
from discord.ext import commands
from discord import Color, Embed
from backend.game_database import GameDatabase
import backend.commands as db
class Automated(commands.Cog):
def __init__(self, bot):
self.bot = bot
sel... | 2.8125 | 3 |
jsymbols.py | agnosticlines/ghidra_kernelcache | 238 | 12799275 | # Symbolicate the kernelcache from jtool2
#@author simo
#@category iOS.kernel
from utils.methods import *
if __name__ == "__main__":
default_file = "test"
fname = askString("Kernelcache symbol file","Symbol file: ",default_file)
f = open(fname,"rb+")
buf = f.read().split('\n')
i = 0
for li... | 2.625 | 3 |
python/test/test_data_types.py | shuuji3/cylon | 0 | 12799276 | ##
# 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
# distributed under the... | 2.078125 | 2 |
scripts/ingests/bdnyc_ingest_photometry.py | zjzhang42/SIMPLE-db | 6 | 12799277 | # Script to add photometry from the BDNYC database into SIMPLE
from astrodbkit2.astrodb import Database, and_
from sqlalchemy import types # for BDNYC column overrides
verbose = True
# --------------------------------------------------------------------------------------
# Establish connection to databases
# Note ... | 2.09375 | 2 |
ope-backend/src/domain/dto/__init__.py | mthora/ope-talos | 0 | 12799278 | from .user_dto import User
from .drink_dto import Drinks
from .dessert_dto import Dessert
from .role_dto import Roles | 1.101563 | 1 |
algorithms/problems/max_min.py | JohnnyB0Y/code-playground | 0 | 12799279 | # -*- coding: utf-8 -*
# count.py
#
#
# Created by JohnnyB0Y on 2021/07/11.
# Copyright © 2021 JohnnyB0Y. All rights reserved.
def domain():
# 0 1 2 3 3 5 12 4
strs = ["", "a", "aa", "aba", "baaa", "baaabd", "kkkfcddddddcfkabckkl", "aaaabcdefghijj... | 3.28125 | 3 |
encoding/byte_conversion.py | metro-source/arctic-ledger | 0 | 12799280 | def to_n_bits(input, input_bits = 8, output_bits = 5):
"""
Convert an array of N-bits integer into an array of N'-bits integers
"""
carry = 0
bits_count = 0
output = []
for number in input:
carry = carry << input_bits
carry += number
bits_count += input_bits
... | 4.0625 | 4 |
newspaper/spiders/indian_express.py | nit-in/news-paper | 1 | 12799281 | #!/usr/bin/python3
import scrapy
from yarl import URL
from datetime import datetime
import json
import newspaper.spiders.config as config
from newspaper.spiders.generate_links import generate_links as generate
from newspaper.spiders.makepdf import make_pdf
class IndianExpressSpider(scrapy.Spider):
name = "indian_... | 2.765625 | 3 |
events/utils.py | Kromey/akwriters | 1 | 12799282 |
def event_key(event):
try:
return event['start']['dateTime']
except KeyError:
return event['start']['date']
| 2.140625 | 2 |
discord_api/low/gateway.py | tasuren/discord-api.py | 1 | 12799283 | import sys
from ..gateway import KeepAlive
class DiscordGateway:
def __init__(self, client, ws):
self.ws = ws
self.token = client.token
self.client = client
self.closed = self.ws.closed
@classmethod
async def start_gateway(cls, client):
url = await client.re... | 2.5 | 2 |
lesson13/lixuebin/reboot/users/user/__init__.py | herrywen-nanj/51reboot | 0 | 12799284 | from django.shortcuts import render
from django.contrib.auth.hashers import make_password
from django.contrib.auth import authenticate, login, logout
from django.views.generic import View, ListView, DetailView,TemplateView
from django.urls import reverse
from django.http import HttpResponseRedirect,HttpRequest, HttpRes... | 2.0625 | 2 |
blog/urls.py | mayur256/MSc-Sem-2-Project | 0 | 12799285 | from django.conf.urls import url
from blog import views
from django.conf import settings
from django.conf.urls.static import static
app_name="blog"
urlpatterns = [
url(r'(?P<id>\d+)/post_edit/$', views.post_edit, name="post_edit"),
url(r'(?P<reqid>\d+)/(?P<proid>\d+)/(?P<posid>\d+)/(?P<comid>\d+)/report/$', vie... | 2.03125 | 2 |
scripts/er_unmatched_test.py | neurodata/bilateral-connectome | 2 | 12799286 | <filename>scripts/er_unmatched_test.py
#%% [markdown]
# # Density test
# Here, we compare the two unmatched networks by treating each as an Erdos-Renyi network
# and simply compare their estimated densities.
#%% [markdown]
# ## The Erdos-Renyi (ER) model
# The [**Erdos-Renyi (ER) model**
# ](https://en.wikipedia.org/w... | 3 | 3 |
inversetoon/geometry/polyline.py | tody411/InverseToon | 4 | 12799287 | # -*- coding: utf-8 -*-
## @package inversetoon.geometry.polyline
#
# Implementation of 2D polyline.
# @author tody
# @date 2015/08/12
import numpy as np
from inversetoon.geometry.bounding_box import BoundingBox
from inversetoon.geometry.line import Line
from inversetoon.util.timer import timing_func
fr... | 2.8125 | 3 |
localizacao/tests/test_viewsets_cidade.py | WesGtoX/agro-digital | 0 | 12799288 | from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase, APIClient
from .fixture import RegiaoFactory, CidadeFactory
User = get_user_model()
class CidadeViewSetTest... | 2.296875 | 2 |
HHBK_2020/D.py | i14kawanaka/AtCoder | 0 | 12799289 | <reponame>i14kawanaka/AtCoder
import numpy as np
def big(a, b):
if(a > b):
return a
return b
def small(a, b):
if(a > b):
return b
return a
def bbb(a,b):
if(a>b):
return (a-b+1)**2
return(b-a+1)**2
def sisumi(a,b):
if(a>b):
return (a-b+1)
def abs(a):
i... | 3.0625 | 3 |
imageledger/migrations/0011_auto_20161205_1424.py | creativecommons/open-ledger | 46 | 12799290 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-05 14:24
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('imageledger', '0010_auto_20161130_1814'),
]
operations = [
migrations.AlterModelOpt... | 1.5 | 2 |
abbrmap.py | BrickSchema/reconciliation-api | 7 | 12799291 | <reponame>BrickSchema/reconciliation-api<gh_stars>1-10
abbrmap = {
"ahu": ["air", "handler", "unit"],
"vav": ["variable", "volume", "box"],
"fcu": ["fan", "coil", "unit"],
"avg": ["average"],
"cmd": ["command"],
"elec": ["electrical"],
"equip": ["equipment"],
"freq": ["frequency"],
"... | 1.507813 | 2 |
algo/tools/converters.py | alexeyev/visartm | 1 | 12799292 | <filename>algo/tools/converters.py
import os
class UciReader:
def __init__(self, docword_file, vocab_file, logger=None):
self.logger = logger
self.log("Start UciReader...")
self.vocab = dict()
with open(vocab_file, "r", encoding="utf-8") as f:
i = 1
for line... | 2.671875 | 3 |
multipleStrategy/pairTradeMultiple.py | sharmaking/CoIntegrationAnalysis | 1 | 12799293 | <filename>multipleStrategy/pairTradeMultiple.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#pairTradeMultiple.py
import baseMultiple
import csv, copy, datetime, numpy as np
class CPairTradeMultiple(baseMultiple.CBaseMultiple):
#------------------------------
#继承重载函数
#------------------------------
#自定义初始化函数
def cu... | 2.390625 | 2 |
TFTP_Server.py | YoucTagh/Network_TFTP | 1 | 12799294 | <gh_stars>1-10
# Python 3!
import socket
import os
import re
import _thread
def TraitNewConnection(ConnexionAUnClient,addrclient):
# Acceder au repertoire racine
os.chdir(Chemin_racine)
print("Connexion de la machine = ", addrclient)
while True:
# Format des commandes transmis par le... | 2.75 | 3 |
ttics.py | ischurov/ttics | 1 | 12799295 | <filename>ttics.py
from flask import (Flask, render_template, abort, send_from_directory,
url_for, g, request, jsonify, redirect, make_response)
import requests
import re
import datetime
from icalendar import Calendar, Event, vText
import qrcode
import qrcode.image.svg
from io import BytesIO
app = ... | 2.484375 | 2 |
Epatient/middleware.py | topdeveloper424/epatient-django | 5 | 12799296 | <reponame>topdeveloper424/epatient-django
import re
from django.conf import settings
from django.shortcuts import redirect
from django.contrib.auth import logout
class LoginRequiredMiddleware:
def __init__(self,get_response):
self.get_response = get_response
def __call__(self,request):
res... | 2.015625 | 2 |
scripts/darwinizer.py | marcelooyaneder/Darwin-Connect | 0 | 12799297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pickle
import pandas as pd
import easygui as eg
from collections import defaultdict
from PyQt5 import QtCore as qtc
class file_entry():
def __init__(self,route_response_label,route_destiny_label):
self.route_response_label=route_response_labe... | 2.796875 | 3 |
source/sample_types.py | arimakaoru/CameraSystem | 0 | 12799298 | <reponame>arimakaoru/CameraSystem
#!/usr/bin/env python
# coding: utf-8
# 色に関する定義
class Color():
# 色コード
UNKNOWN = 0
RED = 1
GREEN = 2
BLUE = 3
BLACK = 4
YELLOW = 5
# 色コードから表示用文字列への変換メソッド
def toColorName(code):
COLOR_NAME = {
Color.UNKNOWN: "Unknown",... | 2.90625 | 3 |
opticalFlow/deepvel/training/testFConv.py | aasensio/DeepLearning | 0 | 12799299 | <filename>opticalFlow/deepvel/training/testFConv.py
import numpy as np
import matplotlib.pyplot as pl
import h5py
import platform
import os
import json
import sys
import argparse
import scipy.ndimage as nd
import pickle
import scipy.io as io
from ipdb import set_trace as stop
if (platform.node() == 'viga'):
os.env... | 2.03125 | 2 |
falcon-sandbox/falcon-sandbox/falcon-sandbox.py | chemberger/stoq-plugins-public | 1 | 12799300 | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics 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
#
# Un... | 1.890625 | 2 |
1.py | songlinyang/vue-test-project | 0 | 12799301 | <filename>1.py
# 1. 给一个数组,统计每个字母出现次数,并按照出现次数排序(不限制语言);
# EG:
# [a,a,c,b,d,c,c,c,d,d]
# {c:4,d:3,a:2,b:1}
# 2. 常用的Linux命令是什么,如何查看日志?使用shell命令过滤出日志中的ERROR出现的次数;
# 1题
arry_list = ["a","a","c","b","d","c","c","c","d","d"]
def programFun(arry_list):
set_result = set(arry_list)
results = {}
for str in set_re... | 2.703125 | 3 |
.travis/docs_post_process.py | goerz/bibdeskparser | 0 | 12799302 | <filename>.travis/docs_post_process.py<gh_stars>0
#!/usr/bin/env python
from pathlib import Path
import subprocess
from versions import get_versions_data, write_versions_json
INDEX_HTML = r'''<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="0; url={default_branch}" />
</head>
<body>
<p>... | 2.4375 | 2 |
thermostat/capture.py | baldingwizard/thermostatpi | 1 | 12799303 | <reponame>baldingwizard/thermostatpi<gh_stars>1-10
from subprocess import call
import time
image=100000
while True:
call(["cp", "ramdisk/ui.png", "ramdisk/ui_"+str(image)+".png"])
time.sleep(0.2)
image = image + 1
| 2.1875 | 2 |
training_codes/biophys2lifmodel_ll/plot_tot_f_rate_from_list.py | zqwei/LIF_Vis_model | 0 | 12799304 | import numpy as np
import matplotlib.pyplot as plt
#for grating_id_start in [7, 8]:
# for grating_id in xrange(grating_id_start, 240, 30):
# f_list = []
# for i in xrange(0, 10):
# f_list.append('output_ll1_g%d_%d/tot_f_rate.dat' % (grating_id, i))
for k1 in [278]: #[0]:
for k2 in xrange(8, 240, 30):... | 2.46875 | 2 |
src/sage/geometry/polyhedron/all.py | bopopescu/sage | 5 | 12799305 |
from sage.misc.lazy_import import lazy_import
lazy_import('sage.geometry.polyhedron.constructor', 'Polyhedron')
lazy_import('sage.geometry.polyhedron.library', 'polytopes')
| 1.210938 | 1 |
fancy_todo_list/application/entities/__init__.py | rcmendes/fancy_todo_list | 1 | 12799306 | <filename>fancy_todo_list/application/entities/__init__.py
from .base import RefId
from .user import Username, User
# from .task import Title, Task
| 1.117188 | 1 |
Wyklad/OOP/OrganismTest.py | tborzyszkowski/PythonWorld | 3 | 12799307 | from Position import Position
from Sheep import Sheep
from Grass import Grass
if __name__ == '__main__':
grass = Grass(position=Position(10, 10))
sheep = Sheep(position=Position(-10, -10))
for i in range(0,10):
print('-- Iteration {0} --'.format(i))
grass.move()
print(grass)
... | 3.421875 | 3 |
src/ecommerce/products/views.py | Suyen-Shrestha/Ecommerce | 0 | 12799308 | from django.views.generic import ListView, DetailView
from django.shortcuts import render, get_object_or_404
from analytics.mixins import ObjectViewedMixin
from carts.models import Cart
from .models import Product
from django.http import Http404
class ProductFeaturedListView(ListView):
template_name = "product... | 2.03125 | 2 |
xcparse/Xcode/BuildSystem/clangcompiler.py | samdmarshall/xcparser | 59 | 12799309 | import os
from .xccompiler import *
from ...Helpers import logging_helper
from ...Helpers import xcrun_helper
from ...Helpers import path_helper
class clangcompiler(xccompiler):
def __init__(self, compiler, config_dict):
super(clangcompiler, self).__init__(compiler, config_dict);
def build(se... | 2.015625 | 2 |
log2tex.py | bhzunami/Immo | 5 | 12799310 | <filename>log2tex.py
import pdb
import re
"""
"""
STOP_WORDS = ["mean living area", "Renovation", "Noise level", "Outlier detection", "Steuerfuss",
"Tags gruppieren", "Stacked model", "Without Tags"]
STATS_WORD = ["R²-Score:", "MAPE:", "MdAPE:", "Min", "Max", "Max", "Mean", "Median", "Mean"]
regex = ... | 2.46875 | 2 |
mlxtend/mlxtend/text/tests/test_generalize_names.py | WhiteWolf21/fp-growth | 0 | 12799311 | import sys
if sys.version_info < (3, 0):
from nose.plugins.skip import SkipTest
raise SkipTest
from mlxtend.text import generalize_names
def test_generalize_names():
assert(generalize_names("<NAME>") == 'etoo s')
assert(generalize_names("Eto'o, Samuel") == 'etoo s')
assert(generalize_names("Eto... | 2.125 | 2 |
tools/get_efi_images.py | fengjixuchui/UEFI_RETool | 240 | 12799312 | <filename>tools/get_efi_images.py<gh_stars>100-1000
# SPDX-License-Identifier: MIT
import glob
import os
import pathlib
import re
import shutil
import colorama
import uefi_firmware
from .guid_db import UEFI_GUIDS
DIR_NAME = "all"
PE_DIR = "modules"
g_re_guid = re.compile(
r"file-[0-9a-f]{8}-[0... | 2.28125 | 2 |
nanoretrotect/nanoretrotect.py | wdecoster/nanoretrotect | 0 | 12799313 | from nanoget import get_input
from argparse import ArgumentParser
from nanoplot import utils
from .version import __version__
from nanoplotter import check_valid_time_and_sort, Plot
from os import path
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
def main():
args = get_args()
merge... | 2.5 | 2 |
angr/analyses/decompiler/__init__.py | zhu8655/angr | 0 | 12799314 | <reponame>zhu8655/angr
from .region_identifier import RegionIdentifier
from .structurer import Structurer
from .structured_codegen import StructuredCodeGenerator
from .clinic import Clinic
from .region_simplifier import RegionSimplifier
from .decompiler import Decompiler
from .decompilation_options import options, opti... | 0.898438 | 1 |
ymz294lib/sequencer.py | kinokorori/rpi_psg_mml | 3 | 12799315 | # -*- coding:utf-8 -*-
import ymz294
import mml
import time
class Sequencer:
# initialize.
# @param psgplayer ymz294.PSGPlayer instance
def __init__(self, psgplayer):
self.psgplayer = psgplayer
# play sound by MML string
# @param chA_MML a MML string for PSG channel A
# @param chB... | 2.484375 | 2 |
pants_jupyter_plugin/__init__.py | Kludex/pants-jupyter-plugin | 7 | 12799316 | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Jupyter support for Pants projects and PEX files.""" # N.B.: Flit uses this as our distribution description.
__version__ = "0.0.4" # N.B.: Flit uses this as our distribution version.... | 1.21875 | 1 |
main.py | hpharmsen/antology | 0 | 12799317 | import random
import arcade
from ant import Ant
from colony import Colony
# TODO
# - Food blobs 2x zo groot
# - Food blobs droppen met muis
# - Food blob coo is altijd centrale coo
# - Lijn tekenen bij backtrack
from settings import settings
class Arena(arcade.Window):
def __init__(self, width, height, title, ge... | 2.546875 | 3 |
src/data/MakeDataset.py | georgezefko/fish_classifier | 0 | 12799318 | <filename>src/data/MakeDataset.py
import gdown
import zipfile
from pathlib import Path
class MakeDataset():
"""
A class that handles everything related to getting
and setting up the training and test datasets
...
Methods
-------
download_data()
Downloads the data from Google Drive... | 3.046875 | 3 |
src/gui/tkinter/button_gui.py | E1mir/PySandbox | 0 | 12799319 | import tkinter
from tkinter import messagebox
from tkinter import Button
window = tkinter.Tk()
HEIGHT = window.winfo_height()
WIDTH = window.winfo_width()
print(f'Height: {HEIGHT}, Width: {WIDTH}')
def click_button():
msg = messagebox.showinfo("Hello!", "You clicked a button!")
# initializing button
button_widg... | 4.21875 | 4 |
python/dataloader2D.py | JakubicekRoman/CTDeepRot | 4 | 12799320 | import numpy as np
import matplotlib.pyplot as plt
from IPython.core.debugger import set_trace
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import glob
import os
from skimage.io import imread
from skimage.transform import resize
from torch.utils import data
import os... | 2.265625 | 2 |
app.py | aws-samples/monorepo-multi-pipeline-trigger | 4 | 12799321 | #!/usr/bin/env python3
from aws_cdk import (core as cdk)
from core.monorepo_stack import MonorepoStack
from core.pipelines_stack import PipelineStack
app = cdk.App()
core = MonorepoStack(app, "MonoRepoStack")
PipelineStack(app, "PipelinesStack", core.exported_monorepo)
app.synth()
| 1.5 | 2 |
platzi/Conversor.py | diegosish/Introduction-Python | 0 | 12799322 | Pesos = input("¿Cuántos Pesos Colombianos tiene?: ")
Pesos = float(Pesos)
v_Dolar = 4033
Dolares = Pesos / v_Dolar
Dolares = str(Dolares)
print("Tienes $" + Dolares + " Dolares") | 3.65625 | 4 |
test_data/parse/unexpected/property_definitions/without_type_annotation/meta_model.py | gillistephan/aas-core-codegen | 5 | 12799323 | <reponame>gillistephan/aas-core-codegen<gh_stars>1-10
class Something:
some_property = 3
__book_url__ = "dummy"
__book_version__ = "dummy"
| 1.03125 | 1 |
algorithms/uglyNumberII/uglyNumberII.py | zhyu/leetcode | 5 | 12799324 | <gh_stars>1-10
class Solution(object):
def nthUglyNumber(self, n):
"""
:type n: int
:rtype: int
"""
h = [1]
s = set([1])
while n > 1:
now = heapq.heappop(h)
for k in (2, 3, 5):
nxt = now * k
if nxt not in... | 2.953125 | 3 |
draw_art_random.py | DevopediaOrg/python-for-kids | 2 | 12799325 | <reponame>DevopediaOrg/python-for-kids
import sys
import random
from PIL import Image, ImageDraw
config = {
'count' : 10,
'color' : {
'random' : True,
'fixed' : (180, 10, 240)
},
'shape' : 'rectangle'
}
img = Image.new("RGB", (400, 400), '#fff')
draw = ImageDraw.Draw(img)
for _ in rang... | 3.515625 | 4 |
test_scripts/GUI_test/GUI_pyqt5graph_test.py | apokhr/PumpProbe-analysis | 0 | 12799326 | <reponame>apokhr/PumpProbe-analysis
from PyQt5 import QtGui, QtCore # (the example applies equally well to PySide)
import sys
import pyqtgraph as pg
import numpy as np
## Always start by initializing Qt (only once per application)
#app = QtGui.QApplication([])
app = QtCore.QCoreApplication.instance()
if app is None:... | 2.515625 | 3 |
apps/consumer_portrait/rs.py | mayi140611/mayiutils | 0 | 12799327 | <filename>apps/consumer_portrait/rs.py
#!/usr/bin/python
# encoding: utf-8
"""
@author: Ian
@contact:<EMAIL>
@file: rs.py
@time: 2019/3/16 18:32
采用无监督的方式做, 通过估算正态分布
"""
from surprise import NormalPredictor
from surprise import Dataset, Reader
from surprise.model_selection import cross_validate
import pandas as pd
i... | 2.34375 | 2 |
polls/models.py | gurupratap-matharu/polls | 0 | 12799328 | import datetime
import uuid
from django.contrib.auth import get_user_model
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
from taggit.models import GenericUUIDTaggedItemBa... | 2.21875 | 2 |
problems/B/AAndBAndCompilationErrors.py | deveshbajpai19/CodeForces | 55 | 12799329 | <filename>problems/B/AAndBAndCompilationErrors.py
__author__ = '<NAME>'
'''
https://codeforces.com/problemset/problem/519/B
Solution: Calculate the sum of each round of errors. The difference of first and second will give the error resolved
by second round. Similarly, the difference of second and third will give the ... | 3.46875 | 3 |
study/day02_spider/03_urllib2_authproxyhandler.py | Youngfellows/HPython2-Spider | 0 | 12799330 | <filename>study/day02_spider/03_urllib2_authproxyhandler.py
# coding=utf-8
import urllib2
# 设置代理
# authproxy_handler = urllib2.ProxyHandler({"http": "mr_mao_hacker:[email protected]:16816"})
authproxy_handler = urllib2.ProxyHandler({"http": "192.168.3.11:9000"})
# authproxy_handler = urllib2.ProxyHandler({"h... | 2.609375 | 3 |
tests/unit/__init__.py | Informasjonsforvaltning/fdk-baseregistries-publisher | 0 | 12799331 | <reponame>Informasjonsforvaltning/fdk-baseregistries-publisher
"""Unit test package.
Modules:
test_fdk_baseregistries_service
"""
| 0.835938 | 1 |
python/py-itertools/itertools-combinations.py | PingHuskar/hackerrank | 41 | 12799332 | <reponame>PingHuskar/hackerrank<filename>python/py-itertools/itertools-combinations.py
# Python > Itertools > itertools.combinations()
# Print all the combinations of a string using itertools.
#
# https://www.hackerrank.com/challenges/itertools-combinations/problem
#
from itertools import combinations
s, n = input().... | 4.125 | 4 |
database_tools/update_SATCAT_UCS_from_source.py | cameronfr/trusat-backend | 21 | 12799333 | <gh_stars>10-100
#!/usr/bin/env python
from hashlib import md5
import os
import sys
# The following 4 lines are necessary until our modules are public
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.insert(1,os.path.dirname(currentdir))
import database
f... | 2.40625 | 2 |
openapi-demo.py | minweiwei/LoadMaster.OpenAPI.python | 0 | 12799334 | <gh_stars>0
import json
import requests
if __name__ == '__main__':
response = requests.post('https://api.zhuangxiang.com/connect/token', data={ # URL
'client_id': 'your app id', # 填写app-id、app-secret、账号及密码
'client_secret': 'your app secret',
'grant_type': 'password',
'username': 'y... | 2.40625 | 2 |
src/services/monolithic/hardware_abstraction/pin.py | IAPark/PITherm | 0 | 12799335 | import RPi.GPIO as GPIO
class Pin:
def __init__(self, pin_id):
self.pin_id = pin_id
self.state = Off
GPIO.setmode(GPIO.BCM)
def sense(self):
GPIO.setup(self.pin_id, GPIO.IN)
output = GPIO.input(self.pin_id)
self.state = output
return output
def set... | 3.140625 | 3 |
scripts/mybgg/models.py | boglesby03/mybgg | 0 | 12799336 | <filename>scripts/mybgg/models.py
from decimal import Decimal
from datetime import datetime
import html
import re
articles = ['A', 'An', 'The']
class BoardGame:
def __init__(self, game_data, collection_data, expansions=[], accessories=[]):
self.id = game_data["id"]
name = collection_data["name"]... | 2.609375 | 3 |
killerbee/openear/__init__.py | Acesonnall/killerbee | 59 | 12799337 |
#import string
#import socket
#import struct
#import bitstring
from capture import *
| 1.070313 | 1 |
utils/tool.py | zyxbend/TinyUnet | 2 | 12799338 | # 多个文件中要用到的函数之类的统一写在这里
from skimage.measure import label
import numpy as np
import copy
# 如果最大连通域面积小于2000,直接认为分割错误,返回无分割结果,反之保留面积最大连通域,如果面积第二大连通域和最大差不多,则两个都保留
def refine_output(output):
refine = np.zeros((1280, 2440), dtype=np.uint8)
if len(np.where(output > 0)[0]) > 0:
output = label(output)
... | 2.90625 | 3 |
signature/signature_examples.py | hughluo/py_metaprogramming | 2 | 12799339 | from signature import Structure, add_signature
class SpamTheOldWay:
def __init__(self, name, price):
self.name = name
self.price = price
@add_signature("name", "price")
class Spam(Structure):
pass
if __name__ == "__main__":
spam_0 = Spam(price=0.618, name="wexort")
print(spam_0.nam... | 3.09375 | 3 |
examples/filter_plugins/__init__.py | bodsch/ansible-plugins | 9 | 12799340 | from bool_filters import *
from dict_filters import *
from hash_filters import *
from list_filters import *
from version_filters import *
from string_filters import *
from datetime_filters import *
| 1.078125 | 1 |
dataCollect.py | chaosWsF/AI-Chinese-A-shares | 0 | 12799341 | import os
import shutil
import arrow
import glob
def get_date_range(start, end):
"""get the date range of the used months"""
start = start[:4] + '-' + start[4:]
startdate = arrow.get(start)
end = end[:4] + '-' + end[4:]
enddate = arrow.get(end)
return arrow.Arrow.range('month', startdate, endd... | 2.765625 | 3 |
oclubs/access/siteconfig.py | zhuyifei1999/oclubs | 13 | 12799342 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
"""Module to access site configuration in siteconfig.ini."""
from ConfigParser import ConfigParser
from flask import g
FILENAME = '/srv/oclubs/siteconfig.ini'
def _done(commit=True):
if g.get('siteconfigParser', None):
if commit:
if g.get('s... | 2.6875 | 3 |
library_test.py | tdd-laboratory/tdd-homework-tsaicharit | 0 | 12799343 | import unittest
import library
NUM_CORPUS = '''
On the 5th of May every year, Mexicans celebrate Cinco de Mayo. This tradition
began in 1845 (the twenty-second anniversary of the Mexican Revolution), and
is the 1st example of a national independence holiday becoming popular in the
Western Hemisphere. (The Fourth of Ju... | 3.546875 | 4 |
src/tanuki/database/database.py | M-J-Murray/tanuki | 0 | 12799344 | <filename>src/tanuki/database/database.py
from __future__ import annotations
from types import TracebackType
from typing import Any, cast, Optional, Type, TYPE_CHECKING, TypeVar
from tanuki.data_store.column_alias import ColumnAlias
from tanuki.data_store.data_type import DataType
from tanuki.data_store.metadata impo... | 2.28125 | 2 |
tests/fixtures/tf_module/function/test_lambda.py | leandevops/terraform-aws-lambda | 0 | 12799345 | <reponame>leandevops/terraform-aws-lambda<filename>tests/fixtures/tf_module/function/test_lambda.py<gh_stars>0
def lambda_handler(event, context):
print('Lambda is running...') | 1.234375 | 1 |
tests/test_coordinates.py | ilya-e/coordinates | 0 | 12799346 | <reponame>ilya-e/coordinates<gh_stars>0
# coding=utf8
"""Test suite for gpss.coordinates."""
from io import StringIO
from os import remove
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from coordinates import retrieve_xyz, xyz2lbh
RNX = '''\
2.11 OBSERVATION DATA M (... | 2.328125 | 2 |
projects/opendr_ws/src/perception/scripts/fall_detection.py | daoran/opendr | 0 | 12799347 | #!/usr/bin/env python
# Copyright 2020-2022 OpenDR European Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 2.15625 | 2 |
gwide/gwideHittable.py | tturowski/gwide | 7 | 12799348 | <reponame>tturowski/gwide<gh_stars>1-10
#!/usr/bin/env python
import os, argparse
from argparse import RawTextHelpFormatter
import gwide.methods as gtm
import gwide.Classes.HittableClass as ghc
def hittable():
## option parser
usage = "For more options type -h"
description = "Downstream analysis on hittabl... | 2.625 | 3 |
data_gen.py | kirubarajan/Dynamic-Memory-Network-Plus | 2 | 12799349 | <filename>data_gen.py
import re
from glob import glob
import numpy as np
from torch.utils.data import DataLoader
from torch.utils.data.dataloader import default_collate
from torch.utils.data.dataset import Dataset
class adict(dict):
def __init__(self, *av, **kav):
dict.__init__(self, *av, **kav)
... | 2.390625 | 2 |
web/test_webinfra.py | danielmunro/test_myinfra | 1 | 12799350 | import pytest
import subprocess
import testinfra
import pprint
# scope='session' uses the same container for all the tests;
# scope='function' uses a new container per test function.
@pytest.fixture(scope='session')
def host(request):
# build local ./Dockerfile
subprocess.check_call(['docker', 'build', '-t', 'web'... | 2.078125 | 2 |