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 |
|---|---|---|---|---|---|---|
apps/accounts/migrations/0005_organisatons_for_user_changes.py | developersociety/commonslibrary | 4 | 12779151 | <reponame>developersociety/commonslibrary<filename>apps/accounts/migrations/0005_organisatons_for_user_changes.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-09 12:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
depe... | 1.539063 | 2 |
scripts/compile.py | martinphellwig/brython_wf | 0 | 12779152 | <reponame>martinphellwig/brython_wf<filename>scripts/compile.py
## execute this file via node.js
# $> nodejs node_bridge.js compile.py
#
# Author: <NAME>
# Date: 04/19/2013
# License: MIT
#
# This file can be used to compile python code to javascript code
# which can be used with brython.
import os
#import dis
#fixme... | 2.5625 | 3 |
week7/lecture13/test2.py | nobodysshadow/edX_MITx_6.00.1x | 622 | 12779153 | <filename>week7/lecture13/test2.py
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 12 07:17:17 2016
@author: ericgrimson
"""
#import numpy as np
import pylab as plt
mySamples = []
myLinear = []
myQuadratic = []
myCubic = []
myExponential = []
for i in range(0, 30):
mySamples.append(i)
myLinear.append(i)
... | 2.796875 | 3 |
cicd/fitnesse/fitnesseSettings.py | consag/build-and-deploy-informatica | 4 | 12779154 | # MIT License
#
# Copyright (c) 2019 <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,... | 1.445313 | 1 |
evaluate.py | existentmember7/detectron2_revise | 0 | 12779155 | import argparse
import time
import os
import numpy as np
import json
import cv2
import random
import torch
from ACID_test import test
# Setup detectron2 logger
import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
# import some common detectron2 utilities
from detectron2.model_zoo import m... | 1.96875 | 2 |
jessy/stt/witai.py | isbm/jessie | 0 | 12779156 | <reponame>isbm/jessie
# -*- coding: utf-8-*-
import os
import logging
import requests
import yaml
from jessy import jessypath
from jessy import diagnose
from jessy.stt import AbstractSTTEngine
from jessy.utils import _module_getter
def is_valid():
'''
Module validator.
'''
return True
class WitAiST... | 2.3125 | 2 |
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/user_api/migrations/0001_initial.py | osoco/better-ways-of-thinking-about-software | 3 | 12779157 | import django.core.validators
import django.utils.timezone
import model_utils.fields
from django.conf import settings
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(s... | 1.921875 | 2 |
backend/Techfesia2019/payments/tests.py | masterashu/Techfesia2019 | 1 | 12779158 | import datetime as dt
from json import dumps as json_dumps
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from registration.models import User
from events.models import SoloEvent
from event_registrations.models import SoloEventRegistration
from payments.mod... | 2.0625 | 2 |
767.py | wilbertgeng/LeetCode_exercise | 0 | 12779159 | <gh_stars>0
"""767. Reorganize String"""
class Solution(object):
def reorganizeString(self, S):
"""
:type S: str
:rtype: str
"""
res = []
s = Counter(S)
pq = []
for key, value in s.items():
pq.append((-value, key))
heapq.heapify(pq... | 3.171875 | 3 |
govuk_bank_holidays/bank_holidays.py | ministryofjustice/govuk-bank-holidays | 19 | 12779160 | <reponame>ministryofjustice/govuk-bank-holidays
import datetime
import functools
import gettext
import json
import logging
import os
import requests
__all__ = ('BankHolidays',)
logger = logging.getLogger(__name__)
class BankHolidays:
"""
Tool to load UK bank holidays from GOV.UK (see https://www.gov.uk/bank... | 3.109375 | 3 |
chatterbox/settings.py | blitzagency/django-chatterbox | 8 | 12779161 | <reponame>blitzagency/django-chatterbox
# DJANGO IMPORTS
from django.conf import settings
# Admin Site Title
AUTO_APPROVE = getattr(settings, "CHATTERBOX_AUTO_APPROVE", True)
SUCCESS_REDIRECT_URL = getattr(settings,
"CHATTERBOX_SUCCESS_REDIRECT_URL",
'/adm... | 1.40625 | 1 |
setting.py | okboy32/anjukeSpider | 0 | 12779162 | <reponame>okboy32/anjukeSpider<gh_stars>0
# mysql配置
DB = 'anjuke'
USER = 'root'
PASSWORD = '<PASSWORD>'
HOST = 'localhost'
PORT = 3306
# 爬取城市
citys = {
# '苏州': 'suzhou',
# '北京': 'bj',
# '天津': 'tj',
# '大连': 'dl',
# '石家庄': 'sjz',
# '哈尔滨': 'heb',
# '沈阳': 'sy',
# '太原': 'ty',
# '长春': '... | 1.453125 | 1 |
utils/send_data.py | e0xextazy/dog_breeds_clf | 1 | 12779163 | import requests
image = {'image': open('data/test_photo.jpeg', 'rb').read()}
r1 = requests.get("http://0.0.0.0:5000/")
print(r1.text)
r2 = requests.post("http://localhost:5000/get_prob", files=image)
print(r2.text) # "Male" or "Female" | 2.9375 | 3 |
phishing/phishing-HTML-linter.py | H1d3r/Penetration-Testing-Tools-1 | 6 | 12779164 | <reponame>H1d3r/Penetration-Testing-Tools-1
#!/usr/bin/python3
import os, sys, re
import string
import argparse
import yaml
import textwrap
import json
from urllib import parse
from bs4 import BeautifulSoup
options = {
'format' : 'text',
}
executable_extensions = [
'.exe',
'.dll',
'.lnk',
'.scr',... | 2.1875 | 2 |
gitvier/common.py | MasterOdin/gitvier | 2 | 12779165 | <filename>gitvier/common.py
import subprocess
def get_input(question, default=""):
add = "[{}] ".format(default) if default != "" else ""
user = input("{}: {}".format(question, add)).strip()
if user == "":
user = default
return user
def get_yes(question, yes=False):
user = input("{}: [{}... | 3.15625 | 3 |
gsem/config.py | andriykohut/gsem | 13 | 12779166 | <filename>gsem/config.py
import os
from gsem.utils import gnome_shell_version
EXTENSION_DIR = os.path.expanduser("~/.local/share/gnome-shell/extensions")
GNOME_SHELL_VERSION = gnome_shell_version()
API_ROOT = "https://extensions.gnome.org"
API_DETAIL = f"{API_ROOT}/ajax/detail"
API_SEARCH = f"{API_ROOT}/extension-qu... | 1.648438 | 2 |
modules/QQqt4/exprobot.py | earlybackhome/You-cannot-guess | 21 | 12779167 | #!/usr/bin/env python
# coding=utf-8
from PyQt4.QtCore import *
import requests
import re, os
from OCR import Image2txt
from PIL import Image
class backEnd(QThread):
finish_signal = pyqtSignal(str, bool)
def __init__(self, txt):
super(backEnd, self).__init__()
self.txt = txt
def run(self):
path = '../OCR/te... | 2.53125 | 3 |
Machine Learning/Lab/lab02/knn/knn.py | jJayyyyyyy/USTC-2018-Smester-1 | 32 | 12779168 | <filename>Machine Learning/Lab/lab02/knn/knn.py
'''
1. 预处理
1.1 [done] 标准化
1.2 [done] 按比例,随机分割训练集、测试集
2. knn
2.1 输入一个测试样本 x
2.2 计算 x 与所有 train_x 的距离, 排序
2.3 取前 k 个 train_x, 即最近的 k 个, 统计 label(即 train_y)
2.4 取数量最大的 label 作为 x 的 label
'''
import numpy as np
class Dataset(object):
def __init__(self... | 3.421875 | 3 |
cs15211/BulbSwitcher.py | JulyKikuAkita/PythonPrac | 1 | 12779169 | __source__ = 'https://leetcode.com/problems/bulb-switcher/description/'
# Time: O(1)
# Space: O(1)
#
# Description: Leetcode # 319. Bulb Switcher
#
# There are n bulbs that are initially off.
# You first turn on all the bulbs.
# Then, you turn off every second bulb.
# On the third round, you toggle every third bulb (t... | 4.1875 | 4 |
curso em video - Phython/desafios/desafio 12.py | ThyagoHiggins/LP-Phython | 0 | 12779170 | preco= float(input('Informe o preço o produto: R$ '))
print(f'O produto com preço original de R${preco} com desconto de 5% passar a ser R${preco*0.95:.2f}') | 3.65625 | 4 |
setup.py | locationlabs/confab | 3 | 12779171 | <filename>setup.py<gh_stars>1-10
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
# Workaround for running "setup.py test"
# See: http://bugs.python.org/issue15881
try:
import multiprocessing # noqa
except ImportError:
pass
__version__ = '1.7.2'
# Jenkins will replace __build__ w... | 1.5625 | 2 |
setup.py | thiwankajayasiri/Airband-_V | 0 | 12779172 | from setuptools import setup
setup(
name='V16_API',
packages=['V16_API'],
include_package_data=True,
install_requires=[
'flask', 'flask-bootstrap', 'flask-nav', 'pyserial', 'flask_wtf', 'gunicorn'
],
)
| 1.109375 | 1 |
setup.py | typemytype/defcon | 0 | 12779173 | <reponame>typemytype/defcon
#!/usr/bin/env python
import sys
from distutils.core import setup
try:
import fontTools
except:
print "*** Warning: defcon requires FontTools, see:"
print " fonttools.sf.net"
try:
import robofab
except:
print "*** Warning: defcon requires RoboFab, see:"
print " ... | 1.992188 | 2 |
util.py | VictorZXY/function-autoencoder | 0 | 12779174 | import torch.nn as nn
from matplotlib import pyplot as plt
def MLP(input_dim, out_dims):
"""
Creates an MLP for the models.
:param input_dim: Integer containing the dimensions of the input (= x_dim + y_dim).
:param out_dims: An iterable containing the output sizes of the layers of the MLP.
:retur... | 3.703125 | 4 |
kerasy/engine/base_layer.py | iwasakishuto/Keras-Imitation | 4 | 12779175 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from ..utils.generic_utils import get_uid
class Layer():
"""Abstract base layer class."""
def __init__(self, **kwargs):
self._trainable_weights = []
self._non_trainable_weights = []
self._grads = {} # (... | 2.796875 | 3 |
parkkeeper/tests/test_models.py | telminov/django-park-keeper | 4 | 12779176 | # coding: utf-8
from django.test import TestCase
from djutils.testrunner import TearDownTestCaseMixin
from parkkeeper import models
from parkkeeper import factories
class BaseTaskTestCase(TearDownTestCaseMixin, TestCase):
def tearDown(self):
self.tearDownMongo()
def test_get_task_model_monit(self):... | 2.1875 | 2 |
Application/cdpapp/views.py | Adi1222/Customer-Data-Protection | 0 | 12779177 | import simplejson
from MySQLdb._exceptions import IntegrityError
from django.shortcuts import render, redirect, reverse, get_object_or_404, get_list_or_404, _get_queryset
from django.contrib.auth import login, logout, authenticate
from .forms import *
from django.core import serializers
from django.http import HttpResp... | 1.90625 | 2 |
setup.py | benlindsay/sim-tree | 0 | 12779178 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 <NAME> <<EMAIL>>
from distutils.core import setup
setup(
name = 'sim-tree',
packages = ['sim_tree'], # this must be the same as the name above
install_requires = ['os', 'pandas', 'time', 'string'],
version = '0.6',
description = 'A module f... | 1.101563 | 1 |
atx/record/scene_detector.py | jamjven/ATX | 1,132 | 12779179 | #-*- encoding: utf-8 -*-
import os
import cv2
import yaml
import numpy as np
from collections import defaultdict
def find_match(img, tmpl, rect=None, mask=None):
if rect is not None:
h, w = img.shape[:2]
x, y, x1, y1 = rect
if x1 > w or y1 > h:
return 0, None
... | 2.453125 | 2 |
description/funcmap.py | shelljane/FastCGRA | 4 | 12779180 | <reponame>shelljane/FastCGRA
from networkx.algorithms.operators.unary import reverse
import xmltodict
import json
import networkx as nx
from networkx.algorithms import isomorphism as iso
import utils
from utils import Base
from protocols import *
class IsoMapper(Base):
def __init__(self, graph, units)... | 2.4375 | 2 |
run-format-converter.py | bruno-ferreira/run-format-converter | 0 | 12779181 | <reponame>bruno-ferreira/run-format-converter
#!/usr/bin/env python
"""docstring"""
import os
from xml.etree import ElementTree as ET
import argparse
# create a class that opens and reads any xml format
# pwx
# gpx
# etc
# json
class OpenXMLFile(object):
"""docstring"""
def open(self):
tree = ET.p... | 3.3125 | 3 |
services/storage/src/simcore_service_storage/dsm.py | colinRawlings/osparc-simcore | 25 | 12779182 | <reponame>colinRawlings/osparc-simcore
# pylint: disable=no-value-for-parameter
# FIXME: E1120:No value for argument 'dml' in method call
# pylint: disable=protected-access
# FIXME: Access to a protected member _result_proxy of a client class
import asyncio
import logging
import os
import re
import tempfile
from colle... | 1.726563 | 2 |
services/traction/acapy_wrapper/models/cred_attr_spec.py | Open-Earth-Foundation/traction | 12 | 12779183 | # coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
class CredAttrSpec(BaseModel):
"""NOTE: This class is... | 2.109375 | 2 |
devops_spt/external_dependency.py | dksmiffs/devops | 0 | 12779184 | <gh_stars>0
"""External dependency management module"""
from abc import ABC, abstractmethod
class ExternalDependency(ABC):
"""Define interface for managing external dependencies"""
@abstractmethod
def existing(self):
"""
Return installed version
OR, set existing = None in subclass... | 2.9375 | 3 |
pbsmmapi/asset/models.py | WGBH/django-pbsmmapi | 0 | 12779185 | <reponame>WGBH/django-pbsmmapi<filename>pbsmmapi/asset/models.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ..abstract.models import PBSMMGenericAsset
from .helpers import check_asset_availabilit... | 2.1875 | 2 |
jwt_devices/middleware.py | poxip/drf-jwt-devices | 13 | 12779186 | from django.http.response import JsonResponse
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from jwt_devices import views
from jwt_devices.settings import api_settings
class PermittedHeadersMiddleware(object):
"""
Middleware used to disallow sending the permanent_t... | 2.140625 | 2 |
reader/migrations/0005_categories.py | a-mere-peasant/MangAdventure | 0 | 12779187 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('reader', '0004_float_numbers')]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.CharField(
auto_created=True, p... | 2.0625 | 2 |
main/PythonTools/LoewnerRunFactory.py | ucapdak/loewner | 0 | 12779188 | from Constants import CONST_IDX, LINR_IDX, KAPPA_IDX, CALPHA_IDX, SQRTPLUS_IDX, EXACT_CUBIC_CONSTANT, STANDARD_IDXS, CUBIC_EXACT_IDXS, QUADRATIC_FORWARD_EXACT_IDXS, NOTORIGIN_IDXS
from LoewnerRun import LoewnerRun, ConstantLoewnerRun, LinearLoewnerRun, KappaLoewnerRun, CAlphaLoewnerRun, SqrtTPlusOneLoewnerRun
class Lo... | 2.34375 | 2 |
bitcoin/exchange.py | darbik/work | 0 | 12779189 | <reponame>darbik/work
def buy_bitcoin(price):
amount = int(raw_input("How much do you want to buy?"))
if amount > 500 or amount < 5:
while amount > 500 or amount < 5:
amount = int(raw_input("Sorry please try another amount between $5 and $500."))
amount = ('buy', amount)
r... | 3.859375 | 4 |
libraryproject/profiles/forms.py | elotgamu/libraryproject | 0 | 12779190 | <gh_stars>0
from django import forms
from .models import Visitor, Student, Librarian
class VisitorsForm(forms.ModelForm):
class Meta:
model = Visitor
fields = ('address',
'phone',
'id_card'
)
class StudentForm(forms.ModelForm):
class M... | 2.21875 | 2 |
2021_CPS_festival/test.py | yehyunchoi/Algorithm | 0 | 12779191 | <gh_stars>0
def f() :
for i in range(1, 10):
print((i * 2 + 5) * 50 +1771 - 1994)
| 2.828125 | 3 |
bot.py | pixley/discord-audio-pipe | 1 | 12779192 | <reponame>pixley/discord-audio-pipe
import sound
import discord
import logging
import config
from discord.ext import commands
class Dap_Bot(commands.Bot):
def __init__(self, command_prefix):
commands.Bot.__init__(self, command_prefix)
# discord.AudioSource stream
self.stream = None
# int device_id
self.devi... | 2.640625 | 3 |
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/waffle_utils/testutils.py | osoco/better-ways-of-thinking-about-software | 3 | 12779193 | """
Test utilities for waffle utilities.
"""
# Can be used with FilteredQueryCountMixin.assertNumQueries() to blacklist
# waffle tables. For example:
# QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES
# with self.assertNumQueries(6, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
WAFFLE_TABLES = [
"waffle_utils_waffl... | 2.03125 | 2 |
LeetCode/Python/two_sum.py | tejeshreddy/competitive-programming | 0 | 12779194 | """
Title: 0001 - Two Sum
Tags: Hash Table
Time: O(n)
Space: O(n)
Source: https://leetcode.com/problems/two-sum/
Difficulty: Easy
"""
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
hmap = {}
for i, v in enumerate(nums):
diff = target - v
if diff... | 3.546875 | 4 |
services/gps/NmeaSerialGps.py | robisen1/AndroidWifiCracker | 19 | 12779195 | #!/usr/bin/env python
from serial import Serial
from threading import Thread
import time
from NmeaEvents import NmeaEventSource
import NmeaParser
import NmeaSentences
class NmeaSerialGps(NmeaEventSource):
"""A NMEA GPS device that is connected via a serial connection"""
def __init__(self, port, baudrate ... | 3.203125 | 3 |
greatbigcrane/urls.py | pnomolos/greatbigcrane | 3 | 12779196 | """
Copyright 2010 <NAME>, <NAME>, and <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 agreed to in writing... | 1.625 | 2 |
Makro Keyboard for PC/deviceConfig.py | erenterzioglu/Macro-Keyboard | 3 | 12779197 | from serial import *
import serial.tools.list_ports
#import serial.tools.list_ports
import jsonConfig as j
import time
#connected_devices=[""]
def serialConnection(values,device):
print("hi ")
print("serialConnection()")
print("values: {} , port: {}".format(values,device))
#c_number=getDev... | 3 | 3 |
a10sdk/core/authentication/authentication_console.py | deepfield/a10sdk-python | 16 | 12779198 | from a10sdk.common.A10BaseClass import A10BaseClass
class TypeCfg(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param console_type: {"enum": ["ldap", "local", "radius", "tacplus"], "type": "string", "format": "enum-list"}
:param type: {"default": 0, "type": "numbe... | 2.1875 | 2 |
auth_service/__init__.py | yoophi/auth-service | 0 | 12779199 | <gh_stars>0
import logging.config
from datetime import datetime
from flask import Flask
from flask_social_login import SQLAlchemyConnectionDatastore
from auth_service.database import db, migrate
from auth_service.extensions import cors, ma
from auth_service.oauth2 import config_oauth
from .config import config
from .... | 2.046875 | 2 |
src/endpoints/email.py | alexfrunza/FiiPractic-Flask-API-2021 | 0 | 12779200 | <reponame>alexfrunza/FiiPractic-Flask-API-2021<gh_stars>0
from flask import request, Blueprint, Response
from src.models.user import User
from src.utils.decorators import http_handling, session, is_authorized
email_bp = Blueprint('email', __name__, url_prefix="")
@email_bp.route('/email-confirmation', methods=["GET... | 2.46875 | 2 |
web/blog/comments/views.py | BumagniyPacket/django-blog | 2 | 12779201 | <filename>web/blog/comments/views.py
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import CreateView, DeleteView, UpdateView
from blog.comments.forms import CommentForm
from blog.comments.models import Comment
class CommentApproveView(LoginRequiredMixin, UpdateView):
model =... | 2.015625 | 2 |
fromconfig_yarn/__init__.py | criteo/fromconfig-yarn | 0 | 12779202 | # pylint: disable=unused-import,missing-docstring
from fromconfig_yarn.launcher import YarnLauncher
| 1.078125 | 1 |
util/fung_metrics.py | eliagbayani/local_reference_taxonomy | 8 | 12779203 | <filename>util/fung_metrics.py
from org.opentreeoflife.taxa import Taxonomy
"""
Usage:
from org.opentreeoflife.taxa import Taxonomy
ott = Taxonomy.getTaxonomy('tax/ott2.8/')
import fung_metrics
fung = ott.select('Fungi')
fung.analyze()
fung_metrics.doit(fung)
"""
def doit(fung):
internal = 0
tips = 0
spe... | 2.671875 | 3 |
nezzle/graphics/edges/edgeconverter.py | dwgoon/nezzle | 2 | 12779204 | <filename>nezzle/graphics/edges/edgeconverter.py
from typing import AnyStr
from typing import Union
from typing import Type
from nezzle.graphics.edges.baseedge import BaseEdge
from nezzle.graphics.edges.edgefactory import EdgeClassFactory
class EdgeConverter(object):
@staticmethod
def convert(edge: BaseEdge... | 2.265625 | 2 |
bb-master/sandbox/lib/python3.5/site-packages/buildbot/steps/download_secret_to_worker.py | Alecto3-D/testable-greeter | 2 | 12779205 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | 1.789063 | 2 |
docs/conf.py | AleCandido/opale | 0 | 12779206 | from datetime import datetime
extensions = []
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = u"Opale"
year = datetime.now().year
copyright = u"%d <NAME> " % year
exclude_patterns = ["_build"]
html_theme = "opale"
html_sidebars = {
"**": [
"about.html",
"na... | 1.695313 | 2 |
anime/migrations/0004_auto_20210812_1612.py | AniLite/API-v1.2 | 2 | 12779207 | <reponame>AniLite/API-v1.2
# Generated by Django 3.2.6 on 2021-08-12 10:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('anime', '0003_anime_episode_summary'),
]
operations = [
migrations.AlterModelOptions(
name='genre',
... | 1.898438 | 2 |
train.py | KimMeen/DCRNN | 4 | 12779208 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 10 22:27:03 2020
@author: <NAME>
"""
import math
import tqdm
import torch
import torch.nn as nn
import pandas as pd
import numpy as np
import utils
from net import DCRNNModel
# import sys
# sys.path.append("./xlwang_version")
# from dcrnn_model import DCRNNModel
"""
H... | 1.898438 | 2 |
setup.py | WesBAn/kivy_python_checkers | 0 | 12779209 | <filename>setup.py
import setuptools
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='kivy_python_checkers',
version='0.8',
url='https://github.com/WesBAn/kivy_python_checkers',
license='MIT License',
author='mcwesban',
author_email... | 1.476563 | 1 |
frocket/common/tasks/registration.py | DynamicYieldProjects/funnel-rocket | 56 | 12779210 | """
Task request/response classes for the registration job (discovering, validating and storing metadata for a dataset)
"""
# Copyright 2021 The Funnel Rocket Maintainers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ... | 2.046875 | 2 |
luna/interaction/fp/fingerprint.py | keiserlab/LUNA | 2 | 12779211 | import numpy as np
from rdkit.DataStructs.cDataStructs import ExplicitBitVect, SparseBitVect
from scipy.sparse import issparse, csr_matrix
from collections import defaultdict
from rdkit import DataStructs
from luna.util.exceptions import (BitsValueError, InvalidFingerprintType, IllegalArgumentError, FingerprintCountsE... | 2.140625 | 2 |
testing/main.py | igit-cn/edgex-ui-go | 0 | 12779212 | from pages.driver import Driver
from pages.login import LoginPage
from pages.addNewDevice import AddNewDevice
from pages.devicesvc import DeviceService
from pages.appsvc import AppService
from pages.scheduler import Scheduler
from pages.notification import Notification
from pages.config import Config
import time
if __... | 2.0625 | 2 |
depthy/stereo/feature_methods.py | mfkiwl/depthy | 14 | 12779213 | <reponame>mfkiwl/depthy
import sys
import time as t
import numpy as np
from depthy.misc import Normalizer
def compute_census(img_l: np.ndarray = None, img_r: np.ndarray = None, offset: int = 7) -> (np.ndarray, np.ndarray):
"""
Census feature extraction (for more details see https://en.wikipedia.org/wiki/Cens... | 2.671875 | 3 |
Giveme5W1H/extractor/extractors/action_extractor.py | bkrrr/Giveme5W | 410 | 12779214 | <reponame>bkrrr/Giveme5W
import re
from nltk.tree import ParentedTree
from Giveme5W1H.extractor.candidate import Candidate
from Giveme5W1H.extractor.extractors.abs_extractor import AbsExtractor
class ActionExtractor(AbsExtractor):
"""
The ActionExtractor tries to extract the main actor and his action.
... | 2.875 | 3 |
src/mcedit2/util/settings.py | elcarrion06/mcedit2 | 673 | 12779215 | <gh_stars>100-1000
"""
settings
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
from PySide import QtCore
import logging
from mcedit2.util import directories
log = logging.getLogger(__name__)
_settings = None
def Settings():
global _settings
i... | 2.21875 | 2 |
measurements/signals.py | nat64check/zaphod_backend | 1 | 12779216 | <reponame>nat64check/zaphod_backend<filename>measurements/signals.py
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Copyright (c) 2018, <NAME>. This software is licensed under the BSD
# 3-Clause License. Please see the LICENSE file in the project root directory.
# •••••••••••••••••... | 1.835938 | 2 |
rhcephpkg/localbuild.py | red-hat-storage/rhcephpkg | 2 | 12779217 | <gh_stars>1-10
import math
from multiprocessing import cpu_count
import os
import re
import subprocess
from tambo import Transport
import rhcephpkg.log as log
import rhcephpkg.util as util
def setup_pbuilder_cache(pbuilder_cache, distro):
# Delete existing cache file if it is bogus (zero-length).
if os.path.i... | 2.140625 | 2 |
Training - Testing/main_plus.py | beric7/material_segmentation | 0 | 12779218 | import torch.optim as optim
from sklearn.metrics import roc_auc_score, f1_score, jaccard_score
from model_plus import createDeepLabv3Plus
import sys
print(sys.version, sys.platform, sys.executable)
from trainer_plus import train_model
import datahandler_plus
import argparse
import os
import torch
import numpy
torch.cu... | 2.203125 | 2 |
app/celery_worker/tasks.py | newbieof410/dockerize-flask-celery | 1 | 12779219 | <gh_stars>1-10
import time
from app.celery_worker import celery
@celery.task
def long_time_task():
print('task begins')
time.sleep(10)
print('task finished')
| 2.125 | 2 |
feishu/api_id.py | crisone/feishu-python-sdk | 44 | 12779220 | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from typing import TYPE_CHECKING, Tuple
from feishu.exception import LarkInvalidArguments, OpenLarkException
if TYPE_CHECKING:
from feishu.api import OpenLark
# https://open.feishu.cn/document/ukTMukTMukTM/uIzMx... | 2.140625 | 2 |
NewsPaperD7(final)/NewsPaper/News/migrations/0003_auto_20210415_2224.py | GregTMJ/django-files | 1 | 12779221 | <filename>NewsPaperD7(final)/NewsPaper/News/migrations/0003_auto_20210415_2224.py
# Generated by Django 3.2 on 2021-04-15 19:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('News', '0002_auto_20210415_2208'),
]
... | 1.632813 | 2 |
bin/Python27/Lib/site-packages/scipy/linalg/__init__.py | lefevre-fraser/openmeta-mms | 0 | 12779222 | """
====================================
Linear algebra (:mod:`scipy.linalg`)
====================================
.. currentmodule:: scipy.linalg
Linear algebra functions.
.. seealso::
`numpy.linalg` for more linear algebra functions. Note that
although `scipy.linalg` imports most of them, ident... | 2.375 | 2 |
Algorithm/BreadthFirstDirectedPaths.py | eroicaleo/LearningPython | 1 | 12779223 | <reponame>eroicaleo/LearningPython
#!/usr/bin/env python3
import math
from collections import deque
from Digraph import Digraph
class BreadthFirstDirectedPaths:
def __init__(self, G, sources):
self.marked = [0]*G.V
self.edgeTo = [0]*G.V
self.distTo = [math.inf]*G.V
self.validateVer... | 3.390625 | 3 |
Dataset/Leetcode/train/62/553.py | kkcookies99/UAST | 0 | 12779224 | <reponame>kkcookies99/UAST<filename>Dataset/Leetcode/train/62/553.py
class Solution:
def XXX(self, m: int, n: int) -> int:
ans = [[1 for _ in range(m)] for _ in range(n)]
for i in range(1,m):
for j in range(1,n):
ans[j][i] = ans[j][i-1] + ans[j-1][i]
return ans[-1... | 2.96875 | 3 |
tests/utils/singleton_provider.py | BoaVaga/boavaga_server | 0 | 12779225 | from dependency_injector.providers import Singleton
def singleton_provider(obj):
def clb():
return obj
return Singleton(clb)
| 1.90625 | 2 |
1601-1700/1681-Minimum Incompatibility/1681-Minimum Incompatibility.py | jiadaizhao/LeetCode | 49 | 12779226 | import math
import itertools
class Solution:
def minimumIncompatibility(self, nums: List[int], k: int) -> int:
n = len(nums)
if k == n:
return 0
dp = [[math.inf] * n for _ in range(1 << n)]
nums.sort()
for i in range(n):
dp[1<<i][i] = 0
for m... | 2.8125 | 3 |
tests/unit_tests/test_cli.py | JoelLefkowitz/poetry-pdf | 1 | 12779227 | import sys
from typing import List
from unittest.mock import patch
import pytest
from poetry_pdf.cli import parse_cli
from poetry_pdf.exceptions import InvalidCommand, InvalidSourcePath
@pytest.mark.parametrize(
"argv",
[
["poetry-pdf", "tests/fixtures/the_raven.txt"],
[
"poetry-p... | 2.421875 | 2 |
intro.py | rmkaneko/pythonbirds-fatec | 0 | 12779228 | <reponame>rmkaneko/pythonbirds-fatec<filename>intro.py
def p():
"""
Essa funcao faz balh
:return: não retorna nada
"""
print('Renzo'.upper())
print(__name__)
if __name__ == '__main__':
print('Main')
def f(nome, sobrenome='<NAME>', idade=32):
return 'Olá %s %s. Minha idade é: %s'... | 2.625 | 3 |
subreddit-gauge/grab.py | maybemaby/subreddit-gauge | 1 | 12779229 | #! python3
# Uses praw to pull data about subreddits.
import praw
from credentials import ( # create your own credentials file
client_id,
client_secret,
reddit_password,
useragent,
reddit_username,
)
# praw object
reddit = praw.Reddit(
client_id=client_id,
client_secret=client_secret,
... | 3.078125 | 3 |
budgetee-server/src/common/helper.py | SPQE21-22/BSPQ22-E2 | 0 | 12779230 | <filename>budgetee-server/src/common/helper.py
"""! @package common"""
import re
from uuid import UUID
under_pat = re.compile(r'_([a-z])')
def camelize(name):
"""! It gets a string with _ and it converts it into camelized
nombre_variable => nombreVariable
@param variable string
@return variable cameli... | 2.65625 | 3 |
Python/SCRIPT PYTHON/Media_Notas.py | guimaraesalves/material-python | 0 | 12779231 | print ('==================================')
print (' EXERCÍCIO MÉDIA DAS NOTAS ')
print ('==================================')
n1 = int (input('INFORME A PRIMEIRA NOTA: '))
n2 = int (input('INFORME A SEGUNDA NOTA: '))
n3 = int (input('INFORME A TERCEIRA NOTA: '))
n4 = int (input('INFORME A QUARTA NOTA: '))
... | 3.796875 | 4 |
src/rstatmon/usermodel.py | git-ogawa/raspi-statmon | 0 | 12779232 | import sys
import shutil
import json
import subprocess
from typing import Union
from pathlib import Path
from jinja2 import Template
class UserModel():
"""Handles user-defined model described in python scripts.
"""
def __init__(self):
self.parent = Path(__file__).resolve().parent
self.dst... | 2.46875 | 2 |
bin/snv_filter_1000genome.py | ChiLoveChuan/iTuNES-dev | 1 | 12779233 | import pandas as pd
import numpy as np
import sys,getopt,os
import re
#####prepare fasta format input file for netMHC######
opts,args=getopt.getopt(sys.argv[1:],"hi:g:o:s:",["input_vcf_file","input_snv_1000G_file","out_dir","sample_id"])
input_vcf_file=""
input_snv_1000G_file =""
out_dir=""
sample_id=""
USAGE='''
This... | 2.4375 | 2 |
config.py | SdeWit/stereotypes-cs | 5 | 12779234 | <reponame>SdeWit/stereotypes-cs
# pylint: disable=too-few-public-methods
"""
Module with different configuration options for the flask application
"""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
"""
Parent class for different configurations.
Defines default values... | 2.046875 | 2 |
tinylocker/utils/account.py | dragmz/tinylock_py | 4 | 12779235 | <filename>tinylocker/utils/account.py
from typing import Any, Dict, List
from algosdk import account, mnemonic
from algosdk.v2client.algod import AlgodClient
class Account:
"""Represents a private key and address for an Algorand account"""
def __init__(self, privateKey: str) -> None:
self.sk = privat... | 2.90625 | 3 |
forum/migrations/0001_initial.py | mapehe/mlp-forum | 0 | 12779236 | # Generated by Django 3.2.7 on 2021-10-03 21:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.867188 | 2 |
CRUDFilters/tests/views.py | timhaley94/django-crud-filters | 5 | 12779237 | from django.http import HttpResponse
from rest_framework import permissions
from CRUDFilters.views import CRUDFilterModelViewSet
from .models import TestClass
from .serializers import TestClassSerializer
class TestClassViewset(CRUDFilterModelViewSet):
serializer_class = TestClassSerializer
crud_model = Test... | 2.1875 | 2 |
create_facehq.py | Manan1811/FaceNet-Model | 1 | 12779238 | import os
from PIL import Image
from models.model import model
import argparse
import numpy as np
import tensorflow as tf
import shutil
def create(args):
if args.pre_trained == 'facenet':
from models.Face_recognition import FR_model
FR = FR_model()
Model = tf.keras.models.load_model(args.s... | 2.46875 | 2 |
nodular/registry.py | hasgeek/nodular | 0 | 12779239 | # -*- coding: utf-8 -*-
"""
The node registry is a place to list the relationships between node types
and their views.
Nodular does *not* provide a global instance of :class:`NodeRegistry`. Since
the registry determines what is available in an app, registries should be
constructed as app-level globals.
"""
from insp... | 2.46875 | 2 |
venv/Lib/site-packages/tqdm/_dist_ver.py | mintzer/pupillometry-rf-back | 0 | 12779240 | __version__ = '4.63.1'
| 1.085938 | 1 |
scanners/zap-advanced/scanner/tests/test_zap_spider_http.py | kevin-yen/secureCodeBox | 488 | 12779241 | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2021 iteratec GmbH
#
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
import pytest
from unittest.mock import MagicMock, Mock
from unittest import TestCase
from zapclient.configuration import ZapConfiguration
class ZapSpiderHttpTests(TestCase):
@py... | 2.015625 | 2 |
scan_cities.py | jo-wen/city_crawl | 0 | 12779242 | #!/usr/bin/env python3
"""
This script doesn't work as is (and is written dumbly), but has all the pieces I used to organize the data.
parsing a csv file from https://simplemaps.com/data/us-cities
checks if each city has:
1) a .gov site
2) a .us site
3) a .com site
4) includes http and https entries
... | 3.90625 | 4 |
Project/proj.packaging/src/Unity.py | luxiaodong/Game | 1 | 12779243 | # -*- coding: utf-8 -*-
import sys
import os
UNITY_PATH = "/Applications/Unity/Hub/Editor/2019.4.18f1c1/Unity.app/Contents/MacOS/Unity"
class Unity(object):
# @staticmethod
# def SwitchPlatorm()
# @staticmethod
# def GeneratorWrapCode():
# Unity.ExecuteScript("CSObjectWrapEditor.Generator", "ClearAll")
# Un... | 2.34375 | 2 |
nbs/matricula.py | ronaldokun/cpm-joao-XXIII | 0 | 12779244 | <gh_stars>0
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import pandas as pd... | 2.4375 | 2 |
utool/util_tags.py | Erotemic/utool | 8 | 12779245 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import six
import re
import operator
from utool import util_inject
print, rrr, profile = util_inject.inject2(__name__)
def modify_tags(tags_list, direct_map=None, regex_map=None, regex_aug=None,
... | 2.34375 | 2 |
wine.py | athena15/knn | 1 | 12779246 | <reponame>athena15/knn<filename>wine.py
import knn
import numpy as np
import pandas as pd
import requests
from io import StringIO
# Adding a note so I can commit changes
# Import wine classification data from UC Irvine's website
col_names = ['Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash', 'Magnesium', 'Total phe... | 3.265625 | 3 |
scripts/clean_data.py | alvesmatheus/fala-camarada | 7 | 12779247 | <gh_stars>1-10
import os
import re
import pandas as pd
RAW_DATA_DIR_PATH = 'data/raw'
READY_DATA_DIR_PATH = 'data/ready'
RAW_COMMITTEE_SCHEDULE_PATH = 'data/raw/agenda_comissoes.csv'
READY_COMMITTEE_SCHEDULE_PATH = 'data/ready/metadados_transcricoes.csv'
TARGET_YEARS = [year for year in range(1995, 2022)]
def fix... | 2.859375 | 3 |
app.py | cadullms/pyminemap | 0 | 12779248 | import mcpi.minecraft as minecraft
from flask import render_template
from flask import Flask
from flask import jsonify
app = Flask(__name__)
@app.route('/')
def pyminemapIndex():
return render_template('index.html')
@app.route('/list')
def pyminemapList():
try:
positionstexte = []
mc = minecra... | 2.765625 | 3 |
Lang.py | codedecde/Recognizing-Textual-Entailment | 36 | 12779249 | from __future__ import unicode_literals, print_function, division
from collections import Counter
from nltk.tokenize import TweetTokenizer
import cPickle as cp
import io
import numpy as np
PAD_TOKEN = 0
SOS_TOKEN = 1
EOS_TOKEN = 2
VOCAB_SIZE = 10000
class Lang(object):
def __init__(self, name, lowercase=True,... | 2.625 | 3 |
apis/utils/constants.py | kothiyayogesh11/yk11_api | 0 | 12779250 | <filename>apis/utils/constants.py
# User related settings
USER_TYPE = "Vendor"
# Email Settings
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = '<EMAIL>'
MAIL_PASSWORD = '<PASSWORD>'
# Server URLS
NOTIFACTION_CLIENT = "http://api.notifications.wellnessta.in/api... | 1.453125 | 1 |