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
tabixpy/_io.py
bejobioinformatics/tabixpy
3
12795651
<gh_stars>1-10 import gzip import json import struct import hashlib from ._logger import logger, getLogLevel from ._gzip import GZIP_MAGIC from ._consts import ( COMPRESS, ) from ._consts import ( TABIX_EXTENSION, ) from ._consts import ( TABIXPY_FORMAT_NAME, TABIXPY_FORMAT_VER, TABIXP...
2.15625
2
analyze/wavelet/base.py
ivanovwaltz/wavelet_sound_microscope
0
12795652
<filename>analyze/wavelet/base.py from functools import partial from itertools import chain, tee import logging import numpy as np log = logging.getLogger(__name__) PI2 = 2 * np.pi def pairwise(iterable): one, two = tee(iterable) next(two, None) return zip(one, two) def grouper(iterable, n): ret...
2.65625
3
melody.py
phinate/melody
0
12795653
import functools import inspect import equinox from typing import Callable, Iterable def compose(workflow: Iterable[Callable], do_jit: bool=False) -> Callable: def pipeline(*args, **kwargs): # *args are for grad, **kwargs are the rest res = dict([]) for f in workflow: sig = inspect....
2.25
2
tools/splitfasta/split_fasta.py
pavanvidem/galaxytools
0
12795654
<gh_stars>0 #!/usr/bin/env python import os import sys from Bio import SeqIO num_chunks = 0 if len(sys.argv) == 3: num_chunks = int(sys.argv[2]) input_filename = sys.argv[1] elif len(sys.argv) == 2: input_filename = sys.argv[1] else: exit("Usage: split_fasta.py <input_filename> [<num_chunks>]") os.m...
3.296875
3
RGBLed_lib.py
sonmezarda/RGB-LED-Library
0
12795655
<filename>RGBLed_lib.py #rgb led lib from machine import PWM, Pin import utime def convert(x, in_min, in_max, out_min, out_max): return (x - in_min) * (out_max - out_min) // (in_max - in_min) + out_min class RGBLed: anode = 'anode' cathode = 'cathode' def __init__(self, red_pin, gree...
3.421875
3
local/model_vqvae.py
blackbawx/SILA-Switching_Identificationy_by_Latent_Articulation
1
12795656
<filename>local/model_vqvae.py<gh_stars>1-10 import os, sys FALCON_DIR = os.environ.get('FALCONDIR') sys.path.append(FALCON_DIR) from models import * from layers import * from util import * from model import * class quantizer_kotha_arff(nn.Module): """ Input: (B, T, n_channels, vec_len) numeric tensor n_...
2.21875
2
modules/shapelets/__init__.py
shapelets/shapelets-compute
14
12795657
<reponame>shapelets/shapelets-compute # Copyright (c) 2021 Grumpy Cat Software S.L. # # This Source Code is licensed under the MIT 2.0 license. # the terms can be found in LICENSE.md at the root of # this project, or at http://mozilla.org/MPL/2.0/. from __future__ import annotations from ._version import get_version...
2.234375
2
solutions/week-3/requests_2.py
bekbolsky/stepik-python
1
12795658
import requests base_url = "https://stepic.org/media/attachments/course67/3.6.3/" with open("solutions/week-3/dataset_3378_3.txt") as f: first_url = f.readline().strip() r = requests.get(first_url) answer = r.text.strip() count = 1 while not answer.startswith("We"): r = requests.get(f"{base_url}{answer}") ...
3.1875
3
nf_core/lint/actions_awsfulltest.py
aunderwo/tools
0
12795659
<filename>nf_core/lint/actions_awsfulltest.py<gh_stars>0 #!/usr/bin/env python import os import yaml def actions_awsfulltest(self): """Checks the GitHub Actions awsfulltest is valid. In addition to small test datasets run on GitHub Actions, we provide the possibility of testing the pipeline on full size dat...
2.203125
2
compiler_gym/util/commands.py
thecoblack/CompilerGym
0
12795660
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import subprocess import sys from contextlib import contextmanager from signal import Signals from subprocess import Popen as _Popen from typi...
2.453125
2
storm_scheduler/task.py
eandersson/storm.scheduler
0
12795661
<filename>storm_scheduler/task.py import logging import time from typing import Callable import storm_scheduler from storm_scheduler import exception LOG = logging.getLogger(__name__) class Task: def __init__(self, func, *args, **kwargs): if not isinstance(func, Callable): raise exception.Ta...
3.015625
3
src/twitter_parser_mongo.py
alikhanlab/Building-Big-Data-Infrastucture-using-NoSQL-and-SQL
0
12795662
# Twitter Parser # Parses Data and uploads to MongoDB import twitter_access import mongo_access from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import re import tweepy import time from datetime import datetime from dateutil.parser import parse from py...
2.796875
3
image_trasnformations/__init__.py
Mauricio-xxi/image_transformations
0
12795663
<reponame>Mauricio-xxi/image_transformations<filename>image_trasnformations/__init__.py from hello import say_hello
1.109375
1
setup.py
scls19fr/pandas-helper-calc
7
12795664
from setuptools import setup setup( name="pandas_helper_calc", version="0.0.1", packages=["pandas_helper_calc"], license="MIT License", long_description=open("README.md").read(), long_description_content_type="text/markdown", )
1.320313
1
libs/models/__init__.py
taesung89/deeplab-pytorch
1
12795665
<reponame>taesung89/deeplab-pytorch<filename>libs/models/__init__.py from libs.models.resnet import * from libs.models.deeplabv2 import * from libs.models.deeplabv3 import * from libs.models.deeplabv3plus import * from libs.models.msc import * def init_weights(model): for m in model.modules(): if isinstan...
2.484375
2
nifi_cluster_coordinator/utils/url_helper.py
plexsystems/nifi-cluster-coordinator
7
12795666
import urllib.parse as urlparse from typing import List, Dict def construct_path_parts(parts: List[str]) -> str: """Return a string separated by '/' for a url path.""" if isinstance(parts, list): return '/'.join(parts) elif parts is None: return '' else: return parts def cons...
3.296875
3
src/Current Models/Two Space/fermat_sprial.py
PharaohCola13/Geotesimal
3
12795667
<gh_stars>1-10 import matplotlib.pyplot as plt from matplotlib import * from numpy import * from matplotlib.animation import * name = "<NAME>" def shape(fig, edge_c, edge_w, grid, radiusm, figcolor): plt.clf() def r_(u): r = a * sqrt(u) return r a = radiusm u = linspace(0, 10 * pi,1000) r = r_(u) ax = p...
2.953125
3
Bugscan_exploits-master/exp_list/exp-434.py
csadsl/poc_exp
11
12795668
#!/usr/bin/env python # -*- coding: utf-8 -*- #__author__ = '1c3z' #ref http://www.wooyun.org/bugs/wooyun-2010-076974 def assign(service, arg): if service == "douphp": return True, arg def audit(arg): url = arg + "admin/include/kindeditor/php/file_manager_json.php?path=/&dir=image" code, ...
1.992188
2
python101/Count_Extract_xml_attribute.py
geraudazangue/Python_Projects
0
12795669
# -*- coding: utf-8 -*- """ Created on Sat May 18 23:47:15 2019 @author: <NAME> """ import glob import os import os.path from pathlib import Path from lxml import etree import pandas as pd from datetime import datetime import logging import time start_time = time.time() logging.basicConfig(filename='app.log', filemod...
2.390625
2
python/iviz/Data/Float.py
eddy-ilg/iviz
0
12795670
<filename>python/iviz/Data/Float.py #!/usr/bin/env python3 #-*- coding: utf-8 -*- import ikit.io from ..Util import toQPixmap import numpy as np from ikit.dataops import heat_map_viz from ikit import read import os import math from copy import copy from ._Base import _Base from .VizItem import VizItem def colors(n): ...
2.4375
2
history/models.py
lievertom/2020.2-Projeto-Kokama-Ensino
0
12795671
<filename>history/models.py from django.db import models class KokamaHistory(models.Model): history_title = models.CharField(max_length=50) history_text = models.TextField() def __str__(self): return self.history_title
2.0625
2
news/migrations/0006_auto_20201111_0809.py
giantmade/giant-news
2
12795672
<filename>news/migrations/0006_auto_20201111_0809.py # Generated by Django 2.2 on 2020-11-11 08:09 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("news", "0005_relatedarticlecardplugin_relatedarticleplugin"), ] ...
1.992188
2
working/website/make_news_posts.py
flatironinstitute/spikeforest_old
1
12795673
<reponame>flatironinstitute/spikeforest_old<gh_stars>1-10 #!/usr/bin/env python import os import shutil import json import frontmatter def main(): if os.path.exists('news_posts'): shutil.rmtree('news_posts') os.mkdir('news_posts') newspath = '../../docs/news' news_posts = [] for fname in...
2.40625
2
app/spider_store/extractors/ku6.py
lihaoABC/trans_api
0
12795674
<reponame>lihaoABC/trans_api # _*_ codingLUTF-8 _*_ import logging import random import re import urllib.parse from app.spider_store.common import ( match1, get_content, ) from app.spider_store.configs import FAKE_USER_AGENT headers = { 'user-agent': random.choice(FAKE_USER_AGENT) } def baomihu...
2.15625
2
main.py
omarzanji/nlp-search
0
12795675
""" Given a substring, search an array of strings by cosine simularity (linear kernel) by returning the index with highest kernel output (confidence). """ class NLPSearch: def __init__(self): pass def process_data(self): pass def create_model(self): pass def...
3.171875
3
google API/NL.py
nfrumkin/ElMingle
1
12795676
# Imports the Google Cloud client library from google.cloud import language from google.cloud.language import enums from google.cloud.language import types # Instantiates a client client = language.LanguageServiceClient() ENTITY_TYPE_TO_IGNORE = [8, 9, 10, 11, 12] # The text to analyze text = "Aside from course work,...
2.921875
3
causal_world/metrics/__init__.py
michaelfeil/CausalWorld
2
12795677
from causal_world.metrics.metric_base import BaseMetric from causal_world.metrics.mean_accumulated_reward_metric import \ MeanAccumulatedRewardMetric from causal_world.metrics.mean_full_integrated_fractional_success \ import MeanFullIntegratedFractionalSuccess from causal_world.metrics.mean_last_fractional_s...
1.125
1
src/utils/key_generator.py
oswagner/rsa-implementation
0
12795678
<reponame>oswagner/rsa-implementation from base64 import b64decode from pyasn1.codec.der.encoder import encode from pyasn1.codec.der.decoder import decode from utils.private_key import AsnSchemaPrivateKey from utils.public_key import AsnSchemaPublicKey # # Utilizado como apoio para criação formatação das chaves # http...
2.609375
3
tests/test_models.py
lydiah2015/news-highlight
0
12795679
<filename>tests/test_models.py from app.models import Article,Source from unittest import TestCase class TestSource(TestCase): def setUp(self): self.source=Source("BuzzFeed","BuzzFeed is a cross-platform") def test_instance(self): self.assertIsInstance(self.source,Source) def test_create(...
3.09375
3
ch_python/def_tempconv.py
yehnan/rpi_book_yehnan
3
12795680
#!/usr/bin/env python def ftoc(f): return (f - 32) * 5 / 9 def ctof(c): return c * (9 / 5) + 32 print("Celsius degree 55 is equal to Fahrenheit degree " + str(ctof(55))); print("Fahrenheit degree 55 is equal to Celsius degree " + str(ftoc(55)));
3.890625
4
tests/conftest.py
idlesign/opencv-proto
18
12795681
<gh_stars>10-100 import pytest from pathlib import Path STUB = False if STUB: from pytest_stub.toolbox import stub_global stub_global({ 'cv2': '[mock_persist]', 'numpy': '[mock_persist]', }) @pytest.fixture def static_path(request): path = request.fspath def static_path_(fname...
2.015625
2
yabgp/message/attribute/nlri/evpn.py
OpenBGP/openbgp
0
12795682
<filename>yabgp/message/attribute/nlri/evpn.py # Copyright 2016 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.apac...
2.078125
2
Week6JamesNoonanAdv.py
WarpedDemon/Webtesting
0
12795683
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.common.exceptions import NoSuchElementException import time, math class PageGetSet: def __init__(self): ...
2.625
3
pages/urls.py
Garinmckayl/monet
0
12795684
from unicodedata import name from accounts import views as account_views from django.urls import path, reverse from .views import (AboutPageView, AuctionCreateView, AuctionDetailView, AuctionListView, BidCreateView, BidDetailView, DashboardPageView, DatasourceView, HomePageView, StripeConnectionVi...
1.929688
2
config.py
JamaSoftware/sync-status
0
12795685
<filename>config.py # Connection Settings JAMA_CONNECT_URL = "https://instance.jamacloud.com" USERNAME = "USERNAME" PASSWORD = "PASSWORD" # If using oauth, set OAUTH = True, set USERNAME = "CLIENT_ID" and PASSWORD="<PASSWORD>" OAUTH = False # Input / Output settings filter_id = 165 # Project's to check sync status ag...
2.046875
2
modules/duckduckgo.py
dngfx/MagicBot
1
12795686
<reponame>dngfx/MagicBot # --depends-on commands from src import ModuleManager, utils URL_DDG = "https://api.duckduckgo.com" class Module(ModuleManager.BaseModule): _name = "DDG" @utils.hook("received.command.duckduckgo", alias_of="ddg") @utils.hook("received.command.ddg", min_args=1) def duckduck...
2.359375
2
src/__init__.py
hoaphumanoid/twitter_bot
6
12795687
<gh_stars>1-10 __title__ = 'Twitter bot' __version__ = '1.0' __author__ = '<NAME>' __license__ = 'MIT license' __copyright__ = 'Copyright 2016 <NAME>' # Version synonym VERSION = __version__
1.007813
1
log_group_subscriber/util.py
oslokommune/okdata-log-group-subscriber
0
12795688
<gh_stars>0 import os def getenv(name): """Return the environment variable named `name`, or raise OSError if unset.""" env = os.getenv(name) if not env: raise OSError(f"Environment variable {name} is not set") return env
2.828125
3
base_model.py
chapternewscu/tensorflow_visual_attention
0
12795689
<gh_stars>0 import os import sys import json import numpy as np import pandas as pd import tensorflow as tf import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg from tqdm import tqdm from dataset import * from utils.words import * from utils.coco.coco import * from utils.coco.pycocoevalcap.eval ...
2.375
2
mitty/plugins/population/vn.py
latticelabs/Mitty-deprecated-
1
12795690
"""A population model that creates samples with more and more variants. Suitable for the aligner paper experiments ^ = intersection E = subset vx ^ v0 = v0 vx ^ v1 = v0 ... vx ^ vn = v0 v0 E v1 v1 E v2 v2 E v3 ... v(n-1) E vn This plugin does not honor the site frequency spectrum model and ignores the original 'p' v...
2.890625
3
tests/test_gosubdag_relationships_i126.py
flying-sheep/goatools
477
12795691
#!/usr/bin/env python """Test that GoSubDag contains ancestors from only the user-specified relationships""" # tests/test_gosubdag_relationships_i126.py # goatools/gosubdag/gosubdag.py # goatools/gosubdag/godag_rcnt.py # goatools/gosubdag/godag_rcnt_init.py # goatools/godag/go_tasks.py # goatools/obo_parser.py from __...
2.09375
2
booleans_operators.py
CrazyJ36/python
0
12795692
<reponame>CrazyJ36/python #!/usr/bin/env python3 # and, or, not if 1 < 2 and 1 < 3: print("true") else: print("false") if 1 < 0 or 1 > 2: print("true") else: print("false") if 1 != 2: print("true") if 1 != 2: print("true") if not 1 < 0: # "not <expr>" means false print("1 is not less ...
4.4375
4
base/apis/views.py
danielecook/upvote.pub
1
12795693
<filename>base/apis/views.py # -*- coding: utf-8 -*- """ All view code for async get/post calls towards the server must be contained in this file. """ import arrow from flask import (Blueprint, request, render_template, flash, g, session, redirect, url_for, jsonify, abort) from werkzeug import check_password_ha...
2.28125
2
robotpose/__init__.py
OSU-AIMS/RoPE-S3D
1
12795694
from .wizards import Wizard from .data import Dataset, DatasetInfo, AutomaticAnnotator from .simulation import Renderer, DatasetRenderer, RobotLookupCreator from .prediction import Predictor, LiveCamera from .paths import Paths from .prediction.analysis import Grapher from .prediction.synthetic import SyntheticPredicto...
1.21875
1
altair/vegalite/v2/schema/__init__.py
hydrosquall/altair
0
12795695
<filename>altair/vegalite/v2/schema/__init__.py from .core import * from .channels import *
1.078125
1
code/1078.py
Nightwish-cn/my_leetcode
23
12795696
<reponame>Nightwish-cn/my_leetcode<filename>code/1078.py class Solution: def findOcurrences(self, text: str, first: str, second: str) -> List[str]: lis = text.split() l = len(lis) return [lis[i + 2] for i in range(0, l - 2) if lis[i] == first and lis[i + 1] == second]
2.96875
3
Tectonic_Utils/geodesy/euler_pole.py
kmaterna/Utility_Code
4
12795697
""" Functions to rotate a point by a known euler pole. """ import numpy as np from . import fault_vector_functions def point_rotation_by_Euler_Pole(Point, Euler_Pole): """ Compute the velocity of rotation of a point about an Euler pole on a spherical earth. This function is useful for computing the veloc...
3.953125
4
comparer.py
Wason1/Multum
0
12795698
# Variables base_list = 'List_1' # this is the base list, each item in this list is checked for a match in the other list_2 = 'List_2' # List_2 is the name of the list in the excel file xlfile = 'DATA_IN.xlsx' # Importing Libs import pandas as pd import numpy as np # Smart Stuff df_0 = pd.read_excel(xlfile, dtype=str...
3.359375
3
src/common.py
daffidwilde/edo-paper
0
12795699
""" Common functions and parameters amongst the experiments. """ from edo.distributions import Uniform from sklearn.preprocessing import MinMaxScaler def scale_dataframe(individual): """ Scale the individual's dataframe to the unit square for calculating fitness. """ original = individual.dataframe.copy...
3
3
pycs/sparsity/mrs/mrs_tools.py
sfarrens/cosmostat
3
12795700
import numpy as np import random import os, sys from scipy import ndimage import healpy as hp from astropy.io import fits import matplotlib.pyplot as plt from scipy.signal import savgol_filter from astropy.io import fits from importlib import reload from pycs.misc.cosmostat_init import * from pycs.misc.mr_prog import...
1.984375
2
tests/contract/test_get_all_catalogs.py
Informasjonsforvaltning/organization-page-bffe
0
12795701
"""Contract test cases for cases for all organization catalogs.""" import json import pytest import requests from tests import responses @pytest.mark.contract @pytest.mark.docker def test_all_catalogs(docker_service: str) -> None: """Should return the all_catalogs response.""" url = f"{docker_service}/organ...
2.484375
2
build/build_nexus.py
evotext/ielex-data-and-tree
2
12795702
""" Builds a NEXUS file form a long-table format CSV. """ import csv from pathlib import Path from collections import defaultdict BASE = Path(__file__).parents[1] / "data" with open(BASE / "ielex.csv", encoding="utf-8") as h: data = list(csv.DictReader(h)) taxa = sorted(set([row["LANGUAGE"] for row in data])) ...
2.65625
3
python/sagiri-bot/SAGIRIBOT/data_manage/get_data/get_rank.py
GG-yuki/bugs
0
12795703
from graia.application.message.chain import MessageChain from graia.application.message.elements.internal import Plain from graia.application.message.elements.internal import At from SAGIRIBOT.basics.aio_mysql_excute import execute_sql async def get_rank(group_id: int, memberList: list) -> list: sql = "select * ...
2.140625
2
python/ABC111/ABC111A.py
yu8ikmnbgt6y/MyAtCoder
0
12795704
<gh_stars>0 def chg(n): if n==1: return 9 elif n==9: return 1 return n n = int(input()) n,a1 = divmod(n,10) n,a2 = divmod(n,10) n,a3 = divmod(n,10) print(100*chg(a3)+10*chg(a2)+chg(a1))
3.109375
3
day11/test_day11.py
Frost/aoc2021-py
0
12795705
from day11 import * test_input = """ 5483143223 2745854711 5264556173 6141336146 6357385478 4167524645 2176841721 6882881134 4846848554 5283751526 """ def test_cave_constructor(): cave = Cave(["12", "34"]) assert cave.energy_levels() == [[1,2], [3,4]] def test_simple_tick(): test_data = """ 1111...
2.5
2
forms/product_form.py
vankrajnova/selenium
0
12795706
<gh_stars>0 from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By class ProductForm: def __init__(self, app): self.app = app self._elements = Elements(app) def add_product_to_cart(self): quantity = self._elements.quantity().text ...
2.875
3
setup.py
dabapps/django-db-queue-exports
0
12795707
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import re import os import sys name = "django-db-queue-exports" package = "django_dbq_exports" description = "An extension to django-db-queue for monitoring long running jobs" url = "https://www.dabapps.com/" project_urls = {"Source": "https:...
2.015625
2
dragonflow/tests/unit/test_ryu_base_app.py
FrankDuan/df_code
0
12795708
<reponame>FrankDuan/df_code # Copyright (c) 2015 OpenStack Foundation. # 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/licens...
1.9375
2
cpydist/utils.py
timgates42/mysql-connector-python
1
12795709
<filename>cpydist/utils.py<gh_stars>1-10 # Copyright (c) 2020, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, as # published by the Free Software Foundation. # # This program is also distributed ...
1.5625
2
game/combat/effects/forgetmoveeffect.py
Sipondo/ulix-dexflow
5
12795710
from .baseeffect import BaseEffect class ForgetMoveEffect(BaseEffect): def __init__(self, scene, action): super().__init__(scene) self.spd_on_action = 250 self.target = action.target self.move = action.a_index def on_action(self): actor = self.scene.board.get_actor(sel...
2.484375
2
sympy/polys/densetools.py
matthew-brett/sympy
0
12795711
<gh_stars>0 """Advanced tools for dense recursive polynomials in `K[x]` or `K[X]`. """ from sympy.polys.densebasic import ( dup_strip, dmp_strip, dup_reverse, dup_convert, dmp_convert, dup_degree, dmp_degree, dmp_degree_in, dup_to_dict, dmp_to_dict, dup_from_dict, dmp_from_dict, dup_LC, dmp...
1.867188
2
tests/test_layers/test_activation.py
wkcn/mobula
47
12795712
import mobula.layers as L import numpy as np def test_sigmoid(): X = ((np.arange(10000) - 5000) / 1000.0).reshape((-1, 1, 1, 1)) data = L.Data(X, "data") data.reshape() l = L.Sigmoid(data) l.reshape() assert l.Y.shape == X.shape l.forward() l.dY = np.random.random(l.Y.shape) * 10 l....
3.0625
3
sls.py
yyyyyyyan/spotify-libre-scrobbler
0
12795713
<reponame>yyyyyyyan/spotify-libre-scrobbler import os import pickle import sys from argparse import ArgumentParser from configparser import ConfigParser from datetime import datetime from getpass import getpass from hashlib import md5 from math import ceil from pylast import LibreFMNetwork, SessionKeyGenerator, WSErro...
3.0625
3
rhoci/models/DFG.py
ahmedmagdyawaad/redhat-ci-dashboard
8
12795714
# Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
2.21875
2
GifGen/complexity.py
james-alvey-42/ProgramTools
0
12795715
<filename>GifGen/complexity.py<gh_stars>0 ''' Idea based on Shangnan (2019) [http://inspirehep.net/record/1722270] regarding classical complexity and it's relation to entropy. This script considers a string of K n-bits (x1 x2 ... xK) in an "all-i" configuration. It then randomly updates the configuration to illustrate ...
3.09375
3
convert/explode-dump.py
google/freebase-wikidata-converter
57
12795716
<reponame>google/freebase-wikidata-converter """ Copyright 2015 Google 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 Unle...
1.78125
2
wsl_spider/wsl_spider/spiders/course_info.py
waseda-room-finder/waseda-syllabus-scraper
4
12795717
<reponame>waseda-room-finder/waseda-syllabus-scraper<filename>wsl_spider/wsl_spider/spiders/course_info.py # -*- coding: utf-8 -*- import scrapy # This file is used to scrape a single course page. It is not used currently. class CourseInfoSpider(scrapy.Spider): name = 'course_info' allowed_domains = ['wsl.wa...
2.765625
3
jenkins/metrics/queue_metrics.py
levep/jenkins-exporter
16
12795718
from prometheus_client.core import GaugeMetricFamily def make_metrics(queue): list_metrics = [] # Total items in Queue metric = GaugeMetricFamily( 'jenkins_queue_total', 'Total items in Queue', labels=None ) metric.add_metric( labels=[], value=queue.get_to...
2.515625
3
webapp/src/database/queries/artifact_queries.py
muctadir/labeling-machine
0
12795719
from datetime import datetime from typing import List from sqlalchemy import insert, func, select, distinct from src import db from src.database.models import Artifact, LockedArtifact, ArtifactLabelRelation, FlaggedArtifact, LabelingData from src.helper.tools_common import string_none_or_empty, who_is_signed_in def...
2.328125
2
src/PQWER_dex.py
jsleslie/PQWER
0
12795720
<reponame>jsleslie/PQWER<gh_stars>0 """ changes made: make widgets parent explicitly declared Use either with root window or Toplevel Bind Return key to selection method """ #from tkinter import * import tkinter as tk import re from PIL import ImageTk, Image import json from tkinter import ttk # Helper ...
2.515625
3
code/Solution_0187_findRepeatedDnaSequences.py
qizhenkang/myLeetCode
0
12795721
<reponame>qizhenkang/myLeetCode # -*- coding: utf-8 -*- """ Created on Fri Oct 8 00:05:44 2021 @author: qizhe """ class Solution: def findRepeatedDnaSequences(self, s: str): """ 读题: 1、感觉像是,在找一个重复字符串,同时字符串长度为10,不是找目标,而是没有目标地找 2、心理上感觉比较麻烦,没有想到好办法 3、长度固定为10,字符只有ATCG四种,字符串最长达到...
2.546875
3
tests/test_forms.py
saxix/django-geo
9
12795722
<reponame>saxix/django-geo<filename>tests/test_forms.py # -*- coding: utf-8 -*- import pytest from geo.forms import administrativeareaform_factory_for_country from geo.models import AdministrativeArea from .fixtures import hierachy @pytest.mark.django_db def test_administrativeareaform_factory(hierachy): italy, r...
2.015625
2
scripts/npc/autogen_10308.py
hsienjan/SideQuest-Server
0
12795723
# ObjectID: 1000002 # ParentID: 10308 # Character field ID when accessed: 4000032 # Object Position X: 2522 # Object Position Y: -22
0.980469
1
demo/auth/__init__.py
yangfan9702/cibo
0
12795724
from demo.exceptions import AuthException def token_auth(fn): def wrapper(*args, **kwargs): from flask import request if request.headers.get("token", None) != "123": raise AuthException("Fail to get access") return fn(*args, **kwargs) return wrapper
2.65625
3
counter_attack/cli/commands/approximation_dataset.py
samuelemarro/anti-attacks
0
12795725
<gh_stars>0 import pathlib import click import torch from counter_attack import defenses, rejectors, training, utils from counter_attack.cli import definitions, options, parsing @click.group(name='approximation-dataset') def approximation_dataset(): pass @approximation_dataset.command(name='preprocessor') @opti...
2.34375
2
kite-python/kite_ml/kite/utils/reduce.py
kiteco/kiteco-public
17
12795726
<filename>kite-python/kite_ml/kite/utils/reduce.py<gh_stars>10-100 import tensorflow as tf def is_empty(x: tf.Tensor) -> tf.Tensor: return tf.equal(tf.reduce_sum(tf.shape(x)), 0) def safe_reduce_mean(x: tf.Tensor, value: float, name: str) -> tf.Tensor: # need conditional in case the tensor is empty to avoid...
2.765625
3
clean_purchase.py
MasonDMitchell/HackNC-2019
0
12795727
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy as sci import pandas as pd import numbers import csv import sys filepath = sys.argv[1] filename = filepath[filepath.rfind('/')+1:] print(filepath) data = pd.read_csv(filepath) print("Adding year column") data['year'] = data.apply...
2.9375
3
lidar_to_DEM_functions.py
xaviernogueira/gcs_gui
4
12795728
import arcpy from arcpy import env from arcpy.sa import * import file_functions from file_functions import * import create_centerline import create_station_lines from create_station_lines import create_station_lines_function import os from os import listdir from os.path import isfile, join import xlrd import shutil fro...
2.25
2
helper/make_url_secure.py
xei/image-server
0
12795729
<reponame>xei/image-server import base64 import hashlib def generate_url_token(url, secret_key): md5_digest = hashlib.md5( ("%s %s" % (url, secret_key)).encode("utf-8") ).digest() base64_encoded = base64.b64encode(md5_digest).decode("utf-8") # Make the key look like Nginx expects. token = base64_encoded....
2.78125
3
python_demo_v4_cookbook/data_structure/expand_sequence_one_by_one.py
renhongl/python_demo
1
12795730
p = (4, 5) x, y = p print(x, y) data = ['ACMD', 50, 90.1, (2012, 11, 12)] name, shares, price, date = data print(name, shares, date)
2.765625
3
train_keras.py
gangeshwark/RareEntityPrediction
0
12795731
from model_new.config import Config from model_new.keras_model import KerasModel from model_new.utils import load_json config = Config() model = KerasModel(config) train_set = load_json('dataset/train.json') # dev_set = load_json('dataset/dev.json') # sub_set = dev_set[:config.batch_size * 50] model.train(train_set,...
2.25
2
Standings/urls.py
pawelad/BLM
1
12795732
from django.conf.urls import patterns, url from Standings import views urlpatterns = patterns( '', # ex: /standings/ url(r'^$', views.standings_index, name='index'), )
1.53125
2
.githooks/pre-commit-python.py
eshepelyuk/gloo
3,506
12795733
#!/usr/bin/python3 # This script runs whenever a user tries to commit something in this repo. # It checks the commit for any text that resembled an encoded JSON web token, # and asks the user to verify that they want to commit a JWT if it finds any. import sys import subprocess import re import base64 import binascii ...
3.0625
3
lltk/corpus/fanfic/fanfic.py
literarylab/lltk
5
12795734
import os import lltk from lltk.text.text import Text from lltk.corpus.corpus import Corpus class TextFanFic(Text): pass class FanFic(Corpus): TEXT_CLASS=TextFanFic def compile(self,**attrs): """ This is a custom installation function. By default, it will simply try to download itself, unless a custom f...
2.953125
3
legacy/src/python/etriTools.py
seu0313/Bad-word-filter
0
12795735
<gh_stars>0 #-*- coding:utf-8 -*- import os import json import base64 import urllib3 BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def transcribe_etri(audio_file_path: str): """ETRI 음성처리 모듈입니다. 오디오 파일을 받으면 음성을 인식한 후 `한국어` 텍스트 데이터를 반환합니다. @status `Accepted` \\ @p...
2.984375
3
custos-client-sdks/custos-python-sdk/custos/samples/tenant_management_samples.py
hasithajayasundara/airavata-custos
10
12795736
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
1.726563
2
pyspark_config/yamlConfig/config.py
Patrizio1301/pyspark-config
0
12795737
<reponame>Patrizio1301/pyspark-config """This module implements abstract config class.""" from abc import ABCMeta from dataclasses import dataclass from pathlib import Path from typing import (Any, Union,Type, Optional) import yaml import os import warnings from future.utils import raise_from from enum import Enum from...
1.84375
2
acunetix/v11/db/tables/licenses.py
BenDerPan/DScaner
20
12795738
# uncompyle6 version 2.13.2 # Python bytecode 3.5 (3351) # Decompiled from: Python 3.5.3 (default, Jan 19 2017, 14:11:04) # [GCC 6.3.0 20170118] # Embedded file name: db\tables\licenses.py from sqlalchemy import * from sqlalchemy.orm import mapper from db.tables import metadata LicensesTable = Table('licenses', metada...
2.234375
2
resources/common_variables.py
enen92/script.retrogames
3
12795739
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Author: enen92 License: I don't care version 3.0 """ import xbmc,xbmcgui,xbmcaddon,os addon_id = 'script.retrogames' selfAddon = xbmcaddon.Addon(id=addon_id) datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile')).decode('utf-8') addonfolder = xbmc.trans...
2.078125
2
python/freq/getfreqs.py
pherna06/server-consumption
1
12795740
<filename>python/freq/getfreqs.py from cpufreq import cpuFreq # CPU control setup cpu = cpuFreq() # Get and check current frequencies. freqs = cpu.get_frequencies() if not freqs: print("No frequency reads available.") exit() # Print frecuencies by CPU. print("CPU frequencies (KHz):") [ print(f"C...
3.4375
3
DQM/CSCMonitorModule/python/csc_dqm_masked_hw_cfi.py
ckamtsikis/cmssw
852
12795741
<reponame>ckamtsikis/cmssw<filename>DQM/CSCMonitorModule/python/csc_dqm_masked_hw_cfi.py<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms #-------------------------- # Masked HW Elements #-------------------------- CSCMaskedHW = cms.untracked.vstring( # == Post LS1 - All ME4/2 chambers should be enabled ...
1.25
1
pymake/__init__.py
CallumJHays/pymake
1
12795742
from .cache import TimestampCache from .cli import cli from .decorator import makes from .environment import env, PATH from .shell import sh from .make import make, make_sync from .targets import Makefile, Target, Dependencies, Group from pathlib import Path __FLAG_IS_PYMAKEFILE__ = True __all__ = ["TimestampCache", ...
1.773438
2
superclasses/invetory.py
augusnunes/titanic-escape
0
12795743
# player inventory class Inventory: '''Classe que representa o inventário do jogador ''' def __init__(self): self.itens = [] self.nomes = [] ### implementar isso def add(self, item): if type(item) == list: for i in item: self.itens.append(i) ...
3.78125
4
manager.py
CipherWang/ckb-address-manager
2
12795744
<gh_stars>1-10 # -*- coding: UTF-8 -*- from bip_utils import Bip39ChecksumError, Bip39Languages, Bip39MnemonicValidator from bip_utils import Bip39SeedGenerator from bip_utils.bip.bip44_base import Bip32 from address import generateShortAddress, CODE_INDEX_SECP256K1_SINGLE, ckbhash from hashlib import sha256 # load m...
1.914063
2
exercises/palindrome-products/palindrome_products.py
wonhyeongseo/python
2
12795745
<reponame>wonhyeongseo/python<gh_stars>1-10 def largest_palindrome(max_factor, min_factor): pass def smallest_palindrome(max_factor, min_factor): pass
2.375
2
tests/test_palmetto.py
zojabutenko/palmetto-py
23
12795746
"""Test Palmetto.""" import pytest from palmettopy.palmetto import Palmetto from palmettopy.exceptions import CoherenceTypeNotAvailable, EndpointDown, WrongContentType @pytest.fixture def words(): """Load test data fixture.""" words = ["cake", "apple", "banana", "cherry", "chocolate"] return words @py...
2.40625
2
example/LSTMPoseMchine/converted/network_convert.py
ddddwee1/SULT
18
12795747
import model3 as M import numpy as np import tensorflow as tf params = np.load('lstmpm_d1.npy').item() params2 = np.load('lstmpm_d2.npy').item() def get_conv(name): res = [] # print(params[name]) res.append(params[name]['weights']) res.append(params[name]['bias']) # print(res[0].shape) return res def get_c...
2.34375
2
src/analysis/analysis.py
burakbalaban/airbnb_project
0
12795748
<reponame>burakbalaban/airbnb_project import sys import numpy as np import pandas as pd import xgboost as xgb from numba import jit from numba import prange from sklearn.model_selection import RandomizedSearchCV from bld.project_paths import project_paths_join as ppj def list_generator(keyword): """Function for...
3.328125
3
Django/StockDash/Stock/urls.py
gankersky/Stock
0
12795749
from django.urls import path, re_path from . import views # 这是应用Book中的url具体配置,请求到这里才能调用该应用的视图,上一级首先是调用BookManager的url,如果没有匹配admin # 那么进入应用的匹配Book.urls,之后才会进入这里应用的url urlpatterns = [ # http://127.0.0.1:8000/admin/ 匹配 # 正则匹配,对请求地址进行正则匹配,如果路径中包含admin,就把后台站点中的url信息包含到这个项目中,指明下一集路径如何匹配 # 如果匹配成功,那么直接调用...
2.203125
2
app/room/forms.py
kid-kodi/BioBank
0
12795750
<filename>app/room/forms.py from flask import request from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, TextAreaField, SelectField from wtforms.validators import ValidationError, DataRequired, Length from flask_babel import _, lazy_gettext as _l from app.models import Room class SearchForm...
2.40625
2