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
gmdc_import.py
djalex88/blender-gmdc
1
12795751
<reponame>djalex88/blender-gmdc<gh_stars>1-10 #!BPY """ Name: 'GMDC (.gmdc, .5gd)' Blender: 249 Group: 'Import' Tooltip: 'Import TS2 GMDC file' """ #------------------------------------------------------------------------------- # Copyright (C) 2016 DjAlex88 (https://github.com/djalex88/) # # Permission is hereby gr...
1.726563
2
scripts/layers.py
hchoi405/dppm
3
12795752
<reponame>hchoi405/dppm """ BSD 2-Clause License Copyright (c) 2021, CGLAB All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright no...
1.351563
1
mapr/ojai/ojai_utils/ojai_list.py
mapr/maprdb-python-client
3
12795753
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * class OJAIList(list): def __init__(self): super(OJAIList, self)._...
2.171875
2
estimagic/__init__.py
vishalbelsare/estimagic
0
12795754
from estimagic import utilities from estimagic.differentiation.derivatives import first_derivative from estimagic.estimation.estimate_msm import estimate_msm from estimagic.estimation.msm_weighting import get_moments_cov from estimagic.inference.bootstrap import bootstrap from estimagic.optimization.optimize import max...
1.429688
1
2018/07/2018_07_30.py
devsagul/daily-coding-problem
0
12795755
""" Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters. For example, given s = "abcba" and k = 2, the longest substring with k distinct characters is "bcb". """ def longest_k(s, k): res = s[:k] l_res = k cur = res letters = set(cur) num_letters...
3.9375
4
setup.py
AllenCellModeling/CVAE_testbed
2
12795756
<filename>setup.py #!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() test_requirements = ["codecov", "f...
1.640625
2
lists as stacks and queues exerscise/01.Basic Stack Operations.py
nrgxtra/advanced
0
12795757
<gh_stars>0 n, s, x = input().split(' ') st = [] [st.append(int(x)) for x in input().split(' ')] for j in range(int(s)): st.pop() if int(x) in st: print('True') else: st = sorted(st) if st: print(st[0]) else: print('0')
3.109375
3
tests/test_custom_widgets.py
jerryc05/python-progressbar
806
12795758
<gh_stars>100-1000 import time import progressbar class CrazyFileTransferSpeed(progressbar.FileTransferSpeed): "It's bigger between 45 and 80 percent" def update(self, pbar): if 45 < pbar.percentage() < 80: return 'Bigger Now ' + progressbar.FileTransferSpeed.update(self, ...
2.9375
3
turdshovel/context.py
daddycocoaman/turdshovel
39
12795759
import os from copy import copy from typing import Any, List, Tuple from nubia import context, eventbus from nubia.internal import cmdloader from nubia.internal.cmdbase import AutoCommand from pygments.token import Name, Token from rich import box, inspect from rich.align import Align from rich.console import Console ...
1.976563
2
load_data/loader/videogames/pokemon_image_type.py
erickfmm/ML-experiments
0
12795760
# -*- coding: utf-8 -*- from pims import ImageReader from load_data.ILoadSupervised import ILoadSupervised from os.path import join, exists import csv class LoadPokemon(ILoadSupervised): def __init__(self, path="train_data/Folder_Videojuegos/pokemon-images-and-types"): self.path = path self.classe...
2.71875
3
tests/structural/structural_test.py
lukaschoebel/POTUSgen
0
12795761
<filename>tests/structural/structural_test.py import unittest from timeout_decorator import * from behavior.ngram_solutions import * from structural import structural_helpers try: from assignment import POTUSgen importFlag = True except: importFlag = False class TestStructural(unittest.TestCase): TIME...
2.71875
3
token_service/authz_client.py
WIPACrepo/token-service
0
12795762
<reponame>WIPACrepo/token-service """ Authz client common code. """ import asyncio import inspect from tornado.web import HTTPError from rest_tools.server import (Auth, RestHandler, RestServer, authenticated, catch_error) class AuthzHandler(RestHandler): def initialize(self, func, ...
2.625
3
cogs/GameManager.py
shadowlerone/TabletopClubDiscordBot
0
12795763
import discord from discord.ext import commands import random import asyncio class GameManager(): def __init__(self): self.setup() def setup(self): print("GameManager: Loaded") class GameManagerCog(commands.Cog): def __init__(self, client): self.client = clie...
2.828125
3
ivfcrvis/recording.py
tim-shea/buckeye_vis
1
12795764
<filename>ivfcrvis/recording.py import numpy import os import math from xml.etree import ElementTree from scipy.io import wavfile from matplotlib import pyplot from features import logfbank class Recording: """Recording reads an ITS file exported from LENA and parses out data about the segments and speakers in th...
2.890625
3
touchdown/tests/stubs/aws/launch_configuration.py
yaybu/touchdown
14
12795765
# Copyright 2016 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
1.953125
2
loop2.py
musaibnazir/MixedPy
0
12795766
<reponame>musaibnazir/MixedPy num = 5 for i in range(0,num): for j in range(0,num-i-1): print(end=" ") for j in range(1,i+1): print(j," ",end="") print()
3.90625
4
415-add-strings/415-add-strings.py
yuzhengcuhk/MyLeetcodeRecord
3
12795767
<reponame>yuzhengcuhk/MyLeetcodeRecord<gh_stars>1-10 class Solution: def addStrings(self, num1: str, num2: str) -> str: intNum1 = 0 intNum2 = 0 for i in num1: intNum1 = intNum1 * 10 + int(i) for i in num2: intNum2 = intNum2 * 10 + int(i) result = str(i...
2.6875
3
lambdapool/cli.py
rorodata/lambdapool
0
12795768
import sys import click from .function import LambdaPoolFunction from . import utils from tabulate import tabulate from lambdapool import exceptions @click.group() def cli(): pass @cli.command() @click.option('--requirements', '-r', type=click.Path(exists=True), help="Specifies the dependencies to be installed ...
2.5625
3
Algorithms/Dynamic_Programming/0-1_Knapsack_Problem/knapsack_problem_0_1.py
arslantalib3/algo_ds_101
182
12795769
<reponame>arslantalib3/algo_ds_101<filename>Algorithms/Dynamic_Programming/0-1_Knapsack_Problem/knapsack_problem_0_1.py #0/1 Knapsack problem def knapsack(val, wt, N, C): table = [[ 0 for _ in range(0, C+1)] for _ in range(0, N+1)] table[0][0] = 0 for i in range(1, N+1): for c in range(1...
3.578125
4
adventure_game.py
boslovski/adventure
0
12795770
import time import random def print_pause(message_to_print): print(message_to_print) time.sleep(2) def intro(item, option): print_pause("You find yourself standing in an open field, filled " "with grass and yellow wildflowers.\n") print_pause("Rumor has it that a " + option + " is some...
3.90625
4
efundsapi/views/__init__.py
code-scaffold/django
1
12795771
<gh_stars>1-10 from .demo import (DemoViewSet,)
1.03125
1
measure_mate/tests/models/test_rating.py
niche-tester/measure-mate
15
12795772
from builtins import str from django.test import TestCase from measure_mate.tests.factories import TemplateFactory, AttributeFactory, RatingFactory class RatingTestCases(TestCase): def test_creation_of_rating(self): template = TemplateFactory() attribute = AttributeFactory(template=template) ...
2.71875
3
watershed.py
by256/icsg3d
27
12795773
<filename>watershed.py """ ## Functions for computing watershed segmentation -------------------------------------------------- ## Author: <NAME>. ## Email: <EMAIL> ## Version: 1.0.0 -------------------------------------------------- ## License: MIT ## Copyright: Copyright <NAME> & <NAME> 2020, ICSG3D -----------------...
2.703125
3
hypemaths/exceptions/exceptions.py
janaSunrise/HypeMaths
8
12795774
class InvalidMatrixError(Exception): pass class MatrixDimensionError(Exception): pass class MatrixNotSquare(Exception): pass class InvalidVectorError(Exception): pass class VectorDimensionError(Exception): pass
1.890625
2
stanCode_Projects/my_photoshop/mirror_lake.py
EricCheng8679/sc-projects
0
12795775
""" File: mirror_lake.py ---------------------------------- This file reads in mt-rainier.jpg and makes a new image that creates a mirror lake vibe by placing an inverse image of mt-rainier.jpg below the original one. """ from simpleimage import SimpleImage def reflect(filename): """ :param filename: str, the...
4.09375
4
src/test/python/make_test_data.py
svanbodegraven/VariantSpark
6
12795776
import os import pandas as pd ''' Generate files for decision tree integration test ''' BASEDIR = os.path.abspath(os.path.join(os.path.basename(__file__), '../../../..')) def proj_path(path): return os.path.join(BASEDIR, path) data = pd.read_csv(proj_path('data/CNAE-9.csv'), names=['category'] + ["w_%s" %...
2.875
3
test/demographicsChart.py
gioandreou/thesis-old
0
12795777
<gh_stars>0 from openpyxl import load_workbook import numpy as np import datetime as dt import matplotlib.pyplot as plt import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as dates def func(pct, allvals): absolute = int(pct/100.*np.sum(allvals)) return "{:.1f}%\n({:d} )".format(...
2.890625
3
src/nitpick/style/__init__.py
jaysonsantos/nitpick
0
12795778
<gh_stars>0 """Styles parsing and merging.""" from .cache import parse_cache_option from .core import Style __all__ = ("Style", "parse_cache_option")
1.242188
1
experiments/tests/test_subsets_exp.py
snspam/sn_spam
0
12795779
""" Tests the subsets_exp module. """ import mock import unittest from .context import subsets_exp from .context import config from .context import runner from .context import test_utils as tu class Subsets_ExperimentTestCase(unittest.TestCase): def setUp(self): config_obj = tu.sample_config() moc...
2.734375
3
order.py
usjeong/coining-monitor
0
12795780
<reponame>usjeong/coining-monitor<filename>order.py import requests import sys import time from datetime import datetime def watch_price(max_price=0, min_price=0): resp = requests.get("https://api.coinone.co.kr/trades/?currency=eth") result = resp.json() order = result["completeOrders"][-1] price = ...
3.15625
3
main.py
ashduino101/python-terminal-video-player
0
12795781
<gh_stars>0 import os import sys import time import moviepy.editor import pygame from blessed import Terminal from PIL import Image, ImageOps import cv2 term = Terminal() HALF = '\N{LOWER HALF BLOCK}' def image(im): im = ImageOps.fit(im, (term.width, term.height * 2)) pixels = im.load() res = '' fo...
2.6875
3
us_counties_death_per_cases.py
RealHulubulu/Coronavirus_Data
0
12795782
<filename>us_counties_death_per_cases.py # -*- coding: utf-8 -*- """ Created on Mon Jun 29 15:54:28 2020 https://plotly.com/python/county-choropleth/?fbclid=IwAR1xOTSniBA_d1okZ-xEOa8eEeapK8AFTgWILshAnEvfLgJQPAhHgsVCIBE https://www.kaggle.com/fireballbyedimyrnmom/us-counties-covid-19-dataset better census data https:/...
2.34375
2
source_code/report.py
zacharybeebe/amabilis
0
12795783
from timberscale import Timber import csv import math ##### REPORT DATA MODULE class Report(object): LOG_RANGE_LIST = [["40+ ft", range(41, 121)], ["31-40 ft", range(31, 41)], ["21-30 ft", range(21, 31)], ["11-20 ft", range(11, 21)], ["1-10 ft", range(1, 11)]] def __init__(self, CSV, St...
2.984375
3
cnlp/data/data_loaders/data_loader.py
pfchai/CNLP
0
12795784
# -*- coding: utf-8 -*- from cnlp.common.registrable import Registrable class DataLoader(Registrable): default_implementation = 'simple' def __len__(self): raise TypeError def __iter__(self): raise NotImplementedError def iter_instances(self): raise NotImplementedError ...
2.15625
2
bin/geomag_webservice.py
alejandrodelcampillo/geomag-algorithms
1
12795785
<gh_stars>1-10 #! /usr/bin/env python from __future__ import absolute_import, print_function import os import sys from wsgiref.simple_server import make_server # ensure geomag is on the path before importing try: import geomagio # noqa (tells linter to ignore this line.) except ImportError: path = os.path ...
2.09375
2
arko/parser.py
bfontaine/arkopy
0
12795786
# -*- coding: UTF-8 -*- import ply.yacc from collections import OrderedDict from .lexer import tokens, lex # a:4:{s:4:"date";s:10:"2019-12-29";s:10:"type_fonds";s:11:"arko_seriel";s:4:"ref1";i:12;s:4:"ref2";i:4669;} from .models import Object start = 'expression' def p_expression(p): """expression : atom ...
2.546875
3
wmgraph/api/group.py
patrickatamaniuk/wmgraph
0
12795787
from .cache import memoized class MgraphConnectorGroupMixin: def list_groups(self, **kwargs): '''https://docs.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0''' url = f'/groups' search = kwargs.get('search') if search is not None: del kwargs['search'] ...
2.46875
2
scripts/quest/q22000e.py
G00dBye/YYMS
54
12795788
<reponame>G00dBye/YYMS<filename>scripts/quest/q22000e.py # 22000 | Strange dream (Evan intro) sm.setSpeakerID(1013101) sm.sendNext("Hey, Evan. You up? What's with the dark circles under your eyes? Didn't sleep well? Huh? A strange dream? What was it about? Whoa? A dream about a dragon?") sm.sendSay("Muahahahahaha, a ...
1.609375
2
aaTwitter.py
OpenLinkedSocialData/aa01
0
12795789
#! /usr/bin/env python #-*- coding: utf8 -*- # put this on /usr/local/bin/ # without .py extension from twython import TwythonStreamer import datetime, pymongo class MyStreamer(TwythonStreamer): def on_success(self, data): if 'text' in data: now=datetime.datetime.now() nick=data['us...
2.34375
2
faker/providers/miscelleneous.py
kaflesudip/faker
1
12795790
# coding=utf-8 # module provided just for backward compatibility from .misc import *
1.226563
1
tilosutils/package_info.py
dertilo/util
0
12795791
<gh_stars>0 # heavily inspired by https://github.com/NVIDIA/NeMo MAJOR = 0 MINOR = 1 PATCH = 0 PRE_RELEASE = '' # Use the following formatting: (major, minor, patch, pre-release) VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE) __shortversion__ = '.'.join(map(str, VERSION[:3])) __version__ = '.'.join(map(str, VERSION[:3...
1.679688
2
setup.py
Narcissist1/wechat-pay
9
12795792
<gh_stars>1-10 from setuptools import setup setup( name='wechat-pay-sdk', packages=['wechatpay'], version='0.6.2', description='A sdk for wechat pay', author='<NAME>', license='MIT', include_package_data=True, author_email='<EMAIL>', url='https://github.com/Narcissist1/wechat-pay', ...
1.359375
1
plugin.video.vstream/resources/sites/streamingk_com.py
akuala/REPO.KUALA
2
12795793
<gh_stars>1-10 # -*- coding: utf-8 -*- # Vstream https://github.com/Kodi-vStream/venom-xbmc-addons from resources.lib.gui.hoster import cHosterGui from resources.lib.gui.gui import cGui from resources.lib.handler.inputParameterHandler import cInputParameterHandler from resources.lib.handler.outputParameterHandler impor...
1.65625
2
modules/skin_detection.py
Merkll/llcolorizer
2
12795794
<filename>modules/skin_detection.py import cv2 import numpy as np import matplotlib.pyplot as plt min_HSV = np.array([0, 58, 30], dtype = "uint8") max_HSV = np.array([33, 255, 255], dtype = "uint8") def get_skin_region(image): image_BGR = cv2.imread(image) image_HSV = cv2.cvtColor(image_BGR, cv2.COLOR_BGR2HSV) ...
3.109375
3
api/edge_api/identities/views.py
SolidStateGroup/Bullet-Train-API
126
12795795
import base64 import json import typing import marshmallow from boto3.dynamodb.conditions import Key from drf_yasg2.utils import swagger_auto_schema from flag_engine.api.schemas import APITraitSchema from flag_engine.identities.builders import ( build_identity_dict, build_identity_model, ) from rest_framework ...
1.796875
2
uninas/training/metrics/abstract.py
cogsys-tuebingen/uninas
18
12795796
import torch from collections import defaultdict from uninas.data.abstract import AbstractDataSet from uninas.models.networks.abstract import AbstractNetwork from uninas.training.result import ResultValue from uninas.utils.args import ArgsInterface, Namespace, Argument class AbstractMetric(ArgsInterface): """ ...
2.578125
3
pymux/panes.py
jonathanslenders/old-pymux
0
12795797
<reponame>jonathanslenders/old-pymux from libpymux.panes import ExecPane import os class BashPane(ExecPane): def __init__(self, pane_executor, pymux_pane_env): super().__init__(pane_executor) self._pymux_pane_env = pymux_pane_env def _do_exec(self): os.environ['PYMUX_PANE'] = self._pym...
2.3125
2
LargeSample/BatchFiles/run_relax.py
jJosephM/SkyrmionDome
0
12795798
import subprocess path_oommf = 'C:/Users/jmank/Desktop/oommf12b4_20200930_86_x64/oommf/oommf.tcl' mif_file = 'C:/Users/jmank/Desktop/oommf12b4_20200930_86_x64/oommf/Skyrmion/skyrmionDome2.mif' length = 2 param_string = ' boxsi '#-parameters "integer_length % s" ' % length threads_string = ' -threads 28 ' oommf_comma...
1.71875
2
src/tanuki/data_backend/data_backend.py
M-J-Murray/tanuki
0
12795799
from __future__ import annotations from abc import abstractclassmethod, abstractmethod, abstractproperty from typing import ( TYPE_CHECKING, Any, Generator, Generic, Optional, Type, TypeVar, Union, ) import numpy as np from pandas import DataFrame from tanuki.data_store.data_type impo...
2.546875
3
runBowtie2.py
TaliaferroLab/AnalysisScripts
0
12795800
<gh_stars>0 #python3 import os import subprocess samples = ['CAD_Neurite_Rep1_S68', 'CAD_Neurite_Rep2_S69', 'CAD_Neurite_Rep3_S70', 'CAD_Neurite_Rep4_S71', 'CAD_Neurite_Rep5_S72', 'CAD_Soma_Rep1_S63', 'CAD_Soma_Rep2_S64', 'CAD_Soma_Rep3_S65', 'CAD_Soma_Rep4_S66', 'CAD_Soma_Rep5_S67', 'N2A_Neurite_Rep1_S58', 'N2A_Ne...
1.59375
2
dit/multivariate/secret_key_agreement/no_communication.py
leoalfonso/dit
1
12795801
""" Secret Key Agreement Rate when communication is not permitted. """ from .. import gk_common_information from ...utils import unitful __all__ = [ 'no_communication_skar', ] @unitful def no_communication_skar(dist, rv_x, rv_y, rv_z, rv_mode=None): """ The rate at which X and Y can agree upon a key wi...
3.15625
3
scripts/auth-server.py
cazz0059/stmonitor
6
12795802
SERVER_HOST = '127.0.0.1' SERVER_PORT = 1335 MAX_GET_REQUESTS = 10 import re, socket import random import string MSG_AUTH_RE = re.compile('''^AUTH +(.+) +(.+)''') MSG_GET_RE = re.compile('''^GET +(.+) +(.+)''') MSG_RVK_RE = re.compile('''^RVK +(.+)''') def serve(srv): while 1: print('[S] Waiting for new...
2.78125
3
utils/bundle/client.py
gravitationalwavedc/gwcloud_job_client
0
12795803
<filename>utils/bundle/client.py<gh_stars>0 """ Adapted from https://gist.github.com/grantjenks/095de18c51fa8f118b68be80a624c45a """ import http.client import socket import xmlrpc.client class UnixStreamHTTPConnection(http.client.HTTPConnection): def connect(self): self.sock = socket.socket( ...
2.15625
2
src/state.py
omegagussan/green-sally
0
12795804
#!/usr/bin/python3 import json state_file_path = "resources/state.json" version = 0 class StateVersionException(Exception): pass def _get_state(): with open(state_file_path, 'r') as state_file: data = json.load(state_file) if data['version'] == 0: data.pop('version', None) ...
2.875
3
tests/test_utils.py
MarinFCM/rain_alert
1
12795805
from rain_alert.utils import RECEIVERS_FILE_PATH import unittest from .context import utils import os class TestGetReceivers(unittest.TestCase): def test_no_file(self): # set the path of the receivers to this folder because in tests folder # we dont have the receivers file utils.RECEIVE...
2.40625
2
tpop/projet1/justine.py
justinemajor/gph
0
12795806
import numpy as np import matplotlib.pyplot as plt noir = [71, 69, 69, 70, 73, 70, 75, 75, 74, 72, 72, 72, 67, 69, 76, 76, 77, 77, 74, 72, 79, 79, 71, 71, 75, 74, 74, 73, 72, 73, 74] bleu = [73, 72, 73, 71, 71, 76, 77, 74, 74, 73, 82, 79, 79, 70, 72, 72, 74, 72 ,72, 70, 70, 73, 71, 73, 72, 72, 73, 72, 71, 71, 70] ora...
3.015625
3
perfil/migrations/0002_auto_20211018_0921.py
Felipe-007/Ecommerce
0
12795807
# Generated by Django 3.2.7 on 2021-10-18 12:21 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('perfil', '0001_initial')...
1.539063
2
boardroom2.py
robscallsign/HypeMan
11
12795808
<reponame>robscallsign/HypeMan import gspread import json import os import time from datetime import datetime import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib.table import Table from matplotlib.font_manager import FontProperties import numpy as np import statistics impor...
2.71875
3
cloudmesh/secchi/tensorflow/preprocessing/generate_tfrecord.py
cloudmesh/cloudmesh-secchi
0
12795809
<filename>cloudmesh/secchi/tensorflow/preprocessing/generate_tfrecord.py import os import io import pandas as pd import tensorflow as tf import sys sys.path.append("../../models/research") from PIL import Image from cloudmesh.secchi.tensorflow.utils_tf import dataset_util from collections import namedtuple, OrderedDi...
2.5
2
robustgp_experiments/demo1d.py
markvdw/RobustGP
16
12795810
import gpflow import matplotlib.pyplot as plt import numpy as np from robustgp import ConditionalVariance X = np.random.rand(150, 1) Y = 0.8 * np.cos(10 * X) + 1.2 * np.sin(8 * X + 0.3) + np.cos(17 * X) * 1.2 + np.random.randn(*X.shape) * 0.1 gpr = gpflow.models.GPR((X, Y), gpflow.kernels.SquaredExponential()) opt = ...
2.125
2
main.py
patrickhisnibrataas/gitlab-to-github-migration
0
12795811
import sys import time from src.github import Github from src.gitlab import Gitlab def exit(message): print(message) sys.exit() if __name__ == "__main__": # Get all gitlab repositories gitlab = Gitlab() gitlab_repos = gitlab.repositories() if gitlab_repos == None: exit('Not abl...
2.90625
3
opennmt/layers/common.py
dblandan/OpenNMT-tf
2
12795812
<reponame>dblandan/OpenNMT-tf """Defines common layers.""" import tensorflow as tf from tensorflow.python.framework import function @function.Defun( python_grad_func=lambda x, dy: tf.convert_to_tensor(dy), shape_func=lambda op: [op.inputs[0].get_shape()]) def convert_gradient_to_tensor(x): """Wraps :obj:`...
2.5625
3
app/api/view.py
saury2013/Memento
0
12795813
# -*- coding: utf-8 -*- from flask import make_response, request, jsonify from flask_login import login_required import json from werkzeug.utils import secure_filename import os from app.models.fragment import Fragment from app.models.branch import Branch from app.models.tag import Tag from app.api import api from app...
2.3125
2
updi/link.py
leonerd/pyupdi
197
12795814
<reponame>leonerd/pyupdi """ Link layer in UPDI protocol stack """ import logging import time from updi.physical import UpdiPhysical import updi.constants as constants class UpdiDatalink(object): """ UPDI data link class handles the UPDI data protocol within the device """ def __init__(self,...
2.71875
3
lib/launch_scripts/ARCHER/ptf_worker.py
melver/logan
0
12795815
<filename>lib/launch_scripts/ARCHER/ptf_worker.py #!/usr/bin/env python2 # Needs to run with ARCHER's Python version. """ Task-farm worker script. """ import sys import json import subprocess def main(argv): json_path = argv[1] parallel_workers = int(argv[2]) mpi_rank = int(argv[3]) - 1 if mpi_rank ...
2.421875
2
06_Alistirma/10_Cozunurluk_Ayarlama(SetTheResolution).py
REISOGLU53/OpenCV-Python
2
12795816
<reponame>REISOGLU53/OpenCV-Python import cv2 cv2.namedWindow("LiveCam") cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) print("weigth:"+str(cap.get(3))) print("height:"+str(cap.get(4))) cap.set(3, 800) cap.set(4, 720) print("weigth*:"+str(cap.get(3))) print("height*:"+str(cap.get(4))) while True: ...
3.0625
3
demo.py
vietbt/EVRPpp
5
12795817
from env.evrp import EVRPEnv from utils.config import read_config import numpy as np from env.worker import VectorizedEVRP from utils.plot import convert_plt_to_numpy, convert_plt_to_tf, plot_tours from utils import try_import_tensorflow tf = try_import_tensorflow() if __name__ == "__main__": config = rea...
1.859375
2
e9/9.py
neutronest/eulerproject-douby
4
12795818
for i in xrange(1000): for j in xrange(1000 - i): k = 1000 - i - j if i and j and k and i * i + j * j == k * k: print i, j, k print i * j * k
2.609375
3
lib/googlecloudsdk/command_lib/resource_manager/tag_arguments.py
google-cloud-sdk-unofficial/google-cloud-sdk
2
12795819
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. 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 requir...
1.882813
2
awsm/hooks/validators.py
jeevb/awsm
0
12795820
<reponame>jeevb/awsm from awsm.validators import yaml_dict from voluptuous import All, Coerce, Schema HOOK_SCHEMA = Schema(All(Coerce(yaml_dict), { 'includes': [str], 'tasks': [dict] })) HOOK_VARS_SCHEMA = All(Coerce(yaml_dict), dict) HOOKS_CFG_SCHEMA = Schema({ 'vars': HOOK_VARS_SCHEMA, str: HOOK_SC...
2.03125
2
wordservice/src/app.py
mjm461/step-funtions-example
0
12795821
from flask import jsonify from pyawsstarter import Logger from wordservice import create_app # Call the Application Factory function to construct a Flask application instance # using the standard configuration defined in /instance/flask.cfg application = create_app('flask.cfg') @application.errorhandler(Exception) ...
2.828125
3
dbmanage/passforget/urls.py
bopopescu/sbdb_new
3
12795822
from django.conf.urls import url from django.contrib import admin import views admin.autodiscover() urlpatterns = [ url(r'^pass_forget/$', views.pass_forget, name='pass_forget'), # url(r'^pass_rec/$', views.pass_rec, name='pass_rec'), ]
1.507813
2
bestbuyapi/api/stores.py
lv10/bestbuyapi
10
12795823
from ..api.base import BestBuyCore from ..constants import STORES_API from ..utils.exceptions import BestBuyStoresAPIError class BestBuyStoresAPI(BestBuyCore): def _api_name(self): return STORES_API # ================================= # Search by store by name or id # ======================...
2.546875
3
DP/Stock_Buy_Sell_1.py
anilpai/leetcode
0
12795824
''' Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit. Input: [7, 1, 5, 3, 6, 4] Output: 5 Input: [7, 6, 4, 3, 1] Output...
3.84375
4
src/enums.py
JQGoh/multivariate_time_series_pipeline
1
12795825
<reponame>JQGoh/multivariate_time_series_pipeline # -*- coding: utf-8 -*- from pathlib import Path class FilePathEnum(object): PROJECT_DIR_POSIX = project_dir = Path(__file__).resolve().parents[1] # PosixPath DOWNLOADED_ZIP = Path(PROJECT_DIR_POSIX).joinpath( "data/raw/household_power_consumption.zi...
2.109375
2
3d_wykresy.py
szarejkodariusz/3DRandomWalksInPython
0
12795826
<reponame>szarejkodariusz/3DRandomWalksInPython import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import random import numpy.random as npr import numpy as np # Number of steps n_steps = 100 # Number of random walks n_walks = 10 walks_x = [[0] * n_steps for i in range(n_...
3.390625
3
scripts/setup-sfe-benchmarks.py
jthorton/double-exp-vdw
1
12795827
<reponame>jthorton/double-exp-vdw import os.path from glob import glob from absolv.models import ( EquilibriumProtocol, SimulationProtocol, State, System, TransferFreeEnergySchema, ) from nonbonded.library.models.datasets import DataSet from openff.toolkit.typing.engines.smirnoff import ForceField ...
1.84375
2
app/simulator/stamp.py
wbj218/microVisualization
0
12795828
<filename>app/simulator/stamp.py<gh_stars>0 class Stamp: def __init__(self): self.enqueue_time = -1 self.picked_time = -1 self.processed_time = -1 self.send_time = -1 self.cache_send_time = -1 self.cache_get_back_time = -1 self.final_time = -1 self.delta_time = -1 self.values = {} self.checked_cach...
2.40625
2
tracker/lookups.py
TreZc0/donation-tracker
39
12795829
<filename>tracker/lookups.py from ajax_select import LookupChannel from django.contrib.auth import get_user_model from django.core.exceptions import PermissionDenied from django.db.models import Q from django.urls import reverse from django.utils.html import escape from django.utils.safestring import mark_safe import ...
2.09375
2
tellsticknet/protocols/fineoffset.py
molobrakos/tellsticknet
30
12795830
<gh_stars>10-100 def decode(packet): """ https://github.com/telldus/telldus/blob/master/telldus-core/service/ProtocolFineoffset.cpp >>> decode(dict(data=0x48801aff05))["data"]["temp"] 2.6 """ data = packet["data"] data = "%010x" % int(data) data = data[:-2] humidity = int(data[-2:],...
3.15625
3
few_shot/datasets.py
liaoweiduo/few-shot
0
12795831
<gh_stars>0 from torch.utils.data import Dataset import torch from PIL import Image from torchvision import transforms from skimage import io from tqdm import tqdm import pandas as pd import numpy as np import os from typing import List, Dict from config import DATA_PATH class OmniglotDataset(Dataset): def __ini...
2.484375
2
ebay.py
zweed4u/Analytics
0
12795832
<reponame>zweed4u/Analytics import requests, BeautifulSoup session=requests.session() headers={'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 Safari/537.36'} styleCode='B39254'#'BB1826' r=session.get('http://www.ebay.com/sch/i.html?_nkw='+str(styleCode)+'&LH_Com...
3.015625
3
job_applications/models.py
yhaojin/recruitment_pipeline
0
12795833
from django.db import models from .utils import upload_to_file, generate_random_string from .validators import validate_file class CompanyManager(models.Manager): def get_or_none(self, **kwargs): try: return self.get(**kwargs) except Company.DoesNotExist: return None cl...
2.328125
2
API/dataloader.py
gaozhangyang/DecST
2
12795834
from .dataloader_traffic import load_data as load_BJ from .dataloader_human import load_data as load_human from .dataloader_moving_mnist import load_data as load_mmnist from .dataloader_kth import load_data as load_kth from .dataloader_kitticaltech import load_data as load_kitticaltech def load_data(dataname,batch_siz...
2.1875
2
special_k/check_gpg_keys/verify_expiry.py
namoopsoo/special_k
0
12795835
# Copyright 2020-present Kensho Technologies, LLC. import logging import sys import click import gpg from ..signing import ( DAYS_WARNING_FOR_KEY_EXPIRATION, add_trusted_keys_to_gpg_home_dir, get_days_until_expiry, ) from ..utils import get_temporary_directory logger = logging.getLogger(__name__) logger...
2.3125
2
stylegan2/utils.py
moritztng/stylegan2-pytorch
0
12795836
from os import remove from os.path import isdir, join from pathlib import Path from gdown import download from zipfile import ZipFile def download_ffhq(path): path = join(path, 'ffhq') if not isdir(path): Path(path).mkdir(parents=True, exist_ok=True) path_zip = join(path, 'ffhq.zip') do...
2.59375
3
search/forms.py
pkimber/search
0
12795837
<gh_stars>0 # -*- encoding: utf-8 -*- from django import forms from haystack.forms import SearchForm class MySearchForm(SearchForm): """ Search records (exclude 'deleted' records by default)... For form information... see 'Creating your own form': http://django-haystack.readthedocs.org/en/latest/vie...
2.640625
3
setup.py
kalekundert/TestSuite
0
12795838
<reponame>kalekundert/TestSuite import distutils.core # Uploading to PyPI # ================= # $ python setup.py register -r pypi # $ python setup.py sdist upload -r pypi version = '0.0' distutils.core.setup( name='finalexam', version=version, author='<NAME>', url='https://github.com/...
1.21875
1
main.py
feng-y16/pinn_cavity
0
12795839
import pdb import time import lib.tf_silent import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.colors import Normalize from matplotlib.gridspec import GridSpec import os import pickle import argparse from lib.pinn import PINN from lib.network import Ne...
2.15625
2
mondrian_kernel.py
matejbalog/mondrian-kernel
10
12795840
<reponame>matejbalog/mondrian-kernel import heapq import numpy as np import scipy.sparse from sklearn import linear_model import sys import time from utils import sample_cut, errors_regression def evaluate_all_lifetimes(X, y, X_test, y_test, M, lifetime_max, delta, validation=False, mondri...
2.546875
3
2021/src/aoc2021/cli.py
Stannislav/Advent-of-Code
2
12795841
"""The command line application for running the advent of code solutions.""" import argparse import importlib import pathlib from typing import cast from aoc2021.lib import ModSolution def main() -> int: """Run the main CLI entry point.""" parser = argparse.ArgumentParser( description="Run the advent...
3.71875
4
Python/jadoo_and_dna_transcription.py
Rounak259/HackerEarth
0
12795842
'''dna_rna = str() nucleotides = {'A', 'C', 'G', 'T', 'U'} complement = {'G':'C', 'C':'G', 'T':'A', 'A':'U'} b = set(input()) if b.issubset(nucleotides): for i in b: if i in complement: dna_rna = dna_rna+complement[i] else: dna_rna = dna_rna+i print(dna_rna) el...
3.734375
4
bot/main.py
AlexGustafsson/irc-sentiment-bot
0
12795843
import csv import logging import random from argparse import ArgumentParser from irc import IRC from irc.messages import IRCMessage from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer positives = [ "(˶‾᷄ ⁻̫ ‾᷅˵)", "(っˆڡˆς)", "♥‿♥", "(づ。◕‿‿◕。)づ", "٩( ๑╹ ꇴ╹)۶", "ᕕ( ᐛ )ᕗ", "...
2.78125
3
source/io/dataloader.py
mwhitesi/notatum
0
12795844
import gzip import pandas as pd import numpy as np import io import os import re import torch import torch.utils.data as data_utils import subprocess import zipfile import zlib from Bio import AlignIO from Bio.SeqIO.FastaIO import FastaIterator, as_fasta from Bio.Align.Applications import MuscleCommandline class Ind...
2.375
2
Step/Custom/Jenkins.py
TheNexusAvenger/Kubuntu-Helper-Scripts
0
12795845
<reponame>TheNexusAvenger/Kubuntu-Helper-Scripts """ TheNexusAvenger Installs Jenkins and a separate Java version. """ import os import shutil from Step.Standard.DownloadArchive import downloadArchive from Step.Standard.DownloadFile import getDownloadLocation from Step.Standard.RunProcess import runProcess def inst...
2.140625
2
flt/model.py
davegreenwood/face-landmark-tool
4
12795846
"""construct landmark models """ import json def read_json(fname): with open(fname) as fid: data = json.load(fid) return data def write_json(model, fname): with open(fname, "w") as fid: json.dump(model, fid) index = dict( jaw=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1...
2.859375
3
src/apps/calendar/models.py
creimers/graphene-advent
0
12795847
from django.db import models import datetime from easy_thumbnails.files import get_thumbnailer from filer.fields.image import FilerImageField import shortuuid class Calendar(models.Model): name = models.CharField(max_length=250) uuid = models.CharField(max_length=22) YEAR_CHOICES = [(r, r) for r in r...
2.171875
2
gwent/common/Zone.py
shinoi2/gwent
0
12795848
<gh_stars>0 #!/usr/bin/python3 HAND = 0 HERO = 1 FIELD = 2 DECK = 3 GRAVEYARD = 4 REMOVED = 5
1.273438
1
src/Problem_7.py
BenjaminHb/WHU_CS_WebLearn
0
12795849
<filename>src/Problem_7.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # File Name: Problem_7.py # Project Name: WebLearn # Author: <NAME> # Created Time: 2019-01-13 02:04 # Version: 0.0.1.20190113 # # Copyright (c) <NAME> 2019 # All rights reserved. # if __name__ == '__main__'...
3.078125
3
app/ctr/__init__.py
ihong9059/flasky
0
12795850
from flask import Blueprint ctr = Blueprint('ctr', __name__) from . import views
1.25
1