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 |
|---|---|---|---|---|---|---|
haptools/data/__init__.py | aryarm/admixtools | 0 | 12793951 | <gh_stars>0
from .data import Data
from .genotypes import Genotypes, GenotypesRefAlt
from .phenotypes import Phenotypes
from .covariates import Covariates
from .haplotypes import Extra, Variant, Haplotype, Haplotypes
| 0.984375 | 1 |
src/utils/utils.py | dsikar/sdsandbox | 1 | 12793952 | <filename>src/utils/utils.py<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# In[40]:
def sort_unity_files(path, mask):
"""
Create a sorted dictionary from unity (SDSandbox) files e.g.
C:\\Users\\aczd097\\Downloads\\dataset\\unity\\log_sample\\logs_Mon_Jul_13_08_29_01_2020\\0_cam-image_array_.jpg
... | 3.046875 | 3 |
a10_neutron_lbaas/tests/unit/test_a10_config.py | hthompson6/a10-neutron-lbaas | 10 | 12793953 | # Copyright 2014, <NAME> (dougwig), A10 Networks
#
# 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 appl... | 2.203125 | 2 |
overhave/cli/db/regular.py | TinkoffCreditSystems/overhave | 33 | 12793954 | <reponame>TinkoffCreditSystems/overhave
import click
import sqlalchemy_utils as sau
from alembic.config import Config
from sqlalchemy.engine.url import URL
from sqlalchemy.exc import OperationalError
from overhave import db as database
from overhave.base_settings import DataBaseSettings
def _create_all(config: Confi... | 2.140625 | 2 |
basta/migrations/0018_initialize_categories.py | lorenzosp93/basta_app | 1 | 12793955 | <filename>basta/migrations/0018_initialize_categories.py
from django.db import migrations, transaction, IntegrityError
from django.utils.translation import gettext_lazy as _
CATEGORIES = (
('elements', _('Chemical element')),
('petnames', _('Pet name')),
('transportation', _('Means of transportation')),
... | 2.28125 | 2 |
ansiscape/interpreters/font.py | cariad/ansiscape | 0 | 12793956 | from ansiscape.enums import Font, InterpretationKey, SelectGraphicRendition
from ansiscape.interpreter import Interpreter
class FontValue(Interpreter[Font]):
def __init__(self) -> None:
super().__init__(
key=InterpretationKey.FONT,
lookup={
SelectGraphicRendition.DE... | 2.453125 | 2 |
wave/wave/freq_old/domain/__init__.py | jedhsu/wave | 0 | 12793957 | <gh_stars>0
from .param import *
from .spectrum import *
| 1.203125 | 1 |
backend/apps/risks/views.py | intellisense/risks | 0 | 12793958 | <filename>backend/apps/risks/views.py<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import RiskType, RiskField
from .serializers import RiskTypeSerializer... | 2.0625 | 2 |
script/core/runner/grid5k/Grid5kRunner.py | tdurieux/RepairThemAll | 49 | 12793959 | <filename>script/core/runner/grid5k/Grid5kRunner.py
import time
import subprocess
import json
import os
import re
import sys
from core.runner.RepairTask import RepairTask
from core.runner.Runner import Runner
from core.renderer.renderer import get_renderer
from config import REPAIR_ROOT, OUTPUT_PATH, GRID5K_MAX_NODE, ... | 2.203125 | 2 |
datasets/code_x_glue_cc_cloze_testing_all/generated_definitions.py | WojciechKusa/datasets | 10,608 | 12793960 | DEFINITIONS = {
"go": {
"class_name": "CodeXGlueCcClozeTestingAll",
"dataset_type": "Code-Code",
"description": "CodeXGLUE ClozeTesting-all dataset, available at https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/ClozeTesting-all",
"dir_name": "ClozeTesting-all",
"nam... | 1.460938 | 1 |
wmm/wrapper.py | ESA-VirES/WMM | 1 | 12793961 | #!/usr/bin/env python
import sys
import argparse
import os
import os.path
import subprocess
import numpy
import gdal
import osr
import ogr
from uuid import uuid4
import logging
logger = logging.getLogger(__name__)
zoomresolution = {
0.70312500:0,
0.35156250:1,
0.17578125:2,
0.08789063:3,
0.043945... | 2.015625 | 2 |
epoch.py | InterImm/marclock-serverless | 1 | 12793962 | <gh_stars>1-10
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlparse
import json
import debugserver
import datetime
from functions.mars import CoordinatedMarsTime
from functions.interimm import MartianTime
class handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_respo... | 2.75 | 3 |
docs/demo/IRE2017/RobotCAR/MLP/train_model.py | FaBoPlatform/RobotCarAI | 10 | 12793963 | # coding: utf-8
# MultiPerceptron
# queueを使った学習
# 学習step数を記録
# 学習データはCSVの代わりにジェネレータを搭載
# 3x11x4のNNモデルに変更
# scoreを追加
import os
_FILE_DIR=os.path.abspath(os.path.dirname(__file__))
import time
import tensorflow as tf
import threading
from sklearn.utils import shuffle
import sys
sys.path.append(_FILE_DIR+'/..')
from gene... | 2.390625 | 2 |
tests/h/services/annotation_moderation_test.py | rickyhan/h | 2 | 12793964 | <filename>tests/h/services/annotation_moderation_test.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from h import models
from h.services.annotation_moderation import AnnotationModerationService
from h.services.annotation_moderation import annotation_moderation_service_factory
cla... | 2.109375 | 2 |
rdmo/questions/migrations/0051_sites_blank.py | ItsNotYou/rdmo | 77 | 12793965 | # Generated by Django 2.2.9 on 2020-02-14 10:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questions', '0050_data_migration'),
]
operations = [
migrations.AlterField(
model_name='catalog',
name='sites',
... | 1.773438 | 2 |
members/context_processors.py | AsinineFatuity/tukulelunch-django-python | 0 | 12793966 | <filename>members/context_processors.py
from .models import Category,PledgeItem,Pledge
from .views import pledge_id_fn
def counter(request):
item_count=0
if 'admin' in request.path:
return {}
else:
try:
pledge=Pledge.objects.filter(pledge_id=pledge_id_fn(request)) #specify cart ... | 1.992188 | 2 |
tests/conftest.py | Agilicus/copper-sdk | 4 | 12793967 | import pytest
from copper_sdk import COPPER_API_TOKEN, COPPER_API_EMAIL
from copper_sdk.copper import Copper
@pytest.fixture(scope='session')
def copper():
return Copper(COPPER_API_TOKEN, COPPER_API_EMAIL)
| 1.742188 | 2 |
cefiro_customizations/helpers.py | saeedkola/cefiro_customizations | 0 | 12793968 | <reponame>saeedkola/cefiro_customizations
import frappe
from frappe.utils import get_files_path, get_site_path, get_site_base_path
import openpyxl,re
def get_absolute_path(file_name, is_private=False):
site_name = get_site_base_path()
if(file_name.startswith('/files/')):
file_name = file_name[7:]
return frappe.u... | 2.515625 | 3 |
PaddleFSL/test/backbones/rc_init_vector_test.py | Chaoqun-Guo/FSL-Mate | 0 | 12793969 | # Copyright 2021 PaddleFSL 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 wri... | 2.203125 | 2 |
docs/source/plots/var_plot_forecast.py | madhushree14/statsmodels | 6,931 | 12793970 | from var_plots import plot_forecast
plot_forecast()
| 1.101563 | 1 |
_old/LennieTheLeaker.py | tmp63498/Lestat | 13 | 12793971 | #!/usr/bin/python3
import argparse
import sys
def readHashFile(hashfile):
f = open(hashfile)
hashes = f.read().split('\n')[:-1]
ntlm ={"cracked":{}, "safe":{}}
f.close()
for i in hashes:
try:
h = i.split(':')
ntlm["safe"][h[3].upper()] = h[0].lower()
except ... | 2.796875 | 3 |
baseq/fastq/split_barcode.py | basedata10/baseq | 1 | 12793972 | <gh_stars>1-10
import os
def write_buffer(buffer, filehandles):
for key in buffer.keys():
filehandles[key].writelines(buffer[key])
buffer[key] = []
def write_and_close(buffer, filehandles):
for key in buffer.keys():
filehandles[key].writelines(buffer[key])
filehandles[key].clos... | 2.796875 | 3 |
Exercicios/ex072.py | mauroalbuquerque/Python-CursoEmVideo | 0 | 12793973 | <filename>Exercicios/ex072.py
contagem = ('Zero', 'Um', 'Dois', 'Três',
'Quatro', 'Cinco', 'Seis', 'Sete',
'Oito', 'Nove', 'Dez', 'Onze', 'Doze',
'Treze', 'Quartoze', 'Quinze', 'Dezesseis',
'Dezesete', 'Dezoito', 'Dezenove', 'Vinte')
selecao = input('Informe um número en... | 3.9375 | 4 |
tools/blender_script.py | aspadm/DEMD-database-old | 3 | 12793974 | import os
import bpy
import sys
# Names of folder and files
args = sys.argv
source_file = args[-2]
convert_file = args[-1]
save_type = convert_file.split(".")[-1]
# Deleting all objects
for scene in bpy.data.scenes:
for obj in scene.objects:
scene.objects.unlink(obj)
for bpy_data_iter in (... | 2.265625 | 2 |
powerwatch/analysis/old_analysis_scripts/monthly_pw_dw_correlate.py | nklugman/PlugWatch | 0 | 12793975 | #!/usr/bin/env python
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, window, asc, desc, lead, lag, udf, hour, month, dayofmonth, collect_list, lit, year, coalesce, mean
import pyspark.sql.functions as F
from pyspark.sql.window import Window
from pyspark.sql.types import FloatType, IntegerTy... | 2.390625 | 2 |
tests/anomaly/test_default.py | cnll0075/Merlion | 2,215 | 12793976 | #
# Copyright (c) 2022 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
from abc import ABC
import logging
import os
from os.path import abspath, dirname, join
import sys
i... | 1.976563 | 2 |
models.py | chawlaj100/P1_Facial_Keypoints | 1 | 12793977 | ## TODO: define the convolutional neural network architecture
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def __init__(sel... | 3.65625 | 4 |
scripts/python/remoteAccessScripts/microThoughts.py | jeremiahmarks/dangerzone | 1 | 12793978 | <gh_stars>1-10
#intent: create a script that will create an HTML page and post it to my website
#via python and html. The argument it will accept is the text for the newest post.
# server.org/SERVERDIRECTORY/yyyyMonDayhhmmss.html
SERVER='ftp.yourhost.org'
USERNAME='yourFTPusername'
PASSWORD='<PASSWORD>'
SERVERDIREC... | 3.46875 | 3 |
tests/test_api/test_FCNet.py | levi131/PaddleScience | 0 | 12793979 | <reponame>levi131/PaddleScience<filename>tests/test_api/test_FCNet.py<gh_stars>0
"""
# Copyright (c) 2021 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 Licen... | 2.234375 | 2 |
bitey/cpu/addressing_mode_factory.py | jgerrish/bitey | 0 | 12793980 | <reponame>jgerrish/bitey
from dataclasses import dataclass
from typing import ClassVar
from bitey.cpu.addressing_mode import (
AddressingMode,
AbsoluteAddressingMode,
AbsoluteIndirectAddressingMode,
AbsoluteXAddressingMode,
AbsoluteYAddressingMode,
AccumulatorAddressingMode,
ImmediateAddress... | 2.921875 | 3 |
libs/simulate_robot.py | yuk6heo/GIS-RAmap | 33 | 12793981 | <reponame>yuk6heo/GIS-RAmap
from __future__ import absolute_import, division
from davisinteractive import logging
from davisinteractive.metrics import batched_jaccard
from davisinteractive.utils.operations import bezier_curve
from davisinteractive.robot.interactive_robot import InteractiveScribblesRobot
from davisint... | 2.09375 | 2 |
src/nti/app/pyramid_zope/traversal.py | NextThought/nti.app.pyramid_zope | 1 | 12793982 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Support for resource tree traversal.
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from pyramid import traversal
from pyramid.compat import is_nonstr_iter
from pyramid.compat import decode_path_info
... | 2.109375 | 2 |
crsbot_source/consts.py | Qman11010101/chunithmSelectorBot | 0 | 12793983 | import json
import os
from os import environ as env
from distutils.util import strtobool
if os.path.isfile("setting.json"):
with open("setting.json", "r", encoding="UTF-8_sig") as s:
setting = json.load(s)
else:
setting = {
"token": {
"discord": env["discord_token"],
"ch... | 2.15625 | 2 |
src/models/hmc_vae.py | ipeis/HH-VAEM | 2 | 12793984 | <reponame>ipeis/HH-VAEM
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2022 by <NAME>, UC3M. +
# All rights reserved. This file is part of the HH-VAEM, and is released under +
# the "MIT License Agreement". Please see the LICENSE ... | 1.59375 | 2 |
analyzePenalties.py | tgadf/football | 0 | 12793985 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 22 18:29:44 2019
@author: tgadfort
"""
from debug import debugclass
from playTypes import noplay
from playYards import playyards
#from copy import deepcopy, copy
# create logger
import logging
module_logger = logging.getLogger('log.{0}'.format(__... | 2.421875 | 2 |
battle.py | AvenirX/Meicraft | 0 | 12793986 | import random
import time
from Character import *
from Item import create_item
def battle(fighters, max_turn=10):
"""
Battle process start->loot
:param max_turn: int turns for 1 battle, default 10
:param fighters: list of fighter
:return: None
"""
# Enter battle_process
... | 3.453125 | 3 |
SA_SVM/pySVM.py | Bowenislandsong/Medical-Document-Classification- | 0 | 12793987 | <gh_stars>0
from sklearn import svm
from sklearn.datasets import load_files
import numpy as np
import scipy.io as spio
from scipy.sparse import csr_matrix
from scipy.special import gammaln
frommat = spio.loadmat('sbowen_woStop.mat', squeeze_me=True)
xTrain = frommat['X_train_woSTOP'] # Xtest Mtx
yTrain = frommat['X_te... | 2.25 | 2 |
trybs4.py | melvin0008/pythoncodestrial | 0 | 12793988 | from bs4 import BeautifulSoup
import xlsxwriter
workbook= xlsxwriter.Workbook("data.xlsx")
worksheet = workbook.add_worksheet()
f = open('rough.html',"r")
data=f.read()
soup=BeautifulSoup(data)
div = soup.find('div', {"class":'dataTables_scroll'})
table=div.find('table')
tbody=div.find('tbody')
rows=tbody.find_all('tr... | 3.078125 | 3 |
plugins/option.py | loktacar/wallpapermaker | 1 | 12793989 | from plugin import Plugin
class Option(Plugin):
"""
Base class for option plugins
"""
# Default value, if default is None, option is required to be set to something else
default = None
# Option name
option = None
# Short command line option
cmd_short = None
# Command line... | 2.78125 | 3 |
lang/Python/longest-common-subsequence-1.py | ethansaxenian/RosettaDecode | 0 | 12793990 | <gh_stars>0
def lcs(xstr, ystr):
"""
lcs('thisisatest', 'testing123testing')
'tsitest'
"""
if not xstr or not ystr:
return ""
x, xs, y, ys = xstr[0], xstr[1:], ystr[0], ystr[1:]
if x == y:
return x + lcs(xs, ys)
else:
return max(lcs(xstr, ys), lcs(xs, ystr), key=l... | 3.15625 | 3 |
docandcover.py | softwaresaved/docandcover | 0 | 12793991 | #input_var='https://github.com/softwaresaved/docandcover/'
input_var='https://github.com/Axelrod-Python/Axelrod'
import os
import shutil
from pygit2 import clone_repository
try:
shutil.rmtree('tmp-repo')
except:
pass
try:
repo = clone_repository(input_var,'tmp-repo')
except:
pass
from fileListGetter... | 2.546875 | 3 |
galerias/migrations/0003_auto_20190806_1038.py | shiminasai/cantera | 0 | 12793992 | # Generated by Django 2.1.7 on 2019-08-06 16:38
import ckeditor_uploader.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sorl.thumbnail.fields
class Migration(migrations.Migration):
dependencies = [... | 1.703125 | 2 |
star_resty/payload/json.py | lazy-labs/star_resty | 3 | 12793993 | <gh_stars>1-10
import types
from typing import Mapping, Type, TypeVar, Union
import ujson
from marshmallow import EXCLUDE, Schema
from starlette.requests import Request
from star_resty.exceptions import DecodeError
from .base import SchemaParser, set_parser
__all__ = ('json_schema', 'json_payload', 'JsonParser')
P ... | 2.140625 | 2 |
2-resources/_External-learning-resources/02-pyth/python-patterns-master/patterns/creational/prototype.py | eengineergz/Lambda | 0 | 12793994 | <reponame>eengineergz/Lambda
"""
*What is this pattern about?
This patterns aims to reduce the number of classes required by an
application. Instead of relying on subclasses it creates objects by
copying a prototypical instance at run-time.
This is useful as it makes it easier to derive new kinds of objects,
when inst... | 3.0625 | 3 |
compile.py | Brikwerk/cvpr-explorer | 0 | 12793995 | <reponame>Brikwerk/cvpr-explorer
import json
import time
import os
from urllib.parse import urljoin
import argparse
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument('year', type=int,
help="""Specifies the CVPR year to compi... | 2.90625 | 3 |
recursion/sumTriangleFromArrray.py | kushvr7/High-On-DSA | 76 | 12793996 | <gh_stars>10-100
def triangle(array, result):
result.insert(0,array)
array = [array[i-1]+array[i] for i in range(1, len(array))]
return triangle(array , result) if len(array)>0 else result
for i in triangle([1,2,3,4,5], []):
print(i)
'''
triangle(3,5,7,9)
-> triangle (8,12,16)
... | 3.65625 | 4 |
hal_fuzz/hal_fuzz/handlers/debug.py | diagprov/hal-fuzz | 117 | 12793997 | <gh_stars>100-1000
from unicorn.arm_const import *
def stop(uc):
print_context(uc)
input("...")
def print_context(uc):
print("==== State ====")
r0 = uc.reg_read(UC_ARM_REG_R0)
r1 = uc.reg_read(UC_ARM_REG_R1)
r2 = uc.reg_read(UC_ARM_REG_R2)
r3 = uc.reg_read(UC_ARM_REG_R3)
r4 = uc.reg_re... | 2.125 | 2 |
artellapipe/tools/welcome/widgets/frame.py | ArtellaPipe/artellapipe-tools-welcome | 0 | 12793998 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains frame widget implementation
"""
from __future__ import print_function, division, absolute_import
from Qt.QtCore import Qt
from Qt.QtWidgets import QSizePolicy, QFrame
from Qt.QtGui import QPainter, QPainterPath
class WelcomeFrame(QFrame, object... | 2.1875 | 2 |
tests/blackbox_tests/__init__.py | stevecotton/i18nspector | 1 | 12793999 | <gh_stars>1-10
# Copyright © 2012-2021 <NAME> <<EMAIL>>
#
# 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, including without limitation the rights
# to use, copy, modify, ... | 1.78125 | 2 |
minydra/console.py | pg2455/minydra | 0 | 12794000 | <gh_stars>0
class bcolors:
HEADER = "\033[95m"
OKBLUE = "\033[94m"
OKGREEN = "\033[92m"
WARNING = "\033[93m"
FAIL = "\033[91m"
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDERLINE = "\033[4m"
class MinyConsole:
def _end(self, key, *args):
return f"{key}{' '.join(args)}{bcolors.ENDC}... | 2.515625 | 3 |
imperative/python/megengine/traced_module/_passes/fuse_pass.py | Olalaye/MegEngine | 1 | 12794001 | <reponame>Olalaye/MegEngine
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARR... | 2.015625 | 2 |
treemodels.py | zgana/manatee | 0 | 12794002 | # treemodels.py
from __future__ import division
import gtk
from debug import *
import numpy as np
import matplotlib.pyplot as plt
class CountingActivitiesModel (gtk.GenericTreeModel):
"""Gtk TreeModel for CountingActivity's in a Log."""
def __init__ (self, log):
gtk.GenericTreeModel.__init__ (sel... | 2.609375 | 3 |
python/interpret-core/interpret/ext/glassbox/__init__.py | prateekiiest/interpret | 2,674 | 12794003 | <reponame>prateekiiest/interpret<gh_stars>1000+
# Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
import sys
from interpret.ext.extension_utils import load_class_extensions
from interpret.ext.extension import GLASSBOX_EXTENSION_KEY, _is_valid_glassbox_explainer
load_class_extensi... | 1.203125 | 1 |
rlo/scripts/azureml_ray.py | tomjaguarpaw/knossos-ksc | 31 | 12794004 | <reponame>tomjaguarpaw/knossos-ksc
"""
Quick start instructions:
1. Make sure you have access to the knossos Azure subscription.
> az login
> az account set -s Knossos
You'll need to have at least Contributor access to the resource group (knossosamlrg).
You can (not recommended) temporarily elevate yoursel... | 1.960938 | 2 |
awacs/devicefarm.py | alanjjenkins/awacs | 358 | 12794005 | <filename>awacs/devicefarm.py
# Copyright (c) 2012-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Device Farm"
prefix = "devicefarm"
class Action(BaseAction):
def __init__(self, action: str =... | 2.265625 | 2 |
tools/tube.py | fsanges/glTools | 165 | 12794006 | <filename>tools/tube.py<gh_stars>100-1000
import maya.cmds as mc
import glTools.tools.controlBuilder
import glTools.utils.attach
import glTools.utils.base
import glTools.utils.attribute
import glTools.utils.component
import glTools.utils.stringUtils
def buildProfile(radius=1,spans=8):
'''
Create tube profile curve... | 2.09375 | 2 |
doba/structures/__init__.py | marverix/doba | 0 | 12794007 | from .BackupPath import BackupPath
from .Container import Container
from .DobaContainersConfig import DobaContainersConfig
from .Image import Image
from .Port import Port
from .Volume import Volume
| 1.03125 | 1 |
utilities/data_io.py | mahmoud-al-najar/DSPEB | 0 | 12794008 | <filename>utilities/data_io.py
import os
import time
import gdal
import pyproj
import tarfile
import warnings
import numpy as np
import xarray as xr
import pandas as pd
import netCDF4 as nc
import xml.etree.ElementTree as et
import datagen_config as cfg
from datetime import datetime, timedelta
from utilities.common im... | 2.34375 | 2 |
photon/stats.py | logarithm/photon-python | 2 | 12794009 | <reponame>logarithm/photon-python<gh_stars>1-10
"""
Copyright 2015 <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 applicab... | 1.992188 | 2 |
11-20/11-20/_11_20.py | JuYoon-Kim/leaning_python | 0 | 12794010 | <gh_stars>0
num ={2,1,3}
for x in num:
print(x,end="",)
for j in num:
print(j,end="")
for k in num:
print(k,end="")
s = 'Never put off till tomorrow what you can do today.'
print(s.split())
print(s.isalpha())
print(s.isdigit())
print(s.upper())
print(s.lower())
print(s.replace('put','off'))
print(s.startswith('Ne... | 3.53125 | 4 |
bosm2015/events/__init__.py | dvm-bitspilani/BITS-BOSM-2015 | 1 | 12794011 | default_app_config = 'events.apps.EventConfig' | 1.148438 | 1 |
pipda/operator.py | vishalbelsare/pipda | 21 | 12794012 | <gh_stars>10-100
"""Provide the Operator class"""
import operator
from enum import Enum
from functools import wraps
from typing import Any, Callable, Mapping, Tuple, ClassVar, Type
from .context import ContextAnnoType, ContextBase
from .function import Function
class Operator(Function):
"""Operator class, defini... | 3.203125 | 3 |
run_pptx_tagging.py | kmkurn/uxtspwsd | 0 | 12794013 | <reponame>kmkurn/uxtspwsd<filename>run_pptx_tagging.py
#!/usr/bin/env python
# Copyright (c) 2021 <NAME>
from itertools import chain
from pathlib import Path
import math
import os
import pickle
from einops import rearrange
from gensim.models.keyedvectors import KeyedVectors
from rnnr import Event, Runner
from rnnr.a... | 1.898438 | 2 |
cfod/analysis/filterbank/sigproc.py | chime-frb-open-data/chime-frb-data | 6 | 12794014 | """Sigproc header definitions and tools. Slightly modified version of:
https://github.com/scottransom/presto/blob/master/lib/python/sigproc.py
by <NAME>.
<NAME>, <EMAIL>
"""
import struct
header_params = {
"HEADER_START": "flag",
"telescope_id": "i",
"machine_id": "i",
"data_type": "i",
"rawdata... | 2.421875 | 2 |
dataloader.py | sha2nkt/dvs_super_slomo | 3 | 12794015 | <reponame>sha2nkt/dvs_super_slomo
import torch
import torch.utils.data as data
import numpy as np
import cv2
from PIL import Image
import glob
import os, pdb
import random
def populateTrainList(folderPath):
folderList_pre = [x[0] for x in os.walk(folderPath)]
folderList = []
trainList = []
for folder in folderLi... | 2.328125 | 2 |
step2_train_rewarder.py | felixba93/summary-reward-no-reference-master | 0 | 12794016 | import sys
import torch
from torch.autograd import Variable
import numpy as np
import os
from os import path
import argparse
import random
import copy
from tqdm import tqdm
import pickle
from scorer.data_helper.json_reader import read_sorted_scores, read_pair_anno_scores, read_articles, \
read_processed_scores, rea... | 2.234375 | 2 |
config.py | koivunen/connvis | 0 | 12794017 | import argparse
parser = argparse.ArgumentParser(prog="connvis",description='Web-based conntrack that tries to simplify the data for privacy research')
parser.add_argument('--nodnsseed', help='do not seed domains from dnsmasq history',action='store_true')
parser.add_argument('--shell', help='Enable interactive shell',a... | 2.125 | 2 |
program_synthesis/karel/scripts/eval_refinement.py | kavigupta/program_synthesis | 123 | 12794018 | import collections
import cPickle as pickle
import glob
import itertools
import json
import operator
import os
import re
import sys
from program_synthesis.karel.dataset import dataset
from program_synthesis.karel.dataset import executor
from program_synthesis.karel.dataset.karel_runtime import KarelRuntime
from progra... | 1.953125 | 2 |
tests/unit_tests/test_CythonInterfaceMaps.py | HTenkanen/cykhash | 0 | 12794019 | import pyximport;
pyximport.install(setup_args = {"script_args" : ["--force"]},
language_level=3)
import unittest
import uttemplate
import cymapinterfacetester as cyt
from cykhash import Int64to64Map, Int32to32Map, Float64to64Map, Float32to32Map, PyObjectMap
AS_LIST = {'int64' : cyt.as_py_list_... | 1.929688 | 2 |
application/data_entry_review.py | PaulineLc/OpenDoorData | 0 | 12794020 | <reponame>PaulineLc/OpenDoorData<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 27 17:41:41 2016
@author: <NAME>
"""
import models
import data_entry_functions
import linear_model
def main():
# insert tables into database
tables = ['room', 'User', 'module', 'wifi_log', 'timetable', 'survey', ... | 2.25 | 2 |
examples/roberta/test_load_allcorpus.py | linyongnan/fairseq | 0 | 12794021 | <filename>examples/roberta/test_load_allcorpus.py
from fairseq.data.infinibatch.infinibatch_dataset import extract_number_values, word_to_idx
from fairseq.data import Dictionary
from multiprocessing import cpu_count, Pool
import os
import re
import sys
import json
import glob
import math
import torch
from nltk import ... | 2.203125 | 2 |
Splice/markup_gtfs.py | agladstein/RNA-Seq-in-the-Cloud | 0 | 12794022 | <reponame>agladstein/RNA-Seq-in-the-Cloud
#!/usr/bin/env python3
import csv
import sys
import os
import re
infile = sys.argv[1]
outfile = sys.argv[2]
with open(infile, 'rt') as fi, open(outfile, 'wt') as fo:
tblin = csv.reader(fi, delimiter = '\t')
tblout = csv.writer(fo,
delimiter = '\t',
... | 2.359375 | 2 |
tests/node/test_zmq.py | eric-volz/defichainLibrary | 1 | 12794023 | import pytest
from tests.util import createNode
node = createNode()
@pytest.mark.query
def test_getzmqnotifications(): # 01
zmq = node.zmq.getzmqnotifications()
assert zmq or zmq == []
| 2.109375 | 2 |
digits.py | yogya-ch/pyprograms | 0 | 12794024 | # Prints the digits in a given number
n=int(input("give a number "))
l=[]
while n>0:
a=n%10
l.append(a)
n=n//10
l.reverse()
for i in l:
print(i) | 3.75 | 4 |
src/004_join/04/answer.py | negi524/awesomebook | 0 | 12794025 | from pandas._config.config import reset_option
from preprocess.load_data.data_loader import load_hotel_reserve
import pandas as pd
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
def main():
"""全結合処理
顧客ごとに2017年1月〜2017年3月の月間合計利用金額を計算
利用がない日は0とする
日付はチェックイン日付を利用する
... | 3.078125 | 3 |
app/module_load/__init__.py | B02902008/TaipeiWater | 0 | 12794026 | <gh_stars>0
from flask import Blueprint
blue_load = Blueprint('load', __name__)
from . import view | 1.164063 | 1 |
bpmn/utils/string_utils.py | marcelobbfonseca/SFDjango-BPMN | 1 | 12794027 | <reponame>marcelobbfonseca/SFDjango-BPMN<gh_stars>1-10
from re import sub
def snake_case(s):
return '_'.join(
sub('([A-Z][a-z]+)', r' \1',
sub('([A-Z]+)', r' \1',
s.replace('-', ' '))).split()).lower()
| 2.734375 | 3 |
adaboost.py | haidawyl/Mnist | 12 | 12794028 | <filename>adaboost.py
#!/usr/bin/python
# -*- coding:utf-8 -*-
from sklearn.ensemble import AdaBoostClassifier, AdaBoostRegressor
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.preprocessing import StandardScaler
fr... | 2.625 | 3 |
splunk_add_on_ucc_framework/uccrestbuilder/builder.py | artemrys/addonfactory-ucc-generator | 16 | 12794029 | #
# Copyright 2021 Splunk Inc.
#
# 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 writing, so... | 2.078125 | 2 |
bluechannel/customers/urls.py | davemerwin/blue-channel | 4 | 12794030 | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^$', 'customers.views.subscribe', name='subscribe'),
)
| 1.203125 | 1 |
ineedtiles.py | IrupeCanet/psychic-goggles | 0 | 12794031 | <filename>ineedtiles.py
# This program calculates how many tiles you will need
# when tilling a wall or floor (in m2).
length = 3.5
width = 2.3
area = length * width
needed = area * 1.05
print("You need", needed, "tiles in metres squared")
| 3.765625 | 4 |
custom_components/solark/config_flow.py | poldim/HA-solark-PV | 11 | 12794032 | <reponame>poldim/HA-solark-PV<filename>custom_components/solark/config_flow.py<gh_stars>10-100
import re
from urllib.parse import urlparse
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_SCAN_INTERVAL
from homeassistant.core import HomeAssistant, callback
import volu... | 2.453125 | 2 |
pacote dawload/projetos progama em Python/desafio071 Simulador de caixa eletronico.py | wagnersistemalima/Mundo-2-Python-Curso-em-Video | 1 | 12794033 | #Desafio Simulador de caixa eletronico
# Crie um progama que simule o funcionamento de um caixaeletrônico. No inicio, pergunte ao usuario
# qual será o valor a ser sacado (número inteiro) e o progama vai informar quantas cedulas de cada valor
# serão entregues. OBS: Considere o caixa possui cedulas de R$50,00 / R$20,00... | 3.953125 | 4 |
src/scruples/scripts/analyze/resource/human_performance.py | allenai/scruples | 29 | 12794034 | """Estimate human performance for the scruples resource."""
import json
import logging
import click
from ....baselines.metrics import METRICS
logger = logging.getLogger(__name__)
# main function
@click.command()
@click.argument(
'split_path',
type=click.Path(exists=True, file_okay=True, dir_okay=False))... | 2.765625 | 3 |
tests/unit/resources/test_stream_utils.py | ebit-wise/pipelinewise-target-bigquery | 0 | 12794035 | import unittest
from datetime import datetime
from target_bigquery import stream_utils
class TestStreamUtils(unittest.TestCase):
"""
Unit Tests
"""
def test_add_metadata_values_to_record(self):
"""Test adding metadata"""
dt = "2017-11-20T16:45:33.000Z"
record = { "type": "REC... | 2.734375 | 3 |
settings.py | GlycerinLOL/Hwa_autobuy | 0 | 12794036 | <reponame>GlycerinLOL/Hwa_autobuy<filename>settings.py
URL = "https://www.huahuacomputer.com.tw/products/gigabyte-%E6%8A%80%E5%98%89-aorus-15g-yb-%E6%A9%9F%E6%A2%B0%E8%BB%B8%E9%9B%BB%E7%AB%B6%E7%AD%86%E9%9B%BB-1"
DRIVER_PATH = "chromedriver.exe"
CHROME_PATH = r"--user-data-dir=C:\\Users\brian\AppData\\Local\\Google\\Ch... | 1.976563 | 2 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/ElementStructuralTypeFilter.py | YKato521/ironpython-stubs | 0 | 12794037 | <reponame>YKato521/ironpython-stubs<filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/ElementStructuralTypeFilter.py
class ElementStructuralTypeFilter(ElementQuickFilter, IDisposable):
"""
A filter used to find elements matching a structural type.
ElementStructuralTypeFilter(structuralType: St... | 2.015625 | 2 |
crossbox/tests/test_session.py | acascarla/crossbox | 0 | 12794038 | <reponame>acascarla/crossbox
import datetime
from http import HTTPStatus
from freezegun import freeze_time
from django.urls import reverse
from crossbox.tests.mixins import BaseTestCase
from crossbox.tests.tools import with_login, create_session
from crossbox.models.day import Day
from crossbox.models.hour import Hou... | 2.03125 | 2 |
TOV_mmdetection/mmdet/models/point/dense_heads/__init__.py | ucas-vg/PointTinyBenchmark | 10 | 12794039 | from .cpr_head import CPRHead
from .p2p_head import P2PHead
__all__ = [
'CPRHead', 'P2PHead',
]
| 1.078125 | 1 |
channels/hokutonoken.py | sodicarus/channels | 0 | 12794040 | # -*- coding: utf-8 -*-
# StreamOnDemand Community Edition - Kodi Addon
# ------------------------------------------------------------
# streamondemand.- XBMC Plugin
# Canale per I <NAME>
# http://www.mimediacenter.info/foro/viewforum.php?f=36
# ------------------------------------------------------------
import re
f... | 2.03125 | 2 |
sns_lambda_update_ssl_rule/functions/update_ssl_rule.py | GMADLA/terraform-aws-ecs-web-app | 0 | 12794041 | import os
import json, boto3
def lambda_handler(event, context):
print("Trigger Event: ")
print(event)
region = os.environ['REGION']
elbv2_client = boto3.client('elbv2', region_name=region)
available_target_groups = os.environ['AVAILABLE_TARGET_GROUPS']
arr_available_target_groups = available_... | 2.203125 | 2 |
src/get_demographics.py | pthangaraj/Stroke-Phenotyping | 0 | 12794042 | #By <NAME> (<EMAIL>), <NAME> Lab at Columbia University Irving Medical Center
#Part of manuscript: "Comparative analysis, applications, and interpretation of electronic health record-based stroke phenotyping methods"
#This script prints out the demographics of all of the models' training sets
import numpy as np
import... | 2.046875 | 2 |
apis/worldtime.py | CantSayIHave/OllieBotCore_v3 | 4 | 12794043 | # worldtime module by CantSayIHave
# Created 2018/01/12
#
# Fetch time and date from a location
# Uses Google Geocoding API and Google Time Zone API
import aiohttp
import time
from datetime import datetime
API_GEOCODE = 'https://maps.googleapis.com/maps/api/geocode/json?'
API_TIMEZONE = 'https://maps.googleapis.com/... | 3.296875 | 3 |
generateData.py | NumericalMax/Linear-Regression | 2 | 12794044 | import numpy as np
from matplotlib import pyplot as plt
n = 100
x = range(0,n)
y = range(0,n)
for k in range(0, n):
y[k] = y[k] + 3*np.random.randn() + 100
plt.figure(figsize=(20,10))
plt.scatter(x, y)
plt.savefig("./images/rawData.png")
X = np.zeros([n,1])
target = np.zeros([n,1])
X[:,0] = x
target[:,0] = y
np.... | 3.234375 | 3 |
django_typograf/admin.py | movermeyer/django-typograf | 1 | 12794045 | <reponame>movermeyer/django-typograf
from django.contrib import admin
from django_typograf.utils import get_typograf_field_name, get_typograf_hash_field_name
class TypografAdmin(admin.ModelAdmin):
""" Admin class for hide typograf fields from admin site """
def _exclude(self, obj=None):
""" Mark typ... | 2.015625 | 2 |
Server/Graph-Tests/generationpiechart.py | danielvanpaass/Demonstrator | 0 | 12794046 | <gh_stars>0
import plotly.graph_objects as go
data = {'pv':[1,4,1,2,4,2],
'wind':[1,2,5,3,2,0],
'net':[10,2,5,0,2,0]}
tot_net= sum(data['net'])
tot_pv = sum(data['pv'])+tot_net*0.05
tot_wind= sum(data['wind'])*0.08
tot_gas=tot_net*0.45
tot_coal=tot_net*0.32
tot_oil=tot_net*0.04
tot_nuclear=tot_net*0... | 2.9375 | 3 |
datetime/main.py | minister19/Python_snippets | 0 | 12794047 | from time import timezone
import pandas as pd
from datetime import datetime
# print(datetime.fromtimestamp(1603209600))
# print(datetime.fromtimestamp(1612868324294/1000))
# print(datetime.fromtimestamp(1613283396746//1000))
print(datetime.fromtimestamp(1640851200))
print(datetime.fromtimestamp(1640649600))
print(date... | 2.765625 | 3 |
第5章/program/Chapter_5_xpath_special.py | kingname/SourceCodeOfBook | 274 | 12794048 | import lxml.html
html1 = '''
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="test-1-k">需要的内容1</div>
<div id="test-2-k">需要的内容2</div>
<div id="testfault-k">需要的内容3</div>
<div id="useless">这是我不需要的内容</div>
</body>
</html>
'''
# selector = lxml... | 3.5625 | 4 |
tests/conftest.py | williamjmorenor/now-lms | 0 | 12794049 | import pytest
from now_lms import init_app, lms_app
lms_app.app_context().push()
@pytest.fixture(scope="package", autouse=True)
def setup_database():
init_app()
| 1.515625 | 2 |
week 2/datatype.py | marksikaundi/Computer-Programming-with-Python | 2 | 12794050 | <filename>week 2/datatype.py
print("this is dataype") | 1.492188 | 1 |