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 |
|---|---|---|---|---|---|---|
iot/rmq/config.py | aabdulwahed/Sitechain_paper_performanceAnalysis | 0 | 12797051 | <filename>iot/rmq/config.py<gh_stars>0
import os
import sys
from ConfigParser import ConfigParser
def configLoader(filename):
if os.path.exists(filename):
_config = ConfigParser()
_config.read(filename)
return _config._sections
else:
return False
| 2.453125 | 2 |
Engine/Metrics.py | teridax5/Minesweeper | 0 | 12797052 | from random import sample
n = 9
class MineMap:
def __init__(self, size=9, mine_coefficient=0.1):
self.size = size
self.field = [[0 for _ in range(self.size)] for _ in range(self.size)]
self.mines = int((self.size**2) * mine_coefficient)
self.shuffle()
def shuffle(se... | 3.125 | 3 |
tests/test_typing.py | kazh98/fpmlib | 0 | 12797053 | #!/usr/bin/env python3
import unittest
from fpmlib.typing import *
| 1.179688 | 1 |
reachy_pyluos_hal/device.py | pollen-robotics/reachy_pyluos_hal | 0 | 12797054 | """Device type annotation."""
from typing import Union
from .dynamixel import DynamixelMotor
from .fan import Fan
from .force_sensor import ForceSensor
from .joint import Joint
from .orbita import OrbitaActuator
Device = Union[Fan, Joint, DynamixelMotor, ForceSensor, OrbitaActuator]
| 1.578125 | 2 |
problems/linked-lists/linked_list_cycle.py | andrenbrandao/algorithm-problems | 0 | 12797055 | <reponame>andrenbrandao/algorithm-problems
"""
LeetCode 141. Linked List Cycle
https://leetcode.com/problems/linked-list-cycle/
"""
# O(n) time
# O(n) memory
from typing import Optional
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
cla... | 3.59375 | 4 |
setup.py | nitros12/pyumlgen | 0 | 12797056 | <filename>setup.py
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md")) as f:
long_desc = f.read()
setup(
name="pyumlgen",
version="0.1.6",
description="Generate UML diagrams with t... | 1.515625 | 2 |
tests/unit/shipping/discount_tests.py | dimka665/django-oscar | 0 | 12797057 | from decimal import Decimal as D
from django.test import TestCase
from nose.plugins.attrib import attr
import mock
from oscar.apps.shipping import methods
from oscar.apps.shipping.models import OrderAndItemCharges
@attr('shipping')
class TestStandardMethods(TestCase):
def setUp(self):
self.non_discount... | 2.171875 | 2 |
django_comments/django_comments/views.py | anistark/django-react-comments | 6 | 12797058 | <gh_stars>1-10
from django.shortcuts import render_to_response
# from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from comment_react.models import Comments
from django.http import HttpResponse
import json
import urllib2
from django.http import QueryDict
@csrf_exempt
def ... | 2.203125 | 2 |
model.py | jouleffect/SEIRD-Epidemics-Simulator | 0 | 12797059 | # Network
import numpy as np
import pandas as pd
import simulator
import random
from igraph import *
import matplotlib.pyplot as plt
class Network():
"""docstring for Network"""
def __init__(self, simulator):
# Genero un grafo random
self.g = Graph.Erdos_Renyi(simulator.num_nodi,simulator.p_link)
# Ini... | 2.96875 | 3 |
shortener/admin.py | shubhamnishad97/URL-Shortener | 7 | 12797060 | from django.contrib import admin
# Register your models here.
from .models import shortenedUrl
admin.site.register(shortenedUrl) | 1.34375 | 1 |
binilla/windows/filedialog.py | delan/binilla | 1 | 12797061 | <reponame>delan/binilla<gh_stars>1-10
'''
This module is our wrapper for filedialog so we can use a better one
if it is available.
The filepicker for Tkinter on Linux is just... ouch.
So, this is the alternative solution.
'''
import sys
from pathlib import Path
USE_TK_DIALOG = True
if "linux" in sys.platform:
i... | 2.5625 | 3 |
main.py | sagaragarwal94/TwitterScraper | 15 | 12797062 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
import twitter_scraper as twitter_scraper
import json
import codecs
standard_library.install_aliases()
def main():
def build_list... | 2.796875 | 3 |
sample_app/_get_banned_users.py | encyphered/accelbyte-python-sdk | 0 | 12797063 | import yaml
import click
from accelbyte_py_sdk.api.iam import admin_get_banned_users_v3
from ._utils import login_as as login_as_internal
@click.command()
@click.argument("active_only", type=bool)
@click.argument("ban_type")
@click.argument("offset", type=int)
@click.argument("limit", type=int)
@click.option("--na... | 1.890625 | 2 |
2015/08.py | bernikr/advent-of-code | 1 | 12797064 | from aocd import get_data
def part1(a):
return sum(len(l) - len(l.encode('utf-8').decode('unicode_escape')) + 2 for l in a)
def part2(a):
return sum(len(l.encode('unicode_escape').decode('utf-8').replace('"', '\\"')) - len(l) + 2 for l in a)
if __name__ == '__main__':
data = get_data(day=8, year=2015)... | 3 | 3 |
textscroll_animation.py | mfinkle/circuitpython_animationextras | 0 | 12797065 | from adafruit_led_animation.animation import Animation
import adafruit_framebuf
class TextScroll(Animation):
def __init__(self, grid_object, speed, text, color, font_name='font5x8.bin', name=None):
self._text = text
self._font_name = font_name
self._frame = 0
# We're only using th... | 3.03125 | 3 |
models/cnn_gru/cnn_gru.py | RyanMokarian/Solar_Irradiance_Forecast_using_Conv3_LSTM_GRU_Attention | 4 | 12797066 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers, models, activations
from models.cnn_gru.cnn import CNN, Encoder
class CnnGru(tf.keras.Model):
def __init__(self, seq_len):
super().__init__()
self.seq_len = seq_len
self.cnn = CNN()... | 2.84375 | 3 |
config.py | mplewis/trianglebot | 0 | 12797067 | <reponame>mplewis/trianglebot
import re
from os import environ
# URL to the Groupme API endpoint
API_URL = 'https://api.groupme.com/v3/bots/post'
# URL to the Google Sheets JSON API endpoint
SHEET_BASE_URL = ('https://spreadsheets.google.com/feeds/cells/%s/%s'
'/public/values?alt=json')
SHEET_ID_MA... | 2.390625 | 2 |
chia/types/spend_bundle_conditions.py | nur-azhar/chia-blockchain | 1 | 12797068 | <reponame>nur-azhar/chia-blockchain
from chia_rs import Spend, SpendBundleConditions
__all__ = ["Spend", "SpendBundleConditions"]
| 0.960938 | 1 |
helper/f2g_omim_mapping.py | PEDIA-Charite/PEDIA-workflow | 9 | 12797069 | '''Create an omim mapping based on information from Face2Gene using the
Face2Gene library.'''
from pprint import pprint
import json
from lib.api.face2gene import Face2Gene
from lib.model.config import ConfigManager
config_data = ConfigManager()
f2g_session = Face2Gene(config=config_data)
s_list = f2g_session.brows... | 2.71875 | 3 |
tests/test_shadow_maya_system.py | rBrenick/shadow-maya | 1 | 12797070 | from maya import cmds
from base import MayaBaseTestCase
import shadow_maya.shadow_maya_system as system
class TestShadowMayaSystem(MayaBaseTestCase):
def test_system(self):
"""Test system in some fashion"""
return True
| 1.984375 | 2 |
aqua_bot/aqua_comandos.py | OHomemParede/aqua_bot_project | 0 | 12797071 | from googletrans import LANGUAGES
from googletrans import Translator
translator = Translator()
async def ajuda(message, comandos :dict):
msg = "```\n"
for c in comandos.keys():
msg += comandos[c][1]+'\n'
msg += "```"
await message.channel.send(msg)
async def traduz(message, _):
msg = message.conten... | 2.921875 | 3 |
src/ape/managers/accounts.py | unparalleled-js/ape | 210 | 12797072 | from typing import Dict, Iterator, List, Type
from dataclassy import dataclass
from pluggy import PluginManager # type: ignore
from ape.api.accounts import AccountAPI, AccountContainerAPI, TestAccountAPI
from ape.types import AddressType
from ape.utils import cached_property, singledispatchmethod
from .config impor... | 2.140625 | 2 |
11-20/Euler_12.py | Drudoo/Euler | 0 | 12797073 | <reponame>Drudoo/Euler<gh_stars>0
# Highly divisible triangular number
# ------------------------------------------------- #
# Return triangle number, return number of factors.
# While factors less than 500, get the triangle number,
# then the factors of that number.
# -------------------------------------------------... | 3.359375 | 3 |
src/models/base.py | armavox/vae-cancer-nodules | 0 | 12797074 | # Code provided by:
# @misc{Subramanian2020,
# author = {<NAME>},
# title = {PyTorch-VAE},
# year = {2020},
# publisher = {GitHub},
# journal = {GitHub repository},
# howpublished = {\url{https://github.com/AntixK/PyTorch-VAE}}
# }
from torch import nn
from abc import abstractmethod
from typing import Lis... | 2.46875 | 2 |
pymelet/point_stat/point_stat_continuous.py | wqshen/pymelet | 2 | 12797075 | # -*- coding: utf-8 -*-
# @Author: wqshen
# @Email: <EMAIL>
# @Date: 2020/6/10 14:43
# @Last Modified by: wqshen
import numpy as np
from logzero import logger
from .point_stat_base import PointStatBase
class ContinuousVariableVerification(PointStatBase):
def __init__(self, forecast=None, obs=None, fcsterr=None,... | 2.453125 | 2 |
sir/SIR_continuous_reinfected.py | xinyushi/SIR.Model | 0 | 12797076 | import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from numpy.random import randint, rand
from sir import *
def SIR_continuous_reinfected(b,k,time,ii,r):
"""
Simulates continuous SIR model
ii = initial percentage of infected
time = Days of simulation
b = proba... | 3.3125 | 3 |
bloom/editor/operations/flip.py | thomasrogers03/bloom | 9 | 12797077 | <reponame>thomasrogers03/bloom
# Copyright 2020 <NAME>
# SPDX-License-Identifier: Apache-2.0
from .. import map_objects
from ..undo_stack import SimpleUndoableOperation, UndoStack
class Flip:
def __init__(
self, undo_stack: UndoStack, map_object: map_objects.EmptyObject, part: str
):
self._un... | 2.453125 | 2 |
icrv=club/trial.py | IamWafula/Kiranja | 1 | 12797078 | print("Enter the first number:")
f_num = int(input())
print("Enter the second number:")
s_num = int(input())
subtraction = f_num - s_num
print ("The value is:")
print ( subtraction ) | 3.984375 | 4 |
Algorithm/Easy/1-500/365Count1inBinary.py | MartinYan623/Lint-Code | 0 | 12797079 | <filename>Algorithm/Easy/1-500/365Count1inBinary.py<gh_stars>0
class Solution:
"""
@param: num: An integer
@return: An integer
"""
def countOnes(self, num):
# write your code here
"""
count=0
while num!=0:
num = num & (num-1)
count+=1
... | 3.453125 | 3 |
simulator/web/lset.py | ondiiik/meteoink | 2 | 12797080 | <reponame>ondiiik/meteoink<filename>simulator/web/lset.py
from config import location
from log import dump_exception
def page(web):
try:
i = int(web.args['idx'])
args = web.args['name'], float(web.args['lat']), float(web.args['lon'])
location[i].name, location[i].lat, location[i].lo... | 2.1875 | 2 |
rabbit_tools/base.py | andrzejandrzej/rabbit-tools | 0 | 12797081 | import argparse
import logging
import re
import sys
from collections import Sequence
from pyrabbit import Client
from pyrabbit.http import HTTPError
from rabbit_tools.config import (
Config,
ConfigFileMissingException,
)
logger = logging.getLogger(__name__)
class StopReceivingInput(Exception):
"""
... | 2.71875 | 3 |
showcase/migrations/0001_initial.py | aurthurm/my-site | 0 | 12797082 | # Generated by Django 2.1.1 on 2018-09-13 18:15
from django.db import migrations, models
import django.utils.timezone
import showcase.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Portfolio',
... | 1.921875 | 2 |
jump.py | shelper/leetcode | 0 | 12797083 | def jump(steps, method=1):
if method == 1:
if len(steps) <= 1:
return True
for i in range(len(steps)):
if i == 0:
cur_cover = steps[0]
else:
cur_cover = max(cur_cover, i + steps[i])
if cur_cover <= i:
... | 3.984375 | 4 |
w02/e25.py | Luccifer/PythonCoruseraHSE | 1 | 12797084 | # Список квадратов
def list_of_squares(num):
i = 1
squares = []
while i**2 <= num:
squares.append(i**2)
i += 1
return squares
if __name__ == '__main__':
num = int(input())
print(*list_of_squares(num))
| 4.0625 | 4 |
pogoiv/poke_data_error.py | tmwilder/pogoiv | 17 | 12797085 | class PokeDataError(ValueError):
pass | 1.09375 | 1 |
BlogPosts/Average_precision/average_precision_post_code.py | markgraves/roamresearch | 190 | 12797086 | <gh_stars>100-1000
from copy import copy
from collections import OrderedDict
import numpy as np
import pandas as pd
from sklearn.metrics import average_precision_score, auc, roc_auc_score
from sklearn.metrics import precision_recall_curve
from sklearn.linear_model import LogisticRegressionCV
from sklearn.cross_validat... | 3.015625 | 3 |
Queens.py | mtxrii/NQueens | 0 | 12797087 | def placeQueen(B, i, j):
B[i][j] += 1
B[i][0] = j
down = j
# vertical downwards queen line of sight
for k in range(len(B)):
if k != i:
B[k][down] -= 1
# diagonal downwards queen line of sight
for l in range(len(B)):
... | 3.46875 | 3 |
src/extendable_pydantic/__init__.py | lmignon/pydantic-ext | 0 | 12797088 | <gh_stars>0
"""A lib to define pydantic models extendable at runtime."""
# shortcut to main used class
from .main import ExtendableModelMeta
from .version import __version__
| 1.179688 | 1 |
ScratchServer.py | manab/MugbotActionDesigner | 1 | 12797089 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import socketserver
except:
import SocketServer as socketserver
import signal
import socket
import serial
import os
import json
import sys
HOST, PORT = '0.0.0.0', 51234
serial = serial.Serial('/dev/ttyACM0', 57600)
class ScratchHandler(socketserver.BaseRequ... | 2.578125 | 3 |
bytesink.py | hdb3/BGPstream | 0 | 12797090 | <gh_stars>0
# bytesink.py
from logger import trace, info, show, warn, error
from basemessage import WireMessage
from nullsink import NullSink
class Sink:
def __init__(self,source):
self.input_type = WireMessage
self.iter = source
def run(self):
trace("")
n = 0
s = 0
... | 2.4375 | 2 |
mycroft/tests/logic/test_run_actions.py | Yelp/mycroft | 50 | 12797091 | # -*- coding: utf-8 -*-
import pytest
from boto.dynamodb2.fields import HashKey
from boto.dynamodb2.fields import RangeKey
from boto.dynamodb2.fields import GlobalAllIndex
from boto.dynamodb2.table import Table
from mycroft.models.aws_connections import get_avro_schema
from mycroft.models.etl_records import ETLRecord... | 1.8125 | 2 |
accounts/forms.py | shivBoy77/Syk_toW | 0 | 12797092 | from django import forms
from django.contrib.auth.models import Group
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.core.exceptions import ValidationError
from django.contrib.auth import authenticate
from .models import User, Profile
from django.contrib import messages
from phonenum... | 2.53125 | 3 |
smart_heating/models.py | spiegelm/smart-heating-server | 0 | 12797093 | """
Copyright 2016 <NAME>, <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 2.296875 | 2 |
frozenlake.py | alexandrefch/q-learning-python | 1 | 12797094 | <gh_stars>1-10
import gym
from agent import *
from progressBar import *
from matplotlib.pyplot import *
class Frozenlake():
"""
A class to manage a frozen lake from gym lib and make an agent play.
...
Attributes
----------
setting : Dict()
Dict of all game setting
agent : Agent()... | 3.34375 | 3 |
src/main.py | axelbr/jax-estimators | 0 | 12797095 | """
Adapted Code from https://github.com/AtsushiSakai/PythonRobotics
"""
from functools import partial
from estimation import ExtendedKalmanFilter, KalmanFilter
import jax.numpy as jnp
import numpy as np
from jax import jacfwd, jit
import matplotlib.pyplot as plt
from src.environments import DiffDriveRobot
from uti... | 2.359375 | 2 |
setup.py | DNKonanov/uni_cli | 0 | 12797096 | <reponame>DNKonanov/uni_cli
import setuptools
setuptools.setup(
name="uniqpy",
version="0.1.3",
author="<NAME>",
author_email="<EMAIL>",
description="UNIQUAC-based tool for multicomponent VLEs",
long_description="uniqpy",
long_description_content_type="",
url="https://github.com/DNKonan... | 1.382813 | 1 |
examples/plot_logreg_timings.py | Badr-MOUFAD/celer | 0 | 12797097 | """
==================================================================
Compare LogisticRegression solver with sklearn's liblinear backend
==================================================================
"""
import time
import warnings
import numpy as np
from numpy.linalg import norm
import matplotlib.pyplot as plt
f... | 2.53125 | 3 |
test/test_definition.py | illingwo/sam-web-client | 0 | 12797098 | #! /usr/bin/env python
import testbase
import unittest
import samweb_client
import samweb_cli
import time,os
defname = 'test-project'
class TestDefinition(testbase.SamdevTest):
def test_descDefinition_DefNotFound(self):
fake_def_name = 'doesnotexist_%d' % time.time()
self.assertRaises(samweb_clie... | 2.3125 | 2 |
utils_nlp/models/gensen/utils.py | gohanlon/nlp | 4,407 | 12797099 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Minibatching utilities."""
import itertools
import operator
import os
import pickle
import numpy as np
import torch
from sklearn.utils import shuffle
from torch.autograd impor... | 2.6875 | 3 |
tempCodeRunnerFile.py | MuhammadTalha28/space-invader-fyp | 1 | 12797100 | <reponame>MuhammadTalha28/space-invader-fyp
game.image.load(
'space_breaker_asset\Background\stars_texture.png').convert_alpha(), (1300, 800))
| 1.554688 | 2 |
app_SQLite.py | hyhplus/FlaskFirstDemo | 0 | 12797101 | <reponame>hyhplus/FlaskFirstDemo
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sqlite3
import config
from flask import *
app = Flask(__name__)
app.config.from_object('config')
@app.before_request
def before_request():
g.db = sqlite3.connect(app.config['DATABASE'])
@app.teardown_request
def teardown_re... | 3.015625 | 3 |
backend/src/auth.py | raduschirliu/calgary-hacks-2022 | 1 | 12797102 | <filename>backend/src/auth.py
from flask import request
import jwt
import os
JWT_SECRET = os.getenv('JWT_SECRET')
JWT_AUDIENCE = os.getenv('JWT_AUDIENCE')
# Check if the request header includes a valid JWT
def verify_jwt():
authorization = request.headers.get('Authorization')
if not authorization:
pr... | 3.0625 | 3 |
patrole_tempest_plugin/tests/api/network/test_availability_zones_rbac.py | lingxiankong/patrole | 14 | 12797103 | # Copyright 2018 AT&T Corporation.
# 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 require... | 1.726563 | 2 |
py/py_0113_non-bouncy_numbers.py | lcsm29/project-euler | 0 | 12797104 | # Solution of;
# Project Euler Problem 113: Non-bouncy numbers
# https://projecteuler.net/problem=113
#
# Working from left-to-right if no digit is exceeded by the digit to its left
# it is called an increasing number; for example, 134468. Similarly if no
# digit is exceeded by the digit to its right it is called a ... | 3.5 | 4 |
airbyte-integrations/connectors/source-firebolt/source_firebolt/source.py | faros-ai/airbyte | 22 | 12797105 | <reponame>faros-ai/airbyte
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import json
from asyncio import gather, get_event_loop
from typing import Dict, Generator
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import (
AirbyteCatalog,
AirbyteConnectionStatus,
AirbyteMe... | 2.078125 | 2 |
responder_commons/report_builder.py | Infosecurity-LLC/responder_commons | 1 | 12797106 | <filename>responder_commons/report_builder.py
import os
import logging
import json
import copy
from benedict import benedict
from responder_commons.exc import TemplateFileNotExist
logger = logging.getLogger('responder_commons')
class Builder:
def __init__(self, translate_params):
# self.translate_collect... | 2.03125 | 2 |
run.py | Anglelengyug/MagiChaum | 0 | 12797107 | import bot
if __name__ == '__main__':
zonbot = bot.Bot('!', pm_help = True)
zonbot.run(zonbot.token)
| 1.132813 | 1 |
mascoord/sim2yaml.py | bbrighttaer/ddcop-dynagraph | 0 | 12797108 | import argparse
import os.path
import oyaml as yaml
def parse_constraint(con_str):
# sample: (0,1):(1,1,1)
agents_str, coefficients_str = con_str.split(':')
x, y = agents_str.replace('(', '').replace(')', '').split(',')
a, b, c = coefficients_str.replace('(', '').replace(')', '').split(',')
c1 = ... | 2.84375 | 3 |
modules/7.Cal_changes_in_inequality.py | YixuanZheng/Aerosol_Inequality_2019 | 3 | 12797109 | # -*- coding: utf-8 -*-
'''
This code calculates changes in the ratio between different population-weighted GDP deciles and quintiles
by <NAME> (<EMAIL>)
'''
import pandas as pd
import numpy as np
from netCDF4 import Dataset
import _env
datasets = _env.datasets
scenarios = _env.scenarios
gdp_year = 201... | 2.671875 | 3 |
typehint.py | xiaopeng163/whats-new-python3.9 | 1 | 12797110 | # from typing import List
mylist: list[int] = [1, 2, 3, 4]
print(mylist)
mylist = '1234'
print(mylist)
| 3.546875 | 4 |
commands.py | syndbg/ssh-chat | 6 | 12797111 | <filename>commands.py
class CommandsHandler:
def __init__(self, protocol):
self.protocol = protocol
self.terminal = self.protocol.terminal
def do_help(self):
public_methods = [function_name for function_name in dir(
self) if function_name.startswith('do_')]
commands... | 3.046875 | 3 |
dataspot-bokeh/dataspot/statistics/excel_importer.py | patrickdehoon/dataspot-docker | 3 | 12797112 | <filename>dataspot-bokeh/dataspot/statistics/excel_importer.py<gh_stars>1-10
from openpyxl import load_workbook
class ExcelImporter:
def __init__(self):
self.__relationships = dict()
def set_relationships(self, ws, statistic):
relationships = self.__relationships
relationships[statis... | 2.59375 | 3 |
Tests/test_mesh_2d.py | robotsorcerer/LevelSetPy | 4 | 12797113 | __author__ = "<NAME>"
__copyright__ = "2021, Hamilton-Jacobi Analysis in Python"
__license__ = "Molux Licence"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Completed"
import argparse
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import os, sys
from os.path import abspath, dirname... | 2.296875 | 2 |
utilities/cleaner.py | asdfhkga/Neutra | 11 | 12797114 | # Module for cleaning messages from all unwanted content
import re
def clean_all(msg):
msg = clean_invite_embed(msg)
msg = clean_backticks(msg)
msg = clean_mentions(msg)
msg = clean_emojis(msg)
return msg
def clean_invite_embed(msg):
"""Prevents invites from embedding"""
return msg.repl... | 2.71875 | 3 |
analyzers/response_size_elliptic.py | dscrobonia/sawyer | 1 | 12797115 | <gh_stars>1-10
import json
import logging
import matplotlib.font_manager
import matplotlib.pyplot as plt
import numpy as np
from sklearn.covariance import EllipticEnvelope
from sklearn.svm import OneClassSVM
log = logging.getLogger(__name__)
def analyze(data):
# Convert this to python data for us to be able to ... | 2.9375 | 3 |
muonic/analysis/muon_lifetime.py | LambdaDigamma/muonic | 3 | 12797116 | #!/usr/bin/env python
import sys
import gzip
#####################################################
#This is coincident level 0!!
#Order of scintillators is irrelevent!
#####################################################
files = sys.argv[1:]
BIT0_4 = 31
BIT5 = 1 << 5
BIT7 = 1 << 7
# For DAQ status
BIT0 = 1 # 1 PP... | 2.53125 | 3 |
tools/bzldoc/bzldoc.bzl | george-enf/enkit | 0 | 12797117 | <filename>tools/bzldoc/bzldoc.bzl<gh_stars>0
load("//tools/codegen:codegen.bzl", "codegen")
load("//tools/mdfmt:mdfmt.bzl", "mdfmt_filter")
def _bzl2yaml_impl(ctx):
args = ctx.actions.args()
for f in ctx.files.src:
args.add("--input", f)
args.add("--short_path", f.short_path)
args.add("--o... | 2.078125 | 2 |
src/wordsim/nn/nn.py | recski/wordsim | 21 | 12797118 | from ConfigParser import ConfigParser
import logging
import os
import sys
from wordsim.models import get_models
from wordsim.nn.utils import evaluate
from wordsim.nn.data import create_datasets
from wordsim.nn.model import KerasModel
def main():
logging.basicConfig(
level=logging.INFO,
format="%(... | 2.5 | 2 |
appengine/components/components/auth/realms.py | amymariaparker2401/luci-py | 74 | 12797119 | # Copyright 2020 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Utilities to work with realms_pb2 messages."""
from .proto import realms_pb2
# Currently acceptable version of Realms API. See api_version i... | 1.875 | 2 |
tests/test_context_manager.py | LouisPi/PiPortableRecorder | 51 | 12797120 | <reponame>LouisPi/PiPortableRecorder
"""tests for Context and ContextManager objects"""
import os
import unittest
from threading import Event
from mock import patch, Mock
try:
from context_manager import ContextManager, Context, ContextError
except ImportError:
print("Absolute imports failed, trying relative ... | 2.546875 | 3 |
Script/TriangularMAtrix.py | AlessandroCaula/Programming_Alessandro_Caula | 0 | 12797121 | matrix=open("/media/alessandro/DATA/User/BIOINFORMATICA.BOLOGNA/Programming_for_Bioinformatics/Module2/Exercise/PAM250.txt","r")
matrix1=open("/media/alessandro/DATA/User/BIOINFORMATICA.BOLOGNA/Programming_for_Bioinformatics/Module2/Exercise/PAM250(1).txt","r")
rows="ARNDCQEGHILKMFPSTWYV"
cols="ARNDCQEGHILKMFPSTWYV"
de... | 3.375 | 3 |
friendFight.py | ctguggbond/ZhihuDTW | 11 | 12797122 | import requests
import hashlib
import time
import json
from pymongo import MongoClient
headers = {
'content-type': 'application/x-www-form-urlencoded',
}
userInfo = {
'player1':{
'uid': '玩家1号的uid',
'token': '玩家1号的token'
},
'player2':{
'uid': '玩家2号的uid',
'token': '玩家2号的t... | 2.484375 | 2 |
rp2/adc.py | fedor2018/my_upython | 0 | 12797123 | <gh_stars>0
from machine import ADC, Pin
from ntc import *
adc0 = ADC(Pin(26)) # create ADC object on ADC pin
adc1 = ADC(Pin(27)) # create ADC object on ADC pin
#adc=None, Vref=3.3, R=10000, Ro=10000.0, To=25.0, beta=3950.0, V=5 )
ntc0=NTC(adc=ADC(Pin(26)), R=3300, Ro=47000, beta=3740)
ntc1=NTC(adc=ADC(Pin(27... | 2.6875 | 3 |
BOJ_Solved/BOJ-21633.py | CodingLeeSeungHoon/Python_Algorithm_TeamNote | 7 | 12797124 | """
백준 21633번 : Bank Transfer
"""
k = int(input())
fee = 25 + k * 0.01
fee = 2000 if fee > 2000 else fee
fee = 100 if fee < 100 else fee
print(fee) | 3.421875 | 3 |
propertiesND.py | Kruti235/109- | 0 | 12797125 | import random
import plotly.express as px
import plotly.figure_factory as ff
import statistics
dice_result = []
for i in range(0,1000):
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
dice_result.append(dice1+dice2)
mean = sum(dice_result)/len(dice_result)
print("mean of this da... | 3.28125 | 3 |
siiptool/scripts/subregion_sign.py | intel/iotg_fbu | 0 | 12797126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
#
"""A signing utility for creating and signing a BIOS sub-region for UEFI
"""
from __future__ import print_function
import os
import sys
import subprocess
import arg... | 2.15625 | 2 |
vvcatalog/templatetags/vvcatalog_tags.py | synw/django-vvcatalog | 3 | 12797127 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from vvcatalog.conf import CURRENCY, PAGINATION
register = template.Library()
@register.simple_tag
def get_currency():
return CURRENCY
@register.simple_tag
def get_pagination():
return PAGINATION
| 1.398438 | 1 |
swagger_server/models/data_utility.py | DITAS-Project/data-utility-evaluator | 0 | 12797128 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class DataUtility(Model):
"""NOTE: This class is auto generated by the swagger... | 2.4375 | 2 |
py_tools/random.py | HAL-42/AlchemyCat | 8 | 12797129 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@contact: <EMAIL>
@software: PyCharm
@file: random.py
@time: 2020/1/15 2:29
@desc:
"""
import numpy as np
import torch
import random
from typing import Union
__all__ = ['set_numpy_rand_seed', 'set_py_rand_seed', 'set_torch_rand_seed', 'set_rand_seed',
... | 2.71875 | 3 |
downloader.py | rocke97/SeedboxDownloader | 1 | 12797130 | import os
import threading
import logging
from ftplib import FTP_TLS
import socket
import time
def setInterval(interval, times = -1):
# This will be the actual decorator,
# with fixed interval and times parameter
def outer_wrap(function):
# This will be the function to be
# called
... | 2.890625 | 3 |
src/etl/ingest.py | jackshukla7/code-20220116-sanjeetshukla | 0 | 12797131 | <gh_stars>0
"""
# ingest.py for project bmi_calculator
# Created by @<NAME> at 9:06 AM 1/16/2022 using PyCharm
"""
import logging.config
from pyspark.sql.types import StructType, StringType, StructField, IntegerType
from src.utils import column_constants
class Ingest:
logging.config.fileConfig("config/logging.co... | 3.015625 | 3 |
testproject/testapp/tests/test_handlers_data_control.py | movermeyer/django-firestone | 1 | 12797132 | <reponame>movermeyer/django-firestone<filename>testproject/testapp/tests/test_handlers_data_control.py
"""
This module tests the ``get_data``, ``get_data_item``, ``get_data_set`` and
``get_working_set`` handler methods.
"""
from firestone.handlers import BaseHandler
from firestone.handlers import ModelHandler
from fir... | 2.421875 | 2 |
src/utils/tiff_to_geojson.py | dataforgoodfr/batch9_geowatchlabs-3-markets | 1 | 12797133 | <filename>src/utils/tiff_to_geojson.py
import os
import rasterio
from rasterio.features import shapes
import geopandas as gpd
def convert_tiff_to_geojson(original_tiff_path, destination_geojson_path, band):
"""
Convert tiff file to geojson for GeoDataFrame handling.
Args:
original_tiff_path (... | 3.15625 | 3 |
examples/cp/visu/house_building_optional.py | raineydavid/docplex-examples | 2 | 12797134 | <gh_stars>1-10
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
Thi... | 2.46875 | 2 |
Numero_Par.py | caibacord6/Programming-2020B | 0 | 12797135 | <reponame>caibacord6/Programming-2020B
'''
Script que identifica si un numero ingresado por el usuario es PAR.
'''
N = 0
print ("Ingrese un numero Entero: ")
num = int(input())
if num % 2 == 0 :
print ("El Numero es Par: ")
else:
print ("El Numero es Impar: ")
| 3.90625 | 4 |
parentheses/0921_minimum_add_to_make_valid.py | MartinMa28/Algorithms_review | 0 | 12797136 | <reponame>MartinMa28/Algorithms_review
class Solution:
def minAddToMakeValid(self, S: str) -> int:
stack = []
violations = 0
if S == '':
return 0
for idx, ch in enumerate(S):
if ch == '(':
stack.append(idx)
elif ch... | 3.296875 | 3 |
tinyfilemanager/constants.py | pentatester/tinyfilemanager | 0 | 12797137 | from .version import __version__
CONFIG_URL = "https://tinyfilemanager.github.io/config.json"
USER_AGENT = f"pypi/tinyfilemanager/{__version__}"
| 1.242188 | 1 |
tests/test_nodes_types.py | WaylonWalker/find-kedro | 17 | 12797138 | """
This module tests the creation of pipeline nodes from various different types
and combinations of types.
"""
import textwrap
import pytest
from find_kedro import find_kedro
contents = [
(
"single_nodes",
2,
"""\
from kedro.pipeline import node
node_a_b = node(lambda x: x, "a"... | 2.546875 | 3 |
bricks/tests/api/test_configfile.py | CloudBrewery/bricks-service | 0 | 12797139 | """
Tests for the API /configfiles/ methods.
"""
import datetime
import mock
from oslo.config import cfg
from bricks.common import utils
from bricks.openstack.common import timeutils
from bricks.tests.api import base
from bricks.tests.api import utils as apiutils
from bricks.tests.db import utils as dbutils
class ... | 2.328125 | 2 |
vindauga/utilities/hexdump.py | gabbpuy/vindauga | 5 | 12797140 | # -*- coding: utf8 -*-
import itertools
def formatLine(r):
r = list(r)
l1 = ' '.join('{:02x}'.format(c) for c in r)
l2 = ''.join(chr(c) if 32 <= c < 127 else '.' for c in r)
return l1, l2
def hexDump(data):
size, over = divmod(len(data), 16)
if over:
size += 1
offsets = range(0,... | 3.25 | 3 |
contentWidget.py | yujiecong/PyQt-Zhku-Client | 0 | 12797141 | <reponame>yujiecong/PyQt-Zhku-Client<filename>contentWidget.py
# Copyright (c) 2020. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
# Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
# Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
# Proin dapib... | 1.78125 | 2 |
models/notes/views.py | choeminjun/src_server_1.2 | 0 | 12797142 | <filename>models/notes/views.py<gh_stars>0
from flask import Blueprint, request, session, url_for, render_template
from werkzeug.utils import redirect
from src.models.notes.note import Note
import src.models.users.decorators as user_decorators
from src.models.users.user import User
from src.models.error_logs.error_log ... | 2.203125 | 2 |
caos/_internal/utils/dependencies.py | caotic-co/caos | 0 | 12797143 | from caos._internal.constants import ValidDependencyVersionRegex
from caos._internal.exceptions import InvalidDependencyVersionFormat, UnexpectedError
from typing import NewType
PipReadyDependency = NewType(name="PipReadyDependency", tp=str)
def _is_dependency_name_in_wheel(dependency_name: str, wheel: str, version:... | 2.1875 | 2 |
game/views.py | lizheng3401/MetaStudio | 0 | 12797144 | import os
from django.shortcuts import render,get_object_or_404, redirect
from django.http import FileResponse
from .models import GameCategory, Game
from comment.forms import GameCommentForm,SubGCommentForm
from comment.models import SubGComment
from .forms import UploadGameForm
BASE_DIR = os.path.dirname(os.path.d... | 2.15625 | 2 |
testing_tools/dummy_numa_ctl.py | TobiasWinchen/mpikat | 0 | 12797145 | #!/usr/bin/env python
#
# Dummy script to replace numactl in testing environment
#
import argparse
import subprocess
print("Using dummy numactl")
parser = argparse.ArgumentParser()
parser.add_argument("cmd", nargs="*")
args, unknown = parser.parse_known_args()
p = subprocess.Popen(args.cmd)
p.wait()
| 2.09375 | 2 |
src/labeling_doccano/doccano_functions.py | rasleh/StanceVeracityDetector | 0 | 12797146 | import json
import os
from pathlib import Path
current_path = os.path.abspath(__file__)
default_raw_path = os.path.join(current_path, '../../data/datasets/twitter/raw/')
unlabeled_data_path = Path(os.path.join(os.path.abspath(__file__), '../../../data/datasets/twitter/raw/unlabeled'))
def generate_label_data(file_na... | 2.734375 | 3 |
nlvm.py | joselynzhao/One-shot-Person-Re-ID-with-Variance-Subsampling-Method | 3 | 12797147 | <reponame>joselynzhao/One-shot-Person-Re-ID-with-Variance-Subsampling-Method
from __future__ import print_function, absolute_import
from reid.snatch import *
from reid import datasets
from reid import models
import numpy as np
import torch
import argparse
import os
from reid.utils.logging import Logger
import os.path ... | 2.15625 | 2 |
draft/serial/serial_threaded.py | industrial-robotics-lab/omni-platform-python | 0 | 12797148 | <filename>draft/serial/serial_threaded.py
#!/usr/bin/env python3
import serial
import time
import threading
if __name__ == '__main__':
port = serial.Serial('/dev/ttyACM0', 115200)
port.flush()
start = time.time()
def process_message(msg):
print(msg)
# print(f"Time passed: {time.time(... | 3 | 3 |
tetris/tetris.py | thejevans/tetris | 0 | 12797149 | <filename>tetris/tetris.py<gh_stars>0
__author__ = '<NAME>'
__copyright__ = 'Copyright 2020 <NAME>'
__credits__ = ['<NAME>']
__license__ = 'Apache License 2.0'
__version__ = '0.0.1'
__maintainer__ = '<NAME>'
__email__ = '<EMAIL>'
__status__ = 'Development'
"""
Docstring
"""
from typing import Dict, List, Union, Optio... | 2.625 | 3 |
site/blog/views.py | marcus-crane/site | 2 | 12797150 | import datetime
from django.contrib.syndication.views import Feed
from django.utils import timezone
from django.urls import reverse
from django.views import generic
from .models import Post
class PostDetailView(generic.DetailView):
model = Post
queryset = Post.objects.exclude(status='D')
template_name = '... | 2.375 | 2 |