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 |
|---|---|---|---|---|---|---|
script.py | OJP98/Text-Prediction | 1 | 34100 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %% [markdown]
# # Laboratorio #3 - Predicción de textos
#
# * <NAME> - 17315
# * <NAME> - 17509
# * <NAME> - 17088
# %%
from keras.layers import Embedding
from keras.layers import LSTM
from keras.layers import Dense
from keras.mode... | 2.796875 | 3 |
notebook/str_compare_re.py | vhn0912/python-snippets | 174 | 34101 | <filename>notebook/str_compare_re.py
import re
s = 'aaa-AAA-123'
print(re.search('aaa', s))
# <re.Match object; span=(0, 3), match='aaa'>
print(re.search('xxx', s))
# None
print(re.search('^aaa', s))
# <re.Match object; span=(0, 3), match='aaa'>
print(re.search('^123', s))
# None
print(re.search('aaa$', s))
# Non... | 3.453125 | 3 |
pytype/__version__.py | jjedele/pytype | 0 | 34102 | <filename>pytype/__version__.py
# pylint: skip-file
__version__ = '2018.12.21'
| 1.085938 | 1 |
keybindings/autokey/data/Mac/refresh.py | guoyiteng/linux-for-macos-user | 1 | 34103 | <filename>keybindings/autokey/data/Mac/refresh.py
store.set_global_value('hotkey', '<meta>+r')
if re.match('.*(Hyper)', window.get_active_class()):
logging.debug('terminal refresh buffer')
engine.set_return_value('<ctrl>+<shift>+r')
else:
logging.debug('normal')
engine.set_return_value('<ctrl>+r')
engin... | 1.828125 | 2 |
mednickdb_pyapi/test_mednickdb_pyapi.py | MednickLab/python_module | 0 | 34104 | <filename>mednickdb_pyapi/test_mednickdb_pyapi.py<gh_stars>0
from mednickdb_pyapi.mednickdb_pyapi import MednickAPI
import pytest
import time
user = '<EMAIL>'
password = '<PASSWORD>'
server_address = 'http://saclab.ss.uci.edu:8000'
def test_login():
"""Test login, this will always pass until we deal with login"... | 2.25 | 2 |
passl/hooks/evaluate_hook.py | LielinJiang/PASSL | 0 | 34105 | <reponame>LielinJiang/PASSL<filename>passl/hooks/evaluate_hook.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 |
npu/core/common.py | xloem/npu | 0 | 34106 | import hashlib
import json
import math
import os
import dill
import base64
from sys import exit
import requests
from bson import ObjectId
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
#from cryptography.hazmat.primitives.asymmetric import padding
#from cryptography... | 1.929688 | 2 |
BZOJ/BZOJ1349.py | xehoth/OnlineJudgeCodes | 7 | 34107 | import math
print(int(math.ceil(math.sqrt(input()))))
| 2.53125 | 3 |
apps/order/migrations/0002_auto_20180710_0937.py | jakejie/ShopPro | 1 | 34108 | <reponame>jakejie/ShopPro
# Generated by Django 2.0.7 on 2018-07-10 09:37
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | 1.710938 | 2 |
discordbot.py | yutoring/discordpy-startup | 0 | 34109 | from discord.ext import commands
import tasks
from datetime import datetime
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
# 接続に必要なオブジェクトを生成
client = discord.Client()
#投稿する日時
dateTimeList = [
'2019/11/19 18:09',
'2019/11/19 18:15',
'2019/11/19 18:20',
]
#... | 2.546875 | 3 |
model-optimizer/unit_tests/extensions/ops/sparse_reshape_test.py | monroid/openvino | 2,406 | 34110 | <reponame>monroid/openvino
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from extensions.ops.sparse_reshape import SparseReshape
from mo.front.common.partial_infer.utils import int64_array
from mo.graph.graph import Node
from unit_tests.utils.gra... | 1.96875 | 2 |
app/utils/sqlalchemy_helpers.py | maricaantonacci/slat | 0 | 34111 | <gh_stars>0
# Copyright (c) I<NAME> (INFN). 2020-2021
#
# 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 ... | 2.296875 | 2 |
python/uw/like/scalemodels.py | coclar/pointlike | 1 | 34112 | """ Code to implement ScaleFactor:: decorator supported
in gtlike.
The gtlike feature is documented here:
https://confluence.slac.stanford.edu/display/ST/Science+Tools+Development+Notes?focusedCommentId=103582318#comment-103582318
Author: <NAME>
"""
import operator
from copy import deepcopy
... | 2.234375 | 2 |
neighbour/forms.py | Nobella-Nyarari-Ejiofor/Neighbourood | 0 | 34113 | <reponame>Nobella-Nyarari-Ejiofor/Neighbourood
from django.contrib.auth.models import User
from django import forms
import neighbour
from .models import Business, Profile , Neighbourhood , Posts
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ['user']
class NeighbourhoodForm(forms... | 2.15625 | 2 |
src/gp_server/utils/paths_overlay_filter.py | hellej/hope-green-path-server | 5 | 34114 | """
This module provides functionality for filtering out paths with nearly identical geometries.
"""
from typing import List, Tuple, Union
from gp_server.app.path import Path
from gp_server.app.logger import Logger
def __get_path_overlay_candidates_by_len(
param_path: Path,
all_paths: List[Path],
len_dif... | 2.796875 | 3 |
ADT/Homework 4/heapsort_variant.py | Devang-25/CS-Jacobs | 0 | 34115 | <filename>ADT/Homework 4/heapsort_variant.py
# Defining the left function
def left(i):
return 2*i+1
# Defining the right function
def right(i):
return 2*i+2
# Defining the parent node function
def parent(i):
return (i-1)//2
# Max_Heapify
def max_heapify(arr,n,i):
l=left(i)
r=right(i)
la... | 3.65625 | 4 |
kunquat/tracker/ui/model/keymapmanager.py | kagu/kunquat | 13 | 34116 | <filename>kunquat/tracker/ui/model/keymapmanager.py
# -*- coding: utf-8 -*-
#
# Authors: <NAME>, Finland 2014
# <NAME>, Finland 2016-2019
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waiv... | 2.046875 | 2 |
make_instance.py | github-nakasho/ohzeki_method | 0 | 34117 | <reponame>github-nakasho/ohzeki_method
#!/usr/bin/env python3
import numpy as np
def make_instance():
# set the number of random numbers
num_rands = 2000
# set K
K = 5
# set random numbers
rands = np.random.rand(num_rands)
# optimal solution
rands_sort = sorted(rands)
optimal_obj ... | 3.171875 | 3 |
ros/src/tl_detector/light_classification/tl_classifier.py | Kuan-HC/Udacity-CarND-Capstone | 0 | 34118 | <filename>ros/src/tl_detector/light_classification/tl_classifier.py
from styx_msgs.msg import TrafficLight
import rospy
import tensorflow as tf
import numpy as np
import cv2
from PIL import Image
# for visualization
#import matplotlib.pyplot as plt
from PIL import ImageDraw
from PIL import ImageColor
import os
class T... | 2.671875 | 3 |
template/plugin/datafile.py | vaMuchenje/Template-Python | 1 | 34119 | #
# The Template-Python distribution is Copyright (C) <NAME> 2007-2008,
# derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy
# Wardley. All Rights Reserved.
#
# The file "LICENSE" at the top level of this source distribution describes
# the terms under which this file may be distributed.
#
impor... | 2.796875 | 3 |
src/tests/colorsensor.py | duckida/legosort | 3 | 34120 | import RPi.GPIO as GPIO
import time
s2 = 26
s3 = 27
signal = 17
NUM_CYCLES = 10
def setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(signal,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(s2,GPIO.OUT)
GPIO.setup(s3,GPIO.OUT)
print("\n")
def loop():
temp = 1
while(1):
GPIO.output(s2,GPIO.LOW)
... | 3.375 | 3 |
example/example2.py | chrisseto/Breeze | 0 | 34121 | import datetime
import peewee as p
from breeze import App, Resource, Serializable
db = p.SqliteDatabase('users.db')
class UserModel(p.Model):
username = p.CharField(unique=True)
password = p.CharField()
email = p.CharField()
join_date = p.DateTimeField(default=datetime.datetime.now)
class Met... | 2.46875 | 2 |
sqlalchemy_jsonapi/constants.py | jimbobhickville/sqlalchemy-jsonapi | 73 | 34122 | <reponame>jimbobhickville/sqlalchemy-jsonapi
"""
SQLAlchemy-JSONAPI
Constants
<NAME>
MIT License
"""
try:
from enum import Enum
except ImportError:
from enum34 import Enum
class Method(Enum):
""" HTTP Methods used by JSON API """
GET = 'GET'
POST = 'POST'
PATCH = 'PATCH'
DELETE = 'DELET... | 2.125 | 2 |
1.-MapReduce Spark/B-Datos Meteorologicos/Meteorologico_3.py | gorco/sgdi-lab | 0 | 34123 | # coding=utf-8
# Este fichero generado para la asignatura SGDI
# Practica 1 MapReduce Y Spark, Ejercicio B.3
# Autores: <NAME> y <NAME>
# <NAME> y <NAME> declaramos que esta solución es fruto exclusivamente de nuestro
# trabajo personal. No hemos sido ayudados por ninguna otra persona ni hemos obtenido la solución de... | 2.875 | 3 |
components/studio/deployments/admin.py | ScilifelabDataCentre/stackn | 0 | 34124 | <gh_stars>0
from django.contrib import admin
from .models import DeploymentDefinition, DeploymentInstance, HelmResource
admin.site.register(HelmResource)
admin.site.register(DeploymentDefinition)
admin.site.register(DeploymentInstance)
| 1.210938 | 1 |
edinet_baseline_hourly_module/edinet_models/pyEMIS/ConsumptionModels/constantMonthlyModel.py | BeeGroup-cimne/module_edinet | 0 | 34125 | #This is a class because it stores its model parameters and has a 'prediction' function which returns predictions for input data
import numpy as np
from baseModel import baseModel, ModellingError as me
from datetime import datetime
import pandas as pd
class ModellingError(me): pass
class ConstantMonthlyModel(baseMode... | 3.390625 | 3 |
geojson_rewind/rewind.py | chris48s/geojson-rewind | 15 | 34126 | <gh_stars>10-100
import argparse
import copy
import json
import logging
import math
import sys
RADIUS = 6378137
def rewind(geojson, rfc7946=True):
gj = copy.deepcopy(geojson)
_check_crs(geojson)
if isinstance(gj, str):
return json.dumps(_rewind(json.loads(gj), rfc7946))
else:
return _... | 2.578125 | 3 |
corehq/apps/domain/project_access/middleware.py | kkrampa/commcare-hq | 1 | 34127 | <gh_stars>1-10
from __future__ import absolute_import
from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.utils.deprecation import MiddlewareMixin
from corehq.apps.domain.project_access.models import SuperuserProjectEntryRecord, ENTRY_RECORD_FREQUENCY
from corehq.util.quickcach... | 1.929688 | 2 |
languages/Natlab/src/natlab/tame/builtin/gen/classProp.py | dherre3/mclab-core | 11 | 34128 | <gh_stars>10-100
# DEPRECATED - THERE IS A PARSER FOR THE CLASS LANGUAGE IN JAVA NOW
# TODO -delete
# processing Class tag - class propagation language
import processTags
import sys
# definition of the class propagation language - in a dictionary
# helper method - converts numbers to a MatlabClassVar
def convertNum(... | 2.6875 | 3 |
python/rrc_simulation/pinocchio_utils.py | prstolpe/rrc_simulation | 39 | 34129 | <reponame>prstolpe/rrc_simulation
import numpy as np
import pinocchio
class PinocchioUtils:
"""
Consists of kinematic methods for the finger platform.
"""
def __init__(self, finger_urdf_path, tip_link_names):
"""
Initializes the finger model on which control's to be performed.
... | 2.8125 | 3 |
expense/admin.py | jramnai/ExpenseCalculator | 1 | 34130 | <filename>expense/admin.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Category, Expense
# Register your models here.
admin.site.register(Category)
admin.site.register(Expense)
| 1.179688 | 1 |
setup.py | dbots-pkg/dbots.py | 8 | 34131 | <gh_stars>1-10
import setuptools
import re
requirements = []
with open('requirements.txt') as f:
requirements = f.read().splitlines()
version = ''
with open('dbots/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not version:
raise Run... | 1.632813 | 2 |
ml-work/test.py | numankh/HypeBeastDashboard | 0 | 34132 | # linear regression feature importance
from sklearn.datasets import make_regression
from sklearn.linear_model import LinearRegression
from matplotlib import pyplot
# define dataset
X, y = make_regression(n_samples=1000, n_features=10, n_informative=5, random_state=1)
# define the model
model = LinearRegression()
# fit ... | 4 | 4 |
parl/utils/logger.py | TomorrowIsAnOtherDay/PARL | 1 | 34133 | # Copyright (c) 2018 PaddlePaddle Authors. 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 app... | 2.015625 | 2 |
venv/lib/python2.7/site-packages/nano-1.0a3-py2.7.egg/nano/blog/settings.py | 784134748/kubernetes-install | 0 | 34134 | from django.conf import settings
NANO_BLOG_TAGS = None
# Optional support for django-taggit
try:
if ('taggit' in settings.INSTALLED_APPS
and getattr(settings, 'NANO_BLOG_USE_TAGS', False)):
import taggit as NANO_BLOG_TAGS
except ImportError:
pass
NANO_BLOG_SPECIAL_TAGS = getattr(settings, 'N... | 1.640625 | 2 |
scripts/get_article.py | theblueskies/prose | 2,906 | 34135 | <reponame>theblueskies/prose
import os
from newspaper import Article
url = 'http://fox13now.com/2013/12/30/new-year-new-laws-obamacare-pot-guns-and-drones/'
article = Article(url)
article.download()
article.parse()
with open(os.path.join('testdata', 'article.txt'), 'w') as f:
f.write(article.text)
| 2.953125 | 3 |
examples/example_02.py | vesche/juc2 | 0 | 34136 | #!/usr/bin/env python
"""
juc2/examples/example_02.py
Move a rectangle across the terminal. <3
"""
from juc2 import art, Stage
stage = Stage(height=40, width=80, frame=True)
rectangle = art.Shapes.Rectangle(width=10, height=5, x=5, y=5)
while True:
stage.draw(rectangle, FPS=4)
if rectangle.x < 60:
... | 3.3125 | 3 |
codes/att_reader/layers.py | caglar/Attentive_reader | 31 | 34137 | <reponame>caglar/Attentive_reader<filename>codes/att_reader/layers.py
import theano
import theano.tensor as tensor
import numpy
from att_reader.utils import prfx, norm_weight, ortho_weight
from core.utils import dot, sharedX
from core.commons import Sigmoid, Tanh, Rect, global_trng, Linear, ELU
"""
We have functi... | 2.171875 | 2 |
server/itk_tube.py | KitwareMedical/itk-tube-web | 3 | 34138 | r"""
This module is a ITK Web server application.
The following command line illustrates how to use it::
$ python .../server/itk-tube.py --data /.../path-to-your-data-file
--data
Path to file to load.
Any WSLink executable script comes with a set of standard arguments that ca... | 2.5 | 2 |
SimplE/tester.py | dertilo/knowledge-graph-reasoning | 0 | 34139 | <filename>SimplE/tester.py
import torch
from tqdm import tqdm
from dataset import Dataset
import numpy as np
from measure import Measure
from os import listdir
from os.path import isfile, join
class Tester:
def __init__(self, dataset, model_path, valid_or_test):
self.device = torch.device("cuda:0" if tor... | 2.46875 | 2 |
eulxml/xmlmap/cerp.py | ig0774/eulxml | 19 | 34140 | # file eulxml/xmlmap/cerp.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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.03125 | 2 |
nestfit/test/__init__.py | autocorr/nestf | 11 | 34141 | <reponame>autocorr/nestf
#!/usr/bin/env python3
import warnings
from pathlib import Path
from spectral_cube import SpectralCube
from astropy.wcs import FITSFixedWarning
DATA_PATH = Path(__file__).parent / "data"
NH3_RMS_K = 0.35
def get_ammonia_cube(trans_id=1):
assert trans_id in (1, 2)
transition = f"{... | 2.46875 | 2 |
djangopeople/djangopeople/management/commands/recluster.py | timgraham/djangopeople | 0 | 34142 | <filename>djangopeople/djangopeople/management/commands/recluster.py
from django.core.management.base import NoArgsCommand
from ... import clustering
class Command(NoArgsCommand):
help = "Re-runs the server-side clustering"
def handle_noargs(self, **options):
clustering.run()
| 1.453125 | 1 |
phl_courts_scraper/portal/__init__.py | PhilaController/phl-courts-scraper | 0 | 34143 | """Parse the UJS court portal."""
from .core import UJSPortalScraper # noqa: F401
from .schema import PortalResult, PortalResults # noqa: F401
__all__ = ["UJSPortalScraper", "PortalResult", "PortalResults"]
| 1.0625 | 1 |
tuning/TensileConfiguration.py | mhbliao/Tensile | 0 | 34144 | <reponame>mhbliao/Tensile<filename>tuning/TensileConfiguration.py<gh_stars>0
import os
import sys
import argparse
################################################################################
# Print Debug
################################################################################
#def printWarning(message... | 2.71875 | 3 |
WeLearn/M3-Python/L1-Python_Intro/hello.py | Sheldon101/mycssi2019labs | 0 | 34145 | <filename>WeLearn/M3-Python/L1-Python_Intro/hello.py
#num1=int(raw_input("Enter num #1:"))
#num2=int(raw_input("Enter num #2:"))
#total= num1 + num2
#print("The sum is: "+ str(total))
# need to be a string so computer can read it
# all strings can be integers but not all integers can be strings
# num = int(raw_input("E... | 4.3125 | 4 |
test/test_server.py | gndu91/wsproto | 179 | 34146 | <gh_stars>100-1000
from typing import cast, List, Optional, Tuple
import h11
import pytest
from wsproto import WSConnection
from wsproto.connection import SERVER
from wsproto.events import (
AcceptConnection,
Event,
RejectConnection,
RejectData,
Request,
)
from wsproto.extensions import Extension
... | 2.125 | 2 |
KnowledgeMapping/spark/connNeo4j/demo_mysql.py | nickliqian/ralph_doc_to_chinese | 8 | 34147 | <reponame>nickliqian/ralph_doc_to_chinese<filename>KnowledgeMapping/spark/connNeo4j/demo_mysql.py<gh_stars>1-10
import pymysql
print("Connect to mysql...")
mysql_db = "report_system"
m_conn = pymysql.connect(host='192.168.20.20', port=3306, user='admin', passwd='<PASSWORD>', db=mysql_db, charset='utf8')
m_cursor = m_... | 2.546875 | 3 |
attached/delete.py | yougikou/yougikou.github.io | 1 | 34148 | <reponame>yougikou/yougikou.github.io
import sys, os, time, traceback
from pdfrw import PdfReader, PdfWriter, PageMerge
def processFile(file):
inpfn = file
outfn = 'out\\' + os.path.basename(inpfn)
reader = PdfReader(inpfn)
writer = PdfWriter(outfn)
pagesNum = len(reader.pages)
print... | 2.796875 | 3 |
Audio Features/waveplot.py | kritika58/A-Novel-Framework-Using-Neutrosophy-for-Integrated-Speech-and-Text-Sentiment-Analysis | 0 | 34149 | import matplotlib.pyplot as plt
import librosa.display
plt.rcParams.update({'font.size': 16})
y, sr = librosa.load(librosa.util.example_audio_file())
plt.figure(figsize=(18, 7))
librosa.display.waveplot(y, sr=sr, x_axis='s')
print(sr)
plt.ylabel('Sampling Rate',fontsize=32)
plt.xlabel('Time (s)',fontsize=32)
plt.show(... | 2.578125 | 3 |
services/dashboard/projekt/dashboard_server.py | JoshPrim/EVA-Projekt | 2 | 34150 | # -*- coding: utf-8 -*-
'''
Autor: <NAME>, <NAME>, <NAME>, <NAME>
Version: 1.3
Server fuer das hosten des FaSta-Dashboards
Copyright 2018 The Authors. 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 o... | 1.710938 | 2 |
hardware/humidity_rev001/main.py | deniz195/json-sensor | 1 | 34151 | # Trinket IO demo
# Welcome to CircuitPython 2.0.0 :)
import board
from digitalio import DigitalInOut, Direction, Pull
from analogio import AnalogOut, AnalogIn
import touchio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import adafruit_dotstar as dotstar
import time
import neop... | 2.90625 | 3 |
tests/lib/raw.py | Defense-Cyber-Crime-Center/dfvfs | 2 | 34152 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the storage media RAW image support helper functions."""
import unittest
from dfvfs.lib import raw
from dfvfs.lib import definitions
from dfvfs.path import fake_path_spec
from dfvfs.path import raw_path_spec
from dfvfs.resolver import context
from dfvfs.vfs impor... | 2.5 | 2 |
src/tools/plot_training_log.py | motherapp/CenterNet | 6 | 34153 | import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
import sys
import time
def get_train_loss(line):
splitted_line = line.split(" ")
return float(splitted_line[2]), float(splitted_line[4])
def get_val_loss(line):
splitted_line = line.split(" ")
if len(spli... | 3.125 | 3 |
pyxb/binding/content.py | thorstenb/pyxb | 0 | 34154 | <filename>pyxb/binding/content.py
# Copyright 2009, <NAME>
#
# 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 ap... | 1.679688 | 2 |
scripts/imglss-query-tycho-veto.py | desihub/imaginglss | 6 | 34155 | <gh_stars>1-10
#!/usr/bin/env python
#
# Code to query the VETO mask of objects/randoms
# It takes the NOISES extension as an input
# It writers a VETO extension.
# Usage, see python query_veto.py -h
#
from __future__ import print_function
__author__ = "<NAME> and <NAME>"
__version__ = "1.0"
__email__ = "<EMAIL> or... | 2.328125 | 2 |
model.py | hafizur-rahman/CarND-Behavioral-Cloning-P3 | 0 | 34156 | <filename>model.py
import csv
import cv2
import numpy as np
from sklearn.utils import shuffle
class DrivingLogReader:
def __init__(self, driving_data):
self.driving_data = driving_data
self.driving_log = self.read_all(self.driving_data)
self.record_count = len(self.driving_log) ... | 2.921875 | 3 |
backend/bundle/controller.py | FlickerSoul/Graphery | 5 | 34157 | from __future__ import annotations
import logging
import pathlib
from logging.handlers import TimedRotatingFileHandler
from os import getenv
from typing import Union, List, Mapping
from bundle.utils.recorder import Recorder
from bundle.utils.cache_file_helpers import CacheFolder, USER_DOCS_PATH
from bundle.seeker imp... | 2.28125 | 2 |
CPC training/tune.py | haoyudong-97/tg2019task | 0 | 34158 | # Copyright 2018 <NAME>, <NAME>.
# (Strongly inspired by original Google BERT code and Hugging Face's code)
""" Fine-tuning on A Classification Task with pretrained Transformer """
import itertools
import csv
import fire
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import toke... | 2.578125 | 3 |
test/teos/unit/test_extended_appointment.py | ritikramuka/python-teos | 86 | 34159 | import pytest
from teos.extended_appointment import ExtendedAppointment
@pytest.fixture
def ext_appointment_data(generate_dummy_appointment):
return generate_dummy_appointment().to_dict()
# Parent methods are not tested.
def test_init_ext_appointment(ext_appointment_data):
# The appointment has no checks... | 2.09375 | 2 |
toolchain/riscv/MSYS/python/Lib/test/encoded_modules/__init__.py | zhiqiang-hu/bl_iot_sdk | 207 | 34160 | # -*- encoding: utf-8 -*-
# This is a package that contains a number of modules that are used to
# test import from the source files that have different encodings.
# This file (the __init__ module of the package), is encoded in utf-8
# and contains a list of strings from various unicode planes that are
# encoded... | 2.296875 | 2 |
kinoko/text/patch_tsv.py | koyo922/kinoko | 13 | 34161 | <gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 expandtab number
"""
使用参考文件,对 csv/tsv 文件进行修补
e.g.
<reference.txt>内容如下:
jiaose 角色 juese
xxx 色情词 <DEL>
<file_to_patch>内容如下:
field1 field2 角色 jiaose field4
field1 field2 色情词 xxx field4
<result直接写到stdout>,内容如下:
field1 field2 角色 ... | 2.328125 | 2 |
toolkit/utils/report_utils.py | suraj-testing2/Flowers_Toilet | 22 | 34162 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 3.28125 | 3 |
Sinavro/Types/BaseClass.py | pl-Steve28-lq/SinavroLang | 4 | 34163 | <filename>Sinavro/Types/BaseClass.py
class SinavroObject: pass
def init(self, val): self.value = val
gencls = lambda n: type(f'Sinavro{n.title()}', (SinavroObject,), {'__init__': init, 'type': n})
SinavroInt = gencls('int')
SinavroFloat = gencls('float')
SinavroString = gencls('string')
SinavroBool = gencls('... | 2.796875 | 3 |
HUGS/Interface/_upload.py | hugs-cloud/hugs | 0 | 34164 | <reponame>hugs-cloud/hugs<filename>HUGS/Interface/_upload.py<gh_stars>0
import tempfile
from pathlib import Path
import ipywidgets as widgets
from HUGS.Client import Process
from HUGS.Interface import Credentials
class Upload:
def __init__(self):
self._credentials = Credentials()
self._user = No... | 2.59375 | 3 |
tools/run_tests/xds_k8s_test_driver/tests/url_map/metadata_filter_test.py | minerba/grpc | 0 | 34165 | # Copyright 2022 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 1.6875 | 2 |
tmpFile.py | yingyulou/tmpFile | 2 | 34166 | <filename>tmpFile.py<gh_stars>1-10
#!/bin/env python
# coding=UTF-8
'''
DESCRIPTION
tmpFile
A module for creating temporary files and folders.
VERSION
1.4.0
LATEST UPDATE
2019.3.4
'''
# Import Python Lib
from os import remove, mkdir
from os.path import join, exists, abspath
from uuid import uui... | 3.203125 | 3 |
hw_asr/augmentations/wave_augmentations/__init__.py | isdevnull/asr_hw | 0 | 34167 | <filename>hw_asr/augmentations/wave_augmentations/__init__.py
from hw_asr.augmentations.wave_augmentations.Gain import Gain
from hw_asr.augmentations.wave_augmentations.ImpulseResponse import ImpulseResponse
from hw_asr.augmentations.wave_augmentations.Noise import GaussianNoise
from hw_asr.augmentations.wave_augmentat... | 1.195313 | 1 |
python/ambassador/compile.py | Asher-Wang/ambassador | 3,438 | 34168 | <reponame>Asher-Wang/ambassador<filename>python/ambassador/compile.py
# Copyright 2020 Datawire. 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... | 2.140625 | 2 |
elasticdl/python/tests/elasticdl_job_service_test.py | DLPerf/elasticdl | 0 | 34169 | <filename>elasticdl/python/tests/elasticdl_job_service_test.py
# Copyright 2020 The ElasticDL Authors. 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... | 1.875 | 2 |
train/train.py | miramirakim227/SwapNeRF_GT | 0 | 34170 | # Training to a set of multiple objects (e.g. ShapeNet or DTU)
# tensorboard logs available in logs/<expname>
import sys
import os
sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))
)
import warnings
import trainlib
from model import make_model, loss
from render import NeRF... | 2.140625 | 2 |
api_level_2/qt/basic.py | olklymov/valkka-examples | 12 | 34171 | """
basic.py : Some basic classes encapsulating filter chains
* Copyright 2017-2020 Valkka Security Ltd. and <NAME>
*
* Authors: <NAME> <<EMAIL>>
*
* This file is part of the Valkka library.
*
* Valkka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Publi... | 2.1875 | 2 |
need_an_image/utils/store.py | RyouMon/i-need-an-image | 1 | 34172 | import os.path
from uuid import uuid4
def save_image(image, save_to='.'):
"""
Save image to local dick
"""
suffix = '.jpg'
if image.mode == 'P':
image = image.convert('RGBA')
if image.mode == 'RGBA':
suffix = '.png'
filename = uuid4().hex + suffix
if not os.path.isd... | 3.234375 | 3 |
leetcode/191.py | pingrunhuang/CodeChallenge | 0 | 34173 | '''
191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3.
'''
class Solution(object):
de... | 4.0625 | 4 |
examples/color4.py | yang69can/pyngl | 125 | 34174 | #
# File:
# color4.py
#
# Synopsis:
# Draws sixteen sample color boxs with RGB labels.
#
# Category:
# Colors
#
# Author:
# <NAME>
#
# Date of initial publication:
# January, 2006
#
# Description:
# This example draws sixteen color boxes using the RGB
# values for named colors. The boxes are... | 3.078125 | 3 |
t4_hotel/apps.py | dnswd/SIRUCO | 0 | 34175 | <filename>t4_hotel/apps.py
from django.apps import AppConfig
class T4HotelConfig(AppConfig):
name = 't4_hotel'
| 1.257813 | 1 |
gameAI.py | dshao2007/TermProject | 0 | 34176 |
import random
from evaluator import ChessEval
class ChessAI(object):
INF = 8000
def __init__(self,game,color):
self.game = game
self.evaluator = ChessEval(game)
self.color = color
self.drunkMode = False
self.points = {'Pawn': 10, 'Knight': 30, 'Bishop': 30, 'Rook': 5... | 3.375 | 3 |
scripts/Render_Animation.py | eecheve/Gaussian-2-Blender | 1 | 34177 | import bpy
def Render_Animation():
bpy.ops.object.camera_add(enter_editmode=False, align='VIEW', location=(0, 0, 0), rotation=(1.60443, 0.014596, 2.55805))
bpy.ops.object.light_add(type='SUN', location=(0, 0, 5)) #setting camera and lights for rendering
cam = bpy.data.objects["Camera"]
scene = bpy.cont... | 2.71875 | 3 |
src/dictstore/interface.py | sampathbalivada/dictstore | 1 | 34178 | <reponame>sampathbalivada/dictstore
# Copyright 2021 <NAME>
# 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 l... | 2.328125 | 2 |
slender/tests/list/test_include.py | torokmark/slender | 1 | 34179 | <filename>slender/tests/list/test_include.py
import re
from unittest import TestCase
from expects import expect, equal, raise_error, be_true, be_false
from slender import List
class TestInclude(TestCase):
def test_include_if_value_in_array(self):
e = List(['apple', 'bear', 'dog', 'plum', 'grape', 'cat... | 2.671875 | 3 |
tests/Util/test_config.py | JI511/Personal_Fitness | 0 | 34180 | # ----------------------------------------------------------------------------------------------------------------------
# Body Weight test cases
# ----------------------------------------------------------------------------------------------------------------------
# imports
import unittest
import tempfile
import ... | 2.4375 | 2 |
userbot/plugins/fontstyles.py | anandhu-dev/catuserbot | 2 | 34181 |
import re
import time
import requests
from telethon import events
from userbot import CMD_HELP
from userbot.utils import register
import asyncio
import random
EMOJIS = [
"😂",
"😂",
"👌",
"💞",
"👍",
"👌",
"💯",
"🎶",
"👀",
"😂",
"👓",
"👏",
"👐",
"🍕",
"💥... | 1.765625 | 2 |
test/api/drawing/test_drawing_objects.py | rizwanniazigroupdocs/aspose-words-cloud-python | 0 | 34182 | # -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_drawing_objects.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | 1.734375 | 2 |
freqent/tests/azimuthal_average_tests/make_sphericalWaveTest.py | lab-of-living-matter/freqent | 5 | 34183 | import numpy as np
import matplotlib.pyplot as plt
import freqent.freqentn as fen
import dynamicstructurefactor.sqw as sqw
from itertools import product
import os
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
savepath = '/media/daniel/storage11/Dropbox/LLM_Danny/frequencySpaceDissipation/tests/freqentn_te... | 3 | 3 |
setup.py | kimvanwyk/red-mail | 0 | 34184 | <reponame>kimvanwyk/red-mail<filename>setup.py
from setuptools import setup, find_packages
import versioneer
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="redmail",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="<NAME>",
author_email=... | 1.398438 | 1 |
wagtailcomments/basic/migrations/0001_initial.py | takeflight/wagtailcomments | 7 | 34185 | <reponame>takeflight/wagtailcomments<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-29 06:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import enumchoicefie... | 1.796875 | 2 |
tests_requre/service/test_views.py | IceWreck/packit-service | 0 | 34186 | from flask import url_for
from flexmock import flexmock
from packit_service import models
from packit_service.models import CoprBuildModel
from packit_service.service.views import _get_build_info
from tests_requre.conftest import SampleValues
def test_get_build_logs_for_build_pr(clean_before_and_after, a_copr_build_... | 2.25 | 2 |
watchapp/urls.py | kepha-okari/the-watch | 0 | 34187 | <gh_stars>0
from django.conf.urls import url,include
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r'^$',views.index,name='hoodNews'),
url(r'^new/hood/',views.create_hood, name='newHo... | 1.8125 | 2 |
shopyoapi/uploads.py | Maurilearn/learnings | 0 | 34188 | <filename>shopyoapi/uploads.py
from werkzeug.security import generate_password_hash
from shopyoapi.init import db
from app import app
from modules.auth.models import User
from modules.school.models import Setting
# from modules.settings.models import Settings
def add_admin(name, email, password):
with app.app_... | 2.25 | 2 |
neutron_plugin_contrail/plugins/opencontrail/neutron_middleware.py | hamzazafar/contrail-neutron-plugin | 3 | 34189 | <filename>neutron_plugin_contrail/plugins/opencontrail/neutron_middleware.py
import logging
from eventlet import corolocal
from eventlet.greenthread import getcurrent
"""
This middleware is used to forward user token to Contrail API server.
Middleware is inserted at head of Neutron pipeline via api-paste.ini file
so ... | 2.328125 | 2 |
scofield/tax/models.py | howiworkdaily/scofield-project | 4 | 34190 | <filename>scofield/tax/models.py
from django.db import models
class TaxClass(models.Model):
"""
Tax rate for a product.
"""
title = models.CharField(max_length=100)
description = models.CharField(max_length=200, help_text='Description of products to be taxed')
def __unicode__(self):
r... | 2.671875 | 3 |
helpers/sett/resolvers/StrategySushiDiggWbtcLpOptimizerResolver.py | shuklaayush/badger-system | 99 | 34191 | <reponame>shuklaayush/badger-system
from brownie import interface
from rich.console import Console
from helpers.utils import snapBalancesMatchForToken
from .StrategyBaseSushiResolver import StrategyBaseSushiResolver
console = Console()
class StrategySushiDiggWbtcLpOptimizerResolver(StrategyBaseSushiResolver):
d... | 2.515625 | 3 |
Section 8/4/4/Ej7.4/UCBExp.py | marcosherreroa/Aplicaciones-de-los-algoritmos-bandidos | 0 | 34192 | # -*- coding: utf-8 -*-
""""
Bandidos estocásticos: introducción, algoritmos y experimentos
TFG Informática
Sección 8.4.4
Figuras 26, 27 y 28
Autor: <NAME>
"""
import math
import random
import scipy.stats as stats
import matplotlib.pyplot as plt
import numpy as np
def computemTeor(n,Delta):
if Del... | 3 | 3 |
tools/code_coverage/package/oss/cov_json.py | deltabravozulu/pytorch | 206 | 34193 | <reponame>deltabravozulu/pytorch<filename>tools/code_coverage/package/oss/cov_json.py
from ..tool import clang_coverage
from ..util.setting import CompilerType, Option, TestList, TestPlatform
from ..util.utils import check_compiler_type
from .init import detect_compiler_type
from .run import clang_run, gcc_run
def ge... | 1.71875 | 2 |
metaworld/envs/asset_path_utils.py | vinnibuh/metaworld | 0 | 34194 | import os
import xml.etree.ElementTree as ET
from tempfile import NamedTemporaryFile
ENV_ASSET_DIR_V1 = os.path.join(os.path.dirname(__file__), 'assets_v1')
ENV_ASSET_DIR_V2 = os.path.join(os.path.dirname(__file__), 'assets_v2')
def full_v1_path_for(file_name):
return os.path.join(ENV_ASSET_DIR_V1, file_name)
... | 2.53125 | 3 |
landcover_change_application/lccs_l3.py | opendatacube/datacube-conference-2019 | 5 | 34195 | """
LCCS Level 3 Classification
| Class name | Code | Numeric code |
|----------------------------------|-----|-----|
| Cultivated Terrestrial Vegetated | A11 | 111 |
| Natural Terrestrial Vegetated | A12 | 112 |
| Cultivated Aquatic Vegetated | A23 | 123 |
| Natural Aquatic Vegetated | A24 | 124 |
| Art... | 3 | 3 |
hackerearth/Algorithms/Buggy Bot/solution.py | ATrain951/01.python-com_Qproject | 4 | 34196 | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
from collections import defaultdict
n, m, ... | 3.5 | 4 |
level1/migrations/0002_auto_20200219_1812.py | smateenml/arabic | 1 | 34197 | # Generated by Django 3.0.2 on 2020-02-19 18:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('level1', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='conjugation',
name='he_future',
),
... | 1.679688 | 2 |
rh/apps/case_studies/cms_apps.py | rapidpro/chpro-microsite | 0 | 34198 | <gh_stars>0
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
class CaseStudiesApphook(CMSApp):
app_name = "case_studies"
name = "Case Studies Application"
def get_urls(self, page=None, language=None, **kwargs):
return ["rh.apps.case_studies.urls"]
apphook_pool.register(... | 1.835938 | 2 |
manim_demo/project/matplotlib_demo.py | shujunge/manim_tutorial | 0 | 34199 | from manimlib.imports import *
from srcs.utils import run
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_agg import FigureCanvasAgg
from sklearn import svm # sklearn = scikit-learn
from sklearn.datasets import make_moons
def mplfig_to_npimage(fig):
""" Converts a matplotlib ... | 2.765625 | 3 |