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
lookout/migrations/0001_initial.py
rspeed/Django-HTTP-Reporting-API
5
12774651
<reponame>rspeed/Django-HTTP-Reporting-API from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Report', fields=[ ('created', models.DateTimeField(auto_now_add=True, primary_key=True, serialize=F...
2.21875
2
pandoc-starter/MarkTex/marktex/rawrender/toRaw.py
riciche/SimpleCVReproduction
923
12774652
<gh_stars>100-1000 import os from marktex.markast.utils import ImageTool,CleanTool from marktex.markast.parser import Scanner from marktex import config from marktex.markast.document import Document from marktex.markast.environment import * from marktex.markast.line import * from marktex.markast.token import * from ma...
2.25
2
output/models/nist_data/atomic/long/schema_instance/nistschema_sv_iv_atomic_long_total_digits_5_xsd/__init__.py
tefra/xsdata-w3c-tests
1
12774653
from output.models.nist_data.atomic.long.schema_instance.nistschema_sv_iv_atomic_long_total_digits_5_xsd.nistschema_sv_iv_atomic_long_total_digits_5 import NistschemaSvIvAtomicLongTotalDigits5 __all__ = [ "NistschemaSvIvAtomicLongTotalDigits5", ]
0.921875
1
PYTHON/OTP_Generator.py
hackerman-101/Hacktoberfest-2022
1
12774654
<filename>PYTHON/OTP_Generator.py<gh_stars>1-10 import random import smtplib sender="<EMAIL>" rec=input("Enter a valid Email address :: ") otp_ls=[] for i in range(6): otp_ls.append(str(random.randint(0,9))) otp="" otp="".join(otp_ls) message=str(otp) server=smtplib.SMTP("smtp.gmail.com",587) server.starttls() se...
3.5625
4
Lib/dbm/ndbm.py
sireliah/polish-python
1
12774655
<reponame>sireliah/polish-python<filename>Lib/dbm/ndbm.py """Provide the _dbm module jako a dbm submodule.""" z _dbm zaimportuj *
0.925781
1
core/mod_user.py
zihochann/zihou
0
12774656
<gh_stars>0 import threading from django.contrib import auth from django.template import loader from django.contrib.auth.models import User def user_login(request, username, password): # Try to authorized. user_obj = auth.authenticate(username=username, password=password) if user_obj is None: ...
2.3125
2
executor_exporter/executors.py
ygormutti/executor-exporter
1
12774657
from concurrent import futures from functools import wraps from typing import Callable, Optional from executor_exporter.exporter import ExecutorExporter from executor_exporter.proxy import InstrumentedExecutorProxy class ThreadPoolExecutor(InstrumentedExecutorProxy, futures.ThreadPoolExecutor): def __init__( ...
2.34375
2
infra_macros/fbcode_macros/tests/utils.py
martarozek/buckit
0
12774658
<reponame>martarozek/buckit # Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. ...
2
2
typic/constraints/error.py
ducminhgd/typical
0
12774659
#!/usr/bin/env python # -*- coding: UTF-8 -*- class ConstraintSyntaxError(SyntaxError): """A generic error indicating an improperly defined constraint.""" pass class ConstraintValueError(ValueError): """A generic error indicating a value violates a constraint.""" pass
1.921875
2
lightconvpoint/nn/deprecated/convolutions_old/convolution.py
valeoai/POCO
13
12774660
import torch import torch.nn as nn import torch.nn.functional as F from math import ceil from lightconvpoint.nn.deprecated import Module from lightconvpoint.spatial.deprecated import knn, sampling_quantized from lightconvpoint.utils.functional import batch_gather class ConvBase(Module): """FKAConv convolution laye...
2.40625
2
CALCULADORA.py
Capricornio23/CALCULADORA
0
12774661
#!/usr/bin/python3 import sys import os import time import os as sistema # Set color R = '\033[31m' # Red N = '\033[1;37m' # White G = '\033[32m' # Green O = '\033[0;33m' # Orange B = '\033[1;34m' #Blue print (""+O+"") os.system('clear') def pedirOpcionCorrecta(): correcto=False num=0 while(...
3.78125
4
ast_language/ast_util.py
gordonwatts/ast-language
0
12774662
<reponame>gordonwatts/ast-language import ast def wrap_ast(node): return ast.Module(body=[ast.Expr(value=node)]) def unwrap_ast(node): return node.body[0].value class SourceRemover(ast.NodeTransformer): def __init__(self, source_name): self.source_name = source_name def visit_Attribute(se...
2.71875
3
akebono/exceptions.py
OTA2000/akebono
3
12774663
<filename>akebono/exceptions.py class EmptyDatasetError(Exception): pass
0.984375
1
src/tandlr/feedbacks/api.py
shrmoud/schoolapp
0
12774664
<filename>src/tandlr/feedbacks/api.py<gh_stars>0 # -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404 from tandlr.api.v2.routers import router from tandlr.core.api import mixins from tandlr.core.api.viewsets import GenericViewSet from tandlr.feedbacks.models import Feedback from tandlr.feedbacks.ser...
2.0625
2
assignment2/10.py
cseas/pap
0
12774665
import re f = open("regex.txt", "r") content = f.readlines() # s = 'A message from <EMAIL> to <EMAIL>' for i in range(len(content)): if re.findall('[\w\.]+@[\w\.]+', content[i]): print(content[i], end='')
3.328125
3
src/example/sony_camera_liveview.py
willywongi/sony_camera_api
0
12774666
from pysony import SonyAPI, ControlPoint import time flask_app = None try: import flask from flask import Flask flask_app = Flask(__name__) except ImportError: print("Cannot import `flask`, liveview on web is not available") if flask_app: flask_app.get_frame_handle = None flask_app.config['D...
2.75
3
mslib/msui/qt5/ui_remotesensing_dockwidget.py
iamansoni/MSS
33
12774667
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/ui_remotesensing_dockwidget.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_RemoteSensingDockWidget(object): def setupUi(se...
1.5625
2
src/pandas_profiling/report/structure/variables/render_count.py
briangrahamww/pandas-profiling
0
12774668
<reponame>briangrahamww/pandas-profiling<filename>src/pandas_profiling/report/structure/variables/render_count.py from pandas_profiling.config import Settings from pandas_profiling.report.formatters import ( fmt, fmt_bytesize, fmt_numeric, fmt_percent, ) from pandas_profiling.report.presentation.core im...
2.359375
2
websauna/blog/tests/model/conftest.py
ooduor/websauna.blog
0
12774669
"""py.test testing fixtures""" import pytest # Websauna from websauna.blog.models import Post from websauna.utils.time import now @pytest.fixture def unpublished_post(dbsession): post = Post() post.title = "Hello world" post.body = "All roads lead to Toholampi" post.tags = "mytag,mytag2" post.en...
2.03125
2
python/2936.py
josevictorp81/Uri-questions-solutions
3
12774670
<reponame>josevictorp81/Uri-questions-solutions curupira = int(input()) boitata = int(input()) boto = int(input()) mapinguari = int(input()) lara = int(input()) total = 225 + (curupira * 300) + (boitata *1500) + (boto * 600) + (mapinguari * 1000)+(lara*150) print(total)
3.15625
3
src/phidget_spatial/launch/phidget_spatial_launch.py
tiiuae/phidget_spatial
0
12774671
from ament_index_python.packages import get_package_prefix from launch import LaunchDescription from launch_ros.actions import Node from os import environ as env def generate_launch_description(): pkg_name = "phidget_spatial" pkg_share_path = get_package_prefix(pkg_name) return LaunchDescription([ ...
2.09375
2
Python/P3 - ADT/Q4.py
mrbinx/mrbinx_python
0
12774672
<filename>Python/P3 - ADT/Q4.py __author__ = 'HaoBin' from Q8_1 import List import queue class Tree(): def __init__(self, root=None, left=None, right=None): self.root = root self.left = left self.right = right if root is not None: if left is None: self....
3.421875
3
pytest/models/aws_cloud/volume_resource.py
Annapooraniqxf2/codacy
0
12774673
<reponame>Annapooraniqxf2/codacy """ This python file helps to read the ec2 volume information from AWS using boto3 """ import boto3 from abc import ABC, abstractmethod class VolumeResource(ABC): """This class is used to fetch details of ec2 instance using boto3""" def __init__(self) -> None: self....
3.171875
3
pythonproject/engine/display.py
emielhman/py-engine
0
12774674
<filename>pythonproject/engine/display.py import sys, pygame class Display: def __init__(self, game): """Display(game)""" self._game = game self._screen = None def _init(self): """_init()""" self._screen = pygame.display.set_mode(self._game.settings.get_scree...
3
3
ether_py/eth/send.py
davedittrich/ether-py
0
12774675
<gh_stars>0 # -*- coding: utf-8 -*- import argparse import logging import secrets import textwrap from cliff.command import Command class EthSend(Command): """Send Ethereum""" log = logging.getLogger(__name__) def get_parser(self, prog_name): parser = super().get_parser(prog_name) pars...
2.53125
3
aiopoke/objects/resources/pokemon/ability.py
beastmatser/aiopokeapi
3
12774676
from typing import TYPE_CHECKING, Any, Dict, List from aiopoke.objects.utility import Effect, NamedResource, VerboseEffect from aiopoke.objects.utility.common_models import Name from aiopoke.utils.minimal_resources import MinimalResource from aiopoke.utils.resource import Resource if TYPE_CHECKING: from aiopoke.o...
2.125
2
utils/logger.py
gylli251/PlexDoctor
1
12774677
import coloredlogs import logging import os logging.basicConfig( filename="plex_doctor.log", level=logging.DEBUG, format='%(levelname)s: "%(asctime)s - %(message)s', ) log = logging.getLogger("PLEX-DOCTOR") log.setLevel(logging.DEBUG) LOGLEVEL = os.environ.get("LOGLEVEL", "INFO").upper() stream_handler =...
2.234375
2
tests/test_convert.py
agbrooks/tohil
0
12774678
import unittest import tohil class TestMethods(unittest.TestCase): def test_convert1(self): """exercise tohil.convert with no to= and with to=str""" self.assertEqual(tohil.convert(10), "10") self.assertEqual(tohil.convert(10, to=str), "10") self.assertEqual(tohil.convert("10"), "1...
3.703125
4
host-software/led/led_vm.py
dpejcha/keyplus
226
12774679
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 <EMAIL> # Licensed under the MIT license (http://opensource.org/licenses/MIT) from sexpr import sexp import pprint import copy import hexdump DEBUG = 0 def u8(x): return x & 0xff def i16(x): return x & 0xffff class LEDVMError(Exception): ...
2.390625
2
src/codeplag/algorithms/tests/test_featurebased.py
Artanias/code-plagiarism
2
12774680
<gh_stars>1-10 import unittest import numpy as np from codeplag.algorithms.featurebased import ( op_shift_metric, counter_metric, get_children_indexes, struct_compare, find_max_index, matrix_value, add_not_counted ) class TestFeaturebased(unittest.TestCase): def test_counter_metric_normal(self):...
2.359375
2
koila/interfaces.py
ousou/koila
0
12774681
<reponame>ousou/koila from __future__ import annotations import functools import operator from abc import abstractmethod from typing import ( Callable, Dict, NamedTuple, Protocol, Tuple, TypeVar, Union, overload, runtime_checkable, ) from torch import Tensor from torch import devic...
2.296875
2
geotrek/trekking/tests/__init__.py
camillemonchicourt/Geotrek
0
12774682
# pylint: disable=W0401 from .base import * from .test_views import * from .test_filters import * from .test_translation import * from .test_trek_relationship import * from .test_models import * from .test_admin import *
1.007813
1
manage_battery.py
clean-code-craft-tcq-1/function-ext-python-Anjana-MU
0
12774683
from report_vitals import report_battery_vitals from filter_values import filterOut_safe_vitals from process_battery_data import process_data from controller_actions import get_actions def is_battery_ok(bms_attributes): data = process_data(bms_attributes) report_battery_vitals(data) get_actions(data)...
2.125
2
AutoEncoder/autoencoder.py
wondervictor/DeepLearningWithPaddle
5
12774684
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
2.140625
2
neatbook/neatbook.py
Peter-32/neatbook
1
12774685
<filename>neatbook/neatbook.py import sys import os import nbformat as nbf import re class Neatbook: def __init__(self, ): PROJECT_FILE = os.path.realpath(os.path.basename(sys.argv[0])) PROJECT_PATH = re.match("(.*[/\\\])", PROJECT_FILE).group(1) PROJECT_NAME = re.match(".*[/\\\]+([^/\\\]+)...
3.0625
3
training/my_models.py
bu-cisl/Illumination-Coding-Meets-Uncertainty-Learning
15
12774686
<reponame>bu-cisl/Illumination-Coding-Meets-Uncertainty-Learning from __future__ import print_function import keras from keras.layers import AveragePooling2D, Lambda import keras.backend as K from keras.layers import Input, MaxPooling2D, UpSampling2D, Dropout, Conv2D, Concatenate, Activation, Cropping2D, \ Flatten...
2.78125
3
settings.py
felix19350/Nature-Trails
0
12774687
<reponame>felix19350/Nature-Trails from djangoappengine.settings_base import * import os TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), '/templates/default/'),)
1.46875
1
tests/sibling_classes.py
mnicolas94/pyrulo
0
12774688
<filename>tests/sibling_classes.py class Sibling: pass
0.785156
1
src/App/tests/test_class_init.py
tseaver/Zope-RFA
2
12774689
<filename>src/App/tests/test_class_init.py<gh_stars>1-10 ############################################################################## # # Copyright (c) 2005 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy ...
2.359375
2
model_compiler/src/model_compiler/tensorflow_util.py
yuanliya/Adlik
548
12774690
# Copyright 2019 ZTE corporation. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from typing import Any, Mapping, NamedTuple, Optional, Sequence from itertools import zip_longest from . import utilities from .models.data_format import DataFormat def get_tensor_by_fuzzy_name(graph, name): if ':' in n...
2.078125
2
wsgi.py
Ajuajmal/heroku
0
12774691
<filename>wsgi.py import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bootcamp.settings") from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(applica...
1.515625
2
admin_demo_scripts/delete_subscriptions_of_departed_users.py
MicroStrategy/mstrio-py
60
12774692
from mstrio.users_and_groups import list_users from mstrio.api.projects import get_projects from mstrio.distribution_services.subscription.subscription_manager import SubscriptionManager from mstrio.connection import Connection def delete_subscriptions_of_departed_users(connection: "Connection") -> None: """Delet...
2.453125
2
setup.py
raulguajardo/PacaPy
0
12774693
<reponame>raulguajardo/PacaPy import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="PacaPy-raul-guajardo", version="0.0.1", author="<NAME>", author_email="<EMAIL>", description="A package designed as a wrapper over Alpaca API for my general u...
1.46875
1
backend/tests/run.py
Itisfilipe/feature-requets-flask-app
2
12774694
from coverage import coverage import unittest cov = coverage(branch=True, include=['app/*']) cov.set_option('report:show_missing', True) cov.erase() cov.start() from .client_test import ClientTestCase from .features_test import FeatureTestCase from .product_area_test import ProductAreaTestCase if __name__ == '__mai...
2.34375
2
web/log.py
BennyJane/career-planning-info
1
12774695
# -*- coding: utf-8 -*- # @Time : 2020/9/26 # @Author : <NAME> # @Email : 暂无 # @File : command.py # @Project : Flask-Demo import os import logging from logging.handlers import RotatingFileHandler from flask import request basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) project_name = os.path.spl...
2.6875
3
todo/main/helpers.py
Romansth/todo
8
12774696
import csv from django.http import HttpResponse class ExportCsvMixin: def export_as_csv(self, request, queryset): meta = self.model._meta field_names = [field.name for field in meta.fields] response = HttpResponse(content_type="text/csv") response["Content-Disposition"] = "attac...
2.515625
3
autoit_ripper/utils.py
nazywam/AutoIt-Ripper
112
12774697
from datetime import datetime, timezone from itertools import cycle from .lame import LAME from .mt import MT def filetime_to_dt(timestamp: int) -> datetime: return datetime.fromtimestamp(timestamp // 100000000, timezone.utc) def bytes_to_bitstring(data: bytes) -> str: return "".join(bin(x)[2:].zfill(8) fo...
2.828125
3
meta/bin/merge_rs.py
bioinformatics-lab/h3agwas
0
12774698
#!/usr/bin/env python3 import sys import os import argparse def parseArguments(): parser = argparse.ArgumentParser(description='transform file and header') parser.add_argument("--list_file", help="", type=str,required=True) parser.add_argument('--use_rs',type=str,help="if need to be limited at some rs", d...
2.9375
3
data/GTSDB/ImageSets/train_test_split.py
aivsol/aivsol-TFFRCNN
1
12774699
import sys f = open('all.txt') data = {} for l in f: t = l.split(";")[0] if t in data: data[t] += [l] else: data[t] = [l] f.close() train = dict(data.items()[0:380]) test = dict(data.items()[380:506]) ''' print ('\n'*10) for k in sorted(train): print k, ':', train[k] print ('\n'*10) f...
2.6875
3
src/schmetterling/log/log.py
bjuvensjo/schmetterling
0
12774700
from schmetterling.core.log import log_config, log_params_return from schmetterling.log.state import LogState @log_params_return('info') def execute(state, log_dir, name, level): log_handlers = log_config(log_dir, name, level) return LogState(__name__, log_handlers['file_handler'].baseFilename)
2.03125
2
src/training/tensorflow/convert_tfjs.py
klawr/deepmech
1
12774701
import tensorflowjs as tfjs import tensorflow as tf model = tf.keras.models.load_model("model.h5") tfjs.converters.save_keras_model(model, "tfjs")
1.875
2
python_api/tests/test_settings.py
berkerdemoglu/My3DEngine
1
12774702
import unittest from src.api import Settings class SettingsTestCase(unittest.TestCase): """Tests the Settings class.""" def setUp(self): self.settings = Settings(800, 600, 60, "3D Engine", use_antialiasing=False) def test_keyword_arguments(self): """Check that the keyword arguments are being parsed correctl...
3.296875
3
proficiencies.py
DennisMerkus/Aether
0
12774703
# Describing possession # Describing things by color # Describing kinship # Describing movement to/from # Describing locations # Greetings and farewells # Face-changing speech (Thanking, apologizing) # Asking questions about where, what, how, when, who, etc # Describing tastes # A set of words/skills/structures that ...
1.640625
2
tools/exercises_LoadDataset.py
vicyangworld/WaterDispenserEye
0
12774704
# -*- coding: utf-8 -*- import os import sys import numpy as np IMAGE_SIZE = 64 #按照指定图像大小调整尺寸 def resize_image(image, height = IMAGE_SIZE, width = IMAGE_SIZE): top, bottom, left, right = (0, 0, 0, 0) #获取图像尺寸 h, w, _ = image.shape #对于长宽不相等的图片,找到最长的一边 longest_edge = max(h, w) #计算短边需要增加多上像素宽度使其与长边等长 if h < long...
3.125
3
code/chapter_6_cnn/mcts_go_cnn.py
hirasaki1985/hirasar_go
1
12774705
<reponame>hirasaki1985/hirasar_go # -*- coding: utf-8 -*- from __future__ import print_function # tag::mcts_go_cnn_preprocessing[] import numpy as np from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D np.random.seed(123) X = np.load('../...
3.109375
3
lisa/sut_orchestrator/qemu/console_logger.py
srveniga/lisa
0
12774706
<reponame>srveniga/lisa<gh_stars>0 # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from threading import Event from typing import IO, Any, Optional, Union import libvirt # type: ignore from . import libvirt_events_thread # Reads serial console log from libvirt VM and writes it to a file. ...
2.171875
2
migration/versions/6dd556a95d2b_expand_content_column.py
floresmatthew/sahasrahbot
0
12774707
<reponame>floresmatthew/sahasrahbot """expand content column Revision ID: <PASSWORD> Revises: <PASSWORD> Create Date: 2020-10-19 18:21:14.384304 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = '<...
1.398438
1
backend/src/hatchling/licenses/parse.py
daobook/hatch
0
12774708
<reponame>daobook/hatch from .supported import EXCEPTIONS, LICENSES def normalize_license_expression(license_expression): if not license_expression: return license_expression # First normalize to lower case so we can look up licenses/exceptions # and so boolean operators are Python-compatible ...
3.09375
3
code/tomography_gpu/opticaltomography/regularizers.py
yhren1993/3DPhaseContrastAET
5
12774709
""" Regularizer class for that also supports GPU code <NAME> <EMAIL> <NAME> <EMAIL> March 04, 2018 """ import arrayfire as af import numpy as np from opticaltomography import settings np_complex_datatype = settings.np_complex_datatype np_float_datatype = settings.np_float_datatype af_float_datatype = sett...
2.34375
2
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/AnnotationImportTypingOptional/lib.py
jnthn/intellij-community
2
12774710
if True: foo = 42 else: foo = None
1.78125
2
Hip/SourceModule.py
EmilPi/PuzzleLib
52
12774711
import os, tempfile, subprocess from string import Template from PuzzleLib import Config from PuzzleLib.Compiler.JIT import getCacheDir, computeHash, FileLock from PuzzleLib.Cuda.SourceModule import SourceModule, ElementwiseKernel, ElementHalf2Kernel, ReductionKernel from PuzzleLib.Cuda.SourceModule import eltwiseTes...
2.03125
2
distributed/diagnostics/tests/test_progressbar.py
ogrisel/distributed
0
12774712
<gh_stars>0 import pytest from tornado import gen from distributed import Executor, Scheduler from distributed.diagnostics.progressbar import TextProgressBar, progress from distributed.utils_test import (cluster, _test_cluster, loop, inc, div, dec, cluster_center) from time import time, sleep def test_text_...
2.09375
2
code/slash_commands/slash_help.py
Fiji05/AquaBot
2
12774713
<reponame>Fiji05/AquaBot import discord from discord.ext import commands import re from discord import app_commands color = 0xc48aff class HelpDropdown(discord.ui.Select): def __init__(self): options = [ discord.SelectOption(label='Economy', description='add, profile, shop, blackjack, slots, ...
2.40625
2
fartor/apps/accounting/users/models/__init__.py
verkatech/fartor-django
6
12774714
<reponame>verkatech/fartor-django from .login_histories import LoginHistory from .users import User
1.085938
1
trustMonitor/trust_monitor_driver/parsingOAT.py
shield-h2020/trust-monitor
2
12774715
<reponame>shield-h2020/trust-monitor from trust_monitor.verifier.structs import * from trust_monitor.verifier.statistics import * from suds.client import Client from trust_monitor.verifier.parser import IRParser, IMAMeasureHandler from trust_monitor.verifier.parser import ContainerCheckAnalysis import logging import gc...
2.203125
2
minv/mongo_4_0.py
kevinadi/invoke-mongodb
0
12774716
<reponame>kevinadi/invoke-mongodb # MongoDB 4.0 import os from mongo_basic import BasicMongo class Mongo(BasicMongo): def __init__(self): pass def version(self): return '4.0'
1.953125
2
manage.py
arctelix/pinimatic
12
12774717
<filename>manage.py<gh_stars>10-100 #!/usr/bin/env python import os import sys if __name__ == "__main__": if 'RACK_ENV' in os.environ: RACK_ENV = os.environ.get("RACK_ENV") print 'RACK_ENV: ', RACK_ENV os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings."+RACK_ENV) else: ...
1.875
2
modules/steps/find_docker_stack_files.py
KTH/aspen
0
12774718
"""FindDockerStackFiles Crawls the fetched application registry directory (from FetchAppRegistry) and locates all docker-stack.yml files""" __author__ = '<EMAIL>' import os from modules.steps.base_pipeline_step import BasePipelineStep from modules.util import environment, data_defs class FindDockerStackFiles(BasePi...
2.453125
2
__init__.py
Vladimir37/finam_stock_data
6
12774719
from .finam_stock_data import get_data
1.046875
1
deep_learn/dataset/sampler/__init__.py
ImbesatRizvi/Accio
2
12774720
from .BinaryPairedWindowSampler import BinaryPairedWindowSampler
1.085938
1
1-10/p2.py
smith-erik/project-euler
0
12774721
#!/usr/bin/python3 print("Sum of even-valued terms less than four million in the Fibonacci sequence:") a, b, sum = 1, 1, 0 while b < 4000000: sum += b if b % 2 == 0 else 0 a, b = b, a + b print(sum)
3.578125
4
code/report/inspectParameters.py
matthijsvk/multimodalSR
53
12774722
import logging import formatting logger_inspectParameters = logging.getLogger('inspectParameters') logger_inspectParameters.setLevel(logging.DEBUG) FORMAT = '[$BOLD%(filename)s$RESET:%(lineno)d][%(levelname)-5s]: %(message)s ' formatter = logging.Formatter(formatting.formatter_message(FORMAT, False)) # create console...
2.25
2
projects/ABD_Net/ABD_components/args.py
Yogurt2019/abd-deep-person-reid
0
12774723
<reponame>Yogurt2019/abd-deep-person-reid import os import argparse def argument_parser(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # ************************************************************ # Branches Related # *************************************...
2.28125
2
analysis.py
colm-o-caoimh/IrisDataset
0
12774724
# <NAME> # PandS project 2020 import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # Import data as pandas dataframe iris_data = pd.read_csv('iris.data', header=None) # assign column headers iris_data.columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'sp...
3.296875
3
test/test_utilities.py
2b-t/stereo-matching
1
12774725
# <NAME> - github.com/2b-t (2022) # @file utilities_test.py # @brief Different testing routines for utility functions for accuracy calculation and file import and export import numpy as np from parameterized import parameterized from typing import Tuple import unittest from src.utilities import AccX, IO class Test...
2.90625
3
config.py
dgg32/graphql_genbank
0
12774726
api_key = "" endpoint_url = ""
1.085938
1
solutions/python3/823.py
sm2774us/amazon_interview_prep_2021
42
12774727
class Solution: def numFactoredBinaryTrees(self, A): """ :type A: List[int] :rtype: int """ A.sort() nums, res, trees, factors = set(A), 0, {}, collections.defaultdict(set) for i, num in enumerate(A): for n in A[:i]: if num % n == 0...
3.015625
3
src/grass/functor.py
running-grass/grass-python
0
12774728
<gh_stars>0 from abc import ABC, abstractmethod from typing import TypeVar, Callable, Generic # from collections.abc import Callable from grass.function import flip A = TypeVar('A') B = TypeVar('B') C = TypeVar('C') class Functor(ABC, Generic[A]): '''函子''' @abstractmethod def fmap(self, f: Callable[[A],...
2.578125
3
package/tests/test_bootstrap_dashboard.py
philippjfr/awesome-panel
0
12774729
<filename>package/tests/test_bootstrap_dashboard.py<gh_stars>0 """Tests of the BootStrapDashboardTemplate""" import importlib import pytest from selenium import webdriver import awesome_panel.express as pnx import panel as pn importlib.reload(pnx) @pytest.fixture def chrome_driver() -> webdriver.Chrome: r"""Th...
2.453125
2
testOneNN.py
agollapudi2019/ShallowMind
1
12774730
<reponame>agollapudi2019/ShallowMind from keras.models import Sequential from keras.layers import Dense, Activation from keras.utils import to_categorical from db import createDatasetsDocument, createNeuralNetsDocument, createExperimentsDocument import GaussianBoundary as gb import numpy as np import keras from testNN ...
2.71875
3
unit_tests/test_instance.py
vonsago/service_platform
6
12774731
<filename>unit_tests/test_instance.py #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-06-09 14:28 # @Author : Vassago # @File : test_instance.py # @Software: PyCharm import logging from unit_tests.common import BaseTestCase LOG = logging.getLogger(__name__) class TestInstance(BaseTestCase): ...
2.53125
3
200.py
geethakamath18/Leetcode
0
12774732
#LeetCode problem 200: Number of Islands class Solution: def check(self,grid,nodesVisited,row,col,m,n): return (row>=0 and row<m and col>=0 and col<n and grid[row][col]=="1" and nodesVisited[row][col]==0) def dfs(self,grid,nodesVisited,row,col,m,n): a=[-1,1,0,0] b=[0,0,1,-1] ...
3.234375
3
src/extensions/COMMANDS/ListCommand.py
DMTF/python-redfish-utility
15
12774733
### # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md ### """ List Command for RDMC """ import redfish.ris from optparse import Opti...
1.828125
2
app/answer/apps.py
Ravishrks/examin
1
12774734
from django.apps import AppConfig class AnswerConfig(AppConfig): name = 'answer'
1.210938
1
scraper.py
Vasile2k/OlxScraper
4
12774735
<filename>scraper.py __author__ = "Vasile2k" import requests from html.parser import HTMLParser queries = [ "Corsair K95", "Gigabyte Aorus Z390 Pro" ] url = "https://www.olx.ro/oferte/" user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko)" \ " Chrom...
3.203125
3
app/language_features/pools/pool_proc.py
andykmiles/code-boutique
0
12774736
<filename>app/language_features/pools/pool_proc.py<gh_stars>0 """ Pool distributes the tasks to the available processors using a FIFO scheduling. It works like a map reduce architecture. It maps the input to the different processors and collects the output from all the processors. After the execution of code, it return...
3.84375
4
setup.py
mab262/covid19_dashboard_max
0
12774737
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="covid19_dashboard", version="0.0.1", author="<NAME>", author_email="<EMAIL>", description="A personalized dashboard which maps up to date covid data to a web template", long...
1.835938
2
src/HistEqualizer/HistogramEqualization.py
victormmp/processamento-digital-imagens
0
12774738
<filename>src/HistEqualizer/HistogramEqualization.py """ Histogram Equalization Class """ import numpy import math import copy import matplotlib.pyplot as plt class HistogramEqualization: """Implements Histogram Equalization""" imgName = "IMG" #ImageName colorDepth = 8 #Intensity represented by 8 bits ...
3.59375
4
ASAP/S_SequenceInRegion.py
HassounLab/ASAP
5
12774739
import Bio.SeqUtils.ProtParam import os import ASAP.FeatureExtraction as extract import pandas as pd import matplotlib.pyplot as plt import numpy as np # Chothia numbering definition for CDR regions CHOTHIA_CDR = {'L': {'1': [24, 34], '2': [50, 56], '3': [89, 97]}, 'H':{'1': [26, 32], '2': [52, 56], '3': [95, 102]}} c...
2.265625
2
actions/utils.py
kabirivan/Ecommerce-Assistant-Jasmine
0
12774740
<filename>actions/utils.py import logging import os import json import smtplib import traceback from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from pathlib import Path from dotenv import load_dotenv load_dotenv() logger = logging.getLogger(__name__) email_username = os.getenv('EM...
2.625
3
kardioml/segmentation/teijeiro/utils/__init__.py
Seb-Good/physionet-challenge-2020
13
12774741
# -*- coding: utf-8 -*- """ En este paquete se situarán distintas clases de utilidad para el resto del proyecto. """ __author__ = "<NAME>" __date__ = "$30-nov-2011 17:50:53$"
1.296875
1
E#01/main.py
vads5/-Python-Prog
2
12774742
''' name: E#01 author: <NAME> email: <EMAIL> link: https://www.youtube.com/channel/UCNN3bpPlWWUkUMB7gjcUFlw MIT License https://github.com/repen/E-parsers/blob/master/License ''' import requests from bs4 import BeautifulSoup url = "http://light-science.ru/kosmos/vselennaya/top-10-samyh-bolshih-zvezd-vo-vselennoj.htm...
2.703125
3
structure/greibach_path.py
vnszero/interpretadorGLC
0
12774743
from typing import Dict from structure.GLC import GLC class Path: ''' ex of a Path: a. G | UGU ''' def __init__(self, alpha : str, top : str, stack : str): self.alpha = alpha self.top = top self.stack = stack def __repr__(self) -> str: return f'{sel...
2.6875
3
ontobio/bin/timeit.py
alliance-genome/ontobio
101
12774744
#!/usr/bin/env python3 from ontobio.sparql2ontology import * from networkx.algorithms.dag import ancestors import time def r(): t1 = time.process_time() get_edges('pato') t2 = time.process_time() print(t2-t1) r() r() r() """ LRU is much faster, but does not persist. However, should be fast enough ...
2.390625
2
objects/CSCG/_3d/ADF/trace/base/cochain/local.py
mathischeap/mifem
1
12774745
# -*- coding: utf-8 -*- from screws.freeze.main import FrozenOnly class ____3dCSCG_ADTF_Cochain_Local____(FrozenOnly): """""" def __init__(self, dt_CO): """""" self._PC_ = dt_CO._dt_.prime.cochain self._MM_ = dt_CO._dt_.mass_matrix self._freeze_self_() def __getitem__(self...
2.5
2
13_commandline/code/hello_world_optparse.py
lluxury/P_U_S_A
0
12774746
#!/usr/bin/env python import optparse def main(): p = optparse.OptionParser() p.add_option('--sysadmin', '-s', default="BOFH") options, arguments = p.parse_args() print 'Hello, %s' % options.sysadmin if __name__ == '__main__': main()
2.421875
2
pyvis/PIMCPy/TestGaussianSingleSlicePotential.py
b3sigma/fourd
20
12774747
#!/bin/env python import numpy #import pylab import CalcStatistics import random import numpy from PIMC import * numParticles=2 numTimeSlices=5 tau=0.1 lam=0.5 Path=PathClass(numpy.zeros((numTimeSlices,numParticles,3),float),tau,lam) Path.SetPotential(HarmonicOscillator) Path.SetCouplingConstant(0.0) print PIMC(10000...
2.0625
2
app/segmentation/utils.py
zhiva-ai/Lung-Segmentation-API
0
12774748
<gh_stars>0 from pydicom import FileDataset from typing import Tuple def get_pixel_spacing_and_slice_thickness_in_centimeters( instance: FileDataset, ) -> Tuple[float, float, float]: """ :param instance: example pydicom instance, one from the :return: """ pixel_spacing_x, pixel_spacing_y = ins...
2.59375
3
Week 10/E19.py
aash7871/PHYS-3210
0
12774749
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 21 09:57:43 2019 @author: amandaash """ import numpy as np import matplotlib.pyplot as plt p = 2 v = 1 x = 0 m = 10 time_step = 0.0001 k = 3 t0 = 0 tf = 10 """ x_val = [] v_val = [] time_array = np.arange(t0,tf, time_step) for n in ...
3.15625
3
make.py
ASquirrelsTail/serve-up
0
12774750
import os from distutils.dir_util import copy_tree # import PyInstaller.__main__ pyinst_args = [ '-c', 'serve_up.py', '--name=ServeUp', '--onefile', '--hidden-import=whitenoise', '--hidden-import=whitenoise.middleware', '--hidden-import=visitors.admin', '--hidden-import=tabl...
2.28125
2