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 |
|---|---|---|---|---|---|---|
kimsta/migrations/0002_auto_20211208_1726.py | Evan-cell/instagram | 0 | 41900 | <reponame>Evan-cell/instagram
# Generated by Django 3.2.7 on 2021-12-08 14:26
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settin... | 2 | 2 |
python/taskmda/mda/svc/generate_entity_ngrams.py | jiportilla/ontology | 0 | 41901 | <reponame>jiportilla/ontology
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import pprint
from base import BaseObject
from base import FileIO
from base import MandatoryParamError
class GenerateEntityNgrams(BaseObject):
def __init__(self,
ontology_name: str,
some_labe... | 2.078125 | 2 |
signalwire/relay/calling/results/dial_result.py | ramarketing/signalwire-python | 23 | 41902 | <filename>signalwire/relay/calling/results/dial_result.py
from . import BaseResult
class DialResult(BaseResult):
def __init__(self, component):
super().__init__(component)
@property
def call(self):
return self.component.call
| 1.828125 | 2 |
src/patteRNA/DOM.py | AviranLab/patteRNA | 12 | 41903 | import numpy as np
class DOM:
"""
Object representing a discretized observation model. Comprised primarily by the
DOM.edges and DOM.chi vectors, which represent the discrete mask and state-dependent
emission probabilities, respectively.
"""
def __init__(self):
self.k = None
se... | 2.609375 | 3 |
printopal_changes/utils.py | HITESHBERA/printopal_changes1 | 0 | 41904 | <filename>printopal_changes/utils.py
from __future__ import unicode_literals
import frappe
from frappe import _
import json
def get_tax_breakup_for_cgst_sgst(doc):
tax_breakups = []
if doc.doctype == 'Sales Invoice':
taxes = {}
for tax in doc.items:
if tax.item_tax_template and tax.item_tax_rate:
tax_ra... | 2.140625 | 2 |
modules/core/dbshell/dbshell.py | petabyteboy/nixcloud-webservices | 121 | 41905 | <filename>modules/core/dbshell/dbshell.py<gh_stars>100-1000
#!@interpreter@
import os
from pwd import getpwnam
from argparse import ArgumentParser
DBSHELL_CONFIG = @dbshellConfig@ # noqa
WEBSERVICES_PREFIX = "/var/lib/nixcloud/webservices"
def run_shell(dbname, user, command):
os.setuid(getpwnam(user).pw_uid)
... | 2.5 | 2 |
misc/qchecker/solver/solver.py | SECCON/SECCON2021_online_CTF | 7 | 41906 | import re
code = open("qchecker.rb").read()
code = code.replace(" ", "").replace("\n", "")
A = re.findall(r'b\[".*?"\]', code)[1]
def decode36base(x):
n = 0
for c in x:
c = ord(c)
if ord("0")<=c<=ord("9"):
c -= ord("0")
else:
c -= ord("a")
c += 10
n = n*36+c
return n
A = [dec... | 3.09375 | 3 |
validator/fastq.py | rdgoite/fastq-validation | 0 | 41907 | <reponame>rdgoite/fastq-validation<gh_stars>0
class Validator:
PLUS_CHAR = 43
AT_CHAR = 64
def __init__(self):
self.validation_results = None
self.sequence_symbols = list()
for symbol in "ACTGN.":
self.sequence_symbols.append(ord(symbol))
self.quality_score_symbo... | 2.765625 | 3 |
src/crossknight/sqink/provider/gdrive.py | jfveronelli/sqink | 32 | 41908 | # coding:utf-8
from base64 import b64encode
from crossknight.sqink import createLogger
from crossknight.sqink.domain import isUuid
from crossknight.sqink.domain import NoteStatus
from crossknight.sqink.markdown import renderHtml
from crossknight.sqink.plist import marshalNote
from crossknight.sqink.plist import unmarsh... | 1.90625 | 2 |
create_base_xml_files.py | rochester-rcl/islandora-import-scripts | 1 | 41909 | <reponame>rochester-rcl/islandora-import-scripts
#work in prgress - This creates a skelatal mods file for the givne set of files
templateFile = "C:\\python-scripts\\xml-file-output\\aids_skeletalmods.xml"
def createXmlFiles(idList):
print("create xml file list")
for id in idList:
#print("processing i... | 2.4375 | 2 |
1095.py | FahimFBA/URI-Problem-Solve | 3 | 41910 |
j,i=65,-2
for I in range (1,14):
J= j-5
I=i+3
print('I=%d J=%d' %(I,J))
j=J
i=I | 3.15625 | 3 |
oldversion1/server0.py | userElaina/rsa-p2p | 0 | 41911 | <gh_stars>0
import os
import time
import socket
import base64
from _th import throws_ex,throws
n=os.cpu_count()
t=10
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.bind(('127.0.0.1',23301))
s.listen(os.cpu_count()<<1)
_count=0
def f():
global _count
while True:
ss,ext=s.accept()
pri... | 2.515625 | 3 |
puffbird/frame.py | gucky92/puffbird | 1 | 41912 | <gh_stars>1-10
"""
FrameEngine class
-----------------
Class to transform a wide pandas DataFrame, as it may be obtained from a
database model like datajoint, into a long dataframe format optimal for
plotting and groupby computations.
"""
import re
from typing import (
Dict, Union, Optional,
Collection, Sequen... | 2.515625 | 3 |
where/estimation/parameters/vlbi_src_dir.py | ingridfausk/where | 16 | 41913 | """Calculate the partial derivatives of the source coordinates
Description:
------------
Calculate the partial derivatives of the source coordinates.
This is done according to equations (2.47) - (2.50) in Teke [2]_.
References:
-----------
.. [1] <NAME>. and <NAME>. (eds.), IERS Conventions (2010), IERS Technical... | 2.71875 | 3 |
wxpusher/tests/test_send_message.py | hnauto/wxpusher-sdk-python | 124 | 41914 | <filename>wxpusher/tests/test_send_message.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unittest for sending message.
File: test_send_message.py
Author: huxuan
Email: <EMAIL>
"""
import unittest
from wxpusher import WxPusher
from . import config
class TestSendMessage(unittest.TestCase):
"""Unittest for... | 2.703125 | 3 |
examples/ble_packet_buffer_client.py | anthonytw/Adafruit_CircuitPython_BLE | 0 | 41915 | # SPDX-FileCopyrightText: 2022 <NAME> for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
Used with ble_packet_buffer_test.py. Transmits "echo" to
PacketBufferService and receives it back.
"""
import time
from ble_packet_buffer_service import PacketBufferService
from adafruit_ble import BLERadio
from adafrui... | 2.796875 | 3 |
fsl/scripts/fsl_ents.py | physimals/fslpy | 6 | 41916 | #!/usr/bin/env python
#
# fsl_ents.py - Extract ICA component time courses from a MELODIC directory.
#
# Author: <NAME> <<EMAIL>>
#
"""This module defines the ``fsl_ents`` script, for extracting component
time series from a MELODIC ``.ica`` directory.
"""
import os.path as op
import sys
import a... | 2.46875 | 2 |
utilities/calculate_missing_diffs.py | SafeBreach-Labs/Back2TheFuture | 84 | 41917 | # (CWD: executables/amd64 folder)
# TODO: finish this
import os
packages = []
total_executables_packages = len(os.listdir("."))
for package_name in os.listdir("."):
packages.append(os.path.join(".", package_name))
without_diffs = []
expected_diffs = 0
for package_path in packages:
match_found = os.listdir(packa... | 2.796875 | 3 |
test/magicmind/op_test/test_size.py | Cambricon/catch | 20 | 41918 | from __future__ import print_function
from itertools import product
import torch
import torch.nn as nn
import torch_mlu
from torch.nn import Parameter
import torch.nn.functional as F
import numpy as np
import sys
import os
import copy
import random
import time
import unittest
cur_dir = os.path.dirname(os.path.abspath(... | 2.3125 | 2 |
webutils/captcha/widgets.py | ernado-legacy/django-webutils | 0 | 41919 | <filename>webutils/captcha/widgets.py
# coding=utf-8
from django import forms
from django.conf import settings
from django.template.loader import render_to_string
from api import *
DEFAULT_WIDGET_TEMPLATE = 'captcha_widget.html'
WIDGET_TEMPLATE = DEFAULT_WIDGET_TEMPLATE
class YaCaptcha(forms.widgets.Widget):
def... | 2.21875 | 2 |
coreModule/enums.py | addu390/app-builder-backend | 1 | 41920 | import enum
class Component(enum.Enum):
TEXT_INPUT_FIELD = 1
IMAGE_UPLOAD_BUTTON = 2
RADIO_BUTTON = 3
MULTI_SELECTION = 4
SUBMIT_BUTTON = 5
class TextInputFieldType(enum.Enum):
MULTI_LINE = 1
SINGLE_LINE = 2
| 2.6875 | 3 |
desafio_ibm/desafio_ibm/users/migrations/0003_auto_20210523_1447.py | jamilatta/desafio_ibm | 0 | 41921 | <reponame>jamilatta/desafio_ibm
# Generated by Django 3.1.11 on 2021-05-23 17:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0002_auto_20210523_1411"),
]
operations = [
migrations.AlterField(
model_name="user",
... | 1.507813 | 2 |
offer/25_MergeSortedLists.py | DevRoss/python-offer-code | 1 | 41922 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by Ross on 19-1-18
"""由于垃圾windows把我的代码无缘无故给删了,所以现在直接使用MKYAN的代码,若有侵权,请告知"""
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# 返回合并后列表
def Merge(self, pHead1, pHead2):
# write code here
... | 3.984375 | 4 |
venv/Lib/site-packages/sqlalchemy/event/__init__.py | svercillo/flaskwebapi | 2 | 41923 | <gh_stars>1-10
# event/__init__.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .api import CANCEL # noqa
from .api import contains ... | 1.203125 | 1 |
userpictures/providers/gravatar.py | trac-hacks/trac-UserPicturesPlugin | 2 | 41924 | <reponame>trac-hacks/trac-UserPicturesPlugin<filename>userpictures/providers/gravatar.py
import hashlib
import re
from trac.config import *
from trac.core import *
from userpictures import IUserPicturesProvider
class UserPicturesGravatarProvider(Component):
implements(IUserPicturesProvider)
# from trac sou... | 2.34375 | 2 |
data_process/wholepose/demo.py | SnorlaxSE/CVPR21Chal-SLR | 0 | 41925 | <reponame>SnorlaxSE/CVPR21Chal-SLR
# from __future__ import absolute_import
# from __future__ import division
# from __future__ import print_function
import argparse
import os
import pprint
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.nn.functional as f
# import torch.optim
... | 1.625 | 2 |
CookieTTS/utils/dataset/data_utils.py | AstraliteHeart/cookietts | 25 | 41926 | <gh_stars>10-100
import random
import time
import pickle
import os
os.environ["LRU_CACHE_CAPACITY"] = "3"
import re
import numpy as np
import torch
import torch.utils.data
import torch.nn.functional as F
# meta processing
from CookieTTS.utils.dataset.metadata import get_dataset_meta
from tqdm import tqdm
# audio proc... | 1.976563 | 2 |
vb2py/PythonCard/simpleSizer.py | ceprio/xl_vb2py | 0 | 41927 | """
__version__ = "$Revision: 1.2 $"
__date__ = "$Date: 2005/10/12 22:27:39 $"
"""
"""
Simple sizer for PythonCard
Uses a simple method for sizing:
- each component type is defined to be fixed or stretchable
- uses GetBestSize() to get a min size for each component
- each component is placed by its cent... | 2.6875 | 3 |
buildImage.py | AbhiTaker/Container-Testing-Platform | 1 | 41928 | <filename>buildImage.py<gh_stars>1-10
import compilers
import docker
def basicImage():
client = docker.from_env()
for id in range(1, len(compilers.compilers)+1):
tagName = "ctp" + str(id)
dockerFileText = compilers.compilers[str(id)]
dockerFile = open('dfile/Dockerfile', 'w', ... | 2.71875 | 3 |
backend/modules/repo/views.py | YouFacai/iWiki | 0 | 41929 | import datetime
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.db import transaction, IntegrityError
from django.db.models import Q
from django.utils.translation import gettext as _
from django.utils.translation import ngettext
from rest_... | 1.765625 | 2 |
main/experiments/init.py | resuly/Traffic-3DResnets | 2 | 41930 | import os,sys,glob,shutil
lists = glob.glob('./*/*.log')
lists += glob.glob('./*/*.tar')
lists += glob.glob('./*/*.pk')
lists += glob.glob('./*/*weights.json')
for f in lists:
os.remove(f)
| 2.421875 | 2 |
LeetCode/Easy/SymetricTree.py | ukayaj620/cp-solution | 1 | 41931 | <reponame>ukayaj620/cp-solution<gh_stars>1-10
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def isMirror(self, left: TreeNode, right: TreeNode) -> bool:
if left is None and right is None:
... | 3.734375 | 4 |
examples/sim_taxi/config/env.py | CPFL/AMS | 26 | 41932 | <reponame>CPFL/AMS
#!/usr/bin/env python
# coding: utf-8
import os
from dotenv import load_dotenv
load_dotenv(os.path.abspath(os.path.dirname(__file__))+'/sample.env')
env = dict(os.environ)
| 1.5625 | 2 |
Algorithm.Python/stubs/QuantConnect/Indicators/__CandlestickPatterns_1.py | gaoxiaojun/Lean | 2 | 41933 | from .__CandlestickPatterns_2 import *
import typing
import QuantConnect.Indicators.CandlestickPatterns
import datetime
class DojiStar(QuantConnect.Indicators.CandlestickPatterns.CandlestickPattern, System.IComparable, QuantConnect.Indicators.IIndicator[IBaseDataBar], QuantConnect.Indicators.IIndicator, System.IComp... | 2.296875 | 2 |
test/test_delete_contact.py | ann-drobysh/python_training | 0 | 41934 | from model.contact import Contact
import random
import allure
def test_delete_some_contact(app, db, check_ui):
if len(db.get_contacts_list()) == 0:
app.contact.add_new_contact(Contact(firstname="Testik", middlename="Midtest", lastname="Lasttest", nickname="Nickname test", title="Mrs", company="Test Company... | 3.15625 | 3 |
pages/urls.py | UlmBlois/website | 0 | 41935 | <gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path('PilotInformations', views.PilotInformationsView.as_view(),
name='pilot_informations'),
path('About', views.AboutView.as_view(), name='about'),
path('Contact', views.ContactView.as_view(), name='contact'),
path('... | 1.695313 | 2 |
sw_data_loader/SWDataClassFile.py | stealthness/sklearn-examples | 0 | 41936 | import os
from PIL import Image
file_deliminator = "//"
valid_image_file_formats = {'png', 'jpg'}
class SWData:
data_img = {}
data_class = {}
base_path = ""
data_classes = set()
data_images_equal_size = False
def __int__(self):
pass
def load_img_datafiles(self, folder_location... | 3 | 3 |
apps/jobs/migrations/0014_rename_job_id_field_in_submission_model_to_job_name.py | kaustubh-s1/EvalAI | 1,470 | 41937 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-01-20 05:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("jobs", "0013_add_job_id_field_in_submission_model")]
operations = [
migrations.RenameField(
... | 1.617188 | 2 |
encoding_selection/src/main/python/example/tf_mnist.py | githubsigmod2021/CodecDB | 4 | 41938 | import collections
import io
import numpy as np
import tensorflow as tf
hidden_dim = 1000
input_size = 28 * 28
output_size = 10
train_data_file = "/home/harper/dataset/mnist/train-images.idx3-ubyte"
train_label_file = "/home/harper/dataset/mnist/train-labels.idx1-ubyte"
test_data_file = "/home/harper/dataset/mnist/t... | 2.578125 | 3 |
src/recombinant_denaturation/2_kinetic_fitting.py | dezeraecox-manuscripts/COX_Proteome-stability | 0 | 41939 | <filename>src/recombinant_denaturation/2_kinetic_fitting.py
import os, re, string
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import bokeh.palettes as bp
from loguru import logger
from GEN_Utils import FileHandling
from ProteomicsUtils import StatUtils
logger.info('Imp... | 2.25 | 2 |
pyy.py | eieio/pyy | 0 | 41940 | <gh_stars>0
''' IRCBot.py
Copyright 2008 <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 appl... | 1.9375 | 2 |
microcosm_flask/metrics.py | KensoDev/microcosm-flask | 0 | 41941 | """
Metrics extensions for routes.
"""
try:
from microcosm_metrics.classifier import Classifier
except ImportError:
raise Exception("Route metrics require 'microcosm-metrics'")
from microcosm_flask.audit import parse_response
from microcosm_flask.errors import extract_status_code
class StatusCodeClassifier... | 2.5625 | 3 |
zeppos_git/branch.py | changrunner/zeppos_git | 0 | 41942 | <gh_stars>0
import git
from zeppos_root.root import Root
from zeppos_logging.app_logger import AppLogger
from cachetools import cached, TTLCache
class Branch:
@staticmethod
@cached(cache=TTLCache(maxsize=1024, ttl=600))
def get_current():
g = git.cmd.Git(Root.find_root_of_project(__file__))
... | 2.125 | 2 |
onfire/embedders.py | joshfp/onfire | 13 | 41943 | import torch
import torch.nn as nn
__all__ = [
'ConcatEmbeddings',
'PassThrough',
'MeanOfEmbeddings',
]
class ConcatEmbeddings(nn.Module):
def __init__(self, fields):
super().__init__()
self.output_dim = sum([field.output_dim for field in fields.values()])
self.embedders = nn.... | 2.640625 | 3 |
payment/tests.py | mohsenamoon1160417237/ECommerce-app | 0 | 41944 | <reponame>mohsenamoon1160417237/ECommerce-app
from django.test import TestCase
class PaymentPageViewTest(TestCase):
def setUp(self):
self.url = '/payment/stripe/'
def test_url_ok(self):
response = self.client.post(self.url)
self.assertEqual(response.status_code , ... | 2.109375 | 2 |
thorpy/_utils/functions.py | YannThorimbert/ThorPy-1.0 | 1 | 41945 | <gh_stars>1-10
"""Miscellaneous functions"""
from random import random
def obtain_valid_object(obj_class, **kwargs):
"""
Try to obtain a valid instance of obj_class, using those args of kwargs that
can be given to its __init__ function.
"""
try:
obj = obj_class(**kwargs)
except TypeErro... | 2.890625 | 3 |
leecode/396.Rotate-FUnction.py | BizShuk/code_algo | 0 | 41946 | <reponame>BizShuk/code_algo
class Solution(object):
def maxRotateFunction(self, A):
"""
:type A: List[int]
:rtype: int
"""
totalSum = sum(A)
Al = len(A)
F = {0:0}
for i in range(Al):
F[0] += i * A[i]
maxNu... | 2.890625 | 3 |
src/traditional/segment/config.py | jakexie/LearnDeepLearning | 0 | 41947 | class Config:
# image size
image_min_dims = 512
image_max_dims = 512
steps_per_epoch = 50
validation_steps = 20
batch_size = 16
epochs = 10
shuffle = True
num_classes = 21
| 1.453125 | 1 |
evaluate.py | NaCl-Ocean/Anchor_free_detection_rotation | 12 | 41948 | import json
import tempfile
from collections import OrderedDict
import os
import numpy as np
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from utils import BoxList
#from utils.pycocotools_rotation import Rotation_COCOeval
def evaluate(dataset, predictions, result_file, score_... | 2.21875 | 2 |
src/txtwrpr/__init__.py | hendrikdutoit/TxtWrpr | 0 | 41949 | <gh_stars>0
"""Application Utilities for Bright Edge eServices developments"""
from .txtwrpr import *
_version = "2.2.2"
| 0.894531 | 1 |
common/framework_excuter/keras_excute.py | wavelet2008/rknn-v5 | 11 | 41950 | <reponame>wavelet2008/rknn-v5<filename>common/framework_excuter/keras_excute.py
from tensorflow.keras.models import load_model
class Keras_model_container:
def __init__(self, model_path) -> None:
self.net = load_model(model_path)
def run(self, input_datas):
outputs = self.net.predict(input_dat... | 1.765625 | 2 |
src/tests/ftest/soak/soak_faults.py | dpquigl/daos | 0 | 41951 | #!/usr/bin/python
"""
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
from soak_test_base import SoakTestBase
class SoakFaultInject(SoakTestBase):
# pylint: disable=too-many-ancestors
"""Test class Description: Runs soak with fault injectors.
:avocado: recurs... | 2.046875 | 2 |
ocdskingfisher/maindatabase/migrations/versions/479219fa5c98_not_null.py | patxiworks/kingfisher | 0 | 41952 | <reponame>patxiworks/kingfisher<filename>ocdskingfisher/maindatabase/migrations/versions/479219fa5c98_not_null.py
"""not-null
Revision ID: 479219fa5c98
Revises: <PASSWORD>
Create Date: 2018-07-18 13:47:25.390348
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '479219fa5c98'
down_revis... | 1.320313 | 1 |
examples/scanner/cluster_hierarchical.py | shanefeng123/agilkia | 3 | 41953 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Example of creating hierarchical clusters from Scanette traces.
Some helpful documentation about SciPy hierarchical clustering::
* SciPy docs: https://docs.scipy.org/doc/scipy/reference/cluster.hierarchy.html
* https://joernhees.de/blog/2015/08/26/scipy-hierar... | 3.125 | 3 |
collection/plugins/modules/installer_address.py | ventris/tateru | 0 | 41954 | <reponame>ventris/tateru<gh_stars>0
#!/usr/bin/env python3
# TODO: describe
# Copyright 2020 Tateru Authors
#
# 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/licen... | 1.9375 | 2 |
get_cleveland_clinic_data.py | CLuiz/med-costs | 0 | 41955 | <reponame>CLuiz/med-costs<gh_stars>0
# Script to grab all hospital cost info from the Cleveland Clinic Family
# of Hospitals, 15 total.
import requests
from subprocess import call
from pathlib import Path
from bs4 import BeautifulSoup
from bs4.element import NavigableString
import time
def get_links(url="https://my... | 3.046875 | 3 |
Scripts/cece_anal_Jan172017_fix4_editbystef.py | gmweir/HJ | 0 | 41956 | <reponame>gmweir/HJ
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 17 12:37:58 2017
@author: weir
"""
# ========================================================================== #
# ========================================================================== #
from __future__ import absolute_imp... | 1.867188 | 2 |
json_form/gen.py | cwstra/rpdiscordrewrite | 1 | 41957 | <gh_stars>1-10
import asyncio
import asyncpg
import ujson as json
request = lambda c, t: 'SELECT * FROM ptu_'+c+'_'+t+';'
codexList = ['al', 'pt', '05']
categList = ['ability','blessing','capability','d_b','edge','feature','item',
'keyword','list','maneuver','mon_forms','mon_nature','move',
'... | 2.28125 | 2 |
autoprocess/auto_integrate.py | michel4j/auto-process | 0 | 41958 | <reponame>michel4j/auto-process
import os
import sys
from autoprocess.engine.process import Manager
from autoprocess.utils import log
from autoprocess.utils import misc
logger = log.get_module_logger('auto.integrate')
def main(args):
if args.dir:
os.chdir(args.dir)
try:
checkpoint = misc.loa... | 2.1875 | 2 |
Competitive Programming/Blind 75 Must Do Leetcode/Course Schedule.py | shreejitverma/GeeksforGeeks | 2 | 41959 | <reponame>shreejitverma/GeeksforGeeks<gh_stars>1-10
'''https://leetcode.com/problems/course-schedule/
207. Course Schedule
Medium
7445
303
Add to List
Share
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, ... | 3.875 | 4 |
tests/test_view.py | tsouvarev/drf-spectacular | 0 | 41960 | import pytest
import yaml
from django.conf.urls import url
from rest_framework.test import APIClient
from drf_spectacular.validation import validate_schema
from drf_spectacular.views import SpectacularAPIView
urlpatterns = [url(r'^api/schema$', SpectacularAPIView.as_view(), name='schema')]
@pytest.mark.urls(__name_... | 2.15625 | 2 |
app/core/migrations/0008_auto_20200820_1408.py | dodge-ttu/gohan-api | 0 | 41961 | <reponame>dodge-ttu/gohan-api
# Generated by Django 2.1.15 on 2020-08-20 14:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20200819_2253'),
]
operations = [
migrations.RenameModel(
old_name='Device',
... | 1.640625 | 2 |
rf_pymods/smwrand.py | rfinnie/rf-pymods | 0 | 41962 | <reponame>rfinnie/rf-pymods<gh_stars>0
# SPDX-FileCopyrightText: Copyright (C) 2019-2021 <NAME>
# SPDX-License-Identifier: MIT
class SMWRand:
"""Super Mario World random number generator
Based on deconstruction by Retro Game Mechanics Explained
https://www.youtube.com/watch?v=q15yNrJHOak
"""
# S... | 2.6875 | 3 |
rotkehlchen/tests/exchanges/test_independentreserve.py | rotkehlchenio/rotkehlchen | 137 | 41963 | <reponame>rotkehlchenio/rotkehlchen<gh_stars>100-1000
import warnings as test_warnings
from unittest.mock import patch
import pytest
from rotkehlchen.accounting.structures.balance import Balance
from rotkehlchen.constants.assets import A_AUD, A_ETC, A_ETH
from rotkehlchen.errors.asset import UnknownAsset
from rotkehl... | 2.171875 | 2 |
ccvaliditycheck.py | ShlomoStept/Credit_Card_Validity_Check | 0 | 41964 | #===================================================================================================================================================================================
# Author: <NAME>
# ccvaliditycheck.py will open up a window and determine if any credit card number; entered by the user, is valid.
#======... | 3.984375 | 4 |
src/utilsmodule/WilliamHillURLs.py | jke94/WilliamHill-WebScraping | 0 | 41965 | <gh_stars>0
'''
AUTOR: <NAME>
Date: 08/10/2020
WilliamHillURLs class to managed info about William Hill web pages.
'''
import requests
from bs4 import BeautifulSoup
from urlvalidator import validate_url, ValidationError
class WilliamHillURLs:
"""Auxiliar class with data about William Hill Web to ... | 3.25 | 3 |
web scrapy/scrapy/coin/coin/items.py | douguedh/Project | 0 | 41966 | <reponame>douguedh/Project
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class ProductItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
Position = scrapy.Field()
Name ... | 2.796875 | 3 |
ctpbee/interface/ctp_mini/lib.py | mcFore/ctpbee | 461 | 41967 | <reponame>mcFore/ctpbee<filename>ctpbee/interface/ctp_mini/lib.py<gh_stars>100-1000
import pytz
from ctpbee_api.ctp_mini import *
from ctpbee.constant import *
STATUS_MINI2VT = {
THOST_FTDC_OAS_Submitted: Status.SUBMITTING,
THOST_FTDC_OAS_Accepted: Status.SUBMITTING,
THOST_FTDC_OAS_Rejected: Status.REJECT... | 1.875 | 2 |
tests/tests_file_exts.py | tkhyn/djinga | 0 | 41968 | from django.core.exceptions import ImproperlyConfigured
from ._base import ExtTestCase
class DjangoTemplateFileExtTests(ExtTestCase):
extensions = ('djinga.ext.static',
'djinga.ext.url')
def test_single_filext(self):
self.setEnvironment(jj_exts=('jinja',), extensions=se... | 2.171875 | 2 |
config.py | mengt/vsphere-event | 0 | 41969 | #coding=utf-8
# interval
interval = 60 # 上报的 step 间隔
# vcenter
host = "172.16.10.127" # vcenter 的地址
user = "<EMAIL>" # vcenter 的用户名
pwd = "<PASSWORD>" # vcenter 的密码
port = 443 # vcenter 的端口
| 1.0625 | 1 |
Twitter-Analysis/tweet_sentiment.py | ntduong/ML | 3 | 41970 | '''
Created on May 4, 2013
@author: Administrator
'''
import json
import sys
def parseTweets(tweet_file='tweets.txt'):
parsed_tweets = []
with open(tweet_file, 'r') as fin:
for line in fin:
tweet = json.loads(line)
if 'text' in tweet:
parsed_tweets.append(tweet)... | 3.421875 | 3 |
pvpcbill/models.py | azogue/pvpcbill | 5 | 41971 | # -*- coding: utf-8 -*-
"""Electrical billing for small consumers in Spain using PVPC. Bill dataclasses."""
from datetime import datetime
from typing import Iterator, List
import attr
import pandas as pd
from pvpcbill.base import Base
from pvpcbill.official import (
MARGEN_COMERC_EUR_KW_YEAR_MCF,
round_money,... | 2.65625 | 3 |
feet/admin.py | yun-mh/uniwalk | 0 | 41972 | from django.contrib import admin
from . import models
@admin.register(models.Footsize)
class FootsizeAdmin(admin.ModelAdmin):
""" アドミンに足サイズテーブルを定義する """
pass
@admin.register(models.FootImage)
class FootImageAdmin(admin.ModelAdmin):
""" アドミンに足イメージテーブルを定義する """
pass
@admin.register(models.Proces... | 1.726563 | 2 |
rover_motor_controller/rover_motor_controller/lx16a/motor_controller.py | mgonzs13/ros2_rover | 11 | 41973 | <reponame>mgonzs13/ros2_rover
"""
Lewansoul wrapper.
"""
from typing import List
from .lx16a import LX16A
from .lx16a_consts import (
MOTOR_LEFT_FRONT,
MOTOR_LEFT_MIDDLE,
MOTOR_LEFT_BACK,
MOTOR_RIGHT_FRONT,
MOTOR_RIGHT_MIDDLE,
MOTOR_RIGHT_BACK,
SERVO_LEFT_FRONT,
SERVO_RIGHT_FRONT,
... | 2.671875 | 3 |
medium/Longest Palindromic Substring/solution.py | ashutosh1919/leetcode-problems | 8 | 41974 | # Time complexity: O(n)
# Approach: Manacher's Algorithm. Please watch this vide for explanation https://youtu.be/V-sEwsca1ak
class Solution:
def longestPalindrome(self, s: str) -> str:
newS = ""
n = 2 * len(s) + 1
ind = 0
for j in range(n):
if j % 2 == 1:
... | 3.234375 | 3 |
apiserver/ourCloud/ocPaths/GetCiMasterDataPath.py | baloise/oim-api | 1 | 41975 | from ourCloud.ocPaths.AbstractOcPath import AbstractOcPath
import requests
class GetCiMasterDataPath(AbstractOcPath):
# 3.4.4
def __init__(self, object_name, object_type='VM'):
"""Creates the path object to retrieve CI master data for a specific object
Parameters
----------
o... | 2.484375 | 2 |
CircuitPython_Flying_Toasters/code.py | joewalk102/Adafruit_Learning_System_Guides | 1 | 41976 | """
Continuously scroll randomly generated After Dark style toasters.
Designed for an ItsyBitsy M4 Express and a 1.3" 240x240 TFT
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Adafruit!
Written by <NAME> for Adafruit I... | 2.78125 | 3 |
app/update_logs_test.py | limshengli/tinypilot | 1,334 | 41977 | import unittest
import update_logs
class UpdateLogsTest(unittest.TestCase):
def test_get_new_logs_with_more_next_logs(self):
self.assertEqual(
"56789",
update_logs.get_new_logs(prev_logs="01234", next_logs="0123456789"))
def test_get_new_logs_with_more_prev_logs(self):
... | 2.71875 | 3 |
HLIMDS_1/servo.py | Baleskin1/fpga_and_nn_pract | 0 | 41978 | <filename>HLIMDS_1/servo.py
from RPi import GPIO as io
from time import sleep
io.setmode(io.BOARD)
some_freq = 440
dc = 50
servo = 12
buzzer_pin = 32
led = 10
io.setup(servo, io.OUT)
io.setup(buzzer_pin, io.OUT)
io.setup(led, io.OUT)
sg90 = io.PWM(servo, 50)
sg90.start(7.5)
buzzer =io.PWM(buzzer_pin, some_freq)
buzze... | 2.890625 | 3 |
music_collection/compilations/migrations/0003_ordered_releases.py | tiesjan/music-collection | 0 | 41979 | <reponame>tiesjan/music-collection
# Generated by Django 2.2.12 on 2020-06-05 18:34
from django.db import migrations, models
def fill_release_order_index(apps, schema_editor):
Release = apps.get_model("compilations", "Release")
Series = apps.get_model("compilations", "Series")
for series in Series.objec... | 1.882813 | 2 |
Python/tdw/object_data/composite_object/composite_object_static.py | ricklentz/tdw | 0 | 41980 | <reponame>ricklentz/tdw
from typing import Dict, List
from tdw.output_data import StaticCompositeObjects
from tdw.object_data.composite_object.sub_object.non_machine_static import NonMachineStatic
from tdw.object_data.composite_object.sub_object.light_static import LightStatic
from tdw.object_data.composite_object.sub_... | 2.34375 | 2 |
dbmirror/dbmirror_parser/__init__.py | strizhechenko/uwo-maps | 0 | 41981 | # coding=utf-8
from flask import Flask, render_template
import json
app = Flask(__name__)
@app.route('/data')
def data():
with open('./cache.json') as fd:
return json.load(fd)
@app.route('/')
def index():
_data = data()
return render_template('index.html', data=_data)
if __name__ == '__main__... | 2.515625 | 3 |
melodic/lib/python2.7/dist-packages/rqt_publisher/publisher_tree_widget.py | Dieptranivsr/Ros_Diep | 2 | 41982 | #!/usr/bin/env python
# Copyright (c) 2011, <NAME>, TU Darmstadt
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# not... | 1.398438 | 1 |
simple_page/urls.py | aprild-c/WiCS_Website_v2 | 0 | 41983 | <filename>simple_page/urls.py
from django.urls import path
from simple_page import views
urlpatterns = [
path('', views.home, name='simple_page'),
path('calendar/', views.calendar, name='simple_page'),
path('contact/', views.contact, name='simple_page'),
path('eboard/', views.eboard, name='simple_page'... | 1.804688 | 2 |
timedata/ui/switch_button.py | timedata-org/controly | 0 | 41984 | <reponame>timedata-org/controly<filename>timedata/ui/switch_button.py<gh_stars>0
from kivy.uix import togglebutton
class SwitchButton(togglebutton.ToggleButton):
def __init__(self, off, on='', **kwds):
super().__init__(text=off, **kwds)
self.texts = off, on
def on_state(self, _, value):
... | 2.171875 | 2 |
pepdb/core/migrations/0073_auto_20160213_0335.py | dchaplinsky/pep.org.ua | 7 | 41985 | <reponame>dchaplinsky/pep.org.ua<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_auto_20160210_0246'),
]
operations = [
migrations.AddField(
... | 1.671875 | 2 |
Processes/performance-forecasting/inventory-updater/tests/test_base.py | rangaswamymr/incubator-bluemarlin | 4 | 41986 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 1.921875 | 2 |
deepff/process.py | JunboLu/CP2K_kit | 16 | 41987 | #! /usr/env/bin python
import os
import linecache
import numpy as np
from collections import OrderedDict
from CP2K_kit.tools import call
from CP2K_kit.tools import data_op
from CP2K_kit.tools import file_tools
from CP2K_kit.tools import read_input
from CP2K_kit.tools import traj_info
from CP2K_kit.deepff import load_d... | 2.3125 | 2 |
spectrochempy_gui/widgets/progresswidget.py | fernandezc/spectrochempy_gui | 0 | 41988 | #!/usr/bin/env python
"""
Author: <NAME> <<EMAIL>>
License: LGPL
Note: I've licensed this code as LGPL because it was a complete translation of the code found here...
https://github.com/mojocorp/QProgressIndicator
Adapted to spectrochempy_gui
"""
import sys
from spectrochempy_gui.pyqtgraph.Qt import QtCo... | 2.015625 | 2 |
fabfile.py | isabella232/electris | 0 | 41989 | <gh_stars>0
#!/usr/bin/env python
import datetime
import json
from time import sleep
import boto
from boto.s3.key import Key
from fabric.api import *
from peewee import *
from tumblr import Api
import requests
import input as i
from models import Candidate, Race, State
import output as o
"""
Base configuration
"""
... | 2.390625 | 2 |
pkg/cortex/serve/start/async.py | wja30/cortex_0.31 | 1 | 41990 | # Copyright 2021 Cortex 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 wri... | 1.515625 | 2 |
app/queries.py | muriithiderro/wiki-farm | 1 | 41991 | <filename>app/queries.py
from .models import *
from sqlalchemy.orm import sessionmaker
from sqlalchemy import func
from geoalchemy2.shape import to_shape
from sqlalchemy.sql import select
from sqlalchemy import create_engine
import json
Base = declarative_base()
metadata = Base.metadata
engine = create_engine("post... | 2.953125 | 3 |
Lecture_6_Local_Search/Exercise4/Exercise/ga_algorithm.py | aleksander-GD/AI-F20 | 0 | 41992 | import random
from Lecture_6_Local_Search.Exercise4.Exercise import random_selction_methods
p_mutation = 0.2
num_of_generations = 30
def genetic_algorithm(population, fitness_fn, minimal_fitness):
for generation in range(num_of_generations):
print("Generation {}:".format(generation))
print_popula... | 4 | 4 |
backend/backend/helps/apps.py | Redaloukil/PackageWay | 0 | 41993 | <reponame>Redaloukil/PackageWay<gh_stars>0
from django.apps import AppConfig
class HelpsAppConfig(AppConfig):
name = "backend.helps"
verbose_name = "Helps"
def ready(self):
try:
import users.signals # noqa F401
except ImportError:
pass | 1.242188 | 1 |
main.py | maikheinrich/RSCPGui | 20 | 41994 | <filename>main.py
import logging
import argparse
import socket
import sys
parser = argparse.ArgumentParser(description='Ruft Daten von E3DC-Systemen mittels RSCP ab')
parser.add_argument('-e', '--export', const=True, default=False, nargs='?',
help='Exportstart mit Programmstart')
parser.add_argumen... | 2.859375 | 3 |
measurement/device_fridge_2d.py | Venlee11/GrapheneLab-Measurement-Code | 11 | 41995 | import time
import numpy as np
import utils.measurement_subs as measurement_subs
import utils.socket_subs as socket_subs
from .do_fridge_sweep import do_fridge_sweep
from .do_device_sweep import do_device_sweep
def device_fridge_2d(
graph_proc, rpg, data_file,
read_inst, sweep_inst=[], set_inst=[],
... | 2.890625 | 3 |
Keras_Test.py | hiyayakko0/Facing-Recognition | 0 | 41996 | <filename>Keras_Test.py
# Modules ################################################################
import os
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_utils
import numpy as np
im... | 3.125 | 3 |
Python/Programming Fundamentals/Exams/62. Treasure Hunt.py | teodoramilcheva/softuni-software-engineering | 0 | 41997 | <filename>Python/Programming Fundamentals/Exams/62. Treasure Hunt.py<gh_stars>0
def is_index_valid(i, length):
return 0 <= i < length
initial_loot = input().split('|')
while True:
line = input()
if line == 'Yohoho!':
break
command = line.split(' ', maxsplit=1)
if command[0] =... | 3.96875 | 4 |
BOJ/11000~11999/11200~11299/11285.py | shinkeonkim/today-ps | 2 | 41998 | 초성 = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
중성 = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ']
종성 = ['', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ', 'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ'... | 3.015625 | 3 |
Tools/Builder/core/performer.py | hung0913208/Base | 0 | 41999 | <reponame>hung0913208/Base
from threading import Lock
from time import sleep
from .logger import Logger, DEBUG
from .utils import update_variable_safety
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty
import subprocess
import sys
import os
class Performer(object):
d... | 2.234375 | 2 |