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 |
|---|---|---|---|---|---|---|
h2client.py | TOKUJI/BlackBull | 1 | 12767851 | import asyncio
import httpx
from blackbull.logger import get_logger_set
logger, log = get_logger_set()
async def main():
async with httpx.AsyncClient(http2=True, verify=False) as c:
res = await c.get('https://localhost:8000/json', headers={'key': 'value'})
assert res.status_code == 200
a... | 2.625 | 3 |
starboard/commands/base.py | TrigonDev/Starboard | 4 | 12767852 | <gh_stars>1-10
# MIT License
#
# Copyright (c) 2022 TrigonDev
#
# 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, mo... | 1.898438 | 2 |
bin/populate_db.py | ryanrdetzel/Mental-Cache | 1 | 12767853 | import pytc
import string
from random import choice
DBNAME="../mental_cache.hdb"
db = pytc.HDB()
db.open(DBNAME, pytc.HDBOWRITER | pytc.HDBOCREAT)
chars = string.letters.lower() + string.digits
x = 1
while x < 1000000:
page_name = ''.join([choice(chars) for i in xrange(8)])
db.put(page_name,'{"order": "","na... | 2.578125 | 3 |
web/transiq/restapi/views/views_page.py | manibhushan05/transiq | 0 | 12767854 | from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.db.models import Q, Count
from django.http import HttpResponseRedirect
from django.utils.html import format_html
from rest_framework import status, viewsets
from rest_framework.renderers import TemplateHTMLRenderer, JSONRe... | 1.476563 | 1 |
Chapter 8/test_2.py | PacktPublishing/Mastering-IPython-4 | 22 | 12767855 | from hail2 import f
class TestHailStones():
def test_f(self):
ans = [0, 0, 1, 7, 2, 5, 8, 16, 3, 19, 6]
for i in range(1, 11):
print(i)
assert f(i) == ans[i]
| 2.734375 | 3 |
base_plugin_manager/__init__.py | LeiQiao/Parasite-Plugins | 0 | 12767856 | from .plugin_manager_plugin import PluginManagerPlugin
from . import plugin_manager_api
| 1.117188 | 1 |
main.py | JNPRAutomate/BGP_Flowspec_automation_with_PyEZ | 13 | 12767857 | #
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2018 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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... | 1.742188 | 2 |
systori/lib/templatetags/amount.py | systori/systori | 12 | 12767858 | from math import floor, ceil
from decimal import Decimal
from django import template
from django.utils.safestring import mark_safe
from .customformatting import ubrdecimal
register = template.Library()
def _make_context(
context,
css,
obj,
field,
bold="gross",
has_form=False,
comment=Non... | 2.171875 | 2 |
arrays/contains_duplicate.py | wtlow003/leetcode-daily | 0 | 12767859 | """
217. Contains Duplicate
https://leetcode.com/problems/contains-duplicate/
Given an array of integers, find if the array contains any duplicates.
Your function should return true if any value appears at least twice in the array,
and it should return false if every element is distinct.
Example:
Input: [1,2,3,1]
Ou... | 3.875 | 4 |
zoomus/components/live_stream.py | seantibor/zoomus | 178 | 12767860 | from __future__ import absolute_import
from zoomus import util
from zoomus.components import base
class LiveStreamComponentV2(base.BaseComponent):
def update(self, **kwargs):
"""
Use this API to update the meeting's stream information.
Expects:
- meeting_id: int
- stream_u... | 2.421875 | 2 |
search/COSP/reinforce_baselines.py | cjdjr/cosp_nas | 3 | 12767861 | <reponame>cjdjr/cosp_nas<gh_stars>1-10
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset
from scipy.stats import ttest_rel
import copy
# from train import rollout, get_inner_model
class Baseline(object):
def wrap_dataset(self, dataset):
return dataset
def unwrap_batch(... | 2.296875 | 2 |
results/plot.py | sebhoof/SolarAxionFlux | 6 | 12767862 | import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{amsmath}\usepackage{amssymb}\usepackage{siunitx}')
# Colours
col_b16agss09 = '#A50026'
col_b16gs98 = '#D73027'
col_agss09 = '#F46D43'
col_agss09ph = '#FDAE61'
col_a... | 2.40625 | 2 |
cosanlab_preproc/wfmaker.py | BryanGonzalez262/cosanlab_preproc | 0 | 12767863 | from __future__ import division
"""
Workflow Maker
==============
Handy function to build dynamic workflows using BIDS formatted data files.
"""
# These imports are not nipype-dependent so we can import them early; see config notes below
import matplotlib
matplotlib.use('Agg')
import nibabel as nib
import os
from .... | 2.234375 | 2 |
app/api/rest/base.py | dolfinus/cryptonite | 0 | 12767864 | <reponame>dolfinus/cryptonite
""" API Backend - Base Resource Models """
from flask_restful import Resource, abort
from api import api_rest
from api.security import multi_auth, restricted, restricted_or_current
class BaseResource(Resource):
def options (self, *args, **kwargs):
return None, 200, ... | 2.390625 | 2 |
tcmba/spiders/processos.py | DadosAbertosDeFeira/tcm-ba | 2 | 12767865 | from datetime import datetime
from scrapy import FormRequest, Request, Spider
from tcmba.items import ProcessItem
class ProcessesSpider(Spider):
name = "processos"
allowed_domains = ["www.tcm.ba.gov.br/"]
start_urls = [
"https://www.tcm.ba.gov.br/consulta/jurisprudencia/consulta-ementario-juridic... | 2.5625 | 3 |
tests/test_contrib_debug_toolbar_flask.py | proofit404/userstories | 187 | 12767866 | <gh_stars>100-1000
import pytest
@pytest.mark.xfail
def test_contrib_is_available():
from stories.contrib.debug_toolbars.flask import StoriesPanel # noqa: F401
| 1.234375 | 1 |
utils/__init__.py | leoHeidel/dog-face-dataset | 1 | 12767867 | <reponame>leoHeidel/dog-face-dataset<filename>utils/__init__.py
from .image_utils import *
| 0.902344 | 1 |
tests/test_mixins.py | Nollde/order | 6 | 12767868 | <gh_stars>1-10
# coding: utf-8
__all__ = [
"CopyMixinTest", "AuxDataMixinTest", "TagMixinTest", "DataSourceMixinTest",
"SelectionMixinTest", "LabelMixinTest", "ColorMixinTest",
]
import unittest
from order import (
CopyMixin, AuxDataMixin, TagMixin, DataSourceMixin, SelectionMixin, LabelMixin, ColorMix... | 2.546875 | 3 |
front_end/vmipl_communication/connection.py | FlorianWestphal/VMI-PL | 0 | 12767869 | <filename>front_end/vmipl_communication/connection.py
import socket
import struct
import os
from vmipl.event_probes import EventProbe
from vmipl_aux.constants import Constants
class Message:
def __init__(self, msg_type, msglen, flags=0, seq=-1, payload=None):
self.type = msg_type
self.flags = flags
self.seq ... | 2.296875 | 2 |
props/graph_representation/parse_graph.py | kshabahang/props | 0 | 12767870 | import props.graph_representation.node
from props.graph_representation.graph_wrapper import GraphWrapper
from props.graph_representation.word import Word, NO_INDEX
from props.graph_representation.node import Node,CopularNode,PossessiveNode,PropNode,\
AppositionNode, PrepNode, CondNode, ConjunctionNode, advNode,... | 1.640625 | 2 |
titus/test/producer/testCart.py | jmilleralpine/hadrian | 127 | 12767871 | #!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 2.4375 | 2 |
P2/ex1at1.py | bmatheaco/pythonexercises | 0 | 12767872 | <gh_stars>0
class Aumento:
codigo = 0
nome = ''
preco = 0.0
aumento = 0.0
def main():
p = Aumento()
p.codigo = int(input('Informe o código do produto: '))
p.nome = str(input('Informe o nome do produto: '))
p.preco = float(input('Informe o preço do produto: R$ '))
p.aumento = (p.prec... | 3.59375 | 4 |
core/colors.py | McArcady/python-lnp | 48 | 12767873 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Color scheme management."""
from __future__ import print_function, unicode_literals, absolute_import
import os, shutil
from . import helpers, paths, log
from .lnp import lnp
from .dfraw import DFRaw
_df_colors = (
'BLACK', 'BLUE', 'GREEN', 'CYAN',
'RED', 'MAGEN... | 2.28125 | 2 |
variant_remapping_tools/reads_to_remapped_variants.py | diegomscoelho/variant-remapping | 3 | 12767874 | #! /usr/bin/env python3
import argparse
from argparse import RawTextHelpFormatter
from collections import Counter, defaultdict
import yaml
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
import pysam
nucleotide_alphabet = {'A', 'T', 'C', 'G'}
def reverse_complement(sequence):
return str(Seq(sequence... | 2.703125 | 3 |
yolo/config.py | ShechemKS/Yolo_Detectron2 | 3 | 12767875 | from detectron2.config import CfgNode as CN
def add_yolo_config(cfg):
cfg.MODEL.YAML = "yolov5m.yaml"
cfg.MODEL.YOLO = CN()
cfg.MODEL.YOLO.NORM = "BN"
cfg.MODEL.YOLO.ACTIVATION = "nn.LeakyReLU"
cfg.MODEL.YOLO.FOCAL_LOSS_GAMMA = 0.0
cfg.MODEL.YOLO.BOX_LOSS_GAIN = 0.05
cfg.MODEL.YOLO.CLS_LOS... | 1.890625 | 2 |
senselet++Onewire_Sensor/senseletOnewire.py | beitong95/SENSELET_PLUSPLUS | 0 | 12767876 | import paho.mqtt.client as paho
from sensorMetaData import sensorMetaData
from sht85 import SHT85
from mlx90614 import MLX90614
import os
import time
import threading
from threading import Lock
from datetime import datetime
import subprocess
# lock for thread print
thread_print_lock = Lock()
# publish or debug
mode=... | 2.71875 | 3 |
clif/python/gen.py | LqNoob/C-Python-interaction | 0 | 12767877 | # Copyright 2017 Google 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 writing,... | 2.046875 | 2 |
tests/ut/python/mindrecord/test_tfrecord_to_mr.py | shaolei-wang/mindspore | 1 | 12767878 | # Copyright 2020 Huawei Technologies Co., Ltd.
#
# 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 agre... | 2.15625 | 2 |
axelerate/__init__.py | chuangzhu/aXeleRate | 0 | 12767879 | <reponame>chuangzhu/aXeleRate
from .train import setup_training
from .infer import setup_inference
| 0.894531 | 1 |
tools/report-converter/tests/unit/analyzers/test_clang_tidy_parser.py | hyker/codechecker | 1 | 12767880 | # -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... | 2.265625 | 2 |
tests/test_Results.py | grahamgower/moments | 0 | 12767881 | import os
import unittest
import numpy
import moments
import time
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
def tearDown(self):
t = time.time() - self.startTime
print("%s: %.3f seconds" % (self.id(), t))
def test_1d_ic(self):
... | 2.5625 | 3 |
tests/test.py | microsoft/attested-fetch | 0 | 12767882 | <reponame>microsoft/attested-fetch<filename>tests/test.py
from pathlib import Path
import json
import base64
import hashlib
import subprocess
import tempfile
THIS_DIR = Path(__file__).parent
DIST_DIR = THIS_DIR.parent / 'dist'
OEVERIFY = "/opt/openenclave/bin/oeverify"
TEST_URL = "https://www.microsoft.com/en-gb/"
T... | 2.21875 | 2 |
lightreid/models/backbones/__init__.py | nataliamiccini/light-reid | 296 | 12767883 | <gh_stars>100-1000
from .resnet import resnet18, resnet34, resnet50, resnet101, resnet152
from .resnet import resnet18ibna, resnet34ibna, resnet50ibna, resnet101ibna, resnet152ibna
from .transformers import *
__cnnbackbone_factory = {
# resnet series
'resnet18': resnet18,
'resnet34': resnet34,
'resnet5... | 1.195313 | 1 |
thmigctrl.py | bazbt3/thmigpen | 1 | 12767884 | #!/usr/bin/env python3
# thmigctrl
# v0.1.0 for Python 3.5
# Runs modules based on a matching hashtag
# Setup tag and channel parameters, a list of valid command options:
tag = 'tmctrl'
retrievecount = 20
channelid = 962
# Import @33MHz and @thrrgilag's library for interacting with pnut.io:
import pnutpy
# Import... | 2.375 | 2 |
HW4-MMap.Random Forest.SciKit Learn/Q2/decision_tree.py | Magic-Fang/CSE6242-DataVisual-Analytics | 8 | 12767885 | from util import entropy, information_gain, partition_classes
import numpy as np
import ast
import heapq
import copy
class DecisionTree(object):
def __init__(self):
# Initializing the tree as an empty dictionary or list, as preferred
#self.tree = []
self.tree = {}
self.maxDepth = 3... | 3.21875 | 3 |
Python L1 Assignments/data/file__ops.py | deb991/TopGear__Projects_n_Assignments | 0 | 12767886 | <filename>Python L1 Assignments/data/file__ops.py
#!/usr/bin/env python
import os
import subprocess
from ctypes import windll
import string
FILEBROWSER_PATH = os.path.join(os.getenv('WINDIR'), 'explorer.exe')
print('\ninitiating File checing into current Directory >>>...\n')
def file__Manager():
pri... | 3.046875 | 3 |
src/reviews/management/commands/send_review_reminders.py | Talengi/phase | 8 | 12767887 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import groupby
from notifications.management.commands.base import EmailCommand
from reviews.models import Review
class Command(EmailCommand):
help = 'Send an email reminder to all users with pending reviews'
text_template = 'reviews/pending_reviews_re... | 2.171875 | 2 |
ninjaopenfoam/swepc.py | hertzsprung/ninjaopenfoam | 0 | 12767888 | import os
class SWEPC:
def __init__(self, name, output, testCase, solver, degree, elements,
endTime, dt, topographyMean=0.6):
self.name = name
self.output = os.path.join('$builddir', output)
self.testCase = testCase
self.solver = solver
self.degree = degree
... | 2.5 | 2 |
abc254/a/main.py | seigot/atcoder | 2 | 12767889 | <filename>abc254/a/main.py<gh_stars>1-10
s = str(input())
ss = ''.join(list(reversed(s)))
sss = ss[:2]
ssss = ''.join(list(reversed(sss)))
print(ssss)
| 3.046875 | 3 |
demo/fs.py | thoughteer/edera | 3 | 12767890 | <reponame>thoughteer/edera
import contextlib
import os
import os.path
import shutil
import tempfile
class FileSystem(object):
def __init__(self, root):
self.root = root
def check(self, path):
return os.path.exists(os.path.join(self.root, path))
@contextlib.contextmanager
def create(... | 2.609375 | 3 |
GUI/Ui_SerialPort.py | IronSublimate/PyQt-multifunctional-uart-helper | 13 | 12767891 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SerialPort.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWind... | 1.75 | 2 |
Mobley_logP/tautomerExploration/LimitedSet_pKa.py | MobleyLab/SAMPL5_logD_PredictionAnalysis | 1 | 12767892 | # Written by <NAME>
# Mobley Group, UC Irvine
# This script performs error analysis for corrected logD values, considering only those where the logD is different than the logP
# These results are compared to predictions from set 16 which did the best by most error metrics
import pickle
from sigfig.sigfig import *
imp... | 2.046875 | 2 |
BayesPaths/ResidualBiGraph3.py | chrisquince/BayesPaths | 3 | 12767893 | <filename>BayesPaths/ResidualBiGraph3.py
from itertools import compress
import argparse
import sys
import numpy as np
import os
import subprocess
import re
from numpy.random import RandomState
import logging
from subprocess import PIPE
from collections import defaultdict
from BayesPaths.UnitigGraph import UnitigGr... | 2.265625 | 2 |
article/figure-4b/lineplot-4b.py | guilherme-araujo/gsop-dist | 0 | 12767894 | <reponame>guilherme-araujo/gsop-dist<filename>article/figure-4b/lineplot-4b.py
import seaborn as sns
import sys
import csv
from statistics import stdev
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import gc
files = [
{'file': 'a1g9', 'bonus': '0.01'},
... | 2.140625 | 2 |
plot_experiments_nodes.py | proroka/redundant_assignment | 0 | 12767895 | <reponame>proroka/redundant_assignment
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import collections
import matplotlib.pylab as plt
import msgpack
import msgpack_numpy
import numpy as np
import scipy
import scipy.stats as st
from six.mov... | 2.078125 | 2 |
app/views.py | configuresystems/restful-api-with-flask | 2 | 12767896 | <reponame>configuresystems/restful-api-with-flask<gh_stars>1-10
"""So that we can modularize our application, we will use this as our
our master file for application endpoints"""
from .modules.todo import views
| 1.257813 | 1 |
src/abaqus/OdbDisplay/ViewCut.py | Haiiliin/PyAbaqus | 7 | 12767897 | import typing
from abaqusConstants import *
class ViewCut:
"""The ViewCut object is used to store values and attributes associate with ViewCut type
objects. ViewCut objects can be created using the methods described below. The methods
accessed via the OdbDisplay object cause the ViewCut object to be add... | 2.8125 | 3 |
memos/memos/models/MemoActivity.py | iotexpert/docmgr | 0 | 12767898 | import enum
from flask import current_app
class MemoActivity(enum.Enum):
Create = 1 # Memo has been created and put into draft
Signoff = 2 # Memo has been submitted to signoff
Sign = 3 # A signature has been added
Unsign = 4 # A signature has been remove... | 3.03125 | 3 |
lib/blackboxprotobuf/lib/protofile.py | nccgroup/blackboxprotobuf | 261 | 12767899 | """
Python methods for importing and exporting '.proto' files from the BBP type
definition format.
"""
# TODO get custom exceptions for these methods
import io
import re
import logging
from blackboxprotobuf.lib.exceptions import TypedefException
import blackboxprotobuf.lib.api
PROTO_FILE_TYPE_MAP = {
"uint": "ui... | 2.46875 | 2 |
cfgov/v1/tests/test_documents.py | adebisi-aden/consumerfinance.gov | 37 | 12767900 | import json
from datetime import datetime
from io import StringIO
from django.test import TestCase, override_settings
from wagtail.core.models import Site
import dateutil.relativedelta
from dateutil.relativedelta import relativedelta
from pytz import timezone
from search.elasticsearch_helpers import ElasticsearchTe... | 2 | 2 |
adam/language_specific/english/__init__.py | isi-vista/adam | 8 | 12767901 | from immutablecollections import immutableset
ENGLISH_DETERMINERS = immutableset(["the", "a"])
DETERMINERS = immutableset(
[
"the",
"a",
"yi1_ge4",
"yi1_jang1",
"yi1_ben3",
"yi1_jyan1",
"yi1_lyang4",
"yi1_bei1",
"yi1_ba3",
"yi1_jr1",
... | 2.78125 | 3 |
wedos_hook/wedos_hook.py | Amunak/acmetool-wapi-hook | 1 | 12767902 | #!/usr/bin/python3
import argparse
import logging
import sys
import time
from configparser import ConfigParser
from pathlib import Path
from random import randint
from typing import Optional, Callable
from dns import resolver, rdtypes
from tldextract import tldextract
from .wapi import Wapi
# Constants that might c... | 2.09375 | 2 |
ssd/utils/box_utils.py | xbcReal/ssd_fcn_multitask_text_detection_pytorch1.0 | 2 | 12767903 | import torch
import math
import numpy as np
def convert_locations_to_boxes(locations, priors, center_variance,
size_variance):
"""Convert regressional location results of SSD into boxes in the form of (center_x, center_y, h, w).
The conversion:
$$predicted\_center * cent... | 2.890625 | 3 |
main_vgg19.py | nirmorgo/Style-Transferer | 4 | 12767904 | <gh_stars>1-10
from style_transfer_funcs_vgg19 import Style_Transferer_VGG19
from image_utils import load_image, plot_input_images
#%%
content_image_path= 'data/trump.jpg'
style_image_path= 'data/pasta.jpg'
img_resize = 720
content_img = load_image(content_image_path, img_resize)
style_img = load_image(style... | 2.046875 | 2 |
skmine/periodic/__init__.py | sdall/scikit-mine | 0 | 12767905 | """
The :mod:`skmine.periodic` implements tools to tackle periodicity in
datasets, preferably presentend in the form of event logs
"""
from .cycles import PeriodicCycleMiner
| 1.445313 | 1 |
app/crawler_app/crawler_app/celeryconfig.py | KimKiHyuk/BenefitObserver | 0 | 12767906 |
import os, sys, json
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(BASE_DIR)
secret_file = os.path.join(BASE_DIR, 'secrets.json')
with open(secret_file) as f:
secrets = json.loads(f.read())
BROKER_URL = secrets['RABBITMQ_CONNECTION']
CELERY_ACCEPT_CONTEN... | 1.960938 | 2 |
src/pds_doi_service/core/input/test/__init__.py | NASA-PDS/pds-doi-service | 2 | 12767907 | <reponame>NASA-PDS/pds-doi-service<filename>src/pds_doi_service/core/input/test/__init__.py
# encoding: utf-8
"""
Planetary Data System's Digital Object Identifier service — tests for core inputs
"""
import unittest
from . import input_util_test
from . import read_bundle
def suite():
suite = unittest.TestSuite()... | 1.695313 | 2 |
pygeotoolbox/sharedtools/fonts/svg/svgicons.py | raugustyn/doctest | 0 | 12767908 | # -*- coding: utf-8 -*-
__author__ = "<EMAIL>"
from pygeotoolbox.sharedtools.fonts.svg.svgfontreader import SVGFontReader
import pygeotoolbox.sharedtools.log as log
from pygeotoolbox.sharedtools import makeDirForFile
__readers = {}
def extractSVGIcon(svgFontFileName, glyphName, iconFileName=None):
global __rea... | 2.390625 | 2 |
src/orientation.py | mackorone/catan | 5 | 12767909 | from enum import Enum
class Orientation(Enum):
NORTH_EAST = 0
NORTH = 1
NORTH_WEST = 2
SOUTH_WEST = 3
SOUTH = 4
SOUTH_EAST = 5
| 3.1875 | 3 |
scripts/practiceScripts/matrixplot.py | czbiohub/scRFE | 11 | 12767910 | <filename>scripts/practiceScripts/matrixplot.py
#!/usr/bin/env python
# coding: utf-8
# # Visualtization: Matrix Plot
# In[1]:
# this is for comparing results from 3m and 24m data
# In[2]:
# imports
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import read_h5ad
from sklearn.ensemble im... | 2.734375 | 3 |
python/publish.py | sogartar/faqap | 1 | 12767911 | #!/usr/bin/env python3
from subprocess import run
from os import path, mkdir
import sys
from datetime import datetime
curr_script_dir = path.abspath(path.dirname(__file__))
publish_dir = datetime.now().strftime("publish-%Y-%m-%d-%H-%M-%S.%f")
mkdir(publish_dir)
run(
[sys.executable, path.join(curr_script_dir, "... | 1.804688 | 2 |
dagauss/DaGauss.py | JonasMoss/dagauss | 0 | 12767912 | # -*- coding: utf-8 -*-
from itertools import product
import sympy as sp
import networkx
import copy
# This should be made into a method.
def get_order(G, values = [], keep = False):
H = G.graph["dependency_graph"]
order = copy.deepcopy(H.graph["sort"])
if not values: return order
... | 3.046875 | 3 |
examples/helloworld/helloworld/hooks.py | ycvbcvfu/SoDo | 4 | 12767913 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sodo.hook import HooKBase
# 第一种方式直接继承HooKBase,然后书写hook 逻辑
class FirstLogHook(HooKBase):
def process_hook(self, *args, **kwargs):
# self.crawler 有全局settings
# settings = self.crawler.settings
print("This is First LogHook")
print("F... | 2.609375 | 3 |
Jisui.py | hoppiece/Jisui | 0 | 12767914 | import PyPDF2
PDF_odd = 'odd.pdf' #奇数ページpdf
PDF_even = 'even.pdf' #偶数ページpdf
OutputName = 'output.pdf' #出力pdf
angle_odd = 0 #奇数ページの回転角度, 時計回り弧度法
angle_even = 0
File_odd = open(PDF_odd, 'rb')
File_even = open(PDF_even, 'rb')
Reader_odd = PyPDF2.PdfFileReader(File_odd)
Reader_even = PyPDF2.PdfFileReader(File_even)
Writer... | 3.546875 | 4 |
bob/io/base/__init__.py | bioidiap/bob.io.base | 0 | 12767915 | # import Libraries of other lib packages
import numpy
import bob.core
# import our own Library
import bob.extension
bob.extension.load_bob_library('bob.io.base', __file__)
from ._library import File as _File_C, HDF5File as _HDF5File_C, extensions
from . import version
from .version import module as __version__
from .... | 2.34375 | 2 |
server/pyser.py | SiggyTheViking/doors | 0 | 12767916 | #!/usr/bin/env python3
import serial
import datetime
import paho.mqtt.publish as pub
import redis
import psycopg2 as pg
ser = serial.Serial('/dev/ttyACM0', 9600)
doors = [
{'door':'front','open':None},
{'door':'french','open':None},
{'door':'kitchen','open':None},
{'door':'music','open':None},
{'d... | 2.53125 | 3 |
iucn_sim/run_sim.py | tobiashofmann88/iucn_extinction_simulator | 11 | 12767917 | <filename>iucn_sim/run_sim.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Run future simulations based on IUCN data and status transition rates
Created on Wed Oct 30 20:59:28 2019
@author: <NAME> (<EMAIL>)
"""
import iucn_sim.iucn_sim as iucn_sim
def add_arguments(parser):
parser.add_argument(
'-... | 2.75 | 3 |
nuvolasdk/__main__.py | tiliado/nuvolasdk | 3 | 12767918 | import sys
import nuvolasdk
sys.exit(nuvolasdk.run(".", sys.argv))
| 1.125 | 1 |
venv/lib/python3.6/site-packages/ansible_collections/dellemc/openmanage/tests/unit/plugins/modules/test_idrac_network.py | usegalaxy-no/usegalaxy | 1 | 12767919 | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 3.0.0
# Copyright (C) 2018-2021 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, division, print_functio... | 1.617188 | 2 |
greenhouse/greenhouse/wsgi.py | wnzlff/greenhouse-web | 1 | 12767920 | <filename>greenhouse/greenhouse/wsgi.py<gh_stars>1-10
"""
WSGI config for greenhouse project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
import sys
from django.core.ws... | 1.867188 | 2 |
reputation/__init__.py | kabirkbr/reputation | 0 | 12767921 | <reponame>kabirkbr/reputation
name = "reputation"
from reputation.aigents_reputation_api import AigentsAPIReputationService
| 1.273438 | 1 |
src/third_party/wiredtiger/test/suite/test_bug018.py | benety/mongo | 0 | 12767922 | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 1.375 | 1 |
BasicProgramming/Problem1/11-Patern-4.py | SyamsulAlterra/Alta | 0 | 12767923 | <filename>BasicProgramming/Problem1/11-Patern-4.py<gh_stars>0
num=5
for i in range(1,num+1):
toPrint=""
end=int(i*(i+1)/2)
a=list(j for j in range(end+1-i,end+1))
for x in a:
toPrint+=" "+str(x)
print(toPrint)
toPrint=""
#output
'''
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
''' | 3.5 | 4 |
broker/persistence/persistence_interface.py | javanlacerda/asperathos-manager | 7 | 12767924 | <filename>broker/persistence/persistence_interface.py
# Copyright (c) 2019 UFCG-LSD.
#
# 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
#
# Unle... | 2.109375 | 2 |
tests/schema_mapping/structures/example6.py | loyada/typed-py | 14 | 12767925 | <gh_stars>10-100
from typedpy import Structure, mappers
class Example6(Structure):
a: int
ssss_ttt: str
_serialization_mapper = [{"a": "bb_cc"}, mappers.TO_CAMELCASE, {"ssssTtt": "x"}]
| 2.21875 | 2 |
tests/test_webhook_payloads.py | DowneyTung/saleor | 19 | 12767926 | <gh_stars>10-100
import json
import pytest
from saleor.order import OrderStatus
from saleor.webhook import WebhookEventType
from saleor.webhook.payloads import (
generate_customer_payload,
generate_order_payload,
generate_product_payload,
generate_sample_payload,
)
@pytest.mark.parametrize(
"eve... | 2.109375 | 2 |
library/password_file.py | lukasic/ansible-role-ispconf | 0 | 12767927 | <gh_stars>0
from ansible.module_utils.basic import AnsibleModule
import os
import sys
import string
def generate_password(length):
chars = string.ascii_letters + string.digits
if sys.version_info.major == 3:
return "".join(chars[c % len(chars)] for c in os.urandom(length))
else:
return "".j... | 2.28125 | 2 |
Python/UploadHeroLoginDownload.py | nerzhul/MiscScripts | 1 | 12767928 | from requests import Request, Session
import bs4 as BeautifulSoup
import re
import sys
conn_url="http://uploadhero.com/lib/connexion.php"
dl_url="http://uploadhero.co/dl/filetodl"
conn_proxies = {
# "http": "http://proxy.example.net:3128",
}
conn_data={"pseudo_login": "mylogin","password_login": "<PASSWORD>"}
s = Ses... | 2.78125 | 3 |
python_modules/libraries/dagster-gcp/dagster_gcp/bigquery/resources.py | hspak/dagster | 3 | 12767929 | <reponame>hspak/dagster<filename>python_modules/libraries/dagster-gcp/dagster_gcp/bigquery/resources.py
import google.api_core.exceptions
import six
from google.cloud import bigquery
from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES
from google.cloud.bigquery.retry import DEFAULT_RETRY
from dagster import ... | 2.0625 | 2 |
modules/todo.py | kijimanh/multibud | 1 | 12767930 | <reponame>kijimanh/multibud
import command
import module
class TodoModule(module.Module):
name = 'To-do'
def on_load(self):
if 'todo' not in self.bot.config:
self.bot.config['todo'] = {}
print('Initialized to-do list data in config')
@command.desc('Add an item to the todo ... | 2.625 | 3 |
weatherAppGUI.py | prakharsaxena1/Shape_AI_Project | 0 | 12767931 | <gh_stars>0
#!/bin/python3
# SHAPE AI PROJECT - Weather App(GUI)
# IMPORTS
import tkinter as tk
from tkinter import ttk
from tkinter.constants import LEFT, RIGHT
from datetime import datetime
import requests
# -- Windows only configuration --
try:
from ctypes import windll
windll.shcore.SetProcessDpiAwarenes... | 3.03125 | 3 |
publication_runs/ecoli_models/ecolicore2comp_load_and_save_with_cobrapy_and_clean.py | klamt-lab/CommModelPy | 3 | 12767932 | <reponame>klamt-lab/CommModelPy
#!/usr/bin/env python3
#
# Copyright 2021 PSB
#
# 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 req... | 2.28125 | 2 |
HackerRank/BasicDataTypes/ListComprehensions.py | OAPJ/Python | 0 | 12767933 | <gh_stars>0
if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
n = int(input())
ar = []
#p=0
for i in range(x+1):
for j in range(y+1):
for k in range(z+1):
if (i+j+k) != n:
ar.append([i,j,k])
print(ar)
"... | 3.1875 | 3 |
src/genie/libs/parser/nxos/tests/ShowSpanningTreeDetail/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 12767934 | <filename>src/genie/libs/parser/nxos/tests/ShowSpanningTreeDetail/cli/equal/golden_output_1_expected.py
expected_output = {
'mstp': {
'mst_instances': {
0: {
'mst_id': 0,
'bridge_priority': 32768,
'bridge_sysid': 0,
'bridge_addres... | 1.578125 | 2 |
hyperglass/cache/base.py | blkmajik/hyperglass | 298 | 12767935 | <reponame>blkmajik/hyperglass<gh_stars>100-1000
"""Base Redis cache handler."""
# Standard Library
import re
import json
from typing import Any, Optional
# Third Party
from pydantic import SecretStr
class BaseCache:
"""Redis cache handler."""
def __init__(
self,
db: int,
host: str =... | 2.609375 | 3 |
__main__.py | DARKPOISON-yt/miyu-animals | 2 | 12767936 | <reponame>DARKPOISON-yt/miyu-animals
import animalapi as a
print(a.animal_data("dogs")) | 1.148438 | 1 |
saleor/account/migrations/0059_merge_20220221_1025.py | victor-abz/saleor | 1,392 | 12767937 | <filename>saleor/account/migrations/0059_merge_20220221_1025.py
# Generated by Django 3.2.12 on 2022-02-21 10:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("account", "0057_clear_user_addresses"),
("account", "0058_update_user_search_document"),
... | 1.171875 | 1 |
GUI.py | rodrickcalvin/Musical-note-identifier-Chromatic-tuner | 3 | 12767938 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/thanos/Qt/Guitar Tuna/guitarTunaDialog.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
... | 1.601563 | 2 |
evidently/model_monitoring/data_drift.py | alex-zenml/evidently | 1 | 12767939 | <filename>evidently/model_monitoring/data_drift.py
from evidently.analyzers.data_drift_analyzer import DataDriftAnalyzer
from evidently.model_monitoring.monitoring import ModelMonitor, ModelMonitoringMetric
class DataDriftMetrics:
p_value = ModelMonitoringMetric("data_drift:p_value", ["feature", "feature_type"])
... | 2.34375 | 2 |
disteval_visualization.py | shrestha-bikash/disteval-1 | 0 | 12767940 | <reponame>shrestha-bikash/disteval-1
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import matplotlib.transforms as mtransforms
import matplotlib.text as mtext
from matplotlib.colors import LinearSegmentedColormap as lsCmap
# Don't currently have the ... | 2.375 | 2 |
btools/__init__.py | belzecue/building_tool | 0 | 12767941 | import bpy
from .road import register_road, unregister_road
from .building import register_building, unregister_building
bl_info = {
"name": "Building Tools",
"author": "<NAME> (ranjian0), <NAME> (luckykadam), Marcus (MCrafterzz)",
"version": (1, 0, 6),
"blender": (2, 80, 0),
"location": "View3D >... | 2.203125 | 2 |
Hangman.py | AlejandroPenaloza/Hangman | 0 | 12767942 | #THIS IS HANGMAN
print('"Hangman"\nA game where you will try to guess which the hidden word is!')
print('\n')
word = input('Input the word to guess:\n')
while True:
if word.isalpha():
break
else:
word = input('Wrong input, type a valid word:\n')
number_of_letters = len(word)
word_listed_lett... | 4.34375 | 4 |
examples/workflows/plot_simulate_evoked.py | mkhalil8/hnn-core | 0 | 12767943 | <gh_stars>0
"""
============================================
01. Simulate Event Related Potentials (ERPs)
============================================
This example demonstrates how to simulate a threshold level tactile
evoked response, as detailed in the `HNN GUI ERP tutorial
<https://jonescompneurolab.github.io/hnn-t... | 2.421875 | 2 |
core/migrations/0002_auto_20180418_1558.py | araceli24/ticross | 0 | 12767944 | # Generated by Django 2.0.4 on 2018-04-18 13:58
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='activityjournal',
name='ti... | 1.703125 | 2 |
memorious/logic/stage.py | x0rzkov/memorious | 0 | 12767945 | from importlib import import_module
from servicelayer.extensions import get_entry_point
from memorious.model import Crawl
class CrawlerStage(object):
"""A single step in a data processing crawler."""
def __init__(self, crawler, name, config):
self.crawler = crawler
self.name = name
s... | 2.640625 | 3 |
main.py | ParkHyeonSeong/FAST_API_STUDY | 0 | 12767946 | from fastapi import FastAPI, Request, Form, Header
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.responses import JSONResponse
from fastapi.responses import Response
from fastapi.staticfiles import StaticFiles # 정적파일
from fastapi.templating import Jinja2Templates # 템플릿화
from pydantic impo... | 2.640625 | 3 |
dcase_task2/train.py | f0k/dcase_task2 | 32 | 12767947 |
from __future__ import print_function
import os
import argparse
import numpy as np
from dcase_task2.lasagne_wrapper.network import Network
from utils.data_tut18_task2 import load_data as load_data_tut18_task2
from utils.data_tut18_task2 import ID_CLASS_MAPPING as id_class_mapping_tut18_task2
from config.settings i... | 2.140625 | 2 |
configs/_base_/datasets/supervisely_3class.py | supervisely-ecosystem/mmdetection3d | 0 | 12767948 |
dataset_type = "SuperviselyDataset"
data_root = '/data/slyproject'
class_names = ['Car', 'Pedestrian', 'Cyclist', 'DontCare']
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
input_modality = dict(use_lidar=True, use_camera=False)
file_client_args = dict(backend='disk')
# db_sampler = dict(
# data_root=data_root,
# ... | 1.742188 | 2 |
sematch/classify.py | dhimmel/sematch | 397 | 12767949 | <gh_stars>100-1000
from gsitk.datasets.datasets import DatasetManager
from nltk.corpus import opinion_lexicon
from collections import Counter
def prepare_lexicon(process=True, dim=250, save=False):
if process:
dm = DatasetManager()
data = dm.prepare_datasets()
nega = set(opinion_lexicon.ne... | 2.40625 | 2 |
qt__pyqt__pyside__pyqode/test_sql_fetchMore__QSqlTableModel_QSqlQueryModel/main__QSqlQueryModel.py | gil9red/SimplePyScripts | 117 | 12767950 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import QApplication, QTableView
from PyQt5.QtSql import QSqlDatabase, QSqlQueryModel, QSqlQuery
db = QSqlDatabase.addDatabase('QSQLITE')
db.setDatabaseName('database.sqlite')
if not db.open():
raise Exception(db.lastErr... | 2.421875 | 2 |