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 |
|---|---|---|---|---|---|---|
scivision_treecrown_plugin/__init__.py | ots22/scivision-treecrown-plugin | 0 | 12789351 | <gh_stars>0
from .model import DeepForest, DetectreeRGB
| 1.023438 | 1 |
Python/write_Points.py | joaonizer/sLLGS | 0 | 12789352 | <filename>Python/write_Points.py
#!/usr/bin/env python3
import numpy as np
def write_Points(w , l , dx , d_or , cortes_y , i):
# Cria os vetores 'px', 'py' e 'd_or' a partir das entradas:
# w - largura da partícula_i
# l - comprimento da partícula_i
# d - distância entre a partícula i e i-1
# ... | 3.078125 | 3 |
whack_a_bug_api/__init__.py | timothyakinyelu/whack-a-bug-api | 0 | 12789353 | <gh_stars>0
from flask import Flask
from whack_a_bug_api.helpers.load_config import loadConfig
from flask_login import LoginManager
login_manager = LoginManager()
def createApp():
app = Flask(__name__, instance_relative_config=True)
mode = app.env
Config = loadConfig(mode)
app.config.from_object(... | 1.945313 | 2 |
setup.py | anonmyous-author/anonymous-code | 0 | 12789354 | from setuptools import find_packages, setup
with open("README.md") as readme_file:
readme = readme_file.read()
with open("requirements.txt") as reqs_file:
requirements = reqs_file.read().split("\n")
setup(
name="braincode",
version="0.1.0",
description="an investigation of computer program repres... | 1.578125 | 2 |
doc/LectureNotes/_build/jupyter_execute/chapter7.py | Shield94/Physics321 | 0 | 12789355 | #!/usr/bin/env python
# coding: utf-8
# # Non-inertial Frames, Translation and Rotating Coordinate Systems
#
#
# Let us quickly remind ourselves about the definition of a so-called **inertial frame of reference**.
#
# An inertial frame of reference in classical physics (and in special
# relativity as well) possesse... | 3.96875 | 4 |
apps/async_task/utils.py | goztrk/django-htk | 206 | 12789356 | <reponame>goztrk/django-htk
# Python Standard Library Imports
import base64
import json
def build_async_task_result(content, content_type, filename):
"""Builds an Async Task result from JSON
This is necessary if we want to return multiple values, as the result by default is just a plain string.
"""
p... | 2.53125 | 3 |
row_analysis/row_analysis.py | guohaoqiang/gcn | 0 | 12789357 | <gh_stars>0
import csv
import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from math import ceil, floor, sqrt
import glog as log
def load(f):
for i in f:
return i
def get_nnz(f):
row_offset = load(f)
ans = []
for i in range(1,len(row_offset)):
ans.append(... | 2.375 | 2 |
backend/tab_widget/item.py | JoyPang123/facial_identity_system | 6 | 12789358 | <gh_stars>1-10
import numpy as np
import torch
from model.triplet.loss import TripletLoss
import torchvision.transforms as transforms
from PyQt5 import QtWidgets
class CustomItem(QtWidgets.QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.pass_info = QtWidgets.QLabel()
... | 2.21875 | 2 |
bootimgpack/ui/main.py | hchyhchyxh/tools | 45 | 12789359 | <gh_stars>10-100
#!/usr/bin/python
# Filename main.py
# Main UI of bootimgpack
#
__author__ = '<EMAIL>'
import os
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from internal import bootimg
from Tkinter import *
import tkFileDialog
class Main:
def __init__(self):
... | 2.53125 | 3 |
Temperature/Temperature_Sites/Temperature_Sites/worker.py | listenzcc/GeoChina | 0 | 12789360 | # Data Worker
# %%
import os
import pandas as pd
import plotly.express as px
from pypinyin import lazy_pinyin
locations_url = 'https://blog.csdn.net/envbox/article/details/80290103'
filename = 'locations.json'
sync_folder = os.environ.get('Sync', '.')
mapbox = dict(
mapbox_accesstoken=open(os.path.joi... | 2.875 | 3 |
src/advent/solutions/day17.py | khwilson/advent2021 | 0 | 12789361 | <reponame>khwilson/advent2021
import itertools as its
import re
from collections import defaultdict
from ..solution import Solution
def run_sims(x1, x2, y1, y2):
# Making assumption y1 and y2 are both negative
max_vy = abs(y1) + 1
t_to_vy_in_range = defaultdict(list)
for vy in range(-max_vy, max_vy +... | 2.828125 | 3 |
src/apodeixi/knowledge_base/shutil_kb_store.py | ChateauClaudia-Labs/apodeixi | 0 | 12789362 | <gh_stars>0
import os as _os
from apodeixi.knowledge_base.isolation_kb_store import Isolation_KBStore_Impl
from apodeixi.knowledge_base.manifest_utils import ManifestUtils
from apodeixi.util.a6i_error import A... | 1.757813 | 2 |
example/is_main_example.py | jamesabel/ismain | 1 | 12789363 | from ismain import is_main
if is_main():
print("Hello from main.")
| 1.6875 | 2 |
Chapter 08/ch8_46.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | 0 | 12789364 | <gh_stars>0
import collections
q=collections.deque([10,20,30,40])
q.appendleft(0)
print(q)
#[0,10,20,30,40] | 2.5 | 2 |
pybie2d/misc/interior_points.py | dbstein/pybie2d | 11 | 12789365 | import numpy as np
import scipy as sp
import scipy.spatial
import matplotlib as mpl
import matplotlib.path
from ..kernels.high_level.cauchy import Cauchy_Layer_Apply
from ..point_set import PointSet
def find_interior_points(source, target, boundary_acceptable=False):
"""
quick finding of which points in targe... | 2.390625 | 2 |
{{cookiecutter.repo_name}}/python/{{cookiecutter.package_name}}/web/jinja_filters.py | havok2063/cookiecutter-marvin | 0 | 12789366 | # !usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
from __future__ import print_function, division, absolute_import
import flask
import jinja2
jinjablue = flask.Blueprint('jinja_filters', __name__)
@jinja2.contextfilter
@jinjablue.app_template_filter()
def split(context, val... | 2.5 | 2 |
Run_MK.py | cduranalarcon/MRR_MK_processing | 0 | 12789367 | <filename>Run_MK.py
import numpy as np
from netCDF4 import Dataset
import calendar, datetime, time, glob, os, sys, shutil
sys.path.append("lib/") # adding lib path
sys.path.append("lib/IMProToo/") # adding lib path
from MRR_functions import raw2snow # Process raw data into Doppler moments using MK2012
import core... | 2.21875 | 2 |
scripts/fast_sparCC.py | shafferm/fast_sparCC | 6 | 12789368 | <reponame>shafferm/fast_sparCC
#!/usr/local/bin/python2
import argparse
from biom import load_table
from sparcc_fast.sparcc_functions import sparcc
from sparcc_fast import utils
from sparcc_fast.bootstrap_correlations import bootstrap_correlations
__author__ = 'shafferm'
# TODO: implement sparse pandas dataframe
d... | 2.53125 | 3 |
models/tss_capsnet/model.py | StephenTerror/TSSCapsNet | 1 | 12789369 | # Copyright 2021 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 1.570313 | 2 |
df_browse/chunk_search_utils.py | petergaultney/df-browse | 0 | 12789370 | # chunk search utils
# from gui_debug import *
def not_at_end(lengthable, position, down):
return position < len(lengthable) if down else position > 0
def get_next_chunk(sliceable, start_position, chunk_size, down):
"""includes start_position, of size chunk_size"""
if not down:
chunk_beg = max(0... | 3.1875 | 3 |
foliant/preprocessors/base.py | foliant-docs/foliant | 105 | 12789371 | import re
from logging import Logger
from typing import Dict
import yaml
OptionValue = int or float or bool or str
class BasePreprocessor():
'''Base preprocessor. All preprocessors must inherit from this one.'''
# pylint: disable=too-many-instance-attributes
defaults = {}
tags = ()
@staticmetho... | 2.5 | 2 |
Algorithms/010_SUBS.py | ChaoticMarauder/Project_Rosalind | 0 | 12789372 | <gh_stars>0
def dna_motif(dna, motif):
m_len=len(motif)
list_motifs=[]
for i in range(len(dna)-m_len):
if(dna[i:i+m_len]==motif):
list_motifs.append(i+1)
return list_motifs
def main():
with open('datasets/rosalind_subs.txt') as input_data:
dna,motif=inp... | 3.40625 | 3 |
tests/integration/test_integration_delivery_method.py | pwitab/visma | 5 | 12789373 | <gh_stars>1-10
import pytest
from visma.models import DeliveryMethod
class TestDeliveryMethod:
@pytest.fixture()
def method(self):
yield DeliveryMethod.objects.all().first()
def test_list_delivery_methods(self):
methods = DeliveryMethod.objects.all()
assert len(methods) is not... | 2.25 | 2 |
app/models/comment.py | maricio41/homebase | 2 | 12789374 | from .db import db
from sqlalchemy.sql import func
class Comment(db.Model):
__tablename__ = "comments"
id = db.Column(db.Integer, nullable=False, primary_key=True)
commentBody = db.Column(db.String(255), nullable=False)
createdAt = db.Column(db.DateTime(timezone=True), nullable=False, server_default=... | 2.75 | 3 |
tests/helpers/response_test.py | Impactstory/jump-api | 15 | 12789375 | import json
import unittest
from jsonschema import validate, ValidationError
from views import app
import os
import urllib.parse
from urllib.parse import urlencode
def testget(url):
client = app.test_client()
client.testing = True
return json.loads(client.get(url).get_data(as_text=True))
class Response... | 2.84375 | 3 |
tests/test_updater.py | amjadsaadeh/dvc | 0 | 12789376 | <filename>tests/test_updater.py
import os
from tests.basic_env import TestDvc
class TestUpdater(TestDvc):
def test(self):
# NOTE: only test on travis CRON to avoid generating too much logs
travis = os.getenv('TRAVIS') == 'true'
if not travis:
return
cron = os.getenv('... | 2.234375 | 2 |
old/utils.py | NateThom/contrastive_learning | 0 | 12789377 | <filename>old/utils.py
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--image_path',
default='/home/nthom/Documents/datasets/CelebA/Img/',
# default='/home/nthom/Documents/datasets/CelebA/Img/partial_blackout/',
... | 2.296875 | 2 |
protostar/format/format1/exploit.py | RegaledSeer/netsecnoobie | 0 | 12789378 | import subprocess
FILE = "/opt/protostar/bin/format1"
#9 bytes
ADDRESS = "BBBB\x38\x96\x04\x08B"
def craft_payload(string):
string += ADDRESS
string += "%130$n"
return string
def main():
payload = craft_payload("", NUM_POINTERS)
subprocess.call([FILE, payload])
if __name... | 2.578125 | 3 |
lab/doodle/test03/testcode01.py | JoHyukJun/RasberryPiLab | 0 | 12789379 | <reponame>JoHyukJun/RasberryPiLab
import RPi.GPIO as GPIO
import time
REDLEDlist = [4, 17, 18, 27, 22, 23, 24, 25]
KEYPADlist = [6, 12, 13, 16, 19, 28, 26, 21]
def KeypadRead():
keypadnum = -1
for i in range(8):
if (not GPIO.input(KEYPADlist[1])):
keypadnum = i
break
return keypadnum
def LEDControl(keypad... | 3.296875 | 3 |
jokenpo.py | hlruffo/exercicios_Python | 1 | 12789380 | # coding: iso-8859-1 -*-
import random
from time import sleep
jogar ='sim'
print("_________________________")
print("!!Bem-vindo ao Jokenpo!!")
print("_________________________")
resultado = ['Vitória do CPU!', 'Houve um empate!', 'O usuário venceu!']
jogadas = ['pedra', 'papel', 'tesoura']
pontos_user = 0
... | 3.8125 | 4 |
dudu/2021-01-02.py | vollov/python-test | 1 | 12789381 | string_from_file = "aAu($requirementMet);g_pc.<strong>$233.45</strong>asdfdsaf<strong>$2.33</strong>op98795436jlkn lk;<strong>$15.22</strong>0989-0k;lkk0"
str=string_from_file
print(str)
# this function finds the price and return to caller
# - steps to do: aaaa, bbb
# parameters:
#
# return: a float number
def get... | 3.640625 | 4 |
scripts/create_ec2.py | noahhai/autovpn | 0 | 12789382 | from __future__ import print_function
import time
import boto
import boto.ec2
import sys
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
keyname=sys.argv[1]
instance_type=sys.argv[2]
region=sys.argv[3]
ami=sys.argv[4]
port=sys.argv[5]
if region:
conn_region = boto.ec2.connect_... | 2.25 | 2 |
workflow/assemble_page.py | ncsa/ng-notebook | 0 | 12789383 | import os
# in a real project, this script probably wouldn't make so many assumptions
# about the inputs and outputs
NG_DIST_DIR_PATH = '/ng-notebook/angular/dist/'
OUTFILE_PATH = '/hostmount/output/index.html'
# ng build's index.html will be a small, single-line file
with open(os.path.join(NG_DIST_DIR_PATH, 'index.h... | 2.46875 | 2 |
timeseries/timeseries/models/__init__.py | takotab/timeseriesAI2 | 0 | 12789384 | from .layers import *
from .ResNet import *
from .InceptionTime import * | 0.976563 | 1 |
leetcode/290.py | zhaipro/acm | 0 | 12789385 | <gh_stars>0
class Solution:
def wordPattern(self, pattern: str, s: str) -> bool:
r1 = {}
r2 = {}
worlds = s.split()
if len(worlds) != len(pattern):
return False
for c, w in zip(pattern, worlds):
if c in r1 and r1[c] != w:
retur... | 3.1875 | 3 |
tests/test/test_feature_class.py | vb64/oeg.feature.class | 0 | 12789386 | <gh_stars>0
"""
make test T=test_feature_class.py
"""
from . import TestBase
class TestFeatureClass(TestBase):
"""
oeg_feature_class
"""
@staticmethod
def test_class_gene():
"""
FeatureClass.GENE
"""
from oeg_feature_class import FeatureClass, size_class, is_in_limi... | 2.421875 | 2 |
back_office/helpers/diff.py | Envinorma/back-office | 0 | 12789387 | import string
from typing import List
from envinorma.models import ArreteMinisteriel, StructuredText
from text_diff import TextDifferences, text_differences
from unidecode import unidecode
_SIMPLE_CHARS = set(string.ascii_letters + string.digits + string.whitespace)
def _clean_line(line: str) -> str:
res = str(... | 2.53125 | 3 |
src/train_model.py | tahaceritli/ptype-cat-experiments | 0 | 12789388 | <filename>src/train_model.py
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import RobustScaler
from src import constants
import joblib
import numpy as np
def reshape_pred_scores(pred_scores):
y_probs = ()
for y_prob in pred_scores:
n = int(len(y_prob) / 4)
y_p... | 2.390625 | 2 |
setup.py | zozzz/yapic.di | 0 | 12789389 | <reponame>zozzz/yapic.di<gh_stars>0
#!/usr/bin/env python3
import os
import sys
from glob import glob
from os import path
from pathlib import Path
from setuptools import setup, Extension
from setuptools.command.test import test as TestCommand
from setuptools import Command
VERSION = "2.0.3"
define_macros = {
"YA... | 1.929688 | 2 |
simplebot.py | dmarx/VideoLinkBot | 7 | 12789390 | <filename>simplebot.py
"""
Reddit bot that scrapes a post for videoo links
and posts the collection in a table as a comment.
This script is designed for scraping a single post.
Run as follows:
import simplebot as s
s.login(_user=username, _pass=password)
post_aggregate_links(submisison_id)
To ... | 3.359375 | 3 |
Modules/Scripted/Home/HomeLib/plots.py | ebrahimebrahim/lungair-desktop-application | 0 | 12789391 | <reponame>ebrahimebrahim/lungair-desktop-application
import slicer, qt, vtk
from .constants import *
PLOT_TYPES = {
"line" : slicer.vtkMRMLPlotSeriesNode.PlotTypeLine,
"bar" : slicer.vtkMRMLPlotSeriesNode.PlotTypeBar,
"scatter" : slicer.vtkMRMLPlotSeriesNode.PlotTypeScatter,
"scatterbar" : slicer.vtkMRMLPlotS... | 1.992188 | 2 |
GibbsSampling_3.py | srinirajaraman/Machine-Learning | 0 | 12789392 | '''
Reference: Algorithm 10.1 from Gibbs sampling for a discrete undirected model
Book : <NAME>
Notation details:
vector - vec
matrix - mat
Author:<NAME>
Dept of EECE
Computational Ocularscience Lab
Date: 22/9/2016
'''
#Import packages
import numpy as np
import matplotlib.pyplot as plt
import math as m
import os ... | 2.6875 | 3 |
lists/linkedlist.py | santoshmano/pybricks | 0 | 12789393 | <reponame>santoshmano/pybricks
class Node:
def __init__(self, val, next=None):
self.val = val
self.next = next
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
def insertEnd(self, val):
n = Node(val)
if self.head == None:
s... | 3.96875 | 4 |
code_icc/utils/__init__.py | ThmCuong/IIC-Python3 | 0 | 12789394 | from . import cluster, segmentation, semisup | 0.960938 | 1 |
docker/src/clawpack-5.3.1/pyclaw/src/petclaw/solution.py | ian-r-rose/visualization | 11 | 12789395 | from clawpack import pyclaw
from clawpack.pyclaw.solution import Solution
class Solution(Solution):
""" Parallel Solution class.
"""
__doc__ += pyclaw.util.add_parent_doc(pyclaw.Solution)
def get_read_func(self, file_format):
from clawpack.petclaw import io
if file_format == 'petsc':
... | 2.53125 | 3 |
covid_cases/clients/sacoronavirus.py | praekeltfoundation/healthcheck | 0 | 12789396 | import re
from dataclasses import dataclass
from datetime import date, datetime
from typing import Iterator
import requests
from bs4 import BeautifulSoup
@dataclass
class Counters:
tests: int
positive: int
recoveries: int
deaths: int
vaccines: int
@dataclass
class CaseImage:
url: str
da... | 2.75 | 3 |
bert_sklearn/model/pytorch_pretrained/__init__.py | ezesalta/bert-sklearn | 0 | 12789397 | __version__ = "0.6.1"
from .tokenization import BertTokenizer, BasicTokenizer, WordpieceTokenizer
from .modeling import (BertConfig, BertModel, BertForPreTraining,
BertForMaskedLM, BertForNextSentencePrediction,
BertForSequenceClassification, BertForMultipleChoice,
... | 1.523438 | 2 |
scripts/argument_parser.py | k-nuth/kth | 20 | 12789398 | <reponame>k-nuth/kth
#!/usr/bin/env python3
# Copyright (c) 2016-2020 Knuth Project developers.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from argparse import ArgumentParser
from os.path import expanduser
def parse_args():... | 2.421875 | 2 |
tcex/resources/__init__.py | brikardtc/tcex | 0 | 12789399 | <gh_stars>0
# -*- coding: utf-8 -*-
"""Resources module for TcEx Framework"""
# flake8: noqa
from .resources import Resources
| 1.046875 | 1 |
pawpy/model_builder.py | robbie-manolache/kaggle-pawpular | 0 | 12789400 |
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #
# Module for building transfer learning framework #
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> #
import tensorflow as tf
import tensorflow.keras.layers as kl
import tensorflow.keras.regularizers as kreg
import tensorflow.keras.initializers as kini
def bu... | 2.421875 | 2 |
global_trainer.py | youngwoon/DnC-RL-Tensorflow | 9 | 12789401 | import os.path as osp
import os
import time
from collections import defaultdict
import numpy as np
import tensorflow as tf
import moviepy.editor as mpy
import tqdm
from contextlib import contextmanager
from mpi4py import MPI
import imageio
from baselines import logger
import baselines.common.tf_util as U
from baselin... | 1.8125 | 2 |
Studabase/tkinterGrid.py | skhadka007/STUDABASE | 0 | 12789402 | # GUI Tkinter grid file.
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk # pip install pillow (<- in terminal if not already installed)
import tkinter as tk
import csv
# OTHER PYTHON FILES (OURS)
import menuFunctions
import openData
# import moreFunctions
i... | 3.203125 | 3 |
2019/day15.py | dimkarakostas/advent-of-code | 2 | 12789403 | <filename>2019/day15.py
class Program:
def __init__(self, memory):
self.memory = memory
self.halted, self.outputs, self.idx, self.rel_base = False, [], 0, 0
def run(self, inputs):
used_inputs = 0
while self.idx < len(self.memory):
instruction = str(self.memory[self.i... | 3.328125 | 3 |
bin/downloadData/coingecko_download.py | albertodiazz/forecastingApp | 0 | 12789404 | '''
Lo que hace este script es bajar la data de https://www.coingecko.com por medio de su API con ayuda del
data.JSON, el cual funge como una lista de las crypto que acutlamente tradeo, esa lista es actualizada
manualmente. En cuanto a los precios, no baja margenes de precio de entrada y cierre solo es data para una pr... | 3.4375 | 3 |
screenpy/actions/select.py | pjbarbatsis/screenpy | 0 | 12789405 | from typing import Union
from selenium.webdriver.support.ui import Select as SelSelect
from ..actor import Actor
from ..pacing import beat, MINOR
from ..target import Target
class Select:
"""
Selects an option from a dropdown menu. This is a superclass that will
create the correct specific Select action... | 3.5625 | 4 |
lec2-1.py | cutz-j/PyMC | 0 | 12789406 | import pymc as pm
import matplotlib.pyplot as plt
import numpy as np
plt.rc('font', family='Malgun Gothic')
lambda_ = pm.Exponential("poisson_param", 1)
data_generator = pm.Poisson("data_generater", lambda_)
data_plus_one = data_generator + 1
print(lambda_.children)
print(data_generator.parents)
# value
print(lambda... | 2.484375 | 2 |
dicom_review/conf/urls.py | chop-dbhi/django-dicom-review | 6 | 12789407 | import re
from django.conf.urls import url, patterns, include
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
from dicom_review.views import review
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', review),
url(r'^login/$', 'django.contr... | 1.875 | 2 |
tests/common/test_op/ascend/fake_quant_with_min_max_args.py | tianjiashuo/akg | 286 | 12789408 | <reponame>tianjiashuo/akg<gh_stars>100-1000
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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
#... | 2.515625 | 3 |
medial_axis/__init__.py | dipaco/cpma | 2 | 12789409 | <filename>medial_axis/__init__.py<gh_stars>1-10
from .cpma import cpma, cpma_3d
| 1.164063 | 1 |
setup.py | bijulette/ParallelFDTD | 4 | 12789410 | <filename>setup.py<gh_stars>1-10
import setuptools
import os
import shutil
import subprocess
from setuptools import Extension
from setuptools.command.build_py import build_py
from setuptools.command.build_ext import build_ext
from setuptools.command.install_lib import install_lib
PACKAGE_NAME = 'pyParallelFDTD'
cla... | 2.03125 | 2 |
PythonProjects/TinderLike/main.py | carlosmpr/CodePortafolio | 0 | 12789411 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
chrome_driver_location = "E:\Development\chromedriver.exe"
driver = webdriver.Chrome(executable_path=chrome_driver_location)
driver.get("https://tinder.com/app/recs")
base_window = driver.window_handles[0]
login = driver.find_ele... | 2.765625 | 3 |
analytics/object/language.py | dpatel257/Smart-City-Sample | 126 | 12789412 | #!/usr/bin/python3
text={
"object-detection": "object-detection",
"svcq-counting": "svcq-counting",
}
| 1.046875 | 1 |
src/bot/core.py | mdcg/youtube-telegram-webhook | 1 | 12789413 | import sys
from src.bot import logger
from src.bot.messages import (
AVAILABLE_COMMANDS_MESSAGE,
GREETINGS_MESSAGE,
NON_INFORMED_CHANNEL_ID_MESSAGE,
SUBSCRIPTION_ERROR_MESSAGE,
SUBSCRIPTION_MESSAGE,
UNKNOWN_MESSAGE,
)
from src.bot.requester import subscribe_in_pubsubhubbub
from src.database.uti... | 2.484375 | 2 |
benchmark/citation/patgcn.py | ecom-research/pytorch_geometric | 1 | 12789414 | <filename>benchmark/citation/patgcn.py<gh_stars>1-10
import argparse
import torch
from torch import nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
import torch_sparse
import MinkowskiEngine as ME
from datasets import get_planetoid_dataset
from train_eval import run, random_planetoid_splits
... | 2.109375 | 2 |
common/HtmlUtils.py | loveflycforever/TypeY | 0 | 12789415 | import datetime
import os
import certifi
import urllib3
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
# 写入文件
def write_file(file_path, text_content):
with open(file_path, 'w', encoding='utf-8') as f:
f.write(datetime.datetime.now().strftime('<!-- [store... | 2.796875 | 3 |
coursera.py | ChutianShen/pointnet_kitti | 0 | 12789416 | <filename>coursera.py
import json
db = []
query_content_dict_index = {}
query_content_dict_index['id'] = 0
query_content_dict_index['last'] = 1
query_content_dict_index['first'] = 2
query_content_dict_index['location'] = 3
query_content_dict_index['active'] = 4
location_dict_index = {}
location_dict_index['city'] = ... | 3.78125 | 4 |
pomito/plugins/task/trello.py | codito/pomito | 1 | 12789417 | # -*- coding: utf-8 -*-
"""Trello plugin for pomito."""
import logging
from trello import TrelloClient
from pomito.plugins import task
from pomito.task import Task
__all__ = ['TrelloTask']
logger = logging.getLogger('pomito.plugins.task.trello')
def _create_trello_client(api_key, api_secret):
"""Create defau... | 2.5 | 2 |
binding.gyp | royalpinto/node-cares | 10 | 12789418 | <reponame>royalpinto/node-cares
{
"targets": [{
"variables": {
# Define `gcc_version` if it's not defined already
# as it is getting used below.
"gcc_version%": "unknown",
},
"target_name": "cares_wrap",
"include_dirs": [
"<!(node -e... | 1.398438 | 1 |
Source/RenderPasses/TemporalDelayPass/Testing/testTemporalDelayPass.py | jeongsoopark/Falcor | 2 | 12789419 | <reponame>jeongsoopark/Falcor
def test_temporal_delay():
imageLoader = RenderPass("ImageLoader", {'filename': 'smoke-puff.png', 'mips': False, 'srgb': True})
depthPass = RenderPass("DepthPass")
forwardLightingPass = RenderPass("ForwardLightingPass")
temporalDelayPass = RenderPass("TemporalDelayPass", {"... | 2.328125 | 2 |
Leetcode/Python/_1534.py | Xrenya/algorithms | 1 | 12789420 | class Solution:
def countGoodTriplets(self, arr: List[int], a: int, b: int, c: int) -> int:
# Brute force solution
counter = 0
lenght = len(arr)
for i in range(lenght-2):
for j in range(lenght-1):
for k in range(lenght):
if i<j and j<k ... | 3 | 3 |
nadl/core/tensor.py | heytanay/nadl | 13 | 12789421 | <filename>nadl/core/tensor.py
import numpy as np
from ..core.ops import HiddenOps
from ..other.utils import Utils
class Tensor:
"""
Core Tensor Class
This class will be responsible for all the heavy lifting.
"""
def __init__(self, data: np.ndarray, requires_grad: bool=True, _children: tuple=(), _op... | 2.578125 | 3 |
041.py | joserc87/project-euler | 0 | 12789422 | <filename>041.py
"""
Project Euler Problem 41
========================
We shall say that an n-digit number is pandigital if it makes use of all
the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital
and is also prime.
What is the largest n-digit pandigital prime that exists?
"""
# THOUGHTS:
#
# Th... | 4.15625 | 4 |
src/main.py | Will2065/uestc-temperature | 0 | 12789423 | <reponame>Will2065/uestc-temperature
import os
import time
from reporter import Reporter
if __name__ == "__main__":
print(f'[{time.strftime("%F %H:%M:%S")}]', end=" ")
cookies = os.environ.get("COOKIES")
if cookies == None:
raise Exception("session id not provided")
else:
cookies = co... | 2.53125 | 3 |
rollbar/contrib/django/tests.py | arthurio/pyrollbar | 177 | 12789424 | """
Unit tests
"""
from django.test import TestCase
from django.conf import settings
class BasicTests(TestCase):
def test_configuration(self):
"""
Test that the configuration is sane.
"""
self.assertTrue('ROLLBAR' in dir(settings),
msg='The ROLLBAR setting is not present... | 2.6875 | 3 |
util.py | tamamiyasita/Roguelike-Tutorial-2020 | 0 | 12789425 | <reponame>tamamiyasita/Roguelike-Tutorial-2020<filename>util.py
import arcade
from random import randint
from constants import *
# from data import IMAGE_ID
from functools import wraps
import time
def exp_calc(x=58, max_level=50, ratio=1.2, constant=40):
result = {}
result[1] = 0
for i in range(2,max_lev... | 3.359375 | 3 |
main.py | JAkkerman/EvolutionaryComputing | 1 | 12789426 | <reponame>JAkkerman/EvolutionaryComputing
import sys, os
sys.path.insert(0, 'evoman')
from environment import Environment
# from demo_controller import player_controller
# from controller import Controller
from test_controller import test_controller
import numpy as np
def init():
"""
Initialise game environm... | 2.71875 | 3 |
server/src/test/deployments/integration_tests/case01_direct/lab_config.py | zstars/weblabdeusto | 0 | 12789427 | <gh_stars>0
##################################
# Laboratory Server configuration #
##################################
laboratory_assigned_experiments = {
'exp1:dummy1@Dummy experiments':
{
'coord_address': 'experiment_dummy1:myprocess@myhost',
'checkers': ()
... | 1.4375 | 1 |
tests/test_pydantic_config.py | Validus-Risk-Management/aws-appconfig-pydantic | 1 | 12789428 | import io
import json
import socket
from typing import Dict, Tuple, Union
import boto3
import pytest
import yaml
from botocore.client import BaseClient
from botocore.response import StreamingBody
from botocore.session import Session
from botocore.stub import Stubber
from pydantic import BaseModel, ValidationError
from... | 2.09375 | 2 |
pyramid_translogger/compat.py | podhmo/pyramid_translogger | 0 | 12789429 | <gh_stars>0
# -*- coding:utf-8 -*-
import sys
import types
# True if we are running on Python 3.
PY3 = sys.version_info[0] == 3
if PY3: # pragma: no cover
string_types = str,
integer_types = int,
class_types = type,
text_type = str
binary_type = bytes
long = int
else:
string_types = bases... | 2.015625 | 2 |
matchsticks/game_types.py | nikihowe/matchsticks | 0 | 12789430 | <filename>matchsticks/game_types.py
# (c) <NAME> 2021
from typing import Optional
Point = tuple[float, float]
Line = tuple[Point, Point]
Move = Optional[tuple[int, int, int]]
| 2 | 2 |
Planning/Jpg2TFRecords.py | whong92/3D_DL | 35 | 12789431 | <filename>Planning/Jpg2TFRecords.py
import time
import tensorflow as tf
from six.moves import cPickle as pickle
import numpy as np
import matplotlib.pyplot as plt
import skimage.transform as skt
import skimage.io as io
import os
import imageio
root_folder = 'D:\\PycharmProjects\\product-image-dataset-v0.1' \
... | 2.4375 | 2 |
ion/services/dm/utility/provenance.py | ooici/coi-services | 3 | 12789432 | #!/usr/bin/env python
'''
@file ion/services/dm/utility/provenance.py
Contains an assortment of utilities for determining provenance
'''
from coverage_model import ParameterFunctionType
'''
An example of using graph()
Here's the output of the CTDMO data product's parameter dictionary
><> graph(pdict, 'seawater_den... | 2.8125 | 3 |
classes/modules/multiframe/ctccnet2/ModelCTCCNet2.py | matteo-rizzo/cctcc | 0 | 12789433 | <reponame>matteo-rizzo/cctcc<gh_stars>0
from typing import Tuple, List
import torch
from auxiliary.settings import NUM_STAGES
from classes.modules.common.BaseModel import BaseModel
from classes.modules.multiframe.ctccnet2.CTCCNet2 import CTCCNet2
class ModelCTCCNet2(BaseModel):
def __init__(self):
supe... | 2.328125 | 2 |
tests/test_dimensions.py | man-of-eel/dpgv4 | 3 | 12789434 | <filename>tests/test_dimensions.py
# pylint: disable=missing-docstring
from dpgv4 import calculate_dimensions
from .util import sample_filename
def test_dimensions() -> None:
input_filename = sample_filename("World - 2.mp4")
assert calculate_dimensions(input_filename) == (256, 144)
| 2.109375 | 2 |
flight_booking_app/urls.py | Celoka/flight_booking_system | 3 | 12789435 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import FlightViewSet,TicketViewSet
router = DefaultRouter()
router.register('ticket', TicketViewSet)
router.register('flight', FlightViewSet)
urlpatterns = [
path('', include(router.urls))
]
| 1.84375 | 2 |
18Host/TMA4120/latex/PyplotTesting/Scripts/main.py | MarcusTL12/School | 0 | 12789436 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib2tikz.save as tikz_save
import math
def derivative(y, h, n: int=1):
if n == 1:
return lambda x: (y(x + h) - y(x - h)) / (2 * h)
else:
return derivative(derivative(y, h, n - 1), h, 1)
def integral(y, h, a, b):
ret = 0
sgn = 1
if a > b:
... | 3.078125 | 3 |
magic_proxy/__init__.py | restran/magic-proxy | 1 | 12789437 | <filename>magic_proxy/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Created by restran on 2017/9/15
from __future__ import unicode_literals, absolute_import
__version__ = '0.1.0'
| 1.140625 | 1 |
jnpr/openclos/tests/unit/test_ztp.py | sysbot/OpenClos | 1 | 12789438 | <filename>jnpr/openclos/tests/unit/test_ztp.py<gh_stars>1-10
'''
Created on Sep 11, 2014
@author: moloyc
'''
import unittest
from flexmock import flexmock
from jnpr.openclos.ztp import ZtpServer
from test_model import createPod, createDevice, createPodDevice
class TestZtp(unittest.TestCase):
def setUp(self):
... | 2.09375 | 2 |
scripts/verify_items.py | ramalingam-cb/testrunner | 0 | 12789439 | #!/usr/bin/env python
"""Verify items exist, or were deleted from couchbase using an on disk kvstore"""
import time
import sys
import getopt
import pickle
import re
import mc_bin_client
import exceptions
import socket
from memcached.helper.data_helper import VBucketAwareMemcached
from membase.api.rest_client import R... | 2.453125 | 2 |
components/collector/tests/source_collectors/trello/test_issues.py | kargaranamir/quality-time | 33 | 12789440 | """Unit tests for the Trello issues collector."""
from datetime import datetime
from .base import TrelloTestCase
class TrelloIssuesTest(TrelloTestCase):
"""Unit tests for the Trello issues collector."""
METRIC_TYPE = "issues"
async def test_issues(self):
"""Test that the number of issues and t... | 2.953125 | 3 |
tests/cpfcnpj_tests.py | vindi/pycpfcnpj | 0 | 12789441 | <reponame>vindi/pycpfcnpj
import unittest
from pycpfcnpj import cpfcnpj
class CPFCNPJTests(unittest.TestCase):
"""docstring for CPFCNPJTests"""
def setUp(self):
self.valid_cpf = '11144477735'
self.invalid_cpf = '11144477736'
self.invalid_cpf_size = '111444777'
self.valid_cnpj =... | 2.578125 | 3 |
ml-agents/mlagents/trainers/bc_custom/trainer.py | icaro56/ml-agents | 0 | 12789442 | <reponame>icaro56/ml-agents
# # Unity ML-Agents Toolkit
# ## ML-Agent Learning (Imitation)
# Contains an implementation of Behavioral Cloning Algorithm
import logging
import os
import numpy as np
import tensorflow as tf
import time
from collections import deque
from mlagents.envs import AllBrainInfo, BrainInfo
from ... | 2.1875 | 2 |
backend/kesaseteli/common/tests/factories.py | jannetasa/yjdh | 0 | 12789443 | <gh_stars>0
import random
from datetime import date, timedelta
import factory
from shared.common.tests.factories import UserFactory
from applications.enums import (
ApplicationStatus,
ATTACHMENT_CONTENT_TYPE_CHOICES,
AttachmentType,
HiredWithoutVoucherAssessment,
SummerVoucherExceptionReason,
)
fr... | 2.140625 | 2 |
bench.py | deseretdigital/statsite-proxy | 2 | 12789444 | <gh_stars>1-10
import socket
import time
import random
NUM = 1024 * 1024
KEYS = ["test", "foobar", "zipzap"]
VALS = [32, 100, 82, 101, 5, 6, 42, 73]
METS = []
for x in xrange(NUM):
key = random.choice(KEYS)
val = random.choice(VALS)
METS.append("%s:%f|c|@123\n" % (key, val))
s = socket.socket()
s.connect... | 2.375 | 2 |
backend/project_requests/apps.py | mnieber/taskboard | 0 | 12789445 | <reponame>mnieber/taskboard<filename>backend/project_requests/apps.py<gh_stars>0
from django.apps import AppConfig
class ProjectRequestsConfig(AppConfig):
name = "project_requests"
| 1.203125 | 1 |
ace/system/database/request_tracking.py | ace-ecosystem/ace2-core | 0 | 12789446 | <reponame>ace-ecosystem/ace2-core<gh_stars>0
# vim: ts=4:sw=4:et:cc=120
import json
import datetime
from operator import itemgetter
from typing import Optional, Union
import ace
from ace.analysis import Observable, AnalysisModuleType
from ace.system.base import AnalysisRequestTrackingBaseInterface
from ace.system.d... | 2.046875 | 2 |
src/selection/AttributeSelector.py | lyonva/Nue | 0 | 12789447 | <gh_stars>0
from utils import ps
class AttributeSelector(ps):
def __init__(self, name, as_class, parameters):
self.name = name
self.as_class = as_class
self.parameters = parameters
| 2.328125 | 2 |
model/attack.py | Michaeltaoma/SecureCovid | 1 | 12789448 | <reponame>Michaeltaoma/SecureCovid<filename>model/attack.py
import torch.nn as nn
class AttackModel(nn.Module):
def __init__(self, n_feature, n_hidden, n_output):
super(AttackModel, self).__init__()
# Number of input features is 12.
self.layer_1 = nn.Linear(n_feature, n_hidden)
se... | 2.828125 | 3 |
third_party/buildbot_slave_8_4/buildslave/commands/git.py | bopopescu/build | 0 | 12789449 | <reponame>bopopescu/build<filename>third_party/buildbot_slave_8_4/buildslave/commands/git.py
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This progr... | 1.84375 | 2 |
tests/test_backend_sql.py | savi-dev/keystone | 0 | 12789450 | <filename>tests/test_backend_sql.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 1.8125 | 2 |