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
osm_adaptor.py
nooneisperfect/ReadYourMAPFile
0
12797451
#!/usr/bin/env python #****************************************************************************** # From $Id: gdal2tiles.py 19288 2010-04-02 18:36:17Z rouault $ # VERSION MODIFIED FROM ORIGINAL, come with no warranty # <NAME> # input: vrt file (-addalpha) in 3857 projection (projection is forced due # to weird effe...
2.484375
2
src/admin.py
erastusnzula/Django-ecommerce
0
12797452
from django.contrib import admin from django.utils.html import format_html # from django.contrib.auth.models import Group from .models import Product, CartProduct, Order, Address, Payment, Coupon, Refund, Setting, ProductImages, Profile, \ Contact, Category, Size # admin.site.unregister(Group) class ProductI...
1.890625
2
pinax/stripe/migrations/0001_initial.py
bonidjukic/pinax-stripe
0
12797453
<reponame>bonidjukic/pinax-stripe # -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-08-06 19:00 from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import j...
1.554688
2
src/generators/adasyn.py
Arzik1987/prelim
2
12797454
<reponame>Arzik1987/prelim import numpy as np from imblearn.over_sampling import ADASYN import warnings from src.generators.rand import Gen_randu class Gen_adasyn: def __init__(self): self.X_ = None self.mname_ = "adasyn" def fit(self, X, y=None, metamodel=None): self.X_ = X.copy() ...
2.375
2
static/random_initializer.py
ajayKumar99/Dog-Breed-Classifier
1
12797455
<gh_stars>1-10 import random def initializer(): i = random.randint(0 , 119) while True: j = random.randint(0 , 119) if i != j: break while True: z = random.randint(0 , 119) if z != i and z != j: break k = random.randint(0 ,2) while True: ...
2.703125
3
result_generator/result_feature_db/index_sift_color.py
shijack/feature_extract
1
12797456
# coding=utf-8 import os import shutil import time def get_dirs_child(path): return [os.path.join(path, f) for f in os.listdir(path)] def get_all_files_suffix(path, file_suffix='.jpg'): all_file = [] for dirpath, dirnames, filenames in os.walk(path): for name in filenames: if name.en...
2.78125
3
tree-walk.py
rabindra-harlalka/my-programs
0
12797457
from typing import Callable from queue import Queue """A type of depth-first walk of a tree (parent, left, right)""" def pre_order_walk(node, result: list, left: Callable, right: Callable, parent: Callable): if node is not None: result.append(node) if left(node) is not None: pre_order_w...
3.984375
4
polymath/srdfg/templates/template_utils.py
lite-david/polymath
15
12797458
<reponame>lite-david/polymath import polymath as pm import numpy as np def format_idx(x, reverse=True): if reverse: return tuple(list(reversed(x))) else: return tuple(x) def _get_indices(node, all_indices, tgt_shape): indices = [] if node.shape == pm.DEFAULT_SHAPES[0]: return ...
2.65625
3
src/my_tools/second_module.py
hyeonukbhin/template_repository
0
12797459
#!/usr/bin/python3.5 # -*- coding: utf-8 -*- import os import sys EXE_PATH = os.getcwd() # 실행 경로 SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) # 스크립트 경로 UPPER_PATH = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 상위 경로 sys.path.append(UPPER_PATH) # 상위 경로를 추가 from my_tools import first_mo...
2.96875
3
vagga2lithos/lithos.py
tailhook/vagga2lithos
5
12797460
<gh_stars>1-10 import yaml try: from yaml import CSafeDumper as BaseDumper from yaml import CSafeLoader as BaseLoader except ImportError: from yaml import SafeDumper as BaseDumper from yaml import SafeLoader as BaseLoader class Dumper(BaseDumper): def statedir_repr(self, value): return s...
2.25
2
src/vispy_radar_scenes/settings.py
henriksod/vispy_radar_scenes
2
12797461
#!/usr/bin/env python # -*- coding: utf-8 -*- """Settings dataclass. Holds settings for the visualization tool during runtime. """ from dataclasses import dataclass @dataclass class Settings: program_title: str = "Radar Data Viewer" dark_mode: bool = True dark_stylesheet: str = ":/dark/stylesheet.qss" ...
2.125
2
src/winograd_collection_manipulation/wsc_json_handler.py
gabimelo/portuguese_wsc
6
12797462
<filename>src/winograd_collection_manipulation/wsc_json_handler.py<gh_stars>1-10 import json import pandas as pd from src.helpers.consts import WINOGRAD_SCHEMAS_FILE, WINOGRAD_SCHEMAS_ORIGINAL_FILE def generate_df_from_original_json(): with open(WINOGRAD_SCHEMAS_ORIGINAL_FILE, 'r', encoding='utf-8') as fp: ...
2.71875
3
globmatinterpret.py
DonHaul/MultiCamCalAruco
1
12797463
import sys, os sys.path.append('./libs') import numpy as np import scipy.io from libs import * import matlab.engine import numpy as np import scipy.io def CalculateGlobICP(): eng = matlab.engine.start_matlab() #create a list of numpy arrays #50 eng.globalProcrustesWrapper(modelpc...
2.1875
2
Lulz.py
kami4/Lulz.pl
0
12797464
<gh_stars>0 import urllib2 import sys import threading import random import re #global params url='' host='' headers_useragents=[] headers_referers=[] request_counter=0 flag=0 safe=0 def inc_counter(): global request_counter request_counter+=1 def set_flag(val): global flag flag=val def s...
2.421875
2
extract.py
hiddeottens/shopify-scraper
0
12797465
path = './stores.csv' import pandas as pd from shopify import extract_products_json result = '' with open(path) as csvfile: df = pd.read_csv(csvfile) url = df['url'] products = extract_products_json(url) print(products)
2.6875
3
app/models.py
marintsev/sputniktests
27
12797466
<reponame>marintsev/sputniktests #!/usr/bin/python # Copyright 2009 the Sputnik authors. All rights reserved. # This code is governed by the BSD license found in the LICENSE file. from google.appengine.ext import db import cStringIO _ESCAPEES = { '"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': ...
2.140625
2
setup.py
Mayukhdeb/taming-transformers
0
12797467
from setuptools import setup, find_packages with open('requirements.txt') as f: required = f.read().splitlines() setup( name='taming-transformers', version='0.0.1-eden', description='Taming Transformers for High-Resolution Image Synthesis', packages=find_packages(), include_package_data=True, ...
1.304688
1
skbio/stats/distance/_anosim.py
JWDebelius/scikit-bio
0
12797468
#! /usr/bin/env python # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------...
2.609375
3
project_template/project_main_app/__init__.py
mciucu/manage-stem-app
1
12797469
<filename>project_template/project_main_app/__init__.py default_app_config = "{{ project_main_app}}.apps.MainAppConfig"
1.15625
1
singlesiding/pyside.py
ewerybody/siding
0
12797470
<reponame>ewerybody/siding<gh_stars>0 """ singlesiding supports PySide2 and 6 but needs to adapt to whats already imported NOT whats available! Thus we deal with it here. """ import sys if 'PySide6' in sys.modules: from PySide6 import QtCore, QtWidgets, QtNetwork elif 'PySide2' in sys.modules: from PySide2 imp...
1.492188
1
extract_table/textract_all.py
shaoyuliusz/faculty_salary
0
12797471
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import os import time import glob import sys import textract_python_table_parser as tptp ''' File name: testract_all.py Author: <NAME> Date created: 12/08/2021 Python Version: 3.9 ''' #change to the directory #cd /Users/appl...
2.90625
3
build/lib/abp/adaptives/a3c/__init__.py
LinearZoetrope/abp
0
12797472
<reponame>LinearZoetrope/abp<filename>build/lib/abp/adaptives/a3c/__init__.py from .adaptive import A2CAdaptive
1
1
SentiNews.py
simplesaad/SentiNews
0
12797473
import requests from bs4 import BeautifulSoup from selenium import webdriver import time import pandas as pd import numpy as np from datetime import datetime from textblob import TextBlob page = requests.get('https://qz.com/india/latest') soup = BeautifulSoup(page.content, 'html.parser') weblinks = soup.find_all('...
3.296875
3
leetcode/188 best-time-to-buy-and-sell-stock-iv.py
xiewendan/algorithm
0
12797474
# -*- coding: utf-8 -*- # __author__ = xiaobao # __date__ = 2019/11/13 12:39:48 # desc: desc # 给定一个数组,它的第 i 个元素是一支给定的股票在第 i 天的价格。 # 设计一个算法来计算你所能获取的最大利润。你最多可以完成 k 笔交易。 # 注意: 你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。 # 示例 1: # 输入: [2,4,1], k = 2 # 输出: 2 # 解释: 在第 1 天 (股票价格 = 2) 的时候买入,在第 2 天 (股票价格 = 4) 的时候卖出,这笔交易所能获得利润 = 4-2 ...
3.59375
4
LogicPy/__init__.py
Sunillad08/Digital_logic
6
12797475
<filename>LogicPy/__init__.py import LogicPy.main_functions as main_functions import LogicPy.conversion as conversion import LogicPy.gates as gates import LogicPy.flipflops as flipflops import LogicPy.combination_logic as combination_logic import LogicPy.display_terminals as display_terminals import LogicPy.arithematic...
1.195313
1
Network Simulations/Assignment 1/dataGenerator.py
neeladripal/bcse-lab
0
12797476
<reponame>neeladripal/bcse-lab import random # generate a random binary string def generateMessage (size): message = '' for count in range(size): message += str(random.randint(0,1)) return message n = 32 * 10000 # size of data file = open("testdata.txt", "w") file.write(generateMessage(n))...
3.046875
3
tags_to_sha.py
karajan1001/dvc-bench
0
12797477
<gh_stars>0 import os from git import Repo def convert_to_sha(tags_filename="tags.txt", hashes_filename="hashes.txt"): tags = [] with open(tags_filename, "r") as fobj: tags.extend([l.strip() for l in fobj.readlines()]) git_repo = Repo("dvc") hashes = [git_repo.commit(t).hexsha + os.linesep f...
3.0625
3
pycomlink/core/__init__.py
jpolz/pycomlink
1
12797478
from __future__ import absolute_import from .comlink_channel import ComlinkChannel from .comlink import Comlink
1.0625
1
telegram_repository/utility.py
clement0010/eusoff-cca-bot
0
12797479
from spreadsheet.utility import get_user_ccas, is_registered, register_user from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import ConversationHandler import logging logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = l...
2.734375
3
bglib/kvui/rootwidget.py
dheller1/bglib
0
12797480
<gh_stars>0 from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout class RootWidget(FloatLayout): def __init__(self, **kwargs): super().__init__(**kwargs)
2.015625
2
modules/FileManager.py
leeyongjoo/algorithm-problem-automation
0
12797481
<reponame>leeyongjoo/algorithm-problem-automation<gh_stars>0 from pathlib import Path from modules.languages import get_extension import os.path from re import sub # 상위 디렉토리 경로 BASE_DIR = Path(__file__).resolve(strict=True).parent.parent class FileManager(object): default_dir = '_downloads' # 파일을 저장할 기본 디렉토리 ...
2.734375
3
crawler/house_renting/settings.py
bernssolg/house-renting-master
823
12797482
<gh_stars>100-1000 # -*- coding: utf-8 -*- from house_renting.spider_settings import lianjia, a58 BOT_NAME = 'house_renting' COMMANDS_MODULE = 'house_renting.commands' SPIDER_MODULES = ['house_renting.spiders'] NEWSPIDER_MODULE = 'house_renting.spiders' USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) A...
1.53125
2
proteinham/lattice/turn_circuit.py
couteiral/proteinham
0
12797483
<filename>proteinham/lattice/turn_circuit.py import math import numpy as np import sympy as sp import symengine as se from abc import * from tqdm import tqdm, trange from copy import deepcopy from itertools import chain from functools import reduce from .qlogic import * from proteinham.core.hamiltonian import Hamilton...
2.359375
2
films/migrations/0001_initial.py
LucaAlexandru/MediaTracker
0
12797484
# Generated by Django 3.2.4 on 2021-10-11 10:34 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
1.859375
2
oculy/plotting/plots/axes.py
MatthieuDartiailh/oculy
0
12797485
<gh_stars>0 # -------------------------------------------------------------------------------------- # Copyright 2020-2021 by Oculy Authors, see git history for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # --------------...
2.125
2
python_obfuscator/helpers/__init__.py
gjp4tw/python-obfuscator
61
12797486
from .variable_name_generator import VariableNameGenerator from .random_datatype import RandomDataTypeGenerator
1.179688
1
iris/services/node.py
kpanic/lymph
0
12797487
import json import logging import gevent import os import psutil import six from gevent import subprocess from six.moves import range from iris.core.interfaces import Interface from iris.utils.sockets import create_socket logger = logging.getLogger(__name__) class Process(object): def __init__(self, cmd, env=N...
2.046875
2
pyqt_demo/test1.py
yzwxx/Label_Lab
0
12797488
<reponame>yzwxx/Label_Lab<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- ''' a window with menu bar and tool bar QAction with addAction for event handling(setting hot keys,showing status tip) set window icon ''' import os from os.path import join import sys from PyQt4 import QtGui,QtCore icon_path = join(o...
2.484375
2
python_submission/707.design-linked-list.199616840.notac.py
stavanmehta/leetcode
0
12797489
<filename>python_submission/707.design-linked-list.199616840.notac.py class Node(object): def __init__(self, value, nextNode=None): self.val = value self.next = nextNode class MyLinkedList(object): def __init__(self): """ Initialize your data structure here. """ ...
4.1875
4
commons.py
projectcuisines/gcm_ana
1
12797490
<reponame>projectcuisines/gcm_ana<filename>commons.py<gh_stars>1-10 # -*- coding: utf-8 -*- """Definitions and objects commonly used between scripts.""" MODELS = { "ExoCAM": { "title": "ExoCAM", "color": "tab:blue", }, "LMDG": { "title": "LMD-G", "color": "tab:red", }, ...
1.460938
1
main.py
MikhSol/monte_carlo_simulation_of_pi
0
12797491
<gh_stars>0 from random import random import time import logging import matplotlib.pyplot as plt logger = logging.getLogger() logging.basicConfig(level=logging.INFO) def estimate_pi(trials): start = time.process_time() count = 0 for _ in range(trials + 1): x, y = random(), random() if x *...
3.0625
3
benchmark/models.py
ens-lgil/PGS_Catalog
1
12797492
<filename>benchmark/models.py from django.db import models from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.contrib.postgres.fields import DecimalRangeField class BM_Coding(models.Model): """Class to describe the International Classification of D...
2.359375
2
dataset.py
sehandev/transformer-pytorch
0
12797493
# Standard # PIP from torch.utils.data import DataLoader from pytorch_lightning import LightningDataModule from torchtext.datasets import WikiText2 # Custom class CustomDataModule(LightningDataModule): def __init__( self, batch_size=1, num_workers=0, ): super().__init__() ...
2.671875
3
test/test_field.py
aimagelab/speaksee
29
12797494
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest import speaksee.data as data import numpy as np import torch '''class TestImageField(object): def test_preprocessing(self): field = data.ImageField() image = '' expected_image = '' assert field.preproce...
2.8125
3
swc-api/config.py
aehaynes/btcpokerstats
0
12797495
<gh_stars>0 SWC_USERNAME = ['Irresonsibl','Irrsponsible', 'Irresponsibl'] SWC_PASSWORD = '<PASSWORD>' SLEEP_MILLISECONDS = 750 GET_SESSION_URL = 'https://sealswithclubs.eu/sealsloginhandler.php?login=X&JSON=1&Version=v0.2.18' USER_AGENT_STR = 'python-requests/1.1.0 CPython/2.7.3 Windows/7' SERVICE_URL = 'sealswithclubs...
1.632813
2
merkle.py
makiolo/root_merkle_tree
2
12797496
<filename>merkle.py<gh_stars>1-10 ''' Generate root merkle tree hash in python. I use https://github.com/bitcoin/bitcoin as reference: BlockBuildMerkleTree --> Satoshi implmentation BlockMerkleRoot ---> new bitcoin core implementation ''' import pandas as pd from hashlib import sha256 from io import StringIO...
2.640625
3
astro345_fall2015/astro345_hw12.py
johnnydevriese/wsu_courses
0
12797497
<filename>astro345_fall2015/astro345_hw12.py import matplotlib.pyplot as plt from pylab import * def moon(x): P = 3340 * 1.622 * x return P def mars(x): P = 3930 * 3.711 * x return P def earth(x): P = 5510 * 9.807 * x return P def jupiter(x): P = 1330 * 24.79 * x return P def f(x): P =...
3.25
3
solutions/0279.Perfect_Squares/python_solution.py
garyzccisme/leetcode
2
12797498
# DP class Solution: def numSquares(self, n: int) -> int: squares = [x ** 2 for x in range(1, int(n ** 0.5) + 1)] dp = [0] + [float('inf')] * n for i in range(1, n + 1): for square in squares: if i < square: break dp[i] = min(...
3.09375
3
codigo_das_aulas/aula_10/aula_10_08.py
VeirichR/curso-python-selenium
234
12797499
<reponame>VeirichR/curso-python-selenium<filename>codigo_das_aulas/aula_10/aula_10_08.py from selenium.webdriver import Firefox from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.expected_conditions import ( url_contains, url_matches ) url = 'https://selenium.dunossauro.live...
2.703125
3
LexData/utils.py
CedricTarbouriech/LexData
16
12797500
import functools import json from datetime import datetime from typing import Any, Dict from .wikidatasession import WikidataSession @functools.lru_cache() def getPropertyType(propertyId: str): repo = WikidataSession() query = { "action": "query", "format": "json", "prop": "revisions"...
2.484375
2
example_xva_v2.py
kwchau/sgbm_xva
6
12797501
<gh_stars>1-10 """ Created on Mon May 14 17:21:26 2018 @author: <NAME> This file holds the parameters for all specific example and the numerical scheme for the BSDE. .. todo:: Moving the numerical scheme to the function file """ import numpy as np class GermenIndexPut(): # Example Information name = "Put op...
2.46875
2
proxmoxmanager/utils/classes/containers.py
igorlitvak/proxmoxmanager
0
12797502
from ..api import APIWrapper from .nodes import ProxmoxNode, ProxmoxNodeDict from .users import ProxmoxUser from typing import Dict, List, Tuple, Any, Union class ProxmoxContainer: def __init__(self, api: APIWrapper, vmid: str, node: str): self._api = api self._vmid = vmid self._node = nod...
2.328125
2
1-6 Algorithmic Toolbox/Week 6/6-3 placing_parentheses.py
MLunov/Data-Structures-and-Algorithms-Specialization-San-Diego-HSE
0
12797503
# Uses python3 def evalt(a, b, op): if op == '+': return a + b elif op == '-': return a - b elif op == '*': return a * b else: assert False def MinAndMax(i, j): MIN = float('inf') MAX = float('-inf') for k in range(i, j): a = evalt(M[i][k], M[k + 1]...
3.15625
3
nfl/espn.py
sansbacon/nfl
2
12797504
""" # espn.py # classes for scraping, parsing espn football data # this does include some basic fantasy data # espn_fantasy is mostly about managing fantasy teams # NOTE: trouble accessing data in offseason # will have to revisit this module as season approaches """ import logging import re from bs4 import Beautif...
3.15625
3
IronManFly/storage/db/db.py
leepand/IronManFly
599
12797505
<filename>IronManFly/storage/db/db.py import threading import glob import gzip try: from StringIO import StringIO # Python 2.7 except: from io import StringIO # Python 3.3+ import uuid import re import os import sys from collections import defaultdict import pandas as pd import pybars from .column import Co...
2.09375
2
app/src/config.py
LucasLaibly/Intrusion
0
12797506
<reponame>LucasLaibly/Intrusion class Development(object): DEBUG: True class Testing(object): DEBUG: False class Production(object): DEBUG: False
1.625
2
backend/db/entities/commited/base.py
R-N/sistem_gaji_vue_thrift
0
12797507
from sqlalchemy import MetaData from sqlalchemy.ext.declarative import declarative_base DbCommitedEntity = declarative_base(metadata=MetaData(schema="commited"))
1.828125
2
src/models/lstm_selfattention_embedding.py
okason97/STONK
2
12797508
<gh_stars>1-10 import tensorflow as tf import tensorflow_probability as tfp from tensorflow.keras import Model, Sequential from tensorflow.keras.layers import Activation, Layer, Dense, Conv1D, BatchNormalization, Dropout, LayerNormalization, LSTM, Embedding, Bidirectional import numpy as np def scaled_dot_product_atte...
2.140625
2
analyze.py
DMinghao/FreelancerJobAnalysis
2
12797509
import pandas as pd import numpy as np import nltk nltk.download('punkt') import os import nltk.corpus from nltk.probability import FreqDist from nltk.tokenize import word_tokenize # read result result = pd.read_csv("result.csv") Tags = result["Tag"] print(Tags) allTag = "" for row in result.index: allTag = a...
3.109375
3
web/pubmed_reader.py
BioSystemsUM/biotmpy
13
12797510
<filename>web/pubmed_reader.py from Bio.Entrez import efetch, read from Bio import Entrez import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import nltk from data_structures.document import Document from data_structures.sentence import Sentence from data_structures.token import Token from ...
2.421875
2
qiradb/qiradb/__init__.py
pAplakidis/qira
0
12797511
<filename>qiradb/qiradb/__init__.py from qiradb._qiradb import *
1.179688
1
common/utils/api_utils.py
hvsuchitra/tv_tracker
0
12797512
<gh_stars>0 import requests import requests_cache # path when running from gui requests_cache.install_cache(cache_name='../common/cache/api', backend='sqlite', expire_after=86400) # requests_cache.install_cache(cache_name='../../common/cache/api', backend='sqlite', expire_after=86400) resource_base_url = 'https://t...
2.484375
2
setup.py
LaCiberReserva/api-python-sdk
6
12797513
from setuptools import setup, find_packages setup( name='blueliv-python-sdk', version='2.3.0', description='Blueliv API SDK for Python', url='https://github.com/Blueliv/api-python-sdk', author='Blueliv', author_email='<EMAIL>', license='MIT', classifiers=[ 'Development Status ::...
1.273438
1
sample_equations.py
lsDantas/Numerical-Analysis
0
12797514
# Sample Equations # # Description: Sample functions (and their derivatives) # to be used with the root-finding algorithms. # #Equation 1 def eq1(x): return x**5 - 5*x + 1 def eq1_d(x): return 5*(x**4) - 5 # Equation 2 def eq2(x): return (pow(x, 2) - 4) def eq2_d(x): return 2*x
3.6875
4
bucky/util/power_transforms.py
hanijames/bucky
0
12797515
<filename>bucky/util/power_transforms.py """Simple power transformation classes.""" # pylint: disable=unused-variable from ..numerical_libs import sync_numerical_libs, xp # TODO this could be better organized... @sync_numerical_libs def yeojohnson(y, lam): """Yeo-Johnson tranform, batched in the first dimension...
2.265625
2
dztools/DZtools.py
kurtsundell/DZtools
1
12797516
import sys #import argparse import pandas as pd import matplotlib.pyplot as plt from dztools.stats.intersample import intersample from dztools.utils.makeplots import makeplots xmin = 1 # define lower limit for probability density plots (PDPs) and kernel density estimates (KDEs) and all plots xmax = 4000 #upper limit...
2.546875
3
opem/Test/test_Padulles_Amphlett.py
Martenet/opem
173
12797517
# -*- coding: utf-8 -*- ''' >>> from opem.Dynamic.Padulles_Amphlett import * >>> import shutil >>> Test_Vector={"A":50.6,"l":0.0178,"lambda":23,"JMax":1.5,"T":343,"N0":5,"KO2":0.0000211,"KH2":0.0000422,"KH2O":0.000007716,"tH2":3.37,"tO2":6.74,"t1":2,"t2":2,"tH2O":18.418,"rho":1.168,"qMethanol":0.0002,"CV":2,"i-start":0...
1.992188
2
mlld_functions.py
mdastro/My_Package
0
12797518
import numpy as np """ :param MLLD_functions: this class has several functions that are usually used by myself. """ class MLLD_functions: def standardization(self, variable): """ :param variable: the array with the variables you wish to standardize :return: standardized array """ ...
3.5625
4
nlidbTranslator/api/adapters/editsql/editsql_adapter.py
DataManagementLab/univerSQL
0
12797519
import random import time from pathlib import Path import numpy as np import json import torch from editsql.data_util import atis_batch from editsql.data_util.atis_data import ATISDataset from editsql.data_util.interaction import load_function from editsql.model import model, utils_bert from editsql.model.schema_inte...
2.375
2
tests/r/test_rep_vict.py
hajime9652/observations
199
12797520
<filename>tests/r/test_rep_vict.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.rep_vict import rep_vict def test_rep_vict(): """Test module rep_vict.py by downloading rep_vict.csv and t...
2.421875
2
fairness/algorithms/zafar/fair-classification-master/disparate_impact/synthetic_data_demo/fairness_acc_tradeoff.py
yashwarlord/fairness-comparison
146
12797521
<reponame>yashwarlord/fairness-comparison import os,sys import numpy as np from generate_synthetic_data import * sys.path.insert(0, '../../fair_classification/') # the code for fair classification is in this directory import utils as ut import loss_funcs as lf # loss funcs that can be optimized subject to various const...
2.84375
3
revivesocialmedia/revivesocialmedia.py
MSAdministrator/revive-social-media
0
12797522
<gh_stars>0 from .opensourceprojects import OpenSourceProjects from .blogposts import BlogPosts from .posttweet import PostTweet from .postlinkedin import PostLinkedIn class ReviveSocialMedia: _OSS_MESSAGE = 'OSS Project: {name} is {description}. Check it out! {url} #reviveposts' _BLOG_MESSAGE = 'Blog Post: ...
2.578125
3
test_tools/simgen_ta.py
mpastyl/Arctium
0
12797523
#!/usr/bin/env python2.7 import sys import argparse import traceback ap = argparse.ArgumentParser(description='Simulation generator') ap.add_argument('--basepath', required=False, default="../..", help='Base path') ap.add_argument('-c', '--config', required=False, default="params.py", ...
1.929688
2
lib/core/function.py
AIprogrammer/AdvMix
11
12797524
<gh_stars>10-100 # ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_import from...
1.742188
2
web/migrations/0002_account_userlink_userpreferences.py
Migueltorresp/frgl
1
12797525
<filename>web/migrations/0002_account_userlink_userpreferences.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings import django.core.validators class Migration(migrations.Migration): depend...
1.828125
2
tyrannosaurus/sync.py
kenyon/tyrannosaurus
0
12797526
<filename>tyrannosaurus/sync.py """ Sync tool. """ from __future__ import annotations import logging from pathlib import Path from typing import Sequence, Mapping from tyrannosaurus.context import _Context logger = logging.getLogger(__package__) class Sync: def __init__(self, context: _Context, dry_run: bool):...
2.515625
3
examples/poisson/simulation.py
AbhilashReddyM/flowX
0
12797527
"""User defined module for simulation.""" import numpy def get_analytical(grid, asol, user_bc): """Compute and set the analytical solution. Arguments --------- grid : flowx.Grid object Grid containing data. asol : string Name of the variable on the grid. """ X, Y = numpy...
3.3125
3
python/hello-python.py
bobby-web/programlang
0
12797528
print("Hllo World")
1.179688
1
rNet.py
ZigaSajovic/rNet
11
12797529
<filename>rNet.py<gh_stars>10-100 import numpy as np class tanh: def __call__(self, input): return np.tanh(input) def d(self, input): return 1 - input * input class sigmoid: def __call__(self, input): return 1 / (1 + np.exp(-input)) def d(self, input): return input ...
2.921875
3
Tree/identicalTree.py
jainanisha90/codepath_interviewBit
0
12797530
# Definition for a binary tree node class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: # @param A : root node of tree # @param B : root node of tree # @return an integer def isSameTree(self, A, B): if A is None and...
3.96875
4
mapperpy/exceptions.py
cohirer2019/MapperPy
2
12797531
<filename>mapperpy/exceptions.py __author__ = 'lgrech' class ConfigurationException(Exception): pass
1.34375
1
app/imr/scrapyard.py
DarkMaguz/IMR-ReportGenerator
0
12797532
<filename>app/imr/scrapyard.py import pikepdf import PyPDF2 # excelFileList = getExcelFiles() # print(getURLsFromExcelFile(excelFileList[0])) # info = downloadFile( # "http://arpeissig.at/wp-content/uploads/2016/02/D7_NHB_ARP_Final_2.pdf") # # dlReports = [info] def validatePDF(filePath): #print('validatePDF: ',...
2.578125
3
pipeline/feature_engineering/preprocessing/sussex_huawei_preprocessor.py
lorenz0890/road_condition_classification
0
12797533
from pipeline.feature_engineering.preprocessing.abstract_preprocessor import Preprocessor from pipeline.feature_engineering.preprocessing.replacement_strategies.mean_replacement_strategy import MeanReplacementStrategy from pipeline.feature_engineering.preprocessing.replacement_strategies.del_row_replacement_strategy im...
2.6875
3
f1_telemetry/data/structs.py
pahansen/f1-2021-telemetry-dashboard
1
12797534
"""Struct classes for car telemetry. Classes parse data from binary format and extract player data.""" import struct import ctypes from dataclasses import dataclass, asdict from typing import List PACKET_HEADER_FORMAT = "<HBBBBQfLBB" PACKET_CAR_TELEMETRY_DATA_FORMAT = "BBb" CAR_TELEMETRY_DATA_FORMAT = "HfffBbHBBHHHHHB...
2.9375
3
src/trace_set/transform.py
ccberg/LA
1
12797535
<filename>src/trace_set/transform.py import numpy as np from src.dlla.hw import prepare_traces_dl from tensorflow.python.keras.utils.np_utils import to_categorical # TODO replace with mlp_hw notebook variants from src.tools.dl import encode from src.tools.la import balance from src.trace_set.database import Database ...
2.234375
2
app/api/index.py
awtkns/openapi-perf-action
0
12797536
import os from fastapi import FastAPI, HTTPException from github3.exceptions import NotFoundError, ForbiddenError from github3.github import GitHub from github3.pulls import PullRequest from pydantic import BaseModel GITHUB_PRIVATE_KEY = os.environ.get('APP_PRIVATE_KEY', None) GITHUB_APP_IDENTIFIER = os.environ.get('...
2.21875
2
ml_scraping/src/NLTK/tutorial/lemmatizing.py
josetorrs/thee-flying-chicken
2
12797537
from nltk.stem import WordNetLemmatizer lemmatizer = WordNetLemmatizer() ''' print(lemmatizer.lemmatize("cacti")) print(lemmatizer.lemmatize("geese")) print(lemmatizer.lemmatize("rocks")) print(lemmatizer.lemmatize("python")) ''' #default pos="n"(noun) #"a" = adjective, "v" = verb #lemmas give back actual words, usual...
3.4375
3
portfolio/models.py
Marcos8060/Django-Gallery-Website
0
12797538
from django.urls import reverse from django.db import models # Create your models here class Location(models.Model): name = models.CharField(max_length=60) def __str__(self): return self.name class Category(models.Model): name = models.CharField(max_length=200) slug = models.SlugField(uniqu...
2.609375
3
diplomacy_research/models/datasets/feedable_dataset.py
wwongkamjan/dipnet_press
39
12797539
<filename>diplomacy_research/models/datasets/feedable_dataset.py # ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (t...
2.03125
2
Image/Analysis.py
fox-ahri/image
0
12797540
from PIL import ImageFont def analysis(obj): params = dict() params['size'] = size(obj) params['rgb'] = color(obj) params['lines'] = line(obj) params['ellipses'] = ellipse_and_rectangle(obj, 'ellipses') params['rectangles'] = ellipse_and_rectangle(obj, 'rectangles') params['texts'] = text(...
2.875
3
pythonoffice/ppt_get.py
YEZHIAN1996/pythonstudy
1
12797541
<filename>pythonoffice/ppt_get.py<gh_stars>1-10 from pptx import Presentation p = Presentation('a.pptx') for slide in p.slides: for shape in slide.shapes: if shape.has_text_frame: print(shape.text_frame.text) if shape.has_table: for cell in shape.table.iter_cells(): ...
2.953125
3
old_code/datawrangle.py
Napam/Stockybocky
2
12797542
'''Combines oslo bors and yahoo data''' import numpy as np import pandas as pd from pprint import pprint import scrapeconfig as cng def merge_bors_and_yahoo_dfs(bors_name: str, yahoo_name: str, result_filename: str): ''' Get filenames for csv files from Oslo Bors and Yahoo Finance and merges them ...
3.0625
3
co-occurrence_matrix.py
fanglala997/test
0
12797543
<filename>co-occurrence_matrix.py import matplotlib import fileDispose import numpy as np def get_bench(text,n): """ get_bench(list,int) 共现矩阵窗口循环的范围,对联选择上下联两句做循环范围 text:文本列表 n:几句话合并 """ bench = [] lable = 0 for i in range(len(text)): if(i % n == 0): lable = i ...
2.8125
3
scripts/plot_performance.py
shercklo/LTO-CMA
7
12797544
<reponame>shercklo/LTO-CMA import os import json import numpy as np import seaborn as sns import matplotlib.pyplot as plt import argparse from datetime import datetime sns.set() from matplotlib import rcParams rcParams["font.size"] = "40" rcParams['text.usetex'] = False rcParams['font.family'] = 'serif' rcParams['fig...
2.0625
2
cpdb/analytics/migrations/0004_alter_searchtracking_query_type.py
invinst/CPDBv2_backend
25
12797545
<reponame>invinst/CPDBv2_backend<gh_stars>10-100 # Generated by Django 2.1.3 on 2018-11-23 08:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('analytics', '0003_searchtracking'), ] operations = [ migrations.AlterField( mod...
1.445313
1
LaureatsBackEnd-master/laureats/migrations/0008_etudiant.py
SanaaCHAOU/laureat_management_ENSAT
0
12797546
<filename>LaureatsBackEnd-master/laureats/migrations/0008_etudiant.py # Generated by Django 3.0.2 on 2020-01-10 20:43 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('laureats', '0007_laureat_filiere'), ] operati...
1.570313
2
spanmb/models/span_extractor.py
zmmzGitHub/SpanMB_BERT
0
12797547
<filename>spanmb/models/span_extractor.py import torch from torch.nn.parameter import Parameter from overrides import overrides from allennlp.modules.span_extractors.span_extractor import SpanExtractor from allennlp.modules.token_embedders.embedding import Embedding from allennlp.nn import util from allennlp.common.c...
2.328125
2
Curso Python Completo - Udemy/Teste/conjuntos.py
Cauenumo/Python
0
12797548
<gh_stars>0 s = set() s.add(2) print(s)
1.71875
2
custom_components/goldair_climate/heater/climate.py
KiLLeRRaT/homeassistant-goldair-climate
0
12797549
""" Goldair WiFi Heater device. """ import logging import json from homeassistant.const import ( ATTR_TEMPERATURE, TEMP_CELSIUS, STATE_UNAVAILABLE ) from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate.const import ( ATTR_HVAC_MODE, ATTR_PRESET_MODE, HVAC_MODE_OFF...
2.203125
2
pydfs_lineup_optimizer/sites/draftstarsnfl/__init__.py
apapadimitriou/pydfs-lineup-optimizer
0
12797550
<filename>pydfs_lineup_optimizer/sites/draftstarsnfl/__init__.py from .importer import * from .settings import * __all__ = [ 'DraftstarsCSVImporter', 'DraftstarsNFLSettings' ]
1.210938
1