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 |
|---|---|---|---|---|---|---|
tacker/api/views/__init__.py | takahashi-tsc/tacker | 116 | 26300 | # Copyright (C) 2020 NTT DATA
# 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
#
# Unless required by ... | 1.835938 | 2 |
users/migrations/0002_auto_20190529_1832.py | VladaDidko/skill- | 0 | 26301 | # Generated by Django 2.2.1 on 2019-05-29 15:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='gender',
fi... | 1.90625 | 2 |
SC001_2021.Jan-Feb/Assignment_3/hangman.py | pcdd05/stanCode_python | 0 | 26302 | <filename>SC001_2021.Jan-Feb/Assignment_3/hangman.py<gh_stars>0
"""
File: hangman.py
Name: DiCheng
-----------------------------
This program plays hangman game.
Users sees a dashed word, trying to
correctly figure the un-dashed word out
by inputting one character each round.
If the user input is correct, show the
upda... | 3.984375 | 4 |
CyberPi/Python with CyberPi 064(面向对象 精灵游戏).py | SCSZCC/PythonWithHardware | 2 | 26303 | """"
名称:064 童芯派 面向对象 体感小飞机
硬件: 童芯派
功能介绍:
使用童芯派的精灵功能在屏幕上编写了一个基于陀螺仪控制的体感小游戏,控制角色飞机躲避空中的子弹。
难度:⭐⭐⭐
支持的模式:上传模式
无
"""
# ---------程序分割线----------------程序分割线----------------程序分割线----------
import cyberpi
import random
import math
import time
class Enemy:
def __init__(self):
self.x = random.randint(0, 128)
... | 3.703125 | 4 |
venv/Lib/site-packages/PyQt4/examples/designer/plugins/widgets/polygonwidget.pyw | prateekfxtd/ns_Startup | 1 | 26304 | <gh_stars>1-10
#!/usr/bin/env python
"""
polygonwidget.py
A PyQt custom widget example for Qt Designer.
Copyright (C) 2006 <NAME> <<EMAIL>>
Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | 3.25 | 3 |
wflow-water-index/wflow-water-index.py | Fondus/Fondus-Python-SDK | 0 | 26305 | <filename>wflow-water-index/wflow-water-index.py
import argparse
import datetime
import math
from netCDF4 import Dataset
import numpy as np
import threading
import queue
# Worker 類別,負責處理資料
class Worker(threading.Thread):
def __init__(self, req, res, num):
threading.Thread.__init__(self)
self.req ... | 2.5625 | 3 |
plugins/input_fsx/datachannel.py | tunstek/hexi | 14 | 26306 | import time
import asyncio
import random
import pyee
import logging
from plugins.input_fsx import fsx_pb2
from hexi.service import event
_logger = logging.getLogger(__name__)
class UDPServer(asyncio.DatagramProtocol):
def __init__(self, manager, token):
super().__init__()
self.manager = manager
self... | 2.328125 | 2 |
shell/my_shell.py | utep-cs-systems-courses/os-shell-joshuaramoscs | 0 | 26307 | <filename>shell/my_shell.py
#! /usr/bin/env python3
import os, sys, time, re
from my_readLine import my_readLine
# Set prompt to '$' if not set
def set_prompt():
# if not os.environ["PS1"]:
os.environ["PS1"] = '$'
# Change directory
def my_cd(args):
if len(args) == 1 or len(args) > 2: # If just cd or... | 2.96875 | 3 |
activity/views.py | AkshayVKumar/ActivityManager | 0 | 26308 | <reponame>AkshayVKumar/ActivityManager<filename>activity/views.py<gh_stars>0
from rest_framework import viewsets
from .serializers import MemberSerializer, ActivityPeriodSerializer
from activity.models import UserProfile, ActivityPeriod
from django.http import JsonResponse
#class for displaying members
class MemberVie... | 2.171875 | 2 |
LJ_surrogates/parameter_modification.py | SimonBoothroyd/LJ_surrogates | 0 | 26309 | from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
from simtk import openmm, unit
from scipy.stats import distributions
import copy
import numpy as np
import os
from smt.sampling_methods import LHS
def vary_parameters_lhc(filename, num_samples, output_directory):
forcefield = ForceField(file... | 2.015625 | 2 |
order/models/customers.py | fbsamples/cp_reference | 2 | 26310 | <reponame>fbsamples/cp_reference
# Copyright 2004-present, Facebook. All Rights Reserved.
from django.db import models
from core.models import BaseModel
class Customer(BaseModel):
"""Represent a single customer instance
fields:
store: the store this customer belongs to
full_name: customer full name
... | 2.71875 | 3 |
kuzushiji/classify/level2.py | littlerain2310/japances_character | 81 | 26311 | import argparse
from collections import defaultdict
import pickle
import re
import lightgbm as lgb
import pandas as pd
import numpy as np
import xgboost as xgb
from ..data_utils import SEG_FP, get_encoded_classes
from ..utils import print_metrics
from ..metric import get_metrics
from .blend import (
score_predict... | 2.234375 | 2 |
vkwave/vkscript/__init__.py | krasnovmv/vkwave | 222 | 26312 | <reponame>krasnovmv/vkwave<gh_stars>100-1000
import vkwave.vkscript.handlers.assignments
import vkwave.vkscript.handlers.blocks
import vkwave.vkscript.handlers.calls
import vkwave.vkscript.handlers.expressions
import vkwave.vkscript.handlers.statements
import vkwave.vkscript.handlers.types
from .converter import VKScri... | 1.210938 | 1 |
greeting/cliente.py | javalisson/Sockets | 2 | 26313 | <reponame>javalisson/Sockets<filename>greeting/cliente.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# adaptado de https://wiki.python.org/moin/TcpCommunication
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 1024
NOME = "Javalisson"
print ("[CLIENTE] Iniciando")
s = socket.socket(socket.AF_IN... | 3.375 | 3 |
blog/migrations/0001_initial.py | jxtxzzw/eoj3 | 1 | 26314 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-04-06 16:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 1.78125 | 2 |
crawler-pcstore/CrawlerForPcstore.py | hms5232/CaiBiBa | 0 | 26315 | import requests
from bs4 import BeautifulSoup
# 聽說要空兩行,註解要空一格
# 搜尋
def search_title(html):
key = input("請輸入關鍵字:") # input key words
starttag = html.find(key) # the index of word user wants
# I got it!
if starttag != -1:
# 找到關鍵字之後把往後到下一個標籤之前的字抓起來
for j in range(starttag, len(html)):
... | 3.421875 | 3 |
Posts/migrations/0001_initial.py | rosekairu/Neighbourly | 0 | 26316 | # Generated by Django 3.0.8 on 2020-07-19 17:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phone_field.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | 1.710938 | 2 |
pip_services3_container/build/DefaultContainerFactory.py | banalna/pip-services3-container-python | 0 | 26317 | # -*- coding: utf-8 -*-
"""
pip_services3_container.build.DefaultContainerFactory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default container factory implementation
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE f... | 2.046875 | 2 |
com/vmware/vapi/protocol/server/transport/msg_handler.py | sumitrsystems/Vmware | 0 | 26318 | """
Msg based protocol handler
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2015, 2017 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long
from collections import deque
from vmware.vapi.lib.log import get_vapi_logger
from vmware.vapi.protocol.server.api_handler i... | 1.921875 | 2 |
validation_tests/case_studies/merewether/plot_results.py | samcom12/anuga_core | 136 | 26319 | from anuga.utilities import plot_utils as util
from matplotlib import pyplot as pyplot
import numpy
verbose= True
swwfile = 'merewether_1m.sww'
p=util.get_output(swwfile)
p2=util.get_centroids(p)
# Time index at last time
tindex = len(p2.time)-1
if verbose: print('calculating experimental transect')
x_data = ... | 2.234375 | 2 |
examples/ignore_early_canceled_tests.py | adavidzh/openhtf | 1 | 26320 | # Copyright 2018 Google Inc. 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
# Unless required by applicable law or agre... | 2.28125 | 2 |
myproject/products/views.py | abhishekmorya/django-rest-assignment | 0 | 26321 | from rest_framework import viewsets, filters, mixins
from rest_framework.response import Response
from products import models
from products import serializers
class CategoryApiView(viewsets.ReadOnlyModelViewSet):
"""API View for Category"""
serializer_class = serializers.CategorySerializer
queryset... | 2.28125 | 2 |
R function.py | haideraheem/Simple-Python-Programs | 0 | 26322 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 6 17:11:11 2018
@author: <NAME>
"""
a= float(input("Type a : "))
b= float(input("Type b : "))
c= float(input("Type c : "))
x= (a*b)+(b*c)+(c*a)
y= (a+b+c)
r= x/y
print( )
print("The result of the calculation is {0:.2f}".format(r)) | 3.8125 | 4 |
src/selectedtests/app/controllers/health_controller.py | isabella232/selected-tests | 2 | 26323 | """Controller for the health endpoints."""
from fastapi import APIRouter
from pydantic import BaseModel
router = APIRouter()
class HealthCheckResponse(BaseModel):
"""Model for health check responses."""
online: bool
@router.get("", response_model=HealthCheckResponse, description="Health check endpoint")
d... | 2.90625 | 3 |
Client/message/friend.py | Ricky-Hao/IMPK-Client | 0 | 26324 | <reponame>Ricky-Hao/IMPK-Client
from .base import BaseMessage
class FriendMessage(BaseMessage):
def __init__(self, data=None):
super().__init__(data)
def _init_type(self):
self.type = 'FriendMessage'
def _parse_dict(self, data):
super()._parse_dict(data)
self.friend_list =... | 2.5 | 2 |
Pyon exercicios/Exercicios/066.py | alefbispo/Exercicios-do-curso-de-Python | 0 | 26325 | '''Crie um programa que leia varios numeros inteiros
o programa so vai parar qunado o usuario digitar 999
no final mostre a soma entre eles e quanto foram digitados'''
soma = total = 0
while True:
valor = int(input('## 999 para parar ###\n'
'Digite um valor: '))
if valor == 999:
... | 3.890625 | 4 |
bookorbooks/account/migrations/0008_auto_20210714_1507.py | talhakoylu/SummerInternshipBackend | 1 | 26326 | # Generated by Django 3.2.5 on 2021-07-14 15:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0007_alter_childlist_child'),
]
operations = [
migrations.Alter... | 1.476563 | 1 |
src/subpackages/ts_process/shape.py | cfiscella/PredictionIntervals | 0 | 26327 | <filename>src/subpackages/ts_process/shape.py
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler,StandardScaler
def shape_data(df,window):
'''
Returns Numpy array of dimension (len(df),window,len(df.columns)). Creates features from lags of time series to be used for modeling.... | 3.375 | 3 |
python_3/aula21c.py | felipesch92/CursoEmVideo | 0 | 26328 | # Programa Principal
def teste():
x = 8
print(f'Na função teste, n vale {n}')
print(f'Na função teste x vale {x}')
n = 2
print(f'No programa principal, n vale {n}')
teste()
print(f'No programa principal, x vale {x}')
| 3.0625 | 3 |
test/test_conf.py | nandub/Limnoria | 476 | 26329 | ##
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binar... | 1.445313 | 1 |
app/model.py | tai-calg/gameserver | 0 | 26330 | <gh_stars>0
# flake8: noqa
import json
from unicodedata import name
import uuid
from enum import Enum, IntEnum
from typing import Optional
from unittest import result
from fastapi import HTTPException
from pydantic import BaseModel
from sqlalchemy import text, true
from sqlalchemy.exc import NoResultFound
from .db... | 2.3125 | 2 |
gwlfe/StreamBank.py | rajadain/gwlf-e | 0 | 26331 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""
Imported from StreamBank.bas
"""
import logging
from .Input.LandUse.AreaTotal import AreaTotal_f
from .Input.LandUse.Ag.AGSTRM import AGSTRM_f
from .Input.LandUse.Ag.TileDrain impo... | 2.34375 | 2 |
AutoGraphModel.py | shiqitao/AutoGraph | 0 | 26332 | <filename>AutoGraphModel.py
import argparse
import os
import time
import torch
from filelock import FileLock
from ModelAPPNP import main_model_appnp
from ModelAPPNP2 import main_model_appnp as main_model_appnp_2
from ModelAPPNP3 import main_model_appnp as main_model_appnp_3
from ModelAPPNP4 import main_model_appnp as... | 2.28125 | 2 |
green_snake/files.py | tetio/green_snake | 0 | 26333 | <gh_stars>0
import os
# import sys
# from shutil import copyfile
# import time
def getFilesFromFolder(path):
files = []
# r=root, d=directories, f = files
for r, d, f in os.walk("./resources/"+path):
for file in f:
if not file.startswith(".") and file.endswith(".msg"): # ".msg" in file... | 2.3125 | 2 |
feedzero/users/urls.py | dammitjim/badfeed | 0 | 26334 | from django.urls import include, path
from feedzero.users.views import LogoutView
app_name = "users"
urlpatterns = [
path("logout/", LogoutView.as_view(), name="logout"),
path("integrations/pocket/", include("feedzero.users.integrations.pocket.urls")),
]
| 1.617188 | 2 |
allies/serializers.py | PaulLerner/Allies | 0 | 26335 | <filename>allies/serializers.py
import numpy as np
import pickle
import struct
class Serializer:
def serialize(self, model):
"""
Serialize a model dict to a string of uint8 bytes
:param model: a dict with model components
:return: a np.array of uint8
"""
raise NotI... | 2.84375 | 3 |
examples/example_1.py | alfredocarella/code-for-the-world | 12 | 26336 | # -*- coding: utf-8 -*-
"""Example 1: Load and plot airfoil coordinates
"""
import os
import matplotlib.pyplot as plt
from mypack.utils.io import read_selig
from mypack.utils.plotting import plot_airfoil
def example_1():
"""Run example 1"""
# script inputs
mod_path = os.path.dirname(os.path.abspath(__fi... | 2.796875 | 3 |
myenv/lib/python2.7/site-packages/tests/admin.py | dkumarlinux/saleor | 1 | 26337 | <gh_stars>1-10
from django.contrib import admin
from django.forms import ModelForm
from versatileimagefield.widgets import VersatileImagePPOISelectWidget
from .models import VersatileImageTestModel, VersatileImageWidgetTestModel
class VersatileImageTestModelForm(ModelForm):
class Meta:
model = Versatil... | 1.914063 | 2 |
alembic/versions/9cae282981fd_waze_object_ended_at.py | shaysw/anyway | 69 | 26338 | <reponame>shaysw/anyway<filename>alembic/versions/9cae282981fd_waze_object_ended_at.py<gh_stars>10-100
"""waze object ended at
Revision ID: 9cae282981fd
Revises: <PASSWORD>
Create Date: 2020-10-20 18:34:54.574378
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = 'cac481832078'
branch_la... | 1.515625 | 2 |
cohesity_management_sdk/models/object_status_enum.py | nick6655/management-sdk-python | 18 | 26339 | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class ObjectStatusEnum(object):
"""Implementation of the 'ObjectStatus' enum.
Specifies the status of an object during a Restore Task.
'kFilesCloned' indicates that the cloning has completed.
'kFetchedEntityInfo' indicates that information about ... | 1.320313 | 1 |
apps/backend/components/collections/base.py | ZhuoZhuoCrayon/bk-nodeman | 31 | 26340 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file exce... | 1.523438 | 2 |
warpworks/views/index.py | storborg/warpworks | 0 | 26341 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from pyramid.view import view_config
from pyweaving.generators.twill import twill
@view_config(route_name='index', renderer='index.html')
def index_view(request):
draft = twill(2, warp_color=(200, 0, 0), ... | 2.25 | 2 |
linux_odp/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cs.py | dproc/trex_odp_porting_integration | 0 | 26342 | <reponame>dproc/trex_odp_porting_integration<gh_stars>0
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
from waflib import Utils,Task,Options,Logs,Error... | 1.867188 | 2 |
fbpmp/utils/abstract_file_ctx.py | benliugithub/fbpcs | 0 | 26343 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import os
import pathlib
from fbpcp.service.storage_s3 import S3StorageService
from fbpmp.utils.buff... | 2.109375 | 2 |
prometheus_redis_client/helpers.py | ChielWH/prometheus_redis_client | 19 | 26344 | import time
from typing import Callable
from functools import wraps
def timeit(metric_callback: Callable, **labels):
def wrapper(func):
@wraps(func)
def func_wrapper(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
metric_callback(time.time()... | 3.015625 | 3 |
tests/test_build.py | polishmatt/swp | 1 | 26345 | <reponame>polishmatt/swp<filename>tests/test_build.py
import unittest
import filecmp
from stawp.build import Builder
class TestBuild(unittest.TestCase):
def build_fixture(self, name, description):
dest='/tmp/swp'
source='tests/fixtures/%s/src' % name
builder = Builder(dist=dest, base=sour... | 2.359375 | 2 |
ARP-SPOOF.py | DEMON1A/ARP-SP00FER | 2 | 26346 | # Start Imports.
import scapy.all as scapy
import time , sys
def Banner():
# One Line Banner
Ban = "\t\t\t\t\t[+] << ARP-SP00F (MITM) >> [+]"
print(Ban)
Banner()
Address = input("\nTarget IP >> ")
MainIP = input("Network IP >> ")
Packets = 0
def MAC_SCAN(ip):
arp = scapy.ARP(pdst=ip)
broadcast =... | 2.9375 | 3 |
ebrains_drive/repo.py | apdavison/ebrains-drive | 5 | 26347 | from urllib.parse import urlencode
from ebrains_drive.files import SeafDir, SeafFile
from ebrains_drive.utils import raise_does_not_exist
class Repo(object):
"""
A seafile library
"""
def __init__(self, client, **kwargs):
self.client = client
allowed_keys = ['encrypted', 'group_name', ... | 2.578125 | 3 |
dice_vtk/geometries/regularPolygon.py | dicehub/dice_vtk | 0 | 26348 | <gh_stars>0
# External modules
# ================
from vtk import vtkRegularPolygonSource
# DICE modules
# ============
from .simple_geometry import SimpleGeometry
from .geometry_base import GeometryProperty
class RegularPolygon(SimpleGeometry):
def __init__(self, name='RegularPolygon', **kwargs):
super(... | 2.140625 | 2 |
setup.py | erisyon/plaster | 0 | 26349 | <reponame>erisyon/plaster
# python setup.py build_ext --inplace
import importlib
import os
import pathlib
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext as build_ext_orig
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README fi... | 2.171875 | 2 |
src/commands/ctx.py | jportner/kibbe | 2 | 26350 | <filename>src/commands/ctx.py
import os
from pathlib import Path
from src.git import find_existing_worktree, get_worktree_list_flat
from src.tmux import get_current_panel, is_inside_tmux
import subprocess
import click
from termcolor import colored
from src.util import get_valid_filename
@click.command()
@click.argu... | 2.46875 | 2 |
code/biases_generation/biases_generation.py | commonsense-exception/commonsense-exception | 0 | 26351 | <gh_stars>0
import pandas as pd
import sys, argparse
import importlib.util
from tqdm import tqdm
NUM_SELECTING = 10
def parse_args():
parser = argparse.ArgumentParser(description='arguments for generating biases')
parser.add_argument('-top', help="Size of intersection of interest", default=10)
parser.add_... | 2.390625 | 2 |
qf_lib/documents_utils/document_exporting/element/custom.py | webclinic017/qf-lib | 198 | 26352 | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | 2.328125 | 2 |
api/urls.py | GHImplementationTeam/referrals | 0 | 26353 | from django.conf.urls import url
import referrals
urlpatterns = [
url(r'^referrals/$', referrals.ReferralsView.as_view()),
url(r'^referral/(?P<referral_id>[-&\w]+)/$', referrals.ReferralView.as_view()),
]
| 1.648438 | 2 |
venv/webscrap_teste.py | pgfjunior/teste_web_scraping | 0 | 26354 | <reponame>pgfjunior/teste_web_scraping<filename>venv/webscrap_teste.py
import urllib.request
from bs4 import BeautifulSoup
page = urllib.request.urlopen('https://www.dentalcremer.com.br/')
soup = BeautifulSoup(page, "html.parser")
print(soup.find_all('table'))
| 2.921875 | 3 |
datasets/ner_dataset.py | saiajaym/MetaLearningForNER | 3 | 26355 | <filename>datasets/ner_dataset.py
import itertools
import json
import os
import random
from collections import defaultdict, Counter
from tqdm.auto import tqdm, trange
from torch.nn import CrossEntropyLoss
from torch.utils import data
import numpy as np
from datasets import utils
class NERSampler:
def __init__(s... | 2.453125 | 2 |
tests/test_testoot/conftest.py | sobolevn/testoot | 2 | 26356 | from typing import Optional
import pytest
from testoot.base import TestootContext, Comparator, TestootSerializer, \
FileType, TestootTestResult
from testoot.ext.pytest import PytestContext
from testoot.testoot import Testoot
from tests.conftest import AbcDiffResult
@pytest.fixture(scope='module')
def base_testo... | 2.109375 | 2 |
peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py | uvic-proteincentre/MRMAssayDB | 0 | 26357 | <filename>peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pepmapperapp', '0001_initial'),
]
operations = [
... | 1.820313 | 2 |
stream/utils.py | maddevsio/yourcast-web | 8 | 26358 | # -*- coding: utf-8 -*-
import json
from random import shuffle
def serialize_stream(stream):
items = stream.youtube_links.split("\n")
if stream.play_random:
shuffle(items)
return {
"id": stream.pk,
"name": stream.name,
"slug": stream.slug,
"keywords": stream.keywords... | 2.84375 | 3 |
laterpay/compat.py | laterpay/laterpay-client-python | 3 | 26359 | # -*- coding: utf-8 -*-
import warnings
import six
def encode_if_unicode(value, encoding='utf-8'): # pragma: no cover
"""
Encode and return a ``value`` using specified ``encoding``.
Encoding is done only if ``value`` is a ``unicode`` instance
(utf-8 encoding is used as default).
.. deprecated:... | 3.484375 | 3 |
main.py | irahorecka/craigslist-housing-subscription | 0 | 26360 | <filename>main.py
"""
Main file to find and send user Craigslist housing posts.
"""
import time
import users
import posts
import mail
def main():
"""Main app to execute subscription based email notifications."""
users_json = users.get_users()
# At start of subscription, drop all content and populate db w... | 2.765625 | 3 |
python/1469_Find_All_Lonely_Nodes.py | liaison/LeetCode | 17 | 26361 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def getLonelyNodes(self, root: TreeNode) -> List[int]:
lonely_nodes = []
def dfs(no... | 3.640625 | 4 |
models/discrete_models/compression/compress_N_fast.py | openworm/behavioral_syntax | 3 | 26362 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 21:55:56 2015
@author: aidanrocke
"""
import numpy as np
def compressSequenceNFast(posture_seq, newStart, nMax):
"""
# COMPRESSSEQUENCE Recursively finds the most compressive subsequence in
# posture_seq and creates and replaces it with a new number. Thi... | 2.9375 | 3 |
hdmi/cores/transmitter/convert_30_to_15.py | srivatsan-ramesh/HDMI-Source-Sink-Modules | 10 | 26363 | from myhdl import Signal, intbv, always, always_comb, block, instances
from hdmi.cores.primitives import dram16xn
@block
def convert_30_to_15(reset, clock, clockx2, data_in, tmds_data2, tmds_data1, tmds_data0):
"""
The block converts the 30-bit data into 15-bit data.
Args:
reset: The reset sig... | 2.828125 | 3 |
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/rest_commands.py | slab14/metron | 1 | 26364 | <gh_stars>1-10
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (... | 1.796875 | 2 |
alipay/aop/api/response/AlipayPcreditHuabeiGoodsCategoryQueryResponse.py | antopen/alipay-sdk-python-all | 0 | 26365 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.GoodsCategoryResult import GoodsCategoryResult
class AlipayPcreditHuabeiGoodsCategoryQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayPcred... | 2.078125 | 2 |
gadk/cli.py | stucox/gadk | 1 | 26366 | <reponame>stucox/gadk
import importlib
import inspect
from os import getcwd, makedirs
from os.path import exists
from typing import List, Set, Optional
import click
import sys
from gadk import Workflow
def output_to_file(workflow: Workflow):
"""Write the workflow to .github/workflows/{workflow.filename}.yml."""... | 2.765625 | 3 |
hummingbot/cli/utils/symbol_splitter.py | mitakash/hummingbot | 0 | 26367 | import re
from typing import Tuple
BINANCE_SYMBOL_SPLITTER = re.compile(r"^(\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$")
class SymbolSplitter:
def __init__(self, market: str, symbol: str):
self._symbol: Tuple[str, str] = self.split(market, symbol)
@property
def base_asset(self):
return s... | 3.515625 | 4 |
headerstest.py | mzeinstra/openAnalyser | 1 | 26368 | from urllib.parse import urlparse
from bs4 import BeautifulSoup
import urllib3
from socket import timeout
import tldextract
import re
import traceback
import sys
import logging
import socket
import threading
from time import sleep
from collector import Collector
from checker import Checker
http = urllib3.PoolManager(... | 2.84375 | 3 |
counterfit/core/attacks.py | Mandroide/counterfit | 0 | 26369 | <gh_stars>0
import datetime
import uuid
import numpy as np
from hyperopt import pyll
from counterfit.core import enums
from counterfit.core.interfaces import AbstractAttack
class Attack(AbstractAttack):
"""Attack class inherits AbstractAttack and sets attack parameters. It also persists attack results and logs t... | 2.421875 | 2 |
electronics/scripts/generate_svg.py | chrisdearman/splitflap | 2,138 | 26370 | <filename>electronics/scripts/generate_svg.py<gh_stars>1000+
#!/usr/bin/env python3
# Copyright 2015-2016 <NAME> and the splitflap contributors
#
# 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 Li... | 2.3125 | 2 |
flloat/__version__.py | aadeshnpn/flloat | 0 | 26371 | <gh_stars>0
# -*- coding: utf-8 -*-
__title__ = "flloat"
__description__ = "A Python implementation of the FLLOAT library."
__url__ = "https://github.com/marcofavorito/flloat.git"
__version__ = "1.0.0a0"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__license__ = "MIT license"
__copyright__ = "2019 <NAME>"
| 1.125 | 1 |
app/blog/blog_entries/migrations/0002_remove_article_for_adult.py | Risoko/DRF-Auth-With-Blog-Entries | 0 | 26372 | # Generated by Django 3.0.1 on 2020-01-08 08:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog_entries', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='for_adult',
),
... | 1.507813 | 2 |
leetcode/easy/rotated-digits.py | vtemian/interviews-prep | 8 | 26373 | class Solution:
def rotatedDigits(self, N: 'int') -> 'int':
result = 0
for nr in range(1, N + 1):
ok = False
for digit in str(nr):
if digit in '347':
break
if digit in '6952':
ok = True
els... | 3.3125 | 3 |
bis/apps/incubator/models/stages.py | AgustinMachiavello/business-incubation-system | 2 | 26374 | <gh_stars>1-10
"""
Stage model
"""
# Models
from django.db import models
from .timeStampMixin import TimeStampMixin
from ..models.projects import Project
# Date and time
from django.utils import timezone
class Stage(TimeStampMixin, models.Model):
STAGE_TYPE_CHOICES = [
('EP', 'En Postulación'),
... | 2.296875 | 2 |
src/process_particle_sys.py | faycalki/tainted-paths | 4 | 26375 | <filename>src/process_particle_sys.py
import sys
sys.dont_write_bytecode = True
from module_info import *
from module_particle_systems import *
from process_common import *
# Lav's export_dir tweak
export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/')
id_pos = 0
flags_pos = 1
mesh_name_pos = 2
nu... | 2.171875 | 2 |
local_configs/write_config.py | wzpscott/SegformerDistillation | 0 | 26376 | import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('config_path')
parser.add_argument('sh_path',default='train_10.24.sh')
args = parser.parse_args()
config_path = args.config_path
sh_path = args.sh_path
with open(f'/home/mist/SegformerDistillation/local_configs/{sh_path}','w') as f:
f... | 2.1875 | 2 |
boris/reporting/reports/clients.py | fragaria/BorIS | 1 | 26377 | <reponame>fragaria/BorIS
# -*- coding: utf-8 -*-
from boris import utils
import datetime
from django.contrib.contenttypes.models import ContentType
from django.template import loader
from django.template.context import RequestContext
from django.utils.translation import ugettext_lazy as _
from boris.classification imp... | 1.882813 | 2 |
1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/GMM.py | yzy1996/Artificial-Intelligence | 7 | 26378 | <filename>1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/GMM.py<gh_stars>1-10
'''
混合高斯模型
使用多个高斯模型来拟合数据分布
'''
import numpy as np
| 1.304688 | 1 |
app1/mercado_externo.py | Nicolasvegam/astrazeneca | 0 | 26379 | import json
frecuencias = [
{
"tag": "company",
"count": 44
},
{
"tag": "team",
"count": 44
},
{
"tag": "experience",
"count": 43
},
{
"tag": "global",
"count": 42
},
{
"tag": "local",
"count": 41
},
{
"tag": "we",
"count": 40
},
{
"tag": "ex... | 2.3125 | 2 |
servers/__init__.py | shubhamdipt/monitoring-dashboard | 1 | 26380 | default_app_config = 'servers.apps.ServersConfig' | 1.132813 | 1 |
config.py | SoCaTel/backend-storage | 0 | 26381 | #--------------------------------------------------------------------------------
# SoCaTel - Backend data storage API endpoints docker container
# These tokens are needed for database access.
#--------------------------------------------------------------------------------
#===========================================... | 1.46875 | 1 |
vet_care/vet_care/report/vc_sales_transaction/vc_sales_transaction.py | neerajvkn/vet_care | 2 | 26382 | # Copyright (c) 2013, 9T9IT and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import fmt_money
from toolz.curried import compose, groupby, valmap, first, reduce, unique, pluck, count, partial
def execute(fil... | 1.921875 | 2 |
integration-test/1634-hide-early-nursing-home.py | rinnyB/vector-datasource | 0 | 26383 | # -*- encoding: utf-8 -*-
from . import FixtureTest
class HideEarlyNursingHomeTest(FixtureTest):
def test_nursing_home_area(self):
import dsl
z, x, y = (15, 5237, 12667)
self.generate_fixtures(
# https://www.openstreetmap.org/way/267296981
dsl.way(267296981, dsl.... | 2.265625 | 2 |
mido_midifile.py | olemb/rawmidifile | 0 | 26384 | """
MIDI file reader and writer for Mido built on top of rawmidifile.
There is no official API in Mido for encoding and decoding meta
messages so I've had to use some internal functions.
"""
from rawmidifile import read_rawmidifile, write_rawmidifile
import mido
from mido.midifiles.meta import (build_meta_message,
... | 2.71875 | 3 |
src/Tools/CodeGenerator/Plugins/SharedLibraryTestsPluginImpl/ScalarTypeInfos.py | Bhaskers-Blu-Org2/FeaturizersLibrary | 15 | 26385 | # ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License
# ----------------------------------------------------------------------
"""Contains the scalar type info objects"""
import os
import textwrap
... | 1.984375 | 2 |
testing/solid_growthremodeling_fiberstretch.py | marchirschvogel/amb | 0 | 26386 | #!/usr/bin/env python3
### block that grows in fiber direction triggered by fiber stretch and remodels to softer material
# TODO: Somehow, this does not converge quadratically at the end (seems irrespective of remodeling,
# but likely to be attributed to the growth in fiber direction) ---> check linearization terms!
... | 1.914063 | 2 |
src/dynamodb_encryption_sdk/materials/__init__.py | ajw-aws/aws-dynamodb-encryption-python | 0 | 26387 | <reponame>ajw-aws/aws-dynamodb-encryption-python<filename>src/dynamodb_encryption_sdk/materials/__init__.py
# Copyright 2018 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 c... | 2.0625 | 2 |
src/ramstk/views/gtk3/preferences/view.py | TahaEntezari/ramstk | 26 | 26388 | <reponame>TahaEntezari/ramstk
# pylint: disable=unused-import, missing-docstring
# -*- coding: utf-8 -*-
#
# ramstk.views.gtk3.preferences.view.py is part of the RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""RAMSTK GTK3 Preferen... | 1.789063 | 2 |
binascii_.py | hlovatt/PyBoardTypeshedGenerator | 5 | 26389 | <filename>binascii_.py<gh_stars>1-10
"""
Generate `pyi` from corresponding `rst` docs.
"""
import rst
from rst2pyi import RST2PyI
__author__ = rst.__author__
__copyright__ = rst.__copyright__
__license__ = rst.__license__
__version__ = "7.2.0" # Version set by https://github.com/hlovatt/tag2ver
def binascii(shed: ... | 2.375 | 2 |
examples/deco_add_param.py | scholer/clize | 390 | 26390 | <gh_stars>100-1000
from sigtools.wrappers import decorator
from clize import run
@decorator
def with_uppercase(wrapped, *args, uppercase=False, **kwargs):
"""
Formatting options:
:param uppercase: Print output in capitals
"""
ret = wrapped(*args, **kwargs)
if uppercase:
return str(ret... | 3.109375 | 3 |
spikey/core/__init__.py | SpikeyCNS/spikey | 4 | 26391 | """
Core __init__.
"""
try:
from spikey.core.callback import ExperimentCallback, RLCallback, TDCallback
from spikey.core.training_loop import TrainingLoop, GenericLoop
except ImportError as e:
raise ImportError(f"core/__init__.py failed: {e}")
| 1.703125 | 2 |
src/abaqus/Calibration/CalibrationModel.py | Haiiliin/PyAbaqus | 7 | 26392 | from ..Calibration.Calibration import Calibration
from ..Model.ModelBase import ModelBase
class CalibrationModel(ModelBase):
"""Abaqus creates a Model object named `Model-1` when a session is started.
Notes
-----
This object can be accessed by:
.. code-block:: python
mdb.models[name]
... | 2.828125 | 3 |
Python-Programming(icourse163.org)/7/7-2.py | takuron/Lesson | 0 | 26393 | import math
x = int(input())
sinn = math.sin(math.radians(15))
son = math.exp(x)-5*x
mon = math.pow((x**2+1),0.5)
lnn = math.log(3*x)
print("%.10f"%(sinn+son/mon-lnn))
| 3.328125 | 3 |
kvmagent/kvmagent/plugins/vm_plugin.py | zstackio/zstack-utility | 55 | 26394 | <gh_stars>10-100
'''
@author: Frank
'''
import contextlib
import os.path
import tempfile
import time
import datetime
import traceback
import xml.etree.ElementTree as etree
import re
import platform
import netaddr
import uuid
import shutil
import simplejson
import base64
import uuid
import json
import socket
from signal... | 1.507813 | 2 |
dics_megset.py | larsoner/beamformer_simulation | 0 | 26395 | import mne
import numpy as np
import pandas as pd
from mne.beamformer import make_dics, apply_dics_csd
from config import dics_settings, fname, args
from megset.config import fname as megset_fname
from megset.config import freq_range
subject = args.subject
print(f'Running analsis for subject {subject}')
mne.set_log_... | 2.390625 | 2 |
analyze_clusters.py | sopeeweje/NLP-AI-Diagnosis | 0 | 26396 | import csv
from sklearn.cluster import MiniBatchKMeans
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import pickle
import numpy as np
import sklearn.metrics as metrics
from yellowbrick.cluster import InterclusterDistance
from scipy.optimize import curve_fit
import umap.umap_ as umap
from col... | 2.875 | 3 |
seeq/addons/correlation/_utils/_permissions.py | seeq12/seeq-correlation | 2 | 26397 | from seeq.sdk.rest import ApiException
from . import print_red
def permissions_defaults(permissions_group: list, permissions_users: list):
if permissions_group is None:
permissions_group = ['Everyone']
if permissions_users is None:
permissions_users = []
return permissions_group, permissi... | 2.59375 | 3 |
zignet/api.py | Rabbit-Development/Zignet | 0 | 26398 | <reponame>Rabbit-Development/Zignet
from zignet import controller, db
from zignet.models import *
from flask import request, abort, make_response
@controller.route('/login', methods = ['POST'])
def login():
username = request.get('username')
password = request.get('password')
Rfid = request.get('Rfid')
pincode = r... | 2.65625 | 3 |
observatory-platform/observatory/platform/utils/proc_utils.py | metasj/observatory-platform | 0 | 26399 | # Copyright 2020 Curtin University
#
# 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 writi... | 2.953125 | 3 |