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
setup.py
bentettmar/nertivia4py
3
35300
<gh_stars>1-10 from distutils.core import setup readme = """ # Nertivia4PY A Python wrapper for the Nertivia API. Support Nertivia server : https://nertivia.net/i/nertivia4py > ### Install > ``` > pip install nertivia4py > ``` > ### Example > ```python > import nertivia4py > > token = "TOKEN_HERE...
1.96875
2
scheduler/args.py
jian-yu/autotx
1
35301
class PoolArgs: def __init__(self, bankerBufCap, bankerMaxBufNumber, signerBufCap, signerBufMaxNumber, broadcasterBufCap, broadcasterMaxNumber, stakingBufCap, stakingMaxNumber, distributionBufCap, distributionMaxNumber, errorBufCap, errorMaxNumber): self.BankerBufCap = bankerBufCap self.BankerMaxBuf...
2.453125
2
generative/stylclip/operators.py
armaank/archlectures
1
35302
import numpy as np import torch from scipy.stats import truncnorm from pymoo.factory import get_sampling, get_crossover, get_mutation from pymoo.operators.mixed_variable_operator import MixedVariableSampling, MixedVariableMutation, MixedVariableCrossover from pymoo.model.sampling import Sampling class TruncatedNormal...
2.28125
2
setup.py
VENULLLC/Monoclock
2
35303
<gh_stars>1-10 #!/usr/bin/env python import sys from distutils.core import setup from distutils.extension import Extension if sys.platform == 'darwin': monoclock_libraries = [] else: monoclock_libraries = ['rt'] setup( name='Monoclock', version='14.4.18', description="Monotonic clock access for Python", url="h...
1.296875
1
models/user.py
NeonWizard/php-mood-tracker
0
35304
class UserModel(Table): def __init__(self): self.tableName = "User" self.requiredFields = ['firstName', 'lastName', 'username', 'password'] self.optionalFields = ['email'] def check(self, data): for req in self.requiredFields: if req not in data: return False for opt in self.optionalFields: if o...
3.03125
3
mrobpy/examples/vis_utils.py
miloserdova-l/mrob
12
35305
<filename>mrobpy/examples/vis_utils.py import numpy as np import pandas as pd import mrob from test_utils import get_mc from sys import platform import matplotlib if platform == "darwin": matplotlib.use('PS') import matplotlib.pyplot as plt # Here the Cholesky decomposition for singular covariance matrix is i...
2.734375
3
api/tf_auth/migrations/0009_populate_username.py
prattl/teamfinder-web
9
35306
<reponame>prattl/teamfinder-web<filename>api/tf_auth/migrations/0009_populate_username.py # -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-04-17 00:30 from __future__ import unicode_literals from django.db import migrations def forwards(apps, schema_editor): TFUser = apps.get_model('tf_auth.TFUser') ...
2.140625
2
emotion_detection/f_emotion_detection.py
juan-csv/Architecture-for-real-time-video-streaming-analytics
16
35307
import config as cfg import cv2 import numpy as np from keras.models import load_model from keras.preprocessing.image import img_to_array from keras import backend as K import tensorflow as tf import keras ''' esto es necesario para que no haya errores a la hora de exponer el servicio con flask info --> https://github...
3.0625
3
src/gui/migrations/0014_feedback_childprotection.py
digitalfabrik/ish-goalkeeper
12
35308
# Generated by Django 2.2.1 on 2020-03-10 18:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gui', '0013_auto_20200310_1742'), ] operations = [ migrations.AddField( model_name='feedback', name='childprotection...
1.492188
1
assignment/assignment2/test/ASTGenSuite.py
khoidohpc/ppl-course
2
35309
<filename>assignment/assignment2/test/ASTGenSuite.py import unittest from TestUtils import TestAST from AST import * class ASTGenSuite(unittest.TestCase): # Test variable declaration def test_single_variable_declaration(self): input = """int a;""" expect = "Program([VarDecl(a,IntType)])" ...
2.96875
3
lib/reinteract/notebook_window.py
rschroll/reinteract
1
35310
# Copyright 2008-2009 <NAME> # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import gtk import os from base_notebook_window impor...
2.078125
2
regulation/settings.py
cfpb/regulations-xml-parser
4
35311
<filename>regulation/settings.py #!/usr/bin/env python from __future__ import print_function from __future__ import unicode_literals import importlib import os import sys # Try to load the settings module try: local_settings = importlib.import_module( os.environ.get('REGML_SETTINGS_FILE', 'settings'))...
2.25
2
src/ui/ui_send_payout_dlg.py
muteio/ghostnode-tool
1
35312
<gh_stars>1-10 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_send_payout_dlg.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SendPayoutDlg(object): def setupUi(self, S...
1.5
2
server/src/models/embedded_models/method_step_embedded_model.py
minhman727/miao-nutrition-assistant
0
35313
<filename>server/src/models/embedded_models/method_step_embedded_model.py from mongoengine import * class MethodStep(EmbeddedDocument): description = StringField(require=True) images = ListField(ImageField(db_alias="miao"), null=True) meta = { "db_alias": "miao", "collection": "method_step...
1.867188
2
silot/experiments/moving_mnist/silot_run.py
e2crawfo/silot
16
35314
from dps.hyper import run_experiment from dps.utils import copy_update from dps.tf.updater import DummyUpdater from silot.run import basic_config, alg_configs, env_configs import argparse parser = argparse.ArgumentParser() parser.add_argument('--max-digits', type=int, choices=[6, 12], required=True) args, _ = parser.p...
1.867188
2
evo_mwc/__init__.py
mrazomej/evo_mwc
0
35315
<gh_stars>0 # -*- coding: utf-8 -*- """Top level package for evo_utils utilities""" from . import viz from . import fitderiv from . import model __author__ = """<NAME>""" __email__ = """<EMAIL> {at} caltech.edu""" __version__ = '0.0.1' name = 'evo_mwc'
0.878906
1
arclet/alconna/__main__.py
SocialSisterYi/Alconna
0
35316
<reponame>SocialSisterYi/Alconna<gh_stars>0 """Alconna 命令行入口""" from arclet.alconna.builtin.commandline import main if __name__ == "__main__": main()
1.007813
1
profiles/viewsets.py
Hacksbr/resume
0
35317
from django.contrib.auth import get_user_model from rest_framework import viewsets, status, permissions from rest_framework.response import Response from profiles.models import Profile from profiles.permissions import IsUserProfileOrAdmin from profiles import serializers User = get_user_model() class ProfileViewSe...
2.046875
2
setup.py
transientlunatic/gravitic
2
35318
<reponame>transientlunatic/gravitic from setuptools import setup # with open('README.rst') as readme_file: # readme = readme_file.read() # with open('HISTORY.rst') as history_file: # history = history_file.read() with open("requirements.txt") as requires_file: requirements = requires_file.read().split("\...
1.75
2
src/briefcase/apps/spreadsheet/events.py
Briefcase/Briefcase
2
35319
def onMessage(request, message, socket): print "ON MESSAGE! :" + message socket.sendToMe("Hello Back!") pass def onConnect(requestData): #socket.sendToAll("Test All") #socket.sendToAllButMe("Test Not Me") #socket.sendToMe("Test Me") return True def onDisconnect(): pass
2.53125
3
hal/vanille_hal.py
ThotAlion/vanille
1
35320
import rclpy import json,numpy from numpy import clip from rclpy.node import Node from std_msgs.msg import Float64MultiArray from sensor_msgs.msg import JointState from diagnostic_msgs.msg import DiagnosticStatus, KeyValue import can from tinymovr import Tinymovr from tinymovr.iface.can import CAN from tinymovr.units...
2.109375
2
pretrained-model/speaker-embedding/vggvox/constants.py
dtx525942103/malaya-speech
0
35321
<reponame>dtx525942103/malaya-speech<gh_stars>0 # Signal processing SAMPLE_RATE = 16000 PREEMPHASIS_ALPHA = 0.97 FRAME_LEN = 0.025 FRAME_STEP = 0.01 NUM_FFT = 512 BUCKET_STEP = 1 MAX_SEC = 10 # Model WEIGHTS_FILE = "data/model/weights.h5" COST_METRIC = "cosine" # euclidean or cosine INPUT_SHAPE=(NUM_FFT,None,1) # IO...
1.664063
2
pyramid/tests/test_scripts/test_proutes.py
danielpronych/pyramid-doxygen
0
35322
<reponame>danielpronych/pyramid-doxygen import unittest from pyramid.tests.test_scripts import dummy class TestPRoutesCommand(unittest.TestCase): def _getTargetClass(self): from pyramid.scripts.proutes import PRoutesCommand return PRoutesCommand def _makeOne(self): cmd = self._getTarge...
2.53125
3
pystatreduce/doc/plot/plot_quadratic-distribution_overlay.py
OptimalDesignLab/pyStatReduce
0
35323
<reponame>OptimalDesignLab/pyStatReduce<gh_stars>0 # plot normal quadratic distribution overlay # Plots the effects of theta in the 2D quadratic by showing the normal # distribution on top of the regular quadratic import numpy as np from mpl_toolkits import mplot3d import matplotlib import matplotlib.pyplot as plt im...
2.921875
3
utils/sqlite.py
ztytotoro/python-scripts
0
35324
<filename>utils/sqlite.py # 导入: from sqlalchemy import Column, String, create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base # 创建对象的基类: Base = declarative_base() # 定义Project对象: class Project(Base): # 表的名字: __tablename__ = 'project' # 表的结构: id =...
2.8125
3
cracking-the-coding-interview/1-chapter3.py
tranquan/coding-dojo
1
35325
import os import sys import math # 3.1 using single array to implement 3 stacks # 1) - using 3 indexes to for each stack pointers, and 3 size to set maximum of stack # 2) - using 3 indexes, 1 begin at the first index and increase, 1 begin at the bottom and decrease, 1 at the bottom and re-balanced every time class Ar...
4
4
Network-communicator-client.py
TomFang1/Network-Communicator
0
35326
import socket HOST = "" PORT = "" def address(): global HOST print("What is the IP of the computer you want to connect to? ") HOST = input(":") global PORT print("What is the PORT of the computer you want to connect to? ") PORT = int(input(":")) connector() def connector(): ...
3.578125
4
pipelines/head-pose-dataset-pipeline/data-chunk-spliter/main.py
tonouchi510/kfp-project
0
35327
<gh_stars>0 import json import hashlib from absl import app from absl import flags from google.cloud import storage FLAGS = flags.FLAGS flags.DEFINE_string( "pipeline", None, "Name of pipeline") flags.DEFINE_string( "job_id", "test", "ID for job management.") flags.DEFINE_string( "bucket_name", "...
2.28125
2
book_parser_alternate_approach.py
shankze/python_book_parser
0
35328
import re import _pickle as cPickle import logging import argparse #This script is not dependant on table of contents. It detects books and chapters based their titles # Dictionary containing key and regex pattern to match the keys pattern_dict = { 'blank_line': re.compile(r'^\s*$'), 'book_number': re.compile...
2.984375
3
modules/Registry/lv1_os_win_reg_mac_address.py
naaya17/carpe
0
35329
<filename>modules/Registry/lv1_os_win_reg_mac_address.py class Mac_Address_Information: par_id = '' case_id = '' evd_id = '' mac_address = '' description = '' backup_flag = '' source_location = [] def MACADDRESS(reg_system): mac_address_list = [] mac_address_count = 0 reg_key...
2.390625
2
src/audio/extract_audio.py
usc-sail/tiles-2019-dataset
0
35330
from __future__ import print_function from fileinput import filename import os import pandas as pd import pdb from datetime import timedelta import datetime import shutil date_time_format = '%Y-%m-%dT%H:%M:%S.%f' date_format = '%Y-%m-%d' def make_dir(data_path): if os.path.exists(data_path) is False: os...
2.46875
2
Python_files/extract_tmc_links.py
jingzbu/InverseVITraffic
0
35331
from util_data_storage_and_load import * import openpyxl data_folder = '/home/jzh/Dropbox/Research/\ Data-driven_estimation_inverse_optimization/INRIX/Raw_data/' ########## extract tmc info for link_1 # load attribute table link_1 data wb_link_1 = openpyxl.load_workbook(data_folder + 'filtered_INRIX_attribute_table...
2.5
2
python/analysis/fp_fit/fp_file.py
ACTCollaboration/moby2
3
35332
#!/usr/bin/python from __future__ import print_function from __future__ import absolute_import from past.builtins import basestring import sys import numpy as np import moby2 trace = moby2.util.log.logger.trace # transitional... _fp_formats = { 'det_uid': '%4d', 'ok': '%1d', 'x0': '%9.6f', 'x0_err':...
2.171875
2
apps/exporter/models.py
mjj55409/cpq-exporter
0
35333
<reponame>mjj55409/cpq-exporter<gh_stars>0 from django.conf import settings from django.db import models # from django.template.defaultfilters import slugify from django.utils.translation import ugettext_lazy as _ class KB (models.Model): name = models.CharField(max_length=30, unique=True) repository_url = mo...
1.976563
2
export_as_bookmark/migrations/__init__.py
10sr/webtools
0
35334
"""export_as_bookmark migration script."""
1.195313
1
management/utils.py
jonathanverner/brython-jinja2
2
35335
<filename>management/utils.py #!/usr/bin/env python3 from plumbum import cli class M(cli.Application): subcommands = {} @classmethod def print_commands(cls, root=None, indent=0): if root is None: root = cls.subcommands for name, (app, sub_cmds) in root.items(): ...
2.640625
3
ml/gan_test.py
Ryoich/python_zero
203
35336
<reponame>Ryoich/python_zero import matplotlib.pyplot as plt import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) def generator_fn(noise, weight_decay=2.5e-5, is_training=True): layers = tf.contrib.layers framework = tf.contrib.framework f1 = framework.arg_scope( ...
2.4375
2
src/forms.py
Afsharov/observer-frontend
0
35337
<reponame>Afsharov/observer-frontend<gh_stars>0 """This module contains all forms used by the Observer-Hive frontend. """ import os import json import logging from bcrypt import checkpw from flask_wtf import FlaskForm from flask_login import current_user from wtforms import StringField, PasswordField from wtforms.vali...
2.1875
2
lido/validate_keys.py
lidofinance/lido-python
3
35338
<reponame>lidofinance/lido-python<filename>lido/validate_keys.py import typing as t from py_ecc.bls import G2ProofOfPossession as bls from lido.eth2deposit.utils.ssz import ( DepositMessage, compute_deposit_domain, compute_signing_root, ) from lido.eth2deposit.settings import get_chain_setting from lido.co...
2.375
2
app/editor/animation_editor/animation_tab.py
zerorock1312/lt-maker-master
0
35339
<filename>app/editor/animation_editor/animation_tab.py from app.resources.resources import RESOURCES from app.extensions.custom_gui import ResourceListView from app.editor.data_editor import SingleResourceEditor from app.editor.base_database_gui import DatabaseTab from app.editor.animation_editor import animation_mod...
2.109375
2
app/views/dashboard.py
aviago/aviago
0
35340
from .base import BaseUserView class Dashboard(BaseUserView): def index(self): pass
1.070313
1
ikabot/function/sellResources.py
adaamz/ikabot
0
35341
<reponame>adaamz/ikabot<filename>ikabot/function/sellResources.py<gh_stars>0 #! /usr/bin/env python3 # -*- coding: utf-8 -*- import time import math import json import gettext import traceback from decimal import * from ikabot.config import * from ikabot.helpers.gui import * from ikabot.helpers.market import * from ik...
1.960938
2
openclean/function/value/text.py
remram44/openclean-core
4
35342
# This file is part of the Data Cleaning Library (openclean). # # Copyright (C) 2018-2021 New York University. # # openclean is released under the Revised BSD License. See file LICENSE for # full license details. """Helper functions for strings.""" from typing import Any from openclean.data.types import Value from o...
3.5625
4
eddiebot_apps/eddiebot_ssl/scripts/model_controller.py
TooSchoolForCool/EddieBot-ROS
5
35343
<reponame>TooSchoolForCool/EddieBot-ROS #!/usr/bin/env python import rospy import tf from gazebo_msgs.srv import SetModelState, DeleteModel, SpawnModel from gazebo_msgs.msg import ModelState from geometry_msgs.msg import Pose, Point, Quaternion class ModelController(object): def __init__(self): rospy.wait_for_se...
2.53125
3
lang/jquery_python/read/redis_python_read.py
ekzemplaro/data_base_language
3
35344
<filename>lang/jquery_python/read/redis_python_read.py<gh_stars>1-10 #! /usr/bin/python3 # -*- coding: utf-8 -*- # # redis_python_read.py # # Dec/09/2014 # # import sys import json import redis # # ---------------------------------------------------------------- rr = redis.Redis(host='host_dbase', port=6379, db=0)...
2.59375
3
Hash and Counting/SpecialKeyboard.py
haaris272k/Problem-Solving-Collection
1
35345
<filename>Hash and Counting/SpecialKeyboard.py """Imagine you have a special keyboard with all keys in a single row. The layout of characters on a keyboard is denoted by a string S1 of length 26. S1 is indexed from 0 to 25. Initially, your finger is at index 0. To type a character, you have to move your finger to the i...
4
4
en_fila/apps/management/migrations/0004_remove_employee_employee_passcode.py
puertoricanDev/En_fila
0
35346
<filename>en_fila/apps/management/migrations/0004_remove_employee_employee_passcode.py # Generated by Django 3.2.6 on 2021-11-16 20:36 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('management', '0003_employee'), ] operations = [ migrations.Re...
1.398438
1
backend/app/app/api/api_v1/system/user.py
lianjy357/vue-element-admin-fastapi
10
35347
<filename>backend/app/app/api/api_v1/system/user.py<gh_stars>1-10 from typing import Any, Dict, Optional,List from fastapi import APIRouter, Depends, HTTPException,Body,Request from sqlalchemy.orm import Session,joinedload_all,contains_eager,Load from fastapi.encoders import jsonable_encoder from app import crud, mode...
2.15625
2
janus/driver.py
zhenglz/janus
0
35348
<reponame>zhenglz/janus """ This is the qmmm driver module """ import pickle from janus import Initializer def run_janus(filename='input.json'): """ Drives the janus program. Creates an instance of the Initializer class and feeds wrappers to either :func:`~janus.driver.run_simulation` or :func:`~...
3.03125
3
teether/slicing.py
ljhOfGithub/teether
0
35349
<reponame>ljhOfGithub/teether from teether.cfg.instruction import Instruction from teether.cfg.opcodes import potentially_user_controlled from teether.explorer.backward import traverse_back from teether.util.intrange import Range def slice_to_program(s): pc = 0 program = {} for ins in s: program[p...
2.671875
3
install/app_store/tk-nuke-writenode/v1.2.0/app.py
JoanAzpeitia/lp_sg
0
35350
<gh_stars>0 # Copyright (c) 2013 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # ag...
2.34375
2
decorators/logging_decorator.py
devwarrior/python_coding
0
35351
<gh_stars>0 ''' decorator to log functions executions ''' from functools import wraps import logging import time def log(logger, level='info'): ''' @brief decorator implementing the logging of a function. ''' def log_decorator(method): ''' @brief decorator implementing the logging of a ...
3.015625
3
experiments/createReverseBatches.py
usc-sail/mica-violence-ratings-predictions-from-movie-scripts
3
35352
from numpy.random import seed seed(5393) from tensorflow import set_random_seed set_random_seed(12011) import os import numpy as np import pandas as pd from scipy import sparse from sklearn.preprocessing import LabelEncoder, LabelBinarizer from sklearn.pipeline import FeatureUnion from sklearn.feature_extraction.te...
2.15625
2
mongosql/util/__init__.py
vdmit11/py-mongosql
0
35353
<reponame>vdmit11/py-mongosql from .raiseload_col import raiseload_col from .selectinquery import selectinquery from .counting_query_wrapper import CountingQuery from .reusable import Reusable from .mongoquery_settings_handler import MongoQuerySettingsHandler from .marker import Marker from .settings_dict import MongoQ...
1.21875
1
files/gpu_stat.py
nauhpc/ansible-role-sacct_gpu
0
35354
#!/usr/bin/python3 # author mhakala import json import re import subprocess import tempfile import os import xml.etree.cElementTree as ET import argparse import os.path import time import random from datetime import datetime from datetime import timedelta import traceback import configparser import glob def jobs_runn...
2.265625
2
CRF/CRF.py
zhen8838/Statistical-Learning-Method
0
35355
""" 参考自https://github.com/bojone/crf/ """ import tensorflow as tf k = tf.keras kl = tf.keras.layers K = tf.keras.backend from sklearn.model_selection import train_test_split import numpy as np import re from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation class CRF(kl.L...
2.78125
3
comet/schedulers.py
chryssa-zrv/UA_COMET
0
35356
# -*- coding: utf-8 -*- r""" Schedulers ============== Leraning Rate schedulers used to train COMET models. """ from argparse import Namespace from torch.optim import Optimizer from torch.optim.lr_scheduler import LambdaLR class ConstantPolicy: """Policy for updating the LR of the ConstantLR scheduler. W...
2.671875
3
pypesto/prediction/__init__.py
sleepy-owl/pyPESTO
0
35357
""" Prediction ========== """ from .amici_predictor import AmiciPredictor from .prediction import PredictionResult, PredictionConditionResult
0.886719
1
tixcraft/utils.py
stavhaygn/crack-tixcraft
20
35358
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium import webdriver import requests def login(): driver = webdriver.Chrome() driver.implicitly_wait(20) driver.get("https://tixc...
2.765625
3
code/src/main.py
ChaofWang/AWSRN
162
35359
<filename>code/src/main.py<gh_stars>100-1000 import torch import utility import data import model import loss from option import args from trainer import Trainer def print_network(net): num_params = 0 for param in net.parameters(): num_params += param.numel() print(net) print('Total number of ...
2.40625
2
mycroft/views.py
seakers/daphne-brain
0
35360
from rest_framework.views import APIView from rest_framework.response import Response from auth_API.helpers import get_or_create_user_information class CheckConnection(APIView): def post(self, request, format=None): # --> 1. Get connection status and id user_info = get_or_create_user_informatio...
2.4375
2
examples/machine_learning.py
miroslavftn/Text-classification
2
35361
from models.statistical.ml_classifier import MLClassifier from models.statistical.models import ModelsFactory from models.statistical.tokenizer import TokenizerFactory # can be loaded from a config file model_name = 'xgb' tokenizer_name = 'default' ngrams = 2 name = 'sst2' stopwords = False max_features = 5000 test_...
3.03125
3
tests/test_algorithms/test_sutherland_hodgman.py
Huite/numba_celltree
2
35362
<gh_stars>1-10 """" Test data generated with: ```python import numpy as np import shapely.geometry as sg def ccw(a): # Ensure triangles are counter-clockwise for i in range(len(a)): t = a[i] normal = (t[1][0] - t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0]) if normal ...
2.296875
2
interpreter/application.py
Jesssullivan/MerlinAI-Interpreters
3
35363
from app.main import create_app from waitress import serve if __name__ == "__main__": app = create_app() serve(app, host='0.0.0.0', port='5000')
1.671875
2
source/194-Vencedor_do_jogo_da_velha.py
FelixLuciano/DesSoft-2020.2
0
35364
<filename>source/194-Vencedor_do_jogo_da_velha.py # Vencedor do jogo da velha # Faça uma função que recebe um tabuleiro de jogo da velha e devolve o vencedor. O tabuleiro é representado por uma lista de listas como o mostrado a seguir: # [['X', 'O', 'X'], ['.', 'O', 'X'], ['O', '.', 'X']] # Note que a lista acima é...
2.59375
3
src/boat/reservierung/apps.py
holytortoise/boat_project
0
35365
from django.apps import AppConfig class ReservierungConfig(AppConfig): name = 'reservierung'
1.125
1
src/bst/pygasus/datamanager/grokker.py
codeix/bst.pygasus.datamanager
0
35366
import martian from martian.error import GrokError from grokcore.component import name as namedirective from zope import component from bst.pygasus.datamanager.model import ExtBaseModel from bst.pygasus.datamanager.interfaces import IModelTransformer from bst.pygasus.datamanager.transformer import ModelTransfomerUtili...
2.203125
2
intent_parser/utils/opil_utils.py
SD2E/experimental-intent-parser
3
35367
<reponame>SD2E/experimental-intent-parser """ Provides a list of functions for building opil objects. """ from intent_parser.intent.measure_property_intent import MeasuredUnit from intent_parser.intent_parser_exceptions import IntentParserException import intent_parser.utils.sbol3_utils as sbol3_utils import intent_par...
2.25
2
ooobuild/lo/ucb/x_simple_file_access.py
Amourspirit/ooo_uno_tmpl
0
35368
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
1.609375
2
bin/bb8/docker_rsync.py
vimc/bb8
0
35369
#!/usr/bin/env python3 import logging from os import getuid, getgid from os.path import join import docker from .logger import log_from_docker class DockerRsync(object): def __init__(self, client=docker.from_env()): self.client = client def _run_rsync(self, volumes, from_path, to_path, relative): ...
2.40625
2
Tools/fontcompile.py
aunicornfarmer/gotris
63
35370
<gh_stars>10-100 #!/usr/bin/python # -*- coding: utf-8 -*- # compiled font is a binary blob: # 1. magic (MFNT) - 4 bytes # 2. number of symbols - 4 bytes # 3. font y advance - 4 bytes # 4. an array of glyphs (offset_x, offset_y, width, height, tx, ty, tx2, ty2, x_advance) - 36 * number of symbols # (iiIIffffI) # 5....
2.78125
3
trojsten/login/tests.py
MvonK/web
5
35371
<filename>trojsten/login/tests.py import json from django.conf import settings from django.test import TestCase, override_settings from django.urls import reverse from trojsten.people.models import User @override_settings(SITE_ID=10, ROOT_URLCONF="trojsten.urls.login") class LoginViewsTests(TestCase): fixtures ...
2.296875
2
gen_bindings.py
mpeterv/emlua
2
35372
#!/usr/bin/env python import collections import re def write_constants(out, lua_version): out.write("EMSCRIPTEN_KEEPALIVE\n") out.write("emlua_constant emlua_constants[] = {\n") with open("lists/lua5{}/constants".format(lua_version)) as constants_file: for line in constants_file: c...
2.546875
3
fixtures/db.py
maxteplyakov/learn_python_test_automation
0
35373
<reponame>maxteplyakov/learn_python_test_automation import mysql.connector from models.group import Group from models.contact import Contact class DbFixture(): def __init__(self, host, name, user, password): self.host = host self.name = name self.user = user self.password = passwo...
3.109375
3
app/tests/support/test_views.py
Valaraucoo/raven
3
35374
import pytest from django.urls import reverse from tests.users import factories as users_factories @pytest.mark.django_db class TestTicketCreateView: def test_get(self,client): url = reverse('support:support-contact') response = client.get(url) assert response.status_code == 200 def ...
2.40625
2
lc0415_add_strings.py
bowen0701/python-algorithms-data-structures
8
35375
<filename>lc0415_add_strings.py """Leetcode 415. Add Strings Easy URL: https://leetcode.com/problems/add-strings/ Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: - The length of both num1 and num2 is < 5100. - Both num1 and num2 contains only digits 0-9. - ...
3.890625
4
tests/version2/test_users.py
SimonAwiti/Questioner-APIs
0
35376
"""Tests for handling the users resource""" import unittest import json from app import create_app from app.API.utilities.database import connection class UserTestCase(unittest.TestCase): """Unit testiing for the user regsitration endpoint""" def setUp(self): """Initialize the app and database connect...
3
3
maskrcnn_benchmark/utils/big_model_loading.py
microsoft/GLIP
295
35377
import numpy as np import torch import torch.nn as nn from collections import OrderedDict def tf2th(conv_weights): """Possibly convert HWIO to OIHW.""" if conv_weights.ndim == 4: conv_weights = conv_weights.transpose([3, 2, 0, 1]) return torch.from_numpy(conv_weights) def _rename_...
2.015625
2
convert/test_convert.py
mikewatkins-new/jboss_call_api
0
35378
import unittest from convert import jboss_command_to_http_request class TestJBOSSCommandToHTTPGETRequestOperationOnlyTestCase(unittest.TestCase): """Test case for JBOSS CLI commands operation only commands using HTTP GET""" def test_no_path_one_operations_no_params_http_get(self): """See if we only o...
3.03125
3
src/__init__.py
logic-and-learning/AdvisoRL
4
35379
<filename>src/__init__.py from . import baselines from . import common from . import reward_machines from . import rl from . import worlds
1.179688
1
hipo_rank/summarizers/textrank.py
MehwishFatimah/Hipo_modified
0
35380
<filename>hipo_rank/summarizers/textrank.py from hipo_rank import Scores, Document, Summary from summa.summarizer import summarize class TextRankSummarizer: def __init__(self, num_words: int = 200, stay_under_num_words: bool = False): print('\n-------------------------\ninit textrank\n---------------------...
2.828125
3
ratechecker/views.py
DalavanCloud/owning-a-home-api
1
35381
<reponame>DalavanCloud/owning-a-home-api from django.db.models import Q, Sum, Avg from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.views import APIView from ratechecker.models import Region, Rate, Adjustment, Fee from rat...
2.09375
2
sharpy/managers/combat2/protoss/micro_voidrays.py
raspersc2/sharpy-sc2
2
35382
from sc2.ids.effect_id import EffectId from sc2.position import Point2 from sc2.units import Units from sharpy.managers.combat2 import MicroStep, Action, MoveType from sc2 import AbilityId from sc2.unit import Unit class MicroVoidrays(MicroStep): def should_retreat(self, unit: Unit) -> bool: if unit.shiel...
2.46875
2
codegen.py
EXXETA/k8s-python-tools
1
35383
# # Copyright (c) 2019 EXXETA AG and others. # # This file is part of k8s-python-tools # (see https://github.com/EXXETA/k8s-python-tools). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information...
2.078125
2
gammapy/utils/wcs.py
grburgess/gammapy
3
35384
# Licensed under a 3-clause BSD style license - see LICENSE.rst """WCS related utility functions.""" from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from astropy.wcs import WCS from astropy.coordinates import Angle __all__ = [ 'linear_wcs_to_arrays', 'linea...
2.3125
2
module2-sql-for-analysis/titantic_ETL.py
elliotgunn/DS-Unit-3-Sprint-2-SQL-and-Databases
0
35385
<gh_stars>0 import pandas as pd import psycopg2 import sqlite3 # don't commit this dbname = '' user = '' password = '' host = '' pg_conn = psycopg2.connect(dbname=dbname, user=user, password=password, host=host) # connection object and cursor pg_conn pg_curs = pg_conn.cursor() # extract: c...
3.609375
4
merceedge/util/yaml.py
merceedge/MerceEdge
6
35386
import yaml from merceedge.exceptions import MerceEdgeError from merceedge.settings import ( logger_access, logger_code, logger_console ) _LOGGER = logger_code def load_yaml(fname): """Load a YAML file.""" try: with open(fname, encoding='utf-8') as conf_file: # If configuratio...
2.84375
3
manifest-build-tools/application/generate_manifest.py
dalebremner/on-tools
4
35387
<reponame>dalebremner/on-tools<gh_stars>1-10 #!/usr/bin/env python # Copyright 2016, DELLEMC, Inc. """ The script generate a new manifest for a new branch according to another manifest. For example, new branch: release/branch-1.2.3 date: 2016-12-15 00:00:00 The generated new manifest: branch-1.2.3-20161215 usage: ./...
2.453125
2
src/infer_cgg.py
lepidodendron/lepidodendron
0
35388
<reponame>lepidodendron/lepidodendron<gh_stars>0 from model_cgg import model ckpt = "cgg_36" mode = 1 from infer import infer, trim_str from itertools import islice from util_cw import CharWright from util_io import load_txt, save_txt from util_np import np, partition from util_tf import tf sess = tf.InteractiveSessio...
1.9375
2
viberbot/api/viber_requests/viber_seen_request.py
AaganMaskey/viber-bot-python
1
35389
from future.utils import python_2_unicode_compatible from ..event_type import EventType from viberbot.api.viber_requests.viber_request import ViberRequest class ViberSeenRequest(ViberRequest): def __init__(self): super(ViberSeenRequest, self).__init__(EventType.SEEN) self._message_token = None self._user_id = ...
2.28125
2
tests/simple_test.py
leoauri/auraloss
272
35390
<gh_stars>100-1000 import torch import auraloss input = torch.rand(8, 2, 44100) target = torch.rand(8, 2, 44100) loss = auraloss.freq.SumAndDifferenceSTFTLoss() print(loss(input, target))
2.09375
2
scripts/processcore.py
paulscottrobson/flat-forth-compiler
0
35391
<reponame>paulscottrobson/flat-forth-compiler # *************************************************************************************** # *************************************************************************************** # # Name : processcore.py # Author : <NAME> (<EMAIL>) # Date : 22nd December 2018 # Pu...
2.09375
2
basars_addons/schedules/__init__.py
Basars/basars-addons
0
35392
from basars_addons.schedules.cosine_decay import InitialCosineDecayRestarts from basars_addons.schedules.cosine_decay import CosineDecayWarmupRestarts
1.101563
1
cctrans/core/baidu.py
wangchuan2008888/ChineseCloudTranslation
3
35393
import random import hashlib import requests from cctrans import conf import cctrans def _sign(app_key, secret_key, text): salt = random.randint(32768, 65536) sign = app_key + text + str(salt) + secret_key return hashlib.md5(sign.encode('utf8')).hexdigest(), salt def _request_data(url, app_key, text, s...
2.421875
2
joint_teapot/workers/git.py
BoYanZh/joint-teapot
2
35394
import os import sys from time import sleep from typing import Optional from joint_teapot.utils.logger import logger current_path = sys.path[0] sys.path.remove(current_path) from git import Repo from git.exc import GitCommandError sys.path.insert(0, current_path) from joint_teapot.config import settings class Git...
2.09375
2
converters/all_lp2dgf.py
daajoe/transit_graphs
0
35395
#!/usr/bin/env bash trap 'ret=$?; printf "%s\n" "$ERR_MSG" >&2; exit "$ret"' ERR for file in $(find $1 -name \*.lp.bz2) ; do echo $file outputname="../gr/subgraphs/$(basename $file).gr" ./lp2dgf.py -f $file > $outputname if [ $? -ne 0 ]; then echo 'ERROR stopping...' exit 1 fi done
1.5625
2
formulario/urls.py
exildev/Rondax
0
35396
<filename>formulario/urls.py from django.conf.urls import include, url from formulario import views urlpatterns = [ url(r'^form/registro/(?P<pk>\d+)/$', views.RegistroSupraForm.as_view(), name='form_registro'), url(r'^form/registro/create/$', views.RegistroCreateSupraForm.as_view(), name='form_crear_registro'), url...
1.867188
2
customers/customerauth/migrations/0002_auto_20190127_0931.py
nkmrohit/python
0
35397
<reponame>nkmrohit/python # Generated by Django 2.1.4 on 2019-01-27 04:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('customerauth', '0001_initial'), ] operations = [ migrations.AlterField( model_name='customers', ...
1.820313
2
utils/logger.py
FFTYYY/RoR_relation_extraction
25
35398
from .watch_time import time_str import fitlog class Logger: def __init__(self , fil_path = None): self.log_fil = open(fil_path , "w" , encoding = "utf-8") def nolog(self , cont = ""): pass def log_print(self , cont = ""): self.log_fil.write(cont + "\n") self.log_fil.flush() print (cont) fitlog.add_t...
2.734375
3
tools/mytools/merge_layer.py
tiger0421/DDRNet.pytorch
0
35399
import cv2 import numpy as np import os under_layer_path = '/home/ubuntu/share/cam_lidar/Tu_indoor/red2' upper_layer_path = "/home/ubuntu/share/cam_lidar/Tu_indoor/aisle02_dir" target_files = os.listdir(upper_layer_path) target_imgs = [f for f in target_files if os.path.isfile(os.path.join(upper_layer_path, f))] try: ...
2.578125
3