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 |
|---|---|---|---|---|---|---|
credsweeper/file_handler/patch_provider.py | iuriimet/CredSweeper | 0 | 12763851 | from typing import Dict, List, Optional
from credsweeper.file_handler.diff_content_provider import DiffContentProvider
from credsweeper.file_handler.files_provider import FilesProvider
from credsweeper.utils import Util
class PatchProvider(FilesProvider):
"""Provide data from a list of `.patch` files.
Allow... | 2.578125 | 3 |
xpxchain/models/mosaic/mosaic_properties.py | Sharmelen/python-xpx-chain-sdk | 1 | 12763852 | <reponame>Sharmelen/python-xpx-chain-sdk<filename>xpxchain/models/mosaic/mosaic_properties.py
"""
mosaic_properties
=================
Properties of an asset.
License
-------
Copyright 2019 NEM
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | 1.960938 | 2 |
numero_feliz.py | neriphy/numeros_felices | 0 | 12763853 | #Programa para evaluar si un numero es feliz
numero_a_evaluar = input("Introduce el numero a evaluar: ")
n = numero_a_evaluar
suma = 2
primer_digito = 0
segundo_digito = 0
tercer_digito = 0
cuarto_digito = 0
while suma > 1:
primer_digito = numero_a_evaluar[0]
primer_digito = int(primer_digito)
print(prim... | 4.125 | 4 |
tf_video/main.py | jegork/tf-video-preprocessing | 1 | 12763854 | <reponame>jegork/tf-video-preprocessing
from keras import backend
import tensorflow as tf
from keras.utils.control_flow_util import smart_cond
from keras.layers.preprocessing.preprocessing_utils import ensure_tensor
import numpy as np
from .utils import *
from keras.engine.base_layer import BaseRandomLayer
HORIZONTAL ... | 2.546875 | 3 |
src/xdg/__init__.py | srstevenson/xdg | 70 | 12763855 | # Copyright © 2016-2021 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAI... | 1.851563 | 2 |
apiempleados/admin.py | acroooo/registroempleados-spa | 0 | 12763856 | from django.contrib import admin
from .models import Empleado
# Register your models here.
class EmpleadoAdmin(admin.ModelAdmin):
lista = ['nombre_completo', 'email', 'contacto', 'direccion']
admin.site.register(Empleado, EmpleadoAdmin)
| 1.609375 | 2 |
qiskit/transpiler/propertyset.py | jagunnels/qiskit-sdk-py | 0 | 12763857 | <reponame>jagunnels/qiskit-sdk-py
# -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
""" A property set is maintained by the PassManager to keep information
about the current s... | 1.539063 | 2 |
tests/test_command.py | acerv/etcdgo | 0 | 12763858 | """
Unittests for command module.
"""
import os
import pytest
from click.testing import CliRunner
import etcd3
import etcdgo.command
@pytest.fixture
def runner(mocker):
"""
Click runner client.
"""
mocker.patch('etcd3.Etcd3Client.__init__', return_value=None)
mocker.patch('etcdgo.config.Config.__i... | 2.53125 | 3 |
tests/benchmark_scripts/toxic_train.py | stanford-futuredata/Willump | 45 | 12763859 | # Original source here: https://www.kaggle.com/tunguz/logistic-regression-with-words-and-char-n-grams
import argparse
import gc
import pickle
import time
import pandas as pd
import scipy.sparse
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split
from toxic... | 2.796875 | 3 |
world/character/tests.py | nigelmathes/GAME | 0 | 12763860 | import os
from django.test import TestCase
from actions_api.combat import Combat
from character.models import Character, StatusEffects
class CombatTests(TestCase):
fixtures = [os.path.join("/Users", "Nigel", "HOBBY_PROJECTS", "GAME", "world", "full_backup.json")]
def test_combat_round(self):
"""
... | 2.703125 | 3 |
python-cim/samples/hash_term.py | dnides/flare-wmi | 0 | 12763861 | <reponame>dnides/flare-wmi
import logging
from cim import CIM
from cim import Index
def main(type_, path, *s):
if type_ not in ("xp", "win7"):
raise RuntimeError("Invalid mapping type: {:s}".format(type_))
c = CIM(type_, path)
i = Index(c.cim_type, c.logical_index_store)
for ss in s:
... | 2.34375 | 2 |
src/category.py | tarun-bisht/security-camera | 1 | 12763862 | <filename>src/category.py
def read_label_pbtxt(label_path: str) -> dict:
with open(label_path, "r") as label_file:
lines = label_file.readlines()
labels = {}
for row, content in enumerate(lines):
labels[row] = {"id": row, "name": content.strip()}
return labels
| 2.875 | 3 |
tencentcloud/bmvpc/v20180625/bmvpc_client.py | snowxmas/tencentcloud-sdk-python | 46 | 12763863 | <filename>tencentcloud/bmvpc/v20180625/bmvpc_client.py
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 ... | 2.15625 | 2 |
boating/tests.py | iago1460/pedal-boating | 0 | 12763864 | import datetime
from django.test import TestCase
from boating.choices import MONDAY, SATURDAY, SUNDAY
from boating.models import Booking, OpeningTimes, HirePoint, Boat
from boating.views import place_booking
class HirePointMixin(object):
hire_point1 = None
hire_point2 = None
def setUp(self):
hi... | 2.796875 | 3 |
paddlex_restful/restful/project/train/classification.py | chccc1994/PaddleX | 8 | 12763865 | <gh_stars>1-10
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 1.71875 | 2 |
vampytest/core/result/__init__.py | HuyaneMatsu/vampytest | 1 | 12763866 | <filename>vampytest/core/result/__init__.py
from .failures import *
from .result import *
from .result_group import *
__all__ = (
*failures.__all__,
*result.__all__,
*result_group.__all__,
)
| 1.046875 | 1 |
tests/spells/test_length_of.py | awesome-archive/geomancer | 216 | 12763867 | # -*- coding: utf-8 -*-
# Import modules
import pytest
from google.cloud import bigquery
from tests.spells.base_test_spell import BaseTestSpell, SpellDB
# Import from package
from geomancer.backend.settings import SQLiteConfig
from geomancer.spells import LengthOf
params = [
SpellDB(
spell=LengthOf(
... | 2.28125 | 2 |
test/test_pwm_setup.py | mrtnschltr/CHIP_IO | 295 | 12763868 | <reponame>mrtnschltr/CHIP_IO<filename>test/test_pwm_setup.py
import pytest
import os
import time
import CHIP_IO.PWM as PWM
import CHIP_IO.OverlayManager as OM
import CHIP_IO.Utilities as UT
def setup_module(module):
if not UT.is_chip_pro():
OM.load("PWM0")
def teardown_module(module):
PWM.cleanup()
... | 2.296875 | 2 |
yatube/posts/migrations/0011_auto_20211118_2131.py | LHLHLHE/yatube_project | 0 | 12763869 | # Generated by Django 2.2.16 on 2021-11-18 18:31
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('posts', '0010_comment'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
... | 1.632813 | 2 |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_group_cfg.py | Maikor/ydk-py | 0 | 12763870 | """ Cisco_IOS_XR_group_cfg
This module contains IOS\-XR group YANG data
for flexible cli groups
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, ... | 1.929688 | 2 |
suites/API/HistoryApi/GetRelativeAccountHistory.py | echoprotocol/pytests | 1 | 12763871 | <reponame>echoprotocol/pytests
# -*- coding: utf-8 -*-
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import (
check_that, equal_to, has_length, is_, is_list, is_str, require_that, require_that_in
)
SUITE = {
"description": "Method 'get_relative_account_h... | 2.25 | 2 |
practice/practice_1.3/test_search.py | Electro98/aads | 7 | 12763872 | """Тесты для модуля search"""
import unittest
import search # pylint: disable=E0401
TEST_SEARCH_ONE_SYMBOL = [
('', 'a', False, 'first', 1, None),
('', 'a', True, 'first', 1, None),
('', 'a', False, 'last', 1, None),
('', 'a', True, 'last', 1, None),
('a', 'a', False, 'first', 1, (0, )),
(... | 2.65625 | 3 |
setup.py | jcaxmacher/git-remote-cvm | 0 | 12763873 | <reponame>jcaxmacher/git-remote-cvm<gh_stars>0
#!/usr/bin/env python
import os
import setuptools
__version__ = '1.15'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setuptools.setup(
name = 'git-remote-cvm',
packages = ['git_remote_cvm'],
version = __version__,
... | 1.429688 | 1 |
robotidy/transformers/ext_SplitDocumentationLines.py | josflorap/robotframework-tidy | 0 | 12763874 | from robot.api.parsing import ModelTransformer, Token
class ext_SplitDocumentationLines(ModelTransformer):
def __init__(self, line_length: int = 200):
self.line_length = line_length
self.inSettings = False
def visit_Documentation(self, node):
for token in node.tokens:
if to... | 2.84375 | 3 |
useroptions/apps.py | VisheshJain112/predective-ai | 0 | 12763875 | from django.apps import AppConfig
class UseroptionsConfig(AppConfig):
name = 'useroptions'
| 1.109375 | 1 |
tests/py/test_fake_data.py | kant/gratipay.com | 517 | 12763876 | from __future__ import print_function, unicode_literals
from gratipay import fake_data
from gratipay.testing import Harness
from gratipay.cli.fake_data import main
class TestFakeData(Harness):
def test_fake_data_cli(self):
num_participants = 6
num_tips = 25
num_teams = 5
num_pack... | 2.328125 | 2 |
droos_bot/__init__.py | yshalsager/droos_bot | 5 | 12763877 | <gh_stars>1-10
""" Bot initialization """
import json
import logging
from logging.handlers import TimedRotatingFileHandler
from pathlib import Path
from sys import stderr, stdout
from telegram import ParseMode
from telegram.ext import Defaults, Dispatcher, PicklePersistence, Updater
from droos_bot.gsheet.spreadsheet ... | 2.09375 | 2 |
apis_server/serializers/project_serializer.py | ilyde-platform/ilyde-apis | 0 | 12763878 | # coding: utf-8
#
# Copyright (c) 2020-2021 Hopenly srl.
#
# This file is part of Ilyde.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 2.015625 | 2 |
programCO2.py | DanielSalazar1/Assignments | 0 | 12763879 | <gh_stars>0
co2 = input("Please input air quality value: ")
co2 = int(co2)
if co2 > 399 and co2 < 698:
print("Excelent")
elif co2 > 699 and co2 < 898:
print("Good")
elif co2 > 899 and co2 < 1098:
print("Fair")
elif co2 > 1099 and co2 < 1598:
print("Mediocre, contaminated indoor air")
elif co2 ... | 3.640625 | 4 |
mp4.py | avmmodules/download_videos_yt | 0 | 12763880 | <filename>mp4.py
'''
Description:
Download YouTube video's with python.
Author: AlejandroV
Version: 1.0
Video: https://youtu.be/gDiSwTOHcXk
'''
from pytube import YouTube
# Your url video of YouTube
url = ""
yt = YouTube(url)
yt.streams.filter(progressive=True, file_extension='mp4').order_by('reso... | 3.09375 | 3 |
examples/flask_simple/flask_simple.py | Mjolnir-Software/dynoscale-python | 0 | 12763881 | import logging
import os
import sys
import colorlog
from flask import Flask
from dynoscale.wsgi import DynoscaleWsgiApp
# Configure logging
handler = colorlog.StreamHandler(stream=sys.stdout)
handler.setFormatter(
colorlog.ColoredFormatter(
fmt="%(asctime)s.%(msecs)03d %(log_color)s%(levelname)-8s%(reset... | 2.390625 | 2 |
tests/test_db.py | ctsit/metab_import | 0 | 12763882 | <filename>tests/test_db.py<gh_stars>0
import sqlite3
import unittest
from m3c import db
class TestDb(unittest.TestCase):
def setUp(self):
self.conn = sqlite3.connect(":memory:")
self.conn.executescript("""
CREATE TABLE names (
person_id INT,
first_name... | 3.203125 | 3 |
saveModule.py | bison--/Minecraft | 0 | 12763883 | <gh_stars>0
import main # we need the blocktypes from the main program
import json
import os
from time import gmtime, strftime
class saveModule(object):
def __init__(self):
# "tarnslate" the block texture tuples into readable words for saving
self.coordDictSave = { str(main.GRASS):'GRASS', str(main... | 2.96875 | 3 |
django/db/models/query_utils.py | egenerat/gae-django | 3 | 12763884 | """
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
import weakref
from django.utils.copycompat import deepcopy
fr... | 2.796875 | 3 |
neural_mmo/forge/ethyr/torch/policy/__init__.py | fangqyi/sandbox-society | 1 | 12763885 | <reponame>fangqyi/sandbox-society<filename>neural_mmo/forge/ethyr/torch/policy/__init__.py
from neural_mmo.forge.ethyr.torch.policy.attention import Attention, SelfAttention
from neural_mmo.forge.ethyr.torch.policy.recurrent import BatchFirstLSTM
from neural_mmo.forge.ethyr.torch.policy.embed import BiasedInput, MixedD... | 1.1875 | 1 |
python/fledge/services/core/api/certificate_store.py | DDC-NDRS/fledge-iot_fledge | 69 | 12763886 | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
import os
import json
from aiohttp import web
from fledge.common import logger
from fledge.common.web.middleware import has_permission
from fledge.services.core import connect
from fledge.common.configuration_manager import... | 1.953125 | 2 |
ghapi/_nbdev.py | jrieke/ghapi | 0 | 12763887 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"GH_HOST": "00_core.ipynb",
"GhApi": "00_core.ipynb",
"date2gh": "00_core.ipynb",
"gh2date": "00_core.ipynb",
"print_summary": "00_core.ipynb",
"GhApi.delete_relea... | 1.140625 | 1 |
f.py | Brzeczunio/nauka_gita | 0 | 12763888 | def wypisz(par1, par2):
print('{0} {1}'.format(par1, par2))
def sprawdz(arg1, arg2):
if arg1 > arg2:
return True
else:
return False
| 3.25 | 3 |
zuoye/5.py | ASAv123456789/ASAv | 0 | 12763889 | <reponame>ASAv123456789/ASAv
ce,nll=input("<<")
lx=ce*(nll/1200)
print("The interest is",lx)
| 2.828125 | 3 |
tests/cli/test_test.py | flupke/jenskipper | 4 | 12763890 | <filename>tests/cli/test_test.py
import re
from jenskipper.cli import test
def test_test(requests_mock):
requests_mock.get('/api/json', json={'useCrumbs': False})
name_pattern = r'default_job%s\.[0-9a-f]{8}' % test.TEMP_JOBS_INFIX
requests_mock.post(re.compile('/job/%s/config.xml' % name_pattern))
qu... | 2.203125 | 2 |
capture-images.py | andrewxue98/sourdough | 0 | 12763891 | from time import sleep
from picamera import PiCamera
import datetime
import os
import RPi.GPIO as GPIO
pin1 = 4
pin2 = 17
dir = 'data'
if not os.path.exists(dir):
os.mkdir(dir)
camera = PiCamera()
while datetime.datetime.now() < datetime.datetime(2020, 12, 3, 12):
try:
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(F... | 3.078125 | 3 |
worker/fb.py | wdr-data/sportsfreund | 5 | 12763892 | import os
import json
import logging
import gevent
import requests
from feeds.models.subscription import Subscription
from lib.attachment import Attachment
from lib.facebook import upload_attachment, guess_attachment_type
from lib.response import Replyable, SenderTypes
from lib.sent_tracking import UserSentTracking
f... | 2.015625 | 2 |
tests/unit/beacons/test_memusage.py | Noah-Huppert/salt | 19 | 12763893 | <reponame>Noah-Huppert/salt<filename>tests/unit/beacons/test_memusage.py
# coding: utf-8
# Python libs
from __future__ import absolute_import
from collections import namedtuple
# Salt libs
import salt.beacons.memusage as memusage
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import M... | 2.09375 | 2 |
ml_ops/tests/diabetes/test_publish_model.py | GolamRashed/azure-databricks-mlops-mlflow | 33 | 12763894 | <reponame>GolamRashed/azure-databricks-mlops-mlflow
import logging
import unittest
from unittest.mock import MagicMock
from diabetes_mlops.publish_model import run
class TestEvaluateMethods(unittest.TestCase):
logger = logging.getLogger(__name__)
logging.basicConfig(
format="%(asctime)s %(module)s %(... | 2.5625 | 3 |
0034. Find First and Last Position of Element in Sorted Array/Solution.py | furutuki/LeetCodeSolution | 0 | 12763895 | from typing import List
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
low = 0
high = len(nums) - 1
while low < len(nums) and high >= 0 and low <= high:
mid = int((low + high) / 2)
if nums[mid] == target:
start = m... | 3.234375 | 3 |
sklearn_dummies/__init__.py | gsmafra/sklearn-dummies | 1 | 12763896 | <gh_stars>1-10
from .base import DataFrameDummies, NPArrayDummies
| 0.976563 | 1 |
tensorflow/python/training/saving/functional_saver.py | handongke/tensorflow | 36 | 12763897 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1.929688 | 2 |
PythonAdvance/re_example.py | JiaLei123/PythonCamp | 0 | 12763898 | <filename>PythonAdvance/re_example.py
import re
pattern = re.compile(r'[0-9]+')
match = pattern.findall('hello world! hello')
print pattern.findall('station 1000 100 and 7')
| 3.25 | 3 |
data-service/src/main/resources/apiserver.py | cgiraldo/platform-data-mgmnt | 4 | 12763899 | """
Copyright (c) 2016 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Apache License, Version 2.0
(the "License").
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
The code, technical concepts, and all information contained herein, a... | 1.390625 | 1 |
src/lib/test_environment/spawn_test_container.py | SimonDudanski/integration-test-docker-environment | 0 | 12763900 | <filename>src/lib/test_environment/spawn_test_container.py
import pathlib
from typing import List
import luigi
import netaddr
from docker.transport import unixconn
from ...lib.base.docker_base_task import DockerBaseTask
from ...lib.base.json_pickle_parameter import JsonPickleParameter
from ...lib.data.container_info ... | 1.992188 | 2 |
highlightjs/tests.py | bumfo/django-highlightjs | 0 | 12763901 | <filename>highlightjs/tests.py
from __future__ import unicode_literals
from django.test import TestCase
from django.utils.html import escape
from django.template import Template, Context
from django.test.utils import override_settings
from . import settings
class HighlightjsTemplateTagTests(TestCase):
def test... | 2.1875 | 2 |
Ex003.py | GabrielSilva2y3d/Curso-em-video-python-exercicios | 0 | 12763902 | valor1 = int(input('Digite um valor:'))
valor2 = int(input('Digite outro valor:'))
soma = valor1 + valor2
print(f'A soma entre os valores {valor1} e {valor2} é igual a {soma}!')
| 3.890625 | 4 |
Analytics/resources/Widgets/get_widgets.py | thanosbnt/SharingCitiesDashboard | 4 | 12763903 | <gh_stars>1-10
from http import HTTPStatus
from flask_jwt_extended import jwt_required
from flask_restful import Resource
from flask_restful import abort
from flask_restful import reqparse
from models.widget import WidgetModel
class GetWidgets(Resource):
"""
Get one or more widgets from the database with a ... | 2.828125 | 3 |
slime_mind/engine/plant.py | teofrastusb/That-Game | 0 | 12763904 | import random
import uuid
class Plant():
def __init__(self, config):
self.id = str(uuid.uuid4())
self.x = None
self.y = None
self.conf = config
self.level = 1
self.max_hp = config.getint('max_hp')
self.current_hp = self.max_hp
self.max_level = config.... | 3.265625 | 3 |
tests/test_ref_list.py | kyzas/scake | 0 | 12763905 | <reponame>kyzas/scake
# -*- coding: utf-8 -*-
from scake import Scake
class Foo():
def __init__(self, x):
self.x = x
def __call__(self):
return self.x
class Wrapper():
def __init__(self, x):
assert not isinstance(x, (tuple, list))
self.x = x
def __call__(self):
... | 2.203125 | 2 |
bin/tRNA-lengths.py | dlysiak/tsRNAsearch_add-new-species | 0 | 12763906 | #!/usr/bin/env python
"""
Write tRNA lengths to file
"""
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import sys
gff = open(sys.argv[1], "r")
readlines = gff.readlines()
gff.close()
my_list = list()
my_dict = dict()
for line in readlines:
splitline = line.strip().split("\t")
fe... | 2.875 | 3 |
torch2trt/converters/narrow.py | NVIDIA-AI-IOT-private/torch2trt | 0 | 12763907 | import tensorrt as trt
from torch2trt.torch2trt import *
from torch2trt.module_test import add_module_test
@tensorrt_converter('torch.Tensor.narrow')
@tensorrt_converter('torch.narrow')
def convert_narrow(ctx):
inputs = get_arg(ctx, 'input', pos=0, default=None)
start = get_arg(ctx, 'start', pos=2, default=... | 2.328125 | 2 |
aiostar/tasks/ParallelTask.py | douding123986/aiostar | 5 | 12763908 | """
Name : ParallelTask
Author : blu
Time : 2022/3/7 08:19
Desc : 并行任务基类
"""
from aiostar.tasks import BaseTask
class ParallelTask(BaseTask):
def __init__(self, fun, *args):
self.fun = fun
self.args = args
| 2.140625 | 2 |
view/console.py | germank/training-monitor | 0 | 12763909 | <reponame>germank/training-monitor<filename>view/console.py
import cmd
import logging
from signalslot import Signal
class CommandConsole(cmd.Cmd):
def __init__(self):
cmd.Cmd.__init__(self)
self.save_command = Signal(['output_dir'])
self.quit_command = Signal()
def do_sav... | 2.453125 | 2 |
parser.py | danesjenovdan/ajdovscina-parser | 0 | 12763910 | from parlaparser.parser import Parser
parser = Parser()
parser.parse()
| 1.320313 | 1 |
circuit_recognizer/circuit_recognizer/connect/edge.py | symbench/scm | 1 | 12763911 | <filename>circuit_recognizer/circuit_recognizer/connect/edge.py
class Edge:
def __init__(self, src, dst, line):
self.src = src
self.dst = dst
self.line = line
assert src != dst, f"Source and destination are the same!"
def reverse(self):
return Edge(self.dst, self.src, se... | 3.234375 | 3 |
example.py | AllCoolNicknamesWereTaken/NumPy_tut | 0 | 12763912 | from numpy import *
a = arange(20).reshape(4,5)
print(a)
print(a.ndim)
print("wymiary {}, typy {}".format(a.dtype.name, a.itemsize))
b = ones((2,3,5,6))
print(b.ndim)
c = empty_like(a)
a = a-c
d = a>(-45)
print(d)
#as array
# print(c*a)
# as matrix
d = random.random((2,3,6))
# print("minimum {}, maximum{}".format(d.m... | 3.09375 | 3 |
plugin/vimtools/tests/test_delete.py | dsw7/VimTools | 0 | 12763913 | <reponame>dsw7/VimTools
from helpers import VimToolsTestCase
class TestDel(VimToolsTestCase):
def setUp(self):
self.input_string = """\
foo bar 1
foo bar 2
foo bar 3
"""
def test_del(self):
expected_string = """\
foo bar 3
"""
command =... | 2.5625 | 3 |
sistem_ozellikleri.py | melihcemipek/python | 0 | 12763914 | import platform
# İşletim sistemi
print(platform.system())
# İşlemci bilgisi
print(platform.processor())
# Nesil bilgisi
print(platform.release())
# PC Bağlantı adı
print(platform.node())
# Python Versiyonu
print(platform.python_version())
# Python Compiler Bilgisi
print(platform.python_compiler())
| 1.726563 | 2 |
setup.py | saulzar/node_expressions | 1 | 12763915 | <filename>setup.py
from setuptools import setup, find_namespace_packages
setup(
name="node-expressions",
version="0.1.3",
author="<NAME>",
author_email="<EMAIL>",
description="API for using expressions to create node graphs in blender",
url="https://github.com/saulzar/node_expressions",
pac... | 1.25 | 1 |
scripts/owner/what_do_i_own.py | wwjiang007/fuchsia-1 | 210 | 12763916 | <filename>scripts/owner/what_do_i_own.py
#!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import re
import sys
SCRIPT_DIR = os.path.dirname(os.path.abspath... | 2.484375 | 2 |
runtime/hetdesrun/adapters/local_file/utils.py | mmalki-neusta/hetida-designer | 41 | 12763917 | def to_url_representation(path: str) -> str:
"""Convert path to a representation that can be used in urls/queries"""
return path.replace("_", "-_-").replace("/", "__")
def from_url_representation(url_rep: str) -> str:
"""Reconvert url representation of path to actual path"""
return url_rep.replace("__... | 3.265625 | 3 |
tests/test_pds.py | gamis/flo | 0 | 12763918 | <reponame>gamis/flo<gh_stars>0
import pandas as pd
import pytest
from pandas.testing import assert_series_equal, assert_frame_equal
from flo import e_
from flo.pds import monkey_patch_pandas
monkey_patch_pandas()
@pytest.mark.parametrize('series,value,expected',
[(pd.Series([1, 2, 3, 4, 3])... | 2.34375 | 2 |
CLI.py | smiteshz/YLYLDadJokes | 1 | 12763919 | import requests as req
print( " _ _ _____ _ ___ ___ ___ ___ ")
print( " | | | | / ____| | | |__ \ / _ \ / _ \ / _ \ ")
print( " | | ___ | | _____ | | __ ___ _ __ ___ _ __ __ _| |_ ___ _ ... | 3.125 | 3 |
brainframe_qt/ui/dialogs/server_configuration/server_configuration.py | aotuai/brainframe-qt | 17 | 12763920 | <filename>brainframe_qt/ui/dialogs/server_configuration/server_configuration.py
import logging
from typing import Optional, Tuple
from PyQt5.QtCore import QObject
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QCheckBox, QDialog, QDialogButtonBox, \
QGridLayout, QLabel, QLineEdit, QPushBut... | 1.820313 | 2 |
test.py | sfu-arch/uir-lib | 4 | 12763921 | <gh_stars>1-10
with open('log', 'r') as logfile:
for line in logfile:
if line.__contains__('LOG'):
print(line)
#pvahdatn@cs-arch-20:~/git/dandelion-lib$ sbt "testOnly dataflow.test03Tester" > log
| 2.1875 | 2 |
beckley/solver/solver.py | cypher-me/HAS-Qualifier-Challenges | 75 | 12763922 | from skyfield.api import EarthSatellite, Topos, load, load_file
import os,sys,stat,time
from pwnlib.tubes.remote import remote
from pwnlib.tubes.process import process
import re
##convert from Skyfield to Decimal
def c_to_d(coordinate):
coord_str = str(coordinate)
coord_split = coord_str.split()
... | 2.625 | 3 |
setup.py | muellermartin/flipflop | 16 | 12763923 | <filename>setup.py
# Bootstrap setuptools
from distutils.core import setup
setup(
name='flipflop',
version='1.0',
py_modules=['flipflop'],
provides=['flipflop'],
author='<NAME>',
author_email='<EMAIL>',
description='FastCGI wrapper for WSGI applications',
url='https://github.com/Kozea/... | 1.101563 | 1 |
src/robusta/core/reporting/consts.py | robusta-dev/robusta | 273 | 12763924 | from enum import Enum
SYNC_RESPONSE_SINK = "robusta-synchronized-response-sink"
class FindingType(Enum):
ISSUE = "issue"
CONF_CHANGE = "configuration_change"
HEALTH_CHECK = "health_check"
REPORT = "report"
# Finding sources
class FindingSource(Enum):
NONE = None # empty default
KUBERNETES_... | 2.296875 | 2 |
protocol/arc_package_specifics_pb2.py | pablo-tx/chrome-sync-server | 8 | 12763925 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: arc_package_specifics.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | 1.226563 | 1 |
top_400/linked_list/237_delete_node_in_a_linked_list.py | Fernadoo/LeetCode | 0 | 12763926 | <filename>top_400/linked_list/237_delete_node_in_a_linked_list.py
'''
Write a function to delete a node (except the tail) in a singly
linked list, given only access to that node.
Given linked list -- head = [4,5,1,9], which looks like following:
Example 1:
Input: head = [4,5,1,9], node = 5
Output: [4,1,9]
Explanati... | 4.0625 | 4 |
app/main.py | cds-snc/sre-bot | 0 | 12763927 | import os
import logging
from slack_bolt.adapter.socket_mode import SocketModeHandler
from slack_bolt import App
from dotenv import load_dotenv
from commands import incident, sre
from commands.helpers import incident_helper, webhook_helper
from server import bot_middleware, server
from jobs import scheduled_tasks
ser... | 1.945313 | 2 |
plot.py | thomasg3/energy-price-aware-scheduling | 1 | 12763928 | <gh_stars>1-10
#!/usr/bin/env python
# make a visualisation of the results, filtered and with the optimal added to the plot or not.
import os
import argparse
import cPickle as pickle
import matplotlib.pyplot as plt
def main(filter, optimal_too):
run_location = os.path.join("results", "runs")
image_location... | 2.34375 | 2 |
A3/code/part4.py | ankurshaswat/COL780 | 1 | 12763929 | """
Move object from one visual marker to another
"""
import sys
import cv2
import numpy as np
import obj_loader
from utils import (calculate_dist_corners, get_camera_params,
get_matrix, load_ref_images, render, get_homographies_contour)
if __name__ == "__main__":
OBJ_PATH = sys.argv[1]
... | 2.71875 | 3 |
torchsolver/utils/counter.py | killf/torchsolver | 0 | 12763930 | <gh_stars>0
import torch
import numpy as np
__ALL__ = ["Counter"]
class Counter:
def __init__(self):
self.data = dict()
def append(self, **kwargs):
for key, value in kwargs.items():
self.set(key, value)
def set(self, key, value):
if key not in self.data:
... | 2.46875 | 2 |
Python/Behavioral/Strategy.py | mildmelon/design-patterns-for-humans-python | 10 | 12763931 | class SortStrategy:
def sort(self, dataset):
pass
class BubbleSortStrategy(SortStrategy):
def sort(self, dataset):
print('Sorting using bubble sort')
return dataset
class QuickSortStrategy(SortStrategy):
def sort(self, dataset):
print('Sorting using quick sort')
re... | 3.15625 | 3 |
coding/python/day03/02_read_json_multiline.py | dkapanidis/my-tutorials | 0 | 12763932 | from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
df = spark.read.option("multiLine", True).json("people_multiline.json")
print(df.show()) | 2.953125 | 3 |
1216. Valid Palindrome III .py | LiaoJJ/LeetCode | 1 | 12763933 | '''
BF C(n,k)*n O(n!)
LeetCode 516
DP find the longest palindrome sequence O(n^2)
'''
class Solution:
def isValidPalindrome(self, s: str, k: int) -> bool:
n = len(str)
dp = [[0]*n for _ in range(n)]
for i in range(n-2, -1, -1):
dp[i][i] = 1
for j in range(i+1, n)... | 3.46875 | 3 |
gen_model.py | munnellg/elltm | 3 | 12763934 | import sys
import logging
import gensim
from optparse import OptionParser
from docs import config
logging.basicConfig(format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO)
# Build this program's option parser
def build_opt_parser():
usage = "usage: %prog [options] <filename> [, <filename>, ...]"... | 2.734375 | 3 |
neodroidvision/entry_points/cli.py | sintefneodroid/vision | 0 | 12763935 | <reponame>sintefneodroid/vision<filename>neodroidvision/entry_points/cli.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__doc__ = r"""
Created on 09/02/2020
"""
import fire
from neodroidvision import get_version
from pyfiglet import Figlet
import draugr
spo... | 2.203125 | 2 |
blog/context_processor/context.py | misterpingvinist/skeletpingvina.xyz | 0 | 12763936 | from ..models import About
from blog.forms import ContactForm
from blog.models import Category
def about(request):
about = About.objects.all()[0]
category = Category.objects.all()
form = ContactForm()
return {
'about_title': about.title,
'about_text': about.text,
'about_image':... | 2.0625 | 2 |
delivery/models.py | choudhary2001/ecommerce | 2 | 12763937 | <reponame>choudhary2001/ecommerce<gh_stars>1-10
from django.db import models
# Create your models here.
from django.contrib.auth.models import User
from django.utils.html import mark_safe
from django.db import models
from PIL import Image
# Create your models here.
class DeliveryBoy(models.Model):
STATE_CHOICES = (
... | 2.28125 | 2 |
meutils/aizoo/examples/pooling.py | Jie-Yuan/MeUtils | 3 | 12763938 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : inn.
# @File : pooling
# @Time : 2020/5/20 6:23 下午
# @Author : yuanjie
# @Email : <EMAIL>
# @Software : PyCharm
# @Description :
import tensorflow as tf
# 类似np
tf.keras.layers.GlobalMaxPooling1D
tf.keras.layers.GlobalAv... | 1.90625 | 2 |
yanghui/116connect.py | technologyMz/ALL_IN_ML | 3 | 12763939 | """
# Definition for a Node.
"""
import collections
class Node:
def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None):
self.val = val
self.left = left
self.right = right
self.next = next
class Solution:
def connect_DFX(self, root) :
... | 3.921875 | 4 |
test.py | lhq1/legal-predicetion | 87 | 12763940 | import argparse
import os
import torch
from net.model import get_model
from net.file_reader import init_dataset, init_transformer
from net.work import test_file
from net.parser import ConfigParser
from net.loader import init
from net.utils import init_thulac
parser = argparse.ArgumentParser()
parser.add_argument('--m... | 2.28125 | 2 |
ibis/pandas/core.py | emilyreff7/ibis | 5 | 12763941 | """The pandas backend is a departure from the typical ibis backend in that it
doesn't compile to anything, and the execution of the ibis expression
is under the purview of ibis itself rather than executing SQL against a server.
Design
------
The pandas backend uses a technique called `multiple dispatch
<https://en.wik... | 3.21875 | 3 |
tests/unit/test_reports.py | flying-sheep/profimp | 56 | 12763942 | # Copyright 2015: <NAME>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 2.421875 | 2 |
src/uncertainty.py | QianWanghhu/IES-FF | 0 | 12763943 | <gh_stars>0
#!/usr/bin/env python
import numpy as np
import pandas as pd
# Note: do save the results while running the original model.
from multiprocessing import Pool
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import time
import copy
import pandas as pd
import pickle
fr... | 1.851563 | 2 |
scripts/separateComponents.py | tatumdmortimer/t7ss | 0 | 12763944 | <gh_stars>0
#!/usr/bin/env python
import argparse
from collections import defaultdict
from Bio import SeqIO
# This gets conserved gene names from orthomcl output, checks that those genes
# are on the same component from plasmidSPAdes assembly, and outputs a file
# listing gene names.
def get_args():
"""Parse co... | 3.125 | 3 |
ssd/src/ssd_model.py | chuanfuye/object_detection | 0 | 12763945 | from src.res50_backbone import resnet50
from torch import nn, Tensor
import torch
from torch.jit.annotations import Optional, List, Dict, Tuple, Module
from src.utils import dboxes300_coco, Encoder, PostProcess
class Backbone(nn.Module):
def __init__(self, pretrain_path=None):
super(Backbone, self).__init... | 2.3125 | 2 |
foldershare.py | xHasKx/foldershare | 0 | 12763946 | <filename>foldershare.py
#!/usr/bin/env python3
import os
import sys
import argparse
import traceback
from subprocess import Popen, PIPE
from http.server import HTTPServer, BaseHTTPRequestHandler
# using 1 MB chunks when sending tar.gz stream
CHUNKSIZE = 1*1024*1024
class ShareHandler(BaseHTTPRequestHandler):
'... | 2.9375 | 3 |
where/cleaners/removers/__init__.py | ingridfausk/where | 16 | 12763947 | <gh_stars>10-100
"""Framework for removing observations
Description:
------------
Each remover should be defined in a separate .py-file. The function inside the .py-file that should be called needs to
be decorated with the :func:`~midgard.dev.plugins.register` decorator as follows::
from midgard.dev import plugi... | 2.390625 | 2 |
tests/runner/http/test_request.py | hf400159/apisix-python-plugin-runner | 0 | 12763948 | <reponame>hf400159/apisix-python-plugin-runner
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License... | 1.9375 | 2 |
restaurants/views.py | MaryamKia/RestaurantsApp | 0 | 12763949 | from django.db.models import Q
import random
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.views import View
from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView
from django.contrib.auth.decorators imp... | 2.171875 | 2 |
world_rowing/cli.py | matthewghgriffiths/rowing | 1 | 12763950 | #!/usr/bin/env python
import sys
import argparse
import datetime
import logging
from typing import (
Optional, Dict, List, cast, Union, Any, Tuple, Iterable
)
import pandas as pd
import cmd2
from world_rowing import api, dashboard
from world_rowing.utils import first
logger = logging.getLogger('world_rowing.cl... | 3.125 | 3 |