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 |
|---|---|---|---|---|---|---|
python/generator_conf.py | chakpongchung/katana | 64 | 12793451 | <reponame>chakpongchung/katana
import re
from abc import ABCMeta
from collections import namedtuple
NON_IDENTIFIER_CHAR_RE = re.compile(r"[^a-zA-Z0-9]")
def identifier_for_string(s):
return NON_IDENTIFIER_CHAR_RE.sub("_", s)
class TypeInstantiation(metaclass=ABCMeta):
element_c_type: str
element_py_typ... | 2.640625 | 3 |
aspen_ssh/parser/exceptions.py | thinkwelltwd/aspen_ssh | 1 | 12793452 | <reponame>thinkwelltwd/aspen_ssh
class SSHCertificateParserError(Exception):
pass
class UnsupportedKeyTypeError(SSHCertificateParserError):
"""This key has a type which we do not know how to parse"""
class InputTooShortError(SSHCertificateParserError):
pass
| 2.4375 | 2 |
src/auto_change.py | yoland68/junit-auto-migrate | 0 | 12793453 | <reponame>yoland68/junit-auto-migrate
#!/usr/bin/env python
import parser
import chrome_convert_agents
import webview_convert_agents
import instrumentation_convert_agents
import test_base_convert_agent
import content_convert_agents
import logging
import argparse
import os
import sys
_TEST_AGENT_DICT = {
"chrome-... | 1.9375 | 2 |
jshbot/plugins.py | AmberHarris/Shaco | 0 | 12793454 | import asyncio
import logging
import importlib.util
import os.path
import sys
# Debug
import traceback
from jshbot import commands
from jshbot.exceptions import ErrorTypes, BotException
EXCEPTION = 'Plugins'
def add_plugins(bot):
"""
Gets a list of all of the plugins and stores them as a key/value pair of
... | 2.296875 | 2 |
DailyProgrammer/DP20131128C.py | DayGitH/Python-Challenges | 2 | 12793455 | <gh_stars>1-10
"""
[11/28/13] Challenge #137 [Intermediate / Hard] Banquet Planning
https://www.reddit.com/r/dailyprogrammer/comments/1rnrs2/112813_challenge_137_intermediate_hard_banquet/
# [](#IntermediateIcon) *(Intermediate)*: Banquet Planning
You and your friends are planning a big banquet, but need to figure ou... | 3.9375 | 4 |
z3py/examples/fixedpoint.3.py | rainoftime/rainoftime.github.io | 1 | 12793456 | fp = Fixedpoint()
fp.set(engine='datalog')
s = BitVecSort(3)
edge = Function('edge', s, s, BoolSort())
path = Function('path', s, s, BoolSort())
a = Const('a',s)
b = Const('b',s)
c = Const('c',s)
fp.register_relation(path,edge)
fp.declare_var(a,b,c)
fp.rule(path(a,b), edge(a,b))
fp.rule(path(a,c), [edge(a,b),path(b,c... | 2.53125 | 3 |
src/neon/frontend/utils.py | MUTTERSCHIFF/ngraph-neon | 13 | 12793457 | <filename>src/neon/frontend/utils.py
from __future__ import absolute_import
import neon as ng
from .axis import ax
def make_convolution_placeholder(shape=None):
"""
Create a placeholder op for inputs to a convolution layer
Arguments:
shape (tuple): The desired shape of the placeholder,
... | 2.9375 | 3 |
wildlifecompliance/migrations/0125_auto_20190228_1127.py | preranaandure/wildlifecompliance | 1 | 12793458 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-02-28 03:27
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0124_auto_20190228_1035'),
]
operations = [
mi... | 1.273438 | 1 |
environments/inmoov/inmoov_client.py | BillChan226/Robotic | 3 | 12793459 | import zmq
from zmq import ssh
import numpy as np
from environments.inmoov.inmoov_p2p_client_ready import InmoovGymEnv
from .inmoov_server import server_connection, client_ssh_connection, client_connection
SERVER_PORT = 7777
HOSTNAME = 'localhost'
def send_array(socket, A, flags=0, copy=True, track=False):
"""se... | 2.296875 | 2 |
PHY407/gaussxw.py | ngrisouard/TenureApplicationCode | 1 | 12793460 | <filename>PHY407/gaussxw.py
from pylab import *
def gaussxw(N):
# Initial approximation to roots of the Legendre polynomial
a = linspace(3,4*N-1,N)/(4*N+2)
x = cos(pi*a+1/(8*N*N*tan(a)))
# Find roots using Newton's method
epsilon = 1e-15
delta = 1.0
while delta>epsilon:
p0 = ones(N... | 2.609375 | 3 |
第11章/program/baidu/pipelines.py | kingname/SourceCodeOfBook | 274 | 12793461 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
from scrapy.conf import settings
class BaiduPipeline(object):
def __init__(self):
host = settings[... | 2.390625 | 2 |
surftrace/execCmd.py | aliyun/surftrace | 32 | 12793462 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: execCmd
Description :
Author : liaozhaoyan
date: 2022/3/19
-------------------------------------------------
Change Activity:
2022/3/19:
-----------------------------------------... | 2.484375 | 2 |
models/validation/OneOfValidator.py | meguia/virtualroom | 1 | 12793463 | <reponame>meguia/virtualroom
from .Validator import Validator
class OneOfValidator(Validator):
def __init__(self, *options):
self.options = set(options)
def validate(self, value):
if value not in self.options:
raise ValueError(f'Expected {value!r} to be one of {self.options!r}')
| 2.96875 | 3 |
reactivated/apps.py | silviogutierrez/reactivated | 178 | 12793464 | import importlib
import json
import logging
import os
import subprocess
from typing import Any, Dict, NamedTuple, Tuple
from django.apps import AppConfig
from django.conf import settings
from . import (
definitions_registry,
extract_views_from_urlpatterns,
global_types,
template_registry,
type_reg... | 2.140625 | 2 |
tests/keypresses.py | nateonguitar/PythonConsoleGameEngine | 1 | 12793465 | import threading
from pynput import keyboard
class KeyPresses():
def __init__(self):
self.keep_from_dying_thread = None
self.holding_shift = False
self.key_listener = keyboard.Listener(on_press=self.on_keydown, on_release=self.on_keyup)
self.key_listener.start()
def on_keydow... | 3.25 | 3 |
Plot3D.py | MohFarahani/dance_generator | 1 | 12793466 | <filename>Plot3D.py
import dataclasses
from typing import List, Mapping, Optional, Tuple, Union
from model_setup import Model_Setup
import matplotlib.pyplot as plt
import pandas as pd
import imageio
from pathlib import Path
import os
import cv2
NUM_COORDS = 33
WHITE_COLOR = (224, 224, 224)
BLACK_... | 2.578125 | 3 |
examples/sync_cmdclass_pyproject/sync_cmdclass_pyproject/__init__.py | linshoK/pysen | 423 | 12793467 | from typing import Any, Callable, Optional, Sequence, Set, Tuple
def foo(
a: Any,
b: Callable[[], Tuple[int, int, str]],
c: Set[str],
d: Optional[Sequence[int]] = None,
e: Any = None,
) -> None:
pass
print("Hello world")
foo(a=1, b=lambda: (1, 2, "hoge"), c=set(), d=None, e=None)
| 3.1875 | 3 |
tenseal/enc_context.py | rand0musername/TenSEAL | 0 | 12793468 | <gh_stars>0
"""The Context manages everything related to the encrypted computation, including keys, which
optimization should be enabled, and how many threads should run for a parallel computation.
"""
import multiprocessing
from enum import Enum
from typing import List, Union
from abc import ABC
import tenseal as ts
... | 2.46875 | 2 |
AmbieNet/users/tests/test_login.py | sansuaza/Backend-AmbieNet | 0 | 12793469 | <filename>AmbieNet/users/tests/test_login.py
#django
from django.test import TestCase
from django.urls import reverse, path
# Django REST Framework
from rest_framework import status
from rest_framework.test import APITestCase
#Model
from AmbieNet.users.models import User, Profile
from AmbieNet.posts.models import P... | 2.796875 | 3 |
tests/_testsite/dummyapp01/dummymodule01.py | bastiedotorg/django-precise-bbcode | 30 | 12793470 | from precise_bbcode.bbcode.tag import BBCodeTag
from precise_bbcode.tag_pool import tag_pool
class LoadDummyTag(BBCodeTag):
name = 'loaddummy01'
definition_string = '[loaddummy01]{TEXT}[/loaddummy01]'
format_string = '<loaddummy>{TEXT}</loaddummy>'
tag_pool.register_tag(LoadDummyTag)
| 1.960938 | 2 |
importify/__init__.py | litcoderr/loadit | 1 | 12793471 | # Copyright 2020 by <NAME>.
# Github: https://github.com/litcoderr
# All rights reserved.
# This file is released under the "MIT License Agreement".
# Please see the LICENSE file.
from .interface import Serializable
| 0.902344 | 1 |
main.py | Vrim/TicTacToe | 0 | 12793472 | <reponame>Vrim/TicTacToe
""" Tic Tac Toe
Author: <NAME>
Date: Oct. 11, 2019
"""
from __future__ import annotations
from typing import Any, List
from Player import Player
from TicTac import TicTac
import os
from AI import AI as ai
board: TicTac
def main():
mode = _selectMode()
if mode == 0:
p1 = Player... | 3.453125 | 3 |
apps/log_extract/models.py | yiqiwang-17/bk-log | 0 | 12793473 | # coding=utf-8
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
---------------------------------------------------------... | 1.335938 | 1 |
sort_algorithms.py | vsaliievaa/DSA_Lab1 | 0 | 12793474 | """sorting algorithms"""
def merge(lst1: list, lst2: list) -> list:
"""Returns two lists merged into one."""
counter = 0
new_list = []
one, two = 0, 0
while one != len(lst1) and two != len(lst2):
if lst1[one] <= lst2[two]:
new_list.append(lst1[one])
one +... | 4.1875 | 4 |
src/smtv_api/helpers/file_utils.py | AdamDomagalsky/smtv-micro-scpr | 0 | 12793475 | from functools import wraps
import os
import tempfile
import tarfile
def TemporaryDirectory(func):
'''This decorator creates temporary directory and wraps given fuction'''
@wraps(func)
def wrapper(*args, **kwargs):
cwd = os.getcwd()
with tempfile.TemporaryDirectory() as tmp_path:
... | 3.46875 | 3 |
data/models/simulator/pepsenum.py | SIXMON/peps | 5 | 12793476 | from enum import IntEnum
from abc import abstractmethod
class PepsEnum(IntEnum):
@property
@abstractmethod
def display_text(self):
raise NotImplementedError('display_text method not implemented')
| 3.125 | 3 |
mmdet/ops/corner_pool/__init__.py | vanyalzr/mmdetection | 274 | 12793477 | <reponame>vanyalzr/mmdetection
from .corner_pool import CornerPool
__all__ = ['CornerPool']
| 1.148438 | 1 |
panelapp/panels/models/genepanel.py | genomicsengland/panelapp | 7 | 12793478 | <filename>panelapp/panels/models/genepanel.py
##
## Copyright (c) 2016-2019 Genomics England Ltd.
##
## This file is part of PanelApp
## (see https://panelapp.genomicsengland.co.uk).
##
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distr... | 1.804688 | 2 |
series_tiempo_ar_api/apps/api/tests/endpoint_tests/pagination_tests.py | datosgobar/series-tiempo-ar-api | 28 | 12793479 | from django.urls import reverse
from series_tiempo_ar_api.apps.api.tests.endpoint_tests.endpoint_test_case import EndpointTestCase
class PaginationTests(EndpointTestCase):
def test_get_single_value(self):
resp = self.client.get(reverse('api:series:series'), data={'ids': self.increasing_month_series_id, ... | 2.203125 | 2 |
vae/main.py | fomorians/vae | 2 | 12793480 | <gh_stars>1-10
import os
import attr
import random
import argparse
import numpy as np
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import tensorflow_probability as tfp
from tqdm import trange
from vae import losses
from vae.data import prep_images, get_dataset
from vae.model import Model
@attr.s
c... | 2.0625 | 2 |
possum/utils/pos_util_midpoints.py | morales-gregorio/poSSum3 | 10 | 12793481 | #!/usr/bin/env python
# encoding: utf-8
import os
import sys
import itk
from possum import pos_itk_core
from possum import pos_itk_transforms
from possum.pos_common import r
"""
.. note::
Some of the non-cruical, optional functions in this module require vtk
module to be installed. If it is not available t... | 2.609375 | 3 |
MLSD/Transformers/activeTrans.py | HaoranXue/Machine_Learning_For_Structured_Data | 4 | 12793482 | <filename>MLSD/Transformers/activeTrans.py
from sklearn.base import TransformerMixin
class activeTrans(TransformerMixin):
def __init__(self,
ifSData=False,
Trans_in=True,
Multi_col=False,
New_Trans=None,
Reset_default=False):
... | 2.640625 | 3 |
WalkerBuddyAPI/app.py | gardyna/WalkerAppGame | 0 | 12793483 | # standard lib
from functools import wraps
# third party packages
from flask import Flask, jsonify, abort, request, Response
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.debug = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
app.secret_key = '<KEY>'
db = SQLAlchemy(app)
# ... | 2.765625 | 3 |
Auto2DSelect/helper.py | MPI-Dortmund/sphire_classes_autoselect | 3 | 12793484 | """
Automatic 2D class selection tool.
MIT License
Copyright (c) 2019 <NAME> Institute of Molecular Physiology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including with... | 2.265625 | 2 |
blacktape/util.py | carascap/blacktape | 0 | 12793485 | <filename>blacktape/util.py
import signal
def worker_init():
"""
Initializer for worker processes that makes them ignore interrupt signals
https://docs.python.org/3/library/signal.html#signal.signal
https://docs.python.org/3/library/signal.html#signal.SIG_IGN
"""
signal.signal(signal.SIGINT, ... | 1.851563 | 2 |
PSET 4/problem-5.py | AtharvaPusalkar/MITx-6.00.1x | 1 | 12793486 | def playHand(hand, wordList, n):
"""
Allows the user to play the given hand, as follows:
* The hand is displayed.
* The user may input a word or a single period (the string ".")
to indicate they're done playing
* Invalid words are rejected, and a message is displayed asking
the user t... | 3.890625 | 4 |
tests/printing/test_registry_rendering.py | anna-naden/qalgebra | 2 | 12793487 | <gh_stars>1-10
import os
import pytest
from qalgebra.utils.testing import datadir
# TODO
| 0.976563 | 1 |
src/question/migrations/0006_auto_20190215_0755.py | DevTeamSCH/vikoverflow-backend | 0 | 12793488 | # Generated by Django 2.1.7 on 2019-02-15 07:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("question", "0005_merge_20190215_0616")]
operations = [
migrations.RemoveField(model_name="answer", name="is_visible"),
migrations.RemoveField(model_name=... | 1.523438 | 2 |
highlights_notifications.py | skontar/hexchat-plugins | 0 | 12793489 | """
Plugin for better notifications with actions.
HexChat Python Interface: http://hexchat.readthedocs.io/en/latest/script_python.html
IRC String Formatting: https://github.com/myano/jenni/wiki/IRC-String-Formatting
"""
import logging
import re
import subprocess
import sys
from os import path
import dbus
import hexc... | 2.21875 | 2 |
plugin/lighthouse/reader/__init__.py | x9090/lighthouse | 1,741 | 12793490 | from .coverage_reader import CoverageReader
| 1.03125 | 1 |
records_mover/records/pandas/to_csv_options.py | ellyteitsworth/records-mover | 0 | 12793491 | import csv
from ...utils import quiet_remove
from ..delimited import cant_handle_hint
from ..processing_instructions import ProcessingInstructions
from ..records_format import DelimitedRecordsFormat
from records_mover.mover_types import _assert_never
import logging
from typing import Set, Dict
logger = logging.getLog... | 2.53125 | 3 |
tests/unit/raptiformica/actions/prune/test_ensure_neighbour_removed_from_config_by_host.py | vdloo/raptiformica | 21 | 12793492 | from raptiformica.actions.prune import ensure_neighbour_removed_from_config_by_host
from tests.testcase import TestCase
class TestEnsureNeighbourRemovedFromConfigByHost(TestCase):
def setUp(self):
self._del_neighbour_by_key = self.set_up_patch(
'raptiformica.actions.prune._del_neighbour_by_key... | 1.976563 | 2 |
src/driving_curriculum/agents/algorithmic/teacher_quintic_polynomials.py | takeitallsource/pac-simulator | 1 | 12793493 | from math import cos, sin
import numpy as np
from ....simulator import Agent
from .quintic_polynomials_planner import quinic_polynomials_planner
class TeacherQuinticPolynomials(Agent):
def learn(self, state, action):
raise NotImplementedError()
def explore(self, state, horizon=1):
raise NotI... | 3.125 | 3 |
research/cv/meta-baseline/postprocess.py | mindspore-ai/models | 77 | 12793494 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 2.015625 | 2 |
answers/Khushi/Day 6/Question 2.py | arc03/30-DaysOfCode-March-2021 | 22 | 12793495 | <gh_stars>10-100
# For the output shown in example enter the required array as shown [1,4,2,5,3]
def OddLengthSum(arr):
sum=0
l=len(arr)
for i in range(l):
for j in range(i,l,2):
for k in range(i,j+1,1):
sum+=arr[k]
return sum
print("Enter the array of 5 elements: ")... | 3.921875 | 4 |
PiCode/test_docker/test.py | SilentByte/healthcam | 2 | 12793496 | from picamera import PiCamera
from picamera.exc import PiCameraMMALError
from time import sleep
from io import StringIO
from glob import glob
from os.path import getsize
if __name__ == "__main__":
tries = 0
while tries < 5:
try:
cam = PiCamera(camera_num=0)
except PiCameraMMALError... | 2.671875 | 3 |
nn/framework.py | thunlp/Chinese_NRE | 272 | 12793497 | import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from .encoder import BiLstmEncoder
from .classifier import AttClassifier
from torch.autograd import Variable
from torch.nn import functional, init
class MGLattice_model(nn.Module):
def... | 2.625 | 3 |
tools/gen/plugin_base.py | mingkaic/tenncor | 1 | 12793498 | #!/usr/bin/env python3
''' Plugin interface definition '''
import abc
class PluginBase(metaclass=abc.ABCMeta):
@abc.abstractmethod
def plugin_id(self) -> str:
'''
Return plugin identifier
'''
@abc.abstractmethod
def process(self,
generated_files: dict, arguments: dic... | 2.90625 | 3 |
crawl/dirbot/spiders/data.py | okfde/odm-datenerfassung | 5 | 12793499 | import unicodecsv
import metautils
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from dirbot.items import Website
class DataSpider(CrawlSpider):
name = "data"
rules = (
# Extract all links a... | 2.828125 | 3 |
kerlas/gym_env.py | imandr/KeRLas | 0 | 12793500 | <filename>kerlas/gym_env.py<gh_stars>0
import gym, random, numpy as np
class MultiEnv(object):
pass
class MultiGymEnv(MultiEnv):
#
# Convert 1-agent Gym environment into a multi-agent environment
#
NAgents = 1
def __init__(self, env, tlimit=None, random_observation_space=None):
... | 2.9375 | 3 |
lib/to_geojson.py | erictheise/trctr-pllr | 0 | 12793501 | <reponame>erictheise/trctr-pllr
import json
def array_to_geojson(array):
props = []
for i in range(len(array[0])-1):
props.append(array[0][i])
feature_collection = {
"type": "FeatureCollection",
"features": []
}
features = []
for i in range(1, len(array)):
feat... | 2.859375 | 3 |
setup.py | 465b/General-Ecosystem-Modeling-Framework | 1 | 12793502 | <filename>setup.py
from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
readme_as_long_description = f.read()
setup(
name="nemf",
version="0.3.4",
packages=find_pa... | 1.53125 | 2 |
simulator/entities/garage.py | lucassm02/fiap-cptm | 0 | 12793503 | <reponame>lucassm02/fiap-cptm
from typing import List
from .train import Train
class Garage(object):
def __init__(self, name: str, key: str, cars: List[Train], volume: int):
self.name = name
self.key = key
self.cars = cars
self.volume = volume
| 2.671875 | 3 |
3. Python Advanced (September 2021)/3.1 Python Advanced (September 2021)/06. Multidimensional Lists/05_primary_diagonal.py | kzborisov/SoftUni | 1 | 12793504 | size = int(input())
matrix = [[int(x) for x in input().split()] for _ in range(size)]
print(sum([matrix[x][x] for x in range(size)]))
| 3.421875 | 3 |
Python-Data-Science/code.py | Prakhar1212/greyatom-python-for-data-science | 0 | 12793505 | # --------------
# Code starts here
class_1 = ['<NAME>','<NAME>','<NAME>','<NAME>']
class_2 = ['<NAME>','<NAME>','<NAME>']
new_class = class_1 + class_2
new_class.append('<NAME>')
new_class.remove('<NAME>')
print(new_class)
# Code ends here
# --------------
# Code starts here
courses = {'Math':65, 'English': 70, 'Hi... | 3.78125 | 4 |
src/sklearn_evaluation/SQLiteTracker.py | abcnishant007/sklearn-evaluation | 351 | 12793506 | <gh_stars>100-1000
from uuid import uuid4
import sqlite3
import json
import pandas as pd
from sklearn_evaluation.table import Table
class SQLiteTracker:
"""A simple experiment tracker using SQLite
:doc:`Click here <../user_guide/SQLiteTracker>` to see the user guide.
Parameters
----------
path
... | 3.171875 | 3 |
run.pyw | xue0228/keyboard | 0 | 12793507 | <gh_stars>0
from xue_macro import macro
if __name__ == '__main__':
# macro.run(fg='#ECB1AC')
macro.run()
| 1.226563 | 1 |
redis/__init__.py | RuiCoreSci/auth | 0 | 12793508 | from redis.client import Redis
redis = Redis()
__all__ = ['redis']
| 1.25 | 1 |
src/RIOT/tests/blob/tests/01-run.py | ARte-team/ARte | 2 | 12793509 | <reponame>ARte-team/ARte
#!/usr/bin/env python3
# Copyright (C) 2019 <NAME> <<EMAIL>>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
def testfunc(child):
... | 1.5 | 2 |
backend/gifz_api/gifs/__init__.py | mkusiciel/terraform-workshops | 3 | 12793510 | <reponame>mkusiciel/terraform-workshops
default_app_config = 'gifz_api.gifs.apps.GifsConfig'
| 1.015625 | 1 |
consumer_lag.py | aseev-xx/kafka-consumer-lag-metrics | 0 | 12793511 | <reponame>aseev-xx/kafka-consumer-lag-metrics<filename>consumer_lag.py
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import sys
import requests
import ConfigParser
import time
import socket
import os
# get base json object for next
def get_json_object(url):
try:
obj = requests.get(url)
except request... | 2.421875 | 2 |
cmasher/cli_tools.py | ajdittmann/CMasher | 0 | 12793512 | <filename>cmasher/cli_tools.py
# -*- coding: utf-8 -*-
# %% IMPORTS
# Built-in imports
import argparse
from importlib import import_module
import os
import sys
# Package imports
import e13tools as e13
from matplotlib import cm as mplcm
import numpy as np
# CMasher imports
from cmasher import __version__
import cmash... | 2.125 | 2 |
dataprep_example/ingest_retailrocket_dataset.py | DynamicYieldProjects/funnel-rocket | 56 | 12793513 | <reponame>DynamicYieldProjects/funnel-rocket
import sys
import time
import argparse
from pathlib import Path
from contextlib import contextmanager
import pandas as pd
from pandas import DataFrame
EVENTS_FILE = 'events.csv'
PROPS_FILE_1 = 'item_properties_part1.csv'
PROPS_FILE_2 = 'item_properties_part2.csv'
INPUT_FILE... | 2.5 | 2 |
multipole-graph-neural-operator/utilities.py | vir-k01/graph-pde | 121 | 12793514 | <gh_stars>100-1000
import torch
import numpy as np
import scipy.io
import h5py
import sklearn.metrics
from torch_geometric.data import Data
import torch.nn as nn
from scipy.ndimage import gaussian_filter
#################################################
#
# Utilities
#
#################################################... | 2.109375 | 2 |
bitbots_motion/bitbots_hcm/scripts/test_subscriber.py | MosHumanoid/bitbots_thmos_meta | 3 | 12793515 | <reponame>MosHumanoid/bitbots_thmos_meta
#!/usr/bin/env python3
import rospy
import time
from sensor_msgs.msg import Imu
class SubTest():
def __init__(self):
rospy.init_node("test_sub")
self.arrt = []
self.arrn = []
self.sum =0
self.count=0
self.max = 0
self... | 2.34375 | 2 |
test_hello.py | bkwin66/python_testx | 0 | 12793516 | print "Hello World"
print "Print something else"
for i in range (10):
print i
| 3.390625 | 3 |
pycqed/measurement/qcodes_QtPlot_colors_override.py | nuttamas/PycQED_py3 | 60 | 12793517 | """
[2020-02-03] Modified version of the original qcodes.plots.colors
Mofied by <NAME> for Measurement Control
It modules makes available all the colors maps from the qcodes, context menu of
the color bar from pyqtgraph, the circular colormap created by me (Victo),
and the reversed version of all of them.
Feel free t... | 2.0625 | 2 |
backend/src/baserow/config/asgi.py | ashishdhngr/baserow | 839 | 12793518 | import django
from channels.routing import ProtocolTypeRouter
from baserow.ws.routers import websocket_router
from django.core.asgi import get_asgi_application
django.setup()
django_asgi_app = get_asgi_application()
application = ProtocolTypeRouter(
{"http": django_asgi_app, "websocket": websocket_router}
)
| 1.671875 | 2 |
source/refresh-ta-check-lambda.py | awslabs/aws-trusted-advisor-explorer | 14 | 12793519 | ######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 1.828125 | 2 |
Homework/ArrayList.py | Frumka/python_developer | 0 | 12793520 | <reponame>Frumka/python_developer
from array import array, ArrayType
from typing import TypeVar, Iterable
from copy import deepcopy
T = TypeVar("T")
class ArrayList(object):
class Iterator(object):
__data: ArrayType
__index: int
def __init__(self, data: ArrayType):
self.__dat... | 3.46875 | 3 |
scripts/render.py | vitchyr/handful-of-trials | 1 | 12793521 | <reponame>vitchyr/handful-of-trials<gh_stars>1-10
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import argparse
import pprint
from dotmap import DotMap
from dmbrl.misc.MBExp import MBExperiment
from dmbrl.controllers.MPC import MPC
from dmbrl.c... | 1.8125 | 2 |
layers/modules/multibox_loss_combined.py | Ze-Yang/Context-Transformer | 86 | 12793522 | import torch
import torch.nn as nn
import torch.nn.functional as F
from utils.box_utils import match
class MultiBoxLoss_combined(nn.Module):
"""SSD Weighted Loss Function
Compute Targets:
1) Produce Confidence Target Indices by matching ground truth boxes
with (default) 'priorboxes' that h... | 2.359375 | 2 |
tests/test_simple.py | mosquito/argclass | 2 | 12793523 | import logging
import os
import re
import uuid
from typing import List, Optional, FrozenSet
import pytest
import argclass
class TestBasics:
class Parser(argclass.Parser):
integers: List[int] = argclass.Argument(
"integers", type=int,
nargs=argclass.Nargs.ONE_OR_MORE, metavar="N",... | 2.625 | 3 |
tmapi/tests/models/test_association.py | ajenhl/django-tmapi | 2 | 12793524 | # Copyright 2011 <NAME> (<EMAIL>)
#
# 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 writ... | 1.96875 | 2 |
robustfpm/util/io.py | andreevnick/robust-financial-portfolio-management-framework | 1 | 12793525 | <reponame>andreevnick/robust-financial-portfolio-management-framework<filename>robustfpm/util/io.py<gh_stars>1-10
# Copyright 2021 portfolio-robustfpm-framework Authors
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
# ht... | 1.984375 | 2 |
mmdet/core/anchor/builder.py | mrzhuzhe/mmdetection | 0 | 12793526 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
from mmcv.utils import Registry, build_from_cfg
PRIOR_GENERATORS = Registry('Generator for anchors and points')
ANCHOR_GENERATORS = PRIOR_GENERATORS
def build_prior_generator(cfg, default_args=None):
return build_from_cfg(cfg, PRIOR_GEN... | 2.03125 | 2 |
list2/task2.py | ErykKrupa/python-course | 0 | 12793527 | <filename>list2/task2.py
from sys import argv, stderr
import re
_base64_str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
def encode(raw_file_path, encrypted_file_path):
raw_file = open(raw_file_path, 'r')
encrypted_file = open(encrypted_file_path, 'w')
blob = ''.join(f'{char:08b}... | 3.078125 | 3 |
x-tree/x-tree.py | bzliu94/algorithms | 0 | 12793528 | <reponame>bzliu94/algorithms<gh_stars>0
# 2016-08-21
# x-tree featuring enclosure and containment queries
# dimension is implicit (determined using points sampled) and assumed to be consistent
# we never split a super-node
# updated on 2016-08-23 to fix traditional/non-traditional isLeafNode() distinction
# update... | 2.90625 | 3 |
tests/test_mailmerge.py | plysytsya/mailmerge | 0 | 12793529 | """
System tests.
<NAME> <<EMAIL>>
"""
import os
import re
import sh
from . import utils
def test_stdout():
"""Verify stdout and stderr.
pytest docs on capturing stdout and stderr
https://pytest.readthedocs.io/en/2.7.3/capture.html
"""
mailmerge_cmd = sh.Command("mailmerge")
output = mailmer... | 2.6875 | 3 |
src/vcslinks/tests/test_py_typed.py | tkf/vcslinks | 1 | 12793530 | <filename>src/vcslinks/tests/test_py_typed.py
from pathlib import Path
def test_py_typed():
assert (Path(__file__).parents[1] / "py.typed").exists()
| 1.859375 | 2 |
bogrod/banking/models.py | joostrijneveld/bogrod | 0 | 12793531 | <gh_stars>0
from django.db import models
from django.db.models import Sum
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
class Account(models.Model):
iban = models.CharField(_('iban'), max_length=34, unique=True)
ACCOUNT_TYPES = (
('checking'... | 2.140625 | 2 |
readsdb_plot.py | ondrolexa/readsdb | 3 | 12793532 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ReadSDBDialog
A QGIS plugin
Read PySDB structural data into QGIS
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
... | 1.601563 | 2 |
Volume Estimation/demo.py | JessieRamaux/Food-Volume-Estimation | 10 | 12793533 | import argparse
import torch
import cv2
import os
import torch.nn.parallel
import modules, net, resnet, densenet, senet
import numpy as np
import loaddata_demo as loaddata
import pdb
import argparse
from volume import get_volume
from mask import get_mask
import matplotlib.image
import matplotlib.pyplot as plt
parser ... | 2.28125 | 2 |
plugins/fake_msg/__init__.py | Orilx/Niko-py | 4 | 12793534 | <filename>plugins/fake_msg/__init__.py
from nonebot import on_command
from nonebot.adapters.onebot.v11 import GroupMessageEvent, Message, MessageSegment
from nonebot.params import CommandArg
from utils.message_builder import fake_forward_msg
from utils.utils import send_group_forward_msg
fake = on_command('fake', alia... | 2.171875 | 2 |
devops-console/apps/features/migrations/0017_auto_20190911_1550.py | lilinghell/devops | 4 | 12793535 | # Generated by Django 2.1.5 on 2019-09-11 07:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('features', '0016_auto_20190605_1830'),
]
operations = [
migrations.AlterField(
model_name='feature',
name='apps',
... | 1.445313 | 1 |
hextech_core/blog/models.py | duonghao314/hextech-core | 0 | 12793536 | from django.db import models
from django.utils import timezone
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.core.fields import RichTextField
from hextech_core.core.m... | 1.960938 | 2 |
models/drocc.py | jbr-ai-labs/PU-OC | 0 | 12793537 | import torch
import torch.nn.functional as F
import torch.utils.data
import torch.utils.data
from models.base_models import OCModel, PUModelRandomBatch
from models.classifiers import Net
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# code DROCC is borrowed from https://github.com/microsoft/... | 2.453125 | 2 |
chat/chat.py | tima-fey/devman | 0 | 12793538 | import argparse
import asyncio
import logging
import datetime
import sys
import json
from aiofile import AIOFile
async def read_from_socket(host, port):
timer = 0
reader, writer = None, None
async with AIOFile("text.txt", 'a') as _file:
while True:
try:
if not reader o... | 2.84375 | 3 |
sdk/python/pulumi_oci/identity/get_group.py | EladGabay/pulumi-oci | 5 | 12793539 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 1.757813 | 2 |
divulga/views.py | SaviorsServices/CommunityService | 0 | 12793540 | <filename>divulga/views.py
from email.mime.text import MIMEText
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
f... | 2.0625 | 2 |
voting/templatetags/voting/custom_helpers.py | lzh9102/ee-voting | 0 | 12793541 | <gh_stars>0
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
def strip_quotes(s):
if s[0] == s[-1] and s.startswith(('"', "'")): # is quoted string
return s[1:-1] # strip quotes
else:
return s
@register.simple_tag(takes_context=True)
def c... | 2.484375 | 2 |
bin/cmssw_wm_create_process.py | khurtado/cmssw-wm-tools | 0 | 12793542 | <filename>bin/cmssw_wm_create_process.py<gh_stars>0
#!/usr/bin/env python
import FWCore.ParameterSet.Config as cms
import pickle
try:
import argparse
except ImportError: #get it from this package instead
import archived_argparse as argparse
import sys, re, os
import json
from tweak_program_helpers import mak... | 2.046875 | 2 |
posters/apps.py | postersession/postersession | 0 | 12793543 | <reponame>postersession/postersession<filename>posters/apps.py
from django.apps import AppConfig
class PostersConfig(AppConfig):
name = 'posters'
| 1.304688 | 1 |
tests/filters/test_interface.py | FlaskGuys/Flask-Imagine | 1 | 12793544 | import unittest
from flask.ext.imagine.filters.interface import ImagineFilterInterface
class TestImagineFilterInterface(unittest.TestCase):
interface = None
def setUp(self):
self.interface = ImagineFilterInterface()
def test_not_implemented_apply_method(self):
with self.assertRaises(NotI... | 2.375 | 2 |
alura-python/gamelib/dao.py | wiltonpaulo/python-fullcourse | 0 | 12793545 | <filename>alura-python/gamelib/dao.py
from models import Game, User
SQL_DELETE_GAME = "delete from game where id = %s"
SQL_GAME_BY_ID = "SELECT id, name, category, console from game where id = %s"
SQL_USER_BY_ID = "SELECT id, name, password from user where id = %s"
SQL_UPDATE_GAME = "UPDATE game SET name=%s, category=... | 3.21875 | 3 |
src/bgapi/gatt_server/rsp.py | GetAmbush/python-bgapi | 5 | 12793546 | <reponame>GetAmbush/python-bgapi
from struct import (unpack_from, calcsize, error)
def find_attribute(data: bytes, offset: int = 0):
FORMAT = '<HH'
result, sent_len = unpack_from(FORMAT, data, offset=offset)
offset += calcsize(FORMAT)
payload = {
'result': result,
'sent_len': sent_len,... | 2.296875 | 2 |
backend/api/migrations/0004_auto_20191114_1008.py | a-mazalov/django-vuejs | 0 | 12793547 | <filename>backend/api/migrations/0004_auto_20191114_1008.py
# Generated by Django 2.2.1 on 2019-11-14 07:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0003_auto_20191113_1639'... | 1.5625 | 2 |
Utils/dicts/sensor_dicts.py | isse-augsburg/PermeabilityNets | 1 | 12793548 | sensor_indices = {
"1140": ((0, 1), (0, 1)),
"285": ((1, 2), (1, 2)),
"80": ((1, 4), (1, 4)),
"20": ((1, 8), (1, 8))
}
sensor_shape = {
"1140": (38, 30),
"285": (19, 15),
"80": (10, 8),
"20": (5, 4)
}
| 1.632813 | 2 |
data/altera_file_splitter.py | bradysalz/fpga-pin-trends | 0 | 12793549 | #!/usr/bin/env python3
"""Separates Altera's junky concatenated CSV files into unique files
We do this in two steps:
1. Move all existing *.txt files to *.tmp files
2. Go through and break up at the start of each CSV file into a new file
"""
import os
import sys
from pathlib import Path
def main(root: str):
ro... | 3.375 | 3 |
B2G/gecko/testing/tps/tps/mozhttpd.py | wilebeast/FireFox-OS | 3 | 12793550 | <gh_stars>1-10
#!/usr/bin/python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import BaseHTTPServer
import SimpleHTTPServer
import threading
import sys
import os
i... | 2.171875 | 2 |