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 |
|---|---|---|---|---|---|---|
pyfda/libs/pyfda_fft_windows_lib.py | cedricboudinet/pyFDA | 0 | 38000 | <reponame>cedricboudinet/pyFDA
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Store the available fft windows ... | 2.296875 | 2 |
src/data/argoverse/dataset.py | ybarancan/STSU | 67 | 38001 | <reponame>ybarancan/STSU
import os
from PIL import Image
import torch
from torch.utils.data import Dataset
from torchvision.transforms.functional import to_tensor
from src.utils import bezier
from .utils import IMAGE_WIDTH, IMAGE_HEIGHT, ARGOVERSE_CLASS_NAMES
from ..utils import decode_binary_labels
import numpy as n... | 2.15625 | 2 |
src/textcode/markup.py | pombredanne/scancode-toolkit | 3 | 38002 | <gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a tra... | 1.390625 | 1 |
novajoin_tempest_plugin/ipa/ipa_client.py | vakwetu/novajoin_tempest_plugin | 0 | 38003 | <gh_stars>0
# Copyright 2017 Red Hat
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 1.703125 | 2 |
old/ctest.py | ostapstephan/SeniorProject | 1 | 38004 | # import lib.pbcvt as pbcvt
import cv2
import numpy as np
import sys
from time import time
def distance(o1, o2):
(x1,y1,w1,h1) = o1
(x2,y2,w2,h2) = o2
c1 = (x1+w1/2,y1+h1/2)
c2 = (x2+w2/2,y2+h2/2)
return np.hypot(c1[0]-c2[0],c1[1]-c2[1])
cv2.namedWindow("preview")
cv2.namedWindow("preview2")
cv2.... | 2.390625 | 2 |
src/library/blas/AutoGemm/KernelsToPreCompile.py | tingxingdong/clean | 1 | 38005 | <reponame>tingxingdong/clean<gh_stars>1-10
import os
import argparse
import AutoGemmParameters
import Common
################################################################################
# Auto-Gemm
################################################################################
def writeOfflineCompilation(args):... | 2.40625 | 2 |
scrap/main.py | talesconrado/SpotPer | 1 | 38006 | <gh_stars>1-10
import musics
import sys
def main():
filename = sys.argv[1]
start_id= int(sys.argv[2])
cod_album = sys.argv[3]
# filename = input('Digite o caminho do arquivo html a ser analisado: ')
# start_id = int(input('Digite o codfaixa inicial: '))
# cod_album = input('Digite o código do a... | 3.09375 | 3 |
cct/core2/config.py | awacha/cct | 1 | 38007 | <reponame>awacha/cct
import logging
import os
import pathlib
import pickle
from typing import Dict, Any, Union, Tuple, KeysView, ValuesView, ItemsView, Optional
from PyQt5 import QtCore
PathLike = Union[os.PathLike, str, pathlib.Path]
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class Config(... | 2.296875 | 2 |
bench-scripts/bench_strawman_jl_varying_num_dim.py | holmes-anonymous-submission/holmes-library | 0 | 38008 | <filename>bench-scripts/bench_strawman_jl_varying_num_dim.py
#!/usr/bin/env python
from common import *
configure_network()
subprocess.run(["cmake", "."])
subprocess.run(["make"])
print("running the bench_strawman_jl_varying_num_dim")
k = 41
# 41 for 100(k), 44 for 200(k)
num_records = 100
size_of_each_dimension = 1... | 2.296875 | 2 |
python/iperf_mar1.py | ttlequals0/misc | 0 | 38009 | #!/usr/local/apps/networking/bin/python2.7
# script will test all server clinet pairs with iperf
### this is the prd script
# pmw 2/18/16
import os
import re
import sys
import datetime
#from subprocess import Popen, PIP
import subprocess
import logging
from pprint import pprint
import argparse
import socket
import Queu... | 1.976563 | 2 |
Python/audio_to_text.py | udbhavdave/Major | 3 | 38010 | # import speech_recognition as sr
# import sys
#
# # read filename from arguments
# filename = ("C:\\Users\\utkar\\Downloads\\crowd.mp3")
#
# # initialize the recognizer
# r = sr.Recognizer()
#
# # open the file
# with sr.AudioFile(filename) as source:
# # listen for the data (load audio to memory)
# audio_data... | 4.0625 | 4 |
codes_auto/1203.print-in-order.py | smartmark-pro/leetcode_record | 0 | 38011 | #
# @lc app=leetcode.cn id=1203 lang=python3
#
# [1203] print-in-order
#
None
# @lc code=end | 1.453125 | 1 |
Toolkits/Discovery/meta/searx/searx/engines/digbt.py | roscopecoltran/SniperKit-Core | 4 | 38012 | <gh_stars>1-10
"""
DigBT (Videos, Music, Files)
@website https://digbt.org
@provide-api no
@using-api no
@results HTML (using search portal)
@stable no (HTML can change)
@parse url, title, content, magnetlink
"""
from sys import version_info
from lxml import html
from searx.engines.xpath ... | 2.546875 | 3 |
calvin_models/calvin_agent/datasets/npz_dataset.py | nikepupu/calvin | 0 | 38013 | import logging
import os
from pathlib import Path
import re
from typing import Dict, List, Optional, Tuple
from calvin_agent.datasets.base_dataset import BaseDataset
from calvin_agent.datasets.utils.episode_utils import (
get_state_info_dict,
process_actions,
process_depth,
process_rgb,
process_sta... | 2.1875 | 2 |
Recommender system/web_scraper.py | ab5163/STEM-Away | 0 | 38014 | import urllib
import json
import requests
from bs4 import BeautifulSoup
import pandas as pd
import re
import string
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
def getpage(num):
url = "https://forums.eveonline.com/c/marketplace/... | 2.9375 | 3 |
NeuralNetworks/Layers/dense.py | hiandersson/deep-dream-networks | 1 | 38015 | import numpy
from NeuralNetworks.Layers.activations import lambda_from_function
class Dense:
def __init__(self, num_nodes = 1, input_dim = None, activation = 'sigmoid'):
# set number of nodes
self.num_nodes = num_nodes
self.input_dim = input_dim
self.activation = activation
... | 3.25 | 3 |
src/static/widget/autocomplete/js/minify.py | karawallace/mygene | 78 | 38016 | <gh_stars>10-100
#!/usr/bin/python
import sys
if sys.version > '3':
PY3 = True
else:
PY3 = False
if PY3:
import http.client, urllib.request, urllib.parse, urllib.error, sys, json,pprint, os.path
else:
import httplib, urllib, sys, json,pprint, os.path
infile = sys.argv[1] if len(sys.argv)>1 else 'mygene... | 2.234375 | 2 |
multimenus/migrations/0006_auto_20200715_1100.py | arck1/djangocms-multimenus | 0 | 38017 | <filename>multimenus/migrations/0006_auto_20200715_1100.py
# Generated by Django 2.1.15 on 2020-07-15 11:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('multimenus', '0005_auto_20200415_1621'),
]
operations = [
migrations.AlterField(... | 1.273438 | 1 |
vnpy/gateway/sec/__init__.py | funrunskypalace/vnpy | 19,529 | 38018 | <filename>vnpy/gateway/sec/__init__.py
from .sec_gateway import SecGateway
| 1.148438 | 1 |
Vertical Order Traversal of a Binary Tree.py | sugia/leetcode | 0 | 38019 | <reponame>sugia/leetcode
'''
Given a binary tree, return the vertical order traversal of its nodes values.
For each node at position (X, Y), its left and right children respectively will be at positions (X-1, Y-1) and (X+1, Y-1).
Running a vertical line from X = -infinity to X = +infinity, whenever the vertical line ... | 3.890625 | 4 |
scripts/distribution.py | Qi-max/amlearn | 12 | 38020 | <reponame>Qi-max/amlearn
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
__author__ = "<NAME>"
__email__ = "<EMAIL>"
def column_hist(data, bins=None, density=True, fraction=True,
save_figure_to_dir=None, save_data_to_dir=None, fmt=None,
ylim=None, yscal... | 2.484375 | 2 |
mauna_loa.py | ellisbrown/BNN-Uncertainty | 0 | 38021 |
import tensorflow as tf
import matplotlib.pyplot as plt
import argparse
from keras.models import load_model
from data import load_from_H5
from bnn import bnn
from viz import plot_predictions
parser = argparse.ArgumentParser(description='Mauna Loa runner')
parser.add_argument('--trained_model', default='models/mauna_... | 2.671875 | 3 |
guest/models.py | TylerBackman/chemminetools | 16 | 38022 | import datetime
from django.db import models
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
class Guest(models.Model):
"""
A temporary user.
Fields:
``user`` - The temporary user.
``last_used`` - The last time we noted this user doing something... | 2.890625 | 3 |
test/unit/metrics/utils.py | alliesaizan/fairlearn | 1,142 | 38023 | <filename>test/unit/metrics/utils.py
# Copyright (c) Microsoft Corporation and Fairlearn contributors.
# Licensed under the MIT License.
import fairlearn.metrics as metrics
def _get_raw_MetricFrame():
# Gets an uninitialised MetricFrame for testing purposes
return metrics.MetricFrame.__new__(metrics.MetricFr... | 1.625 | 2 |
day4/day4.py | areddish/aoc2020 | 1 | 38024 | def check_hgt(h):
if "cm" in h:
return 150 <= int(h.replace("cm","")) <= 193
elif "in" in h:
return 59 <= int(h.replace("in","")) <= 76
else:
return False
def check_hcl(h):
if h[0] != '#' or len(h) != 7:
return False
for x in h[1:]:
if not x in list("... | 3.359375 | 3 |
core/dataflow/nodes/volatility_models.py | ajmal017/amp | 0 | 38025 | import collections
import datetime
import logging
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
import scipy as sp
import sklearn as sklear
import core.config as cconfig
import core.data_adapters as cdataa
import core.dataflow.utils as cdu
import core.fina... | 2.109375 | 2 |
tempgres/service.py | ClockworkConsulting/django-tempgres | 0 | 38026 | <filename>tempgres/service.py
import logging
import requests
logger = logging.getLogger(__name__)
class TempgresDatabaseService:
"""Connection to a tempgres service instance defined by an URL."""
def __init__(self, url, **kwargs):
"""Setup the Tempgress connection.
url can be None, in which ... | 3.125 | 3 |
tests/client/test_get_balance.py | kanzure/eth-testrpc | 164 | 38027 | def test_deploying_contract(client, hex_accounts):
pre_balance = client.get_balance(hex_accounts[1])
client.send_transaction(
_from=hex_accounts[0],
to=hex_accounts[1],
value=1234,
)
post_balance = client.get_balance(hex_accounts[1])
assert post_balance - pre_balance == 12... | 1.835938 | 2 |
marmot/features/google_translate_feature_extractor.py | qe-team/marmot | 19 | 38028 | <gh_stars>10-100
from goslate import Goslate
from nltk import word_tokenize
import ipdb
from marmot.features.feature_extractor import FeatureExtractor
from marmot.exceptions.no_data_error import NoDataError
class GoogleTranslateFeatureExtractor(FeatureExtractor):
def __init__(self, lang='en'):
self.lang... | 2.640625 | 3 |
hackerrank/built_ins/zipped.py | alex-d-bondarev/learn-python | 0 | 38029 | if __name__ == '__main__':
_, X = input().split()
subjects = list()
for _ in range(int(X)):
subjects.append(map(float, input().split()))
for i in zip(*subjects):
print("{0:.1f}".format(sum(i)/len(i)))
| 3.46875 | 3 |
scripts/dspace_dsa_maker.py | masonpublishing/dspace_simple_archives_import | 1 | 38030 | """
dspace_dsa_maker.py - prepare DSpace Simple Archives for import.
Copyright 2018 University of Toronto Libraries
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... | 2.296875 | 2 |
tests/test_notes_append_header.py | fujiawei-dev/tookit-py | 0 | 38031 | <gh_stars>0
"""
Date: 2022.04.13 10:28
Description: Omit
LastEditors: <NAME>
LastEditTime: 2022.04.13 10:28
"""
import tempfile
from pathlib import Path
from create_config_file.notes import notes_append_header
def test_notes_append_header():
path = tempfile.gettempdir()
file = Path(path) / "file.txt"
fi... | 2.046875 | 2 |
src/seirsplus/models/compartment_model_builder.py | SEIRS-Plus/v2 | 1 | 38032 | """
Programmatically building up compartment models
"""
# Standard Libraries
import json
# External Libraries
import numpy as np
class CompartmentModelBuilder:
"""
The CompartmentModelBuilder class gives helper functions for defining
a new compartment model from scratch within a python script. Initialize... | 3.28125 | 3 |
examples/multifig.py | ianhi/mpl-playback | 1 | 38033 | <reponame>ianhi/mpl-playback<filename>examples/multifig.py
"""
================
Multiple Figures
================
Test case for putting multiple figures into sphinx gallery.
The playback file was generated using:
``record_file("multifig.py", ["slider_fig", "fig"])``
"""
import numpy as np
import matplotlib.pyplot as... | 3.09375 | 3 |
Chapter7 - whileandinput.py | Gmentesh2/Chapter7-input-whileloop-exerciseHM | 0 | 38034 | promt = "Here you can enter"
promt += "a series of toppings>>>"
message = True
while message:
message = input(promt)
if message == "Quit":
print(" I'll add " + message + " to your pizza.")
else:
break
promt = "How old are you?"
promt += "\nEnter 'quit' when you a... | 4.28125 | 4 |
scrape_mars.py | Jessica-Xia/web-scraping-challenge | 0 | 38035 | <reponame>Jessica-Xia/web-scraping-challenge
from splinter import Browser
from bs4 import BeautifulSoup
import pandas as pd
import time
def init_browser():
executable_path = {"executable_path": "chromedriver.exe"}
return Browser("chrome", **executable_path, headless=False)
def scrape_news():
browse... | 3.359375 | 3 |
test2.py | edwkar/marrow | 0 | 38036 | <reponame>edwkar/marrow
def foo(a, b):
x = a * b
y = 3
return y
def foo(a, b):
x = __report_assign(7, 8, 3)
x = __report_assign(pos, v, 3)
y = __report_assign(lineno, col, 3)
print("hello world")
foo(3, 2)
report_call(0, 3, foo, (report_eval(3), report_eval(2),))
| 2.734375 | 3 |
.ipynb_checkpoints/utils_discrete-checkpoint.py | hsharsh/pinn-torch | 1 | 38037 | # Data processing imports
import scipy.io as io
import numpy as np
from pyDOE import lhs
# Plotting imports
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scipy.interpolate import griddata
import matplotlib.gridspec as gridspec
def load_dataset(file):
data = io.loadma... | 2.140625 | 2 |
scripts/gpipe/gene2gene.py | CGATOxford/Optic | 0 | 38038 | ##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# 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 Fre... | 1.890625 | 2 |
pyneval/cli/pyneval.py | CSDLLab/PyMets | 12 | 38039 | import argparse
import importlib
import os
import sys
import jsonschema
import pkg_resources
from multiprocessing import Pool, cpu_count
from pyneval.errors.exceptions import InvalidMetricError, PyNevalError
from pyneval.pyneval_io import json_io
from pyneval.pyneval_io import swc_io
from pyneval.metric.utils import a... | 2.140625 | 2 |
src/tratamientos/migrations/0006_auto_20170201_1554.py | mava-ar/sgk | 0 | 38040 | <filename>src/tratamientos/migrations/0006_auto_20170201_1554.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2017-02-01 18:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencie... | 1.203125 | 1 |
src/alembic/versions/89944f8b35b3_db_games_model_migrations.py | green2cerberuz/db_vgames | 0 | 38041 | """DB Games model migrations
Revision ID: 89944f8b35b3
Revises:
Create Date: 2020-11-14 03:49:03.255055
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "89944f8b35b3"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### comman... | 1.976563 | 2 |
way/python/first_steps/basics/testgui.py | only-romano/junkyard | 0 | 38042 | from tkinter import *
clicks = 0
def click_button():
global clicks
clicks += 1
buttonText.set("Clicks {}".format(clicks))
root = Tk()
root.title("GUI на Python")
root.geometry("300x250")
buttonText = StringVar()
buttonText.set("Clicks {}".format(clicks))
btn = Button(textvariable=bu... | 3.640625 | 4 |
genomic_data_service/region_indexer_elastic_search.py | ENCODE-DCC/genomic-data-service | 3 | 38043 | <reponame>ENCODE-DCC/genomic-data-service
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import NotFoundError
from elasticsearch.helpers import bulk
RESIDENTS_INDEX = 'resident_regionsets'
REGION_INDEXER_SHARDS = 2
SEARCH_MAX = 99999
FOR_REGULOME_DB = 'regulomedb'
INDEX_SETTINGS = {
'index'... | 2.03125 | 2 |
genda/formats/dosages.py | jeffhsu3/genda | 5 | 38044 | """ Functions for working with tabix dosages in pandas dataframes
"""
import gzip
import numpy as np
import pandas as pd
import pysam
import statsmodels.api as sm
class Dosage(object):
def __init__(self, dosages, annotations, gene_name):
# Match up the annotation dataframe with the dosage dataframe
... | 2.375 | 2 |
string/Python/0067-add-binary-1.py | ljyljy/LeetCode-Solution-in-Good-Style | 1 | 38045 | class Solution:
def addBinary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:]
if __name__ == '__main__':
a = "11"
b = "1"
solution = Solution()
result = solution.addBinary(a, b)
print(result)
result1 = int(a, 2)
result2 = int(b, 2)
print(result1)
pr... | 3.5 | 4 |
envergo/evaluations/migrations/0007_auto_20210816_1212.py | MTES-MCT/envergo | 0 | 38046 | <gh_stars>0
# Generated by Django 3.1.12 on 2021-08-16 12:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluations', '0006_auto_20210709_1235'),
]
operations = [
migrations.AddField(
model_name='evaluation',
... | 1.773438 | 2 |
app/knowledgecard.py | thaithimyduyen/German-Study-TelegramBot | 2 | 38047 | import logging
import enum
import copy
import telegram.error
from telegram import (
InlineKeyboardButton,
InlineKeyboardMarkup,
ParseMode
)
from app.entities import KnowledgeStatus
from app.card import Card
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level... | 2.40625 | 2 |
learn_pyblish/myplugins/myplugin2.py | kingmax/py | 0 | 38048 | import pyblish.api
########################################################################
class MyPlugin2(pyblish.api.ContextPlugin):
""""""
#----------------------------------------------------------------------
def process(self, context):
print('hello from plugin2')
| 2.375 | 2 |
tests/saliency_tests/visualizer_tests/test_mol_visualizer.py | k-ishiguro/chainer-chemistry | 1 | 38049 | <gh_stars>1-10
import os
import numpy
import pytest
from rdkit import Chem
from chainer_chemistry.saliency.visualizer.mol_visualizer import MolVisualier # NOQA
from chainer_chemistry.saliency.visualizer.mol_visualizer import SmilesVisualizer # NOQA
def test_mol_visualizer(tmpdir):
# Only test file is saved wi... | 2.09375 | 2 |
src/driver.py | 01mu/gamefaqs-scraper | 1 | 38050 | #
# gamefaqs-scraper
# github.com/01mu
#
from gamefaqs_scraper import GFSBoard
from gamefaqs_scraper import GFSThread
board = GFSBoard()
board.get_site('234547-super-smash-bros-ultimate', 0)
threads = board.find()
print("Pages: " + str(board.max_page) + "\n")
for i in range(len(threads)):
print(threads[i].title... | 2.765625 | 3 |
ServerPackage/Game.py | PaulieC/rls | 0 | 38051 | <filename>ServerPackage/Game.py
__author__ = "<NAME>, <NAME>, <NAME>"
__version__ = "sprint1"
__credits__ = ["<NAME>, <NAME>"]
# imports
from ServerPackage import Observer
class Game(Observer.Observer):
name = None
@staticmethod
def num_players_per_game():
"""
Number of players in a game... | 3.3125 | 3 |
crawlers/news/items.py | Ceruleanacg/rena | 7 | 38052 | <filename>crawlers/news/items.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
from scrapy.loader.processors import TakeFirst, Join
class NewsItem(Item):
url = Fi... | 2.4375 | 2 |
intermediate/5/5-intermediate.py | KindaExists/daily-programmer | 0 | 38053 |
"""
[intermediate] challenge #5
Source / Reddit Post - https://www.reddit.com/r/dailyprogrammer/comments/pnhtj/2132012_challenge_5_intermediate/
"""
words = []
sorted_words = []
with open('intermediate/5/words.txt', 'r') as fp:
words = fp.read().split()
sorted_words = [''.join(sorted(word)) for word in word... | 3.65625 | 4 |
Kevin/4.py | kevin-ci/advent-of-code-2020 | 0 | 38054 | <reponame>kevin-ci/advent-of-code-2020<gh_stars>0
import re
input = """iyr:2010 ecl:gry hgt:181cm
pid:591597745 byr:1920 hcl:#6b5442 eyr:2029 cid:123
cid:223 byr:1927
hgt:177cm hcl:#602927 iyr:2016 pid:404183620
ecl:amb
eyr:2020
byr:1998
ecl:hzl
cid:178 hcl:#a97842 iyr:2014 hgt:166cm pid:594143498 eyr:2030
ecl:hzl
... | 1.789063 | 2 |
brdashsite/batchrecords/migrations/0003_auto_20190226_2017.py | JNDib/brdashproject | 0 | 38055 | # Generated by Django 2.1.5 on 2019-02-27 02:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('batchrecords', '0002_auto_20190226_1939'),
]
operations = [
migrations.RemoveField(
model_name='historicalbatchrecord',
name... | 1.46875 | 1 |
precipy/identifiers.py | ananelson/precipy | 0 | 38056 | <filename>precipy/identifiers.py
from enum import Enum
import hashlib
import inspect
import logging
import os
logger = logging.getLogger(name="precipy.identifiers")
metadata_filename = "metadata.pkl"
class FileType(Enum):
ANALYTICS = "analytics"
METADATA = "metadata"
TEMPLATE = "template"
DOCUMENT = ... | 2.5625 | 3 |
src/python/marbles/ie/test/passive_test.py | marbles-ai/ie | 0 | 38057 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import unittest
from marbles.ie import grpc
from marbles.ie.ccg import parse_ccg_derivation2 as parse_ccg_derivation
from marbles.ie.drt.drs import Rel
from marbles.ie.semantics.ccg import process_ccg_pt, pt_to_ccg_derivation
from marbles.i... | 2.328125 | 2 |
lib/devops/supervisor.py | jpotter/angel | 0 | 38058 | <filename>lib/devops/supervisor.py
import fcntl
import os
import random
import select
import signal
import sys
import time
import traceback
from devops.file_and_dir_helpers import *
from angel.util.pidfile import *
from devops.unix_helpers import set_proc_title
from angel.stats.disk_stats import disk_stats_get_usage_f... | 2.03125 | 2 |
muspinsim/experiment.py | muon-spectroscopy-computational-project/muspinsim | 0 | 38059 | <filename>muspinsim/experiment.py<gh_stars>0
"""experiment.py
Classes and functions to perform actual experiments"""
import logging
import numpy as np
import scipy.constants as cnst
from muspinsim.constants import MU_TAU
from muspinsim.utils import get_xy
from muspinsim.mpi import mpi_controller as mpi
from muspinsi... | 2.671875 | 3 |
obtain_rms_frequency_domain.py | antonyvm1102/Redbox | 0 | 38060 | <filename>obtain_rms_frequency_domain.py<gh_stars>0
import signal_processing as sp
import numpy as np
import sys
import time
"""
Get RMS in frequency domain per 1/3 octave band for all signals and translate to min/mean/max per band.
TODO: add option to exclude zeros from the minimum as in 'capture_min_max_mean_... | 2.75 | 3 |
addons/calendar/tests/test_event_notifications.py | SHIVJITH/Odoo_Machine_Test | 0 | 38061 | <gh_stars>0
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from unittest.mock import patch
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from odoo import fields
from odoo.tests.common import SavepointCase, new_test_user
from od... | 2.265625 | 2 |
transformers/configuration_classifier.py | Rohit--Sharma/transformers | 0 | 38062 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 2.390625 | 2 |
teeport/__init__.py | SPEAR3-ML/teeport-client-python | 0 | 38063 | <filename>teeport/__init__.py
# Copyright (c) 2019-2020, SPEAR3 authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
# The reason we need nest_asyncio is that we run multiple event loops in a
# single thread, that's not allowed. The future work should be create a new
# thread for each... | 1.53125 | 2 |
Eval/model.py | gabbar-08/Coupon-Redemption-Prediction | 0 | 38064 |
#Step 1 :- Importing dependancies and train test data generated
from config import *
train_data = pd.read_csv("data/train_data/train_feature.csv")
test_data = pd.read_csv("data/test_data/test_feature.csv")
#Step 2 :- Getting train data insights and drop unnecessary columns, Splitting data into input and target ... | 3.140625 | 3 |
docs/_ext/django_models.py | bhrutledge/jahhills.com | 1 | 38065 | <reponame>bhrutledge/jahhills.com<filename>docs/_ext/django_models.py
# Auto-document Django models
# Copied and adapted from https://djangosnippets.org/snippets/2533/
import inspect
from django.utils.html import strip_tags
from django.utils.encoding import force_text
from django.db import models
def process_docstri... | 2.359375 | 2 |
Hacker_Rank/Python: Division.py | Jai-kishan/Practice-Questions | 1 | 38066 | a=int(input())
b=int(input())
print (a/b)
a=float(a)
b=float(b)
print (a/b) | 3.5625 | 4 |
math/tests/testcases.py | fuz-woo/gpython | 520 | 38067 | # Copyright 2018 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Testcases for functions in math.
#
# Each line takes the form:
#
# <testid> <function> <input_value> -> <output_value> <flags>
#
# where:
#
# <testid> ... | 2.59375 | 3 |
db_query/middleware/complex_bundles_parse.py | hbolzan/django-sql-to-rest | 1 | 38068 | import requests
import functools
from django.shortcuts import get_object_or_404
from db_query.models import PersistentQuery
def apply_middleware(raw_data, exec_sql_fn, *args, **kw_args):
return adapt_bundle(raw_data[0], exec_sql_fn)
def adapt_bundle(raw_data, exec_sql_fn):
return {
"id": raw_data.ge... | 2.046875 | 2 |
template/template/scripts/launcher.py | chrismear/renios | 15 | 38069 | <reponame>chrismear/renios<filename>template/template/scripts/launcher.py
#!/usr/bin/env python
#@PydevCodeAnalysisIgnore
# Copyright 2004-2012 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... | 2.078125 | 2 |
do_aramco_sz.py | Meso272/PyTorch-VAE | 0 | 38070 | <reponame>Meso272/PyTorch-VAE
import os
import numpy as np
datafolder="/home/jliu447/lossycompression/aramco"
ebs=[i*1e-4 for i in range(1,10)]+[i*1e-3 for i in range(1,10)]+[i*1e-2 for i in range(1,11)]
cr=np.zeros((29,51),dtype=np.float32)
psnr=np.zeros((29,51),dtype=np.float32)
filelist=os.listdir(datafolder)
fi... | 1.65625 | 2 |
setup.py | leandrocorreasantos/rapidapi_criptobot_br | 0 | 38071 | <filename>setup.py
#!/usr/bin/env python
from setuptools import setup
setup(
name='rapidapi-criptobot-br',
version='1.1.0',
packages=['api'],
description='class to access criptobot-br on rapidapi',
author='<NAME>',
author_email='<EMAIL>',
install_requires=['requests', 'json'],
keywords=... | 1.296875 | 1 |
ch10_rnn/7_3_BiRNN.py | pythonProjectLearn/TensorflowLearning | 0 | 38072 | #%%
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 3.09375 | 3 |
server.py | YuliyaSinkevich/idealtrust | 0 | 38073 | #!/usr/bin/env python3
from app import app
import argparse
HOST = '127.0.0.1'
PORT = 8080
PROJECT_NAME = 'idealtrust'
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog=PROJECT_NAME, usage='%(prog)s [options]')
parser.add_argument('--port', help='port (default: {0})'.format(PORT), default=PORT)
... | 2.34375 | 2 |
security/open_alchemy/__init__.py | open-alchemy/OpenAlchemyPackage | 0 | 38074 | """Namespace placeholder."""
| 1.109375 | 1 |
source/StartWindow.py | FelixTheoret/Ergocycle | 0 | 38075 | <reponame>FelixTheoret/Ergocycle
"""
Created on Wed March 24 11:15:00 2022
@author: <NAME>
"""
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QFont, QPixmap
import numpy
import datetime
#from Ergocycle.source.TestingWindow import TestingWindow
from TestingWindow import TestingWindow
... | 2.109375 | 2 |
LinkShopSite/models/fileService.py | mikiec84/linkshop | 6 | 38076 | import json
import os
import pymongo
'''
fileService.py
Author: <NAME>
'''
mongo_client = pymongo.MongoClient()
#db = {}
'''
initialize
Takes a 'unique_id'entifier and sets up a database in MongoDB
and ensures that that database has collections associated with
the various file types that are stored.
'''
def init... | 3.203125 | 3 |
dlib/tools/python/test/test_vector.py | asm-jaime/facerec | 11,719 | 38077 | <reponame>asm-jaime/facerec
from dlib import vector, vectors, vectorss, dot
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
from pytest import raises
def test_vector_empty_init():
v = vector()
assert len(v) == 0
assert v.shape == (0, 1)
assert str(v... | 2.1875 | 2 |
superresolution_stage/models/archs/sftmd.py | xian1234/SRBuildSeg | 9 | 38078 | """ Architecture for SFTMD """
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.archs.arch_util as arch_util
import torch.nn.utils.spectral_norm as spectral_norm
class SFTLayer(nn.Module):
def __init__(self, nf=64, n_condition=10):
super(SFTLayer, self).__i... | 2.59375 | 3 |
modals/data_util.py | jamestszhim/modals | 29 | 38079 | <gh_stars>10-100
import copy
import os
import random
from pathlib import Path
import dill
import torch
import torchtext.data as data
import torchtext.datasets as datasets
from torch.utils.data import Sampler
from torchtext.vocab import GloVe
from modals.setup import EMB_DIR
def save_txt_dataset(dataset, path):
i... | 2.34375 | 2 |
setup.py | octopart/beaker_extensions | 1 | 38080 | <reponame>octopart/beaker_extensions<filename>setup.py
from setuptools import setup, find_packages
import sys, os
version = '11octo'
setup(name='beaker_extensions',
version=version,
description="Beaker extensions for additional back-end stores.",
long_description="""\
""",
classifiers=[], # Ge... | 1.492188 | 1 |
pyvims/planets/__type__.py | seignovert/pyvims | 4 | 38081 | """Abstract planet type."""
class Planet(type):
"""Abstract Planet object."""
MEAN_RADIUS = (None, None) # [km] ± err [km]
RADII = ((None, None), (None, None), (None, None)) # [km] ± err [km]
def __str__(cls):
return cls.__name__
def __repr__(cls):
retur... | 3.65625 | 4 |
core/models/sparse_bp_resnet.py | JeremieMelo/L2ight | 7 | 38082 | <gh_stars>1-10
"""
Description:
Author: <NAME> (<EMAIL>)
Date: 2021-10-24 16:24:50
LastEditors: <NAME> (<EMAIL>)
LastEditTime: 2021-10-24 16:24:50
"""
from typing import Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from pyutils.general import logger
from ... | 1.835938 | 2 |
src/discord_utils.py | pocc/bga_discord | 8 | 38083 | <filename>src/discord_utils.py
"""Utils that require discord."""
import logging
from logging.handlers import RotatingFileHandler
import discord
LOG_FILENAME = "errs"
logger = logging.getLogger(__name__)
handler = RotatingFileHandler(LOG_FILENAME, maxBytes=10000000, backupCount=0)
formatter = logging.Formatter("%(asct... | 2.828125 | 3 |
crackers/online_hash_cracker.py | MomboteQ/HASH | 0 | 38084 | ###################################################
# #
# Name : Online Hash Cracker (HASH++) #
# Created by : MomboteQ #
# Version : 1.0 #
# #
########... | 2.421875 | 2 |
sis-api/test/bdd/steps/membership.serialization.py | maxbilbow/7054CEM-sis | 0 | 38085 | <filename>sis-api/test/bdd/steps/membership.serialization.py
from datetime import date
from behave import *
from core.model import to_dict
from core.model.membership import Membership
from core.model.membership_type import MembershipType
from core.utils.serialization import serialize
use_step_matcher("re")
@when("... | 2.21875 | 2 |
DPGAnalysis/SiStripTools/python/poolSource_cff.py | ckamtsikis/cmssw | 852 | 38086 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(),
# skipBadFiles = cms.untracked.bool(True),
inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")... | 1.21875 | 1 |
orange3/Orange/preprocess/impute.py | rgschmitz1/BioDepot-workflow-builder | 54 | 38087 | import numpy as np
import scipy.sparse as sp
import Orange.data
from Orange.statistics import distribution, basic_stats
from Orange.util import Reprable
from .transformation import Transformation, Lookup
__all__ = [
"ReplaceUnknowns",
"Average",
"DoNotImpute",
"DropInstances",
"Model",
"AsValu... | 2.796875 | 3 |
aiida_vasp/workchains/verify.py | muhrin/aiida-vasp | 0 | 38088 | """
Verify workchain.
-----------------
Indented to be used to verify a calculation, perform corrections in inputs files and
restart depending on physical principles etc. E.g. issues that are outside the Calculators awereness,
or not currently checked in it. This workchain does currently nothing.
"""
# pylint: disabl... | 2.796875 | 3 |
cytominer_eval/operations/__init__.py | hillsbury/cytominer-eval | 0 | 38089 | <reponame>hillsbury/cytominer-eval
from .percent_strong import percent_strong
from .precision_recall import precision_recall
from .grit import grit
| 1.085938 | 1 |
storm_analysis/spliner/find_peaks_std.py | bintulab/storm-analysis | 0 | 38090 | #!/usr/bin/env python
"""
Cubic spline peak finder.
Hazen 03/16
"""
import pickle
import numpy
import tifffile
import storm_analysis.sa_library.analysis_io as analysisIO
import storm_analysis.sa_library.fitting as fitting
import storm_analysis.sa_library.ia_utilities_c as utilC
import storm_analysis.sa_library.matc... | 2.03125 | 2 |
server02.py | timgates42/csdesign | 116 | 38091 | <gh_stars>100-1000
###############################################################################
#
# Copyright (c) 2012 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without rest... | 1.84375 | 2 |
synth/__init__.py | lummax/switching-lattice-synth | 0 | 38092 | <filename>synth/__init__.py
import synth.timer
from synth.base import Function
from synth.dp_construction import DualProductConstruction
| 1.28125 | 1 |
ipsc/2016/g.py | csferng/competitive-programming | 0 | 38093 | import collections
import itertools
import re
import sys
read_str = lambda : sys.stdin.readline().strip()
read_str_list = lambda : sys.stdin.readline().strip().split()
read_int = lambda : int(read_str())
read_int_list = lambda : map(int, read_str_list())
read_float = lambda : float(read_str())
read_float_list = lambda... | 3.359375 | 3 |
book/sunglasses.py | gcvalderrama/python_foundations | 0 | 38094 | import unittest
def navigation(rows, cols, x, y):
if 1 <= x <= rows - 2 and 1 <= y <= cols - 2:
return [(x - 1 , y - 1), ( x - 1, y), ( x - 1, y + 1),
( x , y),
(x + 1 , y - 1), ( x + 1, y), ( x + 1, y + 1)]
return []
def hourglassSum(arr):
if n... | 3.25 | 3 |
TakeBlipPosTagger/mlflowlogger.py | guireis1/testpos | 0 | 38095 | <reponame>guireis1/testpos<filename>TakeBlipPosTagger/mlflowlogger.py
import os
import psutil
import mlflow
import seaborn as sns
import matplotlib.pyplot as plt
def save_confusion_matrix_from_tensor(confusion_matrix, labels,
current_epoch, save_dir):
"""Receive a confusion m... | 2.484375 | 2 |
scripts/camera_module/camera_module.py | dos-group/gardening-adventure | 5 | 38096 | <reponame>dos-group/gardening-adventure<filename>scripts/camera_module/camera_module.py
from argparse import ArgumentParser
from picamera import PiCamera
from time import sleep
from pathlib import Path
import os
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--resolution',
... | 3.03125 | 3 |
nova/scheduler/solvers/pluggable_hosts_pulp_solver.py | rishabh1jain1/schedwise | 0 | 38097 | <gh_stars>0
# Copyright (c) 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 2 | 2 |
run/gen-explicit-fee-schedules.py | three-Vs/hedera-services | 164 | 38098 | ###
# A script to convert the Services-consumable feeSchedules.json
# into the "typed" format used by the public pricing calculator.
###
import json
providers = ['nodedata', 'networkdata', 'servicedata']
typed_schedules = {}
with open('hedera-node/src/main/resources/feeSchedules.json', 'r') as fin:
cur_and_nex... | 2.640625 | 3 |
secparse/config.py | clwatkins/sec_edgar_parser | 8 | 38099 | <reponame>clwatkins/sec_edgar_parser
from pathlib import Path
import requests_oauthlib
# Define where filing data will be stored -- defaults to folder within user's home directory
ROOT_DIR = Path.home().joinpath("sec_parse_data")
DB_FILE_LOC = ROOT_DIR.joinpath("sec_parse_db.sqlite3")
# Yahoo API key (some finance ta... | 2.34375 | 2 |