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 |
|---|---|---|---|---|---|---|
appdaemon/apps/common/common.py | Mithras/ha | 3 | 17100 | <gh_stars>1-10
import hassapi as hass
import csv
from collections import namedtuple
Profile = namedtuple(
"Profile", ["profile", "x_color", "y_color", "brightness"])
with open("/config/light_profiles.csv") as profiles_file:
profiles_reader = csv.reader(profiles_file)
next(profiles_reader)
LIGHT_PROFIL... | 2.671875 | 3 |
src/mongo_model.py | zxteloiv/curated-geokb-subsearcher | 0 | 17101 | # coding: utf-8
from pymongo import MongoClient
import conf
class MongoQuery(object):
def __init__(self):
self._conn = MongoClient(conf.mongodb_conn_str)
self._db = self._conn.geokb
def query(self, grounded, limit=15, sort_keys=None):
col = self._db[grounded['from']]
docs = co... | 2.453125 | 2 |
src/dcm/agent/plugins/builtin/configure_server.py | JPWKU/unix-agent | 0 | 17102 | #
# Copyright (C) 2014 Dell, 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... | 1.632813 | 2 |
phy/plot/interact.py | ycanerol/phy | 118 | 17103 | <filename>phy/plot/interact.py
# -*- coding: utf-8 -*-
"""Common layouts."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import logging
import numpy as np
from phylib.utils import emit
from... | 2.4375 | 2 |
AutocompleteHandler.py | codeforamerica/sheltraustin | 0 | 17104 | <filename>AutocompleteHandler.py
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import simplejson
from QueryHandler import QueryHandler
class AutocompleteHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
def get(self):
if not self.request.arguments or self.... | 2.84375 | 3 |
mirari/SV/migrations/0052_auto_20190428_1522.py | gcastellan0s/mirariapp | 0 | 17105 | <gh_stars>0
# Generated by Django 2.0.5 on 2019-04-28 20:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('SV', '0051_ticketproducts_offerprice'),
]
operations = [
migrations.AddField(
model... | 1.539063 | 2 |
svl/compiler/plot_validators.py | timothyrenner/svl | 8 | 17106 | from toolz import get
PLOT_VALIDATORS = [
(
{"line", "scatter", "bar"},
lambda x: ("x" not in x) or ("y" not in x),
"XY plot does not have X and Y.",
),
(
{"histogram"},
lambda x: ("step" in x) and ("bins" in x),
"Histogram cannot have STEP and BINS.",
),... | 2.359375 | 2 |
decision_tree.py | cjbayron/ml-models | 1 | 17107 | <filename>decision_tree.py
'''
Building a Decision Tree using CART (from scratch)
Note: Code was tested only on dataset with numerical features.
Categorical features are not yet fully supported.
'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_sp... | 3.375 | 3 |
codegen/codegen/fblas_routine.py | spcl/fblas | 68 | 17108 | <gh_stars>10-100
"""
FBlas Routine class: it used to represent a routine definition, specified by the user using JSON file.
It is used by the Host and Module Codegen (specified by the _codegen variable). Accordingly,
some class members could be invalid.
"""
from codegen import fblas_types
from codegen imp... | 2.640625 | 3 |
lib/prefab/errors.py | lexsca/docker-prefab | 1 | 17109 | <filename>lib/prefab/errors.py
class PrefabError(Exception):
pass
class HashAlgorithmNotFound(PrefabError):
pass
class ImageAccessError(PrefabError):
pass
class ImageBuildError(PrefabError):
pass
class ImageNotFoundError(PrefabError):
pass
class ImagePushError(PrefabError):
pass
clas... | 1.859375 | 2 |
test_hoyolab.py | c3kay/hoyolab-json-feed | 1 | 17110 | from hoyolab import main
from os import environ
from os.path import exists
import atoma
def init_environ(d):
environ['HOYOLAB_JSON_PATH'] = '{}/hoyolab.json'.format(d)
environ['HOYOLAB_ATOM_PATH'] = '{}/hoyolab.xml'.format(d)
environ['HOYOLAB_JSON_URL'] = 'hoyolab.json'
environ['HOYOLAB_ATOM_URL'] = '... | 2.34375 | 2 |
sausage_grinder/urls.py | jesseerdmann/audiobonsai | 0 | 17111 | from django.urls import path
from . import views as sg
urlpatterns = [
path('artist', sg.artist),
path('genre', sg.genre),
path('release', sg.release),
path('track', sg.track),
path('', sg.sausage_grinder_index),
]
| 1.515625 | 2 |
sails/ui/mmck/parameters/string.py | metrasynth/solar-sails | 6 | 17112 | <filename>sails/ui/mmck/parameters/string.py
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QComboBox
from PyQt5.QtWidgets import QLineEdit
from sf.mmck.parameters import String
from .manager import widget_class_for
from .widget import ParameterWidget
@widget_class_for(String)
class StringParameterWidg... | 2.171875 | 2 |
plot_top_performers.py | jmphil09/mario_rl | 0 | 17113 | from FitnessPlot import FitnessPlot
'''
for n in range(1,6):
plot = FitnessPlot(folder_prefix='data_top{}'.format(n))
plot.plot_all_workers()
plot.plot_workers_as_average()
'''
plot = FitnessPlot(folder_prefix='data_top1', num_workers=16)
worker_dict = plot.create_worker_dict()
#plot.plot_all_workers()
#... | 2.890625 | 3 |
test/PySrc/tests/test_code_tracer_width.py | lifubang/live-py-plugin | 224 | 17114 | <gh_stars>100-1000
from space_tracer.main import replace_input, TraceRunner
def test_source_width_positive():
code = """\
i = 1 + 1
"""
expected_report = """\
i = 1 + | i = 2"""
with replace_input(code):
report = TraceRunner().trace_command(['space_tracer',
... | 2.765625 | 3 |
benchmark/src/benchmark/bench_logging.py | lwanfuturewei/QFlock | 0 | 17115 |
import logging
def setup_logger():
formatter = logging.Formatter('%(asctime)s.%(msecs)03d %(levelname)s %(message)s',
'%Y-%m-%d %H:%M:%S')
logging.basicConfig(level=logging.INFO,
format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s',
... | 2.59375 | 3 |
tools/configure-gateway/threescale/proxies.py | jparsai/f8a-3scale-connect-api | 1 | 17116 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ThreeScale Proxies Rule interface for APIs."""
from .base import ThreeScale
import logging
import requests
import xmltodict
import json
logger = logging.getLogger(__name__)
class Proxies(ThreeScale):
"""ThreeScale Proxies create, update."""
response = None... | 1.992188 | 2 |
src/__main__.py | Grox2006/Kayambot | 0 | 17117 | <gh_stars>0
import sys
from __init__ import Bot
MESSAGE_USAGE = "Usage is python %s [name] [token]"
if __name__ == "__main__":
if len(sys.argv) == 3:
Bot(sys.argv[1], sys.argv[2])
else:
print(MESSAGE_USAGE.format(sys.argv[0]))
| 2.6875 | 3 |
app/__init__.py | logicalicy/flask-react-boilerplate | 2 | 17118 | # Created with tutorials:
# https://www.digitalocean.com/community/tutorials/how-to-structure-large-flask-applications
# http://flask.pocoo.org/docs/0.12/tutorial
from flask import Flask, g, render_template
from flask_sqlalchemy import SQLAlchemy
import sqlite3
# Define WSGI application object.
app = Flask(__name__... | 2.59375 | 3 |
dumpcode/cpiter.py | gkfthddk/keras | 0 | 17119 | <reponame>gkfthddk/keras
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import subprocess
import numpy as np
import datetime
import random
import warnings
import ROOT as rt
import math
from keras.preprocessing.sequence import pad_sequences
from keras.callbacks import Callback
from array import array
from sklearn.m... | 2.0625 | 2 |
tools/opt.py | hmtrii/tirg | 0 | 17120 | <gh_stars>0
class Opt:
def __init__(self):
self.dataset = "fashion200k"
self.dataset_path = "./dataset/Fashion200k"
self.batch_size = 32
self.embed_dim = 512
self.hashing = False
self.retrieve_by_random = True | 2.078125 | 2 |
addons/iap_crm/models/crm_lead.py | SHIVJITH/Odoo_Machine_Test | 0 | 17121 | <filename>addons/iap_crm/models/crm_lead.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Lead(models.Model):
_inherit = 'crm.lead'
reveal_id = fields.Char(string='Reveal ID', help="Technical ID of reveal request done... | 1.273438 | 1 |
vitrage/tests/unit/datasources/kubernetes/test_kubernetes_transformer.py | openstack/vitrage | 89 | 17122 | <filename>vitrage/tests/unit/datasources/kubernetes/test_kubernetes_transformer.py
# Copyright 2018 - Nokia
#
# 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/lice... | 1.398438 | 1 |
two_children.py | daniel2019-max/HackerRank-preparation-month | 0 | 17123 | <reponame>daniel2019-max/HackerRank-preparation-month<filename>two_children.py<gh_stars>0
# Two children, Lily and Ron, want to share a chocolate bar. Each of the squares has an integer on it.
# Lily decides to share a contiguous segment of the bar selected such that:
# The length of the segment matches Ron's birth m... | 3.984375 | 4 |
sdk/python/pulumi_sonarqube/get_users.py | jshield/pulumi-sonarqube | 0 | 17124 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 1.992188 | 2 |
rl/valuefunction/FeatureExtractor.py | nickswalker/counterpoint-reinforcement-learning | 1 | 17125 | from abc import abstractmethod
from typing import List
from rl.action import Action
from rl.state import State
class StateActionFeatureExtractor:
@abstractmethod
def num_features(self) -> int:
pass
@abstractmethod
def extract(self, state: State, action: Action) -> List[float]:
pass
... | 3.15625 | 3 |
yxf_utils/jsonx.py | yanyaming/yxf_utils | 0 | 17126 | <reponame>yanyaming/yxf_utils<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
通用json处理接口
"""
import json
# 输入单引号为边界的类json字符串(内部可能还有双引号),返回单引号为边界的python字典or列表对象。
def singleQuoteJsonStr_to_PythonObj(strr):
jsonObj = eval(strr) # 不能用内置函数解析。只能模拟执行。
return jsonObj # dict or list
# 输入完全正规的json字符... | 2.53125 | 3 |
ggshield/scan/scannable_errors.py | rgajason/gg-shield | 0 | 17127 | <reponame>rgajason/gg-shield
from ast import literal_eval
from typing import Dict, List
import click
from pygitguardian.models import Detail
from ggshield.text_utils import STYLE, display_error, format_text, pluralize
def handle_scan_error(detail: Detail, chunk: List[Dict[str, str]]) -> None:
if detail.status_c... | 2.3125 | 2 |
Packs/Base/Scripts/DBotPreprocessTextData/DBotPreprocessTextData.py | matan-xmcyber/content | 1 | 17128 | <gh_stars>1-10
# pylint: disable=no-member
from CommonServerUserPython import *
from CommonServerPython import *
from sklearn.feature_extraction.text import TfidfVectorizer
import pickle
import uuid
import spacy
import string
from html.parser import HTMLParser
from html import unescape
from re import compile as _Re
imp... | 2.5 | 2 |
punc_recover/tester/punc_tester.py | Z-yq/audioSamples.github.io | 1 | 17129 | import logging
import os
import tensorflow as tf
from punc_recover.models.punc_transformer import PuncTransformer
from punc_recover.tester.base_tester import BaseTester
from utils.text_featurizers import TextFeaturizer
class PuncTester(BaseTester):
""" Trainer for CTC Models """
def __init__(self,
... | 2.171875 | 2 |
moztrap/model/core/migrations/0003_auto__add_field_productversion_cc_version__add_field_product.py | mbeko/moztrap | 0 | 17130 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ProductVersion.cc_version'
db.add_column('core_productversion', 'cc_version', self.gf('django.db.... | 2.078125 | 2 |
tests/downloader_test.py | jkawamoto/roadie-gcp | 1 | 17131 | <gh_stars>1-10
#! /usr/bin/env python
#
# downloader_test.py
#
# Copyright (c) 2015-2016 <NAME>
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
""" Test for downloader module.
"""
import logging
import shutil
import sys
import unittest
import os
from os import p... | 2.3125 | 2 |
ticle/plotters/plot_phase.py | muma7490/TICLE | 0 | 17132 | import matplotlib.pyplot as pl
import os
import numpy as np
from ticle.data.dataHandler import normalizeData,load_file
from ticle.analysis.analysis import get_phases,normalize_phase
pl.rc('xtick', labelsize='x-small')
pl.rc('ytick', labelsize='x-small')
pl.rc('font', family='serif')
pl.rcParams.update({'font.size': 2... | 2.359375 | 2 |
src/putil/rabbitmq/rabbit_util.py | scionrep/scioncc_new | 2 | 17133 | #!/usr/bin/python
import shlex
import simplejson
from putil.rabbitmq.rabbitmqadmin import Management, make_parser, LISTABLE, DELETABLE
class RabbitManagementUtil(object):
def __init__(self, config, options=None, sysname=None):
"""
Given a config object (system CFG or rabbit mgmt config), extra... | 2.296875 | 2 |
gaternet/main.py | gunpowder78/google-research | 1 | 17134 | <filename>gaternet/main.py
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# ... | 2.1875 | 2 |
client.pyw | thatfuckingbird/hydrus-websocket-server | 1,417 | 17135 | <filename>client.pyw
#!/usr/bin/env python3
# Hydrus is released under WTFPL
# You just DO WHAT THE FUCK YOU WANT TO.
# https://github.com/sirkris/WTFPL/blob/master/WTFPL.md
from hydrus import hydrus_client
if __name__ == '__main__':
hydrus_client.boot()
| 1.625 | 2 |
fixEngine/fixEngine.py | HNGlez/ExchangeConnector | 0 | 17136 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ExchangeConnector fixEngine
Copyright (c) 2020 <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 lim... | 1.984375 | 2 |
plugins/session_list/views.py | farazkhanfk7/ajenti | 1 | 17137 | from jadi import component
from aj.api.http import url, HttpPlugin
from aj.auth import authorize
from aj.api.endpoint import endpoint, EndpointError
import aj
import gevent
@component(HttpPlugin)
class Handler(HttpPlugin):
def __init__(self, context):
self.context = context
@url(r'/api/session_list/l... | 1.992188 | 2 |
now/collection/prov_execution/argument_captors.py | CrystalMei/Prov_Build | 2 | 17138 | <filename>now/collection/prov_execution/argument_captors.py<gh_stars>1-10
# Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# Copyright (c) 2018, 2019, 2020 President and Fellows of Harvard College.
# This file is part of ProvBuild.
"""Capture... | 2.171875 | 2 |
Python/Day8 DictionariesAndMaps.py | codePerfectPlus/30-DaysOfCode-With-Python-And-JavaScript | 8 | 17139 | N = int(input())
entry = [input().split() for _ in range(N)]
phoneBook = {name: number for name, number in entry}
while True:
try:
name = input()
if name in phoneBook:
print(f"{name}={phoneBook[name]}")
else:
print("Not found")
except:
break
| 3.90625 | 4 |
10. Recurrent Neural Network/10-1) Recurrent Neural Network, RNN.py | choijiwoong/-ROKA-torch-tutorial-files | 0 | 17140 | <gh_stars>0
#Sequence model. != Recursive Neural Network
#memory cell or RNN cell
#hidden state
#one-to-many_image captioning, many-to-one_sentiment classfication || spam detection, many-to-many_chat bot
#2) create RNN in python
import numpy as np
timesteps=10#시점의 수 _문장의 길이
input_size=4#입력의 차원_단어벡터의 차원
hidden_size=8#... | 2.796875 | 3 |
WeLearn/M3-Python/L3-Python_Object/pet.py | munoz196/moonyosCSSIrep | 0 | 17141 | <filename>WeLearn/M3-Python/L3-Python_Object/pet.py
pet = {
"name":"Doggo",
"animal":"dog",
"species":"labrador",
"age":"5"
}
class Pet(object):
def __init__(self, name, age, animal):
self.name = name
self.age = age
self.animal = animal
self.hungry = False
self.mood= "happy"... | 4.28125 | 4 |
src/repositories/example_repo.py | pybokeh/dagster-examples | 0 | 17142 | <filename>src/repositories/example_repo.py
from dagster import job, repository
from ops.sklearn_ops import (
fetch_freehand_text_to_generic_data,
separate_features_from_target_label,
label_encode_target,
count_tfid_transform_train,
count_tfid_transform_test,
create_sgd_classifier_model,
... | 2.3125 | 2 |
exercicios/Maior_e_Menor_Valores.py | jeversonneves/Python | 0 | 17143 | <filename>exercicios/Maior_e_Menor_Valores.py
resposta = 'S'
soma = quant = media = maior = menor = 0
while resposta in 'Ss':
n = int(input('Digite um número: '))
soma += n
quant += 1
if quant == 1:
maior = menor = n
else:
if n > maior:
maior = n
elif n < menor:
... | 3.984375 | 4 |
rbc/opening/opening.py | rebuildingcode/hardware | 0 | 17144 | <gh_stars>0
from shapely.geometry import Polygon
from ..point import Point
class Opening(Polygon):
"""
Openings are rectangular only.
"""
def __init__(self, width, height):
self.width = width
self.height = height
points = [
Point(0, 0), Point(0, height), Point(w... | 3 | 3 |
AI/Housing Prices Prediction/HousePricesNN.py | n0rel/self | 0 | 17145 | <filename>AI/Housing Prices Prediction/HousePricesNN.py
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from numpy.random import uniform
import matplotlib.pyplot as plt
def relu(x):
return x * (x > 0)
def relu_deriv(x):
return 1 * (x > 0)
class NeuralNet... | 4.125 | 4 |
tests/test_export_keyword_template_catalina_10_15_4.py | PabloKohan/osxphotos | 0 | 17146 | <filename>tests/test_export_keyword_template_catalina_10_15_4.py
import pytest
from osxphotos._constants import _UNKNOWN_PERSON
PHOTOS_DB = "./tests/Test-10.15.4.photoslibrary/database/photos.db"
TOP_LEVEL_FOLDERS = ["Folder1"]
TOP_LEVEL_CHILDREN = ["SubFolder1", "SubFolder2"]
FOLDER_ALBUM_DICT = {"Folder1": [], "... | 1.804688 | 2 |
video_level_models.py | pomonam/youtube-8m | 43 | 17147 | <reponame>pomonam/youtube-8m
# Copyright 2018 Deep Topology 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... | 1.726563 | 2 |
tests/test_refinement.py | qfardet/Pandora2D | 4 | 17148 | <reponame>qfardet/Pandora2D
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA2D
#
# https://github.com/CNES/Pandora2D
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 2.390625 | 2 |
goblet/tests/test_scheduler.py | Aaron-Gill/goblet | 0 | 17149 | <filename>goblet/tests/test_scheduler.py
from unittest.mock import Mock
from goblet import Goblet
from goblet.resources.scheduler import Scheduler
from goblet.test_utils import (
get_responses,
get_response,
mock_dummy_function,
dummy_function,
)
class TestScheduler:
def test_add_schedule(self, mo... | 2.421875 | 2 |
arachnado/rpc/sites.py | wigginzz/arachnado | 2 | 17150 | <gh_stars>1-10
import logging
from functools import partial
from arachnado.storages.mongotail import MongoTailStorage
class Sites(object):
""" 'Known sites' object exposed via JSON-RPC """
logger = logging.getLogger(__name__)
def __init__(self, handler, site_storage, **kwargs):
self.handler = ha... | 2.453125 | 2 |
src/players.py | deacona/the-ball-is-round | 0 | 17151 | <filename>src/players.py
"""players module.
Used for players data processes
"""
import numpy as np
import pandas as pd
import src.config as config
import src.utilities as utilities
from src.utilities import logging
pd.set_option("display.max_columns", 500)
pd.set_option("display.expand_frame_repr", False)
# master_... | 2.890625 | 3 |
Z_ALL_FILE/Py/code_qry.py | omikabir/omEngin | 0 | 17152 | import pandas as pd
import os
#opt = itertools.islice(ls, len(ls))
#st = map(lambda x : )
def parsecode(txt):
df = pd.read_csv(os.getcwd() + '\\OMDB.csv')
ls = df['Code'].to_list()
code = []
q = 0
for i in range(len(ls)):
text = txt
if ls[i] in text:
n = text.find(ls[... | 2.84375 | 3 |
eats/tests/common/base_test_setup.py | Etiqa/eats | 0 | 17153 | import socket
import unittest
from eats.webdriver import PytractorWebDriver
from eats.tests.common import SimpleWebServerProcess as SimpleServer
def _get_local_ip_addr():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("gmail.com",80))
local_ip_addr = s.getsockname()[0]
s.close()
re... | 2.328125 | 2 |
autoprep/service/sqlite_project_service.py | haginot/auto-prep | 0 | 17154 | <reponame>haginot/auto-prep
from autoprep.service.project_service import ProjectService
class SQLiteProjectService(ProjectService):
def get_projects(self):
pass
def get_project(self):
pass
def save_project(self):
pass
| 1.476563 | 1 |
p1_navigation/model.py | Alexandr0s93/deep-reinforcement-learning | 0 | 17155 | import torch
import torch.nn as nn
class QNetwork(nn.Module):
"""Actor (Policy) Model using a Single DQN."""
def __init__(self, state_size, action_size, seed):
"""Initialize parameters and build model.
Params
======
state_size (int): Dimension of each state
acti... | 2.984375 | 3 |
const.py | TakosukeGH/pmx_bone_importer | 0 | 17156 | ADDON_NAME = "pmx_bone_importer"
LOG_FILE_NAME = "pmx_bone_importer.log"
| 1.265625 | 1 |
pox/lib/interfaceio/__init__.py | korrigans84/pox_network | 416 | 17157 | # Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 1.710938 | 2 |
icarus_simulator/strategies/atk_geo_constraint/geo_constr_strat.py | RubenFr/ICARUS-framework | 5 | 17158 | # 2020 <NAME> and <NAME>
import os
import json
import numpy as np
from typing import Set, List
from geopy.distance import great_circle
from scipy.spatial.ckdtree import cKDTree
from shapely.geometry import Polygon, shape, Point
from icarus_simulator.sat_core.coordinate_util import geo2cart
from icarus_simulator.stra... | 2.203125 | 2 |
grafeas/models/deployable_deployment_details.py | nyc/client-python | 0 | 17159 | # coding: utf-8
"""
Grafeas API
An API to insert and retrieve annotations on cloud artifacts. # noqa: E501
OpenAPI spec version: v1alpha1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from grafeas.models.deployment_deta... | 1.84375 | 2 |
lib/python/test/test_trans.py | qxo/cat | 5 | 17160 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: stdrickforce (<NAME>)
# Email: <<EMAIL>> <<EMAIL>>
import cat
import time
def ignore_exception(func):
def wraps(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
pass
return wraps
@ignore_ex... | 2.65625 | 3 |
src/ui/ui_hw_recovery_wdg.py | frosted97/dash-masternode-tool | 75 | 17161 | <reponame>frosted97/dash-masternode-tool<filename>src/ui/ui_hw_recovery_wdg.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ui_hw_recovery_wdg.ui
#
# Created by: PyQt5 UI code generator
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not ed... | 1.835938 | 2 |
datahandler/analyser.py | ameliecordier/IIK | 0 | 17162 | # -*- coding: utf-8 -*-
import csv
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def isValid(p, ep):
return p in ep.patterns
# CLASS ANALYSER
class Analyser:
"""
Représentation d'un résultat d'analyse
"""
def __init__(self):
"""
:para... | 3.15625 | 3 |
binary_trees/next_right.py | xxaxdxcxx/miscellaneous-code | 0 | 17163 | <filename>binary_trees/next_right.py
# Definition for binary tree with next pointer.
class TreeLinkNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
self.next = None
class Solution:
# @param root, a tree link node
# @return nothing
def connect... | 4.125 | 4 |
6.all_species/species_data/merge_species_data.py | oaxiom/episcan | 0 | 17164 | #!/usr/bin/env python3
import sys, os, glob
from glbase3 import *
all_species = glload('species_annotations/species.glb')
newl = []
for file in glob.glob('pep_counts/*.txt'):
oh = open(file, 'rt')
count = int(oh.readline().split()[0])
oh.close()
species_name = os.path.split(file)[1].split('.')[0].l... | 2.625 | 3 |
modules/lex_managers/lex_intent_manager.py | adamhamden/lex-bot | 0 | 17165 | <filename>modules/lex_managers/lex_intent_manager.py<gh_stars>0
import boto3
from prettytable import PrettyTable
class LexIntentManager:
def __init__(self):
self.client = boto3.client('lex-models')
def create_new_intent(self, intent_name, description="n/a", sample_utterances=[], slot_types=[]):
... | 2.1875 | 2 |
src/__init__.py | Victorpc98/CE888-Project | 1 | 17166 | <filename>src/__init__.py
import sys
sys.path.append("..") # Adds higher directory to python modules path. | 2.03125 | 2 |
wxtbx/wx4_compatibility.py | dperl-sol/cctbx_project | 155 | 17167 | <filename>wxtbx/wx4_compatibility.py
from __future__ import absolute_import, division, print_function
'''
Author : Lyubimov, A.Y.
Created : 04/14/2014
Last Changed: 11/05/2018
Description : wxPython 3-4 compatibility tools
The context managers, classes, and other tools below can be used to make the
GUI code ... | 2.375 | 2 |
BMVC_version/utils.py | ZhengyuZhao/ACE | 19 | 17168 | import torch
import torch.nn as nn
import csv
#image quantization
def quantization(x):
x_quan=torch.round(x*255)/255
return x_quan
#picecwise-linear color filter
def CF(img, param,pieces):
param=param[:,:,None,None]
color_curve_sum = torch.sum(param, 4) + 1e-30
total_image = img * 0
f... | 2.953125 | 3 |
lemonpie/_nbdev.py | corazonlabs/ehr_preprocessing | 3 | 17169 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"get_device": "00_basics.ipynb",
"settings_template": "00_basics.ipynb",
"read_settings": "00_basics.ipynb",
"DEVICE": "00_basics.ipynb",
"settings": "00_basics.ipynb",
... | 1.0625 | 1 |
tensorboard/plugins/graph_edit/c2graph_util.py | qzhong0605/tensorboardplugins | 0 | 17170 | <filename>tensorboard/plugins/graph_edit/c2graph_util.py
# Convert the caffe2 model into tensorboard GraphDef
#
# The details of caffe2 model is on the compat/proto/caffe2/caffe2.proto
# And the details of GraphDef model is on the compat/proto/graph.proto
#
##############################################################... | 2.1875 | 2 |
src/Homework2_1.py | alexaquino/TUM-AUTONAVx | 0 | 17171 | #!/usr/bin/env python
# The MIT License (MIT)
# Copyright (c) 2014 <NAME>
# Technische Universität München (TUM)
# Autonomous Navigation for Flying Robots
# Homework 2.1
from plot import plot
class UserCode:
def __init__(self):
# initialize data you want to store in this object between calls to the meas... | 3.515625 | 4 |
src_tf/templates/tf_estimator_template/model/example.py | ashishpatel26/finch | 1 | 17172 | from configs import args
import tensorflow as tf
def forward(x, mode):
is_training = (mode == tf.estimator.ModeKeys.TRAIN)
x = tf.contrib.layers.embed_sequence(x, args.vocab_size, args.embed_dim)
x = tf.layers.dropout(x, 0.2, training=is_training)
feat_map = []
for k_size in [3, 4, 5]:
_... | 2.265625 | 2 |
{{cookiecutter.project_slug}}/core/management/commands/snippets/fastapi_project/core/security.py | claysllanxavier/django-cookiecutter | 8 | 17173 | <filename>{{cookiecutter.project_slug}}/core/management/commands/snippets/fastapi_project/core/security.py
from datetime import datetime, timedelta
from typing import Any, Union
from jose import jwt
from passlib.context import CryptContext
from .config import settings
pwd_context = CryptContext(
default="dja... | 2.0625 | 2 |
margarita/main.py | w0de/margarita | 3 | 17174 | <reponame>w0de/margarita
#!/usr/bin/env python
from flask import Flask
from flask import jsonify, render_template, redirect
from flask import request, Response
from saml_auth import BaseAuth, SamlAuth
import os, sys
try:
import json
except ImportError:
# couldn't find json, try simplejson library
import simplejson ... | 1.960938 | 2 |
python/pato/transport/uart.py | kloper/pato | 0 | 17175 | # -*- python -*-
"""@file
@brief pyserial transport for pato
Copyright (c) 2014-2015 <NAME> <<EMAIL>>.
All rights reserved.
@page License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code ... | 1.890625 | 2 |
PYQT5/Games/RockPapperScissorsGame.py | Amara-Manikanta/Python-GUI | 0 | 17176 | <reponame>Amara-Manikanta/Python-GUI<gh_stars>0
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QFont, QPixmap
from PyQt5.QtCore import QTimer
from random import randint
font = QFont("Times", 14)
buttonFont = QFont("Arial", 12)
computerScore = 0
playerScore = 0
class Windows(QWidget):
def __init... | 3.140625 | 3 |
services/neural/traindatabase.py | vitorecomp/hackaton-deep-learn | 0 | 17177 | <filename>services/neural/traindatabase.py<gh_stars>0
from os import walk
import h5py
import numpy as np
from config.Database import Base
from config.Database import engine
from config.Database import Session
from models.Music import Music
from kmeans.kmeans import Kmeans
mypath = './dataset/datatr/'
def main():
... | 2.296875 | 2 |
projects/TGS_salt/binary_classifier/model.py | liaopeiyuan/ml-arsenal-public | 280 | 17178 | <filename>projects/TGS_salt/binary_classifier/model.py
import torch.nn as nn
import pretrainedmodels
class classifier(nn.Module):
def __init__(self, model_name='resnet32'):
super(classifier, self).__init__()
# Load pretrained ImageNet model
self.model = pretrainedmodels.__dict__[... | 2.46875 | 2 |
code/algorithm/assr.py | ShuhuaGao/bcn_opt_dc | 0 | 17179 | <filename>code/algorithm/assr.py
"""
Given a Boolean function/network, get its algebraic state-space representation.
A logical vector `\delta_n^i` is represented by an integer `i` for space efficiency. Consequently, a logical matrix
is represented by a list, each element for one column, (also known as the "condensed f... | 3.578125 | 4 |
datasets/voc_dataset.py | ming71/DAL | 206 | 17180 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# Extended by <NAME>
# --------------------------------------------------------
import os
import cv2
import numpy as np
import torch
impor... | 2.3125 | 2 |
neploid.py | GravityI/neploid | 0 | 17181 | import discord
import random
import asyncio
import logging
import urllib.request
from discord.ext import commands
bot = commands.Bot(command_prefix='nep ', description= "Nep Nep")
counter = 0
countTask = None
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
# print(bot.user.id)
... | 2.65625 | 3 |
odoo/base-addons/l10n_tr/__manifest__.py | LucasBorges-Santos/docker-odoo | 0 | 17182 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Turkey - Accounting',
'version': '1.0',
'category': 'Localization',
'description': """
Türkiye için Tek düzen hesap planı şablonu Odoo Modülü.
==================================================... | 1.132813 | 1 |
Source Codes/SMF_Python/smf_main.py | mmaher22/iCV-SBR | 20 | 17183 | import os
import time
import argparse
import pandas as pd
from smf import SessionMF
parser = argparse.ArgumentParser()
parser.add_argument('--K', type=int, default=20, help="K items to be used in Recall@K and MRR@K")
parser.add_argument('--factors', type=int, default=100, help="Number of latent factors.")
parser.add_a... | 2.4375 | 2 |
sdks/python/appcenter_sdk/models/Device.py | Brantone/appcenter-sdks | 0 | 17184 | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: <EMAIL>
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class Device(object):
"""NOTE: This cl... | 1.414063 | 1 |
src/providers/snmp.py | tcuthbert/napi | 0 | 17185 | <filename>src/providers/snmp.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author : <NAME>
import os, sys
from providers.provider import Provider
from config.config import Config
sys.path.append('../')
def _reverse_dict(d):
ret = {}
for key, val in d.items():
if ret.has_key(val):
... | 2.265625 | 2 |
visionpack/stable_baselines3/common/off_policy_algorithm.py | joeljosephjin/gvgai-rl | 0 | 17186 | <reponame>joeljosephjin/gvgai-rl<gh_stars>0
import time
import os
import pickle
import warnings
from typing import Union, Type, Optional, Dict, Any, Callable
import gym
import torch as th
import numpy as np
from stable_baselines3.common import logger
from stable_baselines3.common.base_class import BaseAlgorithm
from ... | 1.921875 | 2 |
src/oscar/apps/dashboard/app.py | frmdstryr/django-oscar | 0 | 17187 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import AuthenticationForm
from oscar.core.application import (
DashboardApplication as BaseDashboardApplication)
from oscar.core.loading import get_class
class DashboardApplication(BaseDashboardApp... | 1.8125 | 2 |
wedding/migrations/0004_auto_20170407_2017.py | chadgates/thetravelling2 | 0 | 17188 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-04-07 20:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migr... | 1.695313 | 2 |
taskonomy/utils/log_utils.py | shikhar-srivastava/hover_net | 0 | 17189 | import pandas as pd
import pickle
def read_metric_logs(bucket_type):
metrics = pd.DataFrame(columns=['source_type', 'target_type', 'stats'])
type_list_path = f'/l/users/shikhar.srivastava/data/pannuke/{bucket_type}/selected_types.csv'
type_list = pd.read_csv(type_list_path)['0']
for source_type in t... | 2.71875 | 3 |
train_DEU.py | JosephineRabbit/MLMSNet | 61 | 17190 | <filename>train_DEU.py
from D_E_U import *
D_E = DSS(*extra_layer(vgg(base['dss'], 3), extra['dss']),config.BATCH_SIZE).cuda()
U = D_U().cuda()
U.cuda()
data_dirs = [
("/home/rabbit/Datasets/DUTS/DUT-train/DUT-train-Image",
"/home/rabbit/Datasets/DUTS/DUT-train/DUT-train-Mask"),
]
test_dirs = [("/home/rabb... | 2 | 2 |
solutions/1497_check_if_array_pairs_are_divisible_by_k.py | YiqunPeng/leetcode_pro | 0 | 17191 | <reponame>YiqunPeng/leetcode_pro<gh_stars>0
class Solution:
def canArrange(self, arr: List[int], k: int) -> bool:
"""Hash table.
Running time: O(n) where n == len(arr).
"""
d = collections.defaultdict(int)
for a in arr:
d[a % k] += 1
for key, v in d.items... | 2.890625 | 3 |
machine-learning-ex2/ex2/ex2.py | DuffAb/coursera-ml-py | 0 | 17192 | # Machine Learning Online Class - Exercise 2: Logistic Regression
#
# Instructions
# ------------
#
# This file contains code that helps you get started on the logistic
# regression exercise. You will need to complete the following functions
# in this exericse:
#
# sigmoid.py
# costFunction.py
# predic... | 4.09375 | 4 |
tests/test_apiFunc.py | Reid1923/py-GoldsberryTest | 0 | 17193 | <filename>tests/test_apiFunc.py
# -*- coding: utf-8 -*-
import pytest
import goldsberry
test_data = [
(goldsberry._nbaLeague, 'NBA', '00'),
(goldsberry._nbaLeague, 'WNBA', '10'),
(goldsberry._nbaLeague, 'NBADL', '20'),
(goldsberry._nbaSeason, 1999, '1999-00'),
(goldsberry._nbaSeason, 2000, '2000-01'),
(goldsberry._s... | 1.890625 | 2 |
sasmodels/models/poly_gauss_coil.py | zattala/sasmodels | 0 | 17194 | #poly_gauss_coil model
#conversion of Poly_GaussCoil.py
#converted by <NAME>, Mar 2016
r"""
This empirical model describes the scattering from *polydisperse* polymer
chains in theta solvents or polymer melts, assuming a Schulz-Zimm type
molecular weight distribution.
To describe the scattering from *monodisperse* poly... | 2.515625 | 3 |
examples/information_extraction/msra_ner/eval.py | BenfengXu/PaddleNLP | 1 | 17195 | <filename>examples/information_extraction/msra_ner/eval.py
# Copyright (c) 2021 PaddlePaddle 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.a... | 2.15625 | 2 |
src/python/module/z5py/util.py | constantinpape/z5 | 82 | 17196 | import os
from itertools import product
from concurrent import futures
from contextlib import closing
from datetime import datetime
import numpy as np
from . import _z5py
from .file import File, S3File
from .dataset import Dataset
from .shape_utils import normalize_slices
def product1d(inrange):
for ii in inrang... | 2.28125 | 2 |
custom_components/waste_collection_schedule/sensor.py | trstns/hacs_waste_collection_schedule | 0 | 17197 | <reponame>trstns/hacs_waste_collection_schedule
"""Sensor platform support for Waste Collection Schedule."""
import collections
import datetime
import logging
from enum import Enum
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA... | 2.015625 | 2 |
qidian.py | kivson/qidian-dl | 0 | 17198 | from concurrent.futures import ThreadPoolExecutor
from functools import partial
from json import JSONDecodeError
import requests
from funcy.calc import cache
from funcy.debug import print_calls
from funcy.simple_funcs import curry
HEADERS = {
"Accept": "application/json, text/javascript, */*; q=0.01",
"User-A... | 2.640625 | 3 |
srcWatteco/TICs/_poubelle/TIC_ICEp.py | OStephan29/Codec-Python | 1 | 17199 | # -*- coding: utf-8 -*-
# Pour passer de TICDataXXXFromBitfields @ TICDataBatchXXXFromFieldIndex
# Expressions régulière notepad++
# Find : TICDataSelectorIfBit\( ([0-9]*), Struct\("([^\"]*)"\/([^\)]*).*
# Replace: \1 : \3, # \2
from ._TIC_Tools import *
from ._TIC_Types import *
TICDataICEpFromBitfields = Struct... | 2.140625 | 2 |