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 |
|---|---|---|---|---|---|---|
webapp/models/req_error_log.py | myfreshcity/mystock | 2 | 39700 | from datetime import datetime
from webapp.services import db
class ReqErrorLog(db.Model):
__tablename__ = 'req_error_log'
id = db.Column(db.Integer, primary_key=True)
action = db.Column(db.String(50))
key = db.Column(db.String(255))
msg = db.Column(db.String(2000))
created_time = db.Column(d... | 2.390625 | 2 |
frappe-bench/apps/erpnext/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.py | Semicheche/foa_frappe_docker | 1 | 39701 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SupplierScorecardStanding(Document):
pass
@frappe.whitelist()
def get... | 2.375 | 2 |
Server/Protocol/Messages/Server/LoginOkMessage.py | Voeed/Brawl-stars-v11 | 3 | 39702 | <gh_stars>1-10
from DataStream.ByteStream import ByteStream
from Logic.Player import Player
class LoginOkMessage(ByteStream):
def __init__(self, client, player):
super().__init__(client)
self.id = 20104
self.version = 1
self.player = player;
def encode(self):
... | 2.671875 | 3 |
cronjob/python/Loan_bak_-13122019_1118AM/saveDPWorkingDay.py | heodat234/worldfone4xs_ibm | 0 | 39703 | #!/usr/bin/python3.6
# -*- coding: utf-8 -*-
import re
import ftplib
import calendar
import time
import sys
import os
import json
from pprint import pprint
from datetime import datetime
from datetime import date, timedelta
from bson import ObjectId
from helper.ftp import Ftp
from helper.mongod import Mo... | 2.03125 | 2 |
backend/hqlib/metric_source/issue_log/jira_action_list.py | ICTU/quality-report | 25 | 39704 | <filename>backend/hqlib/metric_source/issue_log/jira_action_list.py
"""
Copyright 2012-2019 <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
Un... | 2.421875 | 2 |
salt/urls.py | mentix02/Saltan | 4 | 39705 | <reponame>mentix02/Saltan
from django.conf.urls import url, include
from . import views, salt
from django.contrib.auth.views import logout
app_name = 'salt'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^visitor/', include('salt.visitor_urls')),
url(r'^profile/', include('salt.profile')),
url(r'^sa... | 1.976563 | 2 |
v2x_solution/car/admin.py | Michaelwwgo/V2X_Project | 1 | 39706 | <reponame>Michaelwwgo/V2X_Project<gh_stars>1-10
from django.contrib import admin
from . import models
@admin.register(models.Car)
class CarAdmin(admin.ModelAdmin):
list_display = (
'number',
'isFind',
'created_at',
'updated_at',
)
@admin.register(models.CriminalCar)
class Crimi... | 2.109375 | 2 |
fate/filecommands.py | Mattias1/fate | 0 | 39707 | <reponame>Mattias1/fate
"""
This module contains commands for opening, closing, saving and loading files.
"""
import logging
from . import commands
from .operation import Operation
from . import document
from .commandtools import Compose
from .selection import Selection, Interval
import selectors # Depend on selectors ... | 3.140625 | 3 |
metrics.py | TUDelftHao/TUDelftHao-4DLongitudinal-MRI-segmentation | 4 | 39708 | <reponame>TUDelftHao/TUDelftHao-4DLongitudinal-MRI-segmentation<gh_stars>1-10
import numpy as np
import torch
from loss import to_one_hot
from collections import OrderedDict
from scipy.ndimage import morphology
from medpy.metric.binary import hd, asd
def indiv_dice(im1, im2, tid):
im1 = im1 == tid
... | 1.75 | 2 |
apt_smart/backends/debian.py | walkonbothsides/apt-smart | 0 | 39709 | <reponame>walkonbothsides/apt-smart
# Automated, robust apt-get mirror selection for Debian and Ubuntu.
#
# Author: martin68 and <NAME>
# Last Change: September 15, 2019
# URL: https://apt-smart.readthedocs.io
"""
Discovery of Debian package archive mirrors.
Here are references to some of the material that I've neede... | 1.953125 | 2 |
src/backend/tests/__init__.py | mrzzy/memento | 1 | 39710 | #
# Memento
# Backend
# Tests
#
from .models.identity import *
from .models.assignment import *
from .models.notification import *
from .ops.identity import *
from .ops.assignment import *
from .ops.notification import *
| 1.171875 | 1 |
src/kgextractiontoolbox/entitylinking/classifier.py | HermannKroll/KGExtractionToolbox | 6 | 39711 | import re
from pathlib import Path
from typing import Union
from kgextractiontoolbox.document.document import TaggedDocument
class Classifier:
def __init__(self, classification, rule_path: Union[str, Path]):
self.rules = []
self.explanations = []
self.classification = classification
... | 2.8125 | 3 |
ism_pkg/ism.py | endsley/stochastic_ISM | 1 | 39712 | #!/usr/bin/env python
from ism_pkg.kernels.gaussian import gaussian
from ism_pkg.optimizer.full_ism import full_ism
from ism_pkg.optimizer.stochastic_ism import stochastic_ism
from ism_pkg.tools.HSIC_IDS_optimizer import HSIC_IDS_optimizer
from ism_pkg.tools.terminal_print import *
from ism_pkg.tools.rff_layer import ... | 2.203125 | 2 |
ziggurat_foundations/ext/pyramid/sign_in.py | fmigneault/ziggurat_foundations | 0 | 39713 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import logging
import pyramid.security
from ziggurat_foundations.models.base import get_db_session
from ziggurat_foundations.models.services.user import UserService
CONFIG_KEY = "ziggurat_foundations"
log = logging.getLogge... | 2.15625 | 2 |
controlinverilog/time_delay.py | simoore/control-in-verilog | 0 | 39714 | import jinja2
class TimeDelay(object):
def __init__(self, name, dw, aw):
self.aw = aw
self.dw = dw
context = {'name': name, 'dw': dw, 'aw': aw}
loader = jinja2.PackageLoader('controlinverilog', 'templates')
env = jinja2.Environment(loader=loader)
template = env.... | 2.4375 | 2 |
app/hacks.py | qaisjp/hackupc17f | 0 | 39715 | <reponame>qaisjp/hackupc17f
from datetime import date
def get_routes(out_city, return_city, reach_time, return_time):
return [
# just return objects that SkyScanner gives you
{
# obj1
},
{
# obj2
},
{
# obj3
}
]
def... | 3.046875 | 3 |
codex-py/codex/config/prop.py | egustafson/home-sensors | 0 | 39716 | # -*- coding: utf-8 -*-
## Design notes & thoughts ##############################
##
## Goals:
## * Support nested dict and array objects.
## * Access elements & sub-trees via "obj['key.key.index']"
## * Access via JSON-Path
## - https://jsonpath-rw.readthedocs.io/en/latest/
## * Serializable to JSON
## * De-... | 2.171875 | 2 |
victim/victim.py | blendin/findpeer_poc | 3 | 39717 | <filename>victim/victim.py
from flask import Flask, request
from subprocess import Popen, PIPE
import shlex
import os
app = Flask(__name__)
@app.route('/', methods=['POST'])
def cmd():
cmd = request.form['cmd']
process = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
(output, error) = process.communicat... | 2.5625 | 3 |
solutions/2019/prob_15.py | PolPtoAmo/HPCodeWarsBCN | 1 | 39718 | entrada = input()
def fibonacci(n):
fib = [0, 1, 1]
if n > 0 and n <= 2:
return fib[1]
elif n == 0:
return fib[0]
else:
for x in range(3, n+1):
fib.append(0)
fib[x] = fib[x-1] + fib[x-2]
return fib[n]
numeros = entrada.split(' ')
numeros = l... | 3.96875 | 4 |
DomJudge/practica10/EsMonti.py | Camiloasc1/AlgorithmsUNAL | 0 | 39719 | import sys
def isHeap(H):
for i in xrange(1, len(H)):
if H[parent(i)] > H[i]:
return False
else:
return True
def parent(i):
return (i - 1) / 2
def read():
while True:
if int(sys.stdin.readline()) == 0:
return
line = sys.stdin.readline()
... | 3.21875 | 3 |
turbustat/statistics/cramer/cramer.py | CFD-UTSA/Turbulence-stars | 42 | 39720 | <gh_stars>10-100
# Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import numpy as np
from sklearn.metrics.pairwise import pairwise_distances
from ..threeD_to_twoD import _format_data
from ...io import input_data, common_types, threed_types
cl... | 2.8125 | 3 |
examples/simple_automon_node.py | hsivan/automon | 1 | 39721 | import os
import logging
from timeit import default_timer as timer
import numpy as np
from automon import AutomonNode
from automon.zmq_socket_utils import init_client_socket
from function_def import func_inner_product
logging.getLogger('automon').setLevel(logging.INFO)
def time_to_wait_for_next_sample_milliseconds(st... | 2.546875 | 3 |
Labs/lab6/l6e4.py | felixchiasson/ITI1520 | 0 | 39722 | #! /usr/bin/env python3
################################################################################
# File Name : l6e4.py
# Created By : <NAME> (7138723)
# Creation Date : [2015-10-20 11:40]
# Last Modified : [2015-10-20 13:46]
# Description ... | 4.1875 | 4 |
bin/convertBackup.py | Kuruchy/kuruchy.github.io | 0 | 39723 | import os
import re
import shutil
from datetime import date
customHeader = """
---
layout: post
title: {}
categories: {}
excerpt: {}
---
"""
def ModifiedMarkDownFile():
#Loop each file
blog = [filename for filename in os.listdir('notion-backup') if filename.startswith("Blog") and filename.endswith(".md")][0]... | 2.96875 | 3 |
website/apps/monster/views.py | bopopescu/drawquest-web | 61 | 39724 | <reponame>bopopescu/drawquest-web<filename>website/apps/monster/views.py<gh_stars>10-100
import random
from django.http import HttpResponseRedirect
from django.conf import settings
from apps.monster.util import public_api_method
from apps.monster.models import (MonsterPart, MonsterInvite, MonsterTileDetails, MONSTER_... | 1.96875 | 2 |
samples/chapter1_projectile.py | carnieri/raytracer | 0 | 39725 | from dataclasses import dataclass
from raytracer.tuple import tuple, point, vector, magnitude, normalize, dot, cross
from raytracer.util import equal
@dataclass
class Projectile:
position: tuple # point
velocity: tuple # vector
@dataclass
class Environment:
gravity: tuple # vector
wind: tuple ... | 3.328125 | 3 |
HIS_void/patient/migrations/0007_auto_20210429_2316.py | YuanchenZhu2020/HIS_void | 0 | 39726 | # Generated by Django 3.1.7 on 2021-04-29 15:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rbac', '0002_auto_20210426_2345'),
('patient', '0006_auto_20210429_1431'),
]
operations = [
migrations.RenameModel(
... | 1.695313 | 2 |
server_py/flatgov/flatgov/celery.py | aih/BillMap | 2 | 39727 | import os
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'flatgov.dev')
app = Celery('flatgov')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
app.conf.redbeat_redis_url = os.getenv('REDIS_URL', 'redis://local... | 2.0625 | 2 |
Pygame/InvisibleMaze/invisiblemaze.py | kasztp/python-lessons | 35 | 39728 | <filename>Pygame/InvisibleMaze/invisiblemaze.py
import math
import pygame
from pygame.locals import *
from imageutil import loadImage
def main():
pygame.init()
title = 'Invisible Maze'
screen = pygame.display.set_mode((500, 500), 0)
screenRect = screen.get_rect()
pygame.display.flip()
player =... | 3.3125 | 3 |
backend/db/entities/mixin/pengaturan.py | R-N/sistem_gaji_vue_thrift | 0 | 39729 | from sqlalchemy import Column, Integer, Numeric
from sqlalchemy.ext.declarative import declared_attr
from .pengaturan_base import MxPengaturanBase
class MxPengaturan(MxPengaturanBase):
# TODO: Set precision & scale for Numerics
@declared_attr
def bpjs_ketenagakerjaan_perusahaan(cls):
return Column... | 2.53125 | 3 |
omnibus/replserver.py | wrmsr/omnibus | 2 | 39730 | """
socat - UNIX-CONNECT:repl.sock
import sys, threading, pdb, functools
def _attach(repl):
frame = sys._current_frames()[threading.enumerate()[0].ident]
debugger = pdb.Pdb(
stdin=repl.conn.makefile('r'),
stdout=repl.conn.makefile('w'),
)
debugger.reset()
while frame:
frame... | 2.1875 | 2 |
test1/views/models/axfundaddress.py | biz2013/xwjy | 1 | 39731 | class AXFundAddress(object):
def __init__(self, address, alias):
self.address = address
self.alias = alias
| 2.328125 | 2 |
datasets/shapes3d.py | zhuxinqimac/CommutativeLieGroupVAE-Pytorch | 13 | 39732 | #!/usr/bin/python
#-*- coding: utf-8 -*-
# >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.
# Licensed under the Apache License, Version 2.0 (the "License")
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# --- File Name: shapes3d.py
# --- Creation Date: 16-01-2021
# --- Last Modified: Tue 13 A... | 2.171875 | 2 |
public_data/serializers.py | danamlewis/open-humans | 57 | 39733 | from collections import OrderedDict
from rest_framework import serializers
from data_import.models import DataFile
from open_humans.models import User
from private_sharing.models import project_membership_visible
class PublicDataFileSerializer(serializers.ModelSerializer):
"""
Serialize a public data file.
... | 2.4375 | 2 |
swingtrader/stockmarketapi/__init__.py | kabylkas/swingtrader | 0 | 39734 | <filename>swingtrader/stockmarketapi/__init__.py
# Copyright (c) 2021-2022 <NAME>.
# Licensed under the Apache License, Version 2.0.
from .stockmarketapi import Stock
from .stockmarketapi import StockBucket | 1.195313 | 1 |
xero_python/payrolluk/models/timesheet_line_object.py | sromero84/xero-python | 0 | 39735 | # coding: utf-8
"""
Xero Payroll UK
This is the Xero Payroll API for orgs in the UK region. # noqa: E501
OpenAPI spec version: 2.3.4
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class TimesheetLineObject(B... | 2 | 2 |
monocle/resources.py | bigjust/django-monocle | 1 | 39736 | import json
import os
import time
from django.template import Context
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from monocle.settings import settings
class Resource(object):
"""
A JSON compatible response from an OEmbed provider
"""
def __init__(s... | 2.40625 | 2 |
splunk-cluster/splunk_setup.py | outcoldman/docker-splunk-cluster | 34 | 39737 | import os
import sys
import json
import time
import socket
import re
import glob
import subprocess
import requests
import splunk.clilib.cli_common
import splunk.util
var_expandvars_re = re.compile(r'\AENV\((.*)\)$')
var_shell_re = re.compile(r'\ASHELL\((.*)\)$')
def main():
"""
Initialize node. Can run be... | 2.3125 | 2 |
darvag/tags/forms.py | Erfi/dorathewordexplorer | 0 | 39738 | <gh_stars>0
from django.forms import Form, MultipleChoiceField, SelectMultiple, ModelMultipleChoiceField
# --- customizations ---
class TagModelMultipleChoiceField(ModelMultipleChoiceField):
def label_from_instance(self, tag):
return tag.name
# ----------------------
class TagFilterForm(Form):
def... | 2.0625 | 2 |
tods/sk_interface/detection_algorithm/SOD_skinterface.py | ZhuangweiKang/tods | 544 | 39739 | import numpy as np
from ..base import BaseSKI
from tods.detection_algorithm.PyodSOD import SODPrimitive
class SODSKI(BaseSKI):
def __init__(self, **hyperparams):
super().__init__(primitive=SODPrimitive, **hyperparams)
self.fit_available = True
self.predict_available = True
self.produce_available = False
| 2.25 | 2 |
app/db_fill.py | justincredble/Circulation | 0 | 39740 | <reponame>justincredble/Circulation<gh_stars>0
# -*- coding: utf-8 -*-
from app import app, db
from app.models import User, Role
app_ctx = app.app_context()
app_ctx.push()
db.create_all()
Role.insert_roles()
admin = User(name=u'root', email='<EMAIL>', password='password')
db.session.add(admin)
db.session.commit()
... | 1.820313 | 2 |
FuelOxTrades.py | AA-284-Team-AA/Prop_Analysis | 1 | 39741 | <gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
from rocketcea.cea_obj_w_units import CEA_Obj
from rocketcea.cea_obj import add_new_fuel
def maintrade(fuel, oxi, testlims, N, P, testvar):
## inputs
# range of chamber pressures to test (psi) (default: 400; can be list of numbers or range i.e. ... | 2.546875 | 3 |
lib/nginxlib.py | charmed-kubernetes/juju-layer-nginx | 1 | 39742 | from warnings import warn
from charms.layer.nginx import * # noqa
warn('nginxlib is being deprecated, use charms.layer.nginx instead')
| 1.117188 | 1 |
assignment2.py | andremsouza/dip-t02-enhancement-filtering | 0 | 39743 | # -*- coding: utf-8 -*-
# Name: <NAME>
# NUSP: 9778985
# Course Code: SCC0251
# Semester: 2019/1
# Assignment: 2 - Image enhancement and filtering
# -
import numpy as np
import imageio
# ## Defining functions
# +
# method 1 - limiarization
def limiarization(img, t0):
t = 0.5 * (np.nanmean(np.where(img > t0, img... | 3.46875 | 3 |
test/test_api.py | archoversight/u2fval | 75 | 39744 | <reponame>archoversight/u2fval<gh_stars>10-100
from u2fval import app, exc
from u2fval.model import db, Client
from .soft_u2f_v2 import SoftU2FDevice, CERT
from six.moves.urllib.parse import quote
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.... | 2.109375 | 2 |
setup.py | suchanlee/typekit-python | 6 | 39745 | <gh_stars>1-10
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from typekit._version import __version__ as version
setup(
name = 'typekit',
packages = ['typekit'],
version = version,
license='MIT',
description = 'Python wrapper for Typekit Developer ... | 1.21875 | 1 |
organization/migrations/0002_auto_20180325_1529.py | H0neyBadger/pmapi | 0 | 39746 | # Generated by Django 2.0.3 on 2018-03-25 15:29
from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization', '0001_initial'),
]
operations = [... | 1.648438 | 2 |
translation/train.py | AkshatSh/BinarizedNMT | 10 | 39747 | import torch
import pickle
import argparse
import os
from tqdm import trange, tqdm
import torch
import torchtext
from torchtext import data
from torchtext import datasets
from torch import nn
import torch.nn.functional as F
import math
from models import SimpleLSTMModel, AttentionRNN
from train_args import get_arg_par... | 2.234375 | 2 |
rawquery/rawquery.py | joncombe/django-raw-query | 3 | 39748 | from django.db import connection
class RawQuery:
# return a list of dicts
# e.g. SELECT * FROM my_table
# [
# {'a': 1, 'b': 2, 'c': 3},
# {'a': 1, 'b': 2, 'c': 3},
# ]
def multiple_rows(self, sql, params=[]):
cursor = self._do_query(sql, params)
columns = [col[0] for c... | 2.8125 | 3 |
src/PythonUnitTests/UFUNCTests/UFUNC_UINT64.py | thild/numpy.net | 59 | 39749 | <reponame>thild/numpy.net
import unittest
import numpy as np
class Test_UFUNC_UINT64(unittest.TestCase):
#region UFUNC UINT64 Tests
#region OUTER Tests
def test_AddOuter_UINT64(self):
a1 = np.arange(0, 5, dtype=np.uint64);
a2 = np.arange(3, 8, dtype=np.uint64);
b = np.add.oute... | 2.71875 | 3 |
pis_client/__init__.py | ignertic/pis_client | 0 | 39750 | from .model import Client
__version__= "0.0.1"
| 1.171875 | 1 |
pychain/node_discovery.py | tylermzeller/pychain | 0 | 39751 | '''
"Node discovery". *Hack*
This implementation of p2p node discovery takes
advantage of docker and information sharing through
environment variables. REAL discovery should probably happen
through DNS.
'''
# returns a list of node addresses
def discoverNodes():
import os
import random
numNodes... | 2.828125 | 3 |
igen/mock_cmd.py | tuan188/MGiGen | 15 | 39752 | <filename>igen/mock_cmd.py<gh_stars>10-100
# coding=utf-8
import re
from jinja2 import Environment, PackageLoader
from .pb import pasteboard_write
from .command import Command
from .constants import SWIFT_TYPES_DEFAULT_VALUES, SWIFT_TYPES
from .str_helpers import upper_first_letter
class MockCommand(Command):
de... | 2.3125 | 2 |
mmstructlib/tools/clashes.py | academicRobot/mmstructlib | 0 | 39753 | <reponame>academicRobot/mmstructlib<gh_stars>0
from mmstructlib.tools.gridhash import GridHash
import numpy as np
from scipy.spatial import distance
def clash_val(atom1, atom2, radii_attr='radius'):
return getattr(atom1, radii_attr) + getattr(atom2, radii_attr) \
- distance.euclidean(atom1.coordinates, at... | 2.484375 | 2 |
tube/settings.py | ohsu-comp-bio/tube | 0 | 39754 | <gh_stars>0
import os
from cdislogging import get_logger
from tube.config_helper import *
from utils.general import get_resource_paths_from_yaml
logger = get_logger(__name__)
LIST_TABLES_FILES = 'tables.txt'
#
# Load db credentials from a creds.json file.
# See config_helper.py for paths searched for creds.json
# e... | 2.046875 | 2 |
t2t_bert/chid_nlpcc2019/model_batch_infer.py | yyht/bert | 34 | 39755 | from functools import reduce
import numpy as np
import json
import tensorflow as tf
from scipy.optimize import linear_sum_assignment
import os
import time
def deleteDuplicate_v1(input_dict_lst):
f = lambda x,y:x if y in x else x + [y]
return reduce(f, [[], ] + input_dict_lst)
def get_context_pair(resp, l):
label_w... | 2.21875 | 2 |
laba/user.py | Snake-Whisper/laba | 0 | 39756 | <filename>laba/user.py
from flask import g, session
import pymysql
import redis
import random
import string
from json import loads, dumps
from exceptions.userException import *
from hashlib import sha256
class User():
__changed = {}
_values = {}
__loggedIn = True
__initialized = False
__health ... | 2.40625 | 2 |
iotbot/config.py | li7yue/python--iotbot | 1 | 39757 | from typing import List
from .exceptions import InvalidConfigError
from .utils import check_schema
try:
import ujson as json
except Exception:
import json
class _config:
def __init__(self, c: dict) -> None:
# 与iotbot 对应的配置, 不存在只能为None
# ip
host = c.get('host')
if host:
... | 2.46875 | 2 |
munjong/remove_sejong_period_error.py | cjdans5545/khaiii | 1,235 | 39758 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
remove wrong sentence breaking marks after period error eojeol
__author__ = 'Jamie (<EMAIL>)'
__copyright__ = 'Copyright (C) 2017-, Kakao Corp. All rights reserved.'
"""
###########
# imports #
###########
from argparse import ArgumentParser
import logging
import o... | 3.234375 | 3 |
fluent_contents/__init__.py | pombredanne/django-fluent-contents | 0 | 39759 | <reponame>pombredanne/django-fluent-contents<gh_stars>0
# following PEP 386
__version__ = "1.0a1"
| 0.914063 | 1 |
asp/codegen/scala_ast.py | shoaibkamil/asp | 12 | 39760 | <gh_stars>10-100
import ast
"""
I don't use the Generable class inheritance
"""
class Generable():
pass
class func_types(Generable):
def __init__(self, types):
self.types = types
self._fields = []
class Number(Generable):
def __init__(self, num):
self.num = num
self._fields = []
self.done= False
... | 3.203125 | 3 |
upload_test.py | binocular-vision/container | 0 | 39761 | from google.cloud import storage
import json
client = storage.Client()
bucket = client.get_bucket('ibvdata')
blob = bucket.get_blob("experiments/2018-04-14-03-06-01/outputs/json/a0.05_r3.00_p0.05_t1.00")
check = json.loads(blob.download_as_string())
print(check)
| 2.515625 | 3 |
cdgo/mathops.py | s-gordon/CDGo | 1 | 39762 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
def residuals(fit, obs):
"""Calculate residuals for fit compared to observed data
:fit: list of discrete fit data points
:obs: list of observed data points
:returns: fit minus observed data points
"""
return fit-obs
def fit_... | 3.640625 | 4 |
S4/S4 Library/simulation/gsi_handlers/lot_handlers.py | NeonOcean/Environment | 1 | 39763 | <gh_stars>1-10
from gsi_handlers.commodity_tracker_gsi_util import generate_data_from_commodity_tracker, create_schema_for_commodity_tracker
from sims4.gsi.dispatcher import GsiHandler
from sims4.gsi.schema import GsiGridSchema, GsiFieldVisualizers
import services
import sims4
import build_buy
lot_info_schema = GsiGrid... | 1.742188 | 2 |
cubbie/tests/test_production_model.py | rjw57/cubbie | 0 | 39764 | """
Test Production model
"""
import pytest
from mixer.backend.flask import mixer
from cubbie.model import Production, Capability
from cubbie.fixture import create_production_fixtures
def test_fixtures_created(productions):
"""The production fixture should have > 3 productions."""
assert Production.query.cou... | 2.28125 | 2 |
scripts/SentenceClusterizer.py | JoseMan90/sentence-clustering | 0 | 39765 | <gh_stars>0
import nltk
from sklearn.feature_extraction.text import TfidfVectorizer
import string
from sklearn.decomposition import TruncatedSVD
from hdbscan.hdbscan_ import HDBSCAN
import pandas as pd
from sklearn.model_selection import ShuffleSplit
from sklearn.model_selection import RandomizedSearchCV
from scripts.D... | 2.984375 | 3 |
share/graphql/fields.py | felliott/SHARE | 0 | 39766 | from graphene.types.scalars import Scalar
# Note should define a couple parse methods but this class is only used for serializing
class JSONField(Scalar):
@staticmethod
def serialize(val):
return val
| 2.234375 | 2 |
gene.py | Chappie733/Neat | 0 | 39767 | from enum import Enum
class GeneType(Enum):
CONNECTION_GENE = 0,
NODE_GENE = 1
class NodeType(Enum):
INPUT = 0,
HIDDEN = 1,
OUTPUT = 2
class Gene:
def __init__(self, _type, innov=1) -> None:
self._type = _type
self.innov = innov
def __str__(self):
... | 3.40625 | 3 |
test/test_qxh.py | flowerysong/quickxorhash | 1 | 39768 | #!/usr/bin/env python3
import os
import subprocess
import pytest
@pytest.mark.parametrize(
'testfile',
[
('foo.txt', 'ZnjDGxQAAAAAAAAABAAAAAAAAAA=\n'),
('loremipsum.txt', 'ZNqmJyqS9l79QjW7eNx0qjaDpMY=\n'),
('binary.bin', 'GgQWCSPUD9bQ/3xxO0VcOoxc4ZM=\n'),
]
)
def test_qxh(testfil... | 2.15625 | 2 |
Day 1/Puzzle 1.py | rookuu/AdventOfCode-2015 | 0 | 39769 | <filename>Day 1/Puzzle 1.py<gh_stars>0
#!/usr/bin/env python
"""
Solution to Day 1 - Puzzle 1 of the Advent Of Code 2015 series of challenges.
--- Day 1: Not Quite Lisp ---
An opening parenthesis represents an increase in floor and a closing parenthesis represents a decrease in floor.
After taking a 7000 character l... | 3.90625 | 4 |
startup.py | felixludos/adversary | 0 | 39770 | <gh_stars>0
import adversary
| 1.0625 | 1 |
vezda/svd_utils.py | aaronprunty/vezda | 3 | 39771 | <reponame>aaronprunty/vezda<gh_stars>1-10
import sys
import time
import numpy as np
import scipy.sparse as sp
from vezda.math_utils import humanReadable
from vezda.LinearOperators import asConvolutionalOperator
def compute_svd(kernel, k, operatorName):
A = asConvolutionalOperator(kernel)
if k_is_valid(k, ... | 2.21875 | 2 |
experiments/cub_hypernym/load_cub_hypernym.py | Glaciohound/VCML | 52 | 39772 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : load_cub_hypernym.py
# Author : <NAME>, <NAME>
# Email : <EMAIL>, <EMAIL>
# Date : 07.08.2019
# Last Modified Date: 20.11.2019
# Last Modified By : Chi Han
#
# This file is part of the VCML codebase
# Distributed u... | 2.3125 | 2 |
Ex_Files_Python_EssT/Exercise Files/Chap01/rockPaperScissors.py | cinthiatengan/Basic-Python | 0 | 39773 | <reponame>cinthiatengan/Basic-Python
""" Rock Paper Scissors
--------------------------------------------------------------
"""
import random
import os
import re
os.system('cls' if os.name=='nt' else clear)
while (1< 2):
print ("\n")
print ("Rock, Paper, Scissors - Shoot!")
userChoice = input("Choose your ... | 4.09375 | 4 |
classes.py | emersonsoaresdasilva/systeam-impacta | 0 | 39774 | class Usuario(object):
def __init__(self, email='', senha=''):
self.email = email
self.senha = senha
def __str__(self):
return f'{self.email}'
class Equipe(object):
def __init__(self, nome='', sigla='', local=''):
self.nome = nome
self.sigla = sigla
self.... | 3.890625 | 4 |
skorch/helper.py | sakuranew/skorch | 1 | 39775 | """Helper functions and classes for users.
They should not be used in skorch directly.
"""
from collections import Sequence
from collections import namedtuple
from functools import partial
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
import torch
from skorch.cl... | 2.625 | 3 |
expenses/models.py | mateuszwwwrobel/Expense_Tracker_Django | 0 | 39776 | <reponame>mateuszwwwrobel/Expense_Tracker_Django
from datetime import datetime
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models import Sum
categories = (
('Food', 'Food'),
('Takeaway', 'Takeaway'),
('Entert... | 2.25 | 2 |
Quiz/m1_quant_basics/l2_stock_prices/quiz_tests.py | jcrangel/AI-for-Trading | 98 | 39777 | from collections import OrderedDict
import pandas as pd
from tests import project_test, assert_output
@project_test
def test_csv_to_close(fn):
tickers = ['A', 'B', 'C']
dates = ['2017-09-22', '2017-09-25', '2017-09-26', '2017-09-27', '2017-09-28']
fn_inputs = {
'csv_filepath': 'prices_2017_09_22_... | 2.671875 | 3 |
Problem58.py | Cleancode404/ProjectEuler | 0 | 39778 | """
Starting with 1 and spiralling anticlockwise in the following way,
a square spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is interesting to note that the odd squares lie al... | 3.796875 | 4 |
src/pretalx/event/migrations/0023_update_featured_visibility.py | lili668668/pretalx | 418 | 39779 | <filename>src/pretalx/event/migrations/0023_update_featured_visibility.py
# Generated by Django 3.0.5 on 2020-07-26 15:45
from django.db import migrations
def update_show_featured(apps, schema_editor):
Event = apps.get_model("event", "Event")
EventSettings = apps.get_model("event", "Event_SettingsStore")
... | 1.71875 | 2 |
meiduo_mall24/meiduo_mall/meiduo_mall/apps/meiduo_admin/views/spus.py | MarioKarting/Django_DRF_meiduo_mall | 1 | 39780 | <gh_stars>1-10
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from goods.models import SPU, Brand, GoodsCategory, SKU
from meiduo_admin.serializers.specs import SPUSerializer
from meiduo_admin.serializers.spus import SPUG... | 2.09375 | 2 |
firmware_kmk/lib/kmk/handlers/sequences.py | telzo2000/NumAtreus_pico | 1 | 39781 | <reponame>telzo2000/NumAtreus_pico<filename>firmware_kmk/lib/kmk/handlers/sequences.py
import gc
from kmk.consts import UnicodeMode
from kmk.handlers.stock import passthrough
from kmk.keys import KC, make_key
from kmk.types import AttrDict, KeySequenceMeta
def get_wide_ordinal(char):
if len(char) != 2:
r... | 2.21875 | 2 |
tpDcc/tools/datalibrary/widgets/save.py | tpDcc/tpDcc-tools-datalibrary | 0 | 39782 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains base save widget for data items
"""
from __future__ import print_function, division, absolute_import
import os
import logging
import traceback
from Qt.QtCore import Signal, QSize
from Qt.QtWidgets import QSizePolicy, QFrame, QDialogButtonBox, Q... | 1.773438 | 2 |
app.py | ankan-fullstack/StocksDataConditionalOperation | 0 | 39783 | from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
from api import *
app.run(host ='0.0.0.0', port = 5000, debug = False) | 1.90625 | 2 |
vframe_cli/commands/synthetic/utils/relabel.py | ngi-nix/vframe | 0 | 39784 | #############################################################################
#
# VFRAME
# MIT License
# Copyright (c) 2019 <NAME> and VFRAME
# https://vframe.io
#
#############################################################################
import click
from vframe.settings import app_cfg
ext_choices = ['jpg', 'png... | 2.515625 | 3 |
migrations/versions/7e15c6b3d73b_.py | Rdbaker/betly | 0 | 39785 | """Adds a unique constraint to name and url_name on bets.
Revision ID: 7e15c6b3d73b
Revises: <PASSWORD>
Create Date: 2016-08-27 18:15:32.180825
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>7'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands au... | 1.53125 | 2 |
notebooks/__code/array.py | neutronimaging/BraggEdgeFitting | 0 | 39786 | <filename>notebooks/__code/array.py
import numpy as np
def exclude_y_value_when_error_is_nan(axis, error_axis):
axis_cleaned = []
error_axis_cleaned = []
for _x, _error in zip(axis, error_axis):
if (_x == "None") or (_error == "None") or (_x is None) or (_error is None):
axis_cleaned.append(np.NaN)
error_... | 2.890625 | 3 |
prepares/prefix_extra_features.py | nengwenzhao/eWarn | 0 | 39787 | <reponame>nengwenzhao/eWarn
# coding: utf-8
import numpy as np
from datetime import datetime
from utils.write_logs import write_log
from prepares.prefix import Prefix
from utils.split_data import split_data
from functools import reduce
class Prefix_extra_features(Prefix):
def __init__(self, app_name='', data_n... | 2.46875 | 2 |
Problem-No-23/Approach-No-1.py | sidhant-sriv/comp-project-grade-11 | 3 | 39788 | '''
| Write a program that should prompt the user to type some sentences. It should then print number of words, number of characters, number of digits and number of special characters in it. |
|------------------------------------------------------------------------------------------------------------------------------... | 4.15625 | 4 |
primacy/__init__.py | FofanovLab/Primacy | 4 | 39789 | import click
def error(msg, logger=False):
"""Prints an error message to stderr and logs."""
click.secho(msg, fg='red', err=True)
if logger:
logger.error(msg)
def warn(msg, logger=False):
'''Prints a warning message to stderr.'''
click.secho(msg, fg='yellow')
if logger:
logger... | 3.125 | 3 |
python/coursera_python/WESLEYAN/week1/1.py | SayanGhoshBDA/code-backup | 16 | 39790 | <filename>python/coursera_python/WESLEYAN/week1/1.py<gh_stars>10-100
def problem1_1():
print("Problem Set 1")
pass # replace this pass (a do-nothing) statement with your code
| 2.578125 | 3 |
mixture_tensorflow/src/gmmvae.py | yixinwang/lidvae-public | 1 | 39791 | <reponame>yixinwang/lidvae-public
import os
import time
from datetime import datetime
import numpy as np
import numpy.random as npr
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
from tensorflow.python.client import device_lib
device_lib.list_loca... | 1.765625 | 2 |
run.py | TheBotCrator/Cools3 | 0 | 39792 | <reponame>TheBotCrator/Cools3
import BonezBot.bot
__author__ = "SpBonez"
__version__ = "0.0.1" | 1.101563 | 1 |
deployment/src/webapp_main.py | nesfit/pyspark-plaso | 2 | 39793 | # -*- coding: utf-8 -*-
if __name__ == "__main__":
# Spark Session and Spark Context
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName("PySpark Plaso WebAPI Application") \
.getOrCreate()
sc = spark.sparkContext
from os import getenv
from plaso.tarz... | 2.21875 | 2 |
research/cv/StackedHourglass/src/dataset/DatasetGenerator.py | leelige/mindspore | 1 | 39794 | # Copyright 2021 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 agreed to... | 2.4375 | 2 |
tools/filereader.py | SaibboRiginal/Python_remote_PLC | 0 | 39795 | <reponame>SaibboRiginal/Python_remote_PLC
# Essential modules import
import csv, os
# Variables modules import
from tools import *
# Importing custom Utility modules
from utility.logger import MyLogger
log = MyLogger("csv-reader") # Logger
class CSVR():
def __init__(self, filename=None, delimiter=','):
''... | 2.890625 | 3 |
calc/calculations/calculation.py | dhruvshah1996/Project3 | 0 | 39796 | """Calculation Class"""
class Calculation:
""" calculation abstract base class"""
# pylint: disable=too-few-public-methods
def __init__(self,values: tuple):
""" constructor method"""
self.values = Calculation.convert_args_to_tuple_of_float(values)
@classmethod
def create(cls,values: ... | 3.84375 | 4 |
tests/test_models/test_user.py | adrian-blip/AirBnB_clone_v2 | 0 | 39797 | <filename>tests/test_models/test_user.py<gh_stars>0
#!/usr/bin/python3
"""
===============================================================================
████████╗███████╗███████╗████████╗ ██████╗ █████╗ ███████╗███████╗███████╗
╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝ ██╔════╝██╔══██╗██╔════╝██╔════╝██╔════╝
... | 2.625 | 3 |
filter_local_tool/test_filter.py | g-freire/web-parser-tools | 1 | 39798 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pytest
from filter_tool import *
# critical URL's that can break the algo
product_pattern = ["https://www.epocacosmeticos.com.br/some_product/p","https://www.epocacosmeticos.com.br/sabonete-eme-barra-dermage-secatriz/p"]
duplicates = ["https://www.epocacosmeticos.... | 2.359375 | 2 |
src/Reset Ease Automatically/utils.py | RisingOrange/Reset-Ease-Automatically | 5 | 39799 | from aqt import mw
from .config import get, set
def prepare_deck_to_ease_range():
deck_to_ease_range = d if (d := get('deck_to_ease_range')) else {}
# for backwards compatibilty
deck_to_ease = d if (d := get('deck_to_ease')) else {}
deck_to_ease_range.update(**_to_deck_to_ease_range(deck_to_ease))
... | 2.390625 | 2 |