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 |
|---|---|---|---|---|---|---|
oops_fhir/r4/code_system/v3_hl7_context_conduction_style.py | Mikuana/oops_fhir | 0 | 47200 | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3HL7ContextConductionStyle"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3HL7ContextConductionStyle:
"""
v3 Code System HL7ContextConducti... | 2.015625 | 2 |
Project-:-Loan-Approval-Analysis/code.py | RiyaVachhani/ga-learner-dst-repo | 1 | 47201 | <reponame>RiyaVachhani/ga-learner-dst-repo<filename>Project-:-Loan-Approval-Analysis/code.py<gh_stars>1-10
# --------------
# Importing header files
import numpy as np
import pandas as pd
from scipy.stats import mode
import warnings
warnings.filterwarnings('ignore')
#Reading file
bank = pd.read_csv(path)... | 2.90625 | 3 |
data/waymo_split/setup_split.py | JuliaChae/M3D-RPN-Waymo | 3 | 47202 | <filename>data/waymo_split/setup_split.py
from importlib import import_module
from getopt import getopt
import scipy.io as sio
import matplotlib.pyplot as plt
from matplotlib.path import Path
import numpy as np
import pprint
import sys
import os
import cv2
import math
import shutil
import re
# stop python from writing... | 2.34375 | 2 |
virtual_finance_api/endpoints/yahoo/util.py | hootnot/virtual-yahoofinance-REST-API | 1 | 47203 | <filename>virtual_finance_api/endpoints/yahoo/util.py
# -*- coding: utf-8 -*-
import time
from datetime import datetime
import re
from typing import Union
from .types import AdjustType, Period, Interval
try:
import rapidjson as json
except ImportError as err:
import json
def get_store(response: str, store... | 2.40625 | 2 |
matplotlib_widget.py | kkgg0521/-Oscilloscope-host-computer | 0 | 47204 | <filename>matplotlib_widget.py
# -*- coding: utf-8 -*-
"""
@Time : 2022/1/11 14:30
@Auth : 吕伟康
@File :matplotlib_widget.py
"""
# -*- coding: utf-8 -*-
"""
@Time : 2021/12/15 10:52
@Auth : 吕伟康
@File :matplotlib_widget.py
"""
import numpy as np
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QWi... | 2.46875 | 2 |
tests/django_app/settings.py | Menda/factory-boy-loader | 0 | 47205 | <filename>tests/django_app/settings.py
"""
Settings for tests.
"""
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'example.sqlite',
},
}
INSTALLED_APPS = [
'tests.django_app'
]
MIDDLEWARE_CLASSES = ()
SECRET_KEY = 'testing.'
| 1.4375 | 1 |
util/util.py | SWARTHYPEARL/pytorch-CycleGAN-and-pix2pix | 0 | 47206 | <reponame>SWARTHYPEARL/pytorch-CycleGAN-and-pix2pix
"""This module contains simple helper functions """
from __future__ import print_function
import torch
import numpy as np
from PIL import Image
import os
import pydicom
from typing import Tuple
from torchvision.transforms import functional as F
def tensor2im(input_... | 2.859375 | 3 |
snakeplane/version.py | cpitts1/snakeplane | 0 | 47207 | <gh_stars>0
__version__ = "1.0.0-alpha20"
| 1.070313 | 1 |
docker_gpu/utils.py | osirrc2019/nvsm-docker | 1 | 47208 | """
Authors: <<NAME>, <NAME>>
Copyright: (C) 2019-2020 <http://www.dei.unipd.it/
Department of Information Engineering> (DEI), <http://www.unipd.it/ University of Padua>, Italy
License: <http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0>
"""
import os
import math
import s... | 2.515625 | 3 |
migemo/__init__.py | oguna/pymigemo | 0 | 47209 | <filename>migemo/__init__.py<gh_stars>0
from .migemo import Migemo
| 1.203125 | 1 |
junior_class/chapter-6-sentiment_classification/code/model/sentiment_classifier.py | wwhio/awesome-DeepLearning | 1,150 | 47210 | # 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 required by applica... | 2.1875 | 2 |
tests/test_openapi_scheme.py | montaro/fastapi-azure-auth | 137 | 47211 | import pytest
from demo_project.main import app
from fastapi.testclient import TestClient
openapi_schema = {
'openapi': '3.0.2',
'info': {
'title': 'My Project',
'description': '## Welcome to my API! \n This is my description, written in `markdown`',
'version': '1.0.0',
},
'path... | 2.09375 | 2 |
md_cms/forms.py | tinpan-io/django-md-cms | 12 | 47212 | <reponame>tinpan-io/django-md-cms
from django import forms
from pagedown.widgets import PagedownWidget
class MdCMSForm(forms.Form):
md_cms_textarea = forms.CharField(
widget=PagedownWidget(),
)
| 1.679688 | 2 |
firmware/test_display.py | mastensg/windportal | 1 | 47213 |
import display
import pytest
import msgflo
import gevent
import os.path
BROKER = os.environ.get('MSGFLO_BROKER', 'mqtt://localhost')
# Helper for running one iteration of next_state()
def run_next(state, inputs):
current = display.State(**state)
inputs = display.Inputs(**inputs)
next = display.next_sta... | 2.140625 | 2 |
gfxlcd/demos/ssd.py | bkosciow/gfxlcd | 12 | 47214 | import random
import sys
sys.path.append("../../")
from gfxlcd.driver.ssd1306.spi import SPI
from gfxlcd.driver.ssd1306.ssd1306 import SSD1306
def hole(x, y):
o.draw_pixel(x+1, y)
o.draw_pixel(x+2, y)
o.draw_pixel(x+3, y)
o.draw_pixel(x+1, y + 4)
o.draw_pixel(x+2, y + 4)
o.draw_pixel(x+3, y + ... | 2.5625 | 3 |
CRF.py | JackieChenssh/TC_VFDT_CRF | 0 | 47215 | def corpus_file_transform(src_file,dst_file):
import os
assert os.path.isfile(src_file),'Src File Not Exists.'
with open(src_file,'r',encoding = 'utf-8') as text_corpus_src:
with open(dst_file,'w',encoding = 'utf-8') as text_corpus_dst:
from tqdm.notebook import tqdm
text_co... | 2.625 | 3 |
cds_ils/circulation/serializers/__init__.py | zzacharo/cds-ils | 1 | 47216 | <reponame>zzacharo/cds-ils<filename>cds_ils/circulation/serializers/__init__.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Loan serializers."""
from invenio_app_i... | 1.53125 | 2 |
bgg4py/valueobject/hot_item.py | hiroaqii/bgg4py | 1 | 47217 | <gh_stars>1-10
from collections import OrderedDict
from typing import List, Optional, Union
from .bgg import Bgg
class Item(Bgg):
id: int
rank: int
name: str
yearpublished: Optional[int]
thumbnail: str
@classmethod
def create(cls, item: OrderedDict):
_item = Item(
id=B... | 2.6875 | 3 |
tests/test_load_docker_api.py | ReconPangolin/tern | 361 | 47218 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
import unittest
from tern.load import docker_api
from tern.utils import rootfs
from test_fixtures import create_working_dir
from test_fixtures import remove_working_dir
class TestLoadDockerAPI(un... | 2.046875 | 2 |
tests/update_golds.py | leonardt/magma | 167 | 47219 | """
Expected to be run from repo root
"""
import shutil
import os
def copy_golds(dir_path):
for f in os.listdir(os.path.join(dir_path, "gold")):
try:
shutil.copy(
os.path.join(dir_path, "build", f),
os.path.join(dir_path, "gold", f)
)
except ... | 2.8125 | 3 |
terracommon/project/settings/dev.py | Terralego/terra-back | 4 | 47220 | # -*- coding: utf-8 -*-
import logging
import os
from django.utils import six
from .base import * # noqa
SECRET_KEY = 'dev-<KEY>'
ALLOWED_HOSTS = []
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INTERNAL_IPS = ('127.0.0.1',) # Used by app debug_toolbar
# Add the Python core Null... | 1.695313 | 2 |
sendcloud/management/commands/sc_members.py | edison7500/django-sendcloud | 2 | 47221 | import click
import logging
from django.core.management.base import BaseCommand
from sendcloud.core.members import MemberAPI
logger = logging.getLogger('sendcloud')
class Command(BaseCommand):
help = __doc__
table_width = 120
def add_arguments(self, parser):
parser.add_argument(
'-... | 2.140625 | 2 |
models/selfatt/selfattn.py | jesa7955/r2c | 0 | 47222 | """
Attention is all you need!
"""
from typing import Dict, List, Any
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
from allennlp.data.vocabulary import Vocabulary
from allennlp.models.model import Model
from allennlp.modules import TextFieldEmbedder, Seq2SeqEncoder, Feed... | 2.65625 | 3 |
sample-viewer-api/src/static/data/compile_cvisb_data/helpers/observations.py | cvisb/cvisb_data | 2 | 47223 | import numpy as np
from .citations import cvisb, kgh
def binarize(val):
if((val == val) & (val is not None)):
if(val == 0):
return(False)
elif(val == 1):
return(True)
elif(val.lower() == "yes"):
return(True)
elif(val.lower() == "no"):
... | 2.90625 | 3 |
test_machine.py | technosvitman/statemachine | 0 | 47224 |
import sys
import io
import time
import argparse
import re
from pyctest import *
def getState(test):
return test.c_test_machine.current_state
'''
@see PycTestCase
'''
class TestStartAndTransition(PycTestCase):
def __init__(self):
super(PycTestCase, self).__init__()
def runTest(se... | 2.484375 | 2 |
python_modules/libraries/dagster-gcp/dagster_gcp_tests/bigquery_tests/test_solids.py | bambielli-flex/dagster | 0 | 47225 | import sys
import datetime
import pytest
import pandas as pd
try:
import unittest.mock as mock
except ImportError:
import mock
from dagster_pandas import DataFrame
from dagster import (
DependencyDefinition,
InputDefinition,
List,
ModeDefinition,
Nothing,
OutputDefinition,
Path,
... | 2.34375 | 2 |
src/multiclass/LSTMMultiClass.py | ocatak/malware_api_class | 172 | 47226 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 1 14:52:43 2018
@author: user
"""
import pandas as pd
from keras import preprocessing
import os
import datetime
from multiclass.AnalizeRunner import AnalizeRunner
##################################################
prefix = "dataset"
data_path = "C:\\... | 2.453125 | 2 |
ankiconnect.py | ofek-b/vomBuch-insAnki | 0 | 47227 | import json
import urllib.request
import subprocess
from time import sleep
from constants import ANKI_USER, DECK_NAME
NOTE_TYPE = 'vomBuch-insAnki Note'
ANKI_APP = None
def request(action, **params): # from AnkiConnect's page
return {'action': action, 'params': params, 'version': 6}
def invoke(action, **para... | 2.34375 | 2 |
cishouseholds/pipeline/generate_outputs.py | ONS-SST/cis_households | 0 | 47228 | import subprocess
from datetime import datetime
from pathlib import Path
from typing import Any
from typing import List
from typing import Optional
from typing import Union
from pyspark.sql import DataFrame
from pyspark.sql import functions as F
from cishouseholds.edit import assign_from_map
from cishouseholds.edit i... | 2.6875 | 3 |
app.py | arthuralvim/deploy-aws-image | 0 | 47229 | import os
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class EnvironmentVariablesEndpoint(Resource):
def get(self):
return [(key, os.environ[key]) for key in os.environ.keys()]
api.add_resource(EnvironmentVariablesEndpoint, '/')
if __name__ == '... | 2.671875 | 3 |
tests/example.py | orsinium-labs/benchmark-imports | 0 | 47230 | <reponame>orsinium-labs/benchmark-imports<gh_stars>0
import math
print(math.sin(1))
| 1.0625 | 1 |
piicatcher/detectors.py | argos-education/piicatcher | 4 | 47231 | <reponame>argos-education/piicatcher
import inspect
from abc import ABC, abstractmethod
from typing import Optional, Type
import catalogue
from dbcat.catalog.models import CatColumn
from dbcat.catalog.pii_types import PiiType
class Detector(ABC):
"""Scanner abstract class that defines required methods"""
na... | 3.3125 | 3 |
indexpy/cli.py | abersheeran/index.py | 242 | 47232 | from __future__ import annotations
import os
import signal
import subprocess
import sys
import time
from multiprocessing import cpu_count
from typing import List, Union
import click
from .__version__ import __version__
from .routing.commands import display_urls
from .utils import F, import_from_string, import_module... | 2.234375 | 2 |
pypowerlawnoise/pypowerlawnoise/args.py | sternarubra/powerlawnoise | 0 | 47233 | <reponame>sternarubra/powerlawnoise
# Copyright (C) 2020 by Landmark Acoustics LLC
r'''Command-line arguments for when the module is run as a program.'''
import argparse
class Args:
r'''Assemble the argument parser for the command-line version.'''
def __init__(self):
parser = argparse.ArgumentParser(... | 3.3125 | 3 |
middleware.py | Ali-TM-original/pakpi | 0 | 47234 | from fastapi import Request
from fastapi.responses import JSONResponse
from db import AuthDb
async def auth_check(request: Request, call_next):
if (request.url.path == "/") or (request.url.path == "/docs"):
response = await call_next(request)
return response
else:
try:
""... | 2.828125 | 3 |
tests/test_optimization.py | nleroy917/optipyzer | 3 | 47235 | import sys, os
from tests.data import DNA_QUERY, PEPTIDE_QUERY
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
REQUIRED_RESPONSE_DATA = [
'query',
'weights',
'seq_t... | 2.671875 | 3 |
karborclient/v1/services.py | thuylt2/karborclient | 0 | 47236 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 2.03125 | 2 |
main/file_persistence.py | moesoha/coolq-telegram-bot | 0 | 47237 | import sqlite3
import datetime
import time
import logging
import os
from bot_constant import CQ_ROOT
CQ_IMAGE_ROOT = os.path.join(CQ_ROOT, r'data/image')
logger = logging.getLogger("CTB." + __name__)
class FileDB:
def __init__(self, db_name: str):
self.conn = sqlite3.connect(db_name, check_same_thread=F... | 2.34375 | 2 |
factory/manageFactoryDowntimes.py | bbockelm/glideinWMS | 0 | 47238 | <filename>factory/manageFactoryDowntimes.py
#!/usr/bin/env python
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This program allows to add announced downtimes
# as well as handle unexpected downtimes
#
import os.path
import os
import time,string
import sys
import re
STARTUP_DIR=sys.path[0]
sys.... | 2.578125 | 3 |
ee_extra/ImageCollection/core.py | andrea29-star/ee_extra | 0 | 47239 | <filename>ee_extra/ImageCollection/core.py
import json
import os
import re
import warnings
from typing import Optional, Union
import ee
import pkg_resources
from ee_extra.STAC.utils import _get_platform_STAC
def closest(
x: ee.ImageCollection,
date: Union[ee.Date, str],
tolerance: Union[float, int] = 1,... | 2.84375 | 3 |
game/__init__.py | Schwarzbaer/wecs_null_project | 0 | 47240 | <reponame>Schwarzbaer/wecs_null_project
import argparse
from panda3d.core import WindowProperties
from panda3d_logos.splashes import Colors
from panda3d_logos.splashes import Pattern
from stageflow import Flow
from stageflow import Stage
from stageflow.prefab import Quit
from stageflow.panda3d import Panda3DSplash
... | 2.0625 | 2 |
utils.py | ejmejm/GoHeuristics | 1 | 47241 | import board3d as go_board
import numpy as np
import global_vars_go as gvg
def games_to_states(game_data):
train_boards = []
train_next_moves = []
for game_index in range(len(game_data)):
board = go_board.setup_board(game_data[game_index])
for node in game_data[game_index].get_main... | 2.671875 | 3 |
file_opr.py | Ashkan-Agc/Moris-mano-cpu-assembler | 2 | 47242 | import os
import struct
def readFile(path):
if not os.path.isfile(path):
raise FileNotFoundError
else:
with open(path, 'r') as file:
source = file.read()
return source
def cleaner(source):
lines = source.split('\n')
for i in range(len(lines)... | 3.0625 | 3 |
band/config/reader.py | rockstat/rockband | 14 | 47243 | from jinja2 import Environment, FileSystemLoader, Template, TemplateNotFound
import collections
import os
import yaml
from os.path import dirname, basename
from .env import environ
from ..log import logger
def reader(fn):
logger.debug('loading', f=fn)
try:
tmplenv = Environment(loader=FileSystemLoader(... | 2.421875 | 2 |
pastebin/migrations/0006_auto_20170129_1502.py | johannessarpola/django-pastebin | 0 | 47244 | <reponame>johannessarpola/django-pastebin<filename>pastebin/migrations/0006_auto_20170129_1502.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11a1 on 2017-01-29 15:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependenci... | 1.5625 | 2 |
apero/tools/recipes/bin/apero_reset.py | njcuk9999/apero-drs | 1 | 47245 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-07-26 at 09:39
@author: cook
"""
from apero import core
from apero import lang
from apero.core import constants
from apero.tools.module.setup import drs_reset
# ================================... | 1.84375 | 2 |
StormRequest/Exceptions.py | notariuss/StormRequest | 1 | 47246 | class UnsupportedMethod(Exception):
def __init__(self, message, errors):
super().__init__(message)
class NoPayload(Exception):
def __init__(self):
super().__init__() | 2.375 | 2 |
vb2py/vbfunctions.py | mvz/vb2py | 2 | 47247 | """
Functions to mimic VB intrinsic functions or things
"""
from __future__ import generators
from vb2py.vbclasses import *
from vb2py.vbconstants import *
from vb2py import utils
from vb2py import config
import math
import sys
import fnmatch # For Like
import glob # For Dir
import os
import shutil # For FileCopy... | 2.6875 | 3 |
src/add_noise.py | Patrick22414/cw-computer-vision | 0 | 47248 | import numpy as np
def white_noise(im, scale):
im = im + np.random.normal(0.0, scale, im.shape)
im = np.maximum(im, 0.0)
im = np.minimum(im, 1.0)
return im
def salt_and_pepper(im, prob):
if prob > 1 or prob < 0:
raise ValueError("Prob must be within 0 to 1")
if im.ndim == 2:
... | 2.65625 | 3 |
core/apps/accounts/urls.py | dansackett/django-project-template | 4 | 47249 | from django.conf.urls import url
from accounts import views as account_views
urlpatterns = [
url(r'users/$', account_views.users_list, name='users-list'),
url(r'users/new/$', account_views.user_create, name='user-create'),
url(r'user/(?P<pk>\d+)/$', account_views.user_single, name='user-single'),
url(... | 1.75 | 2 |
TNT/generate_clusters.py | yoyomimi/TNT_pytorch | 20 | 47250 | <reponame>yoyomimi/TNT_pytorch<gh_stars>10-100
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Created by <NAME> (<EMAIL>)
# Created On: 2020-2-27
# ------------------------------------------------------------------------------
import argparse
import numpy as n... | 1.453125 | 1 |
qrogue/management/save_data.py | 7Magic7Mike7/Qrogue | 4 | 47251 |
from qrogue.game.logic.actors import Player, Robot
from qrogue.game.logic.actors.controllables import TestBot, LukeBot
from qrogue.game.world.map import CallbackPack
from qrogue.util import Logger, PathConfig, AchievementManager, RandomManager, CommonPopups, CheatConfig
from qrogue.util.achievements import Achievement... | 2.578125 | 3 |
mes_examples/example_curvature.py | Anthys/slam | 0 | 47252 | <reponame>Anthys/slam<gh_stars>0
"""
.. _example_curvature:
===================================
example of curvature estimation in slam
===================================
"""
# Authors: <NAME> <<EMAIL>>
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 2
###############################################... | 2.171875 | 2 |
DAD/Jogador/itens_do_heroi.py | Gustavolsl/Falculdade_Impacta_3s | 0 | 47253 | import sqlite3
connection = sqlite3.connect("rpg.db")
create_sql = """
CREATE TABLE IF NOT EXISTS Heroi(
id INTEGER PRIMARY KEY,
nome TEXT NOT NULL,
fisico INTEGER NOT NULL,
magia INTEGER NOT NULL,
agilidade INTEGER NOT NULL
)
"""
cursor = connection.cursor()
#2o passo: pegar o cursor
cursor.ex... | 3.578125 | 4 |
netbox/dcim/migrations/0002_auto_20190830_1742.py | rinsekloek/netbox | 1 | 47254 | <filename>netbox/dcim/migrations/0002_auto_20190830_1742.py
# Generated by Django 2.2.4 on 2019-08-30 17:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import taggit.managers
class Migration(migrations.Migration):
initial = True
... | 1.484375 | 1 |
sample_architectures/sample_gcn.py | hvarS/PyTorch-Refer | 0 | 47255 | <reponame>hvarS/PyTorch-Refer
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.functional as F
import math
class GCN(nn.Module):
def __init__(self,in_features,out_features,bias=False):
super(GCN,self).__init__()
self.in_features = in_features
self.out_feature... | 2.671875 | 3 |
facts/cms_app.py | evildmp/facts | 1 | 47256 | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class FactsApphook(CMSApp):
name = _("Facts")
urls = ["facts.urls"]
apphook_pool.register(FactsApphook)
| 1.601563 | 2 |
irekua_rest_api/serializers/terms/synonym_suggestions.py | IslasGECI/irekua-rest-api | 0 | 47257 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import serializers
from irekua_database.models import SynonymSuggestion
from irekua_rest_api.serializers.base import IrekuaModelSerializer
from irekua_rest_api.serializers.base import IrekuaHyperlinkedModelSerializer
from... | 1.90625 | 2 |
patterndetector/detector/engulfing_candle_detector.py | WynnD/PatternDetector | 1 | 47258 | from .detector import Detector
from patterndetector.data import Data
class EngulfingCandleDetector(Detector):
def __init__(self, data: Data):
super().__init__(data)
@property
def name(self):
return 'Engulfing Candle'
def isPattern(self, ticker):
openPrice = self.data.getOp... | 2.921875 | 3 |
book-code/Chapter-16/mrvisitcounter.py | holtkampjs/photogallery | 2 | 47259 | '''
MIT License
Copyright (c) 2019 <NAME> and <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, merge, publ... | 2.015625 | 2 |
Conceptos/variables.py | MiGueAJM9724/Python | 0 | 47260 | tutor = "codi"
print(tutor)
| 1.078125 | 1 |
ulutil/blat.py | churchlab/ulutil | 1 | 47261 | <filename>ulutil/blat.py
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 1.976563 | 2 |
source/win.py | TwinIsland/WPN | 0 | 47262 | <reponame>TwinIsland/WPN<gh_stars>0
import requests
import lxml.etree
def getSS(crawler):
api = 'https://www.youneed.win/free-ss'
c = lxml.etree.HTML(requests.get(api,headers=crawler.get_crawel_header(),proxies=crawler.get_an_ip()).content)
r = []
count = 0
while True:
count += 1
... | 2.640625 | 3 |
tracker.py | AImotion-Autonomous-Vehicles/AirSimTracking | 0 | 47263 | from .coordinates import Coordinates
from typing import List
import csv
import pandas as pd
class Tracker:
@staticmethod
def load(csv_path: str):
airsim_results = pd.read_csv(csv_path, encoding='utf-8')
tracker = Tracker()
for index, row in airsim_results.iterrows():
coord... | 2.859375 | 3 |
stepik/programming_on_python/3_2_6_my_solve.py | anklav24/Python-Education | 0 | 47264 | string = input().lower().split()
for word in set(string):
print(word, string.count(word))
| 3.765625 | 4 |
week2/2.03 for/step03 multiplication table.py | project-cemetery/stepik-programming-on-python | 7 | 47265 | def print_multiplication_table(vertical_interval, horizontal_interval):
print('\t', end='')
for i in range(horizontal_interval[0], horizontal_interval[1] + 1):
print(i, end='\t')
print()
for i in range(vertical_interval[0], vertical_interval[1] + 1):
print(i, end='\t')
for j in ... | 3.9375 | 4 |
groups/templatetags/group_tags.py | AgentGeek/MangAdventure | 2 | 47266 | """Template tags of the groups app."""
from __future__ import annotations
from typing import TYPE_CHECKING
from django.template.defaultfilters import register
if TYPE_CHECKING: # pragma: no cover
from groups.models import Group, Member
@register.filter
def group_roles(member: Member, group: Group) -> str:
... | 2.28125 | 2 |
redata/utils/time_utils.py | hishoss/redata | 0 | 47267 | from datetime import timedelta
def transform_by_interval(time_interval, for_time):
parts = time_interval.split(" ")
if parts[-1] == "day":
to_compare = for_time - timedelta(days=int(parts[0]))
if parts[-1] == "hour":
to_compare = for_time - timedelta(hours=int(parts[0]))
return to_comp... | 3.828125 | 4 |
App/Apis/like_blog.py | sajinchang/blog | 0 | 47268 | '''
-*- coding: utf-8 -*-
@Time : 18-12-1 下午4:19
@Author : SamSa
@Site :
@File : like_blog.py
@Software: PyCharm
@Statement: 收藏博客
'''
from flask import session
from flask_restful import Resource, reqparse
from App.models.likeModel import Like
parse = reqparse.RequestParser()
parse.add_argument('blog_id')
cla... | 2.515625 | 3 |
config.py | Agasper/gaben | 0 | 47269 | API_KEY = ""
DONT_PRINT_USAGE_FOR = []
REP_DIRECTORY = "C:\\GabenStorage"
MAX_UPLOAD_SIZE_MB = 300
UNITY = {
"2017.2.0f3": "C:\\Program Files\\Unity\\Editor\\Unity.exe",
"2017.4.3f1": "C:\\Program Files\\Unity2017.4.3\\Editor\\Unity.exe"
}
QUOTES = ["I'm a handsome man with a charming personality.", \
"If Nvid... | 1.757813 | 2 |
unittest/scripts/auto/py_shell/scripts/util_help_norecord.py | mueller/mysql-shell | 119 | 47270 | #@ util help
util.help()
#@ util help, \? [USE:util help]
\? util
#@ util check_for_server_upgrade help
util.help('check_for_server_upgrade')
#@ util check_for_server_upgrade help, \? [USE:util check_for_server_upgrade help]
\? check_for_server_upgrade
# WL13807-TSFR_1_1
#@ util dump_instance help
util.help('dump_i... | 1.53125 | 2 |
Classes/Group.py | amiralirj/DarkHelper | 34 | 47271 | from datetime import datetime
import sys
sys.path.insert(1, r'C:\Users\ASUS\Desktop\sources\Telegram\werewolf\Darkhelper\2\V2\Databases')
from Databases.Groups import GroupsPlayersBase , GroupsBase , GroupsControlBase
from Databases.Groups.Bet import BetBase
from Databases.Users import AdminsBase
from Database... | 1.96875 | 2 |
Powerswitch.py | NikBenson/LINDY-IPower-Stripe-Lite-web-scrapping | 1 | 47272 | <filename>Powerswitch.py<gh_stars>1-10
import requests
from bs4 import BeautifulSoup
import sys
import re
args = sys.argv
page = None
soup = None
def main():
global page, soup
if(not(len(args) in {2, 4, 7})):
#exit with error, if invalid arg length
error(1)
return
ip = args[... | 2.90625 | 3 |
mocking/test_mock_2_sql.py | vishwanatham/Python-Testing | 0 | 47273 | from unittest import mock
from . import mock_2_sql
# odbc.connect
# connection.cursor()
# cursor.execute()
# results.description
# results.fetchall
@mock.patch('mocking.mock_2_sql.odbc')
def test_get_emp_name_wih_max_sal(odbc):
result = mock.Mock()
result.description = [["name"], ["salary"]]
result.fetch... | 2.9375 | 3 |
pretix_hide_sold_out/management/commands/hide_sold_out.py | pretix-unofficial/pretix-hide-sold-out | 0 | 47274 | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils.timezone import now
from django_scopes import scopes_disabled
from pretix.base.models import Event, Quota
from pretix.base.services.quotas import QuotaAvailability
class Command(BaseComm... | 1.875 | 2 |
globus/afisha/admin.py | Ecmek/kino-globus | 3 | 47275 | from django.contrib import admin
from .models import Cinema, ShowTime
class CinemaAdmin(admin.ModelAdmin):
list_display = ('title', 'genre', 'trailer', 'description', 'mpaa',)
search_fields = ('title',)
empty_value_display = '-пусто-'
class ShowTimeAdmin(admin.ModelAdmin):
list_display = ('cinema',... | 1.710938 | 2 |
printer/colors.py | lsmucassi/pretty_printer | 0 | 47276 | class Colors:
def __init__(self):
self.color_dict = {
"ERROR": ';'.join([str(7), str(31), str(47)]),
"WARN": ';'.join([str(7), str(33), str(40)]),
"INFO": ';'.join([str(7), str(32), str(40)]),
"GENERAL": ';'.join([str(7), str(34), str(47)])
}
... | 2.875 | 3 |
day05/main.py | Jachoooo/AdventOfCode2021 | 0 | 47277 | <gh_stars>0
import time
import numpy as np
from PIL import Image
FILENAME="input.txt"
if FILENAME=="test.txt":
D=True
SIZE=10
else:
D=False
SIZE=1000
starttime=time.time()
print("\u001b[2J\u001b[0;0H")
inputFile=open(FILENAME,'r')
Coords=[]
for line in inputFile:
Coords.append([int(y) for x in ... | 2.625 | 3 |
techradarscraper/spiders/techradar.py | jcdenton/techradar-scraper | 0 | 47278 | import scrapy
import scrapy.spiders
from techradarscraper.items import TechLoader
class TechRadarSpider(scrapy.spiders.Spider):
name = 'techradar'
start_urls = ['https://www.thoughtworks.com/radar/a-z']
def parse(self, response):
links = response.css('.a-z-links > ul > li.blip.hit > a')
... | 2.625 | 3 |
doozerlib/constants.py | tnozicka/doozer | 0 | 47279 | <filename>doozerlib/constants.py<gh_stars>0
from __future__ import absolute_import, print_function, unicode_literals
# Environment variables to disable Git stdin prompts for username, password, etc
GIT_NO_PROMPTS = {
"GIT_SSH_COMMAND": "ssh -oBatchMode=yes",
"GIT_TERMINAL_PROMPT": "0",
}
| 1.5 | 2 |
bitsoapi/models/public/Trade.py | oxsoftdev/bitsoapi | 0 | 47280 | from decimal import Decimal
from .._BaseModel import BaseModel
class Trade(BaseModel):
def __init__(self, **kwargs):
for (param, value) in kwargs.items():
if param == 'book':
setattr(self, 'book', value)
elif param == 'created_at':
setattr(self, 'c... | 3.03125 | 3 |
day-16/part-1/badouralix.py | evqna/adventofcode-2020 | 12 | 47281 | <reponame>evqna/adventofcode-2020<gh_stars>10-100
from tool.runners.python import SubmissionPy
class BadouralixSubmission(SubmissionPy):
def run(self, s):
"""
:param s: input in string format
:return: solution flag
"""
stage = "rules"
rules = set()
result = ... | 2.921875 | 3 |
main_orchestrator.py | deib-polimi/FederatedLearningFramework | 0 | 47282 | import os
import federate_learning as fl
from federate_learning.orchestrator.control_strategy import ControlType
from federate_learning.orchestrator.control_strategy.control_strategy import Target
from federate_learning.orchestrator.control_strategy.control_strategy_factory import ControlStrategyFactory
num_rounds = i... | 2.078125 | 2 |
satellite-processing/aggregate_cci_aatsr.py | tommibergman/gmdd-tm5-soa | 0 | 47283 | import glob
import subprocess
from settings import rawoutput
def aggregate_aatsr(exp,var='od550aer'):
input_CCI_SU_location = '/Volumes/Utrecht/CCI/'
output_masked_location = '/Volumes/Utrecht/MODIS_masked/'
output_aggregated_location = '/Volumes/Utrecht/CCI/aggregated_cci/'
#output_aggregated_location = 'CCI/aggre... | 2.234375 | 2 |
xu/src/python/Request/Adapter/ItemAdapter.py | sonnts996/XuCompa-Request | 0 | 47284 | <reponame>sonnts996/XuCompa-Request
import os
from PyQt5.QtWidgets import QListWidget
from xu.compa.Parapluie.src.ActionWidget import PWidget
from xu.compa.Parapluie.src.Adapter import PListAdapter
from xu.compa.xhash import XashList, XashHelp
from xu.src.python.Model import XFile
from xu.src.python.Model.ItemModel i... | 2.09375 | 2 |
tests/utils.py | paul-serafimescu/growth-tracker | 1 | 47285 | <filename>tests/utils.py
from django.test import TestCase, RequestFactory
from django.contrib.auth.models import AbstractBaseUser, AnonymousUser
from django.test.client import CONTENT_TYPE_RE
from django.views import View
from django.urls import resolve
from abc import abstractclassmethod, ABCMeta
from typing import An... | 2.265625 | 2 |
app/views.py | epf23/SegundoParcial | 0 | 47286 | # views.py
#Importar conector MySQL
import mysql.connector
import requests
import json
from flask import render_template, request
from flask_table import Table, Col
from app import app
##Conexión a la BD
inf_Activos_Fijos = mysql.connector.connect(
host="localhost",
user="root",
passwd="<PASSWORD>",
databas... | 2.59375 | 3 |
utils/qemu/main.py | JanDorniak99/memkind | 0 | 47287 | <reponame>JanDorniak99/memkind
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (C) 2020 - 2021 Intel Corporation.
import argparse
import collections
import fabric
import functools
import os
import paramiko
import pathlib
import psutil
import re
import subprocess
import sys
import time
import typing
TCP_PORT = 100... | 2.078125 | 2 |
mentorprise/backend_dev/__init__.py | CS261-Group-17/Mentoring-Site | 0 | 47288 | """Needed for pylint to run correctly - GitHub actions will fail if you delete
this"""
| 0.972656 | 1 |
binarize.py | WinnieHAN/xcfg | 0 | 47289 | <gh_stars>0
import sys, os
import argparse, json
from batchify import (
get_tags_tokens_lowercase, get_nonbinary_spans,
get_nonbinary_spans_label, get_actions
)
parser = argparse.ArgumentParser()
parser.add_argument('--binarize', default=False, type=bool)
parser.add_argument('--ifile', default=No... | 2.65625 | 3 |
manage_room/migrations/0005_auto_20170129_0024.py | gaybro8777/coding-night-live | 73 | 47290 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-28 15:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manage_room', '0004_auto_20170127_1505'),
]
operations = [
migrations.Remov... | 1.460938 | 1 |
server/config.py | cryptSky/hlsa_task8 | 0 | 47291 | <filename>server/config.py<gh_stars>0
import os
class BaseConfig(object):
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = False
| 1.734375 | 2 |
menu/context_processors.py | douglasPinheiro/nirvaris-menu | 0 | 47292 |
def globals(request):
#import pdb
#pdb.set_trace()
data = {}
if 'menu_item' in request.session:
data['menu_item'] = request.session['menu_item']
return data
| 2.03125 | 2 |
storyboard/tests/api/test_user_tokens.py | Sitcode-Zoograf/storyboard | 0 | 47293 | <reponame>Sitcode-Zoograf/storyboard<gh_stars>0
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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/licens... | 2.28125 | 2 |
altimeter/qj/api/v1/api.py | elliotsegler/altimeter | 48 | 47294 | <reponame>elliotsegler/altimeter
"""V1 API router"""
from fastapi import APIRouter
from altimeter.qj.api.v1.endpoints.jobs import JOBS_ROUTER
from altimeter.qj.api.v1.endpoints.result_sets import RESULT_SETS_ROUTER
V1_ROUTER = APIRouter()
V1_ROUTER.include_router(JOBS_ROUTER, prefix="/jobs", tags=["jobs"])
V1_ROUTER.... | 1.960938 | 2 |
PrepareSession.py | Brett777/Predict-Churn | 12 | 47295 | import os
os.system("sudo apt-get update")
#os.system('sudo apt-get install openjdk-8-jre -y')
os.system('wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz')
os.system('tar -zxf jdk-8u131-lin... | 2.03125 | 2 |
procuret/tests/variants/with_supplier.py | Procuret/procuret-python | 0 | 47296 | """
Procuret Python
Test With Supplier Module
author: <EMAIL>
"""
from procuret.ancillary.command_line import CommandLine
from procuret.tests.variants.with_session import TestWithSession
class TestWithSupplier(TestWithSession):
def __init__(self) -> None:
cl = CommandLine.load()
self._supplier_... | 2.125 | 2 |
firedetectionserver/src/inferenceserver.py | aj-ames/NSAC-NULLPointers | 1 | 47297 | <gh_stars>1-10
from maven import Maven
import numpy as np
import ast
import multiprocessing as mp
import cv2
import random
from PIL import Image
from flask import Flask, request, jsonify
flaskserver = Flask(__name__)
num_classes = 94
thresh_conf = 0.2
global maven, athena
class Athena:
''' Class to hold member ... | 2.546875 | 3 |
tests/plugins/musicbrainz/test_mb_core.py | jtpavlock/moe | 14 | 47298 | """Tests the musicbrainz plugin."""
import datetime
from unittest.mock import patch
import musicbrainzngs # noqa: F401
import pytest
import tests.plugins.musicbrainz.resources as mb_rsrc
from moe.plugins import musicbrainz as moe_mb
@pytest.fixture
def mock_mb_by_id():
"""Mock the musicbrainzngs api call `get... | 2.40625 | 2 |
pjrd/formulaSetupDialog.py | NAustinO/Nutrition-Assistant | 1 | 47299 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'formulaSetupDialog.ui'
##
## Created by: Qt User Interface Compiler version 5.15.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#######... | 1.828125 | 2 |