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 |
|---|---|---|---|---|---|---|
tests/k8s/k8s_test_utilities.py | shubav/sonic-mgmt | 132 | 34500 | import logging
import time
from tests.common.helpers.assertions import pytest_assert
logger = logging.getLogger(__name__)
def join_master(duthost, master_vip):
"""
Joins DUT to Kubernetes master
Args:
duthost: DUT host object
master_vip: VIP of high availability Kubernetes master
If... | 2.3125 | 2 |
registryServer/apps/account/api.py | HumanDynamics/openPDS-RegistryServer | 7 | 34501 | <gh_stars>1-10
from django.contrib.auth.models import User
from apps.account.models import Profile, Group
from tastypie import fields
from tastypie.authorization import DjangoAuthorization, Authorization
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie.exceptions import BadRequest
fro... | 2.234375 | 2 |
rules/workspace/def.bzl | viovanov/kubecf | 0 | 34502 | """An extension for workspace rules."""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//:dependencies.bzl", "dependencies")
def _workspace_dependencies_impl(ctx):
platform = ctx.os.name if ctx.os.name != "mac os x" else "darwin"
for dependency in dependencies:
ctx.download(
executabl... | 2.21875 | 2 |
tests/surftrace_test.py | aliyun/surftrace | 32 | 34503 | <reponame>aliyun/surftrace<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: surftrace_test.py
Description :
Author : liaozhaoyan
date: 2022/2/27
-------------------------------------------------
Change Activity:
... | 1.9375 | 2 |
backend/secure_backend/models.py | CS-twop/Secure-django-reacthook | 0 | 34504 | from django.db import models
from django.contrib.auth.models import User
class Post(models.Model):
user = models.ForeignKey(User, related_name='posts', on_delete=models.CASCADE)
content = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=... | 2.3125 | 2 |
tests/test_database.py | horsewithnoname1985/packit-app | 0 | 34505 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `database` module."""
import pytest
import os
import sqlite3
from packit_app.database import Database
def test_database_connection():
db = Database()
assert type(db.cur) is sqlite3.Cursor
assert type(db.connection) is sqlite3.Connection
asse... | 2.65625 | 3 |
SS-GCNs/gnns/gin_net.py | TAMU-VITA/SS-GCNs | 1 | 34506 | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling
"""
GIN: Graph Isomorphism Networks
HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (<NAME>, <NAME>, <NAME> and <NAME>, ICLR 2019)
https://arxiv.org/pdf/1810.00826.pdf
"... | 3.375 | 3 |
venv/lib/python3.8/site-packages/clikit/api/command/command_collection.py | GiulianaPola/select_repeats | 2 | 34507 | /home/runner/.cache/pip/pool/0e/03/a2/8516ce170f58c40a340c994a5cb76273f276d7ad1ea824422b51c9e45c | 0.8125 | 1 |
common/py_vulcanize/third_party/rjsmin/_setup/py2/data.py | tingshao/catapult | 2,151 | 34508 | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# <NAME> or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | 2.59375 | 3 |
payments/urls.py | caocmai/maker | 0 | 34509 | from django.urls import path
from . import views
urlpatterns = [
path('charge/', views.charge, name='charge'),
path('payment/', views.HomePageView.as_view(), name='payment'),
]
| 1.726563 | 2 |
cdc/src/__init__.py | ZebinKang/cdc | 0 | 34510 | <filename>cdc/src/__init__.py
from NoteDeid import *
from NoteConceptParser import *
from Converter import *
from D2v import *
from MLPipeline import *
| 1.203125 | 1 |
src/education/urls.py | compressore/moc | 4 | 34511 | <reponame>compressore/moc<filename>src/education/urls.py<gh_stars>1-10
from django.urls import path
from . import views
from core import views as core
from community import views as community
from library import views as library
from ie.urls_baseline import baseline_urlpatterns
from ie.urls_education_baseline import ba... | 1.96875 | 2 |
flowsa/data_source_scripts/StatCan_IWS_MI.py | JohnAndrewTaylor/flowsa | 0 | 34512 | # Stat_Canada.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
'''
Pulls Statistics Canada data on water intake and discharge for 3 digit NAICS from 2005 - 2015
'''
import pandas as pd
import io
import zipfile
import pycountry
from flowsa.common import *
def sc_call(url, sc_response, args):
"""
Convert res... | 2.984375 | 3 |
extra_foam/pipeline/f_zmq.py | scottwedge/EXtra-foam | 0 | 34513 | <gh_stars>0
"""
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: <NAME> <<EMAIL>>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
from collections import deque
from threading import Event
... | 2.21875 | 2 |
src/supervisor/supervisor_loader.py | Telsanyr/Johnny_VI | 6 | 34514 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf8 -*-
# coding: utf8
# This is a module loader. It will reload all the files dedicated to the module
# each time it is reloaded. Therefore, any code modification will be taken into
# account.
# Moreover, because all files are loaded in the same module. All classes ... | 2.234375 | 2 |
todolist/todos/migrations/0002_sharetodolist.py | abdu1aziz/todo-list-app | 0 | 34515 | <gh_stars>0
# Generated by Django 3.1 on 2020-09-23 06:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('todos', '0001_... | 1.664063 | 2 |
keyboard/mechanical-button/single-button/keyboard.py | ELE-Clouds/mpy-lib | 116 | 34516 | <filename>keyboard/mechanical-button/single-button/keyboard.py
# -*- coding:UTF-8 -*-
'''
MIT License
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restr... | 1.75 | 2 |
dataanalysis/mopitt_data_analysis.py | s-ai-kia/nasa_stf | 1 | 34517 | <reponame>s-ai-kia/nasa_stf
# -*- coding: utf-8 -*-
"""mopitt_data_analysis.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1bb_9kuO0Suo5761xgJioS84TrEdR5ojj
"""
import pandas as pd
df = pd.read_csv('MOP02J-20200101-L2V18.0.3.csv')
df.head()
df
... | 2.421875 | 2 |
main.py | dkendrick/starterbot | 2 | 34518 | import bybit
import math
import pandas as pd
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
# settings
num_orders = 3
order_size = 1
order_distance = 10
sl_risk = 0.03
tp_distance = 5
api_key = "YOUR_KEY"
api_secret = "YOUR_SECRET"
client = bybit.bybit(test=False, api_key=... | 2.75 | 3 |
Chapter 11/Chapter 06/app1.py | bpbpublications/Building-Web-Apps-with-Python-and-Flask | 2 | 34519 | <reponame>bpbpublications/Building-Web-Apps-with-Python-and-Flask<filename>Chapter 11/Chapter 06/app1.py
from flask import Flask, render_template
print (__name__)
app = Flask(__name__)
@app.route('/<name>')
def hello(name):
return render_template("btn.html", name=name)
| 2.75 | 3 |
app/models/Article.py | ngedev/hypexblog | 0 | 34520 | <reponame>ngedev/hypexblog
from datetime import datetime
from sqlalchemy import (
Boolean,
Column,
DateTime,
ForeignKey,
Integer,
String,
UnicodeText,
)
from sqlalchemy.orm import relationship
from zemfrog.globals import db
class Article(db.Model):
id = Column(Integer, primary_key=Tru... | 2.484375 | 2 |
apps/combine-api/tests/run/test_run_get_simulators.py | freiburgermsu/biosimulations | 20 | 34521 | <filename>apps/combine-api/tests/run/test_run_get_simulators.py
from biosimulators_utils.config import get_config
from src import app
from src.handlers.run.utils import get_simulator_api, get_simulators, exec_in_subprocess
from unittest import mock
import os
import parameterized
import pytest
import requests
import shu... | 2.078125 | 2 |
simulator/flow_change_gen.py | faywh/read_ez | 7 | 34522 | <gh_stars>1-10
import argparse
import os
import random
from random import Random
from misc import logger
from domain.network_premitives import *
from flow_gen.link_failure_change_generator import LinkFailureChangeGenerator
from flow_gen.random_change_generator import RandomChangeGenerator
if __name__ == '__main__':
... | 2.15625 | 2 |
pyccel/codegen/python_wrapper.py | noushi/pyccel | 0 | 34523 | # coding: utf-8
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#------------------------... | 1.625 | 2 |
src/third_party_module/upload_self_define_module/nester/nester.py | HuangHuaBingZiGe/GitHub-Demo | 0 | 34524 | def print_lol(arr):
for row in arr:
if (isinstance(row, list)):
print_lol(row)
else:
print
row
| 3.109375 | 3 |
xds_plot_integrate.py | keitaroyam/yam_scripts | 2 | 34525 | <gh_stars>1-10
#!/usr/bin/env cctbx.python
from __future__ import print_function
"""
xds_plot_integrate.py
(c) RIKEN 2015. All rights reserved.
Author: <NAME>
This software is released under the new BSD License; see LICENSE.
"""
"""
TODO: plot differences in direct beam and rotation axis
"""
import sys
import re
im... | 2.109375 | 2 |
app/models.py | JoyWambui/habari-gani | 0 | 34526 | <reponame>JoyWambui/habari-gani
class Source:
"""Source class to define News Source Objects"""
def __init__(self,id,name,description,url,category,country):
self.id = id
self.name = name
self.description = description
self.url = url
self.category = category
self.c... | 2.515625 | 3 |
sionna/channel/tr38901/__init__.py | NVlabs/sionna | 163 | 34527 | #
# SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""
Channel sub-package of the Sionna library implementing 3GPP TR39.801 models.
"""
# pylint: disable=line-too-long
from .antenna import AntennaElement, AntennaPanel, Pane... | 1.171875 | 1 |
P_bot_TOR.py | derhornspieler/Scavenger | 1 | 34528 | ######
# If you do not want to post results on Twitter remove the lines marked with TWITTER
######
import time
import tweepy
import os
import classes.utility
import requests
from bs4 import BeautifulSoup, SoupStrainer
tools = classes.utility.ScavUtility()
iterator = 1
session = requests.session()
session.proxies = {}... | 2.78125 | 3 |
core/templatetags/extras.py | bugulin/gymgeek-web | 0 | 34529 | from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from docutils.core import publish_parts
register = template.Library()
@register.filter(name='rst')
@stringfilter
def rst_to_html5(text):
parts = publish_parts(text, writer_name='html5'... | 1.757813 | 2 |
aether/sdk/auth/keycloak/tests/test_keycloak.py | eHealthAfrica/aether-django-sdk-library | 1 | 34530 | <gh_stars>1-10
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# ... | 1.773438 | 2 |
ballet/__init__.py | HDI-Project/fhub_core | 19 | 34531 | # -*- coding: utf-8 -*-
"""Top-level package for ballet."""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.19.5'
# filter warnings
import warnings # noqa E402
warnings.filterwarnings(
action='ignore', module='scipy', message='^internal gelsd')
# silence sklearn deprecation warnings
import logging... | 1.90625 | 2 |
darling_ansible/python_venv/lib/python3.7/site-packages/oci/apigateway/models/cors_policy.py | revnav/sandbox | 0 | 34532 | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 1.796875 | 2 |
tests/layers.py | jiansowa/PaddleSlim | 0 | 34533 | # Copyright (c) 2019 PaddlePaddle Authors. 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 applic... | 2.28125 | 2 |
zpy/db/oracle.py | NoeCruzMW/zpy-flask-msc | 0 | 34534 | <filename>zpy/db/oracle.py
from zpy.logger import TLogger, c_info
from zpy.db.utils import get_current_schema
from marshmallow_objects import models
from typing import Any, Dict, List, Optional, Union
from zpy.db import DBConnection
from zpy.utils.funcs import exec_ifnt_null, safely_exec
from enum import Enum
from mars... | 2.15625 | 2 |
sol/frag_sol.py | hebrewsnabla/pyAutoMR | 5 | 34535 | from pyscf import gto
import radii
def from_frag(xyz, frags, chgs, spins, gjfhead='', scrfhead='', gjfname='', basis=None, wfnpath=None):
# mol = gto.Mole()
# mol.atom = xyz
# mol.basis = bas
# mol.verbose = 1
# mol.build()
#
if isinstance(frags[0], str):
frags = str2list(frags)
guess_fr... | 2.453125 | 2 |
SITE/main_file.py | S-Thaler/SITE | 5 | 34536 | """
File to control the parameters of the SITE approach and to specify the postprocessing functionality.
The parameters for each equation are the ones used in the paper. All results of the paper
'Sparse Identification of Trunction Errors' of Thaler, Paehler and Adams, 2019 can be replicated only be
setting the appropri... | 2.359375 | 2 |
skin_detector/scripts.py | version0chiro/xilinx_Code | 154 | 34537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import os
import cv2
import numpy
def find_images(path, recursive=False, ignore=True):
if os.path.isfile(path):
yield path
elif os.path.isdir(path):
assert os.path.isdir(path), 'FileIO - get_images: Directory does not exist'... | 2.78125 | 3 |
test/test_1.py | rgooler/AOC2019 | 0 | 34538 | from aoc2019 import *
import unittest
class Day1(unittest.TestCase):
def test_mass_12(self):
chall = Rocket()
self.assertEqual(chall.calc_fuel_weight(12), 2)
def test_mass_14(self):
chall = Rocket()
self.assertEqual(chall.calc_fuel_weight(14), 2)
def test_mass_1969(self):
... | 3.125 | 3 |
xdtools/artwork/compound.py | tjcjc/xdtools | 43 | 34539 | """
Contains the definition of Compound.
"""
from xdtools.artwork import Artwork
from xdtools.utils import Point
class Compound(Artwork):
"""
A compound shape.
=== Attributes ===
uid - the unique id of this Compound shape.
name - the name of this Compound shape as it appears in the Layers panel.... | 2.921875 | 3 |
appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py | DannyPol/flatcam | 1 | 34540 | <reponame>DannyPol/flatcam<filename>appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, FCLabel
from appGUI.preferences import machinist_setting
from appGUI.preferences.Option... | 2.234375 | 2 |
venv/lib/python2.7/site-packages/SimpleGUICS2Pygame/test/test_sound.py | CrystalCodes01/python-pong | 0 | 34541 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""
Test play sounds. (January 1st, 2015)
Piece of SimpleGUICS2Pygame.
https://bitbucket.org/OPiMedia/simpleguics2pygame
GPLv3 --- Copyright (C) 2015 <NAME>
http://www.opimedia.be/
"""
import time
try:
import simplegui
SIMPLEGUICS2PYGAME = False
except Impor... | 3.046875 | 3 |
oslo_config/_list_opts.py | CyrilRoelandteNovance/oslo.config | 110 | 34542 | <gh_stars>100-1000
# 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... | 1.851563 | 2 |
dialogue/moviebot_data/batch.py | waynewu6250/ChatBoxer | 7 | 34543 | <filename>dialogue/moviebot_data/batch.py
import torch as t
from torch.autograd import Variable
import numpy as np
import re
import pickle
import h5py
from .load import Data
from .load_chinese import ChineseData
class TrainData:
def __init__(self, data_path, conversation_path, results_path, chinese, prev_sent... | 2.4375 | 2 |
mediawikiapi/config.py | srevinsaju/MediaWikiAPI | 0 | 34544 | <filename>mediawikiapi/config.py
import requests
from datetime import timedelta
from .language import Language
class Config(object):
"""
Contains global configuration
"""
DEFAULT_USER_AGENT = 'mediawikiapi (https://github.com/lehinevych/MediaWikiAPI/)'
DONATE_URL = 'https://donate.wikimedia.org/w/index.php?... | 2.875 | 3 |
abc/abc107/abc107b.py | c-yan/atcoder | 1 | 34545 | <filename>abc/abc107/abc107b.py
from sys import stdout
H, W = map(int, input().split())
a = [input() for _ in range(H)]
h = [all(c == '.' for c in a[i]) for i in range(H)]
w = [True] * W
for i in range(H):
for j in range(W):
w[j] = w[j] and a[i][j] == '.'
for i in range(H):
if h[i]:
continue... | 2.625 | 3 |
courses/E375004/fastapi/src/warehouse_app/dto.py | CVUT-FS-12110/Python | 16 | 34546 | """ Data Transfer Objects """
from pydantic import BaseModel
class WarehouseDto(BaseModel):
name: str # this is our unique identifier!
location: str
capacity: int | 2.625 | 3 |
ecom/carts/admin.py | Bhavitg/FashionKart-Ecommerce | 0 | 34547 | <filename>ecom/carts/admin.py
from django.contrib import admin
# Register your models here.
from .models import Cart,CartItem
admin.site.register(Cart)
admin.site.register(CartItem)
| 1.429688 | 1 |
BboxToolkit/datasets/io.py | qilei123/BboxToolkit | 38 | 34548 | import os
import os.path as osp
import pickle
import time
import numpy as np
from multiprocessing import Pool
from ..utils import get_bbox_dim
from .misc import read_img_info, change_cls_order, get_classes
def load_imgs(img_dir, ann_dir=None, classes=None, nproc=10,
def_bbox_type='poly'):
assert d... | 2.171875 | 2 |
Fusion/tests/cwin.py | roadnarrows-robotics/rnr-sdk | 0 | 34549 | def cwinstart(callobj, *args, **kwargs):
print('cwinstart')
print(' args', repr(args))
for arg in args:
print(' ', arg)
print(' kwargs', len(kwargs))
for k, v in kwargs.items():
print(' ', k, v)
w = callobj(*args, **kwargs)
print(' callobj()->', w)
return w
def cwincall(req1, req2, ... | 2.953125 | 3 |
setup.py | rchurch4/emoji_map | 0 | 34550 | from setuptools import setup
setup(name='emoji_map',
version='0.1',
description='Maps unicode emoji to its description',
url='http://github.com/rchurch4/emoji_map',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['emoji_map'],
include_package_data=True,... | 0.988281 | 1 |
tests/conftest.py | EvanKomp/molscore | 0 | 34551 | import json
import os
import pytest
import tempfile
@pytest.fixture(scope='session', autouse=True)
def working_test_dir():
# create a produce a temporary directory to use for everything
tmp_working_dir = tempfile.TemporaryDirectory()
yield tmp_working_dir.name
# delete it at the end of the session
... | 2.109375 | 2 |
rlcard3/games/gin_rummy/utils/melding.py | cogitoergoread/muszi-macrohard.hu | 1 | 34552 | <gh_stars>1-10
'''
File name: gin_rummy/melding.py
Author: <NAME>
Date created: 2/12/2020
'''
from rlcard3.games.gin_rummy.card import Card
import rlcard3.games.gin_rummy.utils.utils as utils
from typing import List
from typing import Set
import copy
import random
"""
Terminology:
run_meld ... | 2.828125 | 3 |
src/garage/tf/algos/rl2.py | jaekyeom/garage | 1 | 34553 | <reponame>jaekyeom/garage
"""Module for RL2.
This module contains RL2, RL2Worker and the environment wrapper for RL2.
"""
# yapf: disable
import abc
import collections
import akro
from dowel import logger
import numpy as np
from garage import (EnvSpec,
EnvStep,
EpisodeBatch,
... | 2.21875 | 2 |
cct/core2/algorithms/orderforleastmotormovement.py | awacha/cct | 1 | 34554 | <filename>cct/core2/algorithms/orderforleastmotormovement.py
from typing import Tuple, List, TypeVar
T = TypeVar("T")
def orderForLeastMotorMovement(positions: List[Tuple[T, Tuple[float, float]]], startposition: Tuple[float, float]) -> List[T]:
xpositions = set([p[1][0] for p in positions] + [startposition[0]])
... | 2.484375 | 2 |
openpnm/topotools/__init__.py | lixuekai2001/OpenPNM | 2 | 34555 | r"""
Collection of functions for manipulating network topology
=========================================================
This module contains a selection of functions that deal specifically with
network topology.
"""
from ._topotools import *
from ._perctools import *
from ._graphtools import *
from ._plottools impo... | 1.570313 | 2 |
tests/gdata_tests/analytics/data_test.py | lqc/google-data-api | 0 | 34556 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 2.5 | 2 |
parkself_mbed/scripts/parkself_run.py | SweiLz/Parkself | 0 | 34557 | #!/usr/bin/env python
import rospy
from math import sqrt
from geometry_msgs.msg import Twist, PoseStamped, Pose2D, PointStamped, PoseWithCovarianceStamped
from std_msgs.msg import Empty, String
import Queue
goal_point = rospy.Publisher(
"move_base_simple/goal", PoseStamped, queue_size=1)
servo = rospy.Publisher(... | 2.3125 | 2 |
tests/test_session.py | brainsplinter/pylibsrtp | 11 | 34558 | from unittest import TestCase
from pylibsrtp import Error, Policy, Session
RTP = (
b"\x80\x08\x00\x00" # version, packet type, sequence number
b"\x00\x00\x00\x00" # timestamp
b"\x00\x00\x30\x39" # ssrc: 12345
) + (b"\xd4" * 160)
RTCP = (
b"\x80\xc8\x00\x06\xf3\xcb\x20\x01\x83\xab\x03\xa1\xeb\x02\x0... | 2.46875 | 2 |
tripleo_ansible/ansible_plugins/modules/tripleo_baremetal_expand_roles.py | beagles/tripleo-ansible | 22 | 34559 | #!/usr/bin/python
# Copyright 2020 Red Hat, 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 ... | 1.648438 | 2 |
hexa/user_management/migrations/0003_feature_flags.py | qgerome/openhexa-app | 4 | 34560 | # Generated by Django 3.2.6 on 2021-09-10 11:56
import uuid
import django.db.models.deletion
import django.db.models.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("user_management", "0002_remove_username"),
... | 1.882813 | 2 |
btclib/__init__.py | btclib-org/btclib | 40 | 34561 | #!/usr/bin/env python3
# Copyright (C) 2020-2021 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... | 0.953125 | 1 |
Lettuce_Tests/old_tests/testFeatureCategoricalGridCoverage.py | jread-usgs/pyGDP | 0 | 34562 | <filename>Lettuce_Tests/old_tests/testFeatureCategoricalGridCoverage.py
import pyGDP
import os
from nose.tools import assert_equal
from nose.tools import assert_not_equal
class TestFeatureCategoricalGridCoverage(object):
def test_submit_FCGC(self):
pyGDP.WPS_URL='http://cida.usgs.gov/gdp/process/WebProc... | 2.3125 | 2 |
Machine-Learning-in-Production/02-Model-Management/02-Model-Registry.py | databricks-academy/ml-in-production | 14 | 34563 | <gh_stars>10-100
# Databricks notebook source
# MAGIC %md-sandbox
# MAGIC
# MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;">
# MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px">
# MAGIC </div>
# COMMAN... | 3.09375 | 3 |
corehq/apps/callcenter/utils.py | johan--/commcare-hq | 0 | 34564 | from __future__ import absolute_import
from collections import namedtuple
from datetime import datetime, timedelta
import pytz
from casexml.apps.case.dbaccessors import get_open_case_docs_in_domain
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.xml import V2
import uuid
from xml.etree import Elemen... | 1.976563 | 2 |
src/encoded/audit/dataset.py | Lattice-Data/encoded | 0 | 34565 | from snovault import (
AuditFailure,
audit_checker,
)
from .formatter import (
audit_link,
path_to_text,
)
def audit_contributor_institute(value, system):
if value['status'] in ['deleted']:
return
need_inst = []
if 'corresponding_contributors' in value:
for user in value['... | 2.53125 | 3 |
psatlib/__init__.py | nie93/psatlib | 0 | 34566 | """
psatlib -- An imported library designed for PSAT running with Python scripts.
Created by <NAME> (<EMAIL>)
Created on: 06/11/2018
Last Modified on: 10/01/2018
"""
__name__ = "psatlib"
__version__ = "0.1"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__copyright__ = "Copyright (c) 2018 Zhijie Nie"
__d... | 2.65625 | 3 |
webcam_OrbitalTimmer.py | JarvisSan22/Python_webcam | 0 | 34567 | import numpy as np
import cv2
import math
import datetime
from datetime import timedelta as Delta
h=300
w=300
cap = cv2.VideoCapture(0)
SUN_LOC=(200,70)
SUN_RSIZE=20
ORBITAL_R=10
def Orbiral(frame,Centerloc,orbit_r,size_r,phi,color):
x_orbit=Centerloc[0]+int(orbit_r*np.cos(np.deg2rad(phi))... | 2.59375 | 3 |
spyder/plugins/outlineexplorer/tests/test_outline_explorer_editor.py | suokunlong/spyder | 3 | 34568 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""Tests for editor and outline explorer interaction."""
# Test library imports
import pytest
# Local imports
from spyder.plugins.outlineexplorer.widgets import OutlineExplorerWidget
from spyder.plugin... | 2.25 | 2 |
challonge/attachment.py | Parapheen/achallonge | 3 | 34569 | <filename>challonge/attachment.py
from .helpers import FieldHolder, assert_or_raise
class Attachment(metaclass=FieldHolder):
""" representation of a Challonge match attachment """
_fields = ['id', 'match_id', 'user_id', 'description',
'url', 'original_file_name', 'created_at',
'u... | 2.671875 | 3 |
tests/cupy_tests/array_api_tests/test_sorting_functions.py | pri1311/cupy | 0 | 34570 | <reponame>pri1311/cupy<filename>tests/cupy_tests/array_api_tests/test_sorting_functions.py
import pytest
from cupy import array_api as xp
@pytest.mark.parametrize(
"obj, axis, expected",
[
([0, 0], -1, [0, 1]),
([0, 1, 0], -1, [1, 0, 2]),
([[0, 1], [1, 1]], 0, [[1, 0], [0, 1]]),
... | 2.234375 | 2 |
drip/api/subscribers.py | willjohnson/drip-python | 5 | 34571 | from typing import TYPE_CHECKING
from drip.utils import json_list, json_object, raise_response
if TYPE_CHECKING:
from requests import Session
class Subscribers:
session: 'Session'
@json_object('subscribers')
def create_or_update_subscriber(self, email, marshall=True, **options):
"""
... | 2.515625 | 3 |
ldapauth/main/main.py | trutty/python-ldap | 0 | 34572 | from flask import Flask, request
from flask_httpauth import HTTPBasicAuth
from auth_handler import AuthHandler
from cache import Cache
from os import environ
from yaml import safe_load
import logging
from connection_provider import ConnectionProvider
# init logging
logging.basicConfig(format='[%(asctime)s] [%(levelna... | 2.453125 | 2 |
Square_game/Square_game_play.py | samutams/Square_game | 0 | 34573 | <reponame>samutams/Square_game
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
class Square_game():
display_col = (255, 255, 255)
player_col = (0, 0, 0)
text_col = (255, 0, 0)
food_col = (0, 0, 255)
maze_col = (50, 205, 55)
dis_width = 400
dis_height = 400
square_block = 20
g... | 3.390625 | 3 |
gentun/algorithms.py | ahmadmobeen/gentun | 2 | 34574 | <gh_stars>1-10
#!/usr/bin/env python
"""
Genetic algorithm class
"""
import random
import operator
import pymongo
db_client=pymongo.MongoClient("192.168.3.11",27017)
db=db_client["binaryCSA"]
exp_col=db["experiments"]
class GeneticAlgorithm(object):
"""Evolve a population iteratively to find better
individual... | 3.234375 | 3 |
src/frontend/views.py | AllenAnthes/operationcode-pyback | 21 | 34575 | import json
import logging
from typing import Tuple
import requests
from django.conf import settings
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.views.generic import FormView, TemplateView
from .forms import CodeSchoolForm
logger = logging.getLogger(__name__)
class IndexView(Templat... | 2.140625 | 2 |
bitwise/arithmetic/ADD_SUB.py | jamesjiang52/Bitwise | 0 | 34576 | """
The following classes are defined:
AdderSubtractor4
AdderSubtractor8
AdderSubtractor16
"""
from .. import wire
from .. import gate
from .. import signal
from . import ADD
Wire = wire.Wire
Bus4 = wire.Bus4
Bus8 = wire.Bus8
Bus16 = wire.Bus16
class AdderSubtractor4:
"""Construct a new 4-bit adder-... | 3.640625 | 4 |
utils/notification/notification_manager.py | sanjusci/google_sheet_reader | 0 | 34577 | # Create your service here.
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019."
from utils.commons import safe_invoke
class NotificationManager(object):
def __init__(self, *args, **kwargs):
pass
def notify(self, *args, **kwargs):
pass
@staticmethod
def n... | 2.3125 | 2 |
tests/unit/test_config.py | zaro0508/lambda-budgets | 0 | 34578 | <filename>tests/unit/test_config.py
from pathlib import Path
import json
import unittest
from unittest.mock import MagicMock, patch
from budget.config import Config
import yaml
class TestConfig(unittest.TestCase):
def test_init(self):
account_id = '012345678901'
topic_arn = 'arn:aws:sns:us-east-1:12345678... | 2.390625 | 2 |
chap4/4-9.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 1 | 34579 | <gh_stars>1-10
cubes=[value**3 for value in range(1,11)]
print(cubes) | 2.625 | 3 |
test/test_composer.py | nccr-itmo/FEDOT.Web | 23 | 34580 | <reponame>nccr-itmo/FEDOT.Web
import random
import numpy as np
random.seed(1)
np.random.seed(1)
def test_composer_endpoint(client):
case_id = 'scoring'
history_json = client.get(f'api/composer/{case_id}').json
nodes = history_json['nodes']
nodes_ids = [n['uid'] for n in nodes]
edges = history_js... | 2.21875 | 2 |
testClient.py | step305/PiCameraStream_Test | 1 | 34581 | import cv2
import urllib
import numpy as np
import multiprocessing as mp
stream = 'http://192.168.53.114:8000/streamLow.mjpg'
stream2 = 'http://192.168.53.114:8001/streamLow.mjpg'
def procImg(str, wind, stop):
bytes = ''
stream = urllib.urlopen(str)
while not stop.is_set():
try:
bytes... | 2.671875 | 3 |
2012/AU_Danny.py | Valchris/IEEEXtreme_WorkingAsIntended | 0 | 34582 | <filename>2012/AU_Danny.py
import sys
import re
line = sys.stdin.readline().strip()
commands = line.split()
if len(commands) > 15: #Too Long
print 'ERROR'
exit(0)
for i in range(0,len(line)): #Missing Spaces
if i % 2 == 1 and line[i] != ' ':
print 'ERROR'
exit(0)
for i in range(0,len(co... | 2.96875 | 3 |
pupil/profiler.py | nigamapurv/Minkowski_planview | 1 | 34583 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cProfile
import io
import pstats
cache = {}
PROFILE_SWITCH = True
class Profiler:
def __init__(self):
self.profiler = cProfile.Profile()
def profile(self, func, *args, **kwargs):
... | 2.359375 | 2 |
dogdog045.py | chikochiko76/anime2021 | 0 | 34584 | class AImage(AShape):
color: any
def __init__(self, width=100, height=None, cx=None, cy=None, image='pet_darui_dog.png'):
AShape.__init__(self, width, height, cx, cy)
if image.startswith('http')
self.pic = Image.open(io.BytesIO(requests.get(image).content))
else:
... | 2.78125 | 3 |
tests/contrib/aiohttp/conftest.py | discord/dd-trace-py | 0 | 34585 | import aiohttp
import aiohttp_jinja2
import pytest
from ddtrace.contrib.aiohttp.middlewares import trace_app
from ddtrace.contrib.aiohttp_jinja2.patch import patch as patch_jinja2
from ddtrace.internal.utils import version
from ddtrace.pin import Pin
from .app.web import setup_app
if version.parse_version(aiohttp._... | 1.96875 | 2 |
douban.movie_requests.py | willcod/requests_example | 0 | 34586 | <gh_stars>0
import requests, json
from bs4 import BeautifulSoup
hds=[{'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'},\
{'User-Agent':'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.12 Safari/535.11'},\
{'User-Agent': 'Mozill... | 2.96875 | 3 |
app/serialmonitor/forms.py | fretchen/ArduinoMagnetometerWeb | 0 | 34587 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, HiddenField,IntegerField
from wtforms.validators import DataRequired, NumberRange
class ConnectForm(FlaskForm):
'''
The form for connecting to the Arduino
'''
id = HiddenField('A hidden field');
serial_port = StringField... | 2.875 | 3 |
degvabank/degvabank/apps/user/signals.py | Vixx-X/DEGVABanck-backend | 0 | 34588 | <reponame>Vixx-X/DEGVABanck-backend<filename>degvabank/degvabank/apps/user/signals.py<gh_stars>0
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import User, EmailDevice
@receiver(post_save, sender=User)
def creating_user_settings(sender, instance, created, raw, **kwarg... | 1.882813 | 2 |
casperlabs_client/commands/transfer_cmd.py | CasperLabs/client-py | 2 | 34589 | <filename>casperlabs_client/commands/transfer_cmd.py
# -*- coding: utf-8 -*-
from casperlabs_client import CasperLabsClient, consts, reformat
from casperlabs_client.commands.common_options import (
FROM_OPTION,
CHAINNAME_OPTION,
DEPENDENCIES_OPTION,
TTL_MILLIS_OPTION,
private_key_option,
WAIT_PR... | 2.15625 | 2 |
Chapter 03/Chap03_Example3.10.py | bpbpublications/Programming-Techniques-using-Python | 0 | 34590 | for num in range(1,6):
#code inside for loop
if num == 4:
continue
#code inside for loop
print(num)
#code outside for loop
print("continue statement executed on num = 4")
| 4 | 4 |
src/inv/views.py | Nikhilgupta18/practice-react_django | 0 | 34591 | <gh_stars>0
from django.views import View
from django.shortcuts import render
from services.models import Service, ServiceUser, MaterialUser
from account.models import ContactUs
from inv.settings import enable_otp
from account.tasks import send_email
from django.shortcuts import render, redirect
from django.contrib imp... | 1.695313 | 2 |
S4/S4 Library/simulation/situations/visiting/stay_the_night_situation.py | NeonOcean/Environment | 1 | 34592 | <filename>S4/S4 Library/simulation/situations/visiting/stay_the_night_situation.py
from role.role_state import RoleState
from situations.situation_complex import SituationState, SituationStateData
from situations.situation_job import SituationJob
from situations.visiting.visiting_situation_common import VisitingNPCSitu... | 2.390625 | 2 |
starter_code/student_utils.py | Harshit4199/Patient-Selection-for-Diabetes-Drug-Testing | 1 | 34593 | import pandas as pd
import numpy as np
import os
import tensorflow as tf
####### STUDENTS FILL THIS OUT ######
#Question 3
def reduce_dimension_ndc(df, ndc_df):
'''
df: pandas dataframe, input dataset
ndc_df: pandas dataframe, drug code dataset used for mapping in generic names
return:
df: pand... | 3.109375 | 3 |
_resume/build.py | edublancas/edublancas.github.io | 0 | 34594 | <filename>_resume/build.py
"""
Build resume and cv from resume.md and cv.md
"""
import subprocess
import os.path
from jinja2 import Environment, FileSystemLoader
from datetime import date
def get_commit_hash():
out = subprocess.check_output('git show --oneline -s', shell=True)
return out.decode('utf-8') .repl... | 2.6875 | 3 |
setup.py | SUNET/aws-sns-message-validator | 0 | 34595 | <filename>setup.py
from datetime import datetime
from setuptools import setup, find_packages
DEPENDENCIES = [
'requests',
'cryptography',
]
EXCLUDED_PACKAGES = [
'flask_example.py',
]
setup(
name='sns-message-validator',
version='0.0.2+sunet',
description='Validator for SNS messages.',
au... | 1.546875 | 2 |
Util/nucleus_lib.py | cao13jf/CShaper | 3 | 34596 | '''
This library is used to incorporate
'''
import numpy as np
def cell_prob_with_nucleus(cell, nucleus):
'''
This function is used to figure out whether one region is cell or empty hole (without nucleus)
:param cell: segmentations results with different labels
:param nucleus: nucleus RawMemb image (... | 3.078125 | 3 |
api/src/wt/provider/db/models/statistics.py | sedlar/work-tracking | 0 | 34597 | <reponame>sedlar/work-tracking<filename>api/src/wt/provider/db/models/statistics.py
from collections import namedtuple
from typing import List
from decimal import Decimal
from sqlalchemy import select, func
from wt.common import Money, Currency
from wt.costs.expenditures import ExpenditureStatus
from wt.ids import En... | 2.203125 | 2 |
cp_mri/masks.py | vladpopovici/CP_mri | 0 | 34598 | <reponame>vladpopovici/CP_mri<filename>cp_mri/masks.py
# -*- coding: utf-8 -*-
#
# --------------------------------------------------------------------
# Copyright (c) 2022 <NAME> <<EMAIL>>
#
# Licensed under the MIT License. See LICENSE file in root folder.
# -----------------------------------------------------... | 2.5 | 2 |
src/gam/gapi/reports.py | GAM-team/GAM | 102 | 34599 | import calendar
import datetime
import re
import sys
from dateutil.relativedelta import relativedelta
import gam
from gam.var import *
from gam import controlflow
from gam import display
from gam import gapi
from gam import utils
from gam.gapi.directory import orgunits as gapi_directory_orgunits
def build():
re... | 2.109375 | 2 |