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 |
|---|---|---|---|---|---|---|
src/anyconfig/ioinfo/constants.py | ssato/python-anyconfig | 213 | 12795551 | #
# Copyright (C) 2018 - 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: MIT
#
r"""ioinfo.constants to provide global constant variables.
"""
import os.path
GLOB_MARKER: str = '*'
PATH_SEP: str = os.path.sep
# vim:sw=4:ts=4:et:
| 1.5 | 2 |
run.py | zhfeing/graduation-project | 0 | 12795552 | import argparse
import os
import draw_his
import train
import test
from get_data import import_data
from model_zoo import googLeNet, resnet, load_model
import utils
import ensembel_model
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f',... | 2.234375 | 2 |
audio_atari/gaze/human_utils.py | sahiljain11/ICML2019-TREX | 0 | 12795553 | <filename>audio_atari/gaze/human_utils.py
import numpy as np
import cv2
import csv
import os
import torch
from os import path, listdir
import gaze.gaze_heatmap as gh
import time
# TODO: add masking part for extra games
from baselines.common.trex_utils import normalize_state
import torch.nn.functional as F
import torch... | 2.234375 | 2 |
convert_smdb.py | AnonymousRandomPerson/TranscriptionUtils | 0 | 12795554 | <reponame>AnonymousRandomPerson/TranscriptionUtils
import os
import binascii
base_path = os.path.join(os.sep, 'Users', 'chenghanngan', 'Documents', 'Programs', 'Reverse Engineering', 'Support', 'Adventure Squad WAD', 'Pokemon Fushigi no Dungeon - Ikuzo! Arashi no Boukendan (Japan) (WiiWare)', '00000002_app_OUT', 'cont... | 2.0625 | 2 |
pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/fileutils.py | wilbeacham85/genielibs | 0 | 12795555 | <reponame>wilbeacham85/genielibs<filename>pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/fileutils.py
""" File utils common base class """
# Logging
import logging
try:
from pyats.utils.fileutils import FileUtils as server
# Server FileUtils core implementation
# filemode_to_mode
... | 1.898438 | 2 |
accounts/urls.py | huseyinyilmaz/worklogger | 1 | 12795556 | <filename>accounts/urls.py
from django.conf.urls import patterns, url, include
from django.contrib import admin
from accounts import views
admin.autodiscover()
urlpatterns = patterns(
'',
# Examples:
# url(r'^$', 'worklogger.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'l... | 1.960938 | 2 |
example/quality_to_dbm_short_example.py | joshschmelzle/monitornetsh | 1 | 12795557 | <filename>example/quality_to_dbm_short_example.py<gh_stars>1-10
"""
retrieves signal quality from netsh.exe and converts it to rssi
"""
import subprocess
COMMAND = ['netsh', 'wlan', 'show', 'interface']
OUT = subprocess.check_output(COMMAND)
for line in OUT.decode("utf-8").lower().splitlines():
paramater = line.spl... | 2.953125 | 3 |
com/shbak/effective_python/_99_etc/_03_locals_globals/main.py | sanghyunbak/effective_python | 0 | 12795558 | <reponame>sanghyunbak/effective_python<gh_stars>0
import timeit
from termcolor import colored
G_VAR = 1
G_VAR2 = 2
def global_test():
return 1
def benchmark_globals():
def sum_test():
return G_VAR + 3
result = timeit.timeit(
setup='G_VAR2',
stmt='global_test()',
globals=... | 2.8125 | 3 |
tests/app/celery/test_research_mode_tasks.py | cds-snc/notifier-api | 41 | 12795559 | <gh_stars>10-100
import uuid
from datetime import datetime
from unittest.mock import ANY, call
import pytest
import requests_mock
from flask import current_app, json
from freezegun import freeze_time
from app.aws.mocks import (
ses_notification_callback,
sns_failed_callback,
sns_success_callback,
)
from a... | 2.03125 | 2 |
apt.py | henworth/dotbot-apt | 0 | 12795560 | from subprocess import CalledProcessError, check_call, DEVNULL
from typing import Any, List, Sequence
import dotbot
class Apt(dotbot.Plugin):
def can_handle(self, directive: str) -> bool:
return directive == "apt"
def handle(self, directive: str, packages: List[str]) -> bool:
success = self.... | 2.234375 | 2 |
CombinationSumII40.py | Bit64L/LeetCode-Python- | 0 | 12795561 | <filename>CombinationSumII40.py<gh_stars>0
# encoding=utf8
class Solution:
def combinationSum2(self, candidates, target):
"""
:type candidates: List[int]
:type target: int
:rtype: List[List[int]]
"""
candidates.sort()
self.ans = []
def help(work, ca... | 3.515625 | 4 |
dvgutils/pipeline/observable.py | jagin/dvg-utils | 7 | 12795562 | <gh_stars>1-10
from ..helpers import Observable
observable = Observable()
| 1.15625 | 1 |
Python3/Exercises/UnluckyNumbers/unlucky_numbers.py | norbertosanchezdichi/TIL | 0 | 12795563 | for number in range(1, 21):
if number == 4 or number == 13:
state = 'UNLUCKY'
elif number % 2 == 0:
state = 'EVEN'
else:
state = 'ODD'
print(f'{number} is {state}!') | 3.828125 | 4 |
xcube_hub/models/cubegen_config_cube_config.py | bcdev/xcube-hub | 3 | 12795564 | <gh_stars>1-10
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from xcube_hub.models.base_model_ import Model
from xcube_hub import util
class CubegenConfigCubeConfig(Model):
"""NOTE: This class is auto generat... | 2.21875 | 2 |
generalCredentials.py | darren-ccab/Telegram-AI-chatbot-for-university-courses | 0 | 12795565 | <filename>generalCredentials.py
# General Chatbot Token
telegramToken = ""
# Announcement Channel ID
announcementID = ''
# Dialogflow Project ID
projectID = "newagent-XXXXXX"
| 1.171875 | 1 |
soc_test/interpolation_test.py | DeltaLabo/battery_characterizer | 0 | 12795566 | import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2*np.pi, 10)
y = np.sin(x) #Función original
xvals = np.linspace(0, 2*np.pi, 50)
yinterp = np.interp(xvals, x, y)
plt.plot(x, y, 'o')
plt.plot(xvals, yinterp, '-x')
plt.show() | 3.40625 | 3 |
apps/submission/urls.py | renatooliveira/pugpe | 11 | 12795567 | from django.conf.urls import patterns, include, url
from django.views.generic.simple import direct_to_template
from .views import SubmissionView, SubmissionListView, SubmissionSuccess
urlpatterns = patterns('',
url(r'^$',
SubmissionView.as_view(),
name='submission',
),
url(r'^success/$',
... | 1.90625 | 2 |
tests/test_area.py | irahorecka/python-craigslist-meta | 1 | 12795568 | import pytest
from fixtures import get_title, get_url
from craigslist_meta import Site
selector = "area"
# use a site key with areas
site_key = "sfbay"
@pytest.fixture
def area():
"""Get an instance of Area."""
area = next(iter(Site(site_key)))
global area_key
area_key = area.key
yield area
def... | 2.484375 | 2 |
scripts_python/suma.py | joanayala/Frameworks_8A | 0 | 12795569 | <gh_stars>0
a = 5
b = 10
suma = a + b
print("The addition is: ", suma)
| 3.03125 | 3 |
deploy/slice.py | lebedevdes/insightface | 0 | 12795570 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import argparse
import numpy as np
import mxnet as mx
ctx = mx.cpu(0)
image_size = (112, 112)
prefix = "../models/resnet-50"
epoch = 0
sym, arg_params, aux_params = mx.model.load_checkpoi... | 2.234375 | 2 |
tests/torch/nn/parallel/expert_parallel/wrapper_test/init_test/gpt2.py | lipovsek/oslo | 0 | 12795571 | <reponame>lipovsek/oslo<filename>tests/torch/nn/parallel/expert_parallel/wrapper_test/init_test/gpt2.py
import random
from functools import partial
import os
import numpy as np
import torch
import torch.multiprocessing as mp
from transformers import AutoTokenizer, GPT2Config, GPT2LMHeadModel
from oslo.torch.nn.para... | 2.34375 | 2 |
tests/test_factory_container.py | ClanPlay/Python_IoC | 4 | 12795572 | from flying_ioc import IocManager, IocFactory
class TSingleton1:
def __init__(self):
pass
class TSingleton2:
def __init__(self):
pass
class TSingleton3(TSingleton1):
def __init__(self, ts: TSingleton2):
super().__init__()
self.ts = ts
class TSingleton3dot2(TSingleton3... | 2.421875 | 2 |
AlgoExpert/binary_search_trees/sameBsts.py | Muzque/Leetcode | 1 | 12795573 | """
Same BSTs
Write a function that takes in two arrays of integers and determines whether these arrays represent the same BST.
Note that you're not allowed to construct any BSTs in your code.
Sample:
10
-----------
8 15
----- -------
5 12 94
--- _____ _____
2... | 3.859375 | 4 |
movies/templatetags/custom_filters.py | gorkemarslan/Django-Movie-Database | 2 | 12795574 | <filename>movies/templatetags/custom_filters.py
from django import template
from django.core.exceptions import ObjectDoesNotExist
register = template.Library()
@register.filter(name='user_star')
def user_star(user_rating, movie):
"""
Template tag which allows queryset filtering to get user ratings.
It ge... | 2.515625 | 3 |
tests/__init__.py | zzw0929/my-flask | 0 | 12795575 | __author__ = 'zhuzw'
| 0.996094 | 1 |
blockchain.py | jcorbino/blockchain | 1 | 12795576 | from time import time
from hashlib import md5
from datetime import datetime
## Hashing functions:
# Slower, 64 bytes
#sha256 = sha256('content').hexdigest()
# Faster, 32 bytes
#md5 = md5('content').hexdigest()
class Block:
timestamp = ''
prev_hash = ''
content = ''
nonce = 0
hash = ''
def _... | 2.828125 | 3 |
mid_exam_preparation/counter_strike.py | PetkoAndreev/Python-fundamentals | 0 | 12795577 | energy = int(input())
distance = input()
won_battles = 0
while distance != 'End of battle':
distance = int(distance)
if energy >= distance:
energy -= distance
won_battles += 1
if won_battles % 3 == 0:
energy += won_battles
else:
print(f'Not enough energy! Game en... | 4.03125 | 4 |
src/onapsdk/msb/k8s/__init__.py | krasm/python-onapsdk | 4 | 12795578 | """K8s package."""
from .definition import Definition, Profile, ConfigurationTemplate
from .connectivity_info import ConnectivityInfo
from .instance import InstantiationParameter, InstantiationRequest, Instance
| 1.0625 | 1 |
tests/test_factory.py | knowark/injectark | 0 | 12795579 | from injectark import Factory
def test_factory_extract() -> None:
class MockFactory(Factory):
def __init__(self, config):
super().__init__(config)
pass
def _my_method(self):
pass
factory = MockFactory({'key': 'value'})
method = factory.extract('_my_met... | 2.515625 | 3 |
src/distance.py | haminhle192/face_recognition | 0 | 12795580 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class Distance:
def __init__(self):
self.graph = tf.Graph()
self.sess = tf.Session(graph=self.graph)
with self.graph.as_default():
self.b_tf = t... | 2.65625 | 3 |
tests/test_api.py | usc-isi-i2/WEDC | 0 | 12795581 | import sys
import time
import os
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
# text_ = os.path.expanduser(os.path.join(TEST_DATA_DIR, 'text'))
from wedc.application.api import WEDC
class TestPostVectorMethods(unittest... | 2.234375 | 2 |
rldb/db/paper__dqn2013/algo__contingency/__init__.py | seungjaeryanlee/sotarl | 45 | 12795582 | <reponame>seungjaeryanlee/sotarl
"""
Contingency scores from DQN2013 paper.
7 entries
------------------------------------------------------------------------
7 unique entries
"""
from .entries import entries
# Specify ALGORITHM
algo = {
# ALGORITHM
"algo-title": "Contingency",
"algo-nickname": "Conti... | 2.5 | 2 |
unittests/linux/test_networkd.py | stepanandr/taf | 10 | 12795583 | #!/usr/bin/env python
# Copyright (c) 2015 - 2017, Intel Corporation.
#
# 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 ... | 2.21875 | 2 |
consoleme/lib/v2/notifications.py | shyovn/consoleme | 2,835 | 12795584 | <gh_stars>1000+
import json as original_json
import sys
import time
from collections import defaultdict
from typing import Dict
import sentry_sdk
import ujson as json
from asgiref.sync import sync_to_async
from consoleme.config import config
from consoleme.lib.cache import (
retrieve_json_data_from_redis_or_s3,
... | 1.90625 | 2 |
vintools/_tools/_deepTools/_deepTools_Module.py | mvinyard/vintools | 2 | 12795585 | <filename>vintools/_tools/_deepTools/_deepTools_Module.py
# package imports #
# --------------- #
import os
# local imports #
# ------------- #
from ..._utilities._system_utils._use_n_cores import _use_n_cores
from ..._utilities._system_utils._flexible_mkdir import _flexible_mkdir
from ._deepTools_supporting_functions... | 2.046875 | 2 |
appmock/appmock_client.py | kzemek/helpers | 0 | 12795586 | <reponame>kzemek/helpers<filename>appmock/appmock_client.py
# coding=utf-8
"""
Authors: <NAME>
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Client library to contact appmock instances.
"""
import base64
import json
import time
import requests
# Appmock r... | 2.203125 | 2 |
test/DATA_FLOW/Descriptor/utils_test.py | globalSolutionsContinex/data_flow_driver | 0 | 12795587 | <filename>test/DATA_FLOW/Descriptor/utils_test.py
import DataFlow.Descriptor.utils as utils
record = {
"nombre": "<NAME>",
"identidad": "30664743",
"dv": "4"
}
s = lambda record: utils.return_format(record['nombre'] if utils.is_company(record['identidad'], record['dv']) else utils.get_name(record['nombre']... | 2.765625 | 3 |
public/neumeeditor/views/__init__.py | jacobsanz97/cantus | 12 | 12795588 | <filename>public/neumeeditor/views/__init__.py
__author__ = 'afogarty'
| 1.109375 | 1 |
exercises/parsing.py | PetrWolf/pydata_nyc_2019 | 2 | 12795589 | <gh_stars>1-10
# Utilities for data cleaning
import os
def parse_location(location):
"""Extracts latitude and longitude from a location string.
Args:
location: Decimal Degrees (D.D) representation of a geographical location,
e.g. "34.56 N 123.45 W"
Returns:
latitude, long... | 3.5 | 4 |
tool_sdk/api/basic/batch_get_tool_detail_pb2.py | easyopsapis/easyops-api-python | 5 | 12795590 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: batch_get_tool_detail.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from googl... | 1.265625 | 1 |
Python/boundary-of-binary-tree.py | RideGreg/LeetCode | 1 | 12795591 | # Time: O(n)
# Space: O(h)
# 545
# Given a binary tree, return the values of its boundary in anti-clockwise direction
# starting from root. Boundary includes left boundary, leaves, and right boundary
# in order without duplicate nodes.
#
# Left boundary is defined as the path from root to the left-most node. Right bo... | 4.21875 | 4 |
codechallenges/serializers.py | alimustafashah/core | 0 | 12795592 | from rest_framework import serializers
from codechallenges.models import Question, Submission
class QuestionSerializer(serializers.ModelSerializer):
class Meta:
model = Question
fields = (
"title",
"body",
"format",
"answer",
"release_dat... | 2.515625 | 3 |
tests/utils/requires.py | RealA10N/cptk | 5 | 12795593 | <gh_stars>1-10
from __future__ import annotations
from shutil import which
import pytest
def requires(name: str):
""" A decorator for pytest tests that skips the test if a program with the
given name is not found of the machine. """
def decorator(f):
dec = pytest.mark.skipif(
which(... | 2.65625 | 3 |
python/opscore/RO/Astro/Sph/AngSideAng.py | sdss/opscore | 0 | 12795594 | #!/usr/bin/env python
__all__ = ["angSideAng"]
import opscore.RO.MathUtil
import opscore.RO.SysConst
def angSideAng(side_aa, ang_B, side_cc):
"""
Solves a spherical triangle for two angles and the side connecting them,
given the remaining quantities.
Inputs:
- side_aa side aa; range of sides... | 3.71875 | 4 |
src/subtitle_translator/main.py | BercziSandor/subtitle_translator | 0 | 12795595 | """
TODO
"""
import io
import logging
import re
import string
import sys
import textwrap
import time
from datetime import timedelta
from pathlib import Path
from typing import List
import sublib
from deep_translator import GoogleTranslator
# https://pypi.org/project/sublib/
# https://pypi.org/project/deep-translator
... | 3.125 | 3 |
main.py | jnsougata/Ezcord | 0 | 12795596 | import os
from src.ezcord import *
APP = 874663148374880287
TEST = 877399405056102431
bot = Bot(prefix='-', app_id=APP, guild_id=TEST, intents=Intents.members)
@bot.command(name='ping')
async def ping(ctx: Context):
emd = Embed(description=f'**Pong: {bot.latency}ms**')
await ctx.reply(embed=emd)
@bot.co... | 2.09375 | 2 |
tests/test_create_json_schema.py | kaiba-tech/kaiba | 5 | 12795597 | from kaiba.models.kaiba_object import KaibaObject
def test_create_jsonschema_from_model():
"""Test that we can create jsonschema."""
assert KaibaObject.schema_json(indent=2)
| 2.25 | 2 |
src/tests/pyetheroll/test_etherscan_utils.py | homdx/EtherollApp | 0 | 12795598 | <reponame>homdx/EtherollApp<gh_stars>0
import unittest
from unittest import mock
from pyetheroll.etherscan_utils import get_etherscan_api_key
class TestEtherscanlUtils(unittest.TestCase):
def test_get_etherscan_api_key(self):
"""
Verifies the key can be retrieved from either:
1) environm... | 2.515625 | 3 |
src/a06pliki/pknorlen.py | tborzyszkowski/PSPI_Wstep_do_programowania | 0 | 12795599 | import csv
import statistics
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d
import numpy as np
with open('pknorlen_akcje.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
next(readCSV)
counter = 0
kursy_lista = []
for row in readCSV:
kursy_lista.app... | 2.921875 | 3 |
projects/iosDataGeneration/udemy/test.py | eu-snehagupta/learningpython | 0 | 12795600 | import os
import csv
from csv import reader
def read_data():
data = []
with open ("data.csv", "r") as f:
csv_reader = reader(f)
header = next(csv_reader)
if header != None:
for rows in csv_reader:
data.append(rows[0].replace(";",","))
print(data)
... | 3.421875 | 3 |
Products_infos_Functions.py | AndreVinni89/MercadoLivre_WebScraping | 0 | 12795601 | from bs4 import BeautifulSoup as bs
import re
import mysql.connector
class Products_Infos():
def __init__(self, products):
self.products = products
self.productInfos = []
def insertSpaces(self):
for i in self.products:
self.productInfos.append([])
def get_product_lin... | 2.75 | 3 |
certbot_dns_directadmin/__init__.py | cybercinch/certbot-dns-directadmin | 8 | 12795602 | <reponame>cybercinch/certbot-dns-directadmin
"""
The `~certbot-dns-directadmin:directadmin` plugin automates the process of
completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and
subsequently removing, TXT records using the DirectAdmin API.
Named Arguments
---------------
=====================... | 2.015625 | 2 |
fate/test/test_insertoperations.py | Mattias1/fate | 0 | 12795603 | """
This module provides testcases for insertoperations.
Auto indentation is covered.
"""
from ..commands import selectnextline, selectpreviousword
from ..insertoperations import ChangeAfter, ChangeBefore, ChangeInPlace, ChangeAround
from ..undotree import undo
from .basetestcase import BaseTestCase
from .. import docu... | 2.59375 | 3 |
backfill/urls.py | appasahebs/bzTakeHome | 0 | 12795604 | <reponame>appasahebs/bzTakeHome
from django.urls import path
from .views import BackfillView
urlpatterns = [
path('', BackfillView.as_view(), name='list')
]
| 1.648438 | 2 |
module3-nosql-and-document-oriented-databases/Cluster.py | John-G-Thomas/DS-Unit-3-Sprint-2-SQL-and-Databases | 0 | 12795605 | # If colab not locally Find out the IP address of this Colab Instance
# !curl ipecho.net/plain
"""
"How was working with MongoDB different from working with PostgreSQL? What was easier, and what was harder?":
-MongoDB and PostgrSQL biggest difference is hpw the data/information is stored.
-In PostgreSQL there are schem... | 2.90625 | 3 |
ex09/age_de_mon_chien.py | Nath39/Checkpoint00 | 0 | 12795606 | age = int(input ("Combien d'année à votre chien ?\n"))
ageVrai = age*7
print (f"Votre chien a {ageVrai} ans.")
| 3.78125 | 4 |
general/views.py | MarcinSzyc/KRA_PYT_W_02_WARSZTATY_3 | 0 | 12795607 | from django.shortcuts import render, redirect
from django.views import View
from .forms import UserLogin, UserRegistration
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.views import PasswordResetView
from django.core.exceptions import Improperly... | 2.109375 | 2 |
crossmodal/door_models/dynamics.py | brentyi/multimodalfilter | 21 | 12795608 | <gh_stars>10-100
import torch
import torch.nn as nn
import torchfilter
import torchfilter.types as types
from fannypack.nn import resblocks
from . import layers
# TODO: Merge this with DoorDynamicsModelBrent
class DoorDynamicsModel(torchfilter.base.DynamicsModel):
def __init__(self, units=64):
"""Initial... | 2.328125 | 2 |
util/__init__.py | atlas-calo-ml/GraphNets4Pions_LLNL | 1 | 12795609 | <gh_stars>1-10
# i am an import | 1.078125 | 1 |
goldman/queryparams/include.py | sassoo/goldman | 2 | 12795610 | <gh_stars>1-10
"""
queryparams.include
~~~~~~~~~~~~~~~~~~~
Determine relationship resources to include in the response
according to one or more criteria. Documented here:
jsonapi.org/format/#fetching-includes
"""
from goldman.exceptions import InvalidQueryParams
LINK = 'jsonapi.org/format/#... | 2.453125 | 2 |
python/paddle/fluid/tests/unittests/test_fused_gemm_epilogue_op.py | L-Net-1992/Paddle | 11 | 12795611 | <filename>python/paddle/fluid/tests/unittests/test_fused_gemm_epilogue_op.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | 2.046875 | 2 |
School146/forms/article_form.py | mihdenis85/Synergy | 0 | 12795612 | import re
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import DataRequired, regexp
class ArticleForm(FlaskForm):
title = StringField('Название статьи', validators=[DataRequired()... | 2.53125 | 3 |
cc/stream.py | markokr/cc | 3 | 12795613 | """Wrapper around ZMQStream
"""
import sys
import time
import zmq
from zmq.eventloop import IOLoop
from zmq.eventloop.zmqstream import ZMQStream
import skytools
from cc.message import CCMessage, zmsg_size
from cc.util import stat_inc
__all__ = ['CCStream', 'CCReqStream']
#
# simple wrapper around ZMQStream
#
cla... | 2.25 | 2 |
gen-input.py | SirGFM/FallingBlocks | 1 | 12795614 | import pathlib
import os.path
cwd = pathlib.Path(__file__).parent.absolute()
cwd = os.path.abspath(cwd)
fp = os.path.join(cwd, 'ProjectSettings', 'InputManager.asset')
def output_unity_axis(f, joy_idx, name, button='', axis_type=0, joy_axis=0):
f.write(' - serializedVersion: 3\n')
f.write(' m_Name: joyst... | 2.328125 | 2 |
lego/apps/tags/validators.py | HoboKristian/lego | 0 | 12795615 | <filename>lego/apps/tags/validators.py
from django.core.validators import RegexValidator, _lazy_re_compile
slug_re = _lazy_re_compile(r"^[-a-z0-9æøå_.#%$&/]+\Z")
validate_tag = RegexValidator(
slug_re,
"Enter a valid 'tag' consisting of letters, numbers, underscores or hyphens.",
"invalid",
)
| 2.65625 | 3 |
saber/xbrain/split_cells.py | elenimath/saber | 12 | 12795616 | # Copyright 2019 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 2.40625 | 2 |
train.py | nsouff/digits_guesser | 0 | 12795617 | <gh_stars>0
import tensorflow as tf
import os
import numpy as np
import matplotlib.pyplot as plt
class Model():
def __init__(self, filepath='model.h5'):
self.filepath = filepath
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = ... | 2.578125 | 3 |
cours/python/franceioi/concours-de-tir-a-la-corde.py | jusdepatate/pieces-of-code | 1 | 12795618 | <gh_stars>1-10
nbMembres = int(input())
poidsE1 = 0
poidsE2 = 0
for i in range(1, (nbMembres * 2) + 1):
if i % 2:
poidsE1 = poidsE1 + int(input())
else:
poidsE2 = poidsE2 + int(input())
if poidsE1 > poidsE2:
print("L'équipe 1 a un avantage")
else:
print("L'équipe 2 a un avantage")
pri... | 3.40625 | 3 |
Problemset/binary-tree-paths/binary-tree-paths.py | worldwonderer/algorithm | 1 | 12795619 | <filename>Problemset/binary-tree-paths/binary-tree-paths.py<gh_stars>1-10
# @Title: 二叉树的所有路径 (Binary Tree Paths)
# @Author: 18015528893
# @Date: 2021-02-14 17:30:19
# @Runtime: 32 ms
# @Memory: 15 MB
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# ... | 3.359375 | 3 |
unit_tests.py | leguiart/Evolutionary_Computing | 1 | 12795620 | <reponame>leguiart/Evolutionary_Computing
from test_genetic_algorithm import TestGeneticAlgorithm
from hklearn_genetic.problem import Rastrigin, Beale, Himmelblau, Eggholder
import numpy as np
### Proportional selection, no elitism
ga = TestGeneticAlgorithm([[0.25410149, 0.71410111, 0.31915886, 0.45725239]], pc = 0.9,... | 2.71875 | 3 |
src/util/flu_data_source.py | dfarrow0/nowcast | 3 | 12795621 | <filename>src/util/flu_data_source.py
"""
===============
=== Purpose ===
===============
A wrapper for the Epidata API as used for nowcasting. Caching is used
extensively to reduce the number of requests made to the API.
"""
# standard library
import functools
# first party
from delphi.epidata.client.delphi_epidat... | 2.1875 | 2 |
tests/unit/providers/traversal/test_selector_py3.py | YelloFam/python-dependency-injector | 0 | 12795622 | <gh_stars>0
"""Selector provider traversal tests."""
from dependency_injector import providers
def test_traverse():
switch = lambda: "provider1"
provider1 = providers.Callable(list)
provider2 = providers.Callable(dict)
provider = providers.Selector(
switch,
provider1=provider1,
... | 3.03125 | 3 |
2017/iker/day12.py | bbglab/adventofcode | 0 | 12795623 | <gh_stars>0
"""
--- Day 12: Digital Plumber ---
Walking along the memory banks of the stream, you find a small village that is experiencing a little confusion: some programs can't communicate with each other.
Programs in this village communicate using a fixed system of pipes. Messages are passed between programs usin... | 3.640625 | 4 |
messaging/serializers.py | jpaul121/Banter | 0 | 12795624 | <reponame>jpaul121/Banter
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Message
class MessageSerializer(serializers.ModelSerializer):
message_id = serializers.SlugField(source='id', read_only=True, required=False)
title = serializers.CharField(required=Fals... | 2.125 | 2 |
wishing_well/util.py | Ennea/wishing-well | 16 | 12795625 | <reponame>Ennea/wishing-well<filename>wishing_well/util.py
import logging
import os
import socket
import sys
import tkinter
import webbrowser
from pathlib import Path
from tkinter import ttk
from urllib.request import urlopen
from urllib.error import URLError, HTTPError
from .exceptions import LogNotFoundError
def g... | 2.625 | 3 |
Tools/Scripts/webkitpy/tool/steps/promptforbugortitle.py | jacadcaps/webkitty | 6 | 12795626 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 1.515625 | 2 |
MRC/utils_qa.py | alinghi/AI-Portfolio-Hub | 0 | 12795627 | <filename>MRC/utils_qa.py
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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/LICE... | 1.671875 | 2 |
Reservoirs/Task1bis_Non-Periodic-Delay/task1bis.py | grezesf/Research | 1 | 12795628 | import mdp
import Oger
import numpy
import pylab
import random
import math
### README
# the goal is to teach the reservoir to recreate the input signal with a certain delay
def main():
### Create/Load dataset
set_size=200
data_length=100
delay=25
[x, y] = gen_random_data(set_size, data_length, d... | 2.828125 | 3 |
configs/paths_config.py | Svoka/pixel2style2pixel | 0 | 12795629 | dataset_paths = {
'train_source': 'datasets/f2c/train_source',
'train_target': 'datasets/f2c/train_target',
'test_source': 'datasets/f2c/test_source',
'test_target': 'datasets/f2c/test_target',
}
model_paths = {
'stylegan_ffhq': 'pretrained_models/stylegan2-ffhq-config-f.pt',
'ir_se50': 'pretrained_mode... | 1.054688 | 1 |
31_histogram.py | Larilok/image_processing | 0 | 12795630 | from PIL import Image
from pylab import *
img = Image.open('images/profile.jpg').convert('L')
print(array(img)[500])
imgArray = array(img)
figure()
hist(imgArray.flatten(), 300)
show()
# img.show()
| 2.5 | 2 |
quantity/digger/engine/context/data_context.py | wyjcpu/quantity | 0 | 12795631 | # -*- coding: utf-8 -*-
##
# @file data_context.py
# @brief
# @author wondereamer
# @version 0.1
# @date 2016-11-27
import datetime
from quantity.digger.engine.series import SeriesBase, NumberSeries, DateTimeSeries
from quantity.digger.technicals.base import TechnicalBase
from quantity.digger.util import elogger as ... | 2.3125 | 2 |
examples/mnist_cnn.py | llv22/keras | 0 | 12795632 | <reponame>llv22/keras
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # se... | 2.390625 | 2 |
fix_network.py | gauthamv529/Neurohex | 0 | 12795633 | <reponame>gauthamv529/Neurohex
import cPickle
import argparse
from inputFormat import *
from network import network
from theano import tensor as T
parser = argparse.ArgumentParser()
parser.add_argument("source", type=str, help="Pickled network to steal params from.")
parser.add_argument("dest", type=str, help="File t... | 2.421875 | 2 |
day05.py | jamesconstable/aoc2021 | 0 | 12795634 | #! /usr/bin/env python
'''
Solvers and example test cases for Day 5 of the Advent of Code 2021.
Problem description: <https://adventofcode.com/2021/day/5>
'''
from collections import Counter
from dataclasses import dataclass
from typing import Iterable, List, Tuple
import unittest
def part1(lines: Iterable[str]) ->... | 3.921875 | 4 |
src/Utils/Python/Tests/test_IterativeDiagonalizer.py | qcscine/utilities | 0 | 12795635 | __copyright__ = """This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
"""
import pytest
import scine_utilities as scine
import numpy as np
import os
class SigmaVectorEvaluatorPython(scine.SigmaVectorEvaluator):
d... | 2.21875 | 2 |
dl_keras/resnet.py | jarvisqi/deep_learning | 32 | 12795636 | import os
from keras import layers
from keras.layers import Input, merge
from keras.layers.convolutional import (AveragePooling2D, Conv2D, MaxPooling2D,
ZeroPadding2D)
from keras.layers.core import Activation, Dense, Flatten
from keras.layers.normalization import BatchNormalizat... | 2.859375 | 3 |
tests/test_percentage_indicator.py | tahmidbintaslim/pyprind | 411 | 12795637 | """
<NAME> 2014-2016
Python Progress Indicator Utility
Author: <NAME> <<EMAIL>>
License: BSD 3 clause
Contributors: https://github.com/rasbt/pyprind/graphs/contributors
Code Repository: https://github.com/rasbt/pyprind
PyPI: https://pypi.python.org/pypi/PyPrind
"""
import sys
import time
import pyprind
n = 100
slee... | 2.609375 | 3 |
sock.py | danielgweb/Developer-Test | 0 | 12795638 | <gh_stars>0
#!/usr/bin/python
# coding: utf-8
# imports
import socket
import sys
import hashlib
import binascii
import collections
# classes
class SockClient(object):
"""SockClient for handling the connection to the server"""
def __init__(self):
# Creates a TCP/IP socket
try:
self... | 3.140625 | 3 |
subscriptions/models.py | Sukriva/open-city-profile | 5 | 12795639 | <reponame>Sukriva/open-city-profile<filename>subscriptions/models.py
from adminsortable.models import SortableMixin
from django.db import models
from django.db.models import Max
from parler.models import TranslatableModel, TranslatedFields
from utils.models import SerializableMixin
def get_next_subscription_type_cat... | 1.984375 | 2 |
04_CNN_advances/use_vgg_finetune.py | jastarex/DL_Notes | 203 | 12795640 |
# coding: utf-8
# # 使用预训练的VGG模型Fine-tune CNN
# In[1]:
# Import packs
import numpy as np
import os
import scipy.io
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
import skimage.io
import skimage.transform
import tensorflow as tf
get_ipython().magic(u'matplotlib inline')
cwd = os.getcwd()
pri... | 2.53125 | 3 |
setup.py | cameronmaske/s3env | 20 | 12795641 | from setuptools import setup
requires = [
'click==6.7',
'bucketstore==0.1.1'
]
setup(
name="s3env",
version="0.0.4",
author="<NAME>",
description="Manipulate a key/value JSON object file in an S3 bucket through the CLI",
author_email="<EMAIL>",
url='https://github.com/cameronmaske/s3e... | 1.554688 | 2 |
Lista04/ex007.py | Guilherme-Schwann/Listas-de-Exercicios-UFV-CCF-110 | 2 | 12795642 | <gh_stars>1-10
#Ex.11
hora = str(input('Insira o valor hora (HH:MM): ')).split(':')
min = int(hora[1])
min += int(hora[0]) * 60
print(f'Passaram-se {min} minutos desde as 00:00h.')
| 3.25 | 3 |
tests/unit/testplan/testing/multitest/test_result.py | armarti/testplan | 0 | 12795643 | """Unit tests for the testplan.testing.multitest.result module."""
import collections
import mock
import pytest
from testplan.testing.multitest import result as result_mod
from testplan.testing.multitest.suite import testcase, testsuite
from testplan.testing.multitest import MultiTest
from testplan.common.utils impor... | 2.53125 | 3 |
src/cli.py | martinlecs/ap_challenge | 0 | 12795644 | <gh_stars>0
import click
from datetime import datetime
from typing import List
import string
from src.Runner import RinexRunner
from src.Downloader import RinexDownloader
from src.Merger import RinexMerger
@click.command()
@click.argument('station', type=str)
@click.argument('start_date', type=click.DateTime(formats=... | 2.828125 | 3 |
ismir2020_featuresubsets.py | pvankranenburg/ismir2020 | 2 | 12795645 | <gh_stars>1-10
ismir2020featsets = {}
##########################################################################
ismir2020featsets['ismir2020_all_lyr_gt'] = {
'scaledegreefirst',
'scaledegreesecond',
'scaledegreethird',
'scaledegreefourth',
'scaledegreefifth',
'diatonicpitchfirst',
'diatonicpitchsecond',
'dia... | 0.84375 | 1 |
soa2rts.py | acasadoalonso/RealTimeScoring | 0 | 12795646 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
# This module gets that daya from SoaringSpot and prepaeres the infor for the REAL TIME SCORING
#
# Author: <NAME> - May 2021
#
#import sys
import json
import urllib.request
import urllib.error
import urllib.parse
import hmac
import hashlib
import base64
import os
import socke... | 2.625 | 3 |
RevitPyCVC/Fluides/fluide_creer.py | Nahouhak/pythoncvc.net | 6 | 12795647 | <filename>RevitPyCVC/Fluides/fluide_creer.py
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import *
from Autodesk.Revit.DB.Analysis import *
from Autodesk.Revit.DB.Plumbing import *
from Autodesk.Revit.Exceptions import *
from Autodesk.Revit.UI import TaskDialog
from Autodesk.Revit.UI import Task... | 2.09375 | 2 |
build_release.py | JDCalvert/foundryvtt-drag-ruler | 0 | 12795648 | #!/usr/bin/env python3
import json
from pathlib import PurePath, Path
import subprocess
import tempfile
import zipfile
wasm_pack = Path("~/.cargo/bin/wasm-pack").expanduser()
root_files = ["module.json", "README.md", "CHANGELOG.md", "LICENSE"]
wasm_files = ["gridless_pathfinding_bg.wasm", "gridless_pathfinding.js"]
... | 2.078125 | 2 |
Session1_2018/pathsum2.py | vedantc6/LCode | 1 | 12795649 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def dfs(self, root, cur_sum, lnodes, result):
if not root.left and not root.right and cur_sum == root.val:
lnodes.app... | 3.84375 | 4 |
files.py | VergilTheHuragok/SciFi_Text_Adventure_Python | 0 | 12795650 | <reponame>VergilTheHuragok/SciFi_Text_Adventure_Python
import base64
import jsonpickle
from cryptography.fernet import Fernet
key = b'\<KEY>'
key = base64.urlsafe_b64encode(key)
def decrypt(bytes_message):
"""Takes an encrypted bytes object and returns a decrypted one"""
cipher = Fernet(key)
return ci... | 3.5625 | 4 |