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 |
|---|---|---|---|---|---|---|
tweetable/admin.py | kkiyama117/django-HP | 1 | 12764551 | from django.contrib import admin
from .models import *
class TrainAdmin(admin.ModelAdmin):
pass
admin.site.register(User)
admin.site.register(Tweet)
| 1.523438 | 2 |
language_apps/expr1/gen/testParser.py | SadraGoudarzdashti/IUSTCompiler | 3 | 12764552 | # Generated from D:/AnacondaProjects/iust_start/grammars\expr3.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u60... | 1.539063 | 2 |
scripts/stats_test.py | mtcrawshaw/meta-world | 4 | 12764553 | """
Script to analyze distribution of squared Euclidean distance between gradients.
"""
from math import sqrt
import numpy as np
from scipy import stats
# Set constants.
k_vals = [35, 30, 36]
n_vals = [1, 18, 1]
total_n = sum(n_vals)
sigma = 0.01
start_t = 200
t = 250
num_trials = 100
alpha = 0.05
load = "vecs.np"
... | 2.9375 | 3 |
OOPS/oops-intro.py | tverma332/python3 | 3 | 12764554 | import os
class Tomcat:
def get_details_for_each_tomcat(self,server_xml):
self.tcf = server_xml
self.th = os.path.dirname(os.path.dirname(server_xml))
return None
def display_details(self):
print(f'The tomcat config file is : {self.tcf} \nThe tomcat home is : {self.th}')
return None
def main():
tomcat7... | 3.25 | 3 |
ephypype/compute_inv_problem.py | annapasca/ephypype | 18 | 12764555 | <filename>ephypype/compute_inv_problem.py
"""Inverse problem functions."""
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import mne
import glob
import os.path as op
import numpy as np
from mne.io import read_raw_fif, read_raw_ctf
from mne import read_epochs
from mne.evoked import write_evokeds, read_evoked... | 2.203125 | 2 |
tests/h/indexer/reindexer_test.py | ssin122/test-h | 0 | 12764556 | <filename>tests/h/indexer/reindexer_test.py
# -*- coding: utf-8 -*-
import mock
import pytest
from memex.search import client
from h.indexer.reindexer import reindex, SETTING_NEW_INDEX
@pytest.mark.usefixtures('BatchIndexer',
'configure_index',
'get_aliased_index',... | 2.21875 | 2 |
fibonacci/test_fibonacci.py | codenameyau/python-recursion | 0 | 12764557 | import unittest
import fibonacci
class TestFibonacci(unittest.TestCase):
def test_fib(self):
self.assertEqual(fibonacci.fib(1), 1)
self.assertEqual(fibonacci.fib(2), 1)
self.assertEqual(fibonacci.fib(3), 2)
self.assertEqual(fibonacci.fib(4), 3)
self.assertEqual(fibonacci.fi... | 3.453125 | 3 |
academic_helper/migrations/0001_initial.py | asaf-kali/coursist | 6 | 12764558 | # Generated by Django 3.0.6 on 2020-05-25 13:25
from decimal import Decimal
import django.contrib.auth.models
import django.contrib.auth.validators
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
de... | 1.96875 | 2 |
src/integrated_models/tim_veh/solve.py | railtoolkit/OpenLinTim | 0 | 12764559 | <filename>src/integrated_models/tim_veh/solve.py
from core.io.config import ConfigReader
from read_csv import *
import sys
from tim_veh_generic import TimVehGenericModel
from tim_veh_gurobi import TimVehGurobiModel
from tim_veh_helper import TimVehParameters
from vs_helper import TurnaroundData
logger = logging.getLo... | 2.234375 | 2 |
tf_unet/scripts/rfi_launcher.py | abhineet123/river_ice_segmentation | 10 | 12764560 | # tf_unet 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 License, or
# (at your option) any later version.
#
# tf_unet is distributed in the hope that it will be useful,
# but WITHOUT... | 2.046875 | 2 |
HackerRank/10 Days of Statistics/Poisson Distribution I.py | will-data/Self-Study-WIL | 1 | 12764561 | <gh_stars>1-10
import math
p = float(input())
n = int(input())
factorial = lambda n: 1 if n==1 else n*factorial(n-1)
poisson = lambda p, n: p**n*math.exp(-p)/factorial(n)
print(poisson(p,n)) | 3.234375 | 3 |
menu.py | yanzi113/python | 0 | 12764562 | import pygame,sys
import random
import math
from pygame.locals import *
from pygame.sprite import Group
import gF
import Bullet
import DADcharacter
import Slave
import global_var
import Effect
import Item
import gameRule
class Menu():
def __init__(self):
super(Menu,self).__init__()
self.image=pyga... | 2.578125 | 3 |
dsi/expansions.py | mongodb/dsi | 9 | 12764563 | <gh_stars>1-10
"""
Glue between expansions.yml (written by convention in evergreen configs)
and DSI's internal config yamls.
"""
import os
import re
import typing as typ
from collections import namedtuple
import yaml
import structlog
_StrList = typ.List[str]
def _bootstrap_contents(exps: dict, ers: _StrList) -> di... | 1.875 | 2 |
maistra/vendor/com_googlesource_chromium_v8/wee8/build/fuchsia/boot_data.py | knm3000/proxy | 643 | 12764564 | # Copyright 2018 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.
"""Functions used to provision Fuchsia boot images."""
import common
import logging
import os
import subprocess
import tempfile
import time
import uuid
_SS... | 1.953125 | 2 |
lib/datasets/SearchDatasetWrap.py | Mirofil/AutoDL-Projects | 3 | 12764565 | ##################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2019 #
##################################################
import torch, copy, random
import torch.utils.data as data
class SearchDataset(data.Dataset):
def __init__(self, name, data, train_split, valid_split, direct_index=Fal... | 2.484375 | 2 |
lib/utils/utils.py | spaenigs/ensemble-performance | 1 | 12764566 | from functools import reduce
from typing import List
from snakemake.io import glob_wildcards
import pandas as pd
import numpy as np
import os
N_JOBS, MAX_ITER, MAX_NR = 28, 100, 20
MODEL_NAMES = [
# "lda", "bayes",
# "log_reg",
"rf"
]
META_MODEL_NAMES = [
"stacking",
"voting_hard",
"voting_... | 2.3125 | 2 |
programming-laboratory-I/nhwk/pesquisa.py | MisaelAugusto/computer-science | 0 | 12764567 | <filename>programming-laboratory-I/nhwk/pesquisa.py
# coding: utf-8
# Aluno: <NAME>
# Matrícula: 117110525
# Problema: Pesquisa Hotéis
valores = []
tamanhos = []
confortos = []
hoteis = []
while True:
entrada = raw_input().split(",")
if entrada[0] == "---":
break
valores.append(entrada[0])
tamanhos.append(entrad... | 3.625 | 4 |
userid_country.py | PittayutSothanakul/TinyTourMiner | 0 | 12764568 | userid_country = {
60: ("US", "United States", "アメリカ合衆国"),
71: ("CL", "Chile", "チリ"),
95: ("CL", "Chile", "チリ"),
95: ("BR", "Brazil", "ブラジル"),
95: ("PE", "Peru", "ペルー"),
95: ("PT", "Portugal", "ポルトガル"),
170: ("US", "United States", "アメリカ合衆国"),
219: ("CN", "China", "中華人民共和国"),
219: ("PH", "Philippines", "フィリピン"... | 1.210938 | 1 |
main.py | sms77io/active-workflow-voice | 0 | 12764569 | <gh_stars>0
import os
from flask import Flask
from flask import jsonify
from flask import request
from sms77api.Sms77api import Sms77api
app = Flask(__name__)
@app.route('/', methods=['POST'])
def handle():
return handle_agent(Sms77VoiceAgent, request)
def handle_agent(cls, req):
"""Helper that routes 'me... | 2.78125 | 3 |
autoload/leaderf/python/filer/commands/input.py | tsuyoshicho/LeaderF-filer | 43 | 12764570 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from leaderf.utils import lfCmd
_switch_normal_mode_key = ""
_context = {}
# search_func
# additional_prompt_string
# cli_key_dict
# cli_cmdline
# cli_cursor_pos
# cli_pattern
# cursor_pos
# results
# input_prompt_prompts
# input_prompt_command
def command___input_cance... | 2.34375 | 2 |
venvs/sitio_web/restaurantes/forms.py | mmaguero/MII-SSBW16-17 | 1 | 12764571 | # -*- coding: utf-8 -*-
from django import forms
from .models import restaurants
# Para campos individuales:
class RestaurantesForm(forms.Form):
nombre = forms.CharField(required=True, label='Name', max_length=80)
cocina = forms.CharField(required=True, label='Cuisine', widget=forms.TextInput(attrs={'plac... | 2.5625 | 3 |
bin/bacWGS_readQC.py | pkmitchell/bacWGS | 0 | 12764572 | <filename>bin/bacWGS_readQC.py
#!/workdir/miniconda3/envs/bacWGS/bin/python
import sys
from subprocess import call
import argparse
import re
import multiprocessing as mp
'''
Run fastqc on a input samples, then parse output to produce table
'''
#Argument Parser
parser = argparse.ArgumentParser(description="Run FastQC... | 2.625 | 3 |
imagepy/menus/Image/Lookup table/Others/lookuptables_plg.py | Pad0y/imagepy | 0 | 12764573 | <filename>imagepy/menus/Image/Lookup table/Others/lookuptables_plg.py
from ..lookuptables_plg import LUT
from imagepy.app import ColorManager
plgs = [LUT(i, j) for i, j, _ in ColorManager.gets(tag="adv")]
| 1.609375 | 2 |
tests/test_read_rpc.py | OptimalAnalytics/call_center_reports | 0 | 12764574 | import pytest
from process_reports import read_rpc, check_excel, check_extension, read_info
import os
@pytest.fixture
def good_fn():
return os.path.join('Sample_Reports', 'ALL_RPC-2-1-2018_Scrubbed.xlsx')
@pytest.fixture
def updated_fn():
return os.path.join('Sample_Reports', 'ALL_RPC-7-3_2018_Scrubbed.xlsx... | 1.992188 | 2 |
marbaloo_mako/__init__.py | marbaloo/marbalo_mako | 1 | 12764575 | import cherrypy
from mako.lookup import TemplateLookup
class Tool(cherrypy.Tool):
_lookups = {}
def __init__(self):
cherrypy.Tool.__init__(self, 'before_handler',
self.callable,
priority=40)
def callable(self,
filenam... | 2.328125 | 2 |
cgs_vmc/run_training.py | ClarkResearchGroup/cgs-vmc | 18 | 12764576 | <filename>cgs_vmc/run_training.py
"""Runs supervised or unsupervised neural network training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
from absl import app
from absl import flags
import evalua... | 2.03125 | 2 |
miRNASNP3/miRNASNP3/ajax.py | chunjie-sam-liu/miRNASNP-v3 | 1 | 12764577 | import flask_restful
import re
from miRNASNP3 import app, api
from miRNASNP3.core import mongo
from flask_restful import Resource, fields, marshal_with, reqparse, marshal
from flask import send_file
mirna_exp_df = {
"ACC": fields.String,
"DLBC": fields.String,
"READ": fields.String,
"GBM": fields.Str... | 2.203125 | 2 |
resnet50/predict.py | TerenceChen95/Bladder-Cancer-Stage-Detection | 5 | 12764578 | <gh_stars>1-10
import torch
from PIL import Image, ImageFilter
import seaborn
import matplotlib.pyplot as plt
from torchvision import transforms
from torch.autograd import Variable
device = torch.device('cuda:0')
#load model
model = torch.load('../BEST_checkpoint_resnet50.pth.tar')['model']
model.to(device)
model.eval... | 2.265625 | 2 |
transposonmapper/mapping/get_insertions_and_reads.py | EKingma/Transposonmapper | 2 | 12764579 | <gh_stars>1-10
import numpy as np
def get_insertions_and_reads(coordinates, tn_coordinates, readnumb_array):
"""This function computes the total number of transposons per gene , the number of reads per gene and
the distribution of transposons along the gene.
Parameters
----------
coordinates : di... | 3.109375 | 3 |
src/score.py | hudua/mlops | 7 | 12764580 | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import json
import pickle
import numpy as np
import pandas as pd
import azureml.train.automl
from sklearn.externals import joblib
from azure... | 2.25 | 2 |
fasttask/apps.py | huanjoyous/FasterRunner20190716 | 2 | 12764581 | from django.apps import AppConfig
class FasttaskConfig(AppConfig):
name = 'fasttask'
| 0.945313 | 1 |
main.py | GokuGunZ/KingCardGame | 0 | 12764582 | import pygame
from pygame.locals import *
from pygame.event import wait
from deck import *
from game import *
from init import *
deck = Deck()
King = Game("Pit","Dotti","Lella","Rob")
giocata=0
position=[0,0,0,0]
carteGiocate=[[],[],[],[],[],[],[],[],[],[],[],[],[]]
timerScomparsa=0
timerGiocata=0
primaCarta = None
... | 3.0625 | 3 |
automaton/plugins/translate.py | nemec/Automaton | 6 | 12764583 | <reponame>nemec/Automaton
from urllib2 import urlopen, URLError
from urllib import urlencode
import unicodedata
import automaton.lib.plugin
from automaton.lib.data.abbreviations import language_codes
# pylint: disable-msg=W0101
raise automaton.lib.plugin.PluginLoadError(
"Translations from google are now a paid ser... | 2.796875 | 3 |
dynamic_subdomains/templatetags/dynamic_subdomains.py | Oksamies/django-dynamic-subdomains-ai | 6 | 12764584 | <reponame>Oksamies/django-dynamic-subdomains-ai
from django import template
from django.conf import settings
from django.template import TemplateSyntaxError
from django.utils.encoding import smart_str
from django.template.defaulttags import kwarg_re
from ..reverse import reverse_crossdomain
register = template.Librar... | 2.25 | 2 |
event_handlers/bot_computer_status_event_handler.py | sly9/VoyagerTelegramBot | 12 | 12764585 | <gh_stars>10-100
import datetime
import os
import threading
from collections import deque
from time import sleep
from typing import Dict
import psutil
from data_structure.special_battery_percentage import SpecialBatteryPercentageEnum, MemoryUsage
from event_emitter import ee
from event_handlers.voyager_event_handler ... | 2.296875 | 2 |
python-decompresser/formatter.py | maxwellb/rdm-native-value-formatters | 12 | 12764586 | <gh_stars>10-100
from abc import ABC, abstractmethod
import binascii
import json
import logging
import argparse
import base64
import time
import os
import sys
import gzip
import lz4.block
import lzma
try:
import snappy
SNAPPY_SUPPORT = True
except ImportError:
SNAPPY_SUPPORT = False
sys.path.append(
o... | 2.203125 | 2 |
Previous_State_On_Repo/StrokeRecoveryOffline/Data/code/combineWordHinEngBan.py | rohun-tripati/pythonRepo | 1 | 12764587 | #!/usr/bin/env python
import netcdf_helpers
from scipy import *
from optparse import OptionParser
from xml.dom.minidom import parse
import sys, time, os
# import tamil_extract as TE
# import bangla_extract as BE
import hindi_extract as HE
import english_extract as EE
import engword_extract as EWE
import hinword_extr... | 2.296875 | 2 |
apps/carts/migrations/0003_cart_products.py | feliamunda/Django_Store | 0 | 12764588 | # Generated by Django 3.0.3 on 2020-02-07 02:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
('carts', '0002_cart_user'),
]
operations = [
migrations.AddField(
model_name='cart',
... | 1.8125 | 2 |
person/models.py | rgrlinux/nss | 0 | 12764589 | from django.db import models
from django.db.models import base
from django.db.models.deletion import CASCADE
from django.db.models.expressions import F
from localflavor.br.models import BRCPFField
from localflavor.br.validators import BRCPFValidator
class PersonType(models.Model):
id = models.AutoField(primary_ke... | 2.109375 | 2 |
bindings/python/test/time/test_time.py | robinpdm/open-space-toolkit-physics | 7 | 12764590 | <filename>bindings/python/test/time/test_time.py<gh_stars>1-10
################################################################################################################################################################
# @project Open Space Toolkit ▸ Physics
# @file bindings/python/test/time/test... | 1.734375 | 2 |
messenger.py | mtahmed/antnest | 1 | 12764591 | # Standard imports
import collections
import json
import select
import socket
import threading
import zmq
# Custom imports
import job
import message
import taskunit
import utils.logger
class Messenger:
'''A class representing a messenger that handles all communication.
'''
def __init__(self):
# i... | 2.515625 | 3 |
video_info.py | ondrasouk/encoders-comparison-tool | 1 | 12764592 | <filename>video_info.py
import subprocess
binaries = {}
# Videofiles properties. Key is video file path.
videofiles_frame_num = {}
videofiles_duration = {}
videofiles_framerate = {}
videofiles_resolution = {}
videofiles_pix_fmt = {}
pix_fmts_bpp = {}
def set_defaults(binaries_ent):
global binaries
binaries ... | 2.671875 | 3 |
back/slidingpuzzle.py | monoklabs/Econ-Puzzle-Experiment | 2 | 12764593 | # -*- coding: utf-8 -*-
"""
A* sliding puzzle solver
Solver script for the fifteen-puzzle and derivations of it (8-puzzle etc.),
based on what we've learnt on ai-class.com so far. Don't expect it to run very
fast, certain puzzle states take ages to solve. I have documented and
commented the code thoroughly, so hopefull... | 3.796875 | 4 |
python/fds.protobuf.stach.v2/fds/protobuf/stach/v2/table/TableData_pb2.py | saigiridhar21/stachschema-sdks | 0 | 12764594 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fds/protobuf/stach/v2/table/TableData.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf impor... | 1.210938 | 1 |
config_writer/__init__.py | glennib/py-config | 0 | 12764595 | <reponame>glennib/py-config<filename>config_writer/__init__.py
from .config import ConfigWriter
| 1.320313 | 1 |
app/models.py | Diogosantosecastro/bo_sales | 0 | 12764596 | <filename>app/models.py
import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app, request, url_for
from flask_login import UserMixin, AnonymousUserMixin
from . import db, login_manager
f... | 2.609375 | 3 |
problems/primes.py | JoshKarpel/Euler | 1 | 12764597 | import math
def is_prime(n):
if n <= 1:
return False
elif n == 2:
return True
elif n % 2 == 0:
return False
for divisor in range(3, math.ceil(math.sqrt(n)) + 1, 2):
if n % divisor == 0:
return False
return True
def find_n_primes(n):
primes = [2]
... | 3.953125 | 4 |
honeybot/manager.py | Zernerus/honeybot | 0 | 12764598 | from tkinter import *
import tkinter as tk
import os
import inspect
import configparser
#Create a window with a title
window = tk.Tk()
window.geometry("650x670")
window.title("Manager")
#Gets the system path for the manager file
filePath = os.path.abspath(inspect.getfile(inspect.currentframe()))
extenstion = filePat... | 2.953125 | 3 |
api/server/swagger_server/code_templates/serve_kfserving.TEMPLATE.py | srishtipithadia/mlx | 0 | 12764599 | # Copyright 2021 IBM 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 2.171875 | 2 |
export_results.py | bergercookie/demo-selfdriving | 0 | 12764600 | <filename>export_results.py
from basic_types import Problem
from utils import print_, print_sec, print_ssec
def export_results(prob: Problem, outfile: str):
"""Export the results to the file specified."""
print_ssec("Exporting results to {}".format(outfile))
out_lines = []
for a in prob.assigns:
... | 2.796875 | 3 |
python/save_cookies.py | ruilisi/weibo-crawler | 3 | 12764601 | <filename>python/save_cookies.py
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.acti... | 2.8125 | 3 |
tests/test_all.py | thilp/ecological | 0 | 12764602 | #!/usr/bin/python3
import typing
import pytest
import ecological
def test_regular_types(monkeypatch):
monkeypatch.setenv("INTEGER", "42")
monkeypatch.setenv("BOOLEAN", "False")
monkeypatch.setenv("ANY_STR", "AnyStr Example")
monkeypatch.setenv("TEXT", "Text Example")
monkeypatch.setenv("DICT", ... | 2.796875 | 3 |
sdk/python/pulumi_google_native/apigee/v1/get_override.py | AaronFriel/pulumi-google-native | 44 | 12764603 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 1.664063 | 2 |
miepy/particles/regular_prism.py | johnaparker/MiePy | 3 | 12764604 | <reponame>johnaparker/MiePy
import miepy
from .particle_base import particle
import numpy as np
class regular_prism(particle):
def __init__(self, position, N, height, material, width=None, radius=None, orientation=None, tmatrix_lmax=0):
"""A regular prism object (an extruded regular polygon). By convention... | 2.953125 | 3 |
SSH-Honeypot-master/SSH.py | Zusyaku/Termux-And-Lali-Linux-V2 | 2 | 12764605 | <gh_stars>1-10
#Author:D4Vinci
#Squnity Developers
import socket
our_log=open("Attackers_Data.txt","w") #Our text file to save attackers data in it
def ssh(msg="",listeners=2):
welcome="""Welcome to BackBox Linux 4.5 (GNU/Linux 4.2.0-30-generic i686)\n
* Documentation: http://www.backbox.org/\n\n
The programs i... | 2.703125 | 3 |
cloudwatchbridge/dt_cw_bridge.py | dlopes7/dynatrace-api | 80 | 12764606 | #
# Script for transferring Dynatrace timeseries into AWS CloudWatch.
#
import requests, datetime, time, sched, subprocess, shlex
# Enter your own environment id and API key token here
YOUR_ENV_ID = 'ENTER_YOUR_ENV_ID_HERE';
YOUR_API_TOKEN = 'ENTER_YOUR_API_TOKEN_HERE';
# Configure a list of monitored components yo... | 2.03125 | 2 |
fedlab_benchmarks/fedmgda+/client.py | KarhouTam/FedLab-benchmarks | 0 | 12764607 | from logging import log
import torch
import argparse
import sys
import os
import tqdm
from copy import deepcopy
import torchvision
from torchvision import transforms
from torch import nn
from fedlab.core.client.manager import PassiveClientManager
from fedlab.core.client.trainer import SGDClientTrainer
from fedlab.cor... | 2.0625 | 2 |
people_counter_app/inference.py | serisaigeetha/Edge_AI | 0 | 12764608 | <filename>people_counter_app/inference.py<gh_stars>0
#!/usr/bin/env python3
"""
Copyright (c) 2018 Intel Corporation.
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, inclu... | 1.5 | 2 |
main.py | imdany/pyconway | 0 | 12764609 | <filename>main.py
# Conway's Game of Life - Python Implementation
# Author: Daniel: <EMAIL>
import pygame
from pygame.locals import *
from cell import Cell
from config import *
import time
from random import choice
# Initialising PyGame
pygame.init()
pygame.display.set_caption("PyConway")
gameDisplay = p... | 3.9375 | 4 |
roi_extractor.py | IstoVisio/script_roi_extractor | 0 | 12764610 | <reponame>IstoVisio/script_roi_extractor
import os
import sys
import syglass as sy
from syglass import pyglass
import numpy as np
import tifffile
import subprocess
import tkinter as tk
returnString = ""
def extract_roi(projectPath, roi_index):
project = sy.get_project(projectPath)
head, tail = os.path.split(projec... | 2.8125 | 3 |
FeatureVectorGeneration/Kmeans.py | raja21068/Android_Malware_Detection | 2 | 12764611 | import re
import numpy as np
#numerical operation
import matplotlib.pyplot as plt
#matploit provides functions that draws graphs or etc.
from sklearn.cluster import MiniBatchKMeans
from sklearn.cluster import KMeans
import array
import numpy as np
def findminmax(dirname, filename):
print('findminmax')
mf = op... | 2.90625 | 3 |
example_configs/custom_export_formats/custom_exporters.py | stuartcampbell/tiled | 1 | 12764612 | # This file will be (temporarily) included in the Python sys.path
# when config.yml is loaded by the Tiled server.
import io
from PIL import Image
from tiled.structures.image_serializer_helpers import img_as_ubyte
def smiley_separated_variables(array, metadata):
return "\n".join("🙂".join(str(number) for number... | 2.6875 | 3 |
scripts/mixPpcaDemo.py | VaibhaviMishra04/pyprobml | 2 | 12764613 | # Author: <NAME>
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.special import logsumexp
'''
z = Wx + µ + E
the equation above represents the latent variable model which
relates a d-dimensional data vector z to a corresponding q-dimensional
latent variables x
with q < d, for isot... | 3.15625 | 3 |
dino/genetic.py | mateusnbm/chrome-dinosaur | 0 | 12764614 | <filename>dino/genetic.py
#
# genetic.py
#
import copy
import random
'''
'''
class Genome():
'''
'''
def __init__(self, length):
self.fitnesses = [0]
self.genes = [random.uniform(-1, 1) for _ in range(length)]
'''
'''
def __str__(self):
str_rep = ""
fo... | 3.140625 | 3 |
apps/home.py | eri3l/skinks | 0 | 12764615 | import streamlit as st
def app():
st.write("## Welcome to the Skink Search Tool app")
st.write("""
The app filters existing skink data by multiple criteria in order to help with the identification of skinks.
Latest data update: 10 Apr 2020. \n
Use the navigat... | 3.703125 | 4 |
ci/infra/testrunner/utils/logger.py | Klaven/skuba | 0 | 12764616 | <gh_stars>0
import logging
import os
class Logger:
def __init__(self, conf):
pass
@staticmethod
def config_logger(conf, level=None):
logger = logging.getLogger("testrunner")
logger.setLevel(logging.getLevelName("DEBUG"))
if conf.log.file:
mode = 'a'
... | 2.703125 | 3 |
Assignment/wordCalculator.py | TungTNg/itc110_python | 0 | 12764617 | <filename>Assignment/wordCalculator.py
# wordCalculator.py
# A program to calculate the number of words in a sentence
# by <NAME>
def main():
# declare program function:
print("This program calculates the number of words in a sentence.")
print()
# prompt user to input the sentence:
sentence =... | 4.5625 | 5 |
foundation/users/tests/factories.py | pilnujemy/foundation-manager | 1 | 12764618 | <gh_stars>1-10
from __future__ import absolute_import
from .. import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence('user-{0}'.format)
email = factory.Sequence('<EMAIL>'.<EMAIL>)
password = factory.PostGenerationMethodCall('set_password', 'password'... | 2.109375 | 2 |
converters/COCOVisualize.py | mateoKutnjak/yolact | 0 | 12764619 | import json
import sys
import imageio
import matplotlib.pyplot as plt
import cv2
import random
def search_images_by_id(_id):
for _ in valid['images']:
if _['id'] == _id:
return _
def search_categories_by_id(_id):
for _ in valid['categories']:
if _['id'] == _id:
return... | 2.484375 | 2 |
footy/domain/Result.py | dallinb/footy | 2 | 12764620 | """Result - Data structure for a result."""
# Is prediction before game is played, then actual once game ahs been played
# Return the outcome Briers score, home/away goals scored, Predictions if available, and actual
# result if game has been played
class Result:
"""Result - Data structure for a result."""
d... | 3.734375 | 4 |
core/apps.py | techacademypython/hackaton_amada | 0 | 12764621 | from django.apps import AppConfig
class CoreConfig(AppConfig):
name = 'core'
def ready(self):
from mqtt.mqtt_file import client
client.loop_start()
| 1.84375 | 2 |
deepctr_torch/models/pnn.py | sngweicong/DeepCTR-Torch | 4 | 12764622 | # -*- coding:utf-8 -*-
"""
Author:
<NAME>,<EMAIL>
Reference:
[1] <NAME>, <NAME>, <NAME>, et al. Product-based neural networks for user response prediction[C]//Data Mining (ICDM), 2016 IEEE 16th International Conference on. IEEE, 2016: 1149-1154.(https://arxiv.org/pdf/1611.00144.pdf)
"""
import torch
import tor... | 2.953125 | 3 |
neutron/db/models/ndp_proxy.py | dangervon/neutron | 0 | 12764623 | <reponame>dangervon/neutron<filename>neutron/db/models/ndp_proxy.py
# Copyright 2022 Troila
# 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://... | 1.882813 | 2 |
OpenFOAM-wrapper/utils/files.py | Lenferd/ANSYS-OpenFOAM | 0 | 12764624 | import os
import shutil
from utils.logger import Logger, LogLvl
_logger = Logger(LogLvl.LOG_ERROR)
# Creation
def is_directory_exists(dir_name):
directory_exists = os.path.exists(dir_name)
if not directory_exists:
_logger.info("Directory \"{}\" not exists".format(dir_name))
return directory_exis... | 2.890625 | 3 |
Tools/idle/FrameViewer.py | 1byte2bytes/cpython | 5 | 12764625 | <reponame>1byte2bytes/cpython<gh_stars>1-10
from repr import Repr
from Tkinter import *
class FrameViewer:
def __init__(self, root, frame):
self.root = root
self.frame = frame
self.top = Toplevel(self.root)
self.repr = Repr()
self.repr.maxstring = 60
self.load_varia... | 2.84375 | 3 |
src/game_create.py | Boromir-the-Brave/Adventure_Game | 0 | 12764626 | from things import Room, Item
def build_rooms():
print("Building world...", end="")
house_front_yard = Room("house_front_yard")
print(" done.")
return
def generate_items():
print("Generating items...", end="")
print(" done.")
return | 2.78125 | 3 |
sphinxsimulink/diagram/directives.py | dekalinowski/sphinx-simulink | 2 | 12764627 | """
sphinx-simulink.directives
~~~~~~~~~~~~~~~~~~~~~~~
Embed Simulink diagrams on your documentation.
:copyright:
Copyright 2016 by <NAME> <<EMAIL>>.
:license:
MIT, see LICENSE for details.
"""
import hashlib
import os
import tempfile
from docutils.parsers.rst import directives
from do... | 2.140625 | 2 |
pcbhdl/test/library/test_package.py | pcbhdl/pcbhdl | 0 | 12764628 | <reponame>pcbhdl/pcbhdl
import unittest
from pcbhdl.library.package.passive import *
class TestPackage(unittest.TestCase):
def test_eia_two_terminal(self):
pkg = EIA_I_0603
self.assertEqual(pkg.name, "EIA_I_0603")
self.assertEqual(pkg.pads[0].name, "1")
self.assertEqual(pkg.pads[... | 2.734375 | 3 |
src/services/sspanel_mining/__init__.py | lkmvip/sspanel-mining | 1 | 12764629 | """
- 集爬取、清洗、分类与测试为一体的STAFF采集队列自动化更新组件
- 需要本机启动系统全局代理,或使用“国外”服务器部署
"""
from .sspanel_checker import SSPanelStaffChecker
from .sspanel_classifier import SSPanelHostsClassifier
from .sspanel_collector import SSPanelHostsCollector
__version__ = 'v0.2.2'
__all__ = ['SSPanelHostsCollector', "SSPanelStaffChecker", ... | 1.476563 | 1 |
tests/data/program_analysis/crop_yield.py | mikiec84/delphi | 25 | 12764630 | import sys
from typing import List
import math
from delphi.translators.for2py.format import *
from delphi.translators.for2py.arrays import *
from delphi.translators.for2py.static_save import *
from delphi.translators.for2py.strings import *
from dataclasses import dataclass
from delphi.translators.for2py.types_ext impo... | 2.765625 | 3 |
trachours/db.py | superyaro/trachoursplugin | 0 | 12764631 | <filename>trachours/db.py<gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 <NAME> <<EMAIL>>
# Copyright (C) 2017 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from datetime import datetim... | 2.09375 | 2 |
setup.py | tpatja/opensoar | 9 | 12764632 | from setuptools import setup, find_packages
exec(open('opensoar/version.py').read())
with open("README.rst", "r") as f:
long_description = f.read()
setup(
name='opensoar',
version=__version__, # has been import above in exec command
license='MIT',
description='Open source python library for glid... | 1.335938 | 1 |
Lista2/Lista2ex3.py | hugo-paiva/IntroducaoCienciasDaComputacao | 0 | 12764633 | cargo = input().lower().strip()
tempo = int(input())
salarioAtual = float(input())
if salarioAtual < 1039:
print('Salário inválido!')
else:
if cargo == 'gerente':
if tempo <= 3:
reajuste = salarioAtual * 0.12
elif tempo <= 6:
reajuste = salarioAtual * 0.13
else:
... | 3.65625 | 4 |
tests/test_dfa.py | UCSCFormalMethods/CIToolkit | 0 | 12764634 | """ Tests for the Dfa class"""
import math
import random
import itertools
import pytest
from citoolkit.specifications.spec import AbstractSpec
from citoolkit.specifications.dfa import Dfa, State, DfaCycleError
###################################################################################################
# Basi... | 2.828125 | 3 |
reporting/sortshootout.py | pinobatch/numism | 11 | 12764635 | #!/usr/bin/env python3
import os
import sys
import html5lib
from xml.etree import ElementTree as ET
import subprocess
from html import escape as H
"""
If you've found this, then you should help me report a bug in IDLE,
the official Python code editor. In IDLE 3.8.5 on Python 3.8.5 in
Xubuntu 20.04 LTS, if you open a ... | 2.453125 | 2 |
htp/api/scripts/candles.py | kirkjules/machine-learned-timeseries | 1 | 12764636 | <filename>htp/api/scripts/candles.py
import click
from celery import chord
from copy import deepcopy
from uuid import uuid4 # , UUID
from htp.toolbox import dates
from htp.aux import tasks
from datetime import datetime
from htp.aux.database import db_session
from htp.aux.models import GetTickerTask, SubTickerTask, Can... | 2.328125 | 2 |
bot/player_commands/rank.py | UP929312/CommunityBot | 1 | 12764637 | <filename>bot/player_commands/rank.py
import discord # type: ignore
from discord.ext import commands # type: ignore
from discord.commands import Option # type: ignore
from typing import Optional
from database_manager import get_specific_networth_data, get_all_networth_data, get_sum_networth_data
from emojis import ... | 2.703125 | 3 |
services/scrapping_service.py | fedsp/site2data | 0 | 12764638 | from bs4 import BeautifulSoup
import requests
from urllib.parse import urlsplit, urlunsplit
from config import settings
from logo_finder_service import LogoFinderService
from phone_finder_service import PhoneFinderService
from time import sleep
from selenium import webdriver
#from webdriver_manager.chrome import Chrome... | 2.796875 | 3 |
Subtitles.py | ITNano/tech-home | 0 | 12764639 | <gh_stars>0
import requests
from html.parser import HTMLParser
import os
import zipfile
import codecs
import string
import random
# Parses the data from a Google search and finds the first search result link.
# The link will be stored in the instance variable link, if found.
# Use GoogleHTMLParser.feed(input) to inser... | 3.15625 | 3 |
citcall/citcall.py | saggafarsyad/citcall-python | 0 | 12764640 | <gh_stars>0
import base64
import json
import re
import requests
class Citcall:
"""
This is the Python Class client library for use Citcall's API.
To use this, you'll need a Citcall account and Your IP has been filtered in citcall system.
See citcall documentation for more information. This is curre... | 2.71875 | 3 |
demo/smallbatch.py | dw/acid | 15 | 12764641 | <reponame>dw/acid<filename>demo/smallbatch.py
#
# Compare behaviour when batches are large and record size is tiny.
#
import gzip
import random
import time
import acid
import acid.core
import acid.keylib
from demo_util import store_len
from demo_util import store_size
words = sorted(line.decode().strip()
... | 2.328125 | 2 |
Cryptography/CaesarCipher/caesarcipher.py | AoWangDrexel/PiApproximationExperiments | 0 | 12764642 | <gh_stars>0
"""
Author: <NAME>
Date: 08/12/19
Description: Caesar cipher encryption and decryption, also a reverse encryption
"""
# The function reverses the string parameter
def reverse(plain_text):
cipher_text = ""
for letter in range(len(plain_text)):
# starts at the end of the string, -1 an... | 4.3125 | 4 |
tests/test_models.py | mishbahr/djangocms-responsive-wrapper | 18 | 12764643 | <reponame>mishbahr/djangocms-responsive-wrapper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_djangocms-responsive-wrapper
------------
Tests for `djangocms-responsive-wrapper` models module.
"""
from django.conf import settings
from django.test import TestCase
from responsive_wrapper import models
class... | 1.367188 | 1 |
beatup/migrations/0012_alter_post_author.py | divmoe/beatup | 0 | 12764644 | # Generated by Django 4.0.1 on 2022-02-25 04:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('beatup', '0011_alter_customer_photo'),
]
operations = [
migrations.AlterField(
model_name='post... | 1.4375 | 1 |
authenticate.py | kaamilmirza/UltimateTwitterScrapper | 1 | 12764645 | import tweepy
import pandas as pd
config = pd.read_csv("./config.csv")
twitterAPIkey = config['twitterApiKey'][0]
twitterAPIS = config['twitterApiSecret'][0]
twitterAPIAT = config['twitterApiAccessToken'][0]
twitterAPIATS = config['twitterApiAccessTokenSecret'][0]
auth = tweepy.OAuthHandler(twitterAPIkey, twitterAPIS)... | 2.265625 | 2 |
backend/moderation/__init__.py | ranwise/djangochannel | 45 | 12764646 | <filename>backend/moderation/__init__.py
default_app_config = "backend.moderation.apps.ModerationConfig" | 1.164063 | 1 |
events/migrations/0019_eventspage.py | meagles/site | 4 | 12764647 | <gh_stars>1-10
# Generated by Django 3.2.6 on 2021-08-27 19:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0062_comment_models_and_pagesubscription'),
('events', '0018_alter_apicalls_datetime')... | 1.851563 | 2 |
src/image_predict/trainer.py | mina-moto/probspace_kiva_public | 2 | 12764648 | """
"""
import argparse
import os
import sys
import mlflow
import pandas as pd
import pytorch_lightning as pl
import yaml
from dotenv import load_dotenv
load_dotenv() # noqa
sys.path.append(f"{os.getenv('PROJECT_ROOT')}src/") # noqa
from image_predict.data_module.kiva_data_module import KivaDataModule
from image_... | 2.09375 | 2 |
cotidia/team/migrations/0003_auto_20170902_1700.py | guillaumepiot/cotidia-team | 0 | 12764649 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-02 17:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('team', '0002_auto_20170901_1317'),
]
operations = [
migrations.... | 1.609375 | 2 |
plyxproto/helpers.py | sbconsulting/plyprotobuf | 0 | 12764650 | class LexHelper:
offset = 0
def get_max_linespan(self, p):
defSpan = [1e60, -1]
mSpan = [1e60, -1]
for sp in range(0, len(p)):
csp = p.linespan(sp)
if csp[0] == 0 and csp[1] == 0:
if hasattr(p[sp], "linespan"):
csp = p[sp].line... | 2.84375 | 3 |