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
backend/apps/users/filters.py
playonefor/turiy
0
46300
<filename>backend/apps/users/filters.py from django_filters import rest_framework as filters from django.db.models import Q from django.contrib.auth import get_user_model from users.models import tGroup User = get_user_model() class UsersFilter(filters.FilterSet): ''' 用户过滤 ''' username = filters.Ch...
2.078125
2
server/src/main/resources/cloudFoundry/deployment_scripts/replace.py
miwurster/TOSCAna
0
46301
<reponame>miwurster/TOSCAna import sys import fileinput def main(): strFileName = sys.argv[1] strFind = sys.argv[2] strReplace = sys.argv[3] replaceInFile(strFileName, strFind, strReplace) def replaceInFile(fileName, strFind, strReplace): sourceFile = open(fileName, "r") content_file = sourceF...
3.578125
4
tests/unit/app/test_lambda_handler.py
Sage-Bionetworks-IT/lambda-sc-coster-meter
0
46302
<filename>tests/unit/app/test_lambda_handler.py import unittest from unittest.mock import patch from sc_cost_meter import app class TestLambdaHandler(unittest.TestCase): @patch('sc_cost_meter.utils.get_marketplace_synapse_ids') @patch('sc_cost_meter.utils.report_cost') def test_no_customers(self, ...
2.546875
3
1704/207/war.py
bdbaddog/dummy-for-migration-attachments
0
46303
<filename>1704/207/war.py """SCons.Tool.war Tool-specific initialization for zip. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation # # Permission ...
2.078125
2
tests/test_module.py
janezlapajne/python-project-template
0
46304
<gh_stars>0 import pytest import os, glob #import source.module as mod #import tests.helpers as hlp def test_module_func(): assert True
1.5
2
SBaaS_LIMS/lims_oligos_query.py
dmccloskey/SBaaS_LIMS
0
46305
from .lims_oligos_postgresql_models import * from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop from SBaaS_base.sbaas_base_query_initialize import sbaas_base_query_initialize from SBaaS_base.sbaas_base_query_insert import sbaas_base...
2
2
scrapy_camouflage/middleware.py
tianhuil/scrapy-camouflage
0
46306
<reponame>tianhuil/scrapy-camouflage from abc import ABC, abstractmethod import logging from scrapy.downloadermiddlewares.retry import RetryMiddleware from .user_agent import random_user_agent logger = logging.getLogger(__name__) # pylint: disable=invalid-name class CamouflageMiddleware(ABC): def __init__(self, ...
2.3125
2
examples/parse_by_sol.py
sluzhynskyi/nasa
4
46307
import json import urllib.request import pprint import webbrowser URL = "https://mars.jpl.nasa.gov/msl-raw-images/image/images_sol2320.json" jsonFILE = json.loads(urllib.request.urlopen(URL).read()) #pprint.pprint(jsonFILE) camera = jsonFILE['images'][0]['cameraModelType'] sol = jsonFILE['images'][0]['sol'] link = j...
3.0625
3
libs/request/header_const.py
jumper2014/http-api-test-framework-python-pytest
0
46308
#!/usr/bin/env python # coding=utf-8 # author: zengyuetian content_type_json = {'Content-Type': 'application/json'} accept_type_json = {'Accept': 'application/json'} if __name__ == "__main__": pass
1.34375
1
atmosphere/group.py
eriksf/atmosphere-cli
7
46309
import logging from cliff.lister import Lister from cliff.show import ShowOne from atmosphere.api import AtmosphereAPI class GroupList(Lister): """ List groups for a user. """ log = logging.getLogger(__name__) def take_action(self, parsed_args): column_headers = ('uuid', 'name') ...
2.4375
2
splearn/cluster/tests/test_k_means.py
dtrckd/sparkit-learn
1,219
46310
import numpy as np from sklearn.cluster import KMeans from splearn.cluster import SparkKMeans from splearn.utils.testing import SplearnTestCase, assert_array_almost_equal class TestKMeans(SplearnTestCase): def test_same_centroids(self): X, y, X_rdd = self.make_blobs(centers=4, n_samples=200000) ...
2.71875
3
test/test_worker.py
pstray/act-workers
0
46311
""" Tests for worker """ import sys import _pytest import act.api import pytest from act.api.base import ValidationError from act.api.helpers import handle_fact from act.api.libs import cli from act.types.format import object_format from act.types.types import object_validates from act.workers.libs import worker de...
2.3125
2
tcpreq/tcp/options.py
TheJokr/tcpreq
18
46312
<reponame>TheJokr/tcpreq from typing import TypeVar, Type, Dict, Union, Generator # Options are immutable class BaseOption(object): """Common base class for all options.""" __slots__ = ("_raw",) def __init__(self, data: bytes) -> None: self._raw = data def __len__(self) -> int: retur...
2.71875
3
setup.py
DRealArun/deep_architect
0
46313
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='darch', # Versions ...
1.625
2
inter_graph_2.py
fernandorazon/blmsat
0
46314
<reponame>fernandorazon/blmsat<gh_stars>0 #Adicionalmente, para poder tratar a nuestra ventana como un objeto con sus atributos como los deseamos #Se puede declarar una clase heredera de la clase tk con los atributos deseados from tkinter import * from tkinter import ttk from cansat import testLogLineString...
3.359375
3
pysnake/__main__.py
otov4its/pysnake
0
46315
import curses from .game import Game def go(stdscr): Game(stdscr).run() # Start game def main(): # Curses convinient wrapper curses.wrapper(go) if __name__ == '__main__': main()
1.890625
2
tests/factories/test_inquest.py
nickjcoco/eml_analyzer
0
46316
<filename>tests/factories/test_inquest.py<gh_stars>0 import json import pytest import respx from app.factories.inquest import InQuestVerdict, InQuestVerdictFactory def test_inquest_verdict(inquest_dfi_details_response: str): sha256 = "e86c5988a3a6640fb90b90b9e9200e4cce0669594dbb5422622946208c124149" dict_ =...
2.328125
2
lib/Protocol/NVRDriverCLIProtocol.py
multi-service-fabric/element-manager
0
46317
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: NVRDriverCLIProtocol.py import traceback import re import GlobalModule from EmCommonLog import decorater_log from CgwshDriverCLIProtocol import CgwshDriverCLIProtocol class NVRDriverCL...
2.078125
2
course2/lesson13/messagePrep.py
dbrandenburg/python-oreilley-certification
0
46318
<gh_stars>0 #!/usr/bin/env python3 import settings from datetime import timedelta from datetime import datetime from email.mime.text import MIMEText from email.utils import make_msgid from database import login_info import mysql.connector as msc conn = msc.Connect(**login_info) conn.autocommit = True curs = conn.cur...
2.984375
3
setup.py
davvid/skeletor
2
46319
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 <NAME> (davvid -at- gmail.com) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import os try: import setuptools as setup_mod except ImportError:...
1.5
2
flaskcli_pkg/templates/restfull/__init__.py
guxal/Flask-CLI
1
46320
<gh_stars>1-10 from flask import Blueprint app_views = Blueprint('app_views', __name__, url_prefix='/api/v1') from api.v1.views.index import * # noqa ''' from api.v1.views.<file> import * # noqa '''
1.382813
1
dependencies/otp/17.1/erts/etc/unix/etp-thr.py
mosaic-cloud/mosaic-distribution-dependencies
0
46321
<reponame>mosaic-cloud/mosaic-distribution-dependencies # # %CopyrightBegin% # # Copyright Ericsson AB 2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have rec...
1.304688
1
example/cbs_example.py
bulletRush/QCloud_yunapi_wrapper
0
46322
<reponame>bulletRush/QCloud_yunapi_wrapper #!/usr/bin/env python import unittest from qcloudsdk import ZoneId, CbsStorageType, Region, get_region_list, RegionConfig from config import engine class CbsTestCase(unittest.TestCase): def setUp(self): print("\n{0} BEGIN TEST: {1} {2}".format('*' * 20, self._tes...
2.171875
2
data/punctuation/punctuation.py
wongself/CCLUE
19
46323
# coding=utf-8 # Copyright 2020 HuggingFace Datasets 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 applica...
2.4375
2
vk/commands/layer.py
shihchinw/vkcli
0
46324
import click import vk.config as config import vk.utils as utils from vk.commands.query import show_layer_state def _add_layers(layer_str, current_layers, set_layers_func): """Append layers to current_layers and set to device props. Args: layer_str: A string in <layer1:layer2:layerN> format. ...
2.46875
2
Message_sync.py
ethansun666/Torsobot
0
46325
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import rospy import message_filters from std_msgs.msg import Int32, Float32 from pololu_drv8835_rpi import motors rospy.init_node('message_sync', anonymous=False) speed_desired = 0.5 # desired wheel speed in rpm angle_desired = 0.0 # desired angle - 0 k_p_angle = 4*480...
2.796875
3
sqlalchemy/sqlalchemy-0.3.6+codebay/test/tables.py
nakedible/vpnease-l2tp
5
46326
from sqlalchemy import * import os import testbase ECHO = testbase.echo db = testbase.db metadata = BoundMetaData(db) users = Table('users', metadata, Column('user_id', Integer, Sequence('user_id_seq', optional=True), primary_key = True), Column('user_name', String(40)), mysql_engine='innodb' ) address...
2.4375
2
camelot/view/controls/editors/timeeditor.py
FrDeGraux/camelot
12
46327
<reponame>FrDeGraux/camelot<filename>camelot/view/controls/editors/timeeditor.py # ============================================================================ # # Copyright (C) 2007-2016 Conceptive Engineering bvba. # www.conceptive.be / <EMAIL> # # Redistribution and use in source and binary forms, with or withou...
1.15625
1
utils/__init__.py
CSuppan/two-shot-brdf-shape
0
46328
<filename>utils/__init__.py # ----------------------------------------------------------------------- # Copyright (c) 2020, NVIDIA Corporation. All rights reserved. # # This work is made available # under the Nvidia Source Code License (1-way Commercial). # # Official Implementation of the CVPR2020 Paper # Two-shot Spa...
1.210938
1
desafio032.py
marcelocmedeiros/RevisaoPython
0
46329
<reponame>marcelocmedeiros/RevisaoPython<filename>desafio032.py # <NAME> # ADS UNIFIP # REVISÃO DE PYTHON # AULA 10 CONDIÇÕES <NAME> ''' Faça um Programa que leia um ano qualquer e mostre se ele é BISSEXTO. ''' print('='*30) print('{:#^30}'.format(' ANO BISSEXTO ')) print('='*30) print() ano = int(input('Informe o a...
3.84375
4
exams/migrations/0008_populate_exam_run.py
Wassaf-Shahzad/micromasters
32
46330
<filename>exams/migrations/0008_populate_exam_run.py # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-04-24 19:10 from __future__ import unicode_literals from datetime import datetime from django.db import migrations import pytz PILOT_SERIES_CODE = 'PILOT' PILOT_SCHEDULE_START_DATE = datetime(2017, 3, 6,...
2.234375
2
hdg_test/anistropic/cg_test.py
BradHub/SL-SPH
1
46331
<filename>hdg_test/anistropic/cg_test.py import numpy as np import dolfin from dolfin import * from mpi4py import MPI as pyMPI comm = pyMPI.COMM_WORLD mpi_comm = MPI.comm_world #mark whole boundary, inflow and outflow will overwrite) class Noslip(SubDomain): def inside(self, x, on_boundary): return on_bou...
2.296875
2
Contents/Code/__init__.py
donmikel/TorrServer.bundle
5
46332
# -*- coding: utf-8 -*- # Copyright (c) 2016, KOL # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
1.570313
2
test_meeus.py
mcoatanhay/meeuscalc
0
46333
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Fichier: test_meeus.py # Auteur: <NAME> """ Tests pour le module meeus. """ # Import des modules try: import mes_modules_path except: pass from meeus import * import incertitudes.incert as incert import unittest # Définitions constantes et v...
2.671875
3
pymtl3/stdlib/test/__init__.py
mondO/pymtl3
1
46334
<reponame>mondO/pymtl3 from .test_sinks import TestSinkCL from .test_srcs import TestSrcCL from .test_utils import ( TestVectorSimulator, mk_test_case_table, run_sim, run_test_vector_sim, )
1.054688
1
mindhome_alpha/erpnext/assets/doctype/asset/depreciation.py
Mindhome/field_service
1
46335
<filename>mindhome_alpha/erpnext/assets/doctype/asset/depreciation.py # -*- coding: utf-8 -*- # Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, t...
1.835938
2
ssd/modeling/backbone/backbone_cfg.py
xu-peng-tao/SSD-Pruning-and-quantization
19
46336
# !/usr/bin/env python # coding:utf-8 # Author:XuPengTao # Date: 2020/3/14 from ssd.layers import L2Norm import torch.nn.functional as F import torch.nn as nn import torch from ssd.modeling import registry import os import quantization.WqAq.dorefa.models.util_wqaq as dorefa import quantization.WqAq.IAO.models.util_wqaq...
1.898438
2
vocoder/hifigan/env.py
10088/MockingBird
1
46337
import os import shutil def build_env(config, config_name, path): t_path = os.path.join(path, config_name) if config != t_path: os.makedirs(path, exist_ok=True) shutil.copyfile(config, os.path.join(path, config_name))
2.34375
2
week06_deployment/homework/tests.py
mryab/efficient-dl-systems
85
46338
<filename>week06_deployment/homework/tests.py import json import os import statistics import grpc import requests from furl import furl import pytest import inference_pb2_grpc import inference_pb2 from prometheus_client.parser import text_string_to_metric_families @pytest.fixture(scope='session') def eval_data(): ...
2.359375
2
Medium/264. Ugly Number II/solution (1).py
czs108/LeetCode-Solutions
3
46339
<reponame>czs108/LeetCode-Solutions<gh_stars>1-10 # 264. Ugly Number II # Runtime: 173 ms, faster than 54.94% of Python3 online submissions for Ugly Number II. # Memory Usage: 14.2 MB, less than 73.79% of Python3 online submissions for Ugly Number II. class Solution: # Three Pointers def nthUglyNumber(self,...
3.40625
3
Game_AI_and_Reinforcement_Learning/ConnectX/v2/actor.py
BEPb/Python-100-days
16
46340
""" Python 3.9 программа самостоятельной игры агентов текущего и предыдущего покаления программа на Python по изучению обучения с подкреплением - Reinforcement Learning Название файла actor.py Version: 0.1 Author: <NAME> Date: 2021-12-23 """ import numpy as np import parl import os from alphazero_agent import create_a...
3.3125
3
app/routers/openstack/sizes.py
skyworkflows/swm-cloud-gate
3
46341
<reponame>skyworkflows/swm-cloud-gate import typing from fastapi import APIRouter, Header from .connector import OpenStackConnector from .models import convert_to_flavor CONNECTOR = OpenStackConnector() ROUTER = APIRouter() @ROUTER.get("/openstack/flavors") async def list_flavors(username: str = Header(None), pass...
2.234375
2
coselection/coselection.py
gaussit/coselection
0
46342
<reponame>gaussit/coselection import bz2 import itertools import pandas as pd from igraph import * from scipy.sparse import triu from scipy.sparse import csr_matrix from scipy.sparse import coo_matrix from sklearn.preprocessing import normalize def node_extractor(dataframe, *columns): """ Extracts the set of ...
2.875
3
tests/test_ptkcmd/myptkcmd.py
mmiguel6288code/ptkcmd
8
46343
from ptkcmd import PtkCmd, Completion, complete_files class MyPtkCmd(PtkCmd): prompt='MyPtkCmd$ ' def __init__(self,stdin=None,stdout=None,intro=None,interactive=True,do_complete_cmd=True,default_shell=False,**psession_kwargs): super().__init__(stdin,stdout,intro,interactive,do_complete_cmd,default_shel...
2.515625
3
bench/dash.py
mlcgp/bench
0
46344
<filename>bench/dash.py import pandas as pd import dash import os import base64 from inflection import humanize from pathlib import Path from sqlalchemy import create_engine, select, Table, MetaData from sqlalchemy.orm import Session from dash import dcc, html, Input, Output from dash.exceptions import PreventUpdate im...
2.546875
3
middleware.py
wjayesh/flask-prometheus
0
46345
<filename>middleware.py from flask import request import time import sys from prometheus_client import Counter, Histogram APP_REQUEST_COUNT_TOTAL = Counter( 'app_request_count_total', 'App Request Count Total', ['app_name', 'method', 'endpoint'] ) APP_REQUEST_COUNT_FAILED = Counter( 'app_request_count_fai...
2.3125
2
Beginner/03. Python/ZodiacSignTraits.py
DipadityaDas/Hacktoberfest
1
46346
<gh_stars>1-10 def showAries(): print("ARIES (March 21 – April 19)") print("") print("Aries is independent in nature, fun loving, impulsive and a tough cookie. You desire big goals and possess the determination to accomplish them without getting weakened by any hurdle. " + "The courage and amb...
2.859375
3
schema/views.py
leVirve-arxiv/OuO
0
46347
from schema.models import Member from django.shortcuts import render def save_userdata(backend, user, response, *args, **kwargs): if backend.name == 'facebook': try: profile = Member.objects.get(user_id=user.id) except Member.DoesNotExist: profile = Member(user_id=user.id) ...
2.21875
2
neural-navigation-with-lstm/MARCO/nltk/test/token.py
ronaldahmed/SLAM-for-ugv
14
46348
<filename>neural-navigation-with-lstm/MARCO/nltk/test/token.py # Natural Language Toolkit: Test Code for Tokens and Tokenizers # # Copyright (C) 2001 University of Pennsylvania # Author: <NAME> <<EMAIL>> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # # $Id: token.py,v 1.1.1.2 2004/09/29 21:58:...
3.375
3
alyBlog/apps/admin/contains.py
Hx-someone/aly-blog
1
46349
# -*- coding: utf-8 -*- """ @Time : 2020/3/13 13:39 @Author : 半纸梁 @File : contains.py """ PER_PAGE_NUMBER = 10 # 分页每页显示数据条数 IMAGE_MAX_SIZE = 5 * 1024 * 1024 # 5M 图片大小最大为5M IMAGE_EXT_NAME_LS = ["bmp", "jpg", "png", "tif", "gif", "pcx", "tga", "exif", "fpx", "svg", "psd", "cdr", "pcd", "dxf", "...
2.21875
2
test/ontology/__init__.py
eigendude/pysosa
0
46350
<gh_stars>0 ################################################################################ # # Copyright (C) 2019 <NAME> # This file is part of pysosa - https://github.com/eigendude/pysosa # # SPDX-License-Identifier: BSD-3-Clause # See the file LICENSE for more information. # ####################################...
1.453125
1
pymajorme/helpers/constraints.py
danielkupco/PyMaJORME
1
46351
<filename>pymajorme/helpers/constraints.py<gh_stars>1-10 class Constraints(object): ''' Contains all of the primary and foreign key constraint names for the given entity as tuples of entities and relations which are part of constraints ''' def __init__(self, pk_constraints, fk_constraints): ...
2.5625
3
implementation_files/cosim_pandapipes_pandapower/simulators/heat_consumer/__init__.py
ERIGrid2/benchmark-model-multi-energy-networks
0
46352
<reponame>ERIGrid2/benchmark-model-multi-energy-networks<gh_stars>0 from .mosaik_wrapper import HEXConsumerSimulator
0.925781
1
inventario/views.py
vvilche1/odin
0
46353
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404, render, redirect from django.urls import reverse from django.views import generic from django.views.generic import View from .pdf import * from .models import Campus, Usuario, Inventario, Libros,Issue,Resp,Cd fro...
2.046875
2
rsm/datasets/token_embedding_dataset.py
Cerenaut/rsm
0
46354
<gh_stars>0 # Copyright (C) 2019 Project AGI # # 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...
2.0625
2
setup.py
gkama/aiof-metadata
3
46355
<reponame>gkama/aiof-metadata from setuptools import setup, find_packages with open("README.md", encoding="utf-8") as f: readme = f.read() with open("LICENSE", encoding="utf-8") as f: license = f.read() if __name__ == "__main__": setup( name = "aiof-metadata", version = "0.1.0", ...
1.304688
1
pythonProjects/guess_number/guess_number.py
chisma/pythonProjects
0
46356
<gh_stars>0 import random def guess(x): random_number = random.randint(1, x) guess = 0 while guess != random_number: guess = int(input( f"Python generated a lucky number for you. It's your turn to GUESS the number now! Hint: Number is between 1 and {x}: ")) if guess < random_nu...
4.25
4
catalog/harvest/initial_harverster_s2.py
eoss-cloud/madxxx_catalog_api
0
46357
<reponame>eoss-cloud/madxxx_catalog_api #-*- coding: utf-8 -*- """ EOSS catalog system Reads sentinel2 data which is stored in AWS buckets extracted with 'aws s3 ls sentinel-s2-l1c/products/ --recursive --region=eu-central-1 | grep productInfo.json' [ """ __author__ = "<NAME>, <NAME>" __copyright__ = "Copyright 2016,...
2.015625
2
main.py
Ashwin-op/CMOS_Circuit_Generator
9
46358
<gh_stars>1-10 import subprocess from tt import BooleanExpression, to_primitives # Function to print information def printInfo(): print("\t\t\tCMOS Circuit Generator") print("-" * 70) print("Available operators: and, iff, impl, nand, nor, not, nxor, or, xnor, xor") print("(You can use parentheses fo...
3.03125
3
transaction/views.py
FerdiantJoshua/alkafgrosir-administration
0
46359
<reponame>FerdiantJoshua/alkafgrosir-administration import csv import re from datetime import datetime from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.db import transaction as django_transaction from dja...
1.9375
2
configs/pspnet/pspnet_r50-d8_yantai_st12.py
shuaizzZ/mmsegmentation
0
46360
<reponame>shuaizzZ/mmsegmentation<filename>configs/pspnet/pspnet_r50-d8_yantai_st12.py _base_ = [ '../_base_/models/du_pspnet_r50-d8.py', '../_base_/datasets/yantai_st12.py', '../_base_/runtimes/yantai_runtime.py', '../_base_/schedules/schedule_yantai.py' ] model = dict( decode_head=dict(num_classes=4), aux...
1.460938
1
py_tdlib/constructors/set_network_type.py
Mr-TelegramBot/python-tdlib
24
46361
<gh_stars>10-100 from ..factory import Method class setNetworkType(Method): type = None # type: "NetworkType"
1.726563
2
Ex 06.py
brunobendel/Exercicios-python-Pycharm
0
46362
import math a = int(input('digite um numero:')) print('O dobro do valor digitado é: {}\nO triplo é: {}\nA Raiz quadrada é: {}'.format((a*2),(a*3),(math.sqrt(a))))
4.0625
4
.install/.backup/platform/gcutil/lib/google_compute_engine/gcutil_lib/windows_password_test.py
bopopescu/google-cloud-sdk
0
46363
# Copyright 2012 Google 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 by applicable law or a...
2.59375
3
src/prepare_data.py
morrigan/user-behavior-anomaly-detector
35
46364
#!/usr/bin/python import os, csv import tensorflow as tf import numpy as np import pandas as pd import helpers # fix random seed for reproducibility np.random.seed(7) #-------------------------- Constants --------------------------# FLAGS = tf.flags.FLAGS tf.flags.DEFINE_string( "input_dir", os.path.abspath("../d...
2.296875
2
rgpy/tests/test_rbm.py
jqhoogland/rgpy
4
46365
<filename>rgpy/tests/test_rbm.py import os from tfrbm.bbrbm import BBRBM from tfrbm import visualize try: import _pickle as pickle except: import pickle sample_descriptors = ['cold', ] def get_samples(sample_descriptor): filepath = './crit.samples.pkl' # Load the file if restrictions have already been...
2.078125
2
tests/unit/rules/contexts/count.py
translationexchange/tml-python
1
46366
<reponame>translationexchange/tml-python # encoding: UTF-8 """ Test rules built-in functions """ from __future__ import absolute_import import unittest from tml.rules.contexts.count import * import six class WithLength(object): def __len__(self): return 10 class WithoutLength(object): pass class Cou...
2.828125
3
chat/urls.py
Rutujakadam0204/video_conferencing
0
46367
from django.contrib import admin from django.urls import path # from django.contrib.auth.decorators import login_required # from rest_framework.urlpatterns import format_suffix_patterns from . views import * urlpatterns = [ # path('admin/', admin.site.urls), path('', main_view, name='main_view'), ]
1.523438
2
chrome/common/extensions/docs/server2/app_yaml_helper_test.py
iplo/Chain
231
46368
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from app_yaml_helper import AppYamlHelper from extensions_paths import SERVER2 from host_file_system_provider import H...
2.140625
2
bot.py
HOTNSPICY12/Bot.py
0
46369
import os import random from os import system import urllib import json from json import dumps, load import argparse from urllib.request import urlopen from time import sleep import threading system("pip install gtts") system("pip install requests") import amino import time from gtts import gTTS import r...
2.359375
2
tensorstream/finance/supertrend_spec.py
clems4ever/tensorstream
5
46370
import numpy as np import tensorflow as tf from tensorstream.finance.supertrend import Supertrend from tensorstream.tests import TestCase class SupertrendSpec(TestCase): def setUp(self): self.sheets = self.read_ods( self.from_test_res('supertrend.ods', __file__)) def test_supertrend(self): sheet =...
2.421875
2
critters/fac-rec.py
vagoff/shootout
0
46371
import sys import math sys.setrecursionlimit(999000) def fac(x): if x < 2: return 1 return x * fac(x - 1) print(math.log10( fac(int(sys.argv[1])) ))
2.71875
3
whyis/autonomic/global_change_service.py
tolulomo/whyis
31
46372
from builtins import str import sadi import rdflib import setlr from datetime import datetime from .service import Service from nanopub import Nanopublication from datastore import create_id import flask from flask import render_template from flask import render_template_string import logging import sys, traceback i...
1.382813
1
config.py
nejcv1998/koncna-locila
0
46373
<reponame>nejcv1998/koncna-locila<filename>config.py from transformers import * # special tokens indices in different models available in transformers TOKEN_IDX = { 'bert': { 'START_SEQ': 101, 'PAD': 0, 'END_SEQ': 102, 'UNK': 100 }, 'roberta': { 'START_SEQ': 0, ...
2.03125
2
SBaaS_rnasequencing/stage01_rnasequencing_softwareParameters_execute.py
dmccloskey/SBaaS_rnasequencing
0
46374
<reponame>dmccloskey/SBaaS_rnasequencing from .stage01_rnasequencing_softwareParameters_io import stage01_rnasequencing_softwareParameters_io class stage01_rnasequencing_softwareParameters_execute(stage01_rnasequencing_softwareParameters_io, ): pass;
1.289063
1
APIServer/database/schema.py
gcallah/SOCNET
1
46375
from APIServer.database.models import Alert, Thread, Comment from marshmallow_sqlalchemy import ModelSchema class AlertSchema(ModelSchema): class Meta: model = Alert class ThreadSchema(ModelSchema): class Meta: model = Thread class CommentSchema(ModelSchema): class Meta: model ...
2.109375
2
application.py
lucadalmedico/Pomodoro-timer
0
46376
#!/usr/bin/python from Tkinter import * from notifier import Notifier from configurationReader import Configuration class PomodoroTimer(Frame): def __start(self): """ Start to work, this function is executed only the first time """ self.__button.config(text = "Stop", background = '#e21212', ac...
3.296875
3
gsfarc/test/test_datatype_double.py
geospatial-services-framework/gsfpyarc
1
46377
""" """ import unittest import arcpy from numpy import pi from gsfarc.test import config class TestDatatypeDouble(unittest.TestCase): """Tests the double task datatype""" @classmethod def setUpClass(cls): """Class setup creates a toolbox file wrapper to GSF.""" config.setup_idl_toolbox('t...
2.796875
3
pymt_sedflux3d/bmi.py
mcflugen/pymt_sedflux3d
0
46378
<filename>pymt_sedflux3d/bmi.py from __future__ import absolute_import from .lib import Sedflux3D
1.03125
1
app.py
wbigger/2021-tris
0
46379
#!/usr/bin/env python3 print("Gioco del tic tac toe") board = [ ['-','-','-'], ['-','-','-'], ['-','-','-'] ] symList = ['X','O'] def mostra_tabellone(): for i in range(3): for j in range(3): print(board[i][j], end=" ") print() def win(board): ...
4.15625
4
tests/get_function_memory_usage.py
clement-masson/aiarena
0
46380
import psutil import os import time def get_function_memory_usage(function, iterations=100, max_time=None, max_mem_usage=90, verbose=False, display_period=0.2): ''' Cette fonction execute <iterations> fois <function> et renvoit la difference de mémoire virtuelle utilisée pa...
2.828125
3
alloy_related/alloyToRailML/parserAlloy/level.py
pedrordgs/RailML-Utilities
21
46381
<reponame>pedrordgs/RailML-Utilities class Level: def __init__(self, ident, desc, nresources): self.id = ident self.description = desc self.networkResources = nresources
1.507813
2
tiatoolbox/__main__.py
adamshephard/tiatoolbox
0
46382
"""__main__ file invoked with `python -m tiatoolbox` command""" from tiatoolbox.cli import main main()
1.046875
1
test_extra_credit.py
robertavram/tournament
0
46383
<reponame>robertavram/tournament from tournament import * from random import randint from math import log, ceil def setupTournament(tname): createTournament(tname) return def registerPlayers(tournament="Default Tournament", tplayers=10): """Registers a list of randomly generated names. """ # Potent...
3.578125
4
python/prizes.py
camfindlay/govhackaustralia.github.io
1
46384
<filename>python/prizes.py<gh_stars>1-10 import fnmatch import codecs import tablib import os import requests import urlparse import shutil import frontmatter import yaml import io class PrizeSpreadsheets(object): """ """ def __init__(self, dir_path): self.dir_path = dir_path def get_spreadsh...
2.734375
3
tests/core_symbol.py
cubetrain/CubeTrain
0
46385
<gh_stars>0 CORE_SYMBOL='SEAT'
1.007813
1
tests/CRAFT/MFW/lambdaV1.py
idaholab/SR2ML
5
46386
# Copyright 2020, Battelle Energy Alliance, LLC # ALL RIGHTS RESERVED import numpy as np import math import random from scipy.integrate import quad def timeDepLambda(t,a,b): return a+t*b def pdfFailure(t,a,b): first = timeDepLambda(t,a,b) second = math.exp(-quad(timeDepLambda, 0, t, args=(a,b))[0]) return fi...
2.515625
3
minpair/generator.py
brandonlim-hs/minpair
1
46387
from collections import defaultdict from minpair import arpabet from minpair.corpus import require as corpus_require from nltk.corpus import brown from nltk.corpus import cmudict from nltk.corpus import words import re class Generator(object): """Class to generate minimal pairs. """ def __init__(self, do...
2.953125
3
shop/migrations/0004_auto_20191223_1511.py
majestylink/majestyAccencis
0
46388
<reponame>majestylink/majestyAccencis<filename>shop/migrations/0004_auto_20191223_1511.py # Generated by Django 2.2.7 on 2019-12-23 14:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shop', '0003_auto_20191223_1507'), ] operations = [ ...
1.523438
2
vjemmie/cogs/sound_cog.py
PederHA/vjemmie
1
46389
import asyncio import glob import os import random import subprocess import sys import wave from collections import defaultdict from contextlib import suppress from datetime import datetime from functools import partial from itertools import count, islice from pathlib import Path from typing import Default...
1.75
2
train/demo.py
Ethan16/python_misc
1
46390
<gh_stars>1-10 class Demo(object): def __init__(self,a=None,*args,**kwargs): self.a=a #import pdb;pdb.set_trace() def get_a(self): return self.a @property def b(self): b="b2b" return b if __name__== '__main__': demo=Demo('int a','int b','int_c',d=...
3
3
solidata_api/_core/queries_db/query_stats.py
co-demos/solidata-backend
2
46391
# -*- encoding: utf-8 -*- """ _core/queries_db/query_stats.py """ import re import random import pandas as pd import numpy as np from pandas.io.json import json_normalize from log_config import log, pformat log.debug("... _core.queries_db.query_stats.py ..." ) from bson.objectid import ObjectId from flask_r...
2.109375
2
mindsdb_impl/predictor.py
mindsdb/mindsdb-sagemaker-container
7
46392
# This is the file that implements a flask server to do inferences. import os import json import flask import pandas as pd from io import StringIO, BytesIO import mindsdb # Define the path prefix = '/opt/ml/' model_path = os.path.join(prefix, 'model') def parse_data(content_type, data): ''' Get the request c...
2.5625
3
Exam preparation/Python Advanced Exam - 14 February 2021/02_collecting_coins.py
milenpenev/Python_Advanced
0
46393
from math import floor n = int(input()) result = 0 game_over = False path = [] directions = { "up": (-1, 0), "down": (1, 0), "left": (0, -1), "right": (0, 1) } matrix = [] for row in range(n): matrix.append(input().split()) def movement_is_valid(movement): if movement == "up" or movement...
3.796875
4
ball.py
mrmphys/pong
0
46394
<reponame>mrmphys/pong from turtle import Turtle import time class Ball(Turtle): def __init__(self): super().__init__() self.color("white") self.shape("circle") self.penup() self.y_move = 10 self.x_move = 10 self.speeding = 0.1 def move(self): n...
3.515625
4
knowledge/SSHExec.py
procter-gamble-tech/pentest-report
2
46395
<reponame>procter-gamble-tech/pentest-report #!/usr/bin/python3 from StateAction import StateAction import paramiko import socket import argparse class SSHExec(StateAction): """ Runs an ssh command on all user/hosts """ def __init__(self, cmd_list, cmd_name, mode='foreach_host', users=None): """ cmd l...
2.609375
3
python/opscore/RO/Wdg/Sound.py
sdss/opscore
0
46396
<gh_stars>0 """Simple sound players. All sound players are based on Tkinter and some will use the "pygame" sound package if it is available. History: 2003-11-17 ROwen 2004-08-11 ROwen Define __all__ to restrict import. 2005-06-08 ROwen Changed BellPlay, SoundPlayer, NoPLay to new-style classes. 2009-10-22 ROwe...
2.828125
3
Probability-of-the-loan-defaulters/code.py
tbhuwan14/ga-learner-dsb-repo
0
46397
<reponame>tbhuwan14/ga-learner-dsb-repo<gh_stars>0 # -------------- import numpy as np import pandas as pd import matplotlib.pyplot as plt # code starts here df=pd.read_csv(path) p_a=len(df[df['fico']>700])/len(df) print(p_a) p_b=len(df[df['purpose']=='debt_consolidation'])/len(df) print(p_b) df0=df[df['purpose']=='d...
3.078125
3
tf_quant_finance/rates/swap_curve_common.py
slowy07/tf-quant-finance
3,138
46398
<filename>tf_quant_finance/rates/swap_curve_common.py # Lint as: python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LI...
2.03125
2
submissions/abc058/b.py
m-star18/atcoder
1
46399
o = input() e = input() ans = '' for i in range(len(e)): ans += o[i] ans += e[i] if len(o)-len(e) == 1: ans += o[-1] print(ans)
3.078125
3