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 |
|---|---|---|---|---|---|---|
belphegor/utils/modding.py | nguuuquaaa/Belphegor | 16 | 12777351 | <reponame>nguuuquaaa/Belphegor<gh_stars>10-100
import discord
from discord.ext import commands
from . import checks, string_utils
import multidict
import functools
from yarl import URL
#=====================================================================================================================================... | 2.578125 | 3 |
pavement.py | robotframework/HTMLChecker | 9 | 12777352 | import os
from os.path import join as _join
from subprocess import call
from paver.easy import *
from paver.setuputils import setup
BASEDIR = os.path.dirname(__file__)
VERSION = '0.3'
setup(
name='robotframework-htmlchecker',
package_dir = {'': 'src'},
packages=['HTMLChecker', 'HTMLChecker.lib'],
ver... | 2.078125 | 2 |
dev/results/half_wing_swept_45_deg/machline_iterator.py | usuaero/MachLine | 2 | 12777353 | # This script is to run automate running machline for the Weber and Brebner results
import numpy as np
import json
import subprocess
import time
import multiprocessing as mp
import os
# Record and print the time required to run MachLine
start_time = time.time()
def mach_iter(AoA, Node, formulation, freestream):
... | 2.3125 | 2 |
Lib/site-packages/hackedit/vendor/coloredlogs/tests.py | fochoao/cpython | 0 | 12777354 | # Automated tests for the `coloredlogs' package.
#
# Author: <NAME> <<EMAIL>>
# Last Change: November 14, 2015
# URL: https://coloredlogs.readthedocs.org
"""Automated tests for the `coloredlogs` package."""
# Standard library modules.
import logging
import logging.handlers
import os
import random
import re
import str... | 2.0625 | 2 |
nesi/devices/softbox/api/models/portprofile_models.py | inexio/NESi | 30 | 12777355 | # This file is part of the NESi software.
#
# Copyright (c) 2020
# Original Software Design by <NAME> <https://github.com/etingof>.
#
# Software adapted by inexio <https://github.com/inexio>.
# - <NAME> <https://github.com/unkn0wn-user>
# - <NAME> <https://github.com/Connyko65>
# - <NAME> <https://github.com/Dinker1996... | 1.648438 | 2 |
train_softmax_clean.py | ad349/fashionmnist | 0 | 12777356 | <filename>train_softmax_clean.py
#!/usr/bin env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import tensorflow as tf
import argparse
from utils import normalize, decode
from model import graph
def input_pip... | 2.859375 | 3 |
qord/core/shard.py | TheFarGG/qord | 0 | 12777357 | <filename>qord/core/shard.py<gh_stars>0
# MIT License
# Copyright (c) 2022 <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 right... | 1.601563 | 2 |
example/states.py | BLeAm/trigger | 0 | 12777358 | from trigger_generator import *
@trigger
class MyTrigger:
counter: int = 0
build() | 1.335938 | 1 |
robot_manager/handler/irc/connection_handler.py | ES-TUDelft/interaction-design-tool-ir | 1 | 12777359 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# **
#
# ================== #
# CONNECTION_HANDLER #
# ================== #
# Handler class for controlling the connection to the robot
#
# @author ES
# **
import logging
import threading
from autobahn.twisted.component import Component, run
from twisted.internet.defer im... | 1.726563 | 2 |
setup.py | theroggy/geofileops | 1 | 12777360 | <filename>setup.py
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
with open('version.txt', mode='r') as file:
version = file.readline()
setuptools.setup(
name='geofileops',
version=version,
author='<NAME>',
author_email='<EMAIL>',
description='Package t... | 1.585938 | 2 |
scripts/price_feed_scripts/read_price_feed.py | coozebra/chainlink-mix | 9 | 12777361 | #!/usr/bin/python3
from brownie import PriceFeed
def main():
price_feed_contract = PriceFeed[len(PriceFeed) - 1]
print("Reading data from {}".format(price_feed_contract.address))
print(price_feed_contract.getLatestPrice())
| 3.0625 | 3 |
src/024_train-probabilistic-svm.py | BirdVox/bv_context_adaptation | 5 | 12777362 | <reponame>BirdVox/bv_context_adaptation<filename>src/024_train-probabilistic-svm.py
import csv
import datetime
import h5py
from sklearn.externals import joblib
import numpy as np
import os
import pandas as pd
import pickle
import sklearn.preprocessing
import sklearn.svm
import skm
import sys
import time
sys.path.appen... | 2.109375 | 2 |
app/app.py | rilder-almeida/projeto_case_enfase | 0 | 12777363 | """
Módulo da aplicação usando Streamlit para gerar a estrutura front-end
"""
# FIXME: Por algum motivo o streamlit não aceita importar as páginas
# via __init__.py ou importação relativa
# pylint: disable=import-error
import streamlit as st
from introducao import intro
from questao_problema import case
from analise_ge... | 2.796875 | 3 |
customer/migrations/0002_auto_20210618_2044.py | Sukikiroi/Django-Smart-lms-backend | 1 | 12777364 | # Generated by Django 3.2.4 on 2021-06-18 19:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Messages',
fields=[
('id'... | 1.820313 | 2 |
contrib/experimental/alert-ucs.py | MailOnline/alerta | 0 | 12777365 | <reponame>MailOnline/alerta<filename>contrib/experimental/alert-ucs.py
import UcsSdk
import time
def EventHandler(mce):
print 'Received a New Event with ClassId: ' + str(mce.mo.classId)
print "ChangeList: ", mce.changeList
print "EventId: ", mce.eventId
def main():
ucs = UcsSdk.UcsHandle()
ucs.... | 2.25 | 2 |
recipe_db/etl/loader.py | scheb/beer-analytics | 21 | 12777366 | <reponame>scheb/beer-analytics
import abc
from typing import Tuple, List
from django.core.exceptions import ValidationError
from django.db import transaction
from recipe_db.etl.format.parser import FormatParser, ParserResult
from recipe_db.models import Recipe, RecipeHop, RecipeFermentable, RecipeYeast
class Result... | 2.09375 | 2 |
src/utils/setseed.py | seung-sss/model-optimization-level3-cv-04 | 1 | 12777367 | <reponame>seung-sss/model-optimization-level3-cv-04
import numpy as np
import random
import torch
def setSeed(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed) # if use multi-GPU
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
np.random.... | 2.171875 | 2 |
services/traction/api/endpoints/routes/v1/tenant/governance/schema_templates.py | bcgov/traction | 12 | 12777368 | import logging
from uuid import UUID
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from starlette import status
from starlette.requests import Request
from api.core.config import settings
from api.endpoints.dependencies.db import get_db
from api.endpoints.dependencies.tenant_s... | 1.90625 | 2 |
pdf.py | isLinXu/AIToodlBox | 3 | 12777369 | <gh_stars>1-10
from PIL import Image
import fitz # fitz: pip install PyMuPDF
def pdf2images(doc, zoom=2, color='RGB'):
"""pdf to images
example:
doc = fitz.open(/path/to/pdf)
images = pdf2images(doc)
example:
stream = open(/path/to/pdf, 'rb')
doc = fitz.open(stream)
... | 2.890625 | 3 |
local/lib/python3.6/site-packages/pgadmin4/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py | sahilsdei/django_ecommerce | 0 | 12777370 | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import sys
import... | 1.851563 | 2 |
change_ab.py | ximury/python | 0 | 12777371 | <reponame>ximury/python
a, b = 3, 4
print(a, b)
a, b = b, a
print(a, b)
print('---------------------')
a = 1
a += 1
print(a)
| 3.484375 | 3 |
openff/evaluator/protocols/utils.py | lilyminium/openff-evaluator | 0 | 12777372 | """
A set of utilities for setting up property estimation workflows.
"""
from dataclasses import astuple, dataclass
from typing import Generic, Optional, Tuple, TypeVar
from openff.evaluator import unit
from openff.evaluator.attributes import PlaceholderValue
from openff.evaluator.datasets import PropertyPhase
from op... | 2.140625 | 2 |
lib/solutions/CHK/checkout_solution.py | DPNT-Sourcecode/CHK-zxlf01 | 0 | 12777373 | # noinspection PyUnusedLocal
# skus = unicode string
def checkout(skus):
items = {
"A": {"price": 50, "deals": [{"quantity": 5, "price": 200}, {"quantity": 3, "price": 130}]},
"B": {"price": 30, "deals": [{"quantity": 2, "price": 45}]},
"C": {"price": 20},
"D": {"price": 15},
... | 2.421875 | 2 |
todo-api/app/core/tests/test_middleware.py | rkkhub/todo | 0 | 12777374 | from django.contrib.auth import get_user_model
from django.test import TestCase, override_settings
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
TASK_URL = reverse('todo:task-list')
def sample_get_request(client):
return client.get(TASK_URL)
def ... | 2.296875 | 2 |
backend/src/applications/session/create_session_request.py | Seina88/attendance-system | 2 | 12777375 | class CreateSessionRequest:
def __init__(self, info: str, password: str) -> None:
self.info = info
self.password = password
| 2.046875 | 2 |
server/utils/__init__.py | lolimay/digit-recognition | 6 | 12777376 | <reponame>lolimay/digit-recognition<filename>server/utils/__init__.py
"""
Created by lolimay <<EMAIL>>
Last Updated 2019-07-11
""" | 0.941406 | 1 |
packages/arb-compiler-evm/arbitrum/evm/types.py | pangxieshousi/arbitrum | 1 | 12777377 | # Copyright 2019, Offchain Labs, Inc.
#
# 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 ... | 1.742188 | 2 |
turma1/favela_radical/favela_radical/favela_radical.py | Niyudi/favela-radical | 0 | 12777378 | <filename>turma1/favela_radical/favela_radical/favela_radical.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#from -> de import -> importar
from PyQt5.QtWidgets import QApplication
# sys -> sistema
from sys import argv, exit
from interface import JanelaPrincipal
class Aplicativo(QApplication):
def... | 2.46875 | 2 |
tests/unit_tests/test_session.py | slashsec-edu/cryton-core | 0 | 12777379 | from django.test import TestCase
from mock import patch
from cryton.lib.util import exceptions, logger
from cryton.lib.models import session
from cryton.cryton_rest_api.models import (
SessionModel,
PlanExecutionModel,
StepModel
)
import os
from model_bakery import baker
TESTS_DIR = os.path.dirname(os.pa... | 2.109375 | 2 |
tests/integration/test_release_event.py | majamassarini/packit-service | 20 | 12777380 | <gh_stars>10-100
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import json
import shutil
import pytest
from celery.app.task import Context, Task
from celery.canvas import Signature
from flexmock import flexmock
from github import Github
from rebasehelper.exceptions import RebaseHelperE... | 1.734375 | 2 |
sms_sender.py | sleekmike/Twilio-Rasa-Leads-Chatbot | 0 | 12777381 | <filename>sms_sender.py
from twilio.rest import Client
import requests
import os
# ===========================> Getting Environments Variables <================================
twilio_account_sid = os.getenv('TWILIO_ACCOUNT_SID')
twilio_auth_token = os.getenv('TWILIO_AUTH_TOKEN')
twilio_number = os.getenv('TWILIO_SMS_... | 2.484375 | 2 |
lib/innvestigate/src/innvestigate/utils/__init__.py | vwesselkamp/deepfake-fingerprint-atacks | 0 | 12777382 | <gh_stars>0
# Get Python six functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
###############################################################################
###############################################################################
##########################... | 1.96875 | 2 |
modules/2.79/bpy/types/ThemeUserPreferences.py | cmbasnett/fake-bpy-module | 0 | 12777383 | ThemeUserPreferences.space = None
| 1.132813 | 1 |
napari_browser_adv.py | sebi06/czi_demos | 3 | 12777384 | # -*- coding: utf-8 -*-
#################################################################
# File : napari_browser_adv.py
# Version : 0.0.1
# Author : czsrh
# Date : 18.11.2020
# Institution : Carl Zeiss Microscopy GmbH
#
# Copyright (c) 2020 <NAME>, Germany. All Rights Reserved.
################... | 2.125 | 2 |
ez_utils/date_utils.py | darkripples/none-web-frame | 2 | 12777385 | #!/usr/bin/env python
# coding:utf8
"""
@Time : 2018/10/31
@Author : fls
@Contact : <EMAIL>
@Desc : fls易用性utils-日期相关utils
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2018/10/31 11:41 fls 1.0 create
2020/08/01 11:4... | 2.828125 | 3 |
src/encrypted_bigquery_client_test.py | datavirtualization/encrypted-bq-client | 0 | 12777386 | <reponame>datavirtualization/encrypted-bq-client
#!/usr/bin/env python
# Copyright 2013 Google Inc. All Rights Reserved.
"""Unit tests for Encrypted Bigquery Client module."""
from copy import deepcopy
import random
from google.apputils import app
import gflags as flags
from google.apputils import basetest as goog... | 2.8125 | 3 |
server/sttp.py | S1ckret/stm32-esp8266-smart-house | 2 | 12777387 | <filename>server/sttp.py
# S1ckret Team Transfer Protocol
import constants
dict_sensor_id_to_file = {
1 : "ledStatus.txt",
2 : "temperature.txt"
}
def handle_R_frame(msg):
sensor_id = msg[1]
payload_size = msg[2]
payload = msg[3:]
data = int.from_bytes(payload, byteorder="big")
pr... | 2.71875 | 3 |
backend/api/migrations/0007_auto_20210930_1352.py | giacomooo/CASFEE_Project2 | 0 | 12777388 | # Generated by Django 3.2.4 on 2021-09-30 11:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0006_reservation_iscanceled'),
]
operations = [
migrations.AddField(
model_name='reservation',
name='Amount',... | 1.703125 | 2 |
__init__.py | MattEvans16/TempController | 0 | 12777389 | <filename>__init__.py
from flask import Flask, render_template, request, redirect, url_for, session, abort, make_response, g, Response, stream_with_context, jsonify, send_from_directory
from temp_config import *
from temp_control import *
from random import randint
app = Flask('temp_control')
@app.teardown_appcontext... | 2.578125 | 3 |
WikiRecs-notebook.py | drsaunders/wikirecs | 2 | 12777390 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.10.3
# kernelspec:
# display_name: wikirecs
# language: python
# name: wikirecs
# ---
... | 2.546875 | 3 |
SaveTheGalaxy.py | ObradovicNikola/SaveTheGalaxy | 3 | 12777391 | import random
import os.path
import pygame
import sys
from pygame.locals import *
WIDTH = 800
HEIGHT = 640
FPS = 60
POWERUP_TIME = 4000
RELOAD = 300
NUMSTARS = 30
TYPING_SPEED = 300
PLAYER_MAX_HEALTH = 100
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
YELLOW = (255... | 2.59375 | 3 |
app/urls.py | RegilioSpee/k_sec-filecify | 0 | 12777392 | <reponame>RegilioSpee/k_sec-filecify
from django.urls import path,include
from . import views
urlpatterns = [
path('registration/', views.registration),
path('login/',views.user_login,name="login")
]
| 1.820313 | 2 |
geetools/ui/ipytools.py | guy1ziv2/gee_tools | 0 | 12777393 | # coding=utf-8
""" General tools for the Jupyter Notebook and Lab """
from ipywidgets import HTML, Tab, Accordion, Checkbox, HBox, Layout, Widget, \
VBox, Button, Box, ToggleButton, IntSlider, FloatText
from traitlets import List, Unicode, observe, Instance, Tuple, Int, Float
from .. import batch
# imports for a... | 2.34375 | 2 |
models.py | dahe-cvl/isvc2020_overscan_detection | 0 | 12777394 | <reponame>dahe-cvl/isvc2020_overscan_detection<filename>models.py
from torchvision import models
from torchvision.models.segmentation.deeplabv3 import DeepLabHead
from torchvision.models.segmentation.fcn import FCNHead
from metrics import *
from datasets import *
from collections import OrderedDict
class CNN(nn.Modul... | 2.203125 | 2 |
hexFileParser.py | rdaforno/hexfilepatcher | 4 | 12777395 | <gh_stars>1-10
#!/usr/bin/python3
######################################################################################
#
# Intel HEX file parser
#
# 2020, rdaforno
#
######################################################################################
import binascii
# Intel HEX file parser
class HexFileParser:... | 3.125 | 3 |
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_alarmgr_server_oper.py | tkamata-test/ydk-py | 0 | 12777396 | <reponame>tkamata-test/ydk-py
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, RE... | 1.59375 | 2 |
2020/day5.py | Hofei90/Hofei_AdventofCode | 1 | 12777397 | <gh_stars>1-10
import os
SKRIPTPFAD = os.path.abspath(os.path.dirname(__file__))
class BinaryBoarding:
def __init__(self, max_row, max_column, seat):
self.rows = [value for value in range(0, max_row)]
self.columns = [value for value in range(0, max_column)]
self.seat = seat
self.s... | 3.015625 | 3 |
rubiksnet/shiftlib/rubiks3d/primitive.py | javierlorenzod/RubiksNet | 86 | 12777398 | <gh_stars>10-100
import torch # this line is necessary for CUDAExtension to load
import rubiksnet_cuda
from rubiksnet.utils import *
__all__ = [
"rubiks_shift_3d_forward",
"rubiks_shift_3d_backward",
"rubiks_shift_3d",
]
def _make_tuple(elem, repeats):
"""
expand 3 into (3, 3) for strides/paddi... | 2.28125 | 2 |
ietf/meeting/migrations/0026_cancel_107_sessions.py | hassanakbar4/ietfdb | 25 | 12777399 | # Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-18 16:18
from __future__ import unicode_literals
from django.db import migrations
def cancel_sessions(apps, schema_editor):
Session = apps.get_model('meeting', 'Session')
SchedulingEvent = ap... | 1.710938 | 2 |
ibalert/asgi.py | ItsMilann/channels-alert | 0 | 12777400 | <reponame>ItsMilann/channels-alert
import imp
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from django.urls import path
from ibalert.consumers import NotificationConsumer
application = ProtocolTypeRouter(
{
"websocket": AuthMiddlewareStack(
... | 1.859375 | 2 |
tests/conftest.py | lumapps/changelog-generator | 0 | 12777401 | <filename>tests/conftest.py
import os
import tempfile
from pathlib import Path
import pytest
from git import Repo
@pytest.fixture(scope="session", autouse=True)
def core_repo() -> Repo:
tempdir = Path(tempfile.gettempdir()) / "changelog_generator" / "core"
try:
os.makedirs(tempdir)
repo = Rep... | 1.875 | 2 |
pycatia/knowledge_interfaces/relations.py | evereux/catia_python | 90 | 12777402 | <reponame>evereux/catia_python<filename>pycatia/knowledge_interfaces/relations.py
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.... | 1.929688 | 2 |
src/semantic_parsing_with_constrained_lm/configs/qdmr_break_emnlp_camera_ready.py | microsoft/semantic_parsing_with_constrained_lm | 17 | 12777403 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""This config file is for running experiments needed for the EMNLP camera ready.
It will generate the following experiments (depending on the value of eval_split and model):
- 100 dev examples
- GPT-3 Constrained Canonical, n = 1000
- GPT-3 C... | 1.929688 | 2 |
egret/model_library/transmission/bus.py | breldridge/Egret | 0 | 12777404 | # ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain r... | 2.515625 | 3 |
tests/integration/test_with_rabbitmq.py | thiagopena/python-mcollective | 1 | 12777405 | import os
from pymco.test import ctxt
from . import base
class RabbitMQTestCase(base.IntegrationTestCase):
'''RabbitMQ integration test case.'''
CTXT = {
'connector': 'rabbitmq',
'plugin.rabbitmq.vhost': '/mcollective',
'plugin.rabbitmq.pool.size': '1',
'plugin.rabbitmq.pool.... | 2.015625 | 2 |
Modules/Discord/Helix/utils/config/i18n.py | SinLess-Games/Helix | 3 | 12777406 | import contextlib
import functools
import io
import os
from pathlib import Path
from typing import Callable, Union, Dict, Optional
import babel.localedata
from babel.core import Locale
__all__ = [
"get_locale",
"set_locale",
"reload_locales",
"cog_i18n",
"Translator",
"get_babel_locale",
]
_c... | 2.921875 | 3 |
src/dfi/fs.py | slyphon/dfinstall | 0 | 12777407 | <reponame>slyphon/dfinstall
from typing import List, Optional, Union, cast, Dict, Callable
import sys
import os
import os.path as osp
from stat import *
from pathlib import Path
import json
import logging
import arrow
from .dotfile import LinkData
from .config import Settings, TFileStrategy, TSymlinkStrategy, file_str... | 1.953125 | 2 |
tests/mocklogin_duo.py | cloudposse/duo_unix | 1 | 12777408 | #!/usr/bin/env python
import os
import pexpect
import paths
PROMPT = '.* or option \(1-4\): $'
def _login_duo():
p = pexpect.spawn(paths.login_duo + ' -d -c confs/mockduo.conf ' + \
'-f foobar echo SUCCESS')
p.expect(PROMPT, timeout=2)
print '===> %r' % p.match.group(0)
return ... | 2.5 | 2 |
src/cambiopy/azure.py | CNuge/CamBioPy | 0 | 12777409 | #!/bin/env/python3
import sys
import os
import argparse
#location = '.'
#suffix = '.py'
def get_filelist(location, suffix = None, recursive = False):
""" Get a list of files in a directory and optionally its subdirs,
with optional suffix matching requirement."""
if recursive == False:
if suffix is No... | 3.109375 | 3 |
chapter6.py | rpmva/Python1 | 0 | 12777410 | #Chapter 6 Notes
#List = ['a', 'b', 'c'];
#Character at a certain index: List[0] = 'a';
#len(List) = 3;
#Count how often something appears in a list: List.count('a') = 1; List.count('d') = 0;
#Where an index occurs: List.index('b') = 1
#Checking if a character or string is in a list: 'd' in List = False
#Adding items t... | 4.40625 | 4 |
tests/molecular/functional_groups/functional_group/generic_functional_group/test_get_bonder_ids.py | stevenbennett96/stk | 21 | 12777411 | import itertools as it
def test_get_bonder_ids(generic_case_data):
"""
Test :meth:`.GenericFunctionalGroup.get_bonder_ids`.
Parameters
----------
generic_case_data : :class:`.GenericCaseData`
The test case. Holds the functional group to test and the
atoms holding the correct bonde... | 2.421875 | 2 |
SoftLayer/tests/CLI/modules/vs_tests.py | briancline/softlayer-python | 0 | 12777412 | <gh_stars>0
"""
SoftLayer.tests.CLI.modules.vs_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import mock
from SoftLayer import testing
import json
class VirtTests(testing.TestCase):
def test_list_vs(self):
result = self.run_command(['vs', 'list... | 1.945313 | 2 |
tests/test_obspack_surface_collection_recipes.py | dkauf42/gdess | 2 | 12777413 | <reponame>dkauf42/gdess
import os
import pytest
import xarray as xr
from co2_diag import load_stations_dict
from co2_diag.data_source.observations.gvplus_surface import Collection
@pytest.fixture
def newEmptySurfaceStation():
mySurfaceInstance = Collection()
return mySurfaceInstance
def test_station_MLO_is... | 1.9375 | 2 |
sidekick/management/commands/import_members.py | cybera/netbox_sidekick | 1 | 12777414 | import csv
from django.core.management.base import BaseCommand
from django.utils.text import slugify
from dcim.models import Site
from tenancy.models import Tenant
from sidekick.utils import MEMBER_TYPES
class Command(BaseCommand):
help = "Import existing members"
def add_arguments(self, parser):
... | 2.140625 | 2 |
parsers/app/base.py | vintage/moba_quiz | 5 | 12777415 | import json
import os
import shutil
import functools
import re
import requests
from unidecode import unidecode as udecode
from PIL import Image
from slugify import slugify
class ImageNotFound(Exception):
pass
def parse_string(string):
if string is None:
return None
return string.strip()
clas... | 2.625 | 3 |
getTopics.py | mitliagkas/pyliakmon | 3 | 12777416 | import numpy as np
import json
with open('db/cpt.json', 'rb') as outfile:
procHier = json.load(outfile)
outfile.close()
with open('db/icd.json', 'rb') as outfile:
icdHier = json.load(outfile)
outfile.close()
icdMap=dict([(icdHier[x]['level2'],{'desc':icdHier[x]['desc'],'code':x}) for x in icdHier.ke... | 2.59375 | 3 |
generator_lesson/map_lesson.py | farooq-teqniqly/pakt-complete-python-course | 0 | 12777417 | <filename>generator_lesson/map_lesson.py
class Vehicle:
def __init__(self, make: str, model: str):
self.make = make
self.model = model
def __repr__(self):
return f"{self.make}, {self.model}"
@classmethod
def create(cls, **properties):
return cls(**properties)
if __nam... | 4.0625 | 4 |
compiler/custom/write_driver.py | lekez2005/OpenRAM | 0 | 12777418 | <reponame>lekez2005/OpenRAM
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import ... | 2.5625 | 3 |
create_db.py | ayushsingh-07/mailer | 0 | 12777419 | <filename>create_db.py
# -*- encoding: utf-8 -*-
"""Create all Data-Base"""
import os
# setting the environment
from dotenv import load_dotenv # Python 3.6+
from app.main import (
db, # SQLAlchemy Connector dB Object
create_app
)
from app.main.models import * # noqa: F401, F403
load_dotenv(ver... | 2.3125 | 2 |
deprecated_examples/affect/humor_late_fusion.py | TianhaoFu/MultiBench | 0 | 12777420 | <filename>deprecated_examples/affect/humor_late_fusion.py
import sys
import os
sys.path.append(os.getcwd())
import torch
from training_structures.Supervised_Learning import train, test
from fusions.common_fusions import Concat
from datasets.affect.get_data import get_dataloader
from unimodals.common_models import GRU... | 1.914063 | 2 |
Climate_Shocks/__init__.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 0 | 12777421 | """
Author: <NAME>
Created: 14/10/2020 10:47 AM
""" | 0.632813 | 1 |
demo/users/urls.py | physili/django_test | 1 | 12777422 | <reponame>physili/django_test<gh_stars>1-10
from django.conf.urls import re_path
from . import views
app_name = 'user'
urlpatterns = [
re_path(r'^index/$', views.index, name='index'),
re_path(r'^haha/$', views.haha, name='haha'),
re_path(r'^jump/$', views.jump, name='jump'),
]
| 1.59375 | 2 |
plate_yolov4.py | conspicio-ai/alpr | 1 | 12777423 | import sys, os
sys.path.append('yolov3_detector')
from yolov3_custom_helper import yolo_detector
from darknet import Darknet
sys.path.append('pytorch-YOLOv4')
from tool.darknet2pytorch import Darknet as DarknetYolov4
import argparse
import cv2,time
import numpy as np
from tool.plateprocessing import find_coordinates, p... | 2.21875 | 2 |
src/enginemonitor.py | BennyCarbajal/enginemonitor | 0 | 12777424 | #! /usr/bin/env python
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, ningh"
__credits__ = [ "<NAME>" ]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = [ "<NAME>" ]
__email__ = [ "<EMAIL>" ]
__status__ = "Beta"
import subprocess, json, socket, psutil, os, wmi
from pymongo import MongoCl... | 2.296875 | 2 |
algo/mappo2/elements/agent.py | xlnwel/g2rl | 1 | 12777425 | from core.elements.agent import create_agent
| 1.070313 | 1 |
dag_executor/Extensions/AWS/__init__.py | GennadiiTurutin/dag_executor | 0 | 12777426 | from .SNS import SNS
from .SQS import SQS
from .S3 import S3 | 1.085938 | 1 |
nii/mapcore_api.py | tsukaeru/RDM-osf.io | 11 | 12777427 | # -*- coding: utf-8 -*-
#
# MAPCore class: mAP Core API handling
#
# @COPYRIGHT@
#
import sys
import time
import json
import logging
import hashlib
import requests
from urllib.parse import urlencode
from django.utils import timezone
from django.db import transaction
from osf.models.user import OSFUser
from website.s... | 2.015625 | 2 |
fileReader.py | EthanCota/ScholarshipRipper | 1 | 12777428 | #Used to initialize the list of scholarship codes from a text file.
f = open('TheUltimateScholarshipBook2019.txt','r')
g = open('ScholarshipCodes.txt','w')
while True:
x = f.readline()
if not x: break
if x.startswith("Exclusive:"):
print >> g, x
print("Printed" + x)
| 3.75 | 4 |
tests/template_backends/test_django.py | spapas/django | 0 | 12777429 | <gh_stars>0
from django.template.backends.django import DjangoTemplates
from django.test import RequestFactory
from template_tests.test_response import test_processor_name
from .test_dummy import TemplateStringsTests
class DjangoTemplatesTests(TemplateStringsTests):
engine_class = DjangoTemplates
backend_n... | 2.09375 | 2 |
octant/common/base.py | Orange-OpenSource/octant | 4 | 12777430 | # Copyright 2018 Orange
#
# 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 t... | 2.171875 | 2 |
plugins/dokuwiki.py | antoniotrento/wig | 3 | 12777431 | <filename>plugins/dokuwiki.py<gh_stars>1-10
from classes.specializedRequesters import CMSReqMD5, CMSReqString, CMSReqRegex
class DokuWikiMD5(CMSReqMD5):
def __init__(self, host, cache, results):
super().__init__(host, cache, results)
self.name = "DokuWiki"
self.prefix = ["/dokuwiki", ""]
self.data_file = "dat... | 2.390625 | 2 |
arekit/contrib/experiment_rusentrel/labels/formatters/rusentiframes.py | nicolay-r/AREk | 18 | 12777432 | from arekit.contrib.experiment_rusentrel.labels.types import ExperimentPositiveLabel, ExperimentNegativeLabel
from arekit.contrib.source.rusentiframes.labels_fmt import \
RuSentiFramesEffectLabelsFormatter, \
RuSentiFramesLabelsFormatter
class ExperimentRuSentiFramesLabelsFormatter(RuSentiFramesLabelsFormatte... | 1.8125 | 2 |
demo/graph_tutorial/tutorial/views.py | dschien/msgraph-django-app | 0 | 12777433 | import openpyxl
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from datetime import datetime, timedelta
from dateutil import tz, parser
from tutorial.auth_helper import get_sign_in_flow, get_token_from_code, store_user, remove_user_and_toke... | 2.25 | 2 |
Beans 1.0/clear.py | Washiii/beans | 1 | 12777434 | <filename>Beans 1.0/clear.py
import platform
import os
sistem = platform.system()
def clear():
if sistem == "Linux" or "Darwin" and sistem != "Windows":
os.system('clear')
elif sistem == "Windows" and sistem != "Linux" or "Darwin":
os.system('cls')
else:
print('The OS detection has... | 3 | 3 |
libs/plugin_loader.py | gradiuscypher/newsbot-py | 0 | 12777435 | import os
import json
import logging
import traceback
from importlib import import_module
class PluginLoader:
def __init__(self):
self.logger = logging.getLogger('newsbot.py')
self.actions = []
self.parsers = []
self.action_dir = 'actions'
self.parser_dir = 'parsers'
... | 2.5 | 2 |
app/tests/v2/test_admin.py | salma-nyagaka/FastFoodFastApi | 0 | 12777436 | '''tests for admins endpoints'''
import json
from unittest import TestCase
from manage import Connection
from app import create_app
class TestOrders(TestCase):
'''loads up all confiugration settings'''
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
... | 3.03125 | 3 |
tests/testOrtho.py | Rombur/ParrLO | 3 | 12777437 | <filename>tests/testOrtho.py<gh_stars>1-10
#!/usr/bin/env python
import sys
import os
import subprocess
import string
print("Test Ortho...")
nargs=len(sys.argv)
mpicmd = sys.argv[1]+" "+sys.argv[2]+" "+sys.argv[3]
for i in range(4,nargs-2):
mpicmd = mpicmd + " "+sys.argv[i]
print("MPI run command: {}".format(mpicm... | 2.734375 | 3 |
puller/__init__.py | adesso-mobile/puller | 0 | 12777438 | import hmac
from typing import Optional
from fastapi import FastAPI, Request
from .config import get_config
import logging
import os
import subprocess
import uvicorn
from shellescape import quote
app = FastAPI()
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def run_hooks(repo_config, ... | 2.3125 | 2 |
ahvl/generate/password.py | gardar/ahvl | 4 | 12777439 | #
# import modules
#
from ahvl.options.generate.password import OptionsGeneratePassword
from ahvl.helper import AhvlMsg, AhvlHelper
from passlib import pwd
#
# helper/message
#
msg = AhvlMsg()
hlp = AhvlHelper()
#
# GeneratePassword
#
class GeneratePassword:
def __init__(self, lookup_plugin):
# set look... | 2.546875 | 3 |
setka/pipes/SaveResult.py | SlinkoIgor/setka | 0 | 12777440 | <reponame>SlinkoIgor/setka
from .Pipe import Pipe
import os
import torch
class SaveResult(Pipe):
'''
pipe for saving predictions of the model. The results are
stored in a directory ```predictions``` and in directory specified in
```trainer._predictions_dir```. Batches are processed with the
specif... | 2.515625 | 3 |
MLP_InSample_UTD.py | IdeasLabUT/EDA-Artifact-Detection | 10 | 12777441 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 23 12:03:59 2017
@author: Kevin
"""
import numpy as np
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import LeaveOneGroupOut,GridSearchCV
dataPath = 'UTDallas/'
dataName = 'UTD'
nJobs = 12 # Numb... | 2.4375 | 2 |
settings/development.py | GhalebKhaled/fb-bot-test | 0 | 12777442 | <gh_stars>0
from __future__ import unicode_literals
from .base import *
WSGI_APPLICATION = 'wsgi.heroku.application'
WSGI_APPLICATION = 'wsgi.heroku.application'
ADMIN_MEDIA_PREFIX = ''.join([STATIC_URL, 'admin/'])
import dj_database_url
DATABASE_URL = os.environ['DATABASE_URL']
DATABASES = {
'default': dj_d... | 1.796875 | 2 |
renderer/render_utils.py | archonic/frankmocap | 1,612 | 12777443 | # Copyright (c) Facebook, Inc. and its affiliates.
import numpy as np
# vertices: frames x meshVerNum x 3
# trifaces: facePolygonNum x 3 = 22800 x 3
def ComputeNormal(vertices, trifaces):
if vertices.shape[0] > 5000:
print('ComputeNormal: Warning: too big to compute {0}'.format(vertices.shape) )
... | 2.234375 | 2 |
utils/remove_pixel_values.py | kkahatapitiya/occlusion_removal | 2 | 12777444 | import os
import numpy as np
import cv2
import sys
#sys.path.insert(0, '/home/kumarak/Desktop/campus_temp/pred2/')
#import get_dataset_colormap
read="./all_at_100_nocol/"
gtread=open("./thinglabels.txt").readlines()
gt={}
#print(gtread)
for i in gtread:
gt[int(i.split(':')[0])]=i.split(':')[1][1:-1]
#print(gt)
#map=... | 2.59375 | 3 |
backend/data/__init__.py | TiFu/runepicker-helper | 0 | 12777445 | <reponame>TiFu/runepicker-helper
from .champion import championById
from .wiki import wikiById
| 0.921875 | 1 |
python-codes/tests/testcircle.py | WillianEsp/RM_with_CV | 1 | 12777446 | import cv2
import numpy as np
img = cv2.imread('imagem.jpg')
##img = cv2.imread('imagem3.jpg',0)
cv2.imshow('imagem',img)
img = cv2.GaussianBlur(img, (7, 5), 0)
cv2.imshow('imagemblur',img)
gray_img = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
circles = cv2.HoughCircles(gray_img,cv2.HOUGH_GRADIENT,1,30,
... | 3.28125 | 3 |
repeat.py | arunkumarang/python | 0 | 12777447 | <gh_stars>0
#!/usr/bin/env python
import sys
def repeat(s, exclaim):
"""
Return the string 's' repeated 3 times.
If exclaim is true, add exclamation mark.
"""
result = s + s + s
if exclaim:
result = result + '!!!'
return result
def main():
print repeat('Yay', False)
... | 3.671875 | 4 |
bazel/spec-bundling/index.bzl | aspect-build/dev-infra | 33 | 12777448 | load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//bazel/esbuild:index.bzl", "esbuild", "esbuild_amd", "esbuild_config")
load("//bazel/spec-bundling:spec-entrypoint.bzl", "spec_entrypoint")
load("//bazel/spec-bundling:bundle-config.bzl", "spec_bundle_config_file")
"""
Starlark file exposing a macro ... | 1.5 | 2 |
sdk/test/test_file.py | DarrahK/yapily-sdk-python | 0 | 12777449 | <filename>sdk/test/test_file.py<gh_stars>0
# coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.157.0
Generated by: https://opena... | 2.1875 | 2 |
hw_2/hw2_1_b.py | ssupasanya/Coursework | 0 | 12777450 |
# File: hw2_1_b.py
expenses = [
'''Amount:Category:Date:Description''',
'''5.25:supply:20170222:box of staples''',
'''79.81:meal:20170222:lunch with ABC Corp. clients Al, Bob, and Cy''',
'''43.00:travel:20170222:cab back to office''',
'''383.75:travel:20170223:flight to Boston, to visit ABC C... | 1.773438 | 2 |