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 |
|---|---|---|---|---|---|---|
sqlalchemist/models/definitions.py | pmav99/sqlalchemist | 7 | 20600 | import sqlalchemy as sa
from .meta import Base
class Person(Base):
__tablename__ = "person"
id = sa.Column(sa.Integer, primary_key=True)
name = sa.Column(sa.String)
date_of_birth = sa.Column(sa.Date)
height = sa.Column(sa.Integer)
weight = sa.Column(sa.Numeric)
__all__ = [
"Person",
]
| 2.703125 | 3 |
cifar_exps/metric/local_config.py | maestrojeong/Deep-Hash-Table-ICML18- | 70 | 20601 | import sys
sys.path.append("../../configs")
#../../configs
from path import EXP_PATH
import numpy as np
DECAY_PARAMS_DICT =\
{
'stair' :
{
128 :{
'a1': {'initial_lr' : 1e-5, 'decay_steps' : 50000, 'decay_rate' : 0.3},
'a2' : {'initial_lr' : 3e-4, 'decay_step... | 1.898438 | 2 |
POO punto 2/ManagerUsers.py | nan0te/Python-Algorithm-And-DataStructure | 0 | 20602 | <gh_stars>0
from Profesional import Profesional
from Particular import Particular
from Comercial import Comercial
class ManagerUsers:
userslist = []
def addProfesional(self, name, address, baja, area, titulo):
profesional = Profesional(name, address, baja, area, titulo)
self.userslist.a... | 2.890625 | 3 |
src/ggrc/models/mixins/with_action.py | MikalaiMikalalai/ggrc-core | 1 | 20603 | # Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Contains WithAction mixin.
A mixin for processing actions on an object in the scope of put request .
"""
from collections import namedtuple, defaultdict
import werkzeug.exceptions as wzg_exceptions
fro... | 1.703125 | 2 |
tests/__init__.py | Fokko/example-library-python | 0 | 20604 | <gh_stars>0
import sys, os
path = os.path.dirname(__file__)
if path not in sys.path:
sys.path.append(path)
| 1.875 | 2 |
GAN_discriminator.py | SEE-MOF/Generation_of_atmospheric_cloud_fields_using_GANs | 0 | 20605 | import torch
class GAN_discriminator (torch.nn.Module):
def __init__(self, H):
#for GAN
# H=[5, 256, 128, 128, 5, 1, 64, 128, 256, 256, 4096, 1]
#for CGAN
# H =[8, 256, 128, 64, 8, 9, 64, 128, 256, 256, 4096, 1]
super(GAN_discriminator, self).__init__()
#region
... | 2.328125 | 2 |
statuspage_io.py | spyder007/pi-monitoring | 0 | 20606 | <reponame>spyder007/pi-monitoring
import logging
import statuspage_io_client
import configuration
from enums import OpLevel
logger = logging.getLogger(__name__)
class Incident:
"""Incident Class
This class represents the details about a Statuspage.io incident
Attributes:
name: The incident name... | 2.765625 | 3 |
tests/test_gpath.py | ConductorTechnologies/ciopath | 1 | 20607 | """ test gpath
isort:skip_file
"""
import os
import sys
import unittest
try:
from unittest import mock
except ImportError:
import mock
SRC = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "src")
if SRC not in sys.path:
sys.path.insert(0, SRC)
from ciopath.gpath import Pat... | 2.640625 | 3 |
linter.py | KidkArolis/SublimeLinter-contrib-healthier | 0 | 20608 | <gh_stars>0
"""This module exports the Healthier plugin class."""
import json
import logging
import re
import shlex
from SublimeLinter.lint import NodeLinter
logger = logging.getLogger('SublimeLinter.plugin.healthier')
class Healthier(NodeLinter):
"""Provides an interface to the healthier executable."""
# i... | 2.390625 | 2 |
model_compression_toolkit/gptq/pytorch/quantization_facade.py | ofirgo/model_optimization | 42 | 20609 | # Copyright 2022 Sony Semiconductors Israel, Inc. 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 b... | 1.210938 | 1 |
transformer/dataset/graph.py | tmpaul06/dgl | 1 | 20610 | import dgl
import torch as th
import numpy as np
import itertools
import time
from collections import *
Graph = namedtuple('Graph',
['g', 'src', 'tgt', 'tgt_y', 'nids', 'eids', 'nid_arr', 'n_nodes', 'n_edges', 'n_tokens', 'layer_eids'])
# We need to create new graph pools for relative position atte... | 2.359375 | 2 |
tests/asgi/test_configuration.py | mrmilu/ariadne | 1 | 20611 | # pylint: disable=not-context-manager
from unittest.mock import ANY, Mock
from starlette.testclient import TestClient
from ariadne.asgi import (
GQL_CONNECTION_ACK,
GQL_CONNECTION_INIT,
GQL_DATA,
GQL_ERROR,
GQL_START,
GraphQL,
)
from ariadne.types import Extension
def test_custom_context_val... | 2.21875 | 2 |
OpenAI-Gym/agents/ddpg.py | stmobo/Machine-Learning | 2 | 20612 | import tensorflow as tf
import prettytensor as pt
import numpy as np
import gym
import math
import random
from collections import deque
from agents import mixed_network, spaces, replay_buffer
tensorType = tf.float32
"""
Implements a Deep Deterministic Policy Gradient agent.
Adjustable parameters:
- Actor / Critic ... | 2.625 | 3 |
tests/unit/test_door.py | buxx/rolling | 14 | 20613 | from aiohttp.test_utils import TestClient
import pytest
import typing
import unittest.mock
from rolling.kernel import Kernel
from rolling.model.character import CharacterModel
from rolling.model.character import MINIMUM_BEFORE_EXHAUSTED
from rolling.server.document.affinity import AffinityDirectionType
from rolling.se... | 1.875 | 2 |
myWeather2_github.py | RCElectronic/weatherlight | 0 | 20614 | # myWeather.py for inkyphat and RPiZW
print('Starting')
try:
import requests
print('requests module imported')
except:
print('Sorry, need to install requests module')
exit()
wx_url = 'api.openweathermap.org/data/2.5/weather?'
wx_city = 'q=Quispamsis,CA&units=metric'
wx_cityID = 'id=6115383&... | 3.1875 | 3 |
push-to-gee.py | Servir-Mekong/sentinel-1-pipeline | 16 | 20615 | <filename>push-to-gee.py
# -*- coding: utf-8 -*-
from dotenv import load_dotenv
load_dotenv('.env')
import logging
logging.basicConfig(filename='logs/push-2-gee.log', level=logging.INFO)
import ast
import glob
import json
import os
import subprocess
from datetime import datetime
from dbio import *
scale_factor = 1... | 2.015625 | 2 |
rabbitai/tasks/celery_app.py | psbsgic/rabbitai | 0 | 20616 | <filename>rabbitai/tasks/celery_app.py<gh_stars>0
"""
This is the main entrypoint used by Celery workers. As such,
it needs to call create_app() in order to initialize things properly
"""
from typing import Any
from celery.signals import worker_process_init
# Rabbitai framework imports
from rabbitai import create_app... | 2.078125 | 2 |
adapters/adapter.py | ChristfriedBalizou/jeamsql | 0 | 20617 | <filename>adapters/adapter.py
from tabulate.tabulate import tabulate
import subprocess
import sys
import os
import re
import csv
import io
import json
class Adapter(object):
def __init__(self,
server=None,
port=None,
user=None,
connection_cmd=None,
cmd... | 3.03125 | 3 |
MyCrypto/dsa/sm2_dsa.py | hiyouga/cryptography-experiment | 8 | 20618 | <reponame>hiyouga/cryptography-experiment<filename>MyCrypto/dsa/sm2_dsa.py
import sys
sys.path.append("../..")
import random
from MyCrypto.utils.bitarray import bitarray
from MyCrypto.algorithms.exgcd import inverse
from MyCrypto.ecc.sm2 import SM2
class SM2_DSA(SM2):
def __init__(self):
super().__ini... | 2.953125 | 3 |
chatbot/component/__init__.py | zgj0607/ChatBot | 0 | 20619 | __all__ = (
'readonly_admin',
'singleton'
)
| 1.148438 | 1 |
calculadora.py | LucasCouto22/calculadoraPython | 0 | 20620 | def somar(x, y):
if x and y >= 0:
x = x + y
return(x)
def subtrair(x, y):
if x and y >= 0:
x = x - y
return(x)
def multiplicar(x, y):
if x and y >= 0:
x = x * y
return(x)
def dividirInteiro(x, y):
if x and y >= 0:
x = x / y
return(x)
def dividir(x, y):... | 3.96875 | 4 |
prime_issue_spoilage/main.py | NicholasSynovic/ssl-metrics-github-issue-spoilage | 0 | 20621 | <gh_stars>0
from argparse import Namespace
from datetime import datetime
import pandas
from dateutil.parser import parse as dateParse
from intervaltree import IntervalTree
from pandas import DataFrame
from prime_issue_spoilage.utils.primeIssueSpoilageArgs import mainArgs
def getIssueTimelineIntervals(day0: datetime... | 2.96875 | 3 |
IFR/mmseg/datasets/pipelines/semi/loading.py | jfzhuang/IFR | 3 | 20622 | <reponame>jfzhuang/IFR
import os.path as osp
import mmcv
import numpy as np
from mmseg.datasets.builder import PIPELINES
@PIPELINES.register_module()
class LoadImageFromFile_Semi(object):
def __init__(
self, to_float32=False, color_type='color', file_client_args=dict(backend='disk'), imdecode_backend='c... | 2.140625 | 2 |
topologies/dc_t1.py | andriymoroz/sai-challenger | 11 | 20623 | from contextlib import contextmanager
import pytest
from sai import SaiObjType
@contextmanager
def config(npu):
topo_cfg = {
"lo_rif_oid": None,
"cpu_port_oid": None,
}
# Create Loopback RIF
lo_rif_oid = npu.create(SaiObjType.ROUTER_INTERFACE,
[
... | 2.0625 | 2 |
asynchronous_qiwi/models/QIWIWallet/master_m/list_qvc.py | LexLuthorReal/asynchronous_qiwi | 3 | 20624 | <reponame>LexLuthorReal/asynchronous_qiwi<filename>asynchronous_qiwi/models/QIWIWallet/master_m/list_qvc.py
from loguru import logger
import datetime
from pydantic.fields import ModelField
from typing import Optional, List, Union, Any
from ....utils.tools.str_datetime import convert
from pydantic import BaseModel, Fiel... | 1.796875 | 2 |
src/mciso/visualize.py | lancechua/mciso | 2 | 20625 | <reponame>lancechua/mciso<gh_stars>1-10
import matplotlib.pyplot as plt
import pandas as pd
def scenarios_by_product(
X: "np.ndarray", indices: list, products: list, ax: plt.Axes = None
) -> plt.Axes:
"""Plot generated scenarios, with a subplot for each product"""
if ax is None:
_, ax = plt.subplo... | 2.765625 | 3 |
sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 1 | 20626 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 1.898438 | 2 |
lcd_rom_small.py | rhubarbdog/microbit-LCD-driver | 2 | 20627 | from microbit import *
import microbit_i2c_lcd as lcd
i2c.init(sda=pin15,scl=pin13)
display = lcd.lcd(i2c)
display.lcd_display_string(str(chr(247)), 1)
print("this will display a pi symbol for ROM A00 japaneese\n"+\
"display a divide symbol for the A02 ROM european")
i2c.init(sda=pin20,scl=pin19)
| 3.03125 | 3 |
benchmarks/benchmarks.py | alanefl/vdf-competition | 97 | 20628 | import time
import textwrap
import math
import binascii
from inkfish.create_discriminant import create_discriminant
from inkfish.classgroup import ClassGroup
from inkfish.iterate_squarings import iterate_squarings
from inkfish import proof_wesolowski
from inkfish.proof_of_time import (create_proof_of_time_nwesolowski,... | 2.59375 | 3 |
ccl_dask_blizzard.py | michaelleerilee/CCL-M2BLIZZARD | 0 | 20629 | <filename>ccl_dask_blizzard.py
import numpy as np
from load_for_ccl_inputs import load_for_ccl_inputs
from ccl_marker_stack import ccl_dask
base = '/home/mrilee/nobackup/tmp/others/'
fnames = None
if False:
fnames = ['ccl-inputs-globe-122736+23.csv.gz']
if False:
fnames = ['ccl-inputs-glob... | 2.015625 | 2 |
setup.py | RiS3-Lab/polytracker | 0 | 20630 | import os
import re
import sys
from setuptools import setup, find_packages
from typing import Optional, Tuple
SETUP_DIR = os.path.dirname(os.path.realpath(__file__))
POLYTRACKER_HEADER = os.path.join(SETUP_DIR, 'polytracker', 'include', 'polytracker', 'polytracker.h')
if not os.path.exists(POLYTRACKER_HEADER):
sy... | 2.03125 | 2 |
Game22/modules/online/__init__.py | ttkaixin1998/pikachupythongames | 4,013 | 20631 | '''初始化'''
from .server import gobangSever
from .client import gobangClient
from .playOnline import playOnlineUI | 0.871094 | 1 |
gazette_processor/gazette.py | GabrielTrettel/DiariesProcessor | 2 | 20632 | import os,sys, re
from math import ceil, floor
class Gazette:
"""
Loads and parses municipal gazettes.
Attributes:
file_path: The string path to a gazette.
file: The string containing a gazette's content.
city: A string for the city (or cities) of the gazette.
date: A st... | 3.59375 | 4 |
homepairs/HomepairsApp/Apps/Tenants/migrations/0001_initial.py | YellowRainBoots/2.0 | 1 | 20633 | # Generated by Django 3.0.2 on 2020-03-03 21:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('PropertyManagers', '0001_initial'),
('Properties', '0001_initial'),
]
operations = [
... | 1.828125 | 2 |
edk2toolext/image_validation.py | cfernald/edk2-pytool-extensions | 0 | 20634 | <reponame>cfernald/edk2-pytool-extensions<gh_stars>0
# @file image_validation.py
# This tool allows a user validate an PE/COFF file
# against specific requirements
##
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from datetime import datetime
import os
from pefile import PE,... | 2.328125 | 2 |
src/basics/files/delete_fichero.py | FoxNeo/MyPythonProjects | 0 | 20635 | import os
os.remove("fichero_generado.txt") | 1.25 | 1 |
Canon-M10.py | emanuelelaface/Canon-M10 | 3 | 20636 | # -*- coding: utf-8 -*-
from remi.gui import *
from remi import start, App
import cv2
import numpy
import chdkptp
import time
import threading
import rawpy
class OpenCVVideoWidget(Image):
def __init__(self, **kwargs):
super(OpenCVVideoWidget, self).__init__("/%s/get_image_data" % id(self), **kwargs)
... | 2.625 | 3 |
server/utils/exception/exception.py | mnichangxin/blog-server | 0 | 20637 | <filename>server/utils/exception/exception.py
from werkzeug.exceptions import HTTPException
class APIException(HTTPException):
def __init__(self, msg='客户端错误', code=400, err_code=900, headers=None):
self.msg = msg
self.code = code
self.err_code = err_code
super(APIException, self).__... | 2.765625 | 3 |
backend/fetch_tweet.py | phuens/Tweet_Analysis | 0 | 20638 | import json
import csv
import tweepy
from textblob import TextBlob
import nltk
from nltk.tokenize import word_tokenize
def search_for_hashtags(consumer_key, consumer_secret, access_token, access_token_secret, hashtag_phrase):
# create authentication for accessing Twitter
auth = tweepy.OAuthHandler(consumer_ke... | 3.375 | 3 |
umich_daily.py | mpars0ns/scansio-sonar-es | 36 | 20639 | <gh_stars>10-100
import argparse
import sys
from multiprocessing import cpu_count, Process, Queue
import json
import logging
from datetime import datetime
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk, scan
import hashlib
from helpers.certparser import process_cert
from helpers.hostpa... | 2.296875 | 2 |
project/tests/scripts/system_vars.py | LeDron12/c2eo | 12 | 20640 | <gh_stars>10-100
integer = [
['lld', 'long long', 9223372036854775807, -9223372036854775808],
['ld', 'long', 9223372036854775807, -9223372036854775808],
['lu', 'unsigned long', 18446744073709551615, 0],
['d', 'signed', 2147483647, -2147483648],
['u', 'unsigned', 4294967295, 0],
['hd', 'short', 3... | 1.851563 | 2 |
isaactest/tests/recieve_verify_emails.py | jsharkey13/isaac-selenium-testing | 0 | 20641 | <filename>isaactest/tests/recieve_verify_emails.py
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.i_selenium import assert_tab, image_div
from ..tests import TestWithDependency
__all__ = ["recieve_verify_emails"]
#####
# Test : Recieve Verification Emails
#####
@TestWithDependency("RECIEVE_VERIFY_EMAILS... | 2.515625 | 3 |
setup.py | msabramo/grr | 0 | 20642 | #!/usr/bin/env python3
from setuptools import setup
import sys
setup(
name='grr',
version='0.2',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/legoktm/grr/',
license='CC-0',
description='A command-line utility to work with Gerrit',
long_description=open('README.rst').... | 1.492188 | 1 |
runtime/server/x86_gpu/model_repo_stateful/wenet/1/wenet_onnx_model.py | zelda3721/wenet | 0 | 20643 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 1.898438 | 2 |
stuojchaques.py | sunlupeng2020/stuoj | 0 | 20644 | # 获取学生所有的挑战题目信息
# 包括时间、结果、代码等
# 写入数据库stuoj的stuquestionbh表中
from selenium import webdriver
# from selenium.webdriver.common.by import By
import pymysql
import re
from bs4 import BeautifulSoup
import connsql
# import loginzznuoj
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support impo... | 2.796875 | 3 |
tests/test_core.py | TheCheapestPixels/panda3d-stageflow | 3 | 20645 | <reponame>TheCheapestPixels/panda3d-stageflow<filename>tests/test_core.py
from stageflow import Flow
from stageflow import Stage
def test_create_stage():
Stage()
def test_create_flow_bare():
flow = Flow()
assert flow.get_current_stage() is None
assert set(flow.get_stages()) == set([])
def test_cr... | 2.359375 | 2 |
Yukki/__main__.py | nezukorobot/YUUKI | 0 | 20646 | import asyncio
import time
import uvloop
import importlib
from pyrogram import Client as Bot, idle
from .config import API_ID, API_HASH, BOT_TOKEN, MONGO_DB_URI, SUDO_USERS, LOG_GROUP_ID
from Yukki import BOT_NAME, ASSNAME, app, chacha, aiohttpsession
from Yukki.YukkiUtilities.database.functions import clean_restart_st... | 2.09375 | 2 |
loopchain/blockchain/transactions/transaction_builder.py | metalg0su/loopchain | 0 | 20647 | import hashlib
from abc import abstractmethod, ABC
from typing import TYPE_CHECKING
from .. import Signature, ExternalAddress, Hash32
from loopchain.crypto.hashing import build_hash_generator
if TYPE_CHECKING:
from secp256k1 import PrivateKey
from . import Transaction, TransactionVersioner
class Transaction... | 2.5 | 2 |
PyBank/main.py | yongjinjiang/python-challenge | 0 | 20648 | import csv
import os
resource_dir="/Users/jyj/OneDrive/A_A_Data_Analysis/MINSTP201808DATA2/03-Python/Homework/PyBank/Resources"
file_path=os.path.join(resource_dir,"budget_data.csv")
with open(file_path,newline="") as data_file:
csvreader=csv.reader(data_file,delimiter=",")
next(csvreader)
i=0
Nu... | 3.75 | 4 |
demo.py | sshopov/pyconau2017 | 21 | 20649 | <reponame>sshopov/pyconau2017
#!/usr/bin/env python3
'''
Source name: demo.py
Author(s): <NAME>
Python Version: 3.* 32-bit or 64-bit
License: LGPL
Description:
This program was demoed on EV3D4 at PyCon Australia 2017.
It kicks off 2 threads a move thread and a feel thread.
The move thread dr... | 2.484375 | 2 |
Game/story.py | starc52/GDE-Project | 0 | 20650 |
from Game.player import Player
from pygame import *
from Game.const import *
class Story:
""" Story line class """
def __init__(self, message, treasure, player, screen, fade, maps, sound):
self.screen = screen
self.message = message
self.treasure = treasure
self.player = player
self.fade = fade
se... | 3.375 | 3 |
utilities/tag-bumper.py | stackrox/collector | 1 | 20651 | <filename>utilities/tag-bumper.py
#! /usr/bin/env python3
from sh import git, ErrorReturnCode
import argparse
import sys
import os
import atexit
import re
def exit_handler(repo):
"""
Rollback the repo to the branch passed as an argument.
Parameters:
repo: An sh.Command baked for git on the worki... | 2.921875 | 3 |
openshift/helper/openshift.py | flaper87/openshift-restclient-python | 0 | 20652 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
from kubernetes.client import models as k8s_models
from kubernetes.client import apis as k8s_apis
from kubernetes.client.rest import ApiException
from urllib3.exceptions import MaxRetryError
from . import VERSION_RX
from .. import config
from... | 2.09375 | 2 |
tests/__init__.py | jsta/nhdpy | 0 | 20653 | <filename>tests/__init__.py
"""Unit test package for nhdpy."""
| 1.101563 | 1 |
ltcl/modules/lvae_nonlinear.py | anonymous-authors-iclr2022-481/ltcl | 8 | 20654 | """Temporal VAE with gaussian margial and laplacian transition prior"""
import torch
import numpy as np
import ipdb as pdb
import torch.nn as nn
import pytorch_lightning as pl
import torch.distributions as D
from torch.nn import functional as F
from .components.beta import BetaVAE_MLP
from .metrics.correla... | 1.859375 | 2 |
cargame/camera.py | jocelynthiojaya/Self-Learning-Cars | 0 | 20655 | <filename>cargame/camera.py
import arcade
from cargame.globals import conf
from cargame import util
# This math is for getting the ratio from zoom. I honestly
# don't know what it is called, i just constructed it by hand
# Long form is 1 - (x - 1) / 2
zoom_multiplexer = lambda x : (3 - x)/2
# TODO: Implement anchor
c... | 3.46875 | 3 |
configs/tsmnet/tsmnet_r50-d1_769x769_40k_cityscapes_video.py | labdeeman7/TRDP_temporal_stability_semantic_segmentation | 0 | 20656 | <gh_stars>0
_base_ = [
'../_base_/models/tsm_r50-d8.py', '../_base_/datasets/cityscapes_769x769.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
] | 0.820313 | 1 |
abc/104/c_retry2.py | 515hikaru/solutions | 0 | 20657 | <reponame>515hikaru/solutions
from itertools import combinations
def exclude_combi_idx(combis, scores):
a = [score[1] for score in combis]
v = []
for score in scores:
if score[1] in a:
continue
v.append(score)
return v
def set_all_solve(combi):
current = 0
num = 0
... | 2.703125 | 3 |
merlin/celery.py | robinson96/merlin | 0 | 20658 | ###############################################################################
# Copyright (c) 2019, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory
# Written by the Merlin dev team, listed in the CONTRIBUTORS file.
# <<EMAIL>>
#
# LLNL-CODE-797170
# All rights reser... | 1.257813 | 1 |
webapi/apps/web/management/mockup.py | NovaSBE-DSKC/retention-evaluation | 0 | 20659 | <reponame>NovaSBE-DSKC/retention-evaluation<gh_stars>0
import random
import pandas as pd
import json
def get_random_name():
names = ["Miguel", "Susana", " Pedro", "Mateus", "Ângelo", "Beatriz", "Ana", " Maria", "Carlos", "José"]
return names[random.randint(0, len(names) - 1)]
def add_random_names(data):
... | 3.234375 | 3 |
migrations/versions/e91e2508f055_.py | ifat-mohit/flask-microblog | 1 | 20660 | <filename>migrations/versions/e91e2508f055_.py
"""empty message
Revision ID: e91e2508f055
Revises: <PASSWORD>
Create Date: 2019-11-04 22:59:00.701304
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e91e2508f055'
down_revision = '<PASSWORD>'
branch_labels = Non... | 1.617188 | 2 |
cli/cli_cloudformation.py | reneses/cloud-cli | 0 | 20661 | <gh_stars>0
from menu import Menu, MenuEntry
from logic.cloudformation import CloudFormation
class CloudFormationCli:
"""
Menu for the AWS CloudFormation operations
"""
def __init__(self):
"""
Run the menu
"""
# Init the logic handler
self.cloudformation = Clou... | 2.515625 | 3 |
bot/models/__init__.py | masterbpro/radio-archive | 0 | 20662 | from datetime import datetime, timedelta
from peewee import SqliteDatabase, Model, PrimaryKeyField, IntegerField, CharField, BooleanField, DateTimeField
from bot.data.config import STATIC_DIR
from bot.utils.logging import logger
db = SqliteDatabase(f"{STATIC_DIR}/db.sqlite3")
class User(Model):
"""
Клас оп... | 2.84375 | 3 |
TrainingExtensions/tensorflow/src/python/aimet_tensorflow/utils/op/fusedbatchnorm.py | quic-ykota/aimet | 945 | 20663 | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019-2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | 1.070313 | 1 |
flaskex.py | DesuDeluxe/simple_rest_api | 0 | 20664 | import os
from flask import Flask, Response, render_template, redirect
from flask_restful import reqparse,request, abort, Api, Resource, fields, marshal_with
from flask_sqlalchemy import SQLAlchemy
import sqlite3
app = Flask(__name__)
p_dir = os.path.dirname(os.path.abspath(__file__))
db_file = "sqlite:///{}".forma... | 2.515625 | 3 |
backend/server/device_legacy/routes.py | kristof-g/TempHum-Supervisor-Sys | 0 | 20665 | import sys
import os
import json
import csv
from time import strftime
from datetime import timedelta, date, datetime
from flask import Blueprint, render_template, redirect, request, url_for, flash
import server.configuration as cfg
from server.postalservice import checkTemp
from server.helpers import LoginRequired, p... | 2.234375 | 2 |
gdsfactory/components/resistance_sheet.py | simbilod/gdsfactory | 0 | 20666 | from functools import partial
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.components.compass import compass
from gdsfactory.components.via_stack import via_stack_slab_npp_m3
from gdsfactory.types import ComponentSpec, Floats, LayerSpecs, Optional
pad_via_stack_slab_npp ... | 2.4375 | 2 |
cogdl/trainers/sampled_trainer.py | zhangdan0602/cogdl | 0 | 20667 | <reponame>zhangdan0602/cogdl
from abc import abstractmethod
import argparse
import copy
import numpy as np
import torch
from tqdm import tqdm
from cogdl.data import Dataset
from cogdl.data.sampler import (
SAINTSampler,
NeighborSampler,
ClusteredLoader,
)
from cogdl.models.supervised_model import Supervis... | 2.109375 | 2 |
sample-input/sph-factors/pin-cell/sph-factors.py | AI-Pranto/OpenMOC | 97 | 20668 | import openmoc
import openmc.openmoc_compatible
import openmc.mgxs
import numpy as np
import matplotlib
# Enable Matplotib to work for headless nodes
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.ioff()
opts = openmoc.options.Options()
openmoc.log.set_log_level('NORMAL')
##############################... | 1.96875 | 2 |
VerifyServer.py | ACueva/Avi-Playground | 0 | 20669 | <reponame>ACueva/Avi-Playground
#!/usr/bin/env python
import os
import urllib2, json
from urlparse import urlparse
def ParseURL(agsURL):
ags = []
print agsURL
ags = urlparse(agsURL)
return ags
def GetFolders(agsURL):
f = urllib2.urlopen(agsURL)
j = json.loads(f.read())
for item in j["folde... | 3.09375 | 3 |
data_io/export_camera_poses.py | tumcms/aerial2pdsm | 0 | 20670 | <gh_stars>0
import plyfile
from config import SparseModel, project_path
from colmap_scripts.read_model import Image
import numpy as np
project = SparseModel("/home/felix/pointclouds/_working/2019_11_07_Muenchen_26_10_2018",
model_path="/home/felix/pointclouds/_working/2019_11_07_Muenchen_26_10_2... | 2.296875 | 2 |
openpype/hosts/blender/plugins/publish/extract_blend_animation.py | jonclothcat/OpenPype | 1 | 20671 | <reponame>jonclothcat/OpenPype<filename>openpype/hosts/blender/plugins/publish/extract_blend_animation.py
import os
import bpy
import openpype.api
class ExtractBlendAnimation(openpype.api.Extractor):
"""Extract a blend file."""
label = "Extract Blend"
hosts = ["blender"]
families = ["animation"]
... | 2.3125 | 2 |
src/TamaTou.py | hirmiura/starsector-mod-Font_Replacement_for_Orbitron | 1 | 20672 | # SPDX-License-Identifier: MIT
# Copyright 2022 hirmiura (https://github.com/hirmiura)
#
# TamaTouを生成するスクリプト
#
# 使い方
# 1. fontforgeでコンソールを出す(fontforge-console.bat)
# 2. ディレクトリ移動
# 3. ffpython TamaTou.py
# 4. 待つ
#
# Orbitron → オービトロン → オーブ → 玉 → Tamaやな!
# Noto → No Toufu → 豆腐だらけだし → Touやな!
# →→ TamaTou
#
import font... | 2.15625 | 2 |
bambu/bambu.py | westurner/pandasrdf | 2 | 20673 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
bambu
------
pandas RDF functionality
Installation
--------------
::
# pip install pandas
pip install rdflib
"""
import sys
import pandas as pd
import rdflib
def bambu():
"""
mainfunc
"""
pass
def to... | 2.65625 | 3 |
homework1/problem3/local/mort_icu.py | criticaldata/hst953-2021 | 1 | 20674 | <gh_stars>1-10
# Generates the following data files from MIMIC:
# adult_icu.gz: data from adult ICUs
# n_icu.gz: data from neonatal ICUs
# adult_notes.gz: clinical notes from adult ICUs
# Import libraries
import numpy as np
import pandas as pd
import psycopg2
from scipy.stats import ks_2samp
import os
import random
... | 2.703125 | 3 |
release/alert.py | 77loopin/ray | 21,382 | 20675 | <filename>release/alert.py<gh_stars>1000+
import argparse
from collections import defaultdict, Counter
from typing import Any, List, Tuple, Mapping, Optional
import datetime
import hashlib
import json
import logging
import os
import requests
import sys
import boto3
from e2e import GLOBAL_CONFIG
from alerts.default i... | 2.046875 | 2 |
bios-token.py | emahear/openusm | 4 | 20676 | import os
import argparse
def _create_parser():
parser = argparse.ArgumentParser(description='Welcome to Universal Systems Manager'
'Bios Token Change')
parser.add_argument('--verbose',
help='Turn on verbose logging',
... | 2.546875 | 3 |
Examples/user_data/sharptrack.py | FedeClaudi/brainrender | 0 | 20677 | import brainrender
brainrender.SHADER_STYLE = 'cartoon'
from brainrender.scene import Scene
sharptrack_file = 'Examples/example_files/sharptrack_probe_points.mat'
scene = Scene(use_default_key_bindings=True)
scene.add_brain_regions('TH', alpha=.2, wireframe=True)
scene.add_probe_from_sharptrack(sharptrack_file)
s... | 1.804688 | 2 |
homeassistant/components/metoffice/sensor.py | basicpail/core | 7 | 20678 | <gh_stars>1-10
"""Support for UK Met Office weather service."""
from __future__ import annotations
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.const import (
ATTR_ATTRIBUTION,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
LENGTH_KILOMETERS,
... | 1.8125 | 2 |
examples/advanced.py | ajrichardson/formlayout | 0 | 20679 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright © 2009 <NAME>
# Licensed under the terms of the MIT License
# (see formlayout.py for details)
"""
Simple formlayout example
Please take a look at formlayout.py for more examples
(at the end of the script, after the 'if __name__ == "__main__":' line)
"""
import dateti... | 2.6875 | 3 |
PyBank/main.py | jackaloppy/python-challenge | 0 | 20680 | # Import Modules
import os
import csv
# Set the path
filepath = os.path.join("Resources","budget_data.csv")
# Open the CSV file
with open(filepath) as csvfile:
csvreader = csv.reader(csvfile, delimiter=",")
# Skip the header row
next(csvreader)
# Set up some numbers
month = 0
total = 0
max... | 3.859375 | 4 |
odoo-13.0/addons/web/models/ir_http.py | VaibhavBhujade/Blockchain-ERP-interoperability | 12 | 20681 | <reponame>VaibhavBhujade/Blockchain-ERP-interoperability
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import hashlib
import json
from odoo import api, models
from odoo.http import request
from odoo.tools import ustr
from odoo.addons.web.controllers.main import mod... | 1.921875 | 2 |
anonymize-attributes.py | thormeier-fhnw-repos/sna-holaspirit-to-gephi | 2 | 20682 | #!/usr/bin/python
import sys
import argparse
sys.path.append('./')
from src.utils.list_to_dict import list_to_dict
from src.utils.read_csv import read_csv
from src.utils.map_to_list_csv import map_to_list_csv
from src.gephi.write_csv import write_csv
print("")
print("-----------------------------")
print("Anonymiz... | 3.234375 | 3 |
custom_laboratory/custom_laboratory/doctype/vaccination/vaccination.py | panhavad/custom_laboratory | 0 | 20683 | <reponame>panhavad/custom_laboratory<filename>custom_laboratory/custom_laboratory/doctype/vaccination/vaccination.py
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from fr... | 2.046875 | 2 |
FinalRound_ImprovedAccuracy_Functionality/training/utils/detectingCARColor.py | tejasmagia/DetectCarParkingSlot_Contest | 9 | 20684 | from sklearn.cluster import KMeans
import cv2
import PIL
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from matplotlib import image as img1
import pandas as pd
from scipy.cluster.vq import whiten
import os
class DominantColors:
CLUSTERS = None
IMAGEPATH = None
I... | 2.984375 | 3 |
cash/settings/product.py | anshengme/cash | 18 | 20685 | <reponame>anshengme/cash<filename>cash/settings/product.py
from .base import *
DEBUG = False
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', SECRET_KEY)
| 1.125 | 1 |
seqpos/lib/python2.7/site-packages/mercurial/lsprofcalltree.py | guanjue/seqpos | 0 | 20686 | <reponame>guanjue/seqpos<filename>seqpos/lib/python2.7/site-packages/mercurial/lsprofcalltree.py
"""
lsprofcalltree.py - lsprof output which is readable by kcachegrind
Authors:
* <NAME> <david <at> allouche.net>
* <NAME> & <NAME>
* <NAME>
This software may be used and distributed according to the terms
of... | 2.21875 | 2 |
nats/aio/errors.py | sr34/asyncio-nats | 0 | 20687 | # Copyright 2016-2018 The NATS Authors
# 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 writi... | 2.078125 | 2 |
sqlite/app/elephant_queries.py | CurdtMillion/DS-Unit-3-Sprint-2-SQL-and-Databases | 0 | 20688 | <reponame>CurdtMillion/DS-Unit-3-Sprint-2-SQL-and-Databases<filename>sqlite/app/elephant_queries.py
import os
import psycopg2
import sqlite3
from psycopg2.extras import DictCursor
from dotenv import load_dotenv
DB_FILEPATH = os.path.join(os.path.dirname(__file__), "..", "data", "rpg.db")
connection = sqlite3.connect(D... | 3.015625 | 3 |
models/EmbracementLayer.py | gcunhase/EmbraceBERT | 7 | 20689 | import torch
from torch import nn
import numpy as np
from models.AttentionLayer import AttentionLayer
from models.SelfAttentionLayer import SelfAttention, SelfAttentionPytorch,\
BertSelfAttentionScores, BertSelfAttentionScoresP, BertMultiSelfAttentionScoresP,\
BertMultiAttentionScoresP, BertAttentionClsQuery
fr... | 2.625 | 3 |
tests/test_csv2bufr.py | tomkralidis/CSV2BUFR | 0 | 20690 | ###############################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this fi... | 1.617188 | 2 |
map_methods_to_mach_ports/parseXcodeLogs.py | malus-security/kobold | 3 | 20691 | #Input
#Xcode logs output by autogenerated method invocations
#Requirements
#Infer which invocation numbers failed/succeeded
#Infer apparent entitlement requirements based on error message from completion handlers
#Detect which invocation numbers should have had completion handlers
#Map new information to mach-port a... | 2.625 | 3 |
inferelator_ng/tests/test_design_response.py | asistradition/inferelator_ng | 1 | 20692 | <reponame>asistradition/inferelator_ng
import unittest, os
import pandas as pd
import numpy as np
import pdb
from .. import design_response_translation
from .. import utils
my_dir = os.path.dirname(__file__)
class TestDR(unittest.TestCase):
"""
Superclass for common methods
"""
def calculate_design_an... | 2.21875 | 2 |
flights/urls.py | olubiyiontheweb/travelworld | 0 | 20693 | from django.urls import path
from flights import views
urlpatterns = [path("", views.index)]
| 1.4375 | 1 |
invenio_app_ils/ill/loaders/jsonschemas/borrowing_request.py | equadon/invenio-app-ils | 0 | 20694 | <reponame>equadon/invenio-app-ils
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019-2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""BorrowingRequest schema for marshmallow loader."""
from invenio_records... | 1.820313 | 2 |
systemtest/users/apps.py | IBM-Power-SystemTest/systemtest | 1 | 20695 | """
Users app config
References:
https://docs.djangoproject.com/en/3.1/ref/applications/
"""
from django.apps import AppConfig
class UsersConfig(AppConfig):
name = "systemtest.users"
verbose_name = "Users"
def ready(self):
try:
import systemtest.users.signals # noqa F401... | 1.539063 | 2 |
setup.py | grigi/configy | 3 | 20696 | import sys
from setuptools import setup, find_packages
def get_version(fname):
import re
verstrline = open(fname, "rt").read()
mo = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", verstrline, re.M)
if mo:
return mo.group(1)
else:
raise RuntimeError("Unable to find version string in... | 1.859375 | 2 |
opentelemetry-sdk/tests/trace/export/test_in_memory_span_exporter.py | vmihailenco/opentelemetry-python | 2 | 20697 | <reponame>vmihailenco/opentelemetry-python
# Copyright The OpenTelemetry Authors
#
# 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 ... | 2.1875 | 2 |
lib/acli/commands/ec2.py | jonhadfield/acli | 9 | 20698 | # -*- coding: utf-8 -*-
"""Usage:
acli ec2 (ls | list | summary) [options] [--region=<region>]
acli ec2 (start | stop | reboot | terminate | info | cpu | vols | net) <instance_id> [options]
-f, --filter=<term> filter results by term
-s, --start=<start_date> metrics start-date
-e,... | 2.09375 | 2 |
pharedox/gui/gui.py | omarvaneer/pharynx_redox | 2 | 20699 | <reponame>omarvaneer/pharynx_redox<filename>pharedox/gui/gui.py
"""
A Basic GUI based on napari
"""
import logging
import multiprocessing as mp
import sys
from multiprocessing import Process
from pathlib import Path
from typing import Optional
import matplotlib
import napari
import numpy as np
import xarray as xr
from... | 2.109375 | 2 |