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
tools/exporter_python/exporter.py
moriyalb/hades
5
19100
<filename>tools/exporter_python/exporter.py import getopt import sys import os import schema import server import orm CLIENT_TYPE = { '--client_lua_path' : "lua", '--client_cs_path' : "cs", '--client_cpp_path' : "cpp", '--client_js_path' : "js", '--client_python_path' : "python", } def expo...
2.21875
2
python/python project/te330.py
WhitePhosphorus4/xh-learning-code
0
19101
<filename>python/python project/te330.py import wx class App(wx.App): def OnInit(self): self.locale = wx.Locale(wx.LANGUAGE_CHINESE) return 1 def A(evt): print("hello") f.Maximize() def B(evt): b.SetBackgroundColour("#FFFFFF") def C(evt): b.SetBackgroundColour("#EFEFEF") app = App() f = w...
2.921875
3
examples/sneswii2gamepad/code.py
dglaude/CircuitPython_Joystic_Controller
0
19102
<gh_stars>0 # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT # You must add a gamepad HID device inside your boot.py file # in order to use this example. # See this Learn Guide for details: # https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/hid-devices#cu...
3.046875
3
spleeter/util.py
ashirviskas/spleeter-pytorch
28
19103
<gh_stars>10-100 import numpy as np import tensorflow as tf from .unet import UNet def tf2pytorch(checkpoint_path, num_instrumments): tf_vars = {} init_vars = tf.train.list_variables(checkpoint_path) # print(init_vars) for name, shape in init_vars: try: # print('Loading TF Weight ...
2.34375
2
SDEprocesses/explicit.py
PyPaperParrot/pystoch
1
19104
import numpy as np import exceptions as ex def LogWalk(T, nSteps, mu, sigma, x_0=1, t_0=0, boundary=500): ex._check_params(T, nSteps, t_0) dt = T/(10*nSteps) x_t = [] t = t_0 for i in range((10*nSteps)): x = x_0*np.exp((mu - sigma**2/2)*t + sigma*np.random.randn()*np.sqrt(t)) if ...
2.640625
3
oscontainer/cgroup_v2_subsystem.py
Lothiraldan/oscontainer
0
19105
import math from oscontainer.constants import CGROUP_TYPE_V2, PER_CPU_SHARES, NO_LIMIT from oscontainer.cgroup_subsystem import CgroupController, CgroupSubsystem from oscontainer.utils import limit_from_str CPU_WEIGHT = "cpu.weight" CPU_MAX = "cpu.max" CPU_CPUSET_CPUS = "cpuset.cpus" CPU_CPUSET_CPUS_EFFECTIVE = "cpus...
2.5625
3
openapi/tests/matchers.py
suihanki/openapi
25
19106
<gh_stars>10-100 """ Custom hamcrest matchers. """ from hamcrest.core.base_matcher import BaseMatcher from json import dumps, loads class JSONMatcher(BaseMatcher): """ Match JSON content. """ def __init__(self, s): self.json = loads(s) def _matches(self, item): return loads(item...
2.453125
2
build-container/docxify3.py
signaux-faibles/datapi
0
19107
<reponame>signaux-faibles/datapi # coding: utf-8 import sys import json from mailmerge import MailMerge # Le template contient à ce jour les champs : # auteur l'auteur du document # date_edition la date d'édition du document # confidentialite le destinataire du document # raison_sociale la raison sociale de l'entrepri...
1.609375
2
super32assembler/super32assembler/preprocessor/asmdirectives.py
Projektstudium-Mikroprozessor/Super32
1
19108
""" Enum Assembler-Directives """ from enum import Enum, auto class AssemblerDirectives(Enum): START = auto() END = auto() ORG = auto() DEFINE = auto() @classmethod def to_string(cls): return "{START},{END},{ORG},{DEFINE}".format( START=cls.START.name, END=cls...
3.046875
3
Wyklad/OOP/Sheep.py
tborzyszkowski/PythonWorld
3
19109
from Animal import Animal class Sheep(Animal): def __init__(self, sheep=None, position=None): super(Sheep, self).__init__(sheep, position) def clone(self): return Sheep(self, None) def initParams(self): self.power = 3 self.sign = 'S'
3.265625
3
Python/WSClock/Page.py
Camiloasc1/OperativeSystemsUNAL
0
19110
class Page(object): def __init__(self, params): self.size = 2 ** 10 self.Time = False self.R = False self.M = False
2.578125
3
python/python-algorithm-intervew/8-linked-list/16-add-two-numbers-2.py
bum12ark/algorithm
1
19111
<gh_stars>1-10 class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def print_list(self): cur = self while cur: print(cur.val, end='->') cur = cur.next class Solution: # 전가산기구현 def addTwoNumbers(selfself, l1: Lis...
3.4375
3
pyjokes/jokes_pl.py
r0d0dendr0n/pyjokes
0
19112
<gh_stars>0 # -*- coding: utf-8 -*- """ Jokes below come from the "jokes_en.py" file. Translation to Polish: <NAME> - provided under CC BY-SA 3.0 """ neutral = [ "W 2030 roku Beata z ulgą usunęła Python'a 2.7 ze swoich maszyn. 'No!' westchnęła, by za chwilę przeczytać ogłoszenia na temat Python'a 4.4.", "Zapy...
1.578125
2
pele_platform/Utilities/Helpers/launcher.py
gabrii/pele_platform
0
19113
from dataclasses import dataclass import pele_platform.Checker.main as ck import pele_platform.Frag.simulation as fr import pele_platform.Adaptive.simulation as ad from pele_platform.Allosteric.main import run_allosteric import pele_platform.gpcr.main as gpcr import pele_platform.out_in.main as outin from pele_platform...
2.296875
2
Project/AuditReport/Aw/audit_aw.py
StarryHome/MultiToolsPlatform
0
19114
# -*- coding: utf-8 -*- from .pandas_aw import PandasAw class AuditAw(object): """ @summary: 审核AW类,负责审核规则整体流程 """ def __init__(self): self.result = [] def audit_report(self, visit_data_path, visit_demand_path, outliers_path): """ @summary: 审核报告入口 """ # 1.获取...
2.84375
3
libs/subsets_of_subset.py
nishio/atcoder
1
19115
""" all subsets of given subset """ def subsets_of_subset(subset): s = subset superset = subset while True: yield s s = (s - 1) & superset if s == superset: break # --- end of library --- def debugprint(g): for x in g: print(f"{x:06b}") TEST_1 = """ >>> ...
3.515625
4
models/backbone.py
kakaobrain/sparse-detr
83
19116
<gh_stars>10-100 # ------------------------------------------------------------------------------------ # Sparse DETR # Copyright (c) 2021 KakaoBrain. All Rights Reserved. # Licensed under the Apache License, Version 2.0 [see LICENSE for details] # -----------------------------------------------------------------------...
1.734375
2
resonate-carla/risk_calculation/function_test.py
scope-lab-vu/Resonate-Dynamic-Risk
3
19117
<gh_stars>1-10 from bowtie_diagram import BowTie import matplotlib.pyplot as plt EXAMPLE_MONITOR_VALUES = [x for x in range(-5, 21)] bowtie = BowTie() state = {"monitor_values": {"lec_martingale": None}} true_y_vals = [] true_x_vals = [] for x_val in EXAMPLE_MONITOR_VALUES: true_x_vals.append(x_val) state["m...
2.671875
3
hw_asr/model/dsmodel.py
ivan-gorin/asr_project_template
0
19118
#from https://www.assemblyai.com/blog/end-to-end-speech-recognition-pytorch/ from torch import nn import torch.nn.functional as F from hw_asr.base import BaseModel class CNNLayerNorm(nn.Module): def __init__(self, n_feats): super().__init__() self.layer_norm = nn.LayerNorm(n_feats) def forw...
2.734375
3
reminders/menu.py
elanorstark/reminder_pi
0
19119
import datetime from typing import List from reminders.events import Buttons, Alerts from reminders.screen import Screen # highest level, things that can be in a list menu class ListMenuItem: def __init__(self, name): self._name = str(name) @property def name(self): return self._name ...
3.40625
3
custom_components/goldair_climate/configuration.py
jwhite/homeassistant-goldair-climate
8
19120
import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_NAME from .const import ( CONF_CHILD_LOCK, CONF_CLIMATE, CONF_DEVICE_ID, CONF_DISPLAY_LIGHT, CONF_LOCAL_KEY, CONF_TYPE, CONF_TYPE_AUTO, CONF_TYPE_DEHUMIDIFIER, CONF_TYPE_FAN, CONF_TYPE_GECO_HEATER, CONF...
1.90625
2
20-29/nlp23.py
emergent/nlp100.python
0
19121
from nlp20 import get_england import re str = get_england() lines = str.split('\n') p = re.compile(r'^(=+)\s*(.+?)\s*=+') for l in lines: m = re.search(p, l) if m is not None: level = len(m.group(1)) - 1 print(m.group(2), level)
2.9375
3
platform_reports/prometheus_grammars.py
neuro-inc/platform-reports
0
19122
PROMQL = """ start: query // Binary operations are defined separately in order to support precedence ?query\ : or_match | matrix | subquery | offset ?or_match\ : and_unless_match | or_match OR grouping? and_unless_match ?and_unless_match\ : comparison_match | and_unless_match (AND | ...
1.8125
2
usersmanagement/models.py
Open-CMMS/openCMMS_backend
3
19123
"""This file contain the model for the usermanagement app.""" from django.contrib.auth.models import AbstractUser, Group, Permission from django.db import models class UserProfile(AbstractUser): """ Define a user. Here, we use heritage of abstract user and addition of the field nb_tries to detect if ...
2.84375
3
resrc/utils/templatetags/gravatar.py
theWhiteFox/resrc
274
19124
# -*- coding: utf-8 -*-: from django import template import urllib import hashlib register = template.Library() def gravatar(email, size=80, username=None): gravatar_url = "http://www.gravatar.com/avatar.php?" gravatar_url += urllib.urlencode({ 'gravatar_id': hashlib.md5(email).hexdigest(), ...
2.484375
2
utils/torch_utils.py
misads/torch_image_template
5
19125
# encoding=utf-8 """ Misc PyTorch utils Author: <EMAIL> update 12.7 Usage: `from torch_utils import *` `func_name()` # to call functions in this file """ from datetime import datetime import math import os import torch import torch.nn as nn from tensorboardX import SummaryWriter #########################...
3.015625
3
library/route_vpn.py
sebbbastien/ansible-stonesoft
0
19126
#!/usr/bin/python # Copyright (c) 2017 <NAME> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: route_vpn short_description: Crea...
2.109375
2
tfx/experimental/pipeline_testing/pipeline_recorder_utils.py
ntakouris/tfx
1
19127
# Lint as: python3 # Copyright 2020 Google LLC. 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 ...
1.875
2
src/third_party/wiredtiger/lang/python/setup_pip.py
SunguckLee/real-mongodb
4
19128
<gh_stars>1-10 #!/usr/bin/env python # # Public Domain 2014-2016 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source c...
1.085938
1
2022-02-24-ftx-rest-api-python/local_settings.py
georgehaan/analyzingalpha
0
19129
<gh_stars>0 ftxus = { 'api_key':'YOUR_API_KEY', 'api_secret':'YOUR_API_SECRET' }
1.15625
1
src/rechub/parameters.py
yusanshi/easy-rec
0
19130
import argparse from distutils.util import strtobool def str2bool(x): return bool(strtobool(x)) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--num_epochs', type=int, default=1000) parser.add_argument('--learning_rate', type=float, default=0.0005) parser.add_argument...
2.703125
3
course_difficulty.py
ewang26/dailytimedschedule
0
19131
# <NAME> # CSC 630 # Course Difficulty.py file # have each homework assignment be ranked based on difficulty of the course and on difficulty of the assignment itself # list_of_courses_and_difficulty only takes into consideration the difficulty of the course, not the assignment from array import * # install numpy in...
3.875
4
src/esss_fix_format/hooks.py
nicoddemus/esss_fix_format
20
19132
<filename>src/esss_fix_format/hooks.py import abc import textwrap class GitHook(metaclass=abc.ABCMeta): """ Base class to define a Git hook usable by `hooks` task. """ @abc.abstractmethod def name(self): """ :rtype: unicode :return: Name of hook. """ @abc.abst...
2.546875
3
Solutions/print all subset.py
Adityasriram0901/Python-Thunder
81
19133
<reponame>Adityasriram0901/Python-Thunder<gh_stars>10-100 a = [1, 2, 3, 4] def subset(a, n): if n == 1: return n else: return (subset(a[n - 1]), subset(a[n - 2])) print(subset(a, n=4))
3.46875
3
trees/dasgupta/__init__.py
islamazhar/trees
0
19134
from trees.dasgupta.costtree import DasguptaTree
0.996094
1
examples/references/segmentation/pascal_voc2012/code/scripts/training.py
1nF0rmed/ignite
0
19135
# This a training script launched with py_config_runner # It should obligatory contain `run(config, **kwargs)` method import sys from collections.abc import Mapping from pathlib import Path import torch from apex import amp from dataflow.datasets import VOCSegmentationOpencv from py_config_runner.config_utils import ...
2.015625
2
src/instaBot.py
pabloqb2000/py-instabot
0
19136
<gh_stars>0 from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep from tqdm import tqdm import random from EmailSender import * class InstagramBot: # Creates object and starts the browser def __init__(self, username, password): print("Hi, i'm ...
2.84375
3
Python/03 - Strings/String Formatting.py
sohammanjrekar/HackerRank
0
19137
def print_formatted(number): # your code goes here for i in range(1, number +1): width = len(f"{number:b}") print(f"{i:{width}} {i:{width}o} {i:{width}X} {i:{width}b}")
3.84375
4
BattleCity-NES/main.py
iOsnaaente/Kata-train_Code
0
19138
#! usr/bin/dev python from stages import Stages #Le as fases from code import tanks #Responsável pelos tanques do player from images import imagens #imagens do jogo import pygame import random screen_Dimension=[32*20,32*20] pygame.init() screen = pygame.display.set_mode(screen_Dimension) pygame.display....
2.703125
3
n_queens.py
lkk7/n-queens-genetic-solver
0
19139
from typing import Dict from numba import njit import numpy as np import matplotlib.pyplot as plt plt.rcParams['image.cmap'] = 'binary' def read_parameters(filename: str) -> Dict[str, float]: """Read parameters from a file to a dictionary and return it.""" parameters = {} with open(filename, "r") as file:...
3.28125
3
tests/plugins/test_ustreamtv.py
RomanKornev/streamlink
2
19140
<reponame>RomanKornev/streamlink import unittest from streamlink import Streamlink try: from unittest.mock import ANY, MagicMock, call except ImportError: from mock import ANY, MagicMock, call from streamlink.plugins.ustreamtv import UStreamTV class TestPluginUStreamTV(unittest.TestCase): def test_can_h...
2.609375
3
tests/test_xgboost.py
ak110/dl_allinone
1
19141
<filename>tests/test_xgboost.py<gh_stars>1-10 def test_run(): import sklearn.datasets import xgboost data = sklearn.datasets.load_boston() X, y = data.data, data.target # pylint: disable=no-member xgb = xgboost.XGBRegressor(n_estimators=3) xgb.fit(X[:100], y[:100]) assert xgb.predict(X[10...
2.484375
2
test/unit/object/test_collaboration_allowlist_entry.py
box/box-python-sdk
367
19142
<gh_stars>100-1000 # coding: utf-8 from __future__ import unicode_literals, absolute_import from boxsdk.config import API def test_get(mock_box_session, test_collaboration_allowlist_entry): entry_id = test_collaboration_allowlist_entry.object_id expected_url = '{0}/collaboration_whitelist_entries/{1}'.format...
1.960938
2
jumpy/setup.py
bharadwaj1098/brax
1,162
19143
<filename>jumpy/setup.py # Copyright 2021 The Brax 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 applicabl...
1.40625
1
spatial_interpolators/radial_basis.py
tsutterley/spatial-interpolators
18
19144
#!/usr/bin/env python u""" radial_basis.py Written by <NAME> (01/2022) Interpolates data using radial basis functions CALLING SEQUENCE: ZI = radial_basis(xs, ys, zs, XI, YI, polynomial=0, smooth=smooth, epsilon=epsilon, method='inverse') INPUTS: xs: scaled input X data ys: scaled input Y data ...
2.90625
3
oldstuff/api1.py
miusuarioamigo/python-Le
0
19145
from flask import Flask, jsonify, request app = Flask(__name__) @app.route('/', methods =['GET', 'POST']) def index(): if (request.method == 'POST'): some_json = request.get_json() return jsonify({'you sent': some_json}),201 else: return jsonify({"about" : "Hello World!"}) @app.route('...
3.140625
3
tests/mock/tests/settings.py
magicjoey/django-knowledge
199
19146
<gh_stars>100-1000 from mock.tests.base import TestCase from django.test.client import Client from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from knowledge import settings from knowledge.models import Question, Response from ...
2.3125
2
Batch_sentiment/spark_hashtag.py
malli3131/SparkApps
3
19147
import re import string import sys from pyspark import SparkContext exclude = set(string.punctuation) def get_hash_tag(word, rmPunc): pattern = re.compile("^#(.*)") m = pattern.match(word) tag = None if m: match = m.groups() for m_word in match: tag = ''.join(letter for letter in m_word...
2.84375
3
backend/apps/risks/urls.py
intellisense/risks
0
19148
from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns from . import views urlpatterns = [ url(r'^risks/$', views.RiskTypeList.as_view(), name='risks_list'), url(r'^risks/(?P<pk>[0-9]+)/$', views.RiskTypeDetail.as_view(), name='risk_details'), url(r'^fields/$', views...
2.015625
2
src/main.py
sguzman/Dbase_Channel_Grab
0
19149
<gh_stars>0 import json import bs4 import requests url_base = 'https://dbase.tube/chart/channels/subscribers/all?page=%s&spf=navigate' max_page = 19084 html_doc = requests.get(url_base).text for i in range(max_page): url = url_base % i hot_bod = requests.get(url).text json_blob = json.loads(hot_bod) h...
2.640625
3
Leetcode/322. Coin Change/solution1.py
asanoviskhak/Outtalent
51
19150
class Solution: def coinChange(self, coins: List[int], amount: int) -> int: dp = [inf] * (amount + 1) dp[0] = 0 for coin in coins: for x in range(coin, amount + 1): dp[x] = min(dp[x], dp[x - coin] + 1) return dp[amount] if dp[amount] != inf else -1
3.046875
3
kanban_board/admin.py
Zeerooth/django-kanban-board
0
19151
<reponame>Zeerooth/django-kanban-board<gh_stars>0 from django.contrib import admin from ordered_model.admin import OrderedStackedInline, OrderedInlineModelAdminMixin from kanban_board.models import KanbanBoard, KanbanBoardState, Workflow, KanbanBoardElement class KanbanBoardAdmin(admin.ModelAdmin): list_display = ...
1.929688
2
certbot-nginx/certbot_nginx/tests/nginxparser_test.py
jcollie/certbot
4
19152
"""Test for certbot_nginx.nginxparser.""" import copy import operator import tempfile import unittest from pyparsing import ParseException from certbot_nginx.nginxparser import ( RawNginxParser, loads, load, dumps, dump, UnspacedList) from certbot_nginx.tests import util FIRST = operator.itemgetter(0) class T...
2.828125
3
src/python/pants/jvm/resolve/coursier_setup.py
Eric-Arellano/pants
0
19153
<gh_stars>0 # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import textwrap from dataclasses import dataclass from typing import ClassVar, Iterable from pants.core.util_rules.external_tool import ( ...
1.921875
2
app/emails/__init__.py
zollf/CITS3200
0
19154
<filename>app/emails/__init__.py from django.apps import AppConfig class EmailAppConfig(AppConfig): name = 'app.emails' label = 'email_app' verbose_name = 'Emails App' default_app_config = 'app.emails.EmailAppConfig'
1.609375
2
polyaxon_schemas/layers/core.py
gzcf/polyaxon-schemas
0
19155
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from marshmallow import fields, post_dump, post_load, validate from polyaxon_schemas.constraints import ConstraintSchema from polyaxon_schemas.initializations import ( GlorotNormalInitializerConfig, Initialize...
2.46875
2
tests/unit/models/cardlesscredit/test_create_payment.py
glendaesutanto/xendit-python
10
19156
import pytest from ..model_base_test import ModelBaseTest from tests.sampleresponse.cardless_credit import cardless_credit_payment_response from xendit.models import CardlessCredit, CardlessCreditType # fmt: off class TestCreateCardlessCreditPayment(ModelBaseTest): @pytest.fixture def default_cardles...
2.421875
2
docs/examples/http_proxy/constructor_argument.py
dupontz/libcloud
4
19157
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver PROXY_URL_NO_AUTH_1 = 'http://<proxy hostname 1>:<proxy port 2>' cls = get_driver(Provider.RACKSPACE) driver = cls('username', 'api key', region='ord', http_proxy=PROXY_URL_NO_AUTH_1)
1.742188
2
cakechat/dialog_model/factory.py
jacswork/cakechat
1
19158
import os from cakechat.config import BASE_CORPUS_NAME, S3_MODELS_BUCKET_NAME, S3_TOKENS_IDX_REMOTE_DIR, \ S3_NN_MODEL_REMOTE_DIR, S3_CONDITIONS_IDX_REMOTE_DIR from cakechat.dialog_model.model import get_nn_model from cakechat.utils.s3 import S3FileResolver from cakechat.utils.text_processing import get_index_to_t...
1.984375
2
WhileLoop/GraduationPt.2.py
Rohitm619/Softuni-Python-Basic
1
19159
name = input() class_school = 1 sum_of_grades = 0 ejected = False failed = 0 while True: grade = float(input()) if grade >= 4.00: sum_of_grades += grade if class_school == 12: break class_school += 1 else: failed += 1 if failed == 2: ejected ...
3.828125
4
NAO/train_cifar.py
yaogood/NAS-tensorflow2
0
19160
import os import sys import glob import time import copy import random import numpy as np import utils import logging import argparse import tensorflow as tf import tensorflow.keras as keras from model import NASNetworkCIFAR os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # os.environ['CUDA_VISIBLE_DEVICES'] = '1' # Basic m...
1.953125
2
examples/regression.py
Spotflock/studio-sdk-python
8
19161
<reponame>Spotflock/studio-sdk-python import studio def main(): c = studio.StudioClient('xxx') # put your app key here. # REGRESSION test_data = "" train_data = "" test_file_store_response = c.store('../csv/housing_test.csv') print(test_file_store_response) test_data = test_file_store_res...
2.40625
2
VAE/models/vae_mnist.py
Aroksak/generative-dl
0
19162
<filename>VAE/models/vae_mnist.py import torch import torch.nn as nn class Encoder(nn.Module): def _conv_layer_factory(self, input_channels, output_channels, **kwargs): return nn.Sequential( nn.Conv2d(input_channels, output_channels, **kwargs), nn.LeakyReLU(), ) def __...
2.671875
3
json-read.py
ccoffrin/py-json-examples
0
19163
<reponame>ccoffrin/py-json-examples #!/usr/bin/env python3 import json data_json = {} with open('data/json_00.json', 'r') as file: data_json = json.load(file) print(data_json) print(data_json[0]) print(data_json[1]) print(data_json[2]) print(data_json[3]) print(data_json[4]) print(data_json[5]) print(data_json...
3.34375
3
api_python/app/models/classes_basicas/Empregado.py
uninassau-2020-2/proj-grupo5
0
19164
from app.models.classes_basicas.Pessoa import Pessoa class Empregado(Pessoa): id_empregado = None def getIdEmpregado(self): return self.id_empregado def setIdEmpregado(self, id_empregado): self.id_empregado = id_empregado
2.5
2
tests/python/pants_test/pants_run_integration_test.py
WamBamBoozle/pants
0
19165
<reponame>WamBamBoozle/pants<gh_stars>0 # coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literal...
2.078125
2
ireporterApp/migrations/0001_initial.py
George-Okumu/IReporter-Django
0
19166
<filename>ireporterApp/migrations/0001_initial.py<gh_stars>0 # Generated by Django 3.2.8 on 2021-10-13 16:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import ireporterApp.models class Migration(migrations.Migration): initial = True dependenci...
1.648438
2
ethronsoft/gcspypi/parsers/list.py
JuergenSimon/gcspypi
0
19167
from ethronsoft.gcspypi.package.package_manager import PackageManager from ethronsoft.gcspypi.utilities.console import Console from ethronsoft.gcspypi.parsers.commons import init_repository def handle_(config, data): with Console(verbose=config.get("verbose", False), exit_on_error=True) as c: repo = init_r...
2.328125
2
library/oci_dhcp_options.py
slmjy/oci-ansible-modules
106
19168
<reponame>slmjy/oci-ansible-modules #!/usr/bin/python # Copyright (c) 2017, 2018, 2019, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ...
1.710938
2
canistream.py
otakucode/canistream
0
19169
<filename>canistream.py #!/usr/bin/env python3 __author__ = 'otakucode' import argparse import sys from urllib import parse from bs4 import BeautifulSoup import requests def get_title(search_type, search_title): search_encoded = parse.quote(search_title) page = requests.get('http://www.canistream.it/search/...
2.75
3
homeassistant/components/hardware/const.py
liangleslie/core
30,023
19170
<filename>homeassistant/components/hardware/const.py """Constants for the Hardware integration.""" DOMAIN = "hardware"
1.046875
1
packages/_debug_app/app.py
shellyln/red-agate
14
19171
<filename>packages/_debug_app/app.py<gh_stars>10-100 #!/usr/bin/env python3 import json import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../red-agate/') # pylint: disable=import-error, wrong-import-position from redagate_lambda import call, LambdaInternalErrorException # pylint: ena...
2.03125
2
cmsplugin_cascade/migrations/0009_cascadepage.py
teklager/djangocms-cascade
139
19172
<gh_stars>100-1000 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('cms', '0013_urlconfrevision'), ('cmsplugin_cascade', '0008_sortableinlinecascadeelement'), ] operations = [ migrations.CreateMode...
1.742188
2
es_import_poet.py
ly3too/chinese-poetry
0
19173
from elasticsearch_dsl import * import os from glob import glob import json import re from . import to_zh_cn class Poet(Document): dynasty = Text() author = Text() title = Text(analyzer='jieba_index', search_analyzer='jieba_search') paragraphs = Text(analyzer='jieba_index', search_analyzer='jieba_sear...
2.625
3
pyenvgui/gui/components/_version_management.py
ulacioh/pyenv-gui
2
19174
<gh_stars>1-10 from threading import Thread import tkinter as tk from tkinter import ttk, messagebox from . import pyenv from ._custom_widgets import Treeview class VersionManagementFrame(ttk.Frame): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Installed versions op...
2.5
2
Week11/765.py
bobsingh149/LeetCode
101
19175
class Solution: def minSwapsCouples(self, row: List[int]) -> int: parent=[i for i in range(len(row))] for i in range(1,len(row),2): parent[i]-=1 def findpath(u,parent): if parent[u]!=u: parent[u]=findpath(parent[u],parent) ...
2.875
3
proj/python/Test/dictStock.py
jumib/BlackTensor
0
19176
import requests # host = 'localhost:8080' # path = '/member/changeAppId' # payload = {'UserId' : userId } # r = requests.get('localhost:8080/member/changeAppId', params=payload) # import requests # import json # # # GET # res = requests.get('http://localhost:8080/member/changeAppId') # print(str(res.status_code) + " ...
2.796875
3
screen_scan.py
vjeranc/puzpirobot
0
19177
from PIL import ImageGrab, Image import cv2 as cv import numpy as np import match.template_matching as tm import match.bilging as b from mss import mss def grab_screen(): img_src = ImageGrab.grab() return cv.cvtColor(np.array(img_src.convert('RGB')), cv.COLOR_RGB2BGR) class ScreenGrabber(object): def gr...
2.40625
2
simulacoes/queue-sim/src/eventoSaidaFilaZero.py
paulosell/ADS29009
0
19178
<gh_stars>0 from src.event import Event from src.rng import prng from src.eventoChegadaFilaUm import EventoChegadaFilaUm from src.eventoChegadaFilaDois import EventoChegadaFilaDois class EventoSaidaFilaZero(Event): def __init__(self,t,i): super().__init__(t,i) def processEvent(self, simulado...
2.140625
2
examples/camera/simple.py
Hikki12/remio
0
19179
<filename>examples/camera/simple.py<gh_stars>0 """Single simple camera example.""" import time from remio import Camera # Initialize Single Camera device camera = Camera(name="webcam", src=0, size=[400, 400]) camera.start() while True: print("Doing some tasks...") time.sleep(2)
2.546875
3
write_cluster_wrappers.py
jrbourbeau/cr-composition
0
19180
<reponame>jrbourbeau/cr-composition #!/usr/bin/env python from __future__ import print_function import os import stat import comptools as comp here = os.path.abspath(os.path.dirname(__file__)) wrapper_path = os.path.join(here, 'wrapper.sh') wrapper_virtualenv_path = os.path.join(here, 'wrapper_virtualenv.sh') wrappe...
2.265625
2
labml_nn/gan/dcgan/__init__.py
BioGeek/annotated_deep_learning_paper_implementations
1
19181
""" --- title: Deep Convolutional Generative Adversarial Networks (DCGAN) summary: A simple PyTorch implementation/tutorial of Deep Convolutional Generative Adversarial Networks (DCGAN). --- # Deep Convolutional Generative Adversarial Networks (DCGAN) This is a [PyTorch](https://pytorch.org) implementation of paper [...
3.296875
3
src/flexible_models/flexible_GPT2.py
AlexDuvalinho/AITextGenerator
36
19182
<reponame>AlexDuvalinho/AITextGenerator<filename>src/flexible_models/flexible_GPT2.py<gh_stars>10-100 from .flexible_model import FlexibleModel from src.utils import GPT2_BLOCK_SIZE import torch from src.flexible_models.GPT2_lm_segment_model import GPT2LMSegmentModel class FlexibleGPT2(FlexibleModel): """ A Flexib...
2.625
3
measurements-plot/udp-plots.py
HaoruiPeng/latencymeasurement
0
19183
import os import sys import pandas as pd import numpy as np import scipy.stats as st import matplotlib.pyplot as plt def read_udp(file_path): with open(file_path, "r") as f: data_dict = {'send':{}, 'rec':{}} data = pd.read_csv(file_path, sep=",", engine='python', error_bad_lines=False, skiprows=1) ...
2.234375
2
nitorch/core/pyutils.py
wyli/nitorch
1
19184
<reponame>wyli/nitorch """Python utilities.""" import os import functools from types import GeneratorType as generator import warnings from collections import Counter def file_mod(s, nam='', prefix='', suffix='', odir='', ext=''): """Modify a file path. Parameters ---------- s : str File path...
2.640625
3
danceschool/prerequisites/handlers.py
benjwrdill/django-danceschool
1
19185
<reponame>benjwrdill/django-danceschool from django.dispatch import receiver from django.contrib import messages from django.core.exceptions import ValidationError from django.utils.translation import ugettext from django.utils.html import format_html from django.utils.safestring import mark_safe from dancescho...
1.90625
2
b9_tools.py
eoinnoble/b9-indifference
9
19186
import re from collections.abc import MutableMapping from typing import Dict, List import markovify import nltk class RangeDict(MutableMapping): """Enables a dictionary whose keys are ranges.""" def __init__(self, iterable: Dict): if not isinstance(iterable, dict): raise TypeError("You m...
2.90625
3
live_visualisation.py
duyanh-y4n/DJITelloPy
0
19187
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : live_visualisation.py # Author : <NAME> <<EMAIL>> # Date : 10.04.2020 # Last Modified By: <NAME> <<EMAIL>> from djitellopy.realtime_plot.RealtimePlotter import * import redis import numpy as np import traceback import matplotlib #...
2.265625
2
app/cli.py
dev-johnlopez/Assignably
1
19188
<filename>app/cli.py import os import click from app import app from flask.cli import with_appcontext from app.auth.models import Role def register(app): @app.cli.group() def translate(): """Translation and localization commands.""" pass @translate.command() @click.argument('lang') ...
2.59375
3
autobasedoc/tableofcontents.py
NuCOS/autobasedoc
3
19189
<reponame>NuCOS/autobasedoc """ tableofcontents =============== .. module:: tableofcontents :platform: Unix, Windows :synopsis: a tableofcontents that breaks not to the next frame but to the next page .. moduleauthor:: <NAME> """ from reportlab import rl_config from reportlab.platypus import Table, Paragraph, ...
2.515625
3
conans/test/model/username_test.py
jbaruch/conan
0
19190
import unittest from conans.errors import ConanException from conans.model.username import Username class UsernameTest(unittest.TestCase): def username_test(self): Username("userwith-hypens") self.assertRaises(ConanException, Username, "") self.assertRaises(ConanException, Username, "A"*...
3.09375
3
exercises/01_Primeiros Passos/exe_08.py
MariaTrindade/CursoPython
1
19191
<filename>exercises/01_Primeiros Passos/exe_08.py """ Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. C = (5 * (F-32) / 9) """
2.578125
3
throwaway/viz_nav_policy.py
sfpd/rlreloaded
0
19192
<gh_stars>0 #!/usr/bin/env python from control4.algs.save_load_utils import load_agent_and_mdp from control4.core.rollout import rollout from tabulate import tabulate import numpy as np import pygame from control3.pygameviewer import PygameViewer, pygame from collections import namedtuple from copy import deepcopy pat...
2
2
utils/compilers/ConnectionCompiler/token.py
pranaOS-bot/pranaOS-1
5
19193
class Token: def __init__(self, type=None, value=None): self.type = type self.value = value def __str__(self): return "Token({0}, {1})".format(self.type, self.value)
3.296875
3
echopype/echodata/convention/attrs.py
b-reyes/echopype
0
19194
<filename>echopype/echodata/convention/attrs.py """ Define convention-based global, coordinate and variable attributes in one place for consistent reuse """ DEFAULT_BEAM_COORD_ATTRS = { "frequency": { "long_name": "Transducer frequency", "standard_name": "sound_frequency", "units": "Hz", ...
2.234375
2
tf_tests.py
MadsJensen/agency_connectivity
0
19195
<filename>tf_tests.py import mne import numpy as np import matplotlib.pyplot as plt from scipy import stats import seaborn as sns from tf_analysis import single_trial_tf plt.ion() data_folder = "/home/mje/Projects/agency_connectivity/data/" epochs = mne.read_epochs(data_folder + "P2_ds_bp_ica-epo.fif") # single tr...
2.1875
2
data/smth.py
roeiherz/AG2Video
22
19196
<reponame>roeiherz/AG2Video<filename>data/smth.py import json import os import pickle as pkl import random import math import numpy as np import pandas as pd import torch from torch.utils.data import Dataset import torchvision.transforms as T import torch.nn.functional as F from PIL import Image from data.SomethingElse...
2.1875
2
user_login.py
pieddro/football
0
19197
<filename>user_login.py<gh_stars>0 Meine neuer Code.. Neue Codezeile .... Tst stash zum 2. mal
0.976563
1
refstack/api/controllers/__init__.py
jovial/refstack
0
19198
<filename>refstack/api/controllers/__init__.py # Copyright (c) 2015 Mirantis, 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.apach...
1.6875
2
main.py
superwaiwjia/lowRankForSeer
2
19199
#!/usr/bin/env python #coding=utf-8 import pickle import sys, os, re, subprocess, math reload(sys) sys.setdefaultencoding("utf-8") from os.path import abspath, dirname, join whereami = abspath(dirname(__file__)) sys.path.append(whereami) from sklearn.metrics import roc_auc_score import pandas as pd import numpy as np ...
2.40625
2