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
tests/test_cards.py
zergov/flashcards
21
12764051
<gh_stars>10-100 import unittest from flashcards import cards from flashcards.cards import StudyCard class TestModulefunctions(unittest.TestCase): def test_create_card_from_dict(self): data = {'question': '2+2=?', 'answer': '4'} card = cards.create_from_dict(data) self.assertEqual('2+2=...
3.1875
3
venv/lib/python3.7/site-packages/Xlib/keysymdef/greek.py
umr-bot/sliding-puzzle-solver-bot
10
12764052
<gh_stars>1-10 XK_Greek_ALPHAaccent = 0x7a1 XK_Greek_EPSILONaccent = 0x7a2 XK_Greek_ETAaccent = 0x7a3 XK_Greek_IOTAaccent = 0x7a4 XK_Greek_IOTAdiaeresis = 0x7a5 XK_Greek_OMICRONaccent = 0x7a7 XK_Greek_UPSILONaccent = 0x7a8 XK_Greek_UPSILONdieresis = 0x7a9 XK_Greek_OMEGAaccent = 0x7ab XK_Greek_accentdieresis = ...
1.078125
1
test_collision/test_bodies.py
Klumhru/boost-python-bullet
2
12764053
<reponame>Klumhru/boost-python-bullet #!/usr/bin/env python # -*- coding: utf-8 -*- """ test_dynamics.test_bodies """ from __future__ import unicode_literals, print_function, absolute_import
1.015625
1
prebids/databasing/psydb.py
jokedurnez/Psychosis
0
12764054
<reponame>jokedurnez/Psychosis<filename>prebids/databasing/psydb.py ''' File name: psydb.py Author: <NAME> Date created: 10/31/2017 Date last modified: 10/31/2017 Python Version: 2.7 Description: Script to clean up NIDB Project: Psychosis ''' from distutils.dir_util import copy_tree from col...
2.4375
2
dashboard/models.py
FurSquared/dev-game
1
12764055
<gh_stars>1-10 import pytz from django.utils import timezone from django.db import models from django.core.validators import RegexValidator from django.conf import settings from django.utils import timezone alphanumeric_validator = RegexValidator(r'^[0-9a-zA-Z_-]*$', 'Only alphanumeric, underscore, and dash are allow...
2.375
2
meltingpot/python/utils/substrates/reaction_graph_utils.py
yunfanjiang/meltingpot
0
12764056
<gh_stars>0 # Copyright 2020 DeepMind Technologies Limited. # # 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/LICENSE-2.0 # # Unless required by applicab...
2.109375
2
nrfreverse.py
matthew5025/nrf5x-tools
0
12764057
<reponame>matthew5025/nrf5x-tools<filename>nrfreverse.py #!/usr/bin/env python3.5 """ NRF5 reverse tool using IDA-python """ import sqlite3 import idaapi import idc def launch_print(): """print message""" print("############################ nRF5-tool ############################ ") print("##### ...
2.234375
2
tests/tests_manifests_workflow/test_component_opensearch_dashboards_min.py
VijayanB/opensearch-build
0
12764058
<gh_stars>0 # SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. import unittest from unittest.mock import MagicMock, patch from git.git_repository import GitRepository from manif...
2.09375
2
the-settler/API/Screen/moveable_player.py
EnderDas/the-settler
0
12764059
#moveable_player class MoveablePlayer: def __init__(self, x=2, y=2, dir="FORWARD", color="170"): self.x = x self.y = y self.direction = dir self.color = color
3.03125
3
data-science/CollectiveIntelligence/com/recommendations/Recommendations.py
matija94/show-me-the-code
1
12764060
<reponame>matija94/show-me-the-code<gh_stars>1-10 ''' Created on Mar 21, 2017 @author: matija FUNCTIONS FOR COMPUTING SIMILARITY BETWEEN TWO DATASETS BASED ON IT'S KEYS HERE WE USED PERSON AS KEY AND THEIRS VALUES ARE RATINGS FOR THE MOVIES WE COMPUTED A SIMILARITIES IN THIS MODULE BASED ON TWO FUNCTIONS 1.EUCLIDEAN...
3.578125
4
pycon/schedule/management/commands/create_schedule.py
pyconjp/pyconjp-website
6
12764061
<reponame>pyconjp/pyconjp-website import csv import time from datetime import datetime, timedelta from django.core.management.base import BaseCommand, CommandError from symposion.conference.models import Section, current_conference from symposion.proposals.models import ProposalBase from symposion.schedule.models im...
2.5
2
Desktop_App/Addax/env/Lib/site-packages/serial/utilities/__init__.py
filesmuggler/antelope
0
12764062
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, \ print_function, unicode_literals from . import compatibility compatibility.backport() # noqa import builtins import os # noqa import sys # noqa from io import UnsupportedOperation # noqa from collections import O...
1.976563
2
src/orders/signals/handlers.py
tlgtaa/education-backend
1
12764063
<reponame>tlgtaa/education-backend<gh_stars>1-10 from django.db.models.signals import post_save from django.dispatch import receiver from orders.models import Order from tinkoff.models import PaymentNotification as TinkoffPaymentNotification @receiver(post_save, sender=TinkoffPaymentNotification) def mark_order_as_p...
2.109375
2
google_workflow/encv_to_db/settings.py
hcksystem/exposure-notifications-metrics-public
14
12764064
<reponame>hcksystem/exposure-notifications-metrics-public import os from pathlib import Path from typing import Optional from pydantic import BaseSettings class Settings(BaseSettings): google_application_credentials_json: Optional[str] = None # If supplied, we will read this json blob right away as the credenti...
2.390625
2
pycholib/Trial.py
lugtigheid/PychophysicsLibrary
0
12764065
# -*- coding: utf-8 -*- class Trial(object): ''' Created Fri 2 Aug 2013 - ajl Last edited: Sun 4 Aug 2013 - ajl This class contains all variables and methods associated with a single trial ''' def __init__(self, trialid = 0, staircaseid = 0, conditi...
3.421875
3
utilities/stopping/stopping_key.py
bootml/agent
0
12764066
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'cnheider' from pynput import keyboard # import keyboard import utilities as U COMBINATIONS = [ {keyboard.Key.shift, keyboard.Key.alt, keyboard.KeyCode(char='s')}, {keyboard.Key.shift, keyboard.Key.alt, keyboard.KeyCode(char='S')}, ] CALLBACKS = [] #...
2.96875
3
modules/get_cc.py
honchen22/Image-Hashing
0
12764067
import numpy as np import json class CorrelationCoefficient: def __init__(self): self.hash_dict = {} self.cc_dict = {} def init_hash_dict(self): with open('modules/benchmark_cc/standard_benchmark_hash.json', 'r') as f: self.hash_dict = json.loads(f.read()) def init_cc_...
2.765625
3
recover.py
bennofs/nixpkgs-locate
0
12764068
#!/usr/bin/env python3 import sys import json CHUNK_SIZE = 4*32*1024 def wrong_written_size(x): out = 0 while x >= 0: out += x x -= CHUNK_SIZE return out if __name__ == '__main__': with open(sys.argv[1], 'rb') as f: data = f.read() print(sys.argv[1]) try: j...
3.109375
3
refinery/units/formats/pdf.py
bronxc/refinery
0
12764069
<filename>refinery/units/formats/pdf.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import annotations from typing import Optional, Set, TYPE_CHECKING, cast from itertools import islice if TYPE_CHECKING: from PyPDF2.generic import EncodedStreamObject from refinery.units.formats import PathExtr...
2.125
2
malcolm/modules/aravisGigE/blocks/__init__.py
hir12111/pymalcolm
11
12764070
from malcolm.yamlutil import check_yaml_names, make_block_creator aravisGigE_driver_block = make_block_creator(__file__, "aravisGigE_driver_block.yaml") aravisGigE_runnable_block = make_block_creator( __file__, "aravisGigE_runnable_block.yaml" ) aravisGigE_manager_block = make_block_creator(__file__, "aravisGigE_m...
1.898438
2
project/blueprints/bp1/controllers.py
takwas/flask-layout-demo
0
12764071
from werkzeug.exceptions import NotFound from . import bp_obj, views from project.core.models import User @bp_obj.route('/') def index(): return 'Welcome home.' @bp_obj.route('/users/<username>') def get_profile_info(username): user = User.query.filter(User.username == username).first() if user is N...
2.171875
2
src/Utilities/__init__.py
christosgalano/Chatroom_Server
0
12764072
from .shared import create_shared_standards create_shared_standards()
1.117188
1
main (Joao Costa's conflicted copy 2011-07-29).py
borgaster/SpaceWarsEvolved
0
12764073
import time from animation import * from asteroidField import * from background import * from loader import * from physics import * from player import * from powerup import * import pygame from pygame.locals import * from rotatingMenu_img import * from spacemenu import * from starField import * # teclas dos jogadore...
2.53125
3
nmap to excel converter/Older version/nmap_to_excel_conv_v1.7.py
pr2h/Penetration-Testing-Tools
1
12764074
# Welcome function def hujambo(): # Release Date : 21 May 2018 print ''' ################################################## # Tool : nmap_to_excel_conv # # Version : 1.7 # # Profile : https://github.com/pr2h/ # # Coded with Python 2.7 ...
2.90625
3
bld/libs/builder/src/steps/copyfilestep.py
webbers/dongle.net
2
12764075
<reponame>webbers/dongle.net<filename>bld/libs/builder/src/steps/copyfilestep.py import os import distutils.file_util from steps.abstractstep import * class CopyFileStep(AbstractStep): """Copy File Step""" def __init__( self, srcFile, destFile, overwrite = 1, makeDir = 1 ): AbstractStep.__init__( self...
2.46875
2
xdo/__init__.py
rickyosser/python-libxdo
62
12764076
# -*- coding: utf-8 -*- import ctypes import os from collections import namedtuple from ctypes import POINTER from six.moves import range from .xdo import libX11 as _libX11 from .xdo import libxdo as _libxdo from .xdo import ( # noqa CURRENTWINDOW, SEARCH_CLASS, SEARCH_CLASSNAME, SEARCH_DESKTOP, SEARCH_NAME, ...
2.359375
2
reliance/DD/hybrid.py
Lizz647/SJTU-Software
2
12764077
<filename>reliance/DD/hybrid.py import os def spurious_hybrid(num,seqlist): filename = "cachefile" score = 0 with open(filename,'w') as fp: fp.write(str(num)+'\n') fp.write(">targetseq"+'\n') fp.write(seqlist[0]+'\n') for i in range(num-1): fp.write(">otherseq"+'...
2.53125
3
saveToDatabase.py
MuSystemsAnalysis/craigslist_area_search
0
12764078
<gh_stars>0 import sqlite3 import sys def saveCityNamesToDatabase(cityList): database_file = 'test.db' #connect conn = sqlite3.connect(database_file) cursor = conn.cursor() #create table cursor.execute('DROP TABLE IF EXISTS cities') cursor.execute('''CREATE TABLE cities (ID INTEGER PRIMARY...
4
4
netbox/utilities/filters.py
michaelxniu/netbox
0
12764079
import django_filters from django import forms from django.conf import settings from django.db import models from extras.models import Tag def multivalue_field_factory(field_class): """ Given a form field class, return a subclass capable of accepting multiple values. This allows us to OR on multiple filt...
2.671875
3
TestRegExTabs.py
allisonoler/Tabular_File_Benchmark
0
12764080
<filename>TestRegExTabs.py<gh_stars>0 import itertools import mmap import sys import re file_path = sys.argv[1] out_file_path = sys.argv[2] memory_map = sys.argv[3] == "True" def add_column(i, end_character): if i in index_range: return r"([^\t]+" + end_character + ")" else: return r"(?:[^\t]+...
2.609375
3
simpleoperationandvirus.py
Jarvood11/Secureoperation11
0
12764081
# -*- coding: utf-8 -*- """ Created on Sun May 23 16:38:11 2021 @author: Jaroslav """ # -*- coding: utf-8 -*- def f1(x): return x+1 x2=f1(1) print("vvedite vo skolko uvelichet functziy:") n=int(input()) def doublern (f): def g(n): return n*f return g #print(x2) g=double...
3.25
3
07_aula04/q2.py
fdelgadov/LabADAGrupoB
0
12764082
## Q2: What is the time complexity of ## O(n), porque es un for de i=n hasta i=1 # Algoritmo # for (i = n; i > 0; i--) { # n # statement; # 1 # } n = 5 for i in range(n, 0, -1): # n print(i); # 1
3.859375
4
Previous_Designs/Hybrid_Prototype/Software/RPi_PythonScripts/hybrid_logger_2.py
UCHIC/CIWS-Loggers
6
12764083
#!/bin/env/python # File: hybrid_logger.py # # Raspberry Pi data transfer script # # Date: 6/27/18 # <NAME> and <NAME> # Platform: Raspberry Pi 3 model B # # Python version: 2.7.9 import os # for Linux terminal commands\ import RPi.GPIO as GPIO # for Gene...
2.5
2
ddn/data_logger.py
chamillj/SDN-Analytics
0
12764084
#@@---------------------------@@ # Author: <NAME> # Date: 5/18/17 # Description: #@@---------------------------@@ from mininet.log import setLogLevel, info, lg import sys import logging import subprocess class Logger(object): def __init__(self, terminal, filename): self.terminal = terminal self...
2.46875
2
Scripts/python/scripts mundo 1/jogo do dodo/Desafio021.py
BrenoNAlmeida/Scripts-Escola
0
12764085
from pygame import * print('a musica será executada em breve') mixer.init() mixer.music.load('Desafio021.mp3') mixer.music.play() print('tocando...') while mixer.music.get_busy(): time.Clock().tick(10) print('a musica acabou !!!') escolha4 = '' while escolha4 != 'sim' and escolha4 != 'nao': escolha4 = str(input...
3.078125
3
package/tests/application/models/test_author.py
Jhsmit/awesome-panel
1
12764086
# pylint: disable=redefined-outer-name,protected-access # pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring def test_can_construct_author(author): assert isinstance(author.name, str) assert isinstance(author.url, str) assert isinstance(author.github_url, str)...
2.4375
2
tests/zquantum/core/serialization_test.py
bartubisgin/z-quantum-core
0
12764087
<gh_stars>0 """Test cases for serialization module.""" import json import os import numpy as np import pytest from scipy.optimize import OptimizeResult from zquantum.core.bitstring_distribution import BitstringDistribution from zquantum.core.history.recorder import HistoryEntry, HistoryEntryWithArtifacts from zquantum...
2.015625
2
openstack_dashboard/dashboards/project/data_processing/job_binaries/forms.py
maofutian/horizon
0
12764088
<reponame>maofutian/horizon<gh_stars>0 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
1.796875
2
examples/tempo.py
storagebot/pyechonest
2
12764089
<reponame>storagebot/pyechonest import sys from pyechonest import song def get_tempo(artist, title): "gets the tempo for a song" results = song.search(artist=artist, title=title, results=1, buckets=['audio_summary']) if len(results) > 0: return results[0].audio_summary['tempo'] else: re...
2.890625
3
archivy/click_web/resources/cmd_exec.py
thethales/archivy
0
12764090
<filename>archivy/click_web/resources/cmd_exec.py import os import shutil import subprocess import sys import tempfile import traceback from pathlib import Path from typing import List from flask import Response, request from werkzeug.utils import secure_filename from archivy import click_web from .inp...
2.421875
2
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/script/pick_nrf51_files.py
pradeep-gr/mbed-os5-onsemi
22
12764091
#!/usr/bin/env python # Copyright (c) 2015-2016 ARM Limited # SPDX-License-Identifier: Apache-2.0 # # 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/LICEN...
2.0625
2
mdstcl_kernel/mdstcl_kernel/kernel.py
MDSplus/jupyter
1
12764092
from ipykernel.kernelbase import Kernel from MDSplus import Data class MdstclKernel(Kernel): implementation = 'Mdstcl' implementation_version = '1.0' language = 'no-op' language_version = '0.1' language_info = { 'name': 'mdstcl commands', 'mimetype': 'text/plain', 'file_exte...
2.171875
2
agenda.py
StartFuture/workstation-backend
1
12764093
<reponame>StartFuture/workstation-backend<filename>agenda.py import app.dao as Bank # agenda workstation from datetime import datetime from datetime import timedelta # validando e salvando agendamentos start_date = request.form['data_inicio'] # aaaa/mm/dd start_hour = request.form["hora_inicio"] # hh:mm:ss final_hou...
2.53125
3
compare_experiments/compare_generic_genes.py
ajlee21/generic-expression-patterns
8
12764094
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:generic_expression] * # language: python # name: conda-env-g...
2.203125
2
nengo_ssp/__init__.py
nsdumont/nengo_ssp
0
12764095
<gh_stars>0 """Top-level package for Spatial Semantic Pointers.""" __author__ = """<NAME>-<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0' import nengo_ssp.dists import nengo_ssp.hrr_algebra import nengo_ssp.plotting import nengo_ssp.networks import nengo_ssp.utils from nengo_ssp.spatial_semantic_pointer import ...
1.203125
1
tests/implementations/sqlalchemy_.py
novamera/fastapi-crudrouter
0
12764096
from fastapi import FastAPI from sqlalchemy import Column, Float, Integer, String from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy_utils import create_database, database_exists, drop_database from fastapi_crudrouter imp...
2.640625
3
fabfile.py
enterstudio/serapis
7
12764097
""" Steps: -get the summer.ai.pem key -login to the env.host machine and add your public key to the machine's authorized keys http://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html """ from fabric.api import local, sudo, run, warn_only, env, lcd, cd import yaml with open("serapis/config/default...
1.992188
2
LDAR_Sim/src/initialization/input_mapper_v1.py
SensorUp/LDAR_Sim
2
12764098
<filename>LDAR_Sim/src/initialization/input_mapper_v1.py # ------------------------------------------------------------------------------ # Program: The LDAR Simulator (LDAR-Sim) # File: LDAR-Sim input mapper sample # Purpose: Example input mapper # # Copyright (C) 2018-2021 Intelligent Methane Monitori...
1.679688
2
backend/unpp_api/apps/project/migrations/0038_auto_20171107_0801.py
unicef/un-partner-portal
6
12764099
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-11-07 08:01 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('project', '0037_auto_20171031_0715'), ] operations = [ migrations.RenameField( ...
1.570313
2
dataBase/imdb.py
AmitNiz/homeflix
1
12764100
<filename>dataBase/imdb.py import requests,json,os url = "https://movie-database-imdb-alternative.p.rapidapi.com/" headers = { 'x-rapidapi-host': "movie-database-imdb-alternative.p.rapidapi.com", 'x-rapidapi-key': os.environ['IMDB_KEY'] } def search_by_title(title): query_string = {'r':'json','s':ti...
3.28125
3
serverful/check_collections_for_updates.py
nggdpp/ndc-pipeline
0
12764101
<reponame>nggdpp/ndc-pipeline<gh_stars>0 ''' This script works through all of the raw collection records dumped out of ScienceBase, figures out if anything has changed and takes appropriate action. It keeps track of what it's doing by writing a property back into the raw collection records it has processed. It's essent...
2.375
2
orchestrator/schemas/subscription.py
Georgi2704/orchestrator-core
1
12764102
<reponame>Georgi2704/orchestrator-core<gh_stars>1-10 # Copyright 2019-2020 SURF. # 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 req...
1.84375
2
layers/senet.py
zsync/target-classification
2
12764103
import tensorflow as tf from layers.utils import CustomLayer class SELayer(CustomLayer): def __init__(self): super().__init__() def build(self, input_shape): B, H, W, C = input_shape self.squeeze = tf.keras.layers.GlobalAveragePooling2D() self.excitation = tf.keras.Sequential...
2.8125
3
src/cleora.py
Synerise/kdd-cup-2021
13
12764104
<filename>src/cleora.py import subprocess def train_cleora(dim: int, iter_: int, columns: str, input_filename: str, working_dir: str): """ Training Cleora. See more details: https://github.com/Synerise/cleora/ """ command = ['./cleora-v1.1.0-x86_64-unknown-linux-gnu', '--columns', colum...
2.3125
2
meli_challenge/core/__init__.py
rafaelleinio/meli-challenge
1
12764105
<reponame>rafaelleinio/meli-challenge """core module.""" from meli_challenge.core.characters_graph import CharactersGraph from meli_challenge.core.spark_client import SparkClient __all__ = ["CharactersGraph", "SparkClient"]
0.980469
1
tests/settings.py
boxed/django-fastdev
26
12764106
<filename>tests/settings.py import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # These overly specific paths are for jinja2 TEMPLATE_DIRS = [ os.path.join(BASE_DIR, 'tests'), os.path.join(BASE_DIR, 'tests/templates'), ] TEMPLATE_DEBUG = True TEMPLATES = [ { 'BACKEND': 'django.templat...
1.828125
2
bar_viz.py
YuzheSHI/Plot-Templates
2
12764107
import matplotlib import matplotlib.pyplot as plt import numpy as np import os import warnings from matplotlib import colors matplotlib.rc("font",family='AR PL SungtiL GB') warnings.filterwarnings('ignore') def vis_national(national, native, null, x): fig = plt.figure() ax = fig.add_subplot(111) plt.gri...
2.9375
3
ArticlesDataDownloader/ACM/ACMArticlesHandler.py
LechMadeyski/PhD19MarekSosnicki
2
12764108
<filename>ArticlesDataDownloader/ACM/ACMArticlesHandler.py import os import logging import time from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.action_chains import ActionChains from ArticlesDataDownloader.ArticleData import ArticleData from ArticlesDataDownloader.bib_to_arti...
2.828125
3
pizdabol_week.py
NikitaMikhailov/bot_heroku
0
12764109
#!/usr/bin/env bash #!/bin/bash #!/bin/sh #!/bin/sh - from vk_api.utils import get_random_id from vk_api.bot_longpoll import VkBotLongPoll from vk_api import VkUpload import requests import vk_api import time import bot_functions import bot_variable if bot_variable.flag_repository: start_path = "" else: start...
2.203125
2
python/cvi_toolkit/transform/onnx_optimizer.py
sophgo/tpu_compiler
3
12764110
<gh_stars>1-10 from typing import cast import onnx import copy import torch import numpy as np import onnxruntime as rt import onnx.helper import onnx.numpy_helper import onnx.shape_inference from collections import OrderedDict from numbers import Number from onnx import TensorProto, mapping def convert_onnx_attribut...
2.03125
2
tutoriales/tutorial08_03.py
pgentil/PC
0
12764111
#%% VARIABLES 'Variables' # var1 = 10 # var2 = "Hello World" # var3 = None # var4 = 3.5 # if 0: # print ("hello world 0") #el 0 fnciona como Falsey # if 1: # print ("hello world 1") #el 1 funciona como Truthy # x1 = 100 # x2 = 20 # x3 = -5 # y = x1 + x2 + x3 # z = x1 - x2 * x3 # w = (x1+x2+x3) - (x1-...
3.375
3
sympy/matrices/expressions/tests/test_funcmatrix.py
ovolve/sympy
319
12764112
from sympy import (symbols, FunctionMatrix, MatrixExpr, Lambda, Matrix) def test_funcmatrix(): i, j = symbols('i,j') X = FunctionMatrix(3, 3, Lambda((i, j), i - j)) assert X[1, 1] == 0 assert X[1, 2] == -1 assert X.shape == (3, 3) assert X.rows == X.cols == 3 assert Matrix(X) == Matrix(3, ...
3.203125
3
resources/Wireshark/WiresharkDissectorFoo/test/suite_dfilter/group_double.py
joshis1/C_Programming
2
12764113
# Copyright (c) 2013 by <NAME> <<EMAIL>> # # SPDX-License-Identifier: GPL-2.0-or-later import unittest import fixtures from suite_dfilter.dfiltertest import * @fixtures.uses_fixtures class case_double(unittest.TestCase): trace_file = "icmp.pcapng.gz" def test_eq_1(self, checkDFilterCount): dfilter ...
2.078125
2
scrapers/blazar2.py
joshdabosh/neutrinos-analysis-2018
0
12764114
from webdriver_manager.chrome import ChromeDriverManager from bs4 import BeautifulSoup as bs from selenium import webdriver import json browser = webdriver.Chrome(ChromeDriverManager().install()) browser.get("https://www.asdc.asi.it/bzcat/") page = browser.execute_script("setPageSizeValue(0); setHead(Head, 1,...
3.0625
3
code_examples/tensorflow/basic_nmt_example/nmt-tf.py
Splendon/examples
0
12764115
# Copyright 2019 Graphcore Ltd. import tensorflow as tf import os import time import argparse import numpy as np import random from tensorflow.python.ipu.scopes import ipu_scope from tensorflow.python.ipu import ipu_compiler from seq2seq_edits import AttentionWrapperNoAssert, dynamic_decode, TrainingHelperNoCond, Gre...
2.140625
2
testing/freeze/create_executable.py
solackerman/pytest
0
12764116
""" Generates an executable with pytest runner embedded using PyInstaller. """ if __name__ == '__main__': import pytest import subprocess hidden = [] for x in pytest.freeze_includes(): hidden.extend(['--hidden-import', x]) args = ['pyinstaller', '--noconfirm'] + hidden + ['runtests_script.p...
1.992188
2
plugins/modules/oci_appmgmt_control_monitored_instance_actions.py
LaudateCorpus1/oci-ansible-collection
0
12764117
#!/usr/bin/python # Copyright (c) 2020, 2022 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) # Apache License v2.0 # See LICENSE.TXT for d...
1.71875
2
simpleseo/models.py
gelo-zhukov/django-simple-seo
1
12764118
from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import gettext_lazy as _ from simpleseo.utils im...
1.921875
2
cloudpassage/fim_policy.py
patricksanders/cloudpassage-halo-python-sdk
8
12764119
<filename>cloudpassage/fim_policy.py """FimPolicy and FimBaseline classes""" import cloudpassage.sanity as sanity from .halo_endpoint import HaloEndpoint from .http_helper import HttpHelper class FimPolicy(HaloEndpoint): """FimPolicy class: The list_all() method allows filtering of results with keyword argu...
2.515625
3
tree/python/leetcode106_Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal.py
wenxinjie/leetcode
0
12764120
# Given inorder and postorder traversal of a tree, construct the binary tree. # Note: # You may assume that duplicates do not exist in the tree. # For example, given # inorder = [9,3,15,20,7] # postorder = [9,15,7,20,3] # Return the following binary tree: # 3 # / \ # 9 20 # / \ # 15 7 # Definit...
4.09375
4
imagefarm.py
eyihluyc/cubiciser
0
12764121
import cv2 import numpy as np from random import randint from functools import reduce from os import walk from scipy.spatial import ConvexHull DIMENSIONS = (512, 512) def fragment_overlay(background_img, masked_fragment): mask = masked_fragment.astype(int).sum(-1) == np.zeros(DIMENSIONS) backgrou...
2.296875
2
ptrello/cli.py
Ibistylus/ptrello
0
12764122
# -*- coding: utf-8 -*- """Console script for ptrello.""" import sys import click import logging from ptrello import api from ptrello.core.config import logger # from ptrello.core.config import settings # import inspect logger = logging.getLogger("ptrello."+__name__) default_note = "quicknote.txt" class Config(obje...
2.421875
2
resnet_conv_svs.py
brain-research/conv-sv
67
12764123
<gh_stars>10-100 """ Copyright 2018 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/LICENSE-2.0 Unless required by applicable...
1.851563
2
chain_builder.py
jrigden/name_machine
0
12764124
import gzip import io import json import os import random import time import requests import requests_cache requests_cache.install_cache() request = requests.get('https://rpg.rigden.us/seeds_of_infinity/resources/json/names.json') NAMES = request.json()['data'] HOME_PATH = os.path.dirname(os.path.realpath(__file__...
2.5
2
GeoDjango/geodjango/points/models.py
lmrissi/piloto_geodjango
0
12764125
<gh_stars>0 # This is an auto-generated Django model module created by ogrinspect. from django.contrib.gis.db import models from django.template.defaultfilters import date class pocos(models.Model): proprietario = models.CharField("proprietario", max_length=254) orgao = models.CharField("orgao", max_le...
1.945313
2
modules/drive/messages.py
xochilt/cousebuilder
0
12764126
<filename>modules/drive/messages.py<gh_stars>0 # Copyright 2015 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/LICENS...
2.375
2
how_tos/how_to_invoke_a_contract.py
casper-network/pycspr
11
12764127
import argparse import os import pathlib import typing import pycspr from pycspr import NodeClient from pycspr import NodeConnection from pycspr.crypto import KeyAlgorithm from pycspr.types import CL_ByteArray from pycspr.types import CL_U256 from pycspr.types import Deploy from pycspr.types import DeployParameters fr...
1.921875
2
systems/views.py
rtucker-mozilla/minventory
0
12764128
<reponame>rtucker-mozilla/minventory import csv import re import simplejson as json from django.views.decorators.csrf import csrf_exempt from django.core.exceptions import ValidationError from django.urls import reverse from django.db import IntegrityError from django.db.models import Q from django.http import HttpResp...
2.21875
2
matplotlibTUT/plt12_contours.py
subshine/tutorials
10,786
12764129
# View more python tutorials on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial # 12 - contours """ Please note, this script is for python3+. If you are using python2+, please modify it accordi...
4.125
4
dipy/utils/arrfuncs.py
oesteban/dipy
3
12764130
""" Utilities to manipulate numpy arrays """ import sys import numpy as np from nibabel.volumeutils import endian_codes, native_code, swapped_code def as_native_array(arr): """ Return `arr` as native byteordered array If arr is already native byte ordered, return unchanged. If it is opposite endian, ...
3.3125
3
pipeline/pipeline.py
Salazar-99/Kubeflow-DigitalOcean
0
12764131
import kfp import kfp.dsl as dsl from kfp.components import create_component_from_func import kfp.components as comp IMAGE = 'salazar99/python-kubeflow:latest' DATA_URL = 'https://gs-kubeflow-pipelines.nyc3.digitaloceanspaces.com/clean-spam-data.csv' # Download data # def download_data(source_path: str, output_csv: c...
2.765625
3
tools/win/linker_verbose_tracking.py
google-ar/chromium
777
12764132
<filename>tools/win/linker_verbose_tracking.py # Copyright (c) 2016 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. """ This script parses the /verbose output from the VC++ linker and uses it to explain why a particular ob...
1.195313
1
setup.py
berryweinst/pytorch-attention
149
12764133
from distutils.core import setup setup( name='attention', version='0.1.0', author='tllake', author_email='<EMAIL>', packages=['attention'], description='An attention function for PyTorch.', long_description=open('README.md').read())
1.085938
1
service/models.py
acslaszlo/docker-test
0
12764134
<reponame>acslaszlo/docker-test<gh_stars>0 from flywheel import Field, Model class Data(Model): id = Field(data_type=str, hash_key=True) val1 = Field(data_type=str) val2 = Field(data_type=int) val3 = Field(data_type=str)
2.140625
2
tests/test_socketutil.py
gst/Pyro5
0
12764135
import sys import os import platform import threading import socket import pytest from Pyro5 import config, socketutil # determine ipv6 capability has_ipv6 = socket.has_ipv6 if has_ipv6: s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) try: s.connect(("::1", 53)) s.close() socket....
2.34375
2
keno/biased_rng.py
matthewdeanmartin/keno
0
12764136
# coding=utf-8 """ Attempt to creat an RNG that picks numbers like humans # favors date parts (1-31, 1-12, 19/20, 50-99/00-18) # seeks/avoids patterns (i.e. 1,2,3,4,5 or 2,22,32,42) # favors past winning numbers # favors culturally meaningful numbers, 777, 888, etc. # http://ww2.amstat.org/publications/jse/v13n2/meck...
3.734375
4
Extras/at 17.py
SkaarlK/Learning-Python
2
12764137
#Ler 80 números e informar quantos estão no intervalo entre 10 (inclusive) e 150 (inclusive). nums = [] quantia = str(input("Quantos números você deseja inserir (deixe em branco para 80)? ")) def addNumber(): newNumber = int(input("Insira o Número: ")) if newNumber >= 10 and newNumber <= 150: nums.append(newNumb...
3.734375
4
Python/diagonal-traverse.py
sm2774us/leetcode_interview_prep_2021
0
12764138
# Time: O(m * n) # Space: O(1) class Solution(object): def findDiagonalOrder(self, matrix): """ :type matrix: List[List[int]] :rtype: List[int] """ if not matrix or not matrix[0]: return [] result = [] row, col, d = 0, 0, 0 dirs = [(-1, ...
3.25
3
opp/sharpen_up_upper_test.py
heeryoncho/sensors2018cnnhar
10
12764139
import numpy as np from sklearn.metrics import accuracy_score, confusion_matrix from keras.models import load_model import select_data as sd import warnings warnings.simplefilter(action='ignore', category=UserWarning) import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' ''' See paper: Sensors 2018, 18(4), 1055; http...
3.09375
3
bip_utils/bip/bip38/__init__.py
MIPPLTeam/bip_utils
0
12764140
from bip_utils.bip.bip38.bip38_addr import Bip38PubKeyModes from bip_utils.bip.bip38.bip38_ec import Bip38EcKeysGenerator from bip_utils.bip.bip38.bip38 import Bip38Decrypter, Bip38Encrypter
1.0625
1
test/test_photokeeper.py
virantha/photokeeper
0
12764141
<reponame>virantha/photokeeper<filename>test/test_photokeeper.py import photokeeper.photokeeper as P import pytest import os import logging import smtplib from mock import Mock from mock import patch, call from mock import MagicMock from mock import PropertyMock class Testphotokeeper: def setup(self): s...
1.765625
2
setup.py
moonbings/synthtiger
1
12764142
<filename>setup.py import os from setuptools import find_packages, setup ROOT = os.path.abspath(os.path.dirname(__file__)) def read_version(): data = {} path = os.path.join(ROOT, "synthtiger", "_version.py") with open(path, "r", encoding="utf-8") as fp: exec(fp.read(), data) return data["__v...
1.625
2
programmers/P49994.py
hanjoondev/zb-study
0
12764143
<gh_stars>0 from time import perf_counter_ns as ns def solution(dirs): d = {c: direc for c, direc in zip('UDRL', ((1, 0), (-1, 0), (0, 1), (0, -1)))} v = set() r = c = 0 for cmd in dirs: dr, dc = d[cmd] nr, nc = r + dr, c + dc if -5 <= nr <= 5 and -5 <= nc <= 5: ...
2.75
3
maya/app/renderSetup/model/dragAndDropBehavior.py
arjun-namdeo/py_stubs
0
12764144
""" This module provides the drag and drop base and concrete classes. They are derived from the API class MPxDragAndDropBehavior and are used to handle the connections to make when the user drops a node or an attribute on to another node or attribute. The interface to implement for each derived class is the followin...
2.5
2
practice/coursera/p03_dynamic_prog/p03_2_primitive_calculator.py
deehzee/dsalgo
0
12764145
# Uses python3 from collections import deque import sys ### Solution 0: Bruteforce ### def optimal_sequence_recursive(n): if n == 1: return [1] n_ops = n + 1 if n % 3 == 0: seq = optimal_sequence_recursive(n // 3) if len(seq) + 1 < n_ops: n_ops = 1 + len(seq) ...
3.734375
4
tensorflow_datasets/core/_sharded_files_test.py
shikhar2707/datasets
7
12764146
# coding=utf-8 # Copyright 2020 The TensorFlow 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 appl...
2.1875
2
source/pkgsrc/benchmarks/glmark2/patches/patch-waflib_Tools_c__config.py
Scottx86-64/dotfiles-1
1
12764147
$NetBSD: patch-waflib_Tools_c__config.py,v 1.1 2019/12/22 22:21:58 joerg Exp $ When detecting the C++ compiler, force C++ mode for stdin as the wrappers add -std=c++11 and that breaks for C input. --- waflib/Tools/c_config.py.orig 2019-12-21 22:11:24.000906920 +0000 +++ waflib/Tools/c_config.py @@ -632,7 +632,7 @@ de...
1.351563
1
gluonar/data/dataset.py
haoxintong/gluon-audio
9
12764148
<gh_stars>1-10 # MIT License # # Copyright (c) 2019 haoxintong # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, m...
2.015625
2
rnbgrader/tests/test_tmpdirs.py
matthew-brett/rnbgrader
0
12764149
<gh_stars>0 """ Test tmpdirs module """ from __future__ import division, print_function, absolute_import from os import unlink from os.path import isfile, isdir from ..tmpdirs import in_dtemp, dtemporize def test_in_dtemp(): # Test working in temporary directory with in_dtemp() as tmpdir: with open(...
2.5625
3
polyaxon_schemas/ops/run/op.py
granularai/polyaxon-schemas
0
12764150
<reponame>granularai/polyaxon-schemas<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from marshmallow import fields from polyaxon_schemas.ops.build_job import BuildSchema from polyaxon_schemas.ops.operation import BaseOpConfig, BaseOpSchema class BaseRunSchema(Ba...
1.945313
2