max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
tests/sns/test_sns_paginators.py | paulhutchings/beartype-boto3-example | 3 | 49800 | <gh_stars>1-10
import pytest
from bearboto3.sns import (
ListEndpointsByPlatformApplicationPaginator,
ListPlatformApplicationsPaginator,
ListSubscriptionsPaginator,
ListSubscriptionsByTopicPaginator,
ListTopicsPaginator,
ListPhoneNumbersOptedOutPaginator,
ListOriginationNumbersPaginator,
... | 2.015625 | 2 |
file_sync_tool/__main__.py | jackd248/file-sync-tool | 0 | 49801 | #!/usr/bin/env python3
# -*- coding: future_fstrings -*-
import argparse, sys, os
from collections import defaultdict
from db_sync_tool.utility import helper
# Workaround for ModuleNotFoundError
sys.path.append(os.getcwd())
from file_sync_tool import sync
def main(args={}):
"""
Main entry point for the comma... | 2.375 | 2 |
imp/game/checks.py | philskillz-coder/uno-discord-bot | 0 | 49802 | from imp.better import BetterInteraction
from discord import app_commands
from imp.better import errors
def IsHost(message: str = None):
message = message or "You must be a game host for this."
async def predicate(interaction: BetterInteraction):
fulfilled = interaction.client.game_manager.is_host(in... | 2.40625 | 2 |
src/backend/backend/users/migrations/0010_update_uuid_field.py | tejpratap545/E-Commerce-Application | 0 | 49803 | <reponame>tejpratap545/E-Commerce-Application
# Generated by Django 3.1.2 on 2020-10-21 15:40
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20201021_2108'),
]
operations = [
migrations.AlterField(
... | 1.773438 | 2 |
convokit/tests/run_all_tests.py | sophieball/Cornell-Conversational-Analysis-Toolkit | 0 | 49804 | from unittest import TestLoader, TextTestRunner
if __name__ == "__main__":
loader = TestLoader()
tests = loader.discover('.')
testRunner = TextTestRunner()
test_results = testRunner.run(tests)
if len(test_results.errors) > 0:
exit(1)
| 2.234375 | 2 |
robosuite/models/robots/kinova3_robot.py | kyungjaelee/robosuite | 0 | 49805 | <gh_stars>0
import numpy as np
from robosuite.models.robots.robot_model import RobotModel
from robosuite.utils.mjcf_utils import xml_path_completion
class Kinova3(RobotModel):
"""
The Gen3 robot is sparkly newest addition to the Kinova line
Args:
idn (int or str): Number or some other unique iden... | 2.46875 | 2 |
kink_module/kink.py | SolemnMonk/KR | 0 | 49806 | import time, subprocess, os.path, re, multiprocessing, threading
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
class Kink:
driver = None
dispatcher_thread ... | 2.515625 | 3 |
indico/modules/events/models/labels.py | Nordix/indico | 0 | 49807 | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import uuid
from indico.util.locators import locator_property
fr... | 2.359375 | 2 |
mykonos/locator/locator_element.py | monicadanesa/mykonos | 17 | 49808 | import traceback
from alog import debug, info, error
from mykonos.core.core import Core
from mykonos.keywords.management_device import ManagementDevice
from mykonos.keywords.decorators import Parallel
class LocatorElement(Core):
def __init__(self):
self.device_mobile = self.device()
self.manageme... | 2.203125 | 2 |
build/toolchains/helm/helm_toolchain.bzl | muhaftab/charts | 1 | 49809 | <gh_stars>1-10
"""
This module implements the helm toolchain rule.
"""
HelmInfo = provider(
doc = "Information on Helm command line tool",
fields = {
"tool": "Target pointing to Helm executable",
"cmd": "File pointing to Helm executable"
}
)
def _helm_toolchain_impl(ctx):
toolchain_inf... | 1.679688 | 2 |
dilemma_lib.py | idoheinemann/Prisoners-Dilemma | 3 | 49810 | import abc
from typing import NewType
from copy import copy
def _(): # make the registered classes variable invisible
__registered_classes = []
def _register(cls):
if hasattr(cls, 'do_turn'):
print(f'registering {cls.__name__}...')
__registered_classes.append(cls)
els... | 4 | 4 |
backend/apis/family_group/serializers/memberships.py | sango09/senasoft | 1 | 49811 | """Serializer de los miembros de un grupo familiar"""
# Django REST Framework
from rest_framework import serializers
# Serializers
from apis.users.serializers import UserModelSerializer
from apis.pacient.serializers import PacientModelSerializer
# Models
from apis.family_group.models import Memberships
class Membe... | 2.5 | 2 |
validproxy-master/proxyon.py | Zusyaku/Termux-And-Lali-Linux-V2 | 2 | 49812 | import requests
import argparse
import sys
import os
import urllib3
import random
def user_agent():
useragent = [
"Mozilla/5.0 CK={ } (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/7... | 2.3125 | 2 |
pyFT/FTDate.py | lesibius/pyFT | 0 | 49813 | import pyFT.FTError
import datetime as dt
strfRFC3339 = '%Y-%m-%dT%H:%M:%S.000Z'
def FTdateTime(val):
return dt.datetime.strftime(val,strfRFC3339)
| 2.78125 | 3 |
2017.d/1-echiquier-grain-de-ble.d/src/grain-de-ble.py | homeostasie/petits-pedestres | 1 | 49814 | <reponame>homeostasie/petits-pedestres
# On est sur la première case.
# On a un grain de blé sur la première case.
# On a un grain de blé sur l'échéquier.
# Nombre de grain de blé par case.
# case est un nombre entier.
case = 1
# Nombre de grain blé au total sur l'échiquier.
# blé est un nombre entier.
ble = 1
# Coe... | 3.328125 | 3 |
accencis/settings/development.py | majestylink/majestyAccencis | 0 | 49815 | from .base import *
SECRET_KEY = '<KEY>'
DEBUG = True
ALLOWED_HOSTS += ['*']
INSTALLED_APPS += [
'debug_toolbar'
]
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
# DEBUG TOOLBAR SETTINGS
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.ti... | 1.773438 | 2 |
src/Zadanie2/NotesService.py | TestowanieAutomatyczneUG/laboratorium-11-LudwikaMalinowska | 0 | 49816 | <reponame>TestowanieAutomatyczneUG/laboratorium-11-LudwikaMalinowska
from Zadanie2.NotesStorage import NotesStorage
import math
import statistics
class NotesService:
def __init__(self, storage):
self.storage = storage
def add(self, note):
return self.storage.add(note)
def averageOf(self... | 2.84375 | 3 |
src/baseballforecaster.py | baileymorton989/Baseball_Forecasting_and_Simulation | 0 | 49817 | #for data cleaning and analysis
import pandas as pd
import numpy as np
from random import randint
#for visualization
import matplotlib.pyplot as plt
import seaborn as sns
#for directory-related functions
import os
import glob
import getpass
#for web-scraping baseball data
import pybaseball as pyb
#for drafting
... | 2.6875 | 3 |
Oddschecker/LineAggregator.py | Bobtron/ArbFinder | 0 | 49818 | from Oddschecker.Event import *
from Oddschecker import Tools as tl
from Oddschecker.Line import *
from Oddschecker.LineStorage import *
from typing import List
import pprint
pp = pprint.PrettyPrinter(indent=4)
class LineAggregator:
def __init__(self, event: Event, market_to_line_class: dict, sportsbook_codes: L... | 2.46875 | 2 |
Assets/Help.py | fireclawthefox/DirectGuiEditor | 0 | 49819 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file was created using the DirectGUI Designer
from direct.gui import DirectGuiGlobals as DGG
from direct.gui.DirectFrame import DirectFrame
from DirectGuiExtension.DirectAutoSizer import DirectAutoSizer
from DirectGuiExtension.DirectBoxSizer import DirectBoxSizer
from... | 2.015625 | 2 |
5_singleton/chocolate_boiler.py | hypersport/Head-First-Design-Patterns-Python | 0 | 49820 | class ChocolateBoiler:
unique_instance = None
def __new__(cls, *args, **kwargs):
if not cls.unique_instance:
cls.unique_instance = super().__new__(cls, *args, **kwargs)
return cls.unique_instance
def __init__(self):
self.empty = True
self.boiled = False
def... | 3.125 | 3 |
SIFTS/SIFTS2Table.py | ajing/SIFTS.py | 0 | 49821 | '''
SIFTS data to a table, so I can load to MySQL database.
'''
from SIFTSXMLMapControl import processOneXML
from SIFTSXMLMapModel import XMLDIR
import os
## parameters
OUTFILE = "./SIFTS/sift_sql_table_test.txt"
#OUTDIR = "./SIFTS/sift_sql_test/"
OUTDIR = "./SIFTS/sift_sql/"
MOADPDB = "./Data/MOADPDB.txt"
MULT... | 2.671875 | 3 |
researches/img2img/probaV_SR/pvsr_model.py | loveorchids/probaV | 0 | 49822 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet18, vgg16_bn
import omni_torch.networks.blocks as block
import researches.img2img.probaV_SR.pvsr_module as module
class CARN(nn.Module):
def __init__(self, inchannel, filters, scale, BN=nn.BatchNorm2d, s_MSE=Fa... | 2.109375 | 2 |
mediator_test.py | ssoloff/petulant-octo-adventure | 0 | 49823 | #!/usr/bin/env python3
import functools
import itertools
import operator
import re
class _Topic:
def __init__(self, mediator):
self._mediator = mediator
def _get_published_data_for_topic(self, topic):
return [publisher(topic) for publisher in self._mediator._get_publishers_for_topic(topic)]
... | 2.703125 | 3 |
Chapter10/ch10_ex5.py | leetschau/Functional-Python-Programming-Second-Edition | 65 | 49824 | <filename>Chapter10/ch10_ex5.py
#!/usr/bin/env python3
"""Functional Python Programming
Chapter 10, Example Set 5
"""
from collections import defaultdict
from typing import (
Iterable, Callable, Dict, List, TypeVar,
Iterator, Tuple, cast)
D_ = TypeVar("D_")
K_ = TypeVar("K_")
def partition(
source: It... | 3.15625 | 3 |
__init__.py | AnthonyJFeola/DS-Unit-3-Sprint-Challenge-1-Software-Engineering | 17 | 49825 | <reponame>AnthonyJFeola/DS-Unit-3-Sprint-Challenge-1-Software-Engineering<filename>__init__.py
# Nothing to see here | 0.964844 | 1 |
members/crm/migrations/0017_profile_qb_realm_id.py | ocwc/ocwc-members | 0 | 49826 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2019-01-20 12:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("crm", "0016_profile")]
operations = [
migrations.AddField(
model_name="prof... | 1.476563 | 1 |
py/desimodel/inputs/focalplane.py | sdss/lvmmodel | 0 | 49827 | <filename>py/desimodel/inputs/focalplane.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
desimodel.inputs.focalplane
==============================
Utilities for constructing a focalplane model.
"""
import os
from datetime import datetime
import re
import csv
import yaml
... | 2.234375 | 2 |
python2.7libs/hdatools/fkcontrol.py | friedasparagus/HouRig | 1 | 49828 | # MIT License
#
# Copyright (c) 2018 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 1.828125 | 2 |
Python3/0881-Boats-to-Save-People/soln.py | wyaadarsh/LeetCode-Solutions | 5 | 49829 | <reponame>wyaadarsh/LeetCode-Solutions
class Solution:
def numRescueBoats(self, people, limit):
"""
:type people: List[int]
:type limit: int
:rtype: int
"""
people.sort()
l, r, cnt = 0, len(people) - 1, 0
saved = 0
while saved < len(people):
... | 3.1875 | 3 |
construct_editor/gallery/test_tbitstruct.py | jpsnyder/construct-editor | 0 | 49830 | <gh_stars>0
import construct as cs
import construct_typed as cst
import dataclasses
from . import GalleryItem
@dataclasses.dataclass
class TBitsStructTest(cst.TContainerMixin):
@dataclasses.dataclass
class Nested(cst.TContainerMixin):
test_bit: int = cst.sfield(cs.Bit)
test_nibble: int = cst.s... | 2.046875 | 2 |
luafun/steamapi/api.py | Delaunay/LuaFun | 1 | 49831 | import time
import json
import os
class LimitExceeded(RuntimeError):
pass
class ServerError(RuntimeError):
pass
class WebAPI:
""""""
URL = ''
def __init__(self, name):
# 100,000 API calls per day.
# 1 request per second
# 60 request per minute
self.max_api_call... | 2.71875 | 3 |
ensign_multicat/__init__.py | phoughton/ensign_multicat | 0 | 49832 | import ensign_multicat.utils
__all__ = ["utils"] | 1.109375 | 1 |
sparse_arrays.py | Digit4/randoms | 1 | 49833 | <reponame>Digit4/randoms<filename>sparse_arrays.py
inpu = """4
aba
baba
aba
xzxb
3
aba
xzxb
ab
"""
inp = """100
lekgdisnsbfdzpqlkg
eagemhdygyv
jwvwwnrhuai
urcadmrwlqe
mpgqsvxrijpombyv
mpgqsvxrijpombyv
urcadmrwlqe
mpgqsvxrijpombyv
eagemhdygyv
eagemhdygyv
jwvwwnrhuai
urcadmrwlqe
jwvwwnrhuai
kvugevicpsdf
kvugevicpsdf
mpg... | 1.25 | 1 |
osdria/views/draftbar_element_view.py | soberleitner/osdriaApp | 0 | 49834 | from math import ceil
from PySide2.QtCore import QRect, QSize, Qt, QAbstractTableModel, QMimeData, QByteArray
from PySide2.QtGui import QPainter, QStandardItemModel, QStandardItem, QPen
from PySide2.QtWidgets import *
from models.constants import PropType, MimeType
from views.draftbar_element_view_ui import Ui_DraftE... | 2.359375 | 2 |
cmds/clear_spam.py | Asperger/PCRD-DiscordBot | 2 | 49835 | <reponame>Asperger/PCRD-DiscordBot
from utils.log import FileLogger
from utils.spammer import clear_spammer, get_spammer
from utils.cmds_registry import register
register(cmd="clear_spam", alias="clear_spam")
register(cmd="clear_spam", alias="cs")
class clear_spam:
def __init__(self):
self.usage = '!clear... | 2.625 | 3 |
neo4s/bin/neo4j.py | omerl13/neo4s | 2 | 49836 | <gh_stars>1-10
import json
import sys
import time
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators
from neo4j import GraphDatabase, basic_auth
from neo4j.graph import Node, Relationship
from fields_extractor import FieldsExtractor
@Configuration()
class Neo4jCommand(G... | 2.375 | 2 |
data_loader.py | imdeepmind/GenerateFace | 0 | 49837 | <filename>data_loader.py
from torch.utils.data import Dataset
from PIL import Image
import torch
import os
class FaceDataset(Dataset):
def __init__(self, path, transform=None):
self.__images = os.listdir(path)
self.__path = path
self.__transform = transform
def __len__(self):
return len(self.__i... | 2.828125 | 3 |
amo.py | aliwimo/animal_migration_opt | 0 | 49838 | <reponame>aliwimo/animal_migration_opt
from random import random, randint, uniform, seed
from copy import deepcopy
from math import floor
import numpy as np
POP_SIZE = 90
DIMENSION = 30
GENERATIONS = 50
BOUND = 100
UB = BOUND
LB = -BOUND
PA = [0] * POP_SIZE
BEST =... | 2.625 | 3 |
restclients/test/gws/trumba_group.py | uw-it-cte/uw-restclients | 0 | 49839 | from django.test import TestCase
from restclients.models.gws import GroupUser
from restclients.exceptions import DataFailureException
from restclients.gws import GWS
from restclients.test import fdao_gws_override
@fdao_gws_override
class TestGwsTrumbaGroup(TestCase):
def test_get_group(self):
group = GWS... | 2.0625 | 2 |
src/zope/dublincore/interfaces.py | zopefoundation/zope.dublincore | 2 | 49840 | <filename>src/zope/dublincore/interfaces.py
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL sh... | 1.8125 | 2 |
crypto/crypto/models/Asset.py | barte525/RSI | 0 | 49841 | from urllib.request import urlopen
import json
import requests
from django.db import models
from crypto.settings import env
from django.db.utils import IntegrityError
NOT_EXIST_ERROR = "Crypto with that name and currency does not exist in database"
EXTERNAL_API_ERROR = "External api did not send correct response"
NOT_E... | 2.734375 | 3 |
make_data.py | ManuelSzewc/bayes-4tops | 1 | 49842 | <reponame>ManuelSzewc/bayes-4tops<gh_stars>1-10
# here i make the data
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import poisson, norm, bernoulli, expon, uniform, beta, gamma, multinomial
from scipy.special import digamma
import random
from scipy.special import gamma as gam... | 1.828125 | 2 |
tests/snacks/test_unittest_parameterized_demo.py | msakamoto-sf/pythonsnack | 1 | 49843 | from unittest import TestCase
from parameterized import parameterized, parameterized_class, param
# demonstration of wolever/parameterized
# ref: https://github.com/wolever/parameterized
# see-also:
# - http://h-miyako.hatenablog.com/entry/2017/08/16/173000
# - https://qiita.com/nittyan/items/0152a3b93e17c177... | 3.359375 | 3 |
tests/time/TestTime.py | DuneRoot/BPL-python | 0 | 49844 | import unittest
from datetime import datetime
from bpl_lib.network.Network import Network
from bpl_lib.time.Time import Time
class TestTime(unittest.TestCase):
def test_get_time_1(self):
Network.use("mainnet")
time = Time.get_time(datetime.utcfromtimestamp(1533122273))
self.assertIsNotNo... | 2.875 | 3 |
photospicker/event/start_upload_event.py | l-vo/photos-picker | 0 | 49845 | class StartUploadEvent(object):
"""Event dispatched when an upload starts"""
def __init__(self, filepath, upload_file_rank, files_to_upload):
"""
Constructor
:param str filepath: file which starts to be uploaded
:param int upload_file_rank: rank of the file in upload queue
... | 3.28125 | 3 |
otils/coroutine.py | MRongM/py-otils | 0 | 49846 | from gevent import monkey, pool
monkey.patch_all()
import gevent
import time
from otils.oo import _OO
import os
class Worker(_OO):
def __init__(self, handler, data, **kwargs):
super(Worker, self).__init__()
self.handler = handler
self.data = data
for k, v in kwargs... | 2.59375 | 3 |
flicks/base/util.py | Mozilla-GitHub-Standards/6f0d85288b5b0ef8beecb60345173dc14c98e40f48e1307a444ab1e08231e695 | 1 | 49847 | <filename>flicks/base/util.py
from contextlib import contextmanager
from locale import strcoll as locale_strcoll
from django.conf import settings
from django.core.urlresolvers import NoReverseMatch
from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect
from django.utils.functional import lazy
from... | 2.234375 | 2 |
backend/django/campsignup/backend/migrations/0018_auto_20200812_1752.py | Ring-deutscher-PfadfinderInnenverbande/campsignup | 0 | 49848 | # Generated by Django 3.0.8 on 2020-08-12 17:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0017_particip... | 1.617188 | 2 |
swagger_server/models/base_model_.py | Cray-HPE/uas-mgr | 0 | 49849 | <filename>swagger_server/models/base_model_.py
# MIT License
#
# (C) Copyright [2020] Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restr... | 1.898438 | 2 |
docs/conf.py | jojoelfe/napari | 7 | 49850 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 1.515625 | 2 |
kaskade/kafka/mappers.py | sauljabin/kaskade | 16 | 49851 | from confluent_kafka import TopicPartition as GroupPartitionMetadata
from confluent_kafka.admin import BrokerMetadata
from confluent_kafka.admin import GroupMember as GroupMemberMetadata
from confluent_kafka.admin import GroupMetadata, PartitionMetadata, TopicMetadata
from kaskade.kafka.models import (
Broker,
... | 2.15625 | 2 |
LeetCode/Apr 2021 Leetcoding Challenge/Meeting Scheduler.py | UtkarshPathrabe/Competitive-Coding | 13 | 49852 | <gh_stars>10-100
class Solution:
def minAvailableDuration(self, slots1: List[List[int]], slots2: List[List[int]], duration: int) -> List[int]:
timeslots = list(filter(lambda x: x[1] - x[0] >= duration, slots1 + slots2))
heapq.heapify(timeslots)
while len(timeslots) > 1:
start1, e... | 2.90625 | 3 |
LunarLander/LunarLander-ELS.py | Adriel-M/OpenAI-LunarLander | 3 | 49853 | # Evolutionary Learning Strategy Implementation
# Learn more from https://blog.openai.com/evolution-strategies/
import gym
import numpy as np
from gym import wrappers
# GLOBAL SETTINGS
RNG_SEED = 8
ENVIRONMENT = "LunarLander-v2"
POPULATION_SIZE = 100 # Population size
GENERATION_LIMIT = 100 # Max number of generati... | 2.5 | 2 |
setup.py | qxuchn/ANANSE_data | 0 | 49854 | import versioneer
from setuptools import setup, find_packages
import os
DESCRIPTION = "Inference of transcription factor motif activity from single cell RNA-seq data."
with open("README.md") as f:
long_description = f.read()
setup(
name="pananse",
version=versioneer.get_version(),
long_description = ... | 1.242188 | 1 |
awacs/crowd.py | MicrohexHQ/awacs | 0 | 49855 | # Copyright (c) 2012-2013, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon Mechanical Turk Crowd'
prefix = 'crowd'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Act... | 2.109375 | 2 |
data/MuPoTS_skeleton/bbox_root/gen_anno.py | GUO-W/PI-Net | 2 | 49856 | ##
## Software PI-Net: Pose Interacting Network for Multi-Person Monocular 3D Pose Estimation
## Copyright Inria and UPC
## Year 2021
## Contact : <EMAIL>
##
## The software PI-Net is provided under MIT License.
##
import json
with open("../data/MuPoTS-3D.json",'r') as f1:
data_dict = json.load(f1)
print("data... | 1.71875 | 2 |
gist/__main__.py | TakesxiSximada/python-gist-sximada-custom | 1 | 49857 | <reponame>TakesxiSximada/python-gist-sximada-custom<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
from . import (
main,
GistError,
)
logger = logging.getLogger('gist')
if __name__ == "__main__":
try:
main()
except GistError as e:
sys.stderr... | 2.171875 | 2 |
SomeParameters.py | mchtter/mucoTraining | 1 | 49858 | <reponame>mchtter/mucoTraining<gh_stars>1-10
someParameters = input("Please Enter some parameters: ")
def createList(*someParameters):
paramList = []
for add in someParameters:
paramList.append(add)
print(paramList)
return paramList
createList(someParameters)
| 3.140625 | 3 |
section1/solution/birthday.py | koltpython/python-exercises-spring2020 | 1 | 49859 | <reponame>koltpython/python-exercises-spring2020
"""
Write a program that first takes the year, month (as integer), and day of the user's birth date from console.
Then, calculate and print on which day of the year the user has been born.
You can assume user will enter a valid value for all inputs.
Example:
Enter your b... | 4.40625 | 4 |
.leetcode/729.my-calendar-i.py | KuiyuanFu/PythonLeetCode | 0 | 49860 | <reponame>KuiyuanFu/PythonLeetCode
# @lc app=leetcode id=729 lang=python3
#
# [729] My Calendar I
#
# https://leetcode.com/problems/my-calendar-i/description/
#
# algorithms
# Medium (54.39%)
# Likes: 1642
# Dislikes: 54
# Total Accepted: 130.7K
# Total Submissions: 239.1K
# Testcase Example: '["MyCalendar","boo... | 3.671875 | 4 |
Priya/Array/first_repeating/first_repeating.py | LetsUpgrade/Algorithmic-Treasure | 13 | 49861 | <reponame>LetsUpgrade/Algorithmic-Treasure
def first_repeating(n,arr):
#initialize with the minimum index possible
Min = -1
#create a empty dictionary
newSet = dict()
# tranversing the array elments from end
for x in range(n - 1, -1, -1):
#check if the element is already ... | 4 | 4 |
tests/utils/wait.py | shenganzhang/citrine-python | 23 | 49862 | <filename>tests/utils/wait.py
from time import time, sleep
from typing import List, Optional, Callable
def wait_until(condition, timeout=30, interval=0.5):
"""Poll at the specified interval until the provided condition is truthy or the timeout (in seconds) is reached."""
start = time()
result = condition... | 3.234375 | 3 |
submissions/day07.py | ShreyGupta19/advent-of-code | 0 | 49863 | import re
from collections import defaultdict
from advent import AdventProblem
def preprocess(line):
match = re.match(r"([\w\s]+) bags contain (.+)\.", line)
constituents = re.findall(r"(\d+) ([\w\s]+) bags?", match.group(2))
return (match.group(1), constituents)
def part_1(pairings):
contained_by =... | 3.21875 | 3 |
app/__init__.py | JChiyah/crwiz | 3 | 49864 | import os
import sys
import time
import subprocess
import logging.config
from logging import getLogger
from flask import Flask, request, flash, jsonify, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, current_user
import flask_socketio
from flask_socketio import SocketIO... | 1.914063 | 2 |
tests/test_04_dxf_high_level_structs/test_410_table.py | Gmadges/ezdxf | 515 | 49865 | <gh_stars>100-1000
# Copyright (c) 2011-2021, <NAME>
# License: MIT License
import pytest
import ezdxf
from ezdxf.tools.test import load_entities
from ezdxf.sections.table import Table
from ezdxf.lldxf.tagwriter import TagCollector
@pytest.fixture(scope="module")
def table():
doc = ezdxf.new()
return doc.app... | 2.09375 | 2 |
xu/compa/Parapluie/src/StickyWindow/PMessage.py | sonnts996/XuCompa-Request | 0 | 49866 | from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QSizePolicy
from xu.compa.Parapluie import Parapluie
from xu.compa.Parapluie.src.StickyWindow.PSticky import PSticky
class PMessage(PSticky):
def __init__(self, parent: QWidget, rect: QRect = No... | 2.484375 | 2 |
tests/controllers/test_user.py | narutox900/GotItOnboardFinal | 0 | 49867 | from tests.utils import request
from app.utils.messages.message import USERNAME_DUPLICATED, INVALID_CREDENTIALS
class TestRegister:
def test_register_valid(self, client):
data = {
'username': 'test@name',
'password': '<PASSWORD>'
}
rv = request.post(client, '/regist... | 2.578125 | 3 |
demo.py | nuzillard/SDFrw | 1 | 49868 | <reponame>nuzillard/SDFrw<gh_stars>1-10
"""
Demo for the sdfrw.py module.
Performs a few transformation on file "flavonoids.sdf"
and writes the result in "qualified_flavonoids.sdf",
then queries molecules for the value of the No_CE property
"""
import sdfrw
# for SDF file handling
data1 = """Name quercetine
No_CAS 11... | 2.171875 | 2 |
data_api/api.py | xpenalosa/Degree-Final-Project | 0 | 49869 | #!/usr/bin/python3
import logging
from datetime import datetime, timedelta
import json
import re
from kazoo.client import KazooClient
from kazoo.recipe.lock import Lock, ReadLock
from kazoo.exceptions import LockTimeout, NoNodeError
from data_api.errors import DataApiErrors, DataApiException
class DataAPI():
"""Da... | 2.34375 | 2 |
Week3code/Greedy_by_others.py | SedahMo/find_hidden_messages_in_dna | 1 | 49870 | <reponame>SedahMo/find_hidden_messages_in_dna<filename>Week3code/Greedy_by_others.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 11 18:30:27 2021
@author: babemomo
"""
import time
def greedymotifsearch(dna, k, t):
bestmotifs=[string[:k]for string in dna]
for j in range(... | 2.921875 | 3 |
training.py | lishuoleo/dynamic_risk_assessment | 0 | 49871 | <filename>training.py<gh_stars>0
import pandas as pd
import pickle
import os
from sklearn.linear_model import LogisticRegression
import json
# Load config.json and get path variables
with open('config.json', 'r') as f:
config = json.load(f)
dataset_csv_path = os.path.join(os.getcwd(), config['output_folder_path']... | 3.078125 | 3 |
initialisations/onoda_base.py | simonharris/pycluster | 1 | 49872 | """
Onoda 2012 ICA- and PCA-based algorithm
See: Careful seeding method based on independent components analysis for
k-means clustering
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.663.5343&rep=rep1&type=pdf#page=53
"""
from abc import abstractmethod
import numpy as np
from initialisations.base import ... | 2.953125 | 3 |
applications/TrilinosApplication/tests/test_trilinos_matrix.py | lkusch/Kratos | 778 | 49873 | import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics
import KratosMultiphysics.TrilinosApplication as KratosTrilinos
class TestTrilinosMatrix(KratosUnittest.TestCase):
def test_resize(self):
comm = KratosTrilinos.CreateEpetraCommunicator(KratosMultiphysics.DataCommunicator.... | 2.1875 | 2 |
STORE/Pong/main.py | iTecAI/Derpi-Apps | 0 | 49874 | #lib import
import sys, os, random, time
sys.path.append('..\\..\\')
import derpapi
import pygame
RUN = False
#screen init
try:
pygame.init()
except:
pygame.display.init()
def main():
global RUN, random, derpapi
#place main code here
HS = derpapi.retrieve('HISCORE')
if HS == None:... | 2.78125 | 3 |
final_16042020/final_alessandro-reggiani.py | allereggiani22/programming_alessandro_reggiani | 1 | 49875 | """
Pseudocode:
-import s1, s2, BLOSUM62 from input_data.py
-def function that takes as input s1, s2, BLOSUM and gap value to return F (SW) and P matrices
-defining F and P and filling with 0s, no need to initialise first row/column
-iterate SW algorithm
-return F,P
-def function that take F, P, s1 and s2 a... | 3.671875 | 4 |
desafio32.py | lucasmc64/Curso_de_Python_CeV | 1 | 49876 | from datetime import date
print('{} DESAFIO 32 {}'.format('='*10, '='*10))
ano = int(input('Digite um ano qualquer (Ou 0 se quiser a análise do ano atual): '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano != 100 or ano % 400 == 0:
print('O ano {} é BISSEXTO!'.format(ano))
else:
print('O ano ... | 3.765625 | 4 |
src/English.py | Ydos2/AI_Greg_Voice_Assistant | 1 | 49877 | import re
import platform
import os
import time
import json
import datetime
from .website import websiteText
from .UpdateJson import UpdateJsonLanguage
def EnglishFunction(Balthazar, text, languages):
websiteText(Balthazar, text, languages)
if "hello" in text:
Balthazar.speak("hello, how are you?", la... | 2.953125 | 3 |
src/Equations/TimeStep.py | KoningJasper/Offshore-SPH | 0 | 49878 | import numpy as np
from math import sqrt
from numba import njit, prange, jitclass
from src.Common import ParticleType
from typing import Tuple
@jitclass([])
class TimeStep:
def __init__(self):
pass
def compute(self, J: int, pA: np.array, gamma_c: float = 0.25, gamma_f: float = 0.25) -> Tuple[float, flo... | 3.046875 | 3 |
bookbar/auth_app/urls.py | trenev/bookbar | 0 | 49879 | from django.urls import path
from bookbar.auth_app.views import UserRegistrationView, UserLoginView, logout_user, ChangeUserPasswordView, \
ChangeUserEmailView
urlpatterns = (
path('register/', UserRegistrationView.as_view(), name='register user'),
path('login/', UserLoginView.as_view(), name='login user'... | 1.929688 | 2 |
Data Visualization/School/code4.py | ALDOR99/Python | 2 | 49880 | <filename>Data Visualization/School/code4.py
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 15 13:36:53 2021
@author: ali_d
"""
#code3
import numpy as np
import pandas as pd
# plotly
from plotly.offline import init_notebook_mode, iplot, plot
import plotly as py
init_notebook_mode(connected=True)
import plotly.grap... | 3.140625 | 3 |
tests/settings.py | Francislley/CrudDajndo2017.2 | 0 | 49881 | SECRET_KEY = 'testing'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.staticfiles',
'django.contrib.sessions',
'c... | 1.507813 | 2 |
GEOS_Util/coupled_diagnostics/verification/HadCRUT3/__init__.py | GEOS-ESM/GMAO_Shared | 1 | 49882 | <reponame>GEOS-ESM/GMAO_Shared
import os
import netCDF4 as nc
import scipy as sp
from g5lib import dset
__all__=['ctl']
class Ctl(dset.NCDset):
def __init__(self):
name='HadCRUT3'
flist=['/discover/nobackup/projects/gmao/oceanval/verification/HadCRUT3/HadCRUT3.nc']
f=nc.Dataset(f... | 2.125 | 2 |
dgen.py | tmy310/dgen | 0 | 49883 | <reponame>tmy310/dgen<filename>dgen.py
# -*- coding: utf-8 -*-
"""
データアクセス用のコード生成
"""
import os
import mysql.connector
from argparse import *
import subprocess
class Dgen:
def __init__(self):
self.build_argument_parser()
self.COMMON_BASE = 'dao.'
def build_argument_parser(self):
self... | 2.734375 | 3 |
home/migrations/0003_rename_image_movie_thumbnail_and_more.py | italoseara/Django-Movie | 1 | 49884 | <filename>home/migrations/0003_rename_image_movie_thumbnail_and_more.py
# Generated by Django 4.0 on 2021-12-26 20:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0002_remove_movie_language_remove_serie_language'),
]
operations = [
m... | 1.835938 | 2 |
documentstore_migracao/processing/extracted.py | patymori/document-store-migracao | 1 | 49885 | <gh_stars>1-10
import logging
import os
from typing import List
import concurrent.futures
from tqdm import tqdm
from documentstore_migracao.export import article
from documentstore_migracao.utils import files
from documentstore_migracao import config
from documentstore_migracao.utils import DoJobsConcurrently, PoisonPi... | 1.953125 | 2 |
Old/src/com/up/oop3.py | exchris/Pythonlearn | 0 | 49886 | # -*- coding:UTF-8 -*-
class Person(object):
def __init__(self,name,gender,birth,job):
self.name = name
self.gender = gender
self.birth = birth
self.job = job
xiaoming = Person('<NAME>', 'Male', '1990-1-1', job='Student')
print xiaoming.name
print xiaoming.job | 3.828125 | 4 |
lib/poolfileupload/poolfileuploadImpl.py | OGalOz/poolfileupload | 0 | 49887 | <gh_stars>0
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import shutil
from Utils.mutantpooluploadUtilClient import mutantpooluploadUtil
from Utils.expsfileuploadUtilClient import expsfileuploadUtil
from Utils.barcodecountuploadUtilClient import barcodecountfileuploadUtil
from Utils.genetableuploadUti... | 1.703125 | 2 |
stsdas/pkg/analysis/slitless/axe/fcubeprep_iraf.py | iraf-community/stsdas | 1 | 49888 | import iraf
no = iraf.no
yes = iraf.yes
from axe import axesrc
# Point to default parameter file for task
_parfile = 'axe$fcubeprep.par'
_taskname = 'fcubeprep'
######
# Set up Python IRAF interface here
######
def fcubeprep_iraf(grism_image,
segm_image,
filter_info,
... | 2.34375 | 2 |
web/mainApp/migrations/0001_initial.py | njw1204/golf-online-judge | 3 | 49889 | # Generated by Django 2.1.8 on 2019-04-28 10:47
from django.db import migrations, models
import mainApp.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ProblemPost',
fields=[
... | 1.890625 | 2 |
cupy_alias/indexing/__init__.py | fixstars/clpy | 142 | 49890 | <filename>cupy_alias/indexing/__init__.py<gh_stars>100-1000
from clpy.indexing import * # NOQA
| 1.140625 | 1 |
molecule/resources/tests/all/test_common.py | lpmhouben/dnsdist-ansible | 0 | 49891 | <filename>molecule/resources/tests/all/test_common.py
import re
debian_os = ['debian', 'ubuntu']
rhel_os = ['redhat', 'centos']
def test_distribution(host):
assert host.system_info.distribution.lower() in debian_os + rhel_os
def test_repo_pinning_file(host):
if host.system_info.distribution.lower() in debi... | 2.15625 | 2 |
app/internal/drawable/drawable.py | Nenivar/outreach-storytelling | 1 | 49892 | class Drawable():
def draw(self, screen):
pass
def blit(self, screen):
pass | 1.507813 | 2 |
setup.py | nesies/SnowLibrary | 0 | 49893 | 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.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='robotframework-snowlibrary',
version='1.4.0',
url='',
licen... | 1.414063 | 1 |
src/utils/test_tflite.py | luan1412167/Silent-Face-Anti-Spoofing | 0 | 49894 | import numpy as np
import tensorflow as tf
from pytorch2onnx import AntiSpoofPredict
import cv2
import torch
import time
#load pytorch
device_id = 0
model_path = "./resources/anti_spoof_models/2020-09-28-13-11_Anti_Spoofing_1.2_112x112_model_iter-150.pth"
anti_model = AntiSpoofPredict(device_id, model_path)
dummy_img... | 2.75 | 3 |
processing/preprocess_signatures.py | noahlozevski/variational-RNN | 0 | 49895 | import os
import numpy as np
def read_data(input_path, english_only, english_indices=None):
"""Returns the list of signatures, labels, and ids. These can have English-only signatures if specified."""
if english_indices is None:
english_indices = []
sig_list = []
lab_list = [] # Genuine = 0, Forged = 1... | 2.734375 | 3 |
src/ostorlab/agent/message/proto/v3/asset/ip/v4/geolocation/geolocation_pb2.py | bbhunter/ostorlab | 113 | 49896 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v3/asset/ip/v4/geolocation/geolocation.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 google.proto... | 1.359375 | 1 |
code/random_generator.py | mjvakili/alpha-forecast | 0 | 49897 | '''
a simple script for generating uniform randoms and
jackknife regions assuming the KiDS-1000 mask
'''
import fitsio
import numpy as np
import healpy as hp
import kmeans_radec
from kmeans_radec import KMeans, kmeans_sample
from astropy.table import Table
lens = fitsio.read("lens.fits", columns = ["ra_gal", "dec_gal... | 2.546875 | 3 |
world/dominion/migrations/0031_auto_20180804_2115.py | stesla/arxcode | 5 | 49898 | <reponame>stesla/arxcode
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-08-04 21:15
from __future__ import unicode_literals
from django.db import migrations, models
def convert_modifiers_to_influence(apps, schema_editor):
from django.db.models import F
Organization = apps.get_model('dominion', ... | 1.710938 | 2 |
board/migrations/0001_initial.py | ev350/webchess | 0 | 49899 | # Generated by Django 2.0.5 on 2018-05-12 23:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.773438 | 2 |