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
main.py
Pommers/LCExtract
0
12792951
<filename>main.py from src.LCExtract.LCExtract import LCExtract if __name__ == '__main__': LCExtract()
1.03125
1
import_export_google_civic/migrations/0001_initial.py
adborden/WeVoteBase
0
12792952
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='GoogleCivicCandidateCampaign', fields=[ ('id', ...
1.695313
2
aliyun_rocketmq_provider/__init__.py
Ed-XCF/airflow-provider-rocketmq
0
12792953
def get_provider_info(): return { "package-name": "airflow-providers-aliyun-rocketmq", "name": "Aliyun RocketMQ Airflow Provider", "description": "Airflow provider for aliyun rocketmq", "hook-class-names": ["aliyun_rocketmq_provider.hooks.aliyun_rocketmq.AliyunRocketMQHook"], ...
1.601563
2
rrs_cleaner.py
mwweinberg/red_raid_squeakquel
0
12792954
from bs4 import BeautifulSoup import urllib #sets the URLs h1 = "test_eng.html" h2 = "test2_eng.html" # need to either figure out how to skip "None" results or turn search_all into a string def headliner(url): soup = BeautifulSoup((open(url)), "lxml") head1 = soup.find_all(['h1','h2','h3']) head2 = soup.h2.st...
3.25
3
setup.py
test-room-7/alias
2
12792955
<filename>setup.py import os import sys from setuptools import setup from setuptools.command.install import install sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) from alias import ALIASES_DIR_VAR # noqa: E402 from alias import get_aliases_dir # noqa: E402 def set_env_var(var, v...
2.203125
2
test/client/network/test_get_public_ip.py
redmic-project/device-oag-buoy-buoy-client
0
12792956
import unittest from unittest.mock import patch from nose.tools import eq_ from buoy.client.network import ip class MockResponse: def __init__(self, **kwargs): self.content = str.encode(kwargs.pop('content', "")) self.status_code = kwargs.pop('status_code', 404) class TestPublicIP(unittest.Tes...
2.703125
3
data_handler/PostDataGenerator/InputEstimators/InputEstimationVisualizer.py
muratcancicek/pointer_head
0
12792957
<reponame>muratcancicek/pointer_head from .MappingFunctions import Boundary, StaticMapping, DynamicMapping from datetime import datetime from ... import Paths import numpy as np import cv2 import os class InputEstimationVisualizer(object): def __init__(self, sceneScale = 1, landmarkColorStr = ...
2
2
projects/Alleria/alleria/config.py
sm047/detectron2
5
12792958
<reponame>sm047/detectron2<gh_stars>1-10 #!/usr/bin/env python3 # @Time : 4/6/20 5:47 PM # @Author : fangcheng.ji # @FileName: config.py from detectron2.config import CfgNode as CN def add_alleria_config(cfg): _C = cfg # ---------------------------------------------------------------------------- # ...
1.515625
2
NYK.py
innovationgarage/shipdash
0
12792959
import json import numpy as np import pandas as pd pd.options.mode.chained_assignment = None from sklearn.preprocessing import Imputer, StandardScaler import DataSource import os.path class NYK(DataSource.DataSource): def __init__(self, app, dsrc_name='', dsrc_type='csv', dsrc_path='data/', file_name='', header_r...
2.9375
3
complex-flock.py
jasonmpittman/100-days-of-alife-code
0
12792960
#!/usr/bin/env python3 # Created on 05/07/2018 # @author: <NAME> # @license: MIT-license # Purpose: example of multiple agent flocking behavior # Explanation: import pygame, sys, random, math pygame.init() stopped = False window_height = 800 window_width = 600 black = (0,0,0) white = (255,255,255) class agent: ...
3.171875
3
autograd_minimize/torch_wrapper.py
brunorigal/autograd_minimize
8
12792961
import numpy as np import torch from .base_wrapper import BaseWrapper from torch.autograd.functional import hvp, vhp, hessian from typing import List, Tuple, Dict, Union, Callable from torch import nn, Tensor class TorchWrapper(BaseWrapper): def __init__(self, func, precision='float32', hvp_type='vhp', device='cp...
2.15625
2
tests/test_components.py
pritchardn/MonteCarloDlgApp
0
12792962
<gh_stars>0 import pytest from montecarlodlgapp import MonteCarloAppDrop, MyDataDROP given = pytest.mark.parametrize def test_myApp_class(): first = MonteCarloAppDrop("a", "a") second = MonteCarloAppDrop("a", "a") second.randomSeed = 100 first.initialize() second.initialize() pi_1 = first.ru...
2.453125
2
corehq/apps/smsbillables/management/commands/bootstrap_unicel_gateway.py
dslowikowski/commcare-hq
1
12792963
import logging from django.core.management.base import LabelCommand from corehq.apps.accounting.models import Currency from corehq.apps.sms.models import INCOMING, OUTGOING from corehq.apps.smsbillables.models import SmsGatewayFee from corehq.apps.unicel.api import UnicelBackend logger = logging.getLogger('accounting...
1.96875
2
src/robusta/runner/main.py
shahar-lev/robusta
0
12792964
import os import os.path from inspect import getmembers import manhole from .log_init import init_logging from .web import Web from ..core.playbooks.playbooks_event_handler_impl import PlaybooksEventHandlerImpl from .. import api as robusta_api from .config_loader import ConfigLoader from ..model.config import Registr...
1.851563
2
app/recipe/views.py
HHHMHA/recipe-app-api
1
12792965
from rest_framework import viewsets, mixins from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated from .serializers import TagSerializer, IngredientSerializer, RecipeSerializer from core.models import Tag, Ingredient, Recipe class BaseRecipeAttrViewSet(vi...
2.1875
2
tests/support/sample_app/serializers.py
proteanhq/flask-authentic
3
12792966
""" Serializers used by the sample app """ from authentic.entities import Account from protean.context import context from protean_flask.core.serializers import EntitySerializer from protean_flask.core.serializers import ma from .entities import Human class AccountSerializer(EntitySerializer): """ Serializer for...
2.796875
3
twitter_api/tweets_locale_by_tag.py
lcontini/twitter_search_api
3
12792967
#### NOT WORKING import logging import configs import tweepy import pymongo import json # TWITTER PARAMS HASHTAGS_LIST = configs.HASHTAGS_LIST # MONGODB PARAMS MONGO_COL_TWEETS = configs.MONGO_COL_TWEETS MONGO_COL_USER = configs.MONGO_COL_USER MONGO_COL_TTAGS = configs.MONGO_COL_TTAGS MONGO_COL_LOCALE = configs.MONG...
2.671875
3
baiduTransAPI.py
dujiaxin/Dajia_AI
1
12792968
# coding=utf-8 import http.client import hashlib import urllib import random import json class BaiduTranslate: appid = '' # 填写你的appid secretKey = '' # 填写你的密钥 httpClient = None def __init__(self, appid, secretKey): self.appid = appid self.secretKey = secretKey def translate(se...
2.59375
3
quotes/api/views.py
vyahello/quotes
3
12792969
<reponame>vyahello/quotes """Module represents API for routes.""" from typing import List, Type from rest_framework.generics import ( ListCreateAPIView, RetrieveUpdateDestroyAPIView, ) from app.models import Quote from .serializers import QuoteSerializer from .permissions import IsOwnerOrReadOnly class Quotes...
2.296875
2
dataverse/dataverse.py
rliebz/dataverse-client-python
1
12792970
import requests from dataset import Dataset from exceptions import ( InsufficientMetadataError, MethodNotAllowedError, OperationFailedError, ConnectionError ) from utils import get_element, get_elements, sanitize class Dataverse(object): def __init__(self, connection, collection): self.connection...
2.625
3
mergify_engine/tests/functional/actions/test_update.py
truthiswill/mergify-engine
266
12792971
# -*- encoding: utf-8 -*- # # Copyright © 2018–2021 Mergify SAS # # 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 appl...
2.09375
2
0701-0800/0725-Split Linked List in Parts/0725-Split Linked List in Parts.py
jiadaizhao/LeetCode
49
12792972
<reponame>jiadaizhao/LeetCode<filename>0701-0800/0725-Split Linked List in Parts/0725-Split Linked List in Parts.py # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def splitListToParts(self, root: ListNode, k: int) -> Lis...
3.625
4
spirv_tools/passes/dead_inst_elim.py
kristerw/spirv-tools
22
12792973
<reponame>kristerw/spirv-tools """Removes unused instructions. The definition of "unused instruction" is an instruction having a return ID that is not used by any non-debug and non-decoration instruction, and does not have side effects.""" from spirv_tools import ir def remove_debug_if_dead(inst): """Remove debu...
2.21875
2
docassemble/ALRMFinancialCounsellingForm/data/modules/test_access.py
mferrare/docassemble-ALRMFinancialCounsellingForm
0
12792974
import msal import logging import requests import json config = { "authority": "https://login.microsoftonline.com/9f4083b0-0ac6-4dee-b0bb-b78b1436f9f3", "client_id": "d584a43a-c4c1-4fbe-9c1c-3cae87420e6e", "scope": [ "https://graph.microsoft.com/.default" ], "secret": "<KEY>", "endpoint": "https://...
2.625
3
raysect/core/math/cython/tests/test_tetrahedra.py
raysect/source
71
12792975
# Copyright (c) 2014-2021, Dr <NAME>, Raysect Project # 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 notice, # thi...
1.359375
1
test_relation.py
melahi/my-tensorflow-layers
1
12792976
<reponame>melahi/my-tensorflow-layers import numpy as np import tensorflow as tf from tensorflow.python.keras import testing_utils, backend from tensorflow.python.keras.utils import get_custom_objects from tensorflow.python.platform import test from relation import Relation class RelationTest(test.TestCase): @...
2.28125
2
typeidea/comment/models.py
ShanGis/TypeIdea
0
12792977
from django.db import models from django.contrib.auth.models import User from blog.models import Post class Comment(models.Model): STATUS_ITEMS = ( (1,'正常'), (2,'删除'), ) target = models.CharField(max_length=200, null=True, verbose_name='评论目标') content = models.CharField(max_length=20...
2.140625
2
mmdet/ops/ops/rotated/rotate_roi_align.py
qgh1223/SLRDet
27
12792978
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from mmdet import _Custom as _C from apex import amp class _RROIAli...
1.945313
2
eqv_transformer/dynamics_predictor.py
oxcsml/lie-transformer
36
12792979
from torch import nn from attrdict import AttrDict import torch import torch.nn.functional as F from lie_conv.dynamicsTrainer import Partial from torchdiffeq import odeint from lie_conv.hamiltonian import SpringV, SpringH, HamiltonianDynamics, KeplerV, KeplerH class DynamicsPredictor(nn.Module): """This class i...
2.109375
2
hackerrank/Algorithms/implementation/strange-code.py
tjeubaoit/algorithm
0
12792980
<reponame>tjeubaoit/algorithm<filename>hackerrank/Algorithms/implementation/strange-code.py # Complete the strangeCounter function below. def strangeCounter(t): c, i = 0, 0 while c < t: c += 3 << i i += 1 return c - t + 1 def strangeCounter2(t): rem = 3 while t > rem: t = t...
3.59375
4
brainstat/tutorial/__init__.py
rmarkello/BrainStat
0
12792981
<gh_stars>0 """Functions required for the BrainStat Tutorials"""
1.09375
1
src/sim/basicExampleTest/results/aco.py
andremtsilva/dissertacao
0
12792982
<reponame>andremtsilva/dissertacao import acopy import networkx as nx def main(): G = nx.read_graphml('graph_binomial_tree_5.graphml') print(G.nodes()) print(nx.get_node_attributes(G, 'IPT')) """ solver = acopy.Solver(rho=.03, q=1) colony = acopy.Colony(alpha=1, beta=3) tour = solver....
2.984375
3
gameServer/playerCode/trade.py
hydrogen602/settlersPy
0
12792983
<gh_stars>0 from typing import Dict, List from ..extraCode.location import Resource from ..extraCode.util import ActionError from .player import Player class Trade: def __init__(self, cost: Dict[Resource, int], goodsOffered: Dict[Resource, int]): self._cost: Dict[Resource, int] = cost self._good...
3.046875
3
ieee_1584/equations.py
LiaungYip/arcflash
1
12792984
<reponame>LiaungYip/arcflash # Copyright 2022, <NAME> - https://www.penwatch.net # Licensed under the MIT License. Refer LICENSE.txt. import logging from math import log10, sqrt from ieee_1584.cubicle import Cubicle from ieee_1584.tables import table_1, table_3, table_4, table_5 def I_arc_intermediate(c: Cubicle, V...
2.078125
2
setup.py
Pratilipi-Labs/python-logware
0
12792985
<reponame>Pratilipi-Labs/python-logware<gh_stars>0 from setuptools import setup setup(name='logware', version='0.1.4', description='Logging middleware for python web services', url='https://github.com/Pratilipi-Labs/python-logware', author='Giridhar', author_email='<EMAIL>', license='MIT', ...
1.023438
1
run/index-correct.py
ai-ku/uwsd
3
12792986
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "<NAME>" import sys from collections import defaultdict as dd from nlp_utils import fopen pos_file = sys.argv[1] aw_file = sys.argv[2] TAG = "-NONE-" aw_lines = fopen(aw_file).readlines() indices = dd(list) for line in aw_lines: line = line.split() lin...
2.578125
3
dpmm/data.py
jmeyers314/DP_SNe
20
12792987
import numpy as np from utils import pick_discrete class PseudoMarginalData(object): def __init__(self, data, interim_prior): # Data should have dims [NOBJ, NSAMPLE, NDIM] or [NOBJ, NSAMPLE] if NDIM is 1 # interim_prior should have dims [NOBJ, NSAMPLE] self.data = data self.interim...
2.8125
3
bitgo/cmd.py
geeks121/pybitgo
3
12792988
<filename>bitgo/cmd.py<gh_stars>1-10 __author__ = 'sserrano' import json import os from .bitgo import BitGo def load_config(filename): if os.path.exists(filename): try: return json.load(open(filename, 'rb')) except ValueError: return {} else: return {} def updat...
2.40625
2
2017/d5/jumps.py
remarkablerocket/advent-of-code
0
12792989
#!/usr/bin/env python3 from operator import eq as isequal def import_input(path): with open(path, encoding='utf-8') as infile: return [int(line) for line in infile] instructions = import_input("input.txt") class Jumper: def __init__(self, instructions): self.instructions = instructions ...
3.53125
4
domainparsers/imgur.py
petarGitNik/reddit-image-downloader
3
12792990
#!/usr/bin/python3 """ This module contains classes for parsing the imgur.com site. It consists of three classes: ~ ImgurException ~ ImgurFileFormats ~ Imgur Imgur is the main class and it obtains list of direct image urls that could be used to download images. Example usage: ```python3 imgur = Imgur('http://imgur...
2.984375
3
pyfibre_analysis_tools/__init__.py
franklongford/pyfibre_analysis_scripts
0
12792991
from .analysis_tools import load_databases # noqa: E501 from .plotting import confidence_ellipse, scatter, plot_roc_curve, plot_lda_analysis # noqa: E501
1.085938
1
sa.py
Crismaria11/Lab03_SecDS
0
12792992
import pefile import numpy as np # import os execs = [ "1F2EB7B090018D975E6D9B40868C94CA", "33DE5067A433A6EC5C328067DC18EC37", "65018CD542145A3792BA09985734C12A", "<KEY>", "<KEY>", "<KEY>", "<KEY>", "<KEY>", "A316D5AECA269CA865077E7FFF356E7D", "<KEY>", "AL65_DB05DF0498B59B42A8E493CF3C10C578", "B07322743778B5868475DBE...
1.335938
1
main.py
roesel/growth
1
12792993
# -*- coding: utf-8 -*- ''' The main script to run, enables profiling. ''' import numpy as np import math from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from crystal import * from plot_init_tools import * def main(num_of_growths): ''' Main method to start simulation. Uncomment specific ...
2.859375
3
setup.py
TomaLaPlazaConCabeza/web-app
0
12792994
<reponame>TomaLaPlazaConCabeza/web-app from setuptools import find_packages, setup with open("README.md") as handle: LONG_DESCRIPTION = handle.read() setup( name="web_app", description="Wep App for TomaLaPlazaConCabeza", long_description=LONG_DESCRIPTION, version="0.1.0-dev", author="TomaLaPla...
1.4375
1
src/basic/go_cache.py
invokerrrr/alphago_weak
0
12792995
# -*- coding: utf-8 -*- from os import path, getcwd, makedirs, listdir, remove from typing import * import pickle from abc import ABCMeta, abstractmethod from sgfmill.sgf import Sgf_game import numpy as np from .go_types import * __all__ = ["set_cache_dir", "get_cache_dir", "get_game_dir", "get_archive_dir", ...
2.484375
2
test/integration/targets/script/files/no_shebang.py
Container-Projects/ansible-provider-docs
37
12792996
<reponame>Container-Projects/ansible-provider-docs import sys sys.stdout.write("Script with shebang omitted")
1.328125
1
god_zip.py
mbmccoy/voice_of_god
2
12792997
from collections import defaultdict import gzip import os import random import textwrap class Heresy(Exception): """You have defiled the word of God!""" pass def bits(byte_string): """Generates a sequence of bits from a byte stream""" for byte in byte_string: for bit_num in range(8): ...
3.421875
3
backend/apps/users/urls.py
tomoya-kwansei/emonotateV2
0
12792998
<reponame>tomoya-kwansei/emonotateV2 from rest_framework.routers import DefaultRouter from django.conf.urls import url, include from .views import * router = DefaultRouter() router.register(r'users', UserViewSet) router.register(r'curves', CurveViewSet, basename='curves') router.register(r'contents', ContentViewSet, b...
2.3125
2
tests/conftest.py
JackGuyver/pyansys
0
12792999
import socket import os import pytest import pyvista from pyansys.misc import get_ansys_bin import pyansys from pyansys.errors import MapdlExitedError pyvista.OFF_SCREEN = True # check for a valid MAPDL install with CORBA valid_rver = ['182', '190', '191', '192', '193', '194', '195', '201'] EXEC_FILE = None for rv...
1.820313
2
bm25.py
ChosenOne2241/BM25
0
12793000
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Description: Build a structural data from orginial Cranfield collection and # implement the BM25 alogrithm information retrieval; # also 5 evaluation methods (precision, recall, MAP, P at N and # NDCG at N) are applied. # ...
2.3125
2
variants/migrations/0013_smallvariantflags_flag_summary.py
brand-fabian/varfish-server
14
12793001
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-14 19:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("variants", "0012_auto_20181114_1914")] operations = [ migrations.AddField( ...
1.664063
2
exchangelib/services/get_attachment.py
RossK1/exchangelib
1,006
12793002
from itertools import chain from .common import EWSAccountService, create_attachment_ids_element from ..util import create_element, add_xml_child, set_xml_value, DummyResponse, StreamingBase64Parser,\ StreamingContentHandler, ElementNotFound, MNS # https://docs.microsoft.com/en-us/exchange/client-developer/web-se...
2.109375
2
spinsim/__init__.py
rpanderson/spinsim
0
12793003
<filename>spinsim/__init__.py """ """ # from . import utilities from enum import Enum import numpy as np import numba as nb from numba import cuda from numba import roc import math sqrt2 = math.sqrt(2) sqrt3 = math.sqrt(3) class SpinQuantumNumber(Enum): """ Options for the spin quantum number of a system. ...
2.96875
3
board/boot.py
vincent-l-j/micropython-stubber
1
12793004
<filename>board/boot.py<gh_stars>1-10 # This file is executed on every boot (including wake-boot from deepsleep) import machine import uos as os try: import esp esp.osdebug(None) except ImportError: esp = None try: import pyb pyb.country("US") # ISO 3166-1 Alpha-2 code, eg US, GB, DE, AU py...
2.53125
3
atm_controller.py
chulpyo/simple-atm-controller
0
12793005
from __future__ import annotations from typing import List, Dict, Tuple, Optional from abc import ABCMeta, abstractmethod from enum import Enum from bank import Bank from cash_bin import CashBin from card_reader import CardReader class ControlType(Enum): SeeBalance = (0, "잔고 출력") Deposit = (1, "입금") With...
3.3125
3
teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/viewmodels/project_fortesting_list_view.py
zhangyin2088/Teamcat
6
12793006
#coding=utf-8 ''' Created on 2015-10-10 @author: Devuser ''' class ProjectFortestingList(object): def __init__(self,fullpart,isversion,fortestings): self.fullpart=fullpart self.isversion=isversion self.fortestings=fortestings
2.046875
2
cloudrunner_server/api/controllers/groups.py
ttrifonov/cloudrunner-server
2
12793007
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # /******************************************************* # * Copyright (C) 2013-2014 CloudRunner.io <<EMAIL>> # * # * Proprietary and confidential # * This file is part of CloudRunner Server. # * # * CloudRunner Server can no...
1.984375
2
couchfs/api.py
thanos/couchfs
1
12793008
""" A client api for couchdb attachments """ """Main module.""" import logging import fnmatch import io import mimetypes import os import pathlib import re import tempfile from contextlib import contextmanager import requests logger = logging.getLogger(__file__) echo = logger.info class CouchDBClientException(Exc...
2.90625
3
0x02-python-import_modules/5-variable_load.py
darkares23/holbertonschool-higher_level_programming
0
12793009
<gh_stars>0 #!/usr/bin/python3 if __name__ == "__main__": import variable_load_5 print("{:d}".format(variable_load_5.a))
1.84375
2
7kyu/jaden_casing_strings.py
nhsz/codewars
1
12793010
# http://www.codewars.com/kata/5390bac347d09b7da40006f6/ import string def to_jaden_case(s): return string.capwords(s)
2
2
03/solve.py
jkowalleck/AoC2020
0
12793011
<reponame>jkowalleck/AoC2020<filename>03/solve.py from collections import namedtuple from os import path from typing import List INPUT_FILE = path.join(path.dirname(__file__), 'input') def get_input() -> List[str]: with open(INPUT_FILE) as fh: return [line.rstrip('\n') for line in fh.readlines()] class...
3.421875
3
scripts/annotate_variants.py
gwaygenomics/pdx_exomeseq
15
12793012
""" <NAME> 2017 scripts/annotate_variants.py Use ANNOVAR to first convert a sample into annovar format and then annotate """ import os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument('-m', '--merged', action='store_true', help='use directory for merged VCF...
2.46875
2
Week 3/Actual answer.py
JustCodeIt729/Coding-Challenges
3
12793013
def get_max_profit(stock_prices): if len(stock_prices) < 2: raise ValueError('Getting a profit requires at least 2 prices') # We'll greedily update min_price and max_profit, so we initialize # them to the first price and the first possible profit min_price = stock_prices[0] max_profit = st...
4.15625
4
halfpipe/io/__init__.py
fossabot/Halfpipe-1
0
12793014
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from .file import ( DictListFile, AdaptiveLock, loadpicklelzma, dumppicklelzma, make_cachefilepath, cacheobj, uncacheobj, ) from .parse import ( par...
1.671875
2
generator_utils.py
sciatti/mazesolving
0
12793015
import numpy as np #TODO: #1. create a streamlined and replicable gif creation set of functions in this file. #2. implement these functions into the generation algorithms available. def convert_2d(index, cols): return (index // cols, index % cols) def bounds_check(index, rows, cols): if index[0] < 0 or index[...
3.171875
3
main.py
Hsuirad/Hemorrhagic-Volume-Assessment
0
12793016
<reponame>Hsuirad/Hemorrhagic-Volume-Assessment import cv2 as c import numpy as np import tkinter as tk from sklearn.neighbors import KNeighborsClassifier from tkinter import filedialog from PIL import ImageTk, Image l = tk.Tk() l.geometry('300x300') def select(): global name name = filedialog.as...
3.296875
3
pasta para baixar/netcha/exr47 contagem de pares.py
vany-oss/python
0
12793017
<reponame>vany-oss/python<filename>pasta para baixar/netcha/exr47 contagem de pares.py for c in range(2, 51, 2): print(c, end=' ') print('Acabou') #pg que faz uma contagem de 2 em 2 ebtre 1 a 50
2.484375
2
src/datafinder/core/configuration/properties/property_type.py
schlauch/DataFinder
9
12793018
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # 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.554688
2
pysnmp-with-texts/LAN.py
agustinhenze/mibs.snmplabs.com
8
12793019
# # PySNMP MIB module LAN (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LAN # Produced by pysmi-0.3.4 at Wed May 1 14:05:04 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Obje...
1.585938
2
faravdms/account/views.py
samcodesio/faravdms_active
0
12793020
<reponame>samcodesio/faravdms_active from django.shortcuts import redirect, render from django.http import HttpResponse from django.contrib.auth.models import User, auth from django.contrib import messages from django.contrib.auth.forms import UserCreationForm from .forms import CreateUserForm from django.contrib.aut...
2.28125
2
171_excel_sheet_column_number.py
jsingh41/cs_jatin
1
12793021
""" 171 Excel Sheet Column Number https://leetcode.com/problems/excel-sheet-column-number/description/ Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 ...
3.65625
4
musiclist_v2.py
tolgaerdonmez/music-list-lastfm
1
12793022
<reponame>tolgaerdonmez/music-list-lastfm from PyQt5 import QtCore, QtGui, QtWidgets import sqlite3 import sys import requests import os import urllib.request class song(): def __init__(self,name,artist,album): self.name = name self.artist = artist self.album = album def __str__(self): ...
2.96875
3
cfg.py
CharlesPikachu/DeepDream
15
12793023
'''config file''' MEANS = [0.485, 0.456, 0.406] STDS = [0.229, 0.224, 0.225] MAX_JITTER = 32 MAX_ITERS = 50 LEARNING_RATE = 2e-2 NUM_OCTAVES = 6 OCTAVE_SCALE = 1.4 SAVE_INTERVAL = 10 SAVEDIR = 'results'
1.164063
1
tensorbay/dataset/dataset.py
YiweiLi4/tensorbay-python-sdk
0
12793024
<reponame>YiweiLi4/tensorbay-python-sdk #!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # """Notes, DatasetBase, Dataset and FusionDataset. :class:`Notes` contains the basic information of a :class:`DatasetBase`. :class:`DatasetBase` defines the basic concept of a dataset, which is the...
2.3125
2
osdu_commons/services/delivery_service.py
binderjoe/sdu-commons
0
12793025
<gh_stars>0 import logging import time from functools import partial from itertools import islice from typing import List, Optional, Iterable import attr from attr.validators import instance_of, optional from pampy import match from osdu_commons.clients.delivery_client import DeliveryClient, GetResourcesResponseSucce...
1.953125
2
src/bxgateway/messages/ont/ont_message_factory.py
doubleukay/bxgateway
21
12793026
<filename>src/bxgateway/messages/ont/ont_message_factory.py from typing import Type from bxcommon.messages.abstract_message import AbstractMessage from bxcommon.messages.abstract_message_factory import AbstractMessageFactory from bxgateway.messages.ont.addr_ont_message import AddrOntMessage from bxgateway.messages.ont...
1.421875
1
src/modules/resnet18.py
lkm2835/ELimNet
6
12793027
<gh_stars>1-10 import torch from torch import nn as nn from src.modules.base_generator import GeneratorAbstract from torchvision import models class Resnet18(nn.Module): def __init__(self, in_channel: int, out_channel: int, pretrained: bool): """ Args: in_channel: input channels. ...
2.328125
2
src/adorn/data/parameter.py
pyadorn/adorn
3
12793028
<gh_stars>1-10 # Copyright 2021 <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 in...
2.578125
3
fibonacci.py
shiny13/algorithm-problems-python
1
12793029
#use python3 import sys def getNthFib(n): if n == 2: return 1 elif n == 1: return 0 previous = 0 current = 1 for _ in range(n-2): previous, current = current, previous + current return current if __name__ == '__main__': # Expected only one inte...
3.953125
4
examples/diffraction/hole_crossed_grating.py
benvial/gyptis
0
12793030
<filename>examples/diffraction/hole_crossed_grating.py # -*- coding: utf-8 -*- """ 3D Checkerboard Grating ======================= Example of a dielectric bi-periodic diffraction grating. """ # sphinx_gallery_thumbnail_number = 2 from collections import OrderedDict import matplotlib.pyplot as plt import numpy as np ...
2.53125
3
pyteslaapi/__main__.py
tyamell/pytesla
2
12793031
<filename>pyteslaapi/__main__.py #!/usr/bin/python """ Tesla CLI """ from client import TeslaApiClient from exceptions import TeslaException import logging _LOGGER = logging.getLogger('pyteslaapi_cli') def setup_logging(log_level=logging.INFO): """Set up the logging.""" logging.basicConfig(level=log_level) ...
2.359375
2
Organization/player.py
kkuba91/turnament_organizer
1
12793032
"""player.py Chess player class. All data related to Player, which can b set at the begining and during the game. """ # Global package imports: from datetime import date # Local package imports: CATEGORY = { "male":{ "m": 2400, "im": 2400, "k++": 2300, ...
3.125
3
chainer/utils/argument.py
takeratta/chainer
2
12793033
<filename>chainer/utils/argument.py def check_unexpected_kwargs(kwargs, **unexpected): for key, message in unexpected.items(): if key in kwargs: raise ValueError(message) def parse_kwargs(kwargs, *name_and_values): values = [kwargs.pop(name, default_value) for name, default_v...
3.0625
3
hfs_creation.py
karamarielynch/hfs-sim
0
12793034
<reponame>karamarielynch/hfs-sim from math import sqrt from math import factorial from operator import * from numpy import * ### Defining the DeltaJ function that will be used in Wigner6J def DeltaJ(a, b, c): Total = 0 while True: if (a+b-c) < 0: break elif (a-b+c) < 0: break elif (-a+b+c) < 0: b...
2.8125
3
get_styles.py
big-skim-milk/Quetzal
2
12793035
IFS = """ """ def STYLES(): with open('style.qss') as main_styles: with open('customizable_styles.qss') as custom_styles: all_styles = main_styles.read() + IFS + custom_styles.read() return all_styles
2.171875
2
graphs_trees/bst_validate/test_bst_validate.py
filippovitale/interactive-coding-challenges
0
12793036
<reponame>filippovitale/interactive-coding-challenges from nose.tools import assert_equal class TestBstValidate(object): def test_bst_validate(self): node = Node(5) insert(node, 8) insert(node, 5) insert(node, 6) insert(node, 4) insert(node, 7) assert_equal...
3.5625
4
noxfile.py
tdmorello/imagecatalog
0
12793037
<reponame>tdmorello/imagecatalog """Nox sessions.""" import shutil import sys import tempfile from pathlib import Path import nox from nox import Session, session python_versions = ["3.10", "3.9", "3.8", "3.7"] @nox.session(python=python_versions) def tests(session: Session) -> None: """Run the test suite.""" ...
2.125
2
src/moodlesheet/contactsheet/__init__.py
fstwn/moodlesheet
10
12793038
# -*- coding: utf-8 -*- """Top-level package for contactsheet.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
0.941406
1
knot_a_rumor/story.py
rubyyot/knot-a-rumor
0
12793039
from os.path import join import yaml class Story: def __init__(self, path): self.path = path self.author = None self.title = None self.scene = None self.synopsis = None def load(self): f = open(self.filename(), 'r') text = f.read() f.close() ...
3.03125
3
pysite/mixins.py
schwartzadev/site
0
12793040
<reponame>schwartzadev/site<filename>pysite/mixins.py # coding=utf-8 from flask import Blueprint from rethinkdb.ast import Table from _weakref import ref from pysite.database import RethinkDB class DBMixin(): """ Mixin for classes that make use of RethinkDB. It can automatically create a table with the speci...
2.78125
3
python/AnalysisLaunchers/get_analysis.py
FabricGenomics/omicia_api_examples
2
12793041
<filename>python/AnalysisLaunchers/get_analysis.py<gh_stars>1-10 """Get an analysis, or all analyses in the workspace. Example usages: python get_analysis.py --id 1802 python get_analysis.py """ import os import requests from requests.auth import HTTPBasicAuth import sys import simplejson as json import argparse # ...
2.921875
3
hp_transfer_aa_experiments/run.py
hp-transfer/htaa_experiments
1
12793042
import contextlib import logging import logging.config import random import time from pathlib import Path import hp_transfer_benchmarks # pylint: disable=unused-import import hp_transfer_optimizers # pylint: disable=unused-import import hydra import numpy as np import yaml from gitinfo import gitinfo from hp_trans...
1.96875
2
process_ez.py
UrbanInstitute/nccs-public
7
12793043
from process_co_pc import * import logging # Code by <NAME> (<EMAIL>), 2016-2017 def ez_dup_criteria(dups): dups['val'] = dups['TOTREV'].abs() + dups['ASS_EOY'].abs() + dups['EXPS'].abs() return dups, ['FISYR', 'val', 'STYEAR', 'rnd'] class ProcessEZ(ProcessCOPC): """ Creates columns found only in th...
2.40625
2
elfinder/exceptions.py
vikifox/CMDB
16
12793044
<gh_stars>10-100 from django.utils.translation import ugettext as _ class ElfinderErrorMessages: """ Standard error message codes, the text message of which is handled by the elFinder client """ ERROR_UNKNOWN = 'errUnknown' ERROR_UNKNOWN_CMD = 'errUnknownCmd' ERROR_CONF = 'errConf' ER...
2
2
app1/utils/image_url.py
xieyu-aa/news
0
12793045
from qiniu import Auth, put_data #需要填写你的 Access Key 和 Secret Key access_key = '<KEY>' secret_key = '<KEY>' def image_url(image_data): #构建鉴权对象 q = Auth(access_key, secret_key) #要上传的空间 bucket_name = 'new3333' #上传后保存的文件名 key = None # 处理上传结果 token = q.upload_token(bucket_name, key, 3600...
2.765625
3
kiyoshi_ni_shokuhatsu/tools/png_to_palette.py
grokit/grokit.github.io
10
12793046
<filename>kiyoshi_ni_shokuhatsu/tools/png_to_palette.py #!/usr/bin/python3 """ # Links - https://stackoverflow.com/questions/31386096/importing-png-files-into-numpy """ import scipy import scipy.misc import sys def load_gimp_palette(filename): """ For simplicity's sake, a palette is just an array of RGB va...
3.453125
3
src/0059.spiral-matrix-ii/spiral-matrix-ii.py
lyphui/Just-Code
782
12793047
<reponame>lyphui/Just-Code class Solution: def generateMatrix(self, n: int) -> List[List[int]]: if not n: return [] A, lo = [[n*n]], n*n while lo > 1: lo, hi = lo - len(A), lo A = [[ i for i in range(lo, hi)]] + [list(j) for j in zip(*A[::-1])] return A
3.015625
3
game/environment.py
lucascampello/wumpus-cli
0
12793048
<reponame>lucascampello/wumpus-cli<filename>game/environment.py from random import randrange class Environment(object): def __init__(self, dimension:int, n_pits:int, n_golds:int=1, n_wumpus:int=1): # Itens Possíves de Perceber no Mapa self.perceptions = { "pit": "breeze", "...
3.296875
3
tests/unit/dataactvalidator/test_fabsreq9_detached_award_financial_assistance.py
brianherman/data-act-broker-backend
0
12793049
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabsreq9_detached_award_financial_assistance' def test_column_headers(database): expected_subset = {'row_number', 'awardee_or_recipie...
2.375
2
colin-api/tests/unit/api/test_program_account.py
leksmall/lear
0
12793050
# Copyright © 2022 Province of British Columbia # # 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 agr...
1.703125
2