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 |
|---|---|---|---|---|---|---|
assgn3/python/project_cad.py | gray0018/CMU-16-385-Spring2020 | 0 | 12799151 | <reponame>gray0018/CMU-16-385-Spring2020<gh_stars>0
import numpy as np
# write your implementation here
| 1.148438 | 1 |
examples/use-cases/vuln_sync_csv_upload/vuln_upload.py | AutomoxCommunity/automox-console-sdk-python | 1 | 12799152 | <reponame>AutomoxCommunity/automox-console-sdk-python
"""Use case for automating the ingestion of CVE reports"""
import glob
import os
import sys
import time
from getpass import getpass
from io import FileIO
import requests
def upload_cve(file: FileIO) -> dict:
""" Uploads vulnerability list to Automox Vulnerabi... | 2.578125 | 3 |
08_testing/test_mean.py | nachrisman/PHY494 | 0 | 12799153 | from mean import mean
import pytest
def test_ints():
num_list = [1, 2, 3, 4, 5]
obs = mean(num_list)
assert obs == 3
def test_not_numbers():
values = [2, "lolcats"]
with pytest.raises(TypeError):
out = mean(values)
def test_zero():
num_list = [0, 2, 4, 6]
assert mean(num_list) =... | 3.15625 | 3 |
gitlab_migration/cli.py | inhumantsar/gitlab-migration | 0 | 12799154 | # -*- coding: utf-8 -*-
"""Console script for gitlab_migration."""
import os
import sys
import click
from gitlab_migration import gitlab_migration as glm
@click.group()
def cli():
pass
@cli.group()
def projects():
"""Commands for migrating projects."""
return 0
@projects.command()
@click.argument('csv... | 3.03125 | 3 |
juju/relation.py | radiator-software/python-libjuju | 0 | 12799155 | <filename>juju/relation.py
import logging
from . import model
log = logging.getLogger(__name__)
class Relation(model.ModelEntity):
async def destroy(self):
raise NotImplementedError()
# TODO: destroy a relation
| 2.109375 | 2 |
Tensorflow_Basics/tf16_classification/for_you_to_practice.py | LiJingkang/Python_Tensorflw_Learn | 0 | 12799156 |
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
"""
import tensorflow as tf
def add_layer(inputs, in_size, out_size, activation_function=None, ):
# add one more layer and return the output of this layer
Weights = tf.Variable(tf.random_normal... | 3.390625 | 3 |
test/integration/test_jsonrpc.py | agnicoin/sentinel | 0 | 12799157 | <gh_stars>0
import pytest
import sys
import os
import re
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../test_sentinel.conf'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
sys.path.append(os.path.join(os.path... | 2.03125 | 2 |
Tests/RelationshipTest.py | mucsci-students/2021sp-420-team1 | 2 | 12799158 | import unittest
from ClassCollection import ClassCollection
# Todo
# Check if the classes exist in the classCollection (helper?)
# Check if relationship already exists (helper?)
# if it does, error
# if not, add parameter pair to the relationshipCollection
class RelationshipTest(unittest.TestCase):
def testAddRel... | 3.296875 | 3 |
greenbyteapi/http/auth/custom_header_auth.py | charlie9578/greenbyte-api-sdk | 0 | 12799159 | <reponame>charlie9578/greenbyte-api-sdk<filename>greenbyteapi/http/auth/custom_header_auth.py
# -*- coding: utf-8 -*-
"""
greenbyteapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
from greenbyteapi.configuration import Configuration
class CustomHeaderAuth:
@stati... | 2.171875 | 2 |
ale/drivers/hyb2_drivers.py | tthatcher95/ale | 0 | 12799160 | <filename>ale/drivers/hyb2_drivers.py
import spiceypy as spice
import ale
from ale.base.data_naif import NaifSpice
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import Framer
from ale.base.base import Driver
class Hayabusa2IsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
@pro... | 2.21875 | 2 |
Project Euler (HackerRank)/016. Power digit sum.py | XitizVerma/Data-Structures-and-Algorithms-Advanced | 1 | 12799161 | lookup = []
lookup.append(1);
for i in range((10**4)+1):
lookup.append(lookup[i]*2)
answer = []
for i in lookup:
anslist = [int(char) for char in str(i)]
answer.append(sum(anslist))
t = int(input())
while t:
t -= 1
n = int(input())
print(answer[n])
| 3.203125 | 3 |
tests/integration/CbfSubarray_test.py | jamesjiang52/mid-cbf-mcs | 0 | 12799162 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the csp-lmc-prototype project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Contain the tests for the CbfSubarray."""
# Standard imports
import sys
import os
import time
from dateti... | 1.898438 | 2 |
src/mmgroup/tests/spaces/spaces.py | Martin-Seysen/mmgroup | 14 | 12799163 | from mmgroup.mm_space import MMSpace, MMV, MMVector
from mmgroup.mm_space import characteristics
from mmgroup.structures.mm0_group import MM0Group
from mmgroup.tests.spaces.sparse_mm_space import SparseMmSpace
from mmgroup.tests.spaces.sparse_mm_space import SparseMmV
from mmgroup.tests.groups.mgroup_n import MGroupN
... | 2.265625 | 2 |
arxiv2md.py | michamos/vim-arxivist | 2 | 12799164 | <gh_stars>1-10
#!/usr/bin/python
# arxiv2md.py: fetch the latest arXiv listings and transform them to markdown
# Copyright (C) 2014 <NAME>
# 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 wi... | 1.828125 | 2 |
Templates - Script/AdvancedFilter_DB.py | mitevpi/pyRevitCrucible | 8 | 12799165 | """Advanced Collection of Data: Collects all the walls of height 10"""
__author__ = '<NAME>'
import Autodesk.Revit.DB as DB
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
height_param_id = DB.ElementId(DB.BuiltInParameter.WALL_USER_HEIGHT_PARAM)
height_param_prov = DB.ParameterValuePr... | 2.296875 | 2 |
algorithms/math/prime.py | laiseaquino/python-ds | 2 | 12799166 | def prime(limit):
count = 1
while(count<limit):
flag = 0
for i in range(3,count,2):
if (count%i==0):
flag = 1
if (flag==0):
print(count)
count+=2
prime(100)
| 3.640625 | 4 |
big_fiubrother_sampler/store_video_chunk.py | BigFiuBrother/big-fiubrother-sampler | 0 | 12799167 | from big_fiubrother_core import QueueTask
from big_fiubrother_core.db import Database, VideoChunk
from big_fiubrother_core.storage import raw_storage
from big_fiubrother_core.synchronization import ProcessSynchronizer
from os import path
import logging
class StoreVideoChunk(QueueTask):
def __init__(self, configu... | 2.390625 | 2 |
python_modules/dagster/dagster/core/definitions/solid_invocation.py | drewsonne/dagster | 0 | 12799168 | <reponame>drewsonne/dagster<filename>python_modules/dagster/dagster/core/definitions/solid_invocation.py
import inspect
from typing import TYPE_CHECKING, Any, Dict, Generator, Optional, cast
from dagster import check
from dagster.core.definitions.events import AssetMaterialization, RetryRequested
from dagster.core.err... | 2.046875 | 2 |
rl_groundup/envs/__init__.py | TristanBester/rl_groundup | 1 | 12799169 | from .k_armed_bandit import KArmedBandit
from .grid_world import GridWorld
from .race_track import RaceTrack
from .windy_grid_world import WindyGridWorld
from .maze import Maze
from .mountain_car import MountainCar
from .random_walk import RandomWalk
from .short_corridor import ShortCorridor
| 1.101563 | 1 |
Desafios/desafio074.py | josivantarcio/Desafios-em-Python | 0 | 12799170 | from random import randint
for i in range(5):
n = (randint(0,10))
if(i == 0):
m = n
M = n
if (n > M):
M = n
elif (n < m):
m = n
print(n, end=' ')
print(f'\nO maior número foi {M}\nE o Menor foi {m}') | 3.625 | 4 |
client/views/editors.py | omerk2511/dropbox | 4 | 12799171 | <reponame>omerk2511/dropbox
from Tkinter import *
from common import Codes
from ..controllers import FileController # EditorController (?)
from ..handlers.data import Data
class Editors(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.elements = {... | 2.859375 | 3 |
apispec_swaggerinherit.py | timakro/apispec-swaggerinher | 3 | 12799172 | # apispec-swaggerinherit - Plugin for apispec adding support for Swagger-style
# inheritance using `allOf`
# Copyright (C) 2018 <NAME>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Fre... | 1.8125 | 2 |
migrations/versions/035_DemographicsRequestColumnDefinition_Add_UhlSystemNumber.py | LCBRU/identity | 0 | 12799173 | <gh_stars>0
from sqlalchemy import (
MetaData,
Table,
Column,
Integer,
)
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
t = Table("demographics_request_column_definition", meta, autoload=True)
uhl_system_number_column_id = Column("uhl_system_number_column_id",... | 2.234375 | 2 |
aao/test/spiders/test_sports.py | rkenny2/aao | 27 | 12799174 | import pytest
from aao.spiders import spiders
pytestmark = pytest.mark.sports
class TestSport():
"""Nothing to test. """
pass
class TestSoccer():
"""Test the Soccer ABC across all bookmakers. """
@pytest.fixture(scope='class', params=spiders.values())
def spider(self, request):
s = r... | 2.578125 | 3 |
tests/test_easter.py | cccntu/dateutil | 0 | 12799175 | from bs_dateutil.easter import easter
from bs_dateutil.easter import EASTER_WESTERN, EASTER_ORTHODOX, EASTER_JULIAN
from datetime import date
import pytest
# List of easters between 1990 and 2050
western_easter_dates = [
date(1990, 4, 15),
date(1991, 3, 31),
date(1992, 4, 19),
date(1993, 4, 11),
d... | 2.21875 | 2 |
crumpitmanagerapi/config.py | fossabot/crumpitmanagerAPIs | 0 | 12799176 | <gh_stars>0
#! /usr/bin/python3
#Functionality to for reading and using config file
#
#Author: <NAME>
#Date: May 2019
import os
import subprocess
import pathlib
import shlex
import datetime
import yaml
import cerberus
class validateYAML:
def validate_yaml(self, schemaFile: str, yamlFile: str):
schema = ... | 2.796875 | 3 |
tests/test_patterns.py | abs-tudelft/vhdeps | 17 | 12799177 | """Tests the GHDL backend."""
from unittest import TestCase
import os
import re
from plumbum import local
from .common import run_vhdeps
DIR = os.path.realpath(os.path.dirname(__file__))
class TestPatterns(TestCase):
"""Tests the test case pattern matching logic (also used by the vsim
backend)."""
def t... | 2.515625 | 3 |
python_src/ROCstory_classification.py | Joyce-yanqiongzhang/proj2_storytelling | 0 | 12799178 |
"""
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the d... | 3.03125 | 3 |
library/comb_mod.py | harurunrunrun/python-my-library | 0 | 12799179 | <gh_stars>0
def comb_mod(n,r,mod):
if n-r<r:
r=n-r
N=n
R=r
u=1
d=1
for i in range(r):
u*=N
u%=mod
N-=1
d*=R
d%=mod
R-=1
return u*pow(d,mod-2,mod)%mod
| 2.953125 | 3 |
blog/forms.py | Emiliemorais/ido | 0 | 12799180 | from django import forms
from django.utils.translation import ugettext, ugettext_lazy as _
from models import Message, Questionnaire
class MessageForm(forms.ModelForm):
"""MessageForm Class. TThis class contains the treatments
of the existents forms on create message page.
"""
class Meta:
... | 2.375 | 2 |
sign_checker.py | DineshJas/python_tasks | 0 | 12799181 | def func():
a = int(input("enter a number : "))
if a < 0:
print("Negative")
elif a > 0:
print("Positive")
else:
print("zero")
func()
| 3.984375 | 4 |
ml_layer/sentiment/server/server/res_manager.py | indranildchandra/UltimateCryptoChallenge2018 | 1 | 12799182 | <gh_stars>1-10
from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_protect
from django.views.decorators.csrf import csrf_exempt
from django.apps import AppConfig
import os
import numpy as np
import json
import re
from enum import Enum
import tensorflo... | 1.984375 | 2 |
Interactive GUI.py | Wyvernhunter345/my-python-code | 0 | 12799183 | <filename>Interactive GUI.py
from tkinter import *
from time import sleep
window = Tk()
window.title("Diamond Clicker")
back = Canvas(window, height=30, width=30)
back.pack()
diamonds = 0
def morediamonds():
global diamonds
diamonds += 1
print ("You have " + str(diamonds) + " diamonds!")
def curs... | 3.765625 | 4 |
singleton/singleton.py | majianfei/practice | 1 | 12799184 | def Singleton(cls):
"""装饰器,依赖闭包,python3以前没有nonlocal,所以需要定义为可变对象,比如,_instance={}"""
_instance = None
def wrap(*args, **kwargs):
nonlocal _instance
if _instance is None:
_instance = cls(*args, **kwargs)
return _instance
return wrap
class Singleton2():
""... | 3.53125 | 4 |
apps/django_auth_system/__init__.py | ipodjke/django_authorization_system | 0 | 12799185 | <reponame>ipodjke/django_authorization_system<filename>apps/django_auth_system/__init__.py
default_app_config = 'django_auth_system.apps.UsersConfig'
| 1.09375 | 1 |
preprocessing/main.py | hatttruong/feature2vec | 0 | 12799186 | """Summary
Attributes:
Configer (TYPE): Description
"""
import logging
import argparse
from src.preprocess import *
from src.item_preprocessor import *
from src.configer import *
from src import tfidf
Configer = Configer('setting.ini')
logging.basicConfig(
# filename='log.log',
format='%(asctime)s : %(l... | 2.03125 | 2 |
Searching Algorithms/linear_search.py | harsh793/Algorithms | 0 | 12799187 | """This program implements linear search algorithms having a time complexity of O[n].
It compares every element of the array to the key.
"""
def linear_search(array, key):
len_array = len(array)
t = None
for i in range(len_array):
if array[i] == key:
t = i
else:
... | 4.21875 | 4 |
tacotron2_gst/data_utils.py | tilde-nlp/pip2-expressive-speech-synthesis-for-dialogs | 0 | 12799188 | <reponame>tilde-nlp/pip2-expressive-speech-synthesis-for-dialogs
"""
Adapted from:
- https://github.com/NVIDIA/tacotron2
- https://github.com/mozilla/TTS
"""
import random
from typing import List, Tuple
import torch
import numpy as np
import torch.utils.data
from tacotron2_gst import layers
from tacotron2_gst.text im... | 2.671875 | 3 |
type_conversion.py | Amber-Pittman/python-practice | 0 | 12799189 | <filename>type_conversion.py
birth_year = input("What year were you born?")
age = 2019 - int(birth_year)
print(f"Your age is: {age}") | 3.875 | 4 |
method.py | swiftops/JUNIT_RESULT_AGGREGATION | 1 | 12799190 | <reponame>swiftops/JUNIT_RESULT_AGGREGATION<filename>method.py<gh_stars>1-10
import map
from pymongo import MongoClient
import requests
from flask import jsonify
import json
import logging
logging.basicConfig(level=logging.DEBUG)
remotevalue = map.remotevalue
jenkinsdata = {}
build_id = ''
giturl = map.giturl
headers ... | 2.453125 | 2 |
src/utilities/plot_utilities.py | m-rubik/Grow-Space | 2 | 12799191 | """!
All functions providing plotting functionalities.
"""
import matplotlib.pylab as plt
import matplotlib.dates as mdates
import matplotlib.image as image
import pandas as pd
import re
import argparse
import datetime as dt
import numpy as np
from pandas.plotting import register_matplotlib_converters
from datetime im... | 2.8125 | 3 |
lib/GenericsUtil/GenericsUtilClient.py | jsfillman/GenericsUtil | 0 | 12799192 | <reponame>jsfillman/GenericsUtil
# -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
# the fol... | 1.976563 | 2 |
dispatcher.py | IakovTaranenko/theia | 0 | 12799193 | <reponame>IakovTaranenko/theia<filename>dispatcher.py
import discord, aiohttp, os, asyncio, colorama
from colorama import Fore
import video, image, audio, config
colorama.init()
async def dispatch(msg: discord.Message, ctx):
msgLower = msg.content.lower()
if msg.attachments:
for attachment in msg.... | 2.3125 | 2 |
utils/feature_map.py | ankyhe/coursera-quiz-assignment | 0 | 12799194 | from sklearn.preprocessing import PolynomialFeatures
poly = PolynomialFeatures(6)
def map(x):
return poly.fit_transform(x)
| 1.960938 | 2 |
intpy/__init__.py | claytonchagas/intpyplus | 0 | 12799195 | from .intpy import deterministic
from .data_access import get_cache_data, create_entry
name="int_py" | 1.21875 | 1 |
liberaction/sales/models.py | Computeiros-Estonia/liberaction-api | 0 | 12799196 | <gh_stars>0
from django.db import models
from liberaction.users.models import User
from liberaction.core.models import BaseProduct
class Cart(models.Model):
is_open = models.BooleanField(default=True, verbose_name='Carrinho em aberto', help_text='Determina se a compra do carrinho está em aberto.')
class Meta:
... | 2.015625 | 2 |
christelle/migrations/0005_rename_nom_contact_name.py | OBAMARIE13/portfolios | 0 | 12799197 | <reponame>OBAMARIE13/portfolios<filename>christelle/migrations/0005_rename_nom_contact_name.py<gh_stars>0
# Generated by Django 3.2.7 on 2021-10-22 10:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('christelle', '0004_remove_about_fonction'),
]
oper... | 1.65625 | 2 |
Linear-Programing-Optimizing/Car-Factory-Problem.py | aminzayer/Amin-University-Data-Science | 2 | 12799198 | <reponame>aminzayer/Amin-University-Data-Science<filename>Linear-Programing-Optimizing/Car-Factory-Problem.py
# Import pulp
from pulp import *
# Create an Instance of LpProblem
problem = LpProblem('Car Factory', LpMaximize)
# Create Decision Variables
A = LpVariable('Car A', lowBound=0, cat=LpInteger)
B = LpVariable(... | 3.65625 | 4 |
education/constants.py | photoboard/photoboard-django | 0 | 12799199 | from django.utils.translation import gettext as _
DAY_CHOICES = (
(1, _('Monday')),
(2, _('Tuesday')),
(3, _('Wednesday')),
(4, _('Thursday')),
(5, _('Friday')),
(6, _('Saturday')),
(7, _('Sunday')),
) | 1.890625 | 2 |
plugins/polio/migrations/0017_campaign_gpei_email.py | BLSQ/iaso-copy | 29 | 12799200 | # Generated by Django 3.1.12 on 2021-07-12 09:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("polio", "0016_config"),
]
operations = [
migrations.AddField(
model_name="campaign",
name="gpei_email",
... | 1.609375 | 2 |
tools/checkerBoard.py | valette/FROG | 15 | 12799201 | <filename>tools/checkerBoard.py
import SimpleITK as sitk
import sys
gridSpacing = 30;
file = sys.argv[1]
image = sitk.ReadImage( file )
size = image.GetSize();
black = sitk.Image( size, sitk.sitkUInt8 )
black.SetOrigin( image.GetOrigin() )
spacing = image.GetSpacing();
black.SetSpacing( spacing )
black.SetDirection(... | 2.734375 | 3 |
marketlearn/portfolio/__init__.py | mrajancsr/QuantEquityManagement | 2 | 12799202 | from marketlearn.portfolio.asset import Asset # noqa
from marketlearn.portfolio.harry import Harry # noqa
| 1.039063 | 1 |
bloodytracker/database.py | the10ccm/bloodytracker | 0 | 12799203 | import os
import sqlite3
import random
import string
import time
import datetime
from datetime import timedelta
import operator
from tabulate import tabulate
import config
TS_GROUP_BY = dict(
timestamp=0b10000,
project=0b1000,
task=0b0100,
track=0b0010,
date=0b0001
)
class Database:
def in... | 2.875 | 3 |
idlib/identifiers.py | tgbugs/idlib | 2 | 12799204 | """Identifiers are the smallest possible unit of a stream. Their
fundamental property is that they come equipped with an equality
operation. Not all equality operations are as simple as string= or
numberical equality. These must employ a true identity function that
does not reduce the amount of data that is compared. T... | 3.328125 | 3 |
app/extract_utils.py | Maaslak-ORG/doccano | 0 | 12799205 | import json
import os
from rest_framework.renderers import JSONRenderer
from api.models import Project, DOCUMENT_CLASSIFICATION, SEQUENCE_LABELING
from api.serializers import LabelSerializer
from api.utils import JSONPainter
def extract_document_classification(label, labels):
return labels.get(pk=label["label"]... | 2.265625 | 2 |
Graduate_work/main/algorithms.py | mcxemic/Graduate_work | 0 | 12799206 | <reponame>mcxemic/Graduate_work<filename>Graduate_work/main/algorithms.py
import numpy as np
def calculate_task_table_from_productivity_factors(tasks_lists, productivity_factors):
# p - count of task. k - vector productivity factors
# transform two vector to matrix with task * productivity
output_table = ... | 3.15625 | 3 |
gestao/contrato/models/financeiro/ContratoDespesas.py | Smartboxweb98/gestao_empresarial | 3 | 12799207 | # -*- coding: utf-8 -*-
from django.db import models
from gestao.contrato.models.contrato.Contrato import Contrato
from gestao.financeiro.models.movimentacoes.Despesa import Despesa
from gestao.financeiro.models.pagamento.PagamentoDespesa import PagamentoDespesa
class ContratoDespesas(models.Model):
contrato = mo... | 2.1875 | 2 |
simplifiedpytrends/test_trendReq.py | Drakkar-Software/pytrends | 3 | 12799208 | from unittest import TestCase
from simplifiedpytrends.request import TrendReq
class TestTrendReq(TestCase):
def test__get_data(self):
"""Should use same values as in the documentation"""
pytrend = TrendReq()
self.assertEqual(pytrend.hl, 'en-US')
self.assertEqual(pytrend.tz, 360)
... | 2.90625 | 3 |
app/posts/__init__.py | nchudleigh/yunite-blog | 10 | 12799209 | from __future__ import absolute_import, print_function
from flask import Blueprint
posts = Blueprint('posts', __name__)
from . import views
from . import models
| 1.328125 | 1 |
HRec/datasets/hdataset.py | geekinglcq/HRec | 49 | 12799210 | # -*- coding:utf-8 -*-
# ###########################
# File Name: hdataset.py
# Author: geekinglcq
# Mail: <EMAIL>
# Created Time: 2020-12-28 20:17:47
# ###########################
import pandas as pd
import os
import logging
from collections import defaultdict
from torch.utils.data import DataLoader, Dataset
from .e... | 2.171875 | 2 |
src/controllerarena/loggers/VisualLogger.py | VerifiableRobotics/controller-arena | 0 | 12799211 | <filename>src/controllerarena/loggers/VisualLogger.py<gh_stars>0
import socket
import matplotlib.pyplot as plt
import numpy as np
import json
idx = 0
lines = []
def decode(dct):
if "data" in dct:
return dct["data"]
elif "config" in dct:
return dct["config"]
elif "config" not in dct and "x"... | 2.421875 | 2 |
json_eep.py | ivanliao/EazyEEP | 0 | 12799212 | <reponame>ivanliao/EazyEEP<filename>json_eep.py
#!/usr/bin/python
'''
Created on May 20, 2016
@author:
'''
import sys
import os
import json
import eeprom
#import logging as log
from argparse import ArgumentParser
class SysBoard(object):
'''
Main system definition
'''
def __init__(self, json_data):
... | 2.296875 | 2 |
MITx-6.00.1x/pset5/Problem_4_-_Decrypt_a_Story.py | FTiniNadhirah/Coursera-courses-answers | 73 | 12799213 | def decrypt_story():
"""
Using the methods you created in this problem set,
decrypt the story given by the function getStoryString().
Use the functions getStoryString and loadWords to get the
raw data you need.
returns: string - story in plain text
"""
story = CiphertextMessage(get_story... | 3.203125 | 3 |
commandlib/piped.py | crdoconnor/commandlib | 16 | 12799214 | <reponame>crdoconnor/commandlib<filename>commandlib/piped.py
from copy import deepcopy
from subprocess import PIPE, STDOUT, Popen
from commandlib.exceptions import CommandError, CommandExitError
from commandlib.utils import _check_directory
from os import chdir, getcwd
class PipedCommand(object):
def __init__(sel... | 2.703125 | 3 |
thebrushstash/migrations/0006_staticpagecontent.py | zenofewords/thebrushstash | 0 | 12799215 | <reponame>zenofewords/thebrushstash
# Generated by Django 2.2.7 on 2019-12-02 23:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('thebrushstash', '0005_setting'),
]
operations = [
migrations.CreateModel(
name='StaticPageCo... | 1.671875 | 2 |
awwaards_app/migrations/0004_auto_20200609_1512.py | hamisicodes/Awwaards | 0 | 12799216 | <reponame>hamisicodes/Awwaards
# Generated by Django 3.0.7 on 2020-06-09 12:12
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awwaards_app', '0003_rate'),
]
operations = [
migrations.AddField(
... | 1.757813 | 2 |
src/vps/config_seoul.py | deepguider/RoadGPS | 2 | 12799217 | <reponame>deepguider/RoadGPS
import os
root_dir = './data_vps/custom_dataset/dataset_seoul'
db_dir = os.path.join(root_dir, '.')
queries_dir = os.path.join(root_dir, '.')
if not os.path.exists(root_dir) or not(db_dir):
raise FileNotFoundError("root_dir : {}, db_dir : {}".format(root_dir, db_dir))
struct_dir = o... | 2.1875 | 2 |
farmblr/farmblr/settings.py | Nemwel-Boniface/Farmblr | 3 | 12799218 | """
Django settings for farmblr project.
Generated by 'django-admin startproject' using Django 4.0.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import os
from... | 1.84375 | 2 |
rubik_solver/Solver/CFOP/PLLSolver.py | kazi92/rubikSolver | 46 | 12799219 | <filename>rubik_solver/Solver/CFOP/PLLSolver.py<gh_stars>10-100
from rubik_solver.Move import Move
from .. import Solver
class PLLSolver(Solver):
STEPS = {
"810345672": ["X", "R'", "U", "R'", "D2", "R", "U'", "R'", "D2", "R2", "X'"],
"018345276": ["X'", "R", "U'", "R", "D2", "R'", "U", "R", "D2", "... | 2.078125 | 2 |
isic/scripts/make_smaller_image_folder.py | estherrolf/representation-matters | 1 | 12799220 | import os
import shutil
import pandas as pd
import torch
import PIL.Image as Image
import torchvision.transforms as transforms
import time
t = transforms.Compose([transforms.Resize((224,224))])
data_dir = '../../data'
image_dir = os.path.join(data_dir, 'isic/Images')
def main(csv_filename, include_sonic):
if in... | 2.640625 | 3 |
misc/migrations/versions/4c4c7189593e_.py | davewood/do-portal | 0 | 12799221 | <filename>misc/migrations/versions/4c4c7189593e_.py
"""empty message
Revision ID: 4c4c7189593e
Revises: 4b4e6d96c630
Create Date: 2017-04-04 12:37:27.512719
"""
# revision identifiers, used by Alembic.
revision = '4c4c7189593e'
down_revision = '4b4e6d96c630'
from alembic import op
import sqlalchemy as sa
def upgr... | 1.539063 | 2 |
main.py | Abhinavka369/snake_game_with_python | 0 | 12799222 | from turtle import Screen
from snake import Snake
from food import Food
from scoreboard import Score
import time
screener = Screen()
screener.setup(width=600, height=600)
screener.bgcolor("black")
screener.title("SNAKE GAME")
screener.tracer(0)
snake = Snake()
food = Food()
scoreboard = Score()
scree... | 3.484375 | 3 |
sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py | rsdoherty/azure-sdk-for-python | 2,728 | 12799223 | <filename>sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under ... | 2.25 | 2 |
utils/cv_utils.py | RishavMishraRM/Rain_Emoji | 6 | 12799224 | import os
import cv2
import numpy as np
def get_emojis():
emojis_folder = 'emoji/'
emojis = []
for emoji in range(len(os.listdir(emojis_folder))):
print(emoji)
emojis.append(cv2.imread(emojis_folder + str(emoji) + '.png', -1))
return emojis[0:len(emojis) - 1]
def overlay(image, emoj... | 3.421875 | 3 |
config.py | bvezilic/Neural-style-transfer | 3 | 12799225 | <filename>config.py
from pathlib import Path
ROOT_DIR = Path(__file__).parent.resolve()
IMAGE_DIR = ROOT_DIR / 'images'
| 1.828125 | 2 |
server.py | Ryan-Amaral/pi-cluster-vis | 0 | 12799226 | <gh_stars>0
import socket
import json
from _thread import start_new_thread
#from sense_hat import SenseHat
from optparse import OptionParser
import matplotlib.pyplot as plt
import time
parser = OptionParser()
parser.add_option('-i', '--ip', type='string', dest='ip', default='127.0.0.1')
parser.add_option('-p', '--port... | 2.59375 | 3 |
FargoNorth.py | jonschull/Lyte | 1 | 12799227 | <filename>FargoNorth.py
import lyte
secret_number = 4
def shift(c, howMuch= 1):
return chr(ord(c) + howMuch)
def encoder(message):
message=list(message)
for i in range( len(message) ):
message[i] = shift( message[i], howMuch= secret_number )
return ''.join(message)
def decoder(message):
... | 2.625 | 3 |
ngraph/frontends/caffe2/tests/test_ops_unary.py | NervanaSystems/ngraph-python | 18 | 12799228 | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | 2.0625 | 2 |
analysis/froude.py | SalishSeaCast/2d-domain | 0 | 12799229 | # This is a module with functions that can be used to calculate the Froude
# number in a simple 2D system
# <NAME>, 2015
import numpy as np
import datetime
from salishsea_tools.nowcast import analyze
def find_mixed_depth_indices(n2, n2_thres=5e-6):
"""Finds the index of the mixed layer depth for each x-positio... | 2.6875 | 3 |
train/openem_train/ssd/ssd_training.py | bryan-flywire/openem | 10 | 12799230 | __copyright__ = "Copyright (C) 2018 CVision AI."
__license__ = "GPLv3"
# This file is part of OpenEM, released under GPLv3.
# OpenEM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | 1.953125 | 2 |
activerest/connections.py | datashaman/activerest | 0 | 12799231 | import activerest.formats.json_format
import requests
from furl import furl
HTTP_FORMAT_HEADER_NAMES = {
'GET': 'Accept',
'PUT': 'Content-Type',
'POST': 'Content-Type',
'PATCH': 'Content-Type',
'DELETE': 'Accept',
'HEAD': 'Accept',
}
class Connection(object):
_site = None
_format = N... | 2.359375 | 2 |
src/ExampleNets/pythonScripts/eabLatVolData.py | benjaminlarson/SCIRunGUIPrototype | 0 | 12799232 | latvolMod = addModule("CreateLatVol")
size = 10
latvolMod.XSize = size
latvolMod.YSize = size
latvolMod.ZSize = size
latvolMod.DataAtLocation = "Nodes"
report1 = addModule("ReportFieldInfo")
latvolMod.output[0] >> report1.input[0]
data = {}
addDataMod = addModule("CreateScalarFieldDataBasic")
#eval.Operator = 2
#eval... | 1.84375 | 2 |
tests/conftest.py | showtatsu/python-bind9zone | 0 | 12799233 | <reponame>showtatsu/python-bind9zone
import pytest, os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from bind9zone.cli import Bind9ZoneCLI
ZONEDIR_SRC = 'tests/input'
ZONEDIR = 'tests/output'
def get_connection_fixture_params():
if os.getenv('TEST_POSTGRES'):
... | 2.046875 | 2 |
run_all_tests.py | ricdezen/random-algo-stuff | 0 | 12799234 | import os
from setuptools import find_packages
if __name__ == '__main__':
for package in find_packages():
if '.test' in package:
continue
os.system(f'cmd /c "python -m pytest -s {package}/test"')
| 1.632813 | 2 |
config_test/path_test.py | saustinp/3D-CG | 0 | 12799235 | import logging.config
import logging.handlers
logger = logging.getLogger()
logger.setLevel(logging.INFO)
smtp_handler = logging.handlers.SMTPHandler(mailhost=('outgoing.mit.edu', 465),
fromaddr='<EMAIL>',
toaddrs=['<EMAIL>'],
subject='... | 2.234375 | 2 |
naucse/freezer.py | OndSeb/naucse.python.cz | 0 | 12799236 | <reponame>OndSeb/naucse.python.cz<filename>naucse/freezer.py<gh_stars>0
import contextlib
from collections import deque
from flask import current_app
from flask_frozen import UrlForLogger, Freezer
def record_url(url):
"""Logs that `url` should be included in the resulting static site"""
urls_to_freeze = curre... | 2.4375 | 2 |
maxflow/push_relabel.py | JovanCe/mfp | 0 | 12799237 | <reponame>JovanCe/mfp<gh_stars>0
__author__ = '<NAME> <<EMAIL>>'
__date__ = '30 August 2015'
__copyright__ = 'Copyright (c) 2015 Seven Bridges Genomics'
from collections import defaultdict
class PushRelabel(object):
def __init__(self, flow_network):
self.flow_network = flow_network
self.height = ... | 2.234375 | 2 |
utils/error_operate.py | game-platform-awaresome/XSdkTools | 2 | 12799238 | <reponame>game-platform-awaresome/XSdkTools<gh_stars>1-10
#Embedded file name: D:/AnySDK_Package/Env/debug/../script\error_operate.py
# from taskManagerModule import taskManager
import thread
import threading
import file_operate
# import core
def error(code):
return
# idChannel = int(threading.currentThread().... | 1.914063 | 2 |
mega_analysis/crosstab/lobe_top_level_hierarchy_only.py | thenineteen/Semiology-Visualisation-Tool | 10 | 12799239 | <reponame>thenineteen/Semiology-Visualisation-Tool<filename>mega_analysis/crosstab/lobe_top_level_hierarchy_only.py
import numpy as np
import pandas as pd
from mega_analysis.crosstab.all_localisations import all_localisations
# list of all excel localisations
all_localisations = all_localisations()
# list of top leve... | 2.328125 | 2 |
tests/test_1.py | BroadAxeC3/deidre | 1 | 12799240 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import unittest
class ApiTests(unittest.TestCase):
pass
# @Mocker()
# def test_timeout_exception(self, m):
# # given
# m._adapter = Co2ApiTimeoutAdapter(m._adapter)
# m.register_uri(ANY, ANY, text=self.hanging_callback)
# client = Api... | 2.625 | 3 |
g2ana/plugins/ObsLog.py | naojsoft/g2ana | 0 | 12799241 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""Observation Log plugin.
**Plugin Type: Global**
``ObsLog`` is a global plugin. Only one instance can be opened.
**Usage**
***Saving the log to a file***
Put in values for the Observation Log folder and fi... | 2.25 | 2 |
retrieval_gloss.py | iacercalixto/visualsem | 37 | 12799242 | import argparse
import torch
import sys
import os
import json
from collections import defaultdict
import h5py
from sentence_transformers import SentenceTransformer, util
import numpy
import tqdm
from itertools import zip_longest
from utils import grouper, load_sentences, load_bnids, load_visualsem_bnids
def retrieve_... | 2.1875 | 2 |
hcat/detect.py | buswinka/hcat | 4 | 12799243 | import hcat.lib.functional
import hcat.lib.functional as functional
from hcat.lib.utils import calculate_indexes, load, cochlea_to_xml, correct_pixel_size, scale_to_hair_cell_diameter
from hcat.lib.cell import Cell
from hcat.lib.cochlea import Cochlea
from hcat.backends.detection import FasterRCNN_from_url
from hcat.ba... | 2.3125 | 2 |
UServer/http_api_oauth/api/api_gateway.py | soybean217/lora-python | 0 | 12799244 | import json
from . import api, root
from .decorators import gateway_belong_to_user, require_basic_or_oauth
from userver.object.gateway import Gateway, Location
from utils.errors import KeyDuplicateError, PatchError
from .forms.form_gateway import AddGatewayForm, PatchGateway
from flask import request, Response
from .f... | 2.390625 | 2 |
station/websockets/mock/mock_current_step.py | GLO3013-E4/COViRondelle2021 | 0 | 12799245 | <gh_stars>0
import random
from enum import Enum
import rospy
from std_msgs.msg import String
class Step(Enum):
CycleNotStarted = 'CycleNotStarted'
CycleReadyInWaitingMode = 'CycleReadyInWaitingMode'
CycleStarted = 'CycleStarted'
ToResistanceStation = 'ToResistanceStation'
ReadResistance = 'ReadRe... | 2.46875 | 2 |
river/linear_model/__init__.py | mathco-wf/river | 4 | 12799246 | """Linear models."""
from .alma import ALMAClassifier
from .glm import LinearRegression, LogisticRegression, Perceptron
from .pa import PAClassifier, PARegressor
from .softmax import SoftmaxRegression
__all__ = [
"ALMAClassifier",
"LinearRegression",
"LogisticRegression",
"PAClassifier",
"PARegress... | 1.390625 | 1 |
Chapter 02/__manifest__.py | hitosony/odoo | 84 | 12799247 | <reponame>hitosony/odoo
{'name': '<NAME>',
'data': [
'security/ir.model.access.csv',
'security/todo_access_rules.xml',
'views/todo_menu.xml',
'views/todo_view.xml'],
'application': True}
| 0.839844 | 1 |
GUI.py | SlavPetkovic/Python-Crud-Application | 0 | 12799248 | <filename>GUI.py
# Import dependencies
from tkinter import *
from tkinter import ttk
import mysql.connector
import sqlalchemy
import json
import datetime as dt
import getpass
import mysql
with open("parameters/config.json") as config:
param = json.load(config)
# Establishing engine
engine = sqlalchemy.create_engi... | 3.015625 | 3 |
products/admin.py | zerobug110/Syfters_project | 0 | 12799249 | from django.contrib import admin
from products.views import portfolio
# Register your models here.
from . models import Product, New, About, LatestNew
class ProductAdmin(admin.ModelAdmin):
list_display = ('name','price','created_at')
list_links = ('id', 'name')
list_filter = ('name','price','created_at')... | 1.820313 | 2 |
program/predictor/predictor_bilstm_crf.py | windsuzu/AICUP-Deidentification-of-Medical-Data | 1 | 12799250 | <filename>program/predictor/predictor_bilstm_crf.py<gh_stars>1-10
from program.models.model_bilstm_crf import BilstmCrfModel
from program.data_process.data_preprocessor import GeneralDataPreprocessor
import pandas as pd
import tensorflow as tf
import tensorflow_addons as tf_ad
from program.utils.tokenization import rea... | 2.59375 | 3 |