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 |
|---|---|---|---|---|---|---|
ufs_tools/tuple_tools.py | weijia/ufs-tools | 0 | 40700 | <gh_stars>0
def remove_duplicated_keep_order(value_in_tuple):
new_tuple = []
for i in value_in_tuple:
if not (i in new_tuple):
new_tuple.append(i)
return new_tuple
# return tuple(set(value_in_tuple))
| 3.40625 | 3 |
setup.py | jeroyang/mcgocr | 1 | 40701 | <reponame>jeroyang/mcgocr
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import sys
import os
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist bdist_wheel upload")
sys.exit()
with open('README.md') as readme_file:
readme = readme_file.read()
version = '1.0.2'
wi... | 1.335938 | 1 |
utils.py | jbrudvik/yahoo-fantasy-basketball | 12 | 40702 | import sys
import yahooscraper as ys
from datetime import datetime, date
from urllib.parse import urljoin
# Environment variables
USERNAME_ENV = 'YAHOO_USERNAME'
PASSWORD_ENV = '<PASSWORD>'
# Command-line args
REQUIRED_ARGS = [
'<league_id>',
'<team_id>'
]
OPTIONAL_ARGS = []
# Error messages
LOGIN_ERROR_MS... | 3.296875 | 3 |
huskar_sdk_v2/consts.py | mozillazg/huskar-python | 5 | 40703 | <gh_stars>1-10
from __future__ import absolute_import
import pkg_resources
# Huskar ZooKeeper Schema
OVERALL = 'overall'
BASE_PATH = '/huskar'
COMPONENT_PATH = '{subdomain}/{service}/{cluster}'
# Huskar API Schema
SOA_MODE_HEADER = 'X-SOA-Mode'
SOA_MODE_CHOICES = frozenset(['orig', 'prefix', 'route'])
SOA_CLUSTER... | 1.773438 | 2 |
esp_debug_adapter/debug_adapter/debug_backend/debug_backend/hw_spec_tools.py | jrroches/vscode-esp-idf-extension | 2 | 40704 | import sys
import os
from .gdb import Gdb
from .oocd import Oocd
from .hw_specific import *
# useful if there is some variety of naming
hw_names = {
"esp32s2beta": "Esp32_S2",
"esp32s2_beta": "Esp32_S2",
"esp32_s2beta": "Esp32_S2",
"esp32_s2_beta": "Esp32_S2",
"esp32s2": "Esp32_S2",
"esp32-s2"... | 2.625 | 3 |
tests/mlmax/test_local_deployments.py | yinsong1986/mlmax | 56 | 40705 | <gh_stars>10-100
import datatest as dt
import pytest
from sagemaker.processing import ProcessingInput, ProcessingOutput
from sagemaker.sklearn.estimator import SKLearn
from sagemaker.sklearn.processing import SKLearnProcessor
# These tests are skipped unless pytest is run with the `--smlocal` flag.
# These tests will ... | 2.3125 | 2 |
RecoJets/JetProducers/python/ak4PFClusterJets_cfi.py | ckamtsikis/cmssw | 852 | 40706 | import FWCore.ParameterSet.Config as cms
from RecoJets.JetProducers.PFClusterJetParameters_cfi import *
from RecoJets.JetProducers.AnomalousCellParameters_cfi import *
ak4PFClusterJets = cms.EDProducer(
"FastjetJetProducer",
PFClusterJetParameters,
AnomalousCellParameters,
jetAlgorithm = cms.string("A... | 1.085938 | 1 |
python/Generate_Employee_Codes_Data.py | jdglaser/census-dw | 0 | 40707 | <reponame>jdglaser/census-dw
'''
The functions in this script are used to fill data in the census data warehouse.
These functions are used to fill dbo.DIM_CBP_Employee_Sizes
'''
__author__ = "<NAME>"
__last_updated__ = "2019-11-08"
import pandas as pd
from sqlalchemy import create_engine
values = {
"001": "A... | 2.328125 | 2 |
accountsplus/tests/test_admin.py | GhalebKhaled/django-users-plus | 3 | 40708 | <reponame>GhalebKhaled/django-users-plus
from __future__ import unicode_literals
import django.test
import django.contrib.admin
import logging
from .. import admin
from test_models import (UnitTestCompany, UnitTestUser, UnitTestAuditLogEvent, )
logging.disable(logging.CRITICAL)
@django.contrib.admin.register(Uni... | 1.523438 | 2 |
frontends/pycc.py | Henny022p/cexplore | 0 | 40709 | #!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
from shutil import copyfile
from parser import parse, generate_ast, apply_transformations, ASTDump
from parse_debug import process_debug_info
def parse_args(argv):
parser = argparse.ArgumentParser(description='Simplified CC1 frontend')... | 2.375 | 2 |
template/python/base-class.py | hiroebe/sonictemplate-vim | 130 | 40710 | <gh_stars>100-1000
"""
{{_name_}}
"""
class {{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}(object):
def __init__(self{{_cursor_}}):
def __repr__(self):
return
| 2.1875 | 2 |
server/ahj_app/migrations/0006_ahjusermaintains_engineeringreviewrequirement.py | btansy/ahj-registry | 4 | 40711 | <filename>server/ahj_app/migrations/0006_ahjusermaintains_engineeringreviewrequirement.py
# Generated by Django 3.1.3 on 2021-03-16 21:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('a... | 1.601563 | 2 |
test-suite/generated-src/python/constant_record.py | trafi/trafi-djinni | 3 | 40712 | # AUTOGENERATED FILE - DO NOT MODIFY!
# This file generated by Djinni from constants.djinni
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni.pycffi_marshal import CPyPrimitive, CPyRecord, CPyString
from PyCFFIlib_c... | 1.898438 | 2 |
back/organization/views.py | kingzbauer/ChiefOnboarding | 0 | 40713 | import boto3
from botocore.config import Config
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie
from rest_framework import status
... | 1.765625 | 2 |
tx_elevators/management/commands/loadgeo.py | texastribune/tx_elevators | 0 | 40714 | <filename>tx_elevators/management/commands/loadgeo.py
from __future__ import division
from __future__ import unicode_literals
import csv
import logging
from django.core.management.base import BaseCommand
from tqdm import tqdm
class Command(BaseCommand):
args = 'csv file'
help = 'dump geo data'
def hand... | 2.1875 | 2 |
{{cookiecutter.project_slug}}/tests/PyInstaller_/frozen-pytest.py | bwoodsend/cookiecutter-pypackage | 0 | 40715 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Freeze pytest.main() with {{ cookiecutter.project_slug }} included.
"""
import sys
import {{ cookiecutter.project_slug }}
import pytest
sys.exit(pytest.main(sys.argv[1:] + ["--no-cov", "--tb=native"]))
| 1.34375 | 1 |
src/models/losses.py | rs1004/object_detection | 0 | 40716 | import torch
import torch.nn.functional as F
def focal_loss(input: torch.Tensor, target: torch.Tensor, alpha: float = 0.25, gamma: float = 2, reduction: str = 'none'):
pt = F.softmax(input, dim=-1)
log_pt = F.log_softmax(input, dim=-1)
loss = F.nll_loss(alpha * (1 - pt).pow(gamma) * log_pt, target, reduct... | 2.5 | 2 |
gwcs/tests/setup_package.py | cshanahan1/gwcs | 0 | 40717 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
return {
_ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc', 'data/*.hdr'] # noqa
}
| 1.265625 | 1 |
scripts/sv/combine-sv-genotypes/merge_exact_hets.py | vgteam/giraffe-sv-paper | 23 | 40718 | <reponame>vgteam/giraffe-sv-paper
import fileinput
import sys
# merge "symetric" hets (0/1+1/0 and vice versa) that match
# exactly (chr, pos, ref, alt). They must be consecutive so
# the VCF should be sorted.
# The variants are merged and the genotype is transformed to 1/1.
# If present, the merged GQ is the minimum... | 2.59375 | 3 |
src/infrastructure/services/scraper_services.py | rafaelcorazzi/game-scraper | 0 | 40719 | <reponame>rafaelcorazzi/game-scraper<filename>src/infrastructure/services/scraper_services.py
import bs4
import requests
from bs4 import BeautifulSoup
import base64
import hashlib
from typing import List
import re
from src.helpers.utils import Utils
from src.domain.console_domain import ConsolePlataform
from src.domain... | 2.65625 | 3 |
badwolf/deploy/providers/pypi.py | messense/badwolf | 94 | 40720 | <filename>badwolf/deploy/providers/pypi.py
# -*- coding: utf-8 -*-
import logging
from badwolf.utils import run_command
from badwolf.deploy.providers import Provider
logger = logging.getLogger(__name__)
class PypiProvider(Provider):
name = 'pypi'
def deploy(self):
username = self.config.get('usern... | 2.234375 | 2 |
lib/filewatcher/filewatchconfig.py | yinyin/FileWatcher | 0 | 40721 | <gh_stars>0
# -*- coding: utf-8 -*-
""" 設定檔相關物件與共用函式定義 """
import os
import re
import time
import datetime
import yaml
from filewatcher import metadatum
class WatcherConfiguration(object):
""" global configuration """
def __init__(self, target_directory, recursive_watch, remove_unoperate_file, meta_db_path, me... | 2.234375 | 2 |
antioch/test/test_permissions.py | philchristensen/antioch | 15 | 40722 | <reponame>philchristensen/antioch<filename>antioch/test/test_permissions.py
# antioch
# Copyright (c) 1999-2019 <NAME>
#
# See LICENSE for details
import sys, os, os.path, time
from django.test import TestCase
from django.db import connection
from antioch import test
from antioch.core import errors, exchange
# sys.... | 2.0625 | 2 |
src/pip/__init__.py | ehashman/pip | 1 | 40723 | <gh_stars>1-10
__version__ = "18.0.dev0"
| 1.078125 | 1 |
autoconj/rewrites.py | google-research/autoconj | 34 | 40724 | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 1.5 | 2 |
smng.py | caostorm/smng | 0 | 40725 | #coding=utf-8
from core.interface.action import server_action
from core.helper.creator import create_action
from core.helper.globalvar import global_const
import os
class smng:
def __init__(self):
global_const().set_value('BASEDIR', os.path.dirname(__file__))
def run(self):
try:
ac... | 2.078125 | 2 |
src/spark/io/stubs.py | jbalint/spark | 1 | 40726 | <filename>src/spark/io/stubs.py
#*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... | 1.257813 | 1 |
isitfit/tests/test_click.py | autofitcloud/isitf | 82 | 40727 | <gh_stars>10-100
"""
General tests for click usage. Check each test's docstrings for more details
"""
import click
class TestClickOptionMultipleWithDefault:
"""
General tests for click to check how it deals with defaults and multiple=True (for share-email option)
The goal is to figure out when to *not* prompt t... | 3.09375 | 3 |
tws_game/base_classes.py | tomreitsma/the-weird-science | 1 | 40728 | <gh_stars>1-10
from uuid import uuid4
class BaseLobby(object):
id = None
clients = []
game = None
factory = None
def __init__(self):
self.id = str(uuid4())
def set_factory(self, factory):
self.factory = factory
class BaseGame(object):
factory = []
commands = {
... | 2.703125 | 3 |
src/sleuthdeck/plugins/sound/actions.py | sleuth-io/sleuth-deck | 0 | 40729 | <gh_stars>0
from pydub import AudioSegment
from pydub.playback import play
from sleuthdeck.deck import Action
from sleuthdeck.deck import ClickType
from sleuthdeck.deck import Key
from sleuthdeck.deck import KeyScene
class Play(Action):
def __init__(self, sound_file: str, gain: int = 0):
sound = AudioSegm... | 2.3125 | 2 |
content/usage/lst/feedback/reset-feedback.py | Kumortas/osdoc_eyelogic | 0 | 40730 | exp.set('total_responses', 0)
exp.set('total_correct', 0)
exp.set('total_response_time', 0)
exp.set('average_response_time', 'NA')
exp.set('avg_rt', 'NA')
exp.set('accuracy', 'NA')
exp.set('acc', 'NA')
| 1.203125 | 1 |
bash_source/bacsort/pairwise_identities_to_distance_matrix.py | jwang45/biosuite | 0 | 40731 | #!/usr/bin/env python3
"""
Copyright 2018 <NAME> (<EMAIL>)
https://github.com/rrwick/Bacsort
This script uses FastANI output to generate a PHYLIP distance matrix suitable for quicktree.
This file is part of Bacsort. Bacsort is free software: you can redistribute it and/or modify it
under the terms of the GNU General ... | 2.796875 | 3 |
edera/storages/__init__.py | thoughteer/edera | 3 | 40732 | from .embedded import EmbeddedStorage
from .inmemory import InMemoryStorage
from .mongo import MongoStorage
from .sqlite import SQLiteStorage
| 1.109375 | 1 |
buttshock/et232/base.py | nannook206/buttshock-py | 1 | 40733 | <filename>buttshock/et232/base.py
# Buttshock - Base Module
#
# Contains base classes for communicating with the to the ErosTek ET-232B
# Electrostim Unit.
from ..errors import ButtshockChecksumError, ButtshockError, ButtshockIOError
import binascii
import struct
class ET232Base(object):
"""Base class for ET-232... | 2.921875 | 3 |
Python/Robot.py | zdynamics/zRobotics | 2 | 40734 | import DenavitHartenberg as dh
import Kinematics as k
import numpy as np
import matplotlib.pyplot as plt
import Movements as mv
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation
from sympy import *
class System:
def __init__(self, jointsPositions, linksLengths, centersOfMass, dhP... | 2.53125 | 3 |
rbacProject/apps/rbac/views_role.py | xeroCBW/testmodel | 0 | 40735 | from django.http import HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
import json
from django.core.serializers.json import DjangoJSONEncoder
from rbac.models import Menu, Role
from system.models import SystemSetup
from users.models import Structure
from system.forms import *
from django... | 1.96875 | 2 |
tests/emulator/kernel/test_printf.py | FKD13/RCPU | 17 | 40736 | <filename>tests/emulator/kernel/test_printf.py
from .utils import init_kernel
import pytest
def test_printf(capsys):
k = init_kernel()
# This loads the third argument of printf, a number
k.stack.push(443)
# This loads the second argument of printf, the address of a string
k.write_string(20, "this ... | 2.484375 | 2 |
src/spaceone/inventory/libs/manager.py | jihyungSong/plugin-azure-power-state | 0 | 40737 | from spaceone.core.manager import BaseManager
from spaceone.inventory.libs.connector import AzureConnector
class AzureManager(BaseManager):
connector_name = None
cloud_service_types = []
response_schema = None
collected_region_codes = []
def verify(self, options, secret_data, **kwargs):
"... | 2.28125 | 2 |
sxml/utils.py | vmstarchenko/sxml | 0 | 40738 | import re
import importlib.util
import sys
from .options import Option
def clean_spaces(text: str) -> str:
return re.sub(r'\s+', ' ', text).strip()
def patch_options(options, kwargs):
return {
k: options[v.key] if isinstance(v, Option) else v
for k, v in kwargs.items()
}
def wrap_globa... | 2.5 | 2 |
project_name/common/serializers.py | brevetech/breve_drf_template | 0 | 40739 | <filename>project_name/common/serializers.py
from rest_framework import serializers
class ErrorSerializer(serializers.Serializer):
"""
Defines a basic error serializer for
error responses
"""
error_code = serializers.IntegerField()
message = serializers.CharField(max_length=500)
def set_... | 2.703125 | 3 |
packages/models-library/src/models_library/function_service/iter_range.py | elisabettai/osparc-simcore | 0 | 40740 | from typing import Optional
from ..services import LATEST_INTEGRATION_VERSION, ServiceDockerData, ServiceType
from ._utils import OM, create_fake_thumbnail_url, register
from .constants import FUNCTION_SERVICE_KEY_PREFIX
def create_metadata(type_name: str, prefix: Optional[str] = None) -> ServiceDockerData:
pref... | 1.976563 | 2 |
v2/audio/audio_reader.py | safgen/deep-speaker | 0 | 40741 | <reponame>safgen/deep-speaker<filename>v2/audio/audio_reader.py
from time import time
import dill
import librosa
import numpy as np
import os
import re
from glob import glob
from random import shuffle, randint, choice
from tqdm import tqdm
from helpers.logger import Logger
logger = Logger.instance()
TMP_DIR = '/tmp... | 2.390625 | 2 |
Learning/DublicateFileHandler/handler.py | achaika80/Python | 0 | 40742 | # write your code here
import sys
import os
import hashlib
args = sys.argv
print(sys.argv)
if len(args) < 2:
print("Directory is not specified")
sys.exit()
else:
file_ext = ''
file_ext = input('Enter file format:')
sort = input('\nSize sorting options:\n1. Descending\n2. Ascending\n\nEnter a sorti... | 3.453125 | 3 |
refactored_modular/nest_tvb_pivot.py | sontheimer/EBRAINS_InterscaleHUB | 0 | 40743 | # ------------------------------------------------------------------------------
# Copyright 2020 Forschungszentrum Jülich GmbH
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0. "
#
# Forschungszentrum Jülich
# In... | 1.632813 | 2 |
benchmarking/simulations/scripts/cluster_build.py | justinshaffer/DEICODE | 0 | 40744 | #Import
import warnings; warnings.simplefilter('ignore') #for PCoA warnings
import pandas as pd
import numpy as np
#import data
from biom import load_table
from skbio.stats import subsample_counts
#MOCK data generation
from gneiss.util import match
from gneiss.sort import niche_sort
from simulations import block_diag... | 2.046875 | 2 |
atlas/foundations_contrib/src/foundations_contrib/models/project_listing.py | DeepLearnI/atlas | 296 | 40745 |
class ProjectListing(object):
@staticmethod
def list_projects(redis_connection):
"""Returns a list of projects store in redis with their
creation timestamps
Arguments:
redis_connection {RedisConnection} -- Redis connection to use as a provider for data
Returns:
... | 3.4375 | 3 |
quantsbin/derivativepricing/namesnmapper.py | quantsbin/Quantsbin | 132 | 40746 | """
developed by Quantsbin - Jun'18
"""
from enum import Enum
class AssetClass(Enum):
EQOPTION = 'EqOption'
FXOPTION = 'FXOption'
FUTOPTION = 'FutOption'
COMOPTION = 'ComOption'
class DerivativeType(Enum):
VANILLA_OPTION = 'Vanilla Option'
class PricingModel(Enum):
BLACKSCHOLESMERTON... | 2.25 | 2 |
code/Net.py | fpklipic/DRHNet | 4 | 40747 | import tensorflow as tf
import numpy as np
import resnet_block
def LeakyRelu(x, leak=0.2, name="LeakyRelu"):
with tf.variable_scope(name):
leak_c = tf.constant(0.1)
leak = tf.Variable(leak_c)
f1 = 0.5 * (1 + leak)
f2 = 0.5 * (1 - leak)
return f1 * x + f2 * tf.abs(x)
def... | 2.578125 | 3 |
test/appengine_api_tests.py | al3x/downforeveryoneorjustme | 26 | 40748 | <filename>test/appengine_api_tests.py
import unittest
from google.appengine.api import urlfetch
class AppEngineAPITest(unittest.TestCase):
def test_urlfetch(self):
response = urlfetch.fetch('http://www.google.com')
self.assertEquals(0, response.content.find('<html>'))
| 2.8125 | 3 |
blog_project/routes/art_route.py | acatamathesia/flask_blog_react | 0 | 40749 | <filename>blog_project/routes/art_route.py
from flask import request, session
from models.models import Article, ArticleContent
from models.result import ResultResp
from services import art_services
def insert_article():
try:
params = request.json
art_services.insert_article(Article(None, params['t... | 2.609375 | 3 |
qcloudsdkvpc/CreateFlowLogRequest.py | f3n9/qcloudcli | 0 | 40750 | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class CreateFlowLogRequest(Request):
def __init__(self):
super(CreateFlowLogRequest, self).__init__(
'vpc', 'qcloudcliV1', 'CreateFlowLog', 'vpc.api.qcloud.com')
def get_cloudLogId(self):
return self.get_params().g... | 2.078125 | 2 |
tcga_encoder/models/layers.py | tedmeeds/tcga_encoder | 2 | 40751 | <reponame>tedmeeds/tcga_encoder
from tcga_encoder.utils.helpers import *
from tcga_encoder.utils.math_funcs import *
import tensorflow as tf
from tcga_encoder.models.layers import *
from tcga_encoder.models.regularizers import *
from tcga_encoder.definitions.nn import *
from tcga_encoder.definitions.locations import ... | 2.375 | 2 |
src/cirrus/package.py | Maxsparrow/cirrus | 12 | 40752 | #!/usr/bin/env python
"""
package
Implementation for the package command that handles helping set up and
manipulate packages for use with cirrus.
Commands:
package init - Initialise a new repo with a basic cirrus.conf file
add the appropriate setup, manifest and requirements files
package sublime-project - Assist... | 2.046875 | 2 |
user_messages/__init__.py | matthiask/django-user-messages | 21 | 40753 | VERSION = (0, 7, 0)
__version__ = ".".join(map(str, VERSION))
default_app_config = "user_messages.apps.UserMessagesConfig"
| 1.460938 | 1 |
setup.py | cdominik/optool | 11 | 40754 | from setuptools import setup
setup(
name='optool',
version='1.9.4',
py_modules=['optool'],
install_requires=[
'numpy','matplotlib'
]
)
| 1.085938 | 1 |
wepppy/nodb/mods/rhem/rhempost.py | hwbeeson/wepppy | 0 | 40755 | # Copyright (c) 2016-2018, University of Idaho
# All rights reserved.
#
# <NAME> (<EMAIL>)
#
# The project described was supported by NSF award number IIA-1301792
# from the NSF Idaho EPSCoR Program and by the National Science Foundation.
import os
from os.path import exists as _exists
from os.path import join as _joi... | 2.0625 | 2 |
gamelib/icons.py | muppetjones/remgame | 0 | 40756 | <reponame>muppetjones/remgame
#!/usr/bin/env python3
"""Draw various icons within a box using pygame."""
import logging
import sys
import pygame
from gamelib import colors
SHAPE_DICT = None
log = logging.getLogger(__name__)
def get_shape_dict():
global SHAPE_DICT
mod = sys.modules[__name__]
if not SHA... | 3.515625 | 4 |
dialpad/client.py | dialpad/dialpad-python-sdk | 5 | 40757 | <filename>dialpad/client.py
import requests
from cached_property import cached_property
from .resources import (
SMSResource,
RoomResource,
UserResource,
CallResource,
NumberResource,
OfficeResource,
WebhookResource,
CompanyResource,
ContactResource,
CallbackResource,
CallCenterResource,
Call... | 2.234375 | 2 |
pydart/apps/turtle/optimizer.py | Jungdam/AlphaCon | 2 | 40758 | import math
import numpy as np
import pydart
import action as ac
import myworld
import cma
import multiprocessing
from multiprocessing import Process, Queue
import mmMath
from numpy.linalg import inv
dt = 1.0/600.0
skel_file = '/home/jungdam/Research/AlphaCon/pydart/apps/turtle/data/skel/turtle.skel'
def obj_func_tra... | 2.21875 | 2 |
logger/writers/influxdb_writer.py | mchoi39/openrvdas | 1 | 40759 | <gh_stars>1-10
#!/usr/bin/env python3
import logging
import sys
import json
from os.path import dirname, realpath; sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.utils import timestamp
from logger.utils.formats import Text
from logger.writers.writer import Writer
INFLUXDB_AUTH_TOKEN = IN... | 2.421875 | 2 |
src/abstractions/tests/test_initialization.py | iamsoroush/abstractions | 7 | 40760 | <filename>src/abstractions/tests/test_initialization.py
import pytest
from pathlib import Path
from abstractions.utils import load_config_file, Struct
# @pytest.fixture()
# def run_config(pytestconfig):
# run_name = pytestconfig.getoption("run_name")
# run_dir = Path('runs').joinpath(run_name)
# config = ... | 2.28125 | 2 |
Semana07Atividade01/Sem07Atv01Q02.py | Marvingms7/IFPI | 0 | 40761 | v_carro = float(input("Informe o valor: "))
total_mes_carro = (0.004 * v_carro) +v_carro
p_inicial = 10000
renda_total = (0.007 * p_inicial) + p_inicial
mes = -1
while True:
mes += 1
total_mes_carro = (0.004 * total_mes_carro) + total_mes_carro
if renda_total < total_mes_carro:
renda_total = (0.007 ... | 3.671875 | 4 |
fui_kk/participation_summary.py | martava/fui-kk | 9 | 40762 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Documentation string"""
__authors__ = ["Person1", "Person2"]
__email__ = "<EMAIL>"
__copyright__ = "<NAME>"
__credits__ = ["Person1", "Person2", "Person3"]
__version__ = "0.1"
__license__ = "MIT"
# This file is subject to the terms and conditions defi... | 3.109375 | 3 |
monitor/views.py | sweetchipsw/Sweetmon_legacy | 2 | 40763 | from django.shortcuts import render,get_object_or_404, redirect
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from monitor.models import Machine, Crash, Testcase, Profile, DupCrash
from track.models import Issue
from django.http import Http404
from django.conf import settings
from django.core... | 1.921875 | 2 |
former/resource.py | flomotlik/former | 11 | 40764 | <reponame>flomotlik/former
from former import specification
import logging
logger = logging.getLogger(__name__)
PRIMITIVE_TYPE = 'PrimitiveType'
PRIMITIVE_ITEM_TYPE = 'PrimitiveItemType'
TYPE = 'Type'
ITEM_TYPE = 'ItemType'
REQUIRED = 'Required'
SPEC = specification.specification()
TYPES = {}
TYPES.update(SPEC['Reso... | 2.28125 | 2 |
ver1_0/openassembly/pirate_profile/templatetags/profiletags.py | fragro/Open-Assembly | 1 | 40765 | <reponame>fragro/Open-Assembly
from django import template
from django import forms
from django.http import HttpResponseRedirect
import datetime
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from tagging.models import Tag, TaggedItem
from pirate_profile.models im... | 2.171875 | 2 |
text/symbols.py | Kapust/tacotron2 | 0 | 40766 | <filename>text/symbols.py
_kirciuotos_raides = {
"a" : ["a`","a~","a^"],
"ą" : ["ą~","ą^"],
"e" : ["e`","e~","e^"],
"ę" : ["ę~","ę^"],
"ė" : ["ė~","ė^"],
"i" : ["i`","i~","i^"],
"į" : ["į~","į^"],
"y" : ["y~","y^"],
"o" : ["o`","o~","o^"],
"u" : ["u`","u~","u^"],
"ų" : ["ų~","ų^"],
"ū" : ["ū~","ū^"],
"l" : ["l~"],
"m"... | 1.992188 | 2 |
chained/functions/lambded.py | andrewsonin/chained | 0 | 40767 | from functools import partial
from keyword import iskeyword
from typing import Tuple, Final, Callable, Any, List, Generator, NoReturn, Dict
from chained.type_utils.meta import ChainedMeta
def _call_monkey_patcher(self, *args, **kwargs):
"""LambdaExpr.__call__ monkey patcher"""
return self.eval()(*args, **kwa... | 2.75 | 3 |
fmriprep_denoise/data/timeseries.py | SIMEXP/fmriprep-denoise-benchmark | 5 | 40768 | import pandas as pd
from nilearn.signal import clean
from nilearn.interfaces.fmriprep import load_confounds_strategy, load_confounds
from fmriprep_denoise.data.atlas import create_atlas_masker, get_atlas_dimensions
def generate_timeseries_per_dimension(atlas_name, output, benchmark_strategies,
... | 2.140625 | 2 |
tests/__init__.py | benlachman/marshmallow-mongoengine | 77 | 40769 | <gh_stars>10-100
def exception_test(assert_check_fn):
try:
def exception_wrapper(*arg, **kwarg):
assert_check_fn(*arg, **kwarg)
except Exception as e:
pytest.failed(e) | 2.5 | 2 |
speckle/schemas/Line.py | pjkottke/PySpeckle | 24 | 40770 | import json
import json
import hashlib
from pydantic import BaseModel, validator
from typing import List, Optional
from speckle.base.resource import ResourceBaseSchema
from speckle.resources.objects import SpeckleObject
from speckle.schemas import Interval
NAME = 'line'
class Schema(SpeckleObject):
type: Optional... | 2.3125 | 2 |
allennlp_beaker/__main__.py | allenai/allennlp-beaker | 1 | 40771 | <gh_stars>1-10
from collections import deque
from datetime import date
import os
import shutil
import subprocess
from tempfile import TemporaryDirectory
from typing import Any, Dict, List, Iterable, Optional, Tuple
import uuid
from allennlp.common.file_utils import cached_path
from allennlp.common.params import Params... | 2.03125 | 2 |
python/ray/util/actor_group.py | jamesliu/ray | 33 | 40772 | <gh_stars>10-100
import weakref
from dataclasses import dataclass
import logging
from typing import List, TypeVar, Optional, Dict, Type, Tuple
import ray
from ray.actor import ActorHandle
T = TypeVar("T")
ActorMetadata = TypeVar("ActorMetadata")
logger = logging.getLogger(__name__)
@dataclass
class ActorWrapper:
... | 2.703125 | 3 |
lib/galaxy/webapps/openapi/utils.py | thepineapplepirate/galaxy | 0 | 40773 | <reponame>thepineapplepirate/galaxy
"""
Allows merging overlapping openapi definitions.
Taken from https://github.com/tiangolo/fastapi/pull/4727
"""
import http.client
import inspect
import itertools
import warnings
from enum import Enum
from typing import (
Any,
Callable,
cast,
Dict,
List,
Opti... | 2.171875 | 2 |
sfa/managers/component_manager_pl.py | planetlab/sfa | 1 | 40774 | import os
import xmlrpclib
from sfa.util.faults import *
from sfa.util.plxrn import PlXrn
from sfa.util.sfaticket import SfaTicket
from sfa.util.version import version_core
def GetVersion(api):
return version_core({'interface':'component',
'testbed':'myplc'})
def init_server():
from ... | 1.914063 | 2 |
tests/pikamon/database/test_pokemon_schema.py | dlrocker/pikamon-py | 0 | 40775 | import pytest
import sqlite3
from database_helpers import create_sample_user_records # noqa
def test_pokemon_insert_valid_record_no_users(sqlite_conn):
"""Validate that we fail to insert a valid record into the 'pokemons' table when there is no corresponding
user in the 'users' table"""
cursor = sqlite_... | 3.25 | 3 |
gym_stag_hunt/envs/pettingzoo_hunt.py | DavidRother/Gym-Stag-Hunt | 0 | 40776 | from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector
from pettingzoo.utils import wrappers
from pettingzoo.utils.conversions import parallel_wrapper_fn
from gym_stag_hunt.envs.hunt import HuntEnv
from gym.spaces import Box
import cv2
import numpy as np
def env(grid_size=(5, 5), screen_size=(600,... | 2.296875 | 2 |
logstash_conf_api.py | garyelephant/dolphin | 0 | 40777 | <gh_stars>0
# coding: utf-8
from string import Template
PRETTY_INDENT = 4
BASE_INDENT_SPACE = ' '
def _quote( s ):
return ''.join( [ '"', s, '"' ] )
class ConfBase( object ):
def __init__( self ):
super( ConfBase, self ).__init__()
def _dump( d, pretty=False, indent=0 ):
if isinstance( d, int ) ... | 2.703125 | 3 |
pykivdroid/screen.py | Sahil-pixel/Pykivdroid | 8 | 40778 | from pykivdroid import mActivity,WindowManagerNLayoutParams,Window,run_on_ui_thread,View
@run_on_ui_thread
def set_full_screen():
return mActivity.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN
|View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
... | 1.9375 | 2 |
tests/test_jwt.py | kschu91/pyoidc | 373 | 40779 | import os
from oic.utils.jwt import JWT
from oic.utils.keyio import build_keyjar
from oic.utils.keyio import keybundle_from_local_file
__author__ = "roland"
BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "data/keys"))
keys = [
{"type": "RSA", "key": os.path.join(BASE_PATH, "cert.key"), "us... | 2.296875 | 2 |
dwind_os/python/financial_functions.py | NREL/dwind | 2 | 40780 | import numpy as np
import pandas as pd
import decorators
from scipy import optimize
import settings
import utility_functions as utilfunc
import agent_mutation
import PySAM.Battwatts as battery
import PySAM.BatteryTools as batt_tools
import PySAM.Utilityrate5 as utility
import PySAM.Cashloan as cashloan
#===========... | 2.34375 | 2 |
Python/Code/Python3-Base/11_Advance/Generator.py | hiloWang/notes | 2 | 40781 | <filename>Python/Code/Python3-Base/11_Advance/Generator.py
#########################
# 生成器
#########################
# 创建一个生成器
L = (x * 2 for x in range(5))
print(type(L))
print(L)
for value in L:
print(value, end=' ')
print()
# 创建一个函数生成器
def fib(times):
n = 0
a, b = 0, 1
while n < times:
... | 4.0625 | 4 |
DataHandler.py | siej88/OCTLayers | 1 | 40782 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import numpy as N
class DataHandler(object):
"""Data File Manipulator"""
def format(self, number):
"""format(int number)"""
if (number == 0):
return '0.00'
string = str(number)
length = len(string)
if (len... | 2.6875 | 3 |
test/ofx_test_utils.py | myfreecomm/fixofx | 4 | 40783 | # Copyright 2005-2010 Wesabe, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 2.15625 | 2 |
src/python/doufo/convert.py | Hong-Xiang/doufo | 3 | 40784 | """doufo.convert
abstract class of `dataType` converters.
Example:
Todo:
Author:
"""
from .function import func
from functools import wraps, cmp_to_key
from multipledispatch import Dispatcher
from typing import Callable, TypeVar
__all__ = ['converters', 'convert_to', 'convert']
T = TypeVar('T')
B = TypeVa... | 2.984375 | 3 |
02_run_model.py | swenkel/traffic_counter | 0 | 40785 | <reponame>swenkel/traffic_counter<gh_stars>0
################################################################################
# #
# #
# (c) <NAME> ... | 1.65625 | 2 |
models/config/_utils.py | ZAurele/alpha-py | 0 | 40786 | import re, os, copy
PAREMETER_PATTERN = '{{%s}}'
def convert_value_for_environment(value: object) -> str:
if str(value).lower() == 'true': value = '1'
elif str(value).lower() == 'false': value = '0'
return str(value)
def set_environment_variables(environs:dict):
if environs:
for key, value in... | 2.59375 | 3 |
setup.py | coverosu/cmyui_pkg | 0 | 40787 | <gh_stars>0
import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name = 'cmyui',
version = '1.5.7',
author = 'cmyui',
author_email = '<EMAIL>',
description = 'Some generic tools I find myself using often (web, mysql/pg, logging, utils, etc).',
l... | 1.3125 | 1 |
AmygNet3D_indep.py | YilinLiu97/AmygNet-Pytorch | 3 | 40788 | <gh_stars>1-10
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import nibabel as nib
from Dataset import Crop
import torch.optim as optim
import math
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, dilation, do_act, if_drop, wrs_ratio_fc... | 1.859375 | 2 |
pytorch/5.1-introduction-to-convnets.py | Lornatang/Deep-learning-with-python3 | 4 | 40789 | <gh_stars>1-10
# Copyright 2019 Lorna Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 2.203125 | 2 |
fn_cisco_amp4ep/fn_cisco_amp4ep/components/fn_amp_get_events.py | nickpartner-goahead/resilient-community-apps | 65 | 40790 | # -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
""" Resilient functions component to run a Cisco AMP for endpoints query - get events """
# Set up:
# Destination: a Queue named "amp_get_events".
# Manual Action: Execute a REST q... | 2.671875 | 3 |
commitsan/repos.py | abusalimov/commitsan | 0 | 40791 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import os
import shutil
import sys
from commitsan.git import (REPOS_PATH, CalledProcessError,
git_cmd, git_revlist, mkdir_p)
from commitsan.worker import job
f... | 2.15625 | 2 |
src/indriya_msgs/python/physics_pb2.py | praveenv4k/Indriya | 1 | 40792 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: physics.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.protobuf import reflection as _refle... | 1.546875 | 2 |
src/tests/profile.py | royalstream/pythonnet | 1 | 40793 | """Run all of the unit tests for this package over and over,
in order to provide for better profiling."""
from __future__ import print_function
def main():
import sys, os, gc, time
dirname = os.path.split(__file__)
sys.path.append(dirname)
import runtests
gc.set_debug(gc.DEBUG_LEAK)
star... | 2.59375 | 3 |
Autocoders/Python/utils/NoseTests/src/Config.py | chrisdonlan/fprime | 5 | 40794 | import sys
from . import BuildConstants
class Config(object):
__instance = None
system = None
cCompiler = None
includes = None
libs = None
def __init__(self):
self.system = sys.platform
self.cCompiler = None
self.includes = None
self.libs = None
self.B... | 2.5 | 2 |
dataclasses/resources/examples/test_const_cache.py | hschwane/offline_production | 1 | 40795 | <filename>dataclasses/resources/examples/test_const_cache.py
#!/usr/bin/env python
# This is an example script that illustrates the problem in ticket #967
# http://code.icecube.wisc.edu/projects/icecube/ticket/967
#
# We only allow getting const objects from the frame to prevent exactly
# this problem. What, I think,... | 1.585938 | 2 |
src/mailer.py | jack139/takit | 2 | 40796 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import smtplib, os, time, sys, gc
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE, formatdate
from email import Encoders
from email.Header import Header... | 2.625 | 3 |
src/oci/database/models/stack_monitoring_config.py | pabs3/oci-python-sdk | 0 | 40797 | <reponame>pabs3/oci-python-sdk<filename>src/oci/database/models/stack_monitoring_config.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/... | 1.796875 | 2 |
src/pyqtschema/widgets/base.py | amsico/pyqtschema | 1 | 40798 | <reponame>amsico/pyqtschema
from functools import wraps
from typing import Tuple
from PyQt5.QtGui import QColor
from .signal import Signal
class StateProperty(property):
def setter(self, fset):
@wraps(fset)
def _setter(*args):
*head, value = args
if value is not None:
... | 2.234375 | 2 |
kili/queries/issue/queries.py | ASonay/kili-playground | 214 | 40799 | <gh_stars>100-1000
"""
Queries of issue queries
"""
def gql_issues(fragment):
"""
Return the GraphQL issues query
"""
return f'''
query ($where: IssueWhere!, $first: PageSize!, $skip: Int!) {{
data: issues(where: $where, first: $first, skip: $skip) {{
{fragment}
}}
}}
'''
GQL_ISSUES_COUNT = ... | 1.726563 | 2 |