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 |
|---|---|---|---|---|---|---|
student.py | ricardombrodriguez/Tetris-AI-Bot | 0 | 12799051 | import asyncio
import getpass
import json
import os
import websockets
from shape import S, Z, I, O, J, T, L, Shape
from search import *
async def agent_loop(server_address="localhost:8000", agent_name="student"):
async with websockets.connect(f"ws://{server_address}/player") as websocket:
# Receive infor... | 2.890625 | 3 |
python/trans_graph.py | Juelin-Liu/GraphSetIntersection | 12 | 12799052 | import sys
import time
def gen_continuous_id_graph(inputFile, outputFile, isUndirected=False):
with open(inputFile, 'r') as fin, open(outputFile, 'w') as fout:
cur_idx = 0
idmap = {}
for line in fin:
if line.startswith('#') or line.startswith('%'):
continue
... | 2.625 | 3 |
blaze/tests/test_toplevel.py | davidfischer/blaze-core | 1 | 12799053 | import os.path
from blaze.test_utils import temp_dir
import blaze.toplevel as toplevel
from blaze.params import params
from blaze import dshape
from blaze.sources.chunked import CArraySource, CTableSource
from blaze.eclass import eclass
def test_open_carray():
with temp_dir() as temp:
# Create an array o... | 2.09375 | 2 |
xframes/cmp_rows.py | cchayden/xframes | 0 | 12799054 | <filename>xframes/cmp_rows.py
# Row comparison wrapper for ascending or descending comparison.
class CmpRows(object):
""" Comparison wrapper for a row.
Rows can be sorted on one or more columns, and each one
may be ascending or descending.
This class wraps the row, remembers the column indexes ... | 3.453125 | 3 |
projects/baby_driver/scripts/test_can_send.py | Citrusboa/firmware_xiv | 14 | 12799055 | <filename>projects/baby_driver/scripts/test_can_send.py
"""This Module Tests methods in can_send.py"""
# pylint: disable=unused-import
import unittest
from unittest.mock import patch, Mock
import can
import cantools
import can_util
from message_defs import BABYDRIVER_DEVICE_ID
from can_send import can_send_raw, load_... | 2.375 | 2 |
cmkinitramfs/utils.py | lleseur/cmkinitramfs | 0 | 12799056 | """Module providing miscellaneous utilities used by cmkinitramfs"""
from __future__ import annotations
import functools
import hashlib
import os.path
# Function needed for python < 3.9
def removeprefix(string: str, prefix: str) -> str:
"""Remove a prefix from a string
Add support for :meth:`str.removeprefi... | 3.21875 | 3 |
constructer/major-tsv/getMajor_obj_TH_EN.py | marsDev31/KUnit | 1 | 12799057 | f = open("stdList.tsv").readlines()
obj = ""
data = []
for txtLine in f:
data = txtLine.split('\t')
obj += "{value:'" + data[0] + "', label:'"+ data[0] + " " + data[2] + " (" + data[1] + " " + data[3].replace('\n','') + ")'}," + "\n"
print(obj)
obj = str('['+ obj +']').replace(',]',']')
save = open("mahor_th_e... | 2.625 | 3 |
python_gui_tkinter/KALU/GARBAGE1/label_ckbtn.py | SayanGhoshBDA/code-backup | 16 | 12799058 | <reponame>SayanGhoshBDA/code-backup
from tkinter import StringVar, Tk, Label, Checkbutton, IntVar
def update_label():
if var.get() == 1:
label_text.set("On")
else:
label_text.set("Off")
window = Tk()
label_text = StringVar()
label = Label(window, textvariable=label_text)
label_text.set("Off")... | 3.15625 | 3 |
travellifestyleblog22/migrations/0009_remove_category_image.py | biareiam/travellifestyleblog | 0 | 12799059 | # Generated by Django 3.2 on 2022-04-08 15:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('travellifestyleblog22', '0008_alter_category_image'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='im... | 1.351563 | 1 |
Tensorflow/other/mnist_test.py | egesko/SideChannel-AdversarialAI | 4 | 12799060 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL']= '2'
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist
physical_devices = tf.config.list_physical_devices('GPU')
print(physical_devices)
(x_train, y_train), (x_test, y_test) = mnist.load_d... | 2.546875 | 3 |
payments/urls.py | HimanshuAwasthi95/pune.pycon.org | 0 | 12799061 | from django.conf.urls import url
import payments.views
urlpatterns = [
url(r"^webhook/$", payments.views.webhook,
name="webhook"),
]
| 1.359375 | 1 |
tests/boardfarm_plugins/boardfarm_prplmesh/tests/beacon_report_query_and_response.py | SWRT-dev/easymesh | 0 | 12799062 | ###############################################################
# SPDX-License-Identifier: BSD-2-Clause-Patent
# SPDX-FileCopyrightText: 2020 the prplMesh contributors (see AUTHORS.md)
# This code is subject to the terms of the BSD+Patent license.
# See LICENSE file for more details.
###################################... | 2.265625 | 2 |
tests/Monkeypatching/test_Api_monkeypatching_api_delete.py | LudwikaMalinowska/Automated-Testing-Project2 | 0 | 12799063 | import unittest
import requests
from assertpy import assert_that
from requests.exceptions import Timeout
from unittest.mock import Mock, patch
from src.Api import Api
from src.todos import todos
class TestApiMonkeyPatch(unittest.TestCase):
@patch('src.Api.Api', autospec=True)
def test_method_api_delete_rai... | 2.609375 | 3 |
leetcode/valid_mountain_array.py | Nyior/algorithms-and-datastructures-python | 1 | 12799064 | """
Given an array of integers arr, return true if and only if it is a valid mountain array.
Recall that arr is a mountain array if and only if:
arr.length >= 3
There exists some i with 0 < i < arr.length - 1 such that:
arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
arr[i] > arr[i + 1] > ... > ar... | 4.28125 | 4 |
mod_dnase_score.py | aniketk21/tfbs-prediction | 2 | 12799065 | <gh_stars>1-10
'''
mod_dnase_score.py
usage: python mod_dnase_score.py bedgraph_file.bedgraph dataset.dat output.dat
modify the DNASE score.
'''
import sys
bed = open(sys.argv[1])
inp = open(sys.argv[2])
out = open(sys.argv[3], 'w')
inpl = inp.readlines()
bedl = bed.readlines()
for i in xrange(len(bedl)... | 2.75 | 3 |
src/craftr/core/impl/actions/LambdaAction.py | craftr-build/craftr-core | 64 | 12799066 |
import dataclasses
import typing as t
from craftr.core.base import Action, ActionContext
@dataclasses.dataclass
class LambdaAction(Action):
delegate: t.Callable[[ActionContext], None]
def execute(self, context: ActionContext) -> None:
self.delegate(context)
| 2.171875 | 2 |
zoho_subscriptions/subscriptions/plan.py | st8st8/django-zoho-subscriptions | 0 | 12799067 | <gh_stars>0
import ast
from requests import HTTPError
from zoho_subscriptions.client.client import Client
from zoho_subscriptions.subscriptions.addon import Addon
try:
from django.conf import settings as configuration
except ImportError:
try:
import config as configuration
except ImportError:
... | 2.1875 | 2 |
upcycle/cuda/__init__.py | samuelstanton/upcycle | 0 | 12799068 | from .try_cuda import try_cuda | 1.007813 | 1 |
socialposts/settings/__init__.py | renanbs/socialposts | 0 | 12799069 | from .production import *
try:
from.local import *
except:
pass
| 1.109375 | 1 |
pEFIM.py | pradeepppc/PSHUIM | 0 | 12799070 | from functools import cmp_to_key
from Transaction import Transaction
class pEFIM():
highUtilityItemsets = []
candidateCount = 0
utilityBinArrayLU = {}
utilityBinArraySU = {}
# a temporary buffer
temp = []
for i in range(5000):
temp.append(0)
def __init__(self, mapItemsTone... | 2.703125 | 3 |
src/eddington/__init__.py | AssafZohar/eddington | 0 | 12799071 | """Core functionalities of the Eddington platform."""
from eddington.exceptions import (
EddingtonException,
FitDataColumnExistenceError,
FitDataColumnIndexError,
FitDataColumnsLengthError,
FitDataError,
FitDataInvalidFile,
FitDataInvalidFileSyntax,
FitFunctionLoadError,
FitFunctionR... | 2.015625 | 2 |
redis-monitor/tests/tests_online.py | abael/ScrapyCluster | 0 | 12799072 | <reponame>abael/ScrapyCluster<gh_stars>0
'''
Online integration tests
'''
import unittest
from unittest import TestCase
from mock import MagicMock
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from redis_monitor import RedisMonitor
from plugins.kafka_base_monitor ... | 1.921875 | 2 |
third_party/liblouis/src/tests/harness/runHarness.py | zipated/src | 2,151 | 12799073 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Liblouis test harness
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later v... | 1.5625 | 2 |
parlai/agents/programr/parser/template/nodes/base.py | roholazandie/ParlAI | 0 | 12799074 | <filename>parlai/agents/programr/parser/template/nodes/base.py
import xml.etree.ElementTree as ET
# from parlai.agents.programr.utils.logging.ylogger import YLogger
import parlai.utils.logging as logging
from parlai.agents.programr.aiml_manager import AIMLManager
aiml_manager = AIMLManager.get_instance()
###########... | 2.28125 | 2 |
Viewer/Viewer.py | FWMSH/timelapseViewer | 0 | 12799075 | '''
File: Viewer.py
Author: <NAME>. & <NAME>.
Date: 06/04/19
Description: This viewer can be run on a RaspberryPI, and pulls timelapse photos from a webserver hosted by Server.py
'''
from kivy.config import Config
import timelapseshare as tls
import PIL
import _thread
import time
import os
os.environ['KIVY_GL_BACKEND'... | 2.421875 | 2 |
GUI_code.py | MaazKhurram/Emergency-Response-System | 1 | 12799076 |
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication,QMainWindow, QWidget, QPushButton
from PyQt5.QtGui import QPainter,QBrush, QPen
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QTransform
from PyQt5.QtCore import QPointF
from CarMaintainer import CarMaintainer
... | 2.8125 | 3 |
placidity/tests/test_node.py | bebraw/Placidity | 2 | 12799077 | # -*- coding: utf-8 -*-
from placidity.node import Node, TreeNode
class TestNode():
def test_append_children_to_node(self):
node1, node2 = Node(), Node()
node1.children.append(node2)
assert node1.children[0] == node2
assert node2.parents[0] == node1
def test_append_parents_... | 3.78125 | 4 |
GodwillOnyewuchi/Phase 1/Python Basic 2/day 9 task/task 7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 6 | 12799078 | #Python program to test whether the system is a big-endian platform or little-endian platform
import sys
if sys.byteorder == "little":
print("Little-endian platform.") # its an intel, alpha
else:
print("Big-endian platform.") # its a motorola, sparc | 2.828125 | 3 |
python/bob/bob.py | fruit-in/exercism-solution | 9 | 12799079 | def response(hey_bob):
question = hey_bob.rstrip().endswith('?')
yell = any(c.isupper() for c in hey_bob) \
and not any(c.islower() for c in hey_bob)
nothing = not hey_bob.strip()
if question and not yell:
return "Sure."
elif not question and yell:
return "Whoa, chill out!"
... | 3.5625 | 4 |
setup.py | jicho/quicklock | 4 | 12799080 | from distutils.core import setup
setup(
name = 'quicklock',
packages = ['quicklock'],
version = '0.1.7',
description = 'A simple Python resource lock to ensure only one process at a time is operating with a particular resource.',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/NateF... | 1.632813 | 2 |
new_customers/models.py | bashmak/djing | 23 | 12799081 | <gh_stars>10-100
from django.shortcuts import resolve_url
from django.utils.translation import gettext_lazy as _
from django.db import models
from django.conf import settings
from django.core.validators import RegexValidator
from group_app.models import Group
class PotentialSubscriber(models.Model):
fio = models... | 2.0625 | 2 |
tests/cli/test_base.py | ssato/python-anyconfig | 213 | 12799082 | #
# Copyright (C) 2013 - 2021 <NAME> <<EMAIL>>
# License: MIT
#
# pylint: disable=missing-docstring
"""test cases for anyconfig.cli module.
"""
import contextlib
import io
import pathlib
import sys
import tempfile
import unittest
import anyconfig.api
import anyconfig.cli as TT
from .. import base
from . import collec... | 2.21875 | 2 |
tool/pylib/ecmascript/transform/optimizer/reducer.py | mever/qooxdoo | 1 | 12799083 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2013 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# MIT: https:/... | 2.265625 | 2 |
agents/meinberg_m1000/mibs/MBG-SNMP-ROOT-MIB.py | simonsobs/socs | 6 | 12799084 | <reponame>simonsobs/socs<filename>agents/meinberg_m1000/mibs/MBG-SNMP-ROOT-MIB.py<gh_stars>1-10
#
# PySNMP MIB module MBG-SNMP-ROOT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file://./MBG-SNMP-ROOT-MIB.mib
# Produced by pysmi-0.3.4 at Fri May 1 22:39:55 2020
# On host grumpy platform Linux version 4.15.0-88-generi... | 1.703125 | 2 |
tests/core/test_neural_modules_pytorch.py | borisdayma/NeMo | 0 | 12799085 | <reponame>borisdayma/NeMo<gh_stars>0
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 2.125 | 2 |
pybolt/bolt_nlp/char_cnn_classification/model.py | mikuh/pybolt | 0 | 12799086 | <gh_stars>0
import tensorflow as tf
class CharCNN(tf.keras.Model):
def __init__(self, ):
pass
| 1.859375 | 2 |
bika/lims/vocabularies/__init__.py | hocinebendou/bika.gsoc | 0 | 12799087 | <filename>bika/lims/vocabularies/__init__.py
# -*- coding:utf-8 -*-
from Acquisition import aq_get
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.interfaces import IDisplayListVocabulary, ICustomPubPref
from bika.lims.utils import to_utf8
from Products.Archetypes.public impor... | 1.765625 | 2 |
__manifest__.py | IDRISSOUM/sinerkia_jitsi_meet | 0 | 12799088 | # -*- coding: utf-8 -*-
# © 2020 Sinerkia iD (<https://www.sinerkia.com>).
{
'name': 'Sinerkia Jitsi Meet Integration',
'version': '12.0.1.0.2',
'category': 'Extra Tools',
'sequence': 1,
'summary': 'Create and share Jitsi Meet video conferences with other users and external partners',
'descr... | 1.085938 | 1 |
integral_approximation.py | thenewpyjiang/integral-approximation-python | 1 | 12799089 | <reponame>thenewpyjiang/integral-approximation-python
from sympy.parsing.sympy_parser import parse_expr
from math import *
from sympy import *
import numpy as np
# Left endpoints integral approximation
def left(expr, left_bound, right_bound, delta_x):
x = symbols('x')
expression = parse_expr(expr)
sum = 0
... | 3.53125 | 4 |
main.py | brunoredes/ransomware | 0 | 12799090 | <gh_stars>0
#!/usr/bin/python3.6
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
from Crypto.Util import Counter
import argparse
import os
import Discovery
import Crypter
# -----------------
# A senha pode ter os seguintes tamanhos:
# 128/192/256 bits - 8bite = 1byte = 1 caracter unicode
# 256/8 = 32 bytes
# --... | 3.15625 | 3 |
apps/accounts/migrations/0015_use_dc_locations.py | denning/admin-portal | 10 | 12799091 | <filename>apps/accounts/migrations/0015_use_dc_locations.py
# Generated by Django 2.2.19 on 2021-04-15 13:14
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
("taggit", "0003_taggeditem_add_unique_ind... | 1.648438 | 2 |
emailfinder/find_email.py | forumulator/pythonScripts | 0 | 12799092 | import urllib
from urllib import request, parse
import re
import os, sys
import time
import argparse
# Request headers
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36',
'Referer': 'http://www.verifyemailaddress.or... | 3.140625 | 3 |
training.py | ArthurMPassos/Snake-ThurMP | 0 | 12799093 | import pygame
from random import randint
# Var de trainamento
# Lista de saida [Esquerda, Cima, Direita, Baixo]
listaOutput = [0,0,0,0]
# Lista de entrada [n da rodada ,pontos obtidos
# matriz do tabuleiro] (tabuleiro incluindo
# paredes, corpo da cobra e maca)
listaEntrada = [0]*3
# Nota: a matriz sera quase 4 ve... | 3.5 | 4 |
retailstore/serializers/schemas.py | code-R/retail_app | 2 | 12799094 | <filename>retailstore/serializers/schemas.py<gh_stars>1-10
from marshmallow import fields, Schema
class BaseSchema(Schema):
id = fields.Integer()
name = fields.String(required=True)
description = fields.String()
created_at = fields.DateTime(attribute="created_at")
class LocationSchema(BaseSchema):
... | 2.5625 | 3 |
flare/forms/formerrors.py | xnopasaranx/flare | 0 | 12799095 | from typing import List, Tuple
#from flare.forms.bones.base import ReadFromClientErrorSeverity
from flare.icons import SvgIcon
from flare.i18n import translate
from flare import html5
def collectBoneErrors(errorList, currentKey,boneStructure):
'''
severity:
NotSet = 0
InvalidatesOther = 1
Empty = 2
Invalid... | 2.109375 | 2 |
nacelle/contrib/mail/utils.py | paddycarey/nacelle | 0 | 12799096 | <filename>nacelle/contrib/mail/utils.py<gh_stars>0
"""Utilities used to render and send emails
"""
# marty mcfly imports
from __future__ import absolute_import
# third-party imports
from nacelle.core.template.renderers import render_jinja2_template
def render_email(template, context=None):
"""Uses Jinja2 to rend... | 1.5 | 2 |
test_scripts/ssd_on_video.py | ajinkyakhoche/Object-Detection-Project | 0 | 12799097 | import cv2
import numpy as numpy
import tensorflow as tflow
from utils import label_map_util
#from ConeDetection import *
from cone_img_processing2 import *
import os
# Set threshold for detection of cone for object detector
threshold_cone = 0.5
#Set path to check point and label map
#PATH_TO_CKPT = './frozen_orange... | 2.421875 | 2 |
kubernetes/test/test_v2beta2_metric_spec.py | mariusgheorghies/python | 0 | 12799098 | <gh_stars>0
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
i... | 1.984375 | 2 |
api_products/tests.py | arunjohn96/Abacies | 0 | 12799099 | from rest_framework.test import APITestCase
from django.shortcuts import reverse
from rest_framework import status
from core.models import ProductsTbl, PurchaseTransactionTbl
# Create your tests here.
class TestProductViews(APITestCase):
def setUp(self):
self.product_url = reverse('products-list')
... | 2.515625 | 3 |
search_similar_image.py | airwick989/Content-Based-Image-Retrieval | 1 | 12799100 | import cv2
from PIL import Image
import numpy as np
import constants
import os
import math
import matplotlib.pyplot as plt
import time
def hammingDistance(v1, v2):
t = 0
for i in range(len(v1)):
if v1[i] != v2[i]:
t += 1
return t
# read thresholds from thresholds.txt and then store th... | 3.21875 | 3 |
file-operations/pdf_operations.py | kpunith8/python_samples | 0 | 12799101 | <filename>file-operations/pdf_operations.py
# Use PyPDF2 library to work with pdf files
# It can only read text content, not the images and other media content
import PyPDF2
# read as binary file, make sure you pass the pdf file name
pdf_file = open("path-to-pdf.pdf", "rb")
pdf_reader = PyPDF2.PdfFileReader(pdf_file)
... | 3.875 | 4 |
src/feature_extraction_tokenization.py | garsontrier/turkish-nlp-preprocessor | 1 | 12799102 | # Written by <NAME>
import os
def file_feature_extraction(dir, filename):
'''
Navigates through tokenized words,
reconstructs original form by following few rules
Then, extracts features for that token and adds them to the corresponding list
All features of the dataset is written in the sam... | 3.734375 | 4 |
python/tools/simfempath.py | beckerrh/simfemsrc | 0 | 12799103 | <filename>python/tools/simfempath.py
import sys, os, shutil, subprocess
# def storeSourcePath(installdir, simfemsourcedir):
# with open(installdir+'/SOURCE_DIR_SIMFEM','w') as pathfile:
# pathfile.write(simfemsourcedir)
# def getSourcePath(installdir):
# with open(installdir+'/SOURCE_DIR_SIMFEM','r') as pathfile:
... | 2.453125 | 2 |
src/hopts/grid_search.py | alexchueshev/icsme2020 | 0 | 12799104 | <gh_stars>0
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from .base_search import BaseSearchALS
_KWARG_TRANSFORM = 'transform_y'
class GridSearchALS(BaseSearchALS):
def fit(self, *args, **kwargs):
x_df, y_df, cols = args
transform_y = kwargs.get(_KWARG_... | 2.640625 | 3 |
encoding.py | h4ste/cantrip | 2 | 12799105 | """ Clinical snapshot encoders for use with CANTRIP Model.
CANTRIPModel expects a clinical snapshot encoder function which takes as input the CANTRIPModel and adds
clinical snapshot encoding ops to the graph returning the final clinical snapshot encoding as
[batch x max_seq_len x embedding_size]
"""
import tensorflo... | 2.671875 | 3 |
test_filter_commands.py | antgonza/version-testing-fastp-minimap2 | 0 | 12799106 | import gzip
import unittest
import subprocess
import os
class TestPreProcessing(unittest.TestCase):
def setUp(self):
# params for the test
self.curr_path = os.path.dirname(os.path.abspath(__file__))
self.output_path = self.curr_path + "/data"
self.file_one = self.output_path + "/all_reads_... | 2.734375 | 3 |
tonggong/validations/__init__.py | Scar1et-x/tonggong | 0 | 12799107 | <filename>tonggong/validations/__init__.py
from . import errors, utils, validators
__all__ = ["validators", "errors", "utils"]
| 1.25 | 1 |
openeo-qgis-plugin-master/models/result.py | bgoesswe/openeo-qgis-plugin | 0 | 12799108 | <filename>openeo-qgis-plugin-master/models/result.py<gh_stars>0
from qgis.core import QgsRasterLayer
from qgis.PyQt.QtCore import QFileInfo
from qgis.core import QgsProject
class Result():
def __init__(self, path=None):
self.path = path
def display(self):
"""
Displays an image from t... | 2.296875 | 2 |
python/raspberrypi/DFRobot_VL6180X.py | DFRobot/DFRobot_VL6180X | 0 | 12799109 | <filename>python/raspberrypi/DFRobot_VL6180X.py
# -*- coding: utf-8 -*
""" file DFRobot_VL6180X.py
# DFRobot_VL6180X Class infrastructure, implementation of underlying methods
@copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
@licence The MIT License (MIT)
@author [yangfeng]<<EMAI... | 1.984375 | 2 |
remaquery.py | wulffern/remaquery | 0 | 12799110 | ######################################################################
## Copyright (c) 2019 <NAME>, Norway
## ###################################################################
## Created : wulff at 2019-3-25
## ###################################################################
## The MIT License (MIT... | 1.164063 | 1 |
deployment/engine.py | cu-csc/automaton | 1 | 12799111 | """
implements the staged deployment engine which contains the logic and
order of execution
"""
class StagedDeploymentEngine(object):
def __init__(self):
raise NotImplementedError
| 1.625 | 2 |
NFCow/malls/apps.py | jojoriveraa/titulacion-NFCOW | 0 | 12799112 | from django.apps import AppConfig
class MallsConfig(AppConfig):
name = 'malls'
| 1.257813 | 1 |
prueba.py | IC-3002/ic-3002-2020ii-p2-lobo | 0 | 12799113 | <filename>prueba.py
import re
from simulated_annealing import optimizar
from dominio_tsp import DominioTSP
#from dominio_ag_tsp import DominioAGTSP
#from algoritmo_genetico import optimizar
from math import e
from time import time
"""
temperatura = 10000
enfriamiento = [0.8,0.9,0.95,0.99]
dominio = DominioTSP('dato... | 2.765625 | 3 |
indumpco/file_format.py | ncleaton/indumpco | 0 | 12799114 | <filename>indumpco/file_format.py<gh_stars>0
# -*- coding: utf-8 -*-
import zlib
import lzma
import re
import os
class FormatError(Exception):
pass
def pack_idxline(seg_len, seg_sum):
return "%d %s\n" % (int(seg_len), seg_sum)
def unpack_idxline(idxline):
hit = re.match(r'^([0-9]+) (\w+)\s*$', idxline)
... | 2.578125 | 3 |
venv/lib/python3.6/site-packages/pylint/test/functional/too_many_lines.py | aitoehigie/britecore_flask | 0 | 12799115 | # pylint: disable=missing-docstring
# -1: [too-many-lines]
__revision__ = 0
ZERFZAER = 3
HEHEHE = 2
| 1.054688 | 1 |
UserProfiles/migrations/0006_auto_20180812_2236.py | Milo-Goodfellow-Work/GuildsDevelopmentBuild | 0 | 12799116 | # Generated by Django 2.0.7 on 2018-08-12 22:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('UserProfiles', '0005_auto_20180808_2150'),
]
operations = [
migrations.AlterField(
model_name='userprofilemodel',
na... | 1.617188 | 2 |
rle.py | ashkitten/dosdvd | 5 | 12799117 | <gh_stars>1-10
def rle():
with open("logo.ascii") as fp:
logo = fp.read().split("\n")[:-1]
# simple row based rle
bits = 5
cur = "."
run = 0
buf = list()
for row in logo:
for c in row:
if c == cur:
run += 1
else:
cur = ... | 3.140625 | 3 |
microbenchmarks/oldstyle_iteration.py | aisk/pyston | 1 | 12799118 | class C:
def __init__(self):
self.l = range(10)
def __getitem__(self, idx):
return self.l[idx]
def f():
c = C()
total = 0
for _ in xrange(100000):
for i in c:
total += i
print total
f()
| 3.109375 | 3 |
textpreprocess.py | skbly7/usefulness | 0 | 12799119 | #!/usr/bin/python
import html2text
#import tokenizer
from nltk.tokenize import MWETokenizer as tokenizer
import nltk
#from nltk import word_tokenize
from nltk.tokenize import WordPunctTokenizer # This is better for sentences containing unicode, like: u"N\u00faria Espert"
word_tokenize = WordPunctTokenizer().tokeni... | 3.1875 | 3 |
model/project.py | checheninao/python_training_mantis | 0 | 12799120 | class Project:
def __init__(self, name, status=None, description=None):
self.name = name
self.description = description
self.status = status
def __repr__(self):
return self.name
def __eq__(self, other):
return self.name == other.name
def key(self):
ret... | 2.875 | 3 |
util/process_dump.py | ArchiveTeam/twitchtv-index | 0 | 12799121 | <filename>util/process_dump.py
import argparse
import collections
import json
import shutil
import os
def main():
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('input_dump', type=argparse.FileType('r'))
arg_parser.add_argument('output_dir')
args = arg_parser.parse_args()
if not ... | 2.359375 | 2 |
utils_prep/preproc_manu/ASR/1_AsrCorrection.py | GanshengT/INSERM_EEG_Enrico_Proc | 1 | 12799122 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 21 15:39:43 2019
@author: Manu
"""
import mne
from mne import io
import sys
sys.path.append('C:/_MANU/_U821/Python_Dev/')
import scipy
from util import tools,asr,raw_asrcalibration
import numpy as np
import matplotlib.pyplot as plt
from mne.viz import plot_evoked_topo... | 1.710938 | 2 |
mediapp_be/config/__init__.py | MedPy-C/backend | 0 | 12799123 | <reponame>MedPy-C/backend
import os
from .development import Development
# from .production import Production
# from .test import Test
def get_configs(enviroment=None):
from mediapp_be.config.test import Test
configs = {
'dev': Development,
# 'prd': Production,
'test': Test
}
... | 2.109375 | 2 |
src/ebonite/ext/sqlalchemy/models.py | zyfra/ebonite | 270 | 12799124 | from abc import abstractmethod
from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar
from pyjackson import dumps, loads
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Text, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relatio... | 2.140625 | 2 |
sfeprapy/func/pd_6688_1_2_2007.py | fsepy/sfeprapy | 4 | 12799125 | # -*- coding: utf-8 -*-
import numpy as np
def annex_b_equivalent_time_of_fire_exposure(
q_fk, delta_1, m, k_b, A_f, H, A_vh, A_vv, delta_h
):
"""Calculates time equivalence of standard fire exposure in accordance with PD 6688-1-2 Annex B
IAN FU 12 APRIL 2019
:param q_fk: [MJ/m2] Fire load density
... | 2.484375 | 2 |
dataloader.py | colorfulbrain/brain2020 | 91 | 12799126 | <reponame>colorfulbrain/brain2020
from __future__ import print_function, division
import os
import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
from utils import PatchGenerator, padding, read_csv, read_csv_complete, read_csv_complete_apoe, get_AD_risk
import random
import pandas as pd
impor... | 2.90625 | 3 |
analysis.py | bijonguha/Image-Analysis | 0 | 12799127 | <gh_stars>0
import cv2
import numpy as np
from skimage.exposure import is_low_contrast
import matplotlib.pyplot as plt
def check_contrast(path, method='rms'):
'''
Check contrast of given images using
RMS or Michelson method
path : str
path of given image
method : str
method 'r... | 3.015625 | 3 |
WordInput.py | Lee-Jooho/wordembedding | 0 | 12799128 | import numpy as np
import string
import re
import nltk
nltk.download('stopwords')
stop_words = nltk.corpus.stopwords.words('english')
class word_inform():
def __init__(self):
self.inform = {}
def wordinput(self):
WI = input('문장을 입력해주세요 : ') # 문장 받아오기. WI = word input.... | 3.375 | 3 |
django/publicmapping/redistricting/tests/test_score_statistics_set.py | azavea/district-builder-dtl-pa | 5 | 12799129 | from base import BaseTestCase
from django.contrib.auth.models import User
from redistricting.models import *
class StatisticsSetTestCase(BaseTestCase):
fixtures = [
'redistricting_testdata.json',
'redistricting_testdata_geolevel2.json',
'redistricting_statisticssets.json',
]
def... | 2.1875 | 2 |
stanza_bio.py | daniloBlera/biomed-parsers-intro | 0 | 12799130 | <filename>stanza_bio.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Some simple usage examples of the stanfordnlp Stanza library
The original Colab notebook where this script came from:
https://colab.research.google.com/drive/1AEdAzR4_-YNEClAB2TfSCYmWz7fIcHIO?usp=sharing
Colab notebook on scispaCy:
htt... | 2.5625 | 3 |
boj/4344.py | pparkddo/ps | 1 | 12799131 | <filename>boj/4344.py
import sys; input=sys.stdin.readline
for _ in range(int(input())):
n, *scores = map(int, input().split())
average = sum(scores) / len(scores)
answer = len(list(filter(lambda x: x > average, scores))) / len(scores)
print(f"{answer:.3%}")
| 3.453125 | 3 |
dhbwFischertechnik/factoryWebsite/mqttHandler.py | Ic3Fighter/Modellfabrik | 4 | 12799132 | <filename>dhbwFischertechnik/factoryWebsite/mqttHandler.py
import json
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from factoryWebsite.models import Order
from factoryWebsite.utils import sendNewOrderToFactory
monitorMainUnit = False
temperatureMainUnit = ""
voltageMainUnit = ... | 2.359375 | 2 |
homework5.py | chubbypanda/principles-of-computing | 22 | 12799133 | # Homework 5 for Principles of Computing class, by k., 07/19/2014
# Question 1
class Incrementer(object):
'''
counting increments separately from the function
'''
def __init__(self, count):
self.count = count
def increment(self):
self.count += 1
"""
Recursion according to the "Ca... | 4.09375 | 4 |
lab5/kernel/sendimg.py | Mechshaman/osc2022 | 0 | 12799134 | import argparse
import serial
import os
parser = argparse.ArgumentParser()
parser.add_argument('image', default='kernel8.img', type=str)
parser.add_argument('device',default='/dev/ttyUSB0', type=str)
args = parser.parse_args()
try:
ser = serial.Serial(args.device,115200)
except:
print("Serial init failed!")
... | 2.765625 | 3 |
code/mini-rov/hydrogenMiniROVClient2020.py | CISSROV/2019-Project | 2 | 12799135 | #!/usr/bin/env python3.4
import webSocketClient
import motorInterface
import json
axis = ['xLeft', 'yLeft', 'triggerLeft', 'xRight', 'yRight', 'triggerRight']
buttons = ['A', 'B', 'X', 'Y', 'LB', 'RB']
trimUp = {
'center': 0.0
}
# these are in a row
# this motor is IN3/4 on the edge of the motor controller
m1 =... | 2.25 | 2 |
app.py | tristan-jl/tensorflow-flask | 0 | 12799136 | <filename>app.py
import pandas as pd
import tensorflow_decision_forests as tfdf
from flask import Flask
from flask import jsonify
from flask import request
from tensorflow import keras
app = Flask(__name__)
model = keras.models.load_model("gb_model")
@app.route("/predict", methods=["POST"])
def predict():
data =... | 2.75 | 3 |
scrapli_community/nokia/srlinux/async_driver.py | ikievite/scrapli_community | 37 | 12799137 | <filename>scrapli_community/nokia/srlinux/async_driver.py
"""scrapli_community.nokia.nokia_srlinux.async_driver"""
from scrapli.driver import AsyncNetworkDriver
async def default_async_on_open(conn: AsyncNetworkDriver) -> None:
"""
nokia_srlinux on_open callable
Args:
conn: AsyncNetworkDriver obj... | 2.109375 | 2 |
input/pad.py | villinvic/Georges | 6 | 12799138 | <gh_stars>1-10
from config.loader import Default
from input.enums import Stick, Button, Trigger
from input.action_space import ControllerState
import zmq
import os
import platform
class Pad(Default):
"""Writes out controller inputs."""
action_dim = 50
def __init__(self, path, player_id, port=None):
... | 2.46875 | 2 |
Special Midterm Exam in OOP.py | Jerohlee/OOP-1-2 | 0 | 12799139 | <gh_stars>0
from tkinter import *
window = Tk()
window.title("Special Midterm Exam in OOP")
window.geometry("300x200+20+10")
def changecolor():
button.configure(bg="yellow")
button = Button(window, text = "Click to Change Color", command= changecolor)
button.place(relx=.5, y=100, anchor="center")
win... | 3.390625 | 3 |
apminsight/instrumentation/dbapi2.py | Wealize/apminsight-site24x7-py | 0 | 12799140 | from apminsight import constants
from apminsight.util import is_non_empty_string
from apminsight.agentfactory import get_agent
from .wrapper import default_wrapper
class CursorProxy():
def __init__(self, cursor, conn):
self._apm_wrap_cursor = cursor
self._apm_wrap_conn = conn
self._apm_c... | 2.125 | 2 |
casclik/controllers/__init__.py | mahaarbo/casclik | 14 | 12799141 | from casclik.controllers.reactive_qp import ReactiveQPController
from casclik.controllers.reactive_nlp import ReactiveNLPController
from casclik.controllers.pseudo_inverse import PseudoInverseController
from casclik.controllers.model_predictive import ModelPredictiveController
| 1.078125 | 1 |
datalad_metalad/processor/autoget.py | yarikoptic/datalad-metalad | 7 | 12799142 | <filename>datalad_metalad/processor/autoget.py<gh_stars>1-10
import logging
from .base import Processor
from ..pipelineelement import (
PipelineResult,
ResultState,
PipelineElement,
)
from ..utils import check_dataset
logger = logging.getLogger("datalad.metadata.processor.autoget")
class AutoGet(Proces... | 2.34375 | 2 |
string_09.py | Technicoryx/python_strings_inbuilt_functions | 0 | 12799143 | """Below Python Programme demonstrate encode
functions in a string"""
#Utf-8 Encoding
# unicode string
string = 'pythön!'
# print string
print('The string is:', string)
# default encoding to utf-8
string_utf = string.encode()
# print result
print('The encoded version is:', string_utf)
# unicode string
string = 'pythön!... | 4.15625 | 4 |
answer/0066/66.linningmii.py | linningmii/leetcode | 15 | 12799144 | <gh_stars>10-100
class Solution:
def plusOne(self, digits):
"""
:type digits: List[int]
:rtype: List[int]
"""
result = digits[:]
for i in range(len(result) - 1, -1, -1):
if result[i] == 9:
result[i] = 0
if i == 0:
... | 3.0625 | 3 |
rl-fmri/tmp_load_zip.py | liusida/thesis-bodies | 0 | 12799145 | <reponame>liusida/thesis-bodies
from stable_baselines3 import PPO
filename = "exp5/model-ant-400-500-600-s0.zip"
model = PPO.load(filename)
print(model) | 1.390625 | 1 |
tests/test_weatherman_butler.py | aecobb53/weatherman | 1 | 12799146 | from weatherman import weather_butler
import pytest
import datetime # noqa
import sqlite3 # noqa
import yaml
import json # noqa
import os
import unittest
mock = unittest.mock.Mock()
master_copnfig = 'etc/weatherman.yml'
with open(master_copnfig) as ycf:
config = yaml.load(ycf, Loader=yaml.FullLoader)
environment =... | 2.375 | 2 |
Bioinformatics VI/Week II/SuffixArray.py | egeulgen/Bioinformatics_Specialization | 3 | 12799147 | <gh_stars>1-10
import sys
def SuffixArray(Text):
''' Suffix Array
Input: A string Text.
Output: SuffixArray(Text).
'''
suffixes = []
suffix_array = []
for i in range(len(Text)):
suffixes.append(Text[i:])
suffix_array.append(i)
suffix_array = [x for _, x in sorted(zip(su... | 3.4375 | 3 |
ppo/mineRL.py | icrdr/pytorch-playground | 0 | 12799148 | <gh_stars>0
import minerl
import gym
import logging
logging.basicConfig(level=logging.DEBUG)
env = gym.make('MineRLNavigateDense-v0')
print('v')
obs = env.reset()
done = False
net_reward = 0
while not done:
action = env.action_space.noop()
print(action)
action['camera'] = [0, 0.03 * obs["compassAngle"]]
... | 2.28125 | 2 |
200914/04.lists.py | Floou/python-basics | 0 | 12799149 | <reponame>Floou/python-basics
say = 'всем привет!'
print(say) | 1.640625 | 2 |
BOCSite/boc/apps.py | dylodylo/Betting-Odds-Comparision | 2 | 12799150 | from django.apps import AppConfig
class BocConfig(AppConfig):
name = 'boc'
| 1.15625 | 1 |