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 |
|---|---|---|---|---|---|---|
uvicorn/protocols/utils.py | immerrr/uvicorn | 0 | 12780651 | import asyncio
import time
import urllib.parse
from typing import Optional, Tuple
from asgiref.typing import WWWScope
def get_remote_addr(transport: asyncio.Transport) -> Optional[Tuple[str, int]]:
socket_info = transport.get_extra_info("socket")
if socket_info is not None:
try:
info = so... | 2.5625 | 3 |
UTDVN_backend/UTDVN_database/apps.py | NewLuminous/UTDVN | 1 | 12780652 | <filename>UTDVN_backend/UTDVN_database/apps.py<gh_stars>1-10
from django.apps import AppConfig
class UtdvnDatabaseConfig(AppConfig):
name = 'UTDVN_database'
| 1.21875 | 1 |
hardhat/recipes/libsigc++.py | stangelandcl/hardhat | 0 | 12780653 | <filename>hardhat/recipes/libsigc++.py
from .base import GnuRecipe
class LibSigCppRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(LibSigCppRecipe, self).__init__(*args, **kwargs)
self.sha256 = '774980d027c52947cb9ee4fac6ffe2ca' \
'60cc2f753068a89dfd281c83dbff965... | 1.84375 | 2 |
src/controller/dbcontroller.py | gusilva/sdr | 0 | 12780654 | <gh_stars>0
from src.model.model import Base, Settings, Report, FolderTracking
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from datetime import datetime
class Controller(object):
"""
Controller class to interact with db model data.
Methods
-------
getA... | 2.328125 | 2 |
app.py | skullcandy69/Minor-Project | 0 | 12780655 | <filename>app.py<gh_stars>0
import time
from absl import app, logging
import cv2
import numpy as np
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images, load_tfrecord_dataset
from yolov3_tf2.utils import draw_outputs
from flask import Flask, r... | 2.328125 | 2 |
bin/ominoes/pentominoes-3x20-loop.py | tiwo/puzzler | 0 | 12780656 | #!/usr/bin/env python
# $Id$
"""2 solutions"""
import puzzler
from puzzler.puzzles.pentominoes import Pentominoes3x20Loop
puzzler.run(Pentominoes3x20Loop)
| 1.171875 | 1 |
LeetCode/198-house-robber.py | leaving-voider/LeetCode.cn-Record | 0 | 12780657 | ###############################################################################################
# 直接参考官方方法,经典题型——打家劫舍,采用动态规划
###########
# 时间复杂度:O(n),n为数组长度
# 空间复杂度:O(1),采用滚动数组,复杂度减少到最低
###############################################################################################
class Solution:
def rob(sel... | 3.21875 | 3 |
MouthMusicModel.py | ahpalmerUNR/mouthMusicStreamer | 0 | 12780658 | # -*- coding: utf-8 -*-
# @Author: ahpalmerUNR
# @Date: 2020-12-21 14:38:59
# @Last Modified by: ahpalmerUNR
# @Last Modified time: 2021-05-06 23:10:20
import torch
class MouthMusicMouthModel(torch.nn.Module):
def __init__(self):
super(MouthMusicMouthModel,self).__init__()
self.conv1 = torch.nn.Conv2d(3,62,7,... | 2.46875 | 2 |
lime/util/passwords_test.py | toastwaffle/LiME | 0 | 12780659 | <gh_stars>0
"""Tests for the password descriptor.
Relies on the descriptor existing on the user model.
"""
from absl.testing import absltest
from passlib import context
from lime import app
from lime.database import models
from lime.util import testing
class PasswordsTest(absltest.TestCase):
"""Tests for the pas... | 2.703125 | 3 |
sequence/sea_level.py | sequence-dev/sequence | 1 | 12780660 | <gh_stars>1-10
import numpy as np
from landlab import Component
from scipy import interpolate
class SeaLevelTimeSeries(Component):
_name = "Sea Level Changer"
_time_units = "y"
_unit_agnostic = True
_info = {
"sea_level__elevation": {
"dtype": "float",
"intent": "ou... | 2.46875 | 2 |
src/speech/spectrogram_model.py | dem123456789/Speech-Emotion-Recognition-with-Dual-Sequence-LSTM-Architecture | 6 | 12780661 | import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
class SpectrogramModel(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size_cnn, stride_cnn, padding_cnn, kernel_size_pool, stride_pool, hidden_dim, num_layers, dropout_rate, num_labels, batch_size, bidirectional=False)... | 2.4375 | 2 |
swann/viz/tfr.py | alexrockhill/SwannLabResources | 0 | 12780662 | import os
import numpy as np
import os.path as op
import matplotlib.pyplot as plt
from matplotlib.colors import BASE_COLORS, SymLogNorm
from scipy.stats import ttest_ind
from swann.preprocessing import get_info
from swann.utils import get_config, derivative_fname
from swann.analyses import decompose_tfr, find_bursts,... | 2.3125 | 2 |
cinderclient/v3/services.py | wmore/openstack_study | 0 | 12780663 | <gh_stars>0
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# 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
#
... | 1.820313 | 2 |
nurbspy/nurbs_surface_bilinear.py | dragonbook/nurbspy | 25 | 12780664 | # -------------------------------------------------------------------------------------------------------------------- #
# Import packages
# -------------------------------------------------------------------------------------------------------------------- #
import numpy as np
from .nurbs_surface import NurbsSurface
... | 1.765625 | 2 |
tests/test_base.py | 1xch/fliki | 3 | 12780665 | def test_base(app):
assert app.extensions['fliki'] is not None
def test_has_index(client):
r = client.get('/test/', follow_redirects=True)
assert b"Title: index\nSummary: base page for wiki" not in r.data
assert b"Welcome to your flask-wiki" in r.data
def test_new_page(client):
r = client.get('/... | 2.4375 | 2 |
backpack/extensions/firstorder/batch_grad/batch_grad_base.py | jabader97/backpack | 395 | 12780666 | """Calculates the batch_grad derivative."""
from __future__ import annotations
from typing import TYPE_CHECKING, Callable, List, Tuple
from torch import Tensor
from torch.nn import Module
from backpack.core.derivatives.basederivatives import BaseParameterDerivatives
from backpack.extensions.firstorder.base import Fi... | 2.65625 | 3 |
mapping.py | tlfobe/LAMMPS-SIMR | 0 | 12780667 | #!/usr/bin/python
# Analysis scripts for mapping same phase energies to each other using signac
import signac
import numpy as np
import subprocess
import pdb
import os
import sys
import pandas
import mdtraj as md
import shutil
import yaml
#need to make yaml not just enumerate all ts and ps, but give other info like ... | 2.390625 | 2 |
venv/lib/python2.7/dist-packages/landscape/lib/bpickle_dbus.py | pengwu/scapy_env | 0 | 12780668 | <reponame>pengwu/scapy_env
"""
Different versions of the Python DBus bindings return different types
to represent integers, strings, lists, etc. Older versions return
builtin Python types: C{int}, C{str}, C{list}, etc. Newer versions
return DBus-specific wrappers: C{Int16}, C{String}, C{Array}, etc.
Failures occur wh... | 2.46875 | 2 |
chinese-poem/probability.py | MashiMaroLjc/ML-and-DM-in-action | 370 | 12780669 | # coding:utf-8
#
def two(words):
"""
:param words:
:return:
"""
new = []
s = len(words)
for index in range(s):
w = words[index]
for next_index in range(index + 1, s):
next_w = words[next_index]
new.append(frozenset([w, next_w]))
return new
poe... | 2.75 | 3 |
CloudRun/Scraper/code/main.py | greavr/easy-golf-booker | 0 | 12780670 | <gh_stars>0
import collections
import json
import logging
import os
import random
import string
import sys
import time
from datetime import date, datetime, timedelta, timezone
import google.cloud.logging
import pytz
import requests
from flask import Flask, jsonify
from google.cloud import datastore, pubsub_v1
from pyt... | 2.34375 | 2 |
sequence_trie.py | JeffreyUrban/count-sequences | 0 | 12780671 | <filename>sequence_trie.py
from collections import Counter
import json
# TODO: Index all active nodes within deque (or move to other structure), so updating is faster.
"""
Sequence Trie:
Like a linked list, except each node links to a dictionary (count collection)
Each node stores a count of sequences of strings th... | 3.484375 | 3 |
mirrors/libs/utils/gql_related.py | likeyiyy/mirrorweb | 0 | 12780672 | import json
import re
from jinja2.loaders import BaseLoader
from werkzeug.datastructures import ImmutableMultiDict
from jinja2.sandbox import ImmutableSandboxedEnvironment
import decimal
from mirrors.common.logger import logger
class DjangoLoader(BaseLoader):
def __init__(self):
pass
def get_source... | 2.078125 | 2 |
shell/src/dist/scripts/sibilla_py/sibilla/__init__.py | f-biondi/sibilla | 0 | 12780673 | <gh_stars>0
from .plotting_module import SibillaDataPlotter
from .profiler_module import Profiler
from .sibilla_runtime import SibillaRuntime, Map, SibillaReachabilityResult, SibillaFristPassageTimeResult, SibillaReachabilityResult
__all__= (
SibillaRuntime,
Map,
SibillaReachabilityResult,
SibillaFris... | 1.53125 | 2 |
prodrop/exceptions.py | adambeagle/prodrop_project | 3 | 12780674 | """
exceptions.py
Author: <NAME>
PURPOSE:
Contains all custom exception classes for the prodrop package.
"""
###############################################################################
# ParseTreeError and iheritors
class ParseTreeError(Exception):
"""Base class for all parse tree related errors."""
pas... | 2.78125 | 3 |
train.py | ardamavi/Vocalize-Sign-Language | 65 | 12780675 | # <NAME>
import os
import numpy
from get_dataset import get_dataset
from get_model import get_model, save_model
from keras.callbacks import ModelCheckpoint, TensorBoard
epochs = 15
batch_size = 6
def train_model(model, X, X_test, Y, Y_test):
checkpoints = []
if not os.path.exists('Data/Checkpoints/'):
... | 2.390625 | 2 |
pytiff/test/test_write.py | ch-schiffer/pytiff | 9 | 12780676 | from hypothesis import HealthCheck
from hypothesis import given, settings
from hypothesis.extra import numpy as hnp
from pytiff import *
import hypothesis.strategies as st
import numpy as np
import pytest
import subprocess
import tifffile
from skimage.data import coffee
def test_write_rgb(tmpdir_factory):
img = co... | 2.03125 | 2 |
Server/tests/v2/views/student/report/t_facility_report.py | moreal/DMS-Backend | 27 | 12780677 | from app.models.report import FacilityReportModel
from tests.v2.views import TCBase
class TestFacilityReport(TCBase):
"""
시설 고장 신고를 테스트합니다.
"""
def __init__(self, *args, **kwargs):
super(TestFacilityReport, self).__init__(*args, **kwargs)
self.method = self.client.post
self.... | 2.296875 | 2 |
fudbyte/apps/core/urls.py | niieq/fudbyte | 0 | 12780678 | from django.conf.urls import url
from .views import index, food_detail, post_food_comment
urlpatterns = [
url(r'^$', index),
url(r'^food/(?P<food_slug>[-\w]+)$', food_detail),
url(r'^food/(?P<food_slug>[-\w]+)/add_comment$', post_food_comment)
] | 1.726563 | 2 |
MyVisuApp.py | HaikoKrais/HomeDataViewer | 1 | 12780679 | <filename>MyVisuApp.py
# -*- coding: utf-8 -*-
'''
Visualizes temperature and humidity in rooms and provides a weather forecast.
Classes:
MyScreens: Used to switch between the screens which provide the different contents
Scrn1: Start screen of the app. Provides navigation to the other screens
Scrn2: Shows ... | 2.5625 | 3 |
data_steward/cdr_cleaner/cleaning_rules/deid/geolocation_concept_suppression.py | lrwb-aou/curation | 16 | 12780680 | """
Sandbox and record suppress all records with a concept_id or concept_code relating to Geo Location information.
Original Issue: DC-1385
suppress all records associated with a GeoLocation identifier concepts in PPI vocabulary
The concept_ids to suppress can be determined from the vocabulary with the following reg... | 1.90625 | 2 |
11/solution1.py | msagi/advent-of-code-2021 | 0 | 12780681 | # https://adventofcode.com/2021/day/11
def increase_energy_level(arr, arr_len_x, arr_len_y, increase_step):
for x in range(arr_len_x):
for y in range(arr_len_y):
arr[x][y] += increase_step
def flash_octopus(arr, arr_len_x, arr_len_y, x, y):
if arr[x][y] <= 9: # no flash for this octopus... | 3.296875 | 3 |
app/index_tags.py | patrickhoefler/secta | 0 | 12780682 | #!/usr/bin/env python3
import codecs
from collections import defaultdict
import errno
import json
import os
def tree():
"""
http://recursive-labs.com/blog/2012/05/31/one-line-python-tree-explained/
"""
return defaultdict(tree)
def index_tags():
"""
Iterate through all locally saved JSON fil... | 3.078125 | 3 |
src/cms/templatetags/offer_filters.py | digitalfabrik/coldaid-backend | 4 | 12780683 | from django import template
register = template.Library()
@register.filter
def active_since(region_offers, offer_template):
return region_offers.filter(template=offer_template).first().created_date
| 1.765625 | 2 |
rbfmorph/rbf_func.py | utkarshmech/rbfmorph | 2 | 12780684 | import numpy as np
def rd(c1, c2):
return np.sqrt((c1[0]-c2[0])**2+(c1[1]-c2[1])**2+(c1[2]-c2[2])**2)
#rbf as global support spline type
#Gaussian Spline
def rbf(r):
return np.exp(-r**2)
#Spline polynomial
def rbf1(r,deg):
return r**deg
# Global
def rbf2(r):
return np.exp(-r**2)
# %% codecell
| 2.796875 | 3 |
saltverifier/server.py | virtru-ops/salt-verifier | 1 | 12780685 | <reponame>virtru-ops/salt-verifier
"""
A simple challenge response server
Request:
encrypted-message-of-challenge
Response:
status-code;body-of-response
Good response:
200-299;base64 of rsa-sha256 of challenge
Bad response:
400-599;error-message
"""
import os
import sys
import argparse
import ti... | 2.96875 | 3 |
AlphaRemover.py | partywithemanuel/alpha_remover | 0 | 12780686 | import wx
import matplotlib.pyplot as plt
import os
import sys
import subprocess
from PIL import Image
class App(wx.Frame):
def __init__(self, parent, title):
super(App, self).__init__(parent, title = title,size = (640,300))
panel = wx.Panel(self)
sizer = wx.GridBagSizer(5, 4)
#d... | 2.46875 | 2 |
chapter4/pizza.py | sharad16j/Expert-Python-Programming-Third-Edition | 112 | 12780687 | <filename>chapter4/pizza.py
class Pizza:
def __init__(self, toppings):
self.toppings = toppings
def __repr__(self):
return "Pizza with " + " and ".join(self.toppings)
@classmethod
def recommend(cls):
"""Recommend some pizza with arbitrary toppings,"""
return cls(['spam'... | 3.875 | 4 |
examples/nlp/bert/test_glue_pytorch_bert.py | AFDWang/Hetu | 82 | 12780688 | <reponame>AFDWang/Hetu<filename>examples/nlp/bert/test_glue_pytorch_bert.py
from tqdm import tqdm
import os
import math
import logging
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.optim import SGD
import numpy as np
from pytorch_bert import BertForSequenceClassification
from bert_config im... | 2.1875 | 2 |
config.py | Johnsoneer/The-Quote-Book | 0 | 12780689 | from app.env import env
'''
Uses environment variables to secure secrets whilst giving our server the ability to
access certain key parameters for things like emailing users managing csrf tokens.
'''
class Config(object):
SECRET_KEY = env.SECRET_KEY
DATABASE_USER = env.DATABASE_USER
DATABASE_PASSWORD =... | 2.546875 | 3 |
index.py | n-schilling/datadog-synthetic-scheduler | 1 | 12780690 | import json
import logging
import os
import sys
import boto3
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
http_pool = urllib3.PoolManager()
secretsmanager_client = boto3.client('secretsmanager')
def changeSyntheticStatus(new_status):
logger.info(f"Start... | 2.078125 | 2 |
orders/migrations/0007_auto_20191223_1502.py | yun-mh/uniwalk | 0 | 12780691 | # Generated by Django 2.2.5 on 2019-12-23 06:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('orders', '0006_auto_20191222_2318'),
]
operations = [
migrations.AlterField(
model_name='order'... | 1.640625 | 2 |
python/test/lib/sibra/state/bandwidth_test.py | cschutijser/scion | 1 | 12780692 | <gh_stars>1-10
# Copyright 2016 ETH Zurich
#
# 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 ... | 1.960938 | 2 |
napalm_eltex/__init__.py | noc-uac-ssc/napalm-eltex | 1 | 12780693 | """napalm-eltex package."""
from napalm_eltex.eltex import CEDriver
__all__ = ('CEDriver',) | 1.046875 | 1 |
test/unit/test_arn.py | robin-aws/aws-encryption-sdk-python | 0 | 12780694 | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 2.109375 | 2 |
myapp/models.py | tainanpopo/Django-PostgreSQL | 0 | 12780695 | from django.db import models
# Create your models here.
class Student(models.Model):
name = models.CharField(max_length = 20, null = False)#建立字串長度最大為20,且欄位不可空白。
sex = models.CharField(max_length = 2, default = 'M', null = False)
birthday = models.DateField(null = False)
phone = models.CharField(max_len... | 2.78125 | 3 |
meg_runtime/ui/manager.py | ibedard16/Runtime | 0 | 12780696 | <gh_stars>0
"""MEG UI Manager
"""
from PyQt5 import QtWidgets, uic
from os.path import dirname
import pkg_resources
import sys
from meg_runtime.ui.mainmenupanel import MainMenuPanel
from meg_runtime.ui.clonepanel import ClonePanel
from meg_runtime.ui.repopanel import RepoPanel
from meg_runtime.logger import Logger
... | 2.34375 | 2 |
mathutils/gram.py | saridut/FloriPy | 0 | 12780697 | #!/usr/bin/env python
'''This module contains routines to perform Gram-Schmidt orthonormalization on
a sequence of vectors.
'''
import numpy as np
import numpy.linalg as la
def gso(A, overwrite=False, out=None):
'''Performs Gram-Schmidt orthonormalization on a sequence of vectors.
Parameters
----------
... | 3.671875 | 4 |
src/train_spp.py | atreyasha/spp-explainability | 1 | 12780698 | <reponame>atreyasha/spp-explainability<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tqdm import tqdm
from glob import glob
from math import ceil
from functools import partial
from collections import OrderedDict
from tensorboardX import SummaryWriter
from torch.optim import Adam
from torch.nn impor... | 1.90625 | 2 |
mopack/builders/bfg9000.py | jimporter/mopack | 0 | 12780699 | import os
from . import Builder, BuilderOptions
from .. import types
from ..environment import get_cmd
from ..freezedried import FreezeDried
from ..log import LogFile
from ..path import pushd
from ..shell import ShellArguments
_known_install_types = ('prefix', 'exec-prefix', 'bindir', 'libdir',
... | 1.976563 | 2 |
LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/443_String_Compression.py | Sycamore-City-passerby/ML | 0 | 12780700 | <gh_stars>0
class Solution:
def compress(self, chars):
"""
:type chars: List[str]
:rtype: int
"""
n = len(chars)
i , count = 0 , 1
for j in range(1,n+1):
if j < n and chars[j] == chars[j-1]:
count += 1
else:
... | 3.796875 | 4 |
statsmodels/examples/tsa/ex_var_reorder.py | yarikoptic/statsmodels | 20 | 12780701 |
from __future__ import print_function
import statsmodels.api as sm
from statsmodels.tsa.vector_ar.tests.test_var import TestVARResults
test_VAR = TestVARResults()
test_VAR.test_reorder()
| 1.304688 | 1 |
pypei/utils.py | dwu402/pyDD | 2 | 12780702 | <filename>pypei/utils.py
from matplotlib import dates as mdates
from matplotlib import pyplot as plt
def form_xmonths(ax: plt.Axes, dspec=r'1 %b %Y', majors=1, minors=15, mindspec=r'15 %b'):
"""Formats an pyplot axis with ticks and labels at the first of each Month"""
date_format = mdates.DateFormatter(dspec)
... | 3.0625 | 3 |
Main/migrations/0069_auto_20210502_1223.py | Muhammet-Yildiz/Ecommerce_Website-HepsiOrada | 10 | 12780703 | # Generated by Django 3.1.4 on 2021-05-02 09:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Main', '0068_remove_product_discount'),
]
operations = [
migrations.RenameField(
model_name='product',
old_name='advantage',... | 1.53125 | 2 |
python/vision/error_functions.py | Oilgrim/ivs_sim | 0 | 12780704 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 2 14:58:01 2017
@author: lracuna
"""
import autograd.numpy as np
def validation_points_error(Xi, Xo, Hestimated):
Xi = np.copy(Xi)
Xo = np.copy(Xo)
sum = 0
for i in range(Xo.shape[1]):
sum += geometric_distance(Xo[:,i],Xi[:... | 2.828125 | 3 |
ordia/app/__init__.py | nyurik/ordia | 0 | 12780705 | <reponame>nyurik/ordia
"""app."""
from __future__ import absolute_import, division, print_function
from flask import Flask
from ..base import Base
def create_app(max_ids=None):
"""Create webapp.
Factory for webapp.
Returns
-------
app : flask.app.Flask
Flask app object.
"""
... | 2.34375 | 2 |
caldp/sysexit.py | spacetelescope/caldp | 2 | 12780706 | """This module defines context managers which are used to trap exceptions
and exit Python cleanly with specific exit_codes which are then seen as
the numerical exit status of the process and ultimately Batch job.
The exit_on_exception() context manager is used to bracket a block of code
by mapping all exceptions onto ... | 3.65625 | 4 |
migrations/0004_auto_20180503_0115.py | contraslash/authentication-django | 0 | 12780707 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-03 01:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('authentication', '0003_auto_20161030_0401'),
]
operations = [
migrations.RemoveField(... | 1.632813 | 2 |
particle/__init__.py | mikolasan/pyroguelike | 0 | 12780708 | '''
https://github.com/Mekire/pygame-particles
'''
from .particle import Emitter
| 1.148438 | 1 |
iatransfer/research/transfer/utils.py | KamilPiechowiak/iatransfer | 4 | 12780709 | <filename>iatransfer/research/transfer/utils.py
from typing import Dict
def get_transfer_method_name(transfer_method: Dict) -> str:
name = [transfer_method["transfer"]]
if "matching" in transfer_method:
name.append(transfer_method["matching"])
if "standardization" in transfer_method:
name.a... | 2.9375 | 3 |
moya/context/sortmodifiers.py | moyaproject/moya | 129 | 12780710 | <reponame>moyaproject/moya
"""Hacked up script to sort modifiers"""
# Couldn't find a tool for this
"""
import io
with io.open('modifiers.py', 'rt') as f:
iter_lines = iter(f)
while 1:
line = next(iter_lines, None)
if line.startswith('class ExpressionModifiers('):
break
defs ... | 2.6875 | 3 |
app/__init__.py | fauzaanirsyaadi/belajar-full-stack | 0 | 12780711 | #ini adalah file pertama yang akan dibaca
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
from .models.users import User
| 1.8125 | 2 |
duconv/src/lr_schedule.py | kingcong/MindSpore_Code | 77 | 12780712 | <filename>duconv/src/lr_schedule.py
# 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 req... | 2.046875 | 2 |
metastudio/lib/ext/meta-jython/metastudio.py | tovganesh/metastudio | 4 | 12780713 | <gh_stars>1-10
#
# metastudio.py
#
# Wrappers for accessing MeTA Studio APIs. Where ever possible these
# wrappers are consistent with the ones provided in BeanShell (the default
# scripting interface for MeTA Studio).
# However, due to some restriction in Python, like no support for function
# overloading, certain f... | 1.835938 | 2 |
mesService/modules/AngularInterface/planmanage/plan_schedule.py | mabotech/mes_sv | 2 | 12780714 | # @createTime : 2019/10/30 9:13
# @author : Mou
# @fileName: plan-schedule.py
# 计划排产部分前端接口
import json
from flask import current_app
from flask import request
from mesService import config_dict
from mesService.lib.pgwrap.db import connection
class PlanSchedule(object):
def getsortlist(self):
reqparam... | 2.421875 | 2 |
python/baekjoon/step/15-greedy/ATM.py | bum12ark/algorithm | 1 | 12780715 | <gh_stars>1-10
"""
출처: https://www.acmicpc.net/problem/11399
"""
# param
size = int(input())
p_times = list(map(int, input().split()))
# solution
p_times.sort()
prev = result = 0
for t in p_times:
prev += t
result += prev
# result
print(result)
| 2.8125 | 3 |
contract_analysis.py | jasonrubenstein18/MLB_FA | 0 | 12780716 | import pandas as pd
import numpy as np
from statsmodels.formula.api import ols
import plotly_express
import plotly.graph_objs as go
from plotly.subplots import make_subplots
# Read in data
batter_data = pd.read_csv("~/Desktop/MLB_FA/Data/fg_bat_data.csv")
del batter_data['Age']
print(len(batter_data))
print(batter_dat... | 2.9375 | 3 |
16/main.py | DVRodri8/advent-of-code-2019 | 0 | 12780717 | <reponame>DVRodri8/advent-of-code-2019<filename>16/main.py
pattern = [0,1,0,-1]
simple = "59768092839927758565191298625215106371890118051426250855924764194411528004718709886402903435569627982485301921649240820059827161024631612290005106304724846680415690183371469037418126383450370741078684974598662642956794012825271487... | 3.0625 | 3 |
logs/main_stringio.py | nekomaruh/Rendimiento_Escolar_en_Chile_2010-2019 | 0 | 12780718 | # Libraries
import pandas as pd
import numpy as np
import interface
import time
def get_dataframes(start_time, year=2010):
dataframes = None
columns_to_drop = interface.get_columns_to_drop()
amount_csv = interface.get_amount_of_csv()
for year in range(year, year+amount_csv):
print('------------... | 3.203125 | 3 |
DeepLib/Nvidia/NvOsd.py | bluetiger9/DeepEye | 57 | 12780719 | <reponame>bluetiger9/DeepEye<filename>DeepLib/Nvidia/NvOsd.py<gh_stars>10-100
## Copyright (c) 2020 <NAME> (<EMAIL>). All rights reserved.
## Licence: MIT
from DeepLib import *
import pyds
PGIE_CLASS_ID_VEHICLE = 0
PGIE_CLASS_ID_BICYCLE = 1
PGIE_CLASS_ID_PERSON = 2
PGIE_CLASS_ID_ROADSIGN = 3
def osd_sink_pad_buffer... | 2.40625 | 2 |
web/premises/migrations/0030_report_reason.py | mehrdad-shokri/arguman.org | 1 | 12780720 | <filename>web/premises/migrations/0030_report_reason.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('premises', '0029_contention_related_nouns'),
]
operations = [
migrat... | 1.75 | 2 |
tests/test_log_format.py | jnbellinger/lta | 1 | 12780721 | # test_log_format.py
"""Unit tests for lta/log_format.py."""
import sys
from requests.exceptions import HTTPError
from .test_util import ObjectLiteral
from lta.log_format import StructuredFormatter
class LiteralRecord(ObjectLiteral):
"""
LiteralRecord is a literal LogRecord.
This class creates an Objec... | 3.09375 | 3 |
StructuralCausalModels/structural_equation.py | Black-Swan-ICL/PySCMs | 1 | 12780722 | <reponame>Black-Swan-ICL/PySCMs
# TODO add string representation of Structural Equation
class StructuralEquation:
"""A class to represent structural equations.
Structural Equations are assignments of the sort
.. math::
X_{i} := g((X_j)_{j ~\in ~J}, U_i),
where :math:`U_i` is an exogenous (ran... | 3.15625 | 3 |
RobotFramework/inventories/production/connectivity_check_v2.py | dmmar/netascode | 36 | 12780723 | # Example
# -------
#
# connectivity_check_v2.py
from pyats import aetest
import re
import logging
# get your logger for your script
logger = logging.getLogger(__name__)
class CommonSetup(aetest.CommonSetup):
# CommonSetup-SubSec1
@aetest.subsection
def check_topology(
self,
testb... | 2.296875 | 2 |
Scripts/chardetect-script.py | linshenping/Python27 | 0 | 12780724 | <filename>Scripts/chardetect-script.py
#!C:\Python27\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'chardet==3.0.4','console_scripts','chardetect'
__requires__ = 'chardet==3.0.4'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('chardet==3.0.4', 'console... | 1.789063 | 2 |
wxpythonopengl.py | aole/boilerplate | 1 | 12780725 |
import wx
import numpy as np
import time
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.arrays import vbo
from OpenGL.GL import shaders
from readobj import Obj3D
__author__ = '<NAME>'
__version__ = '0.1.0'
vertexShader = """
#version 120
void main() {
gl_Posit... | 2.375 | 2 |
backend/error_handlers.py | UIC-InDeXLab/CovidInsights | 0 | 12780726 | <reponame>UIC-InDeXLab/CovidInsights
from backend import app
from flask import jsonify
invalid_country_msg = "Invalid country name. Please check using /list/countries to see valid country names."
invalid_region_msg = "Invalid region name. Please check using /list/regions to see names of regions."
invalid_country_or_no... | 2.359375 | 2 |
app/config.py | Tiebe/EarnApp-Earning-Monitor | 0 | 12780727 | <gh_stars>0
import os
import io
import json
from time import sleep
class Configuration:
def __init__(self) -> None:
self.check_for_existing_config()
# Delay before checking env. Solves docker issues.
sleep(2)
# if config doesn't exist
if self.config_file_exists:
... | 2.359375 | 2 |
django_monitor/price_monitor/urls/__init__.py | jasonljc/enterprise-price-monitor | 0 | 12780728 | from django.conf.urls import url
from .. import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^add/$', views.request_add)
] | 1.492188 | 1 |
writeFullVP.py | maq18/TopoScope | 0 | 12780729 | <filename>writeFullVP.py
import copy, random, os
from collections import defaultdict
from hierarchy import Hierarchy
class GetFullVP(object):
def __init__(self, groupSize, dirs):
self.groupSize = groupSize
self.dir = dirs
if not os.path.exists(self.dir):
os.mkdir(self.dir)
... | 2.546875 | 3 |
setup.py | chrisbarr/bilious-rutabaga | 0 | 12780730 | <filename>setup.py<gh_stars>0
from setuptools import setup, find_packages
setup(
name = 'bucket_lister',
packages = find_packages(),
version = '0.2.3',
description = 'List S3 buckets for an account',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/chrisbarr/bilious-ru... | 1.507813 | 2 |
PP.py | Mukela12/philosophical | 1 | 12780731 | from flask import Flask, render_template, url_for, request, redirect,flash
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__)
@app.route("/", methods=["POST", "GET"])
def Base():
if request.method == "POST":
name = request.form["name"]
email = request.form["emai... | 2.796875 | 3 |
esteira/pipeline/stage.py | guilhermewebdev/esteira | 0 | 12780732 | <filename>esteira/pipeline/stage.py
from .task import Task
class Stage(Task):
before_script = []
script = []
repo_dir = ''
def __init__(self, repo_dir, image=None, external_envs={}):
self.repo_dir = repo_dir
super().__init__(external_envs=external_envs, image=image)
def each_scri... | 2.265625 | 2 |
__init__.py | IBM/alchemy-config | 0 | 12780733 | <filename>__init__.py
#*****************************************************************#
# (C) Copyright IBM Corporation 2020. #
# #
# The source code for this program is not published or otherwise #
# divested of its trade se... | 1.414063 | 1 |
Pomodoro-GUI/main.py | twbm/Git-Learning-Thingy | 1 | 12780734 | from tkinter import *
import time
# ---------------------------- CONSTANTS ------------------------------- #
PINK = "#e2979c"
RED = "#e7305b"
GREEN = "#9bdeac"
YELLOW = "#f7f5dd"
FONT_NAME = "Courier"
WORK_MIN = 25
SHORT_BREAK_MIN = 5
LONG_BREAK_MIN = 20
# ---------------------------- TIMER RESET ---------------------... | 3.09375 | 3 |
test/run.py | mcr/uoscore-uedhoc | 0 | 12780735 | #!/usr/bin/env python3
# Copyright (c) 2021 Fraunhofer AISEC. See the COPYRIGHT
# file at the top-level directory of this distribution.
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/M... | 2.4375 | 2 |
src/gamesbyexample/fizzbuzzgame.py | asweigart/gamesbyexample | 83 | 12780736 | """FizzBuzz Game, by <NAME> <EMAIL>
A number game where you also race against the clock.
Tags: tiny, beginner, game, math"""
__version__ = 0
import sys, time
print('''Fizz Buzz Game, by <NAME> <EMAIL>
Starting with 1, enter increasing numbers.
However, if the number is a multiple of 3, type "fizz" instead of
the numb... | 4.0625 | 4 |
review_ladder/models.py | miri64/review_ladder | 0 | 12780737 | <reponame>miri64/review_ladder<filename>review_ladder/models.py<gh_stars>0
from django.db import models, transaction
from django.db.models import Q, Count
from django.conf import settings
from django.core import validators
import datetime
import dateutil.parser
GITHUB_REPO = "%s/%s" % (settings.GITHUB_REPO_USER, sett... | 2.296875 | 2 |
unit_tests/glhe/profiles/test_external_base.py | stianchris/GLHE | 2 | 12780738 | <gh_stars>1-10
import os
import tempfile
import unittest
from glhe.profiles.external_base import ExternalBase
class TestExternalBase(unittest.TestCase):
@staticmethod
def add_instance():
temp_dir = tempfile.mkdtemp()
temp_csv = os.path.join(temp_dir, 'temp.csv')
with open(temp_csv, ... | 2.28125 | 2 |
example_evaluate_with_diff.py | ducha-aiki/manifold-diffusion | 118 | 12780739 | <gh_stars>100-1000
# EXAMPLE_EVALUATE Code to evaluate example results on ROxford and RParis datasets.
# Revisited protocol has 3 difficulty setups: Easy (E), Medium (M), and Hard (H),
# and evaluates the performance using mean average precision (mAP), as well as mean precision @ k (mP@k)
#
# More details about the r... | 2.34375 | 2 |
leads/views.py | beniman8/django_crm | 0 | 12780740 | from django.core.mail import send_mail
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render,redirect,reverse
from django.http import HttpResponse
from .models import Lead,Agent,Category
from .forms import LeadForm, LeadModelForm,CustomUserCreationForm,AssignAgentForm,LeadCategor... | 1.984375 | 2 |
test/test_loss_metrics/test_loss.py | imabackstabber/segment-with-nn | 0 | 12780741 | # coding=utf-8
''' test case for loss
'''
import tensorflow as tf
from segelectri.loss_metrics.loss import FocalLoss, LovaszLoss, DiceLoss, BoundaryLoss
class TestLoss(tf.test.TestCase):
def setUp(self):
self.y_true = tf.random.uniform((2, 512, 512),
minval=0,
... | 2.265625 | 2 |
miplearn/solvers/tests/test_internal_solver.py | GregorCH/MIPLearn | 0 | 12780742 | <filename>miplearn/solvers/tests/test_internal_solver.py<gh_stars>0
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
import logging
from io i... | 2.234375 | 2 |
serialize/dynamo.py | thorwhalen/ut | 4 | 12780743 | """Dynamo access"""
import os
from time import sleep
import boto.dynamodb2
from .khan_logger import KhanLogger
__author__ = 'mattjmorris'
class Dynamo(object):
def __init__(self, access_key=None, secret=None):
"""
If access_key and/or secret are not passed in, assumes we are accessing erenev's ... | 2.875 | 3 |
scripts/python/road_segments/add_dicast_ids.py | OSADP/Pikalert-Vehicle-Data-Translator- | 2 | 12780744 | <filename>scripts/python/road_segments/add_dicast_ids.py
#!/usr/bin/env python
"""Add dicast site ids to road segment file"""
# ============================================================================== #
# #
# (c) Copyright, 2015 Un... | 2.234375 | 2 |
pji/service/section/info/__init__.py | HansBug/pji | 0 | 12780745 | <filename>pji/service/section/info/__init__.py
from .base import SectionInfoTemplate, SectionInfo
from .general import SectionInfoType, load_info_template
from .local import LocalSectionInfoTemplate, LocalSectionInfo
from .mapping import SectionInfoMappingTemplate, SectionInfoMapping
from .static import StaticSectionIn... | 1.28125 | 1 |
Main.py | dixantmittal/CS5242-CNN-implementation | 0 | 12780746 | # A bit of setup
from __future__ import print_function
import Models
import code_base.solver as slvr
from code_base.data_utils import *
from code_base.layers import *
from code_base.solver import Solver
settings.time_analysis['logger_enabled'] = False
# for auto-reloading external modules
# see http://stackoverflow.... | 2.109375 | 2 |
ds/lru.py | haandol/algorithm_in_python | 0 | 12780747 | class LRUCache(object):
def __init__(self, size):
self.size = size
self.lru = {}
self.cache = {}
self.counter = 0
def put(self, key, value):
if key not in self.cache:
if len(self.lru) >= self.size:
k, _ = min(self.lru.iteritems(), key=lambda x... | 3.609375 | 4 |
app/speech.py | liliangbin/webBot | 2 | 12780748 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from aip import AipSpeech
# 语音识别模块。。
# baidu app use my tel to login
class Speech(object):
def __init__(self):
self.APP_ID = '16250780'
self.APP_KEY = 'xcnrNwkhe61iYGoaZVRNpnma'
self.SECRET_KEY = '<KEY>'
self.client = AipSpeech(self.APP_ID, se... | 3.03125 | 3 |
2020_Challenge/submissions/Andres_Duque/functions.py | UCHIC/CIWS-VisChallenge | 2 | 12780749 | <filename>2020_Challenge/submissions/Andres_Duque/functions.py
"""
<NAME>
"""
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import scipy
from sklearn.decomposition import PCA
import pandas as pd
from matplotlib.patches import Rectangle, Circle
import matplotlib as mpl
impo... | 2.859375 | 3 |
tests/test_config_debug.py | nmichlo/eunomia | 3 | 12780750 | <reponame>nmichlo/eunomia
import re
from eunomia.config.nodes import SubNode
from tests.test_backend_obj import _make_config_group
from tests.util import temp_capture_stdout
# ========================================================================= #
# Test Config Objects ... | 2.171875 | 2 |