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 |
|---|---|---|---|---|---|---|
startup/users/30-user-Katz.py | NSLS-II-SMI/profile_collection | 0 | 12778051 | <gh_stars>0
def alignement_katz_2021_1():
global names, x_piezo, y_piezo, z_piezo, incident_angles, y_piezo_aligned
names = ['sample1', 'sample2', 'sample3', 'sample4', 'sample5', 'sample6', 'sample7']
x_piezo = [ 55000, 42000, 19000, 2000, -16000, -31000, -49000]
y_piezo ... | 1.984375 | 2 |
cornflow-dags/DAG/update_all_schemas.py | baobabsoluciones/cornflow | 1 | 12778052 | # General imports
import importlib as il
import os
import sys
# Partial imports
from airflow.operators.python import PythonOperator
from airflow.models import Variable
from airflow import DAG
from airflow.utils.db import create_session
from datetime import datetime, timedelta
from typing import List
# Import from cor... | 2.296875 | 2 |
app/language_r/r_lang_obj.py | jwons/raas | 0 | 12778053 | <gh_stars>0
import os
import subprocess
import json
import docker
import re
from glob import glob
from app.languageinterface import LanguageInterface
from app.languageinterface import StaticAnalysisResults
from app.language_r.preproc_helpers import all_preproc
from shutil import copy
# Debugging
from celery.contrib i... | 2.171875 | 2 |
results/informer_dataset_ftS_sl96_ll48_pl24_dm512_nh8_el2_dl1_df2048_atprob_fc5_ebtimeF_dtTrue_mxTrue_test_0/test.py | LeoYoung1996/Experiment | 0 | 12778054 | <gh_stars>0
"""
@Time : 2021/12/15 17:23
@Author : Leo
@FileName: test.py
@SoftWare: PyCharm
@description:
"""
import numpy as np
a = np.load('true.npy')
b = np.load('pred.npy')
print(a[0])
print("-----------------------------------------------")
print(b[0]) | 1.960938 | 2 |
python/day1/main.py | kp42/aoc2020 | 0 | 12778055 | <filename>python/day1/main.py
import functools
import random
def first_part(data):
current = None
used_lines = []
not_found = True
while not_found:
current = None
for line in data:
int_line = int(line)
if current is None and int_line not in used_lines:
... | 3.765625 | 4 |
stimuli/Python/one_file_per_item/en/36_# math_for 18.py | ALFA-group/neural_program_comprehension | 6 | 12778056 | <reponame>ALFA-group/neural_program_comprehension
start = 3
total = 0
for i in range(start, -1, -1):
total -= i*i
print(total)
| 2.984375 | 3 |
zerobin.py | bmintz/python-snippets | 2 | 12778057 | <reponame>bmintz/python-snippets<filename>zerobin.py<gh_stars>1-10
#!/usr/bin/env python3
# encoding: utf-8
import asyncio
import base64
import json
import logging
import os
import zlib
import aiohttp
import sjcl
log = logging.getLogger(__name__)
def get_surrogate(cpt):
num = cpt - 0x010000
return ((num & ... | 2.375 | 2 |
satemdata/feature/utils.py | energyandcleanair/satem_data | 0 | 12778058 | <gh_stars>0
import datetime as dt
from . import DATE_FORMAT
def get_feature_date(feature):
return dt.datetime.strptime(feature['date'], DATE_FORMAT)
def clean_date(date):
if isinstance(date, dt.datetime):
return date
if isinstance(date, dt.date):
return dt.datetime.combine(date, dt.date... | 2.90625 | 3 |
code/vae_train/vae_encoder.py | GT-SALT/Persuasive-Orderings | 12 | 12778059 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from vae_train.vae_utils import *
class Encoder(nn.Module):
def __init__(self, embedding_size=128, n_highway_layers=0, encoder_hidden_size=128, n_class=None, encoder_layers=1, bidirectional=False):
super(Encoder, self).__... | 2.609375 | 3 |
fun.py | OfficialZandrex/discord-zeebot | 0 | 12778060 | <filename>fun.py
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import json
import os
import chalk
import youtube_dl
import random
import io
import aiohttp
import time
import datetime
from datetime import datetime as dt
import logging
import re
from i... | 2.71875 | 3 |
cellcutter/alpha/modeling/common.py | jiyuuchc/cellcutter | 5 | 12778061 | <reponame>jiyuuchc/cellcutter<gh_stars>1-10
import tensorflow as tf
import tensorflow.keras.layers as layers
class BatchConv2D(tf.keras.layers.Layer):
def __init__(self, num_filters, size = 3, activation = 'relu', name=None, **kwargs):
super(BatchConv2D, self).__init__(name=name)
self._config_dict ... | 2.21875 | 2 |
gcp_airflow_foundations/source_class/gcs_source.py | badal-io/gcp-airflow-foundations | 3 | 12778062 | <reponame>badal-io/gcp-airflow-foundations
from dataclasses import fields
from os import X_OK
from urllib.parse import urlparse
from dacite import from_dict
from dataclasses import dataclass
from airflow.operators.dummy import DummyOperator
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.oper... | 2.234375 | 2 |
src/features/build_features.py | denizhankara/Multi-class-classification-task | 0 | 12778063 | <gh_stars>0
#from src.data.make_dataset import main
def f():
lst = [lambda : i**2 for i in range(100)]
return lst[0]()
if __name__ == "__main__":
f()
pass | 2.03125 | 2 |
code-files/frosch2010_Tabu_language.py | Frosch2010/discord-tabu | 2 | 12778064 | from frosch2010_Tabu_settings import tabu_settings
class tabu_language:
tabu_wrong_arguments = ""
tabu_game_already_running = ""
tabu_no_game_running = ""
tabu_more_players_needed = ""
tabu_user_already_joined = ""
tabu_user_joined_game = ""
tabu_user_started_game = ""
... | 1.875 | 2 |
controller/controller/manage_pods.py | emattia/sigopt-python | 67 | 12778065 | <reponame>emattia/sigopt-python
from http import HTTPStatus
from kubernetes.client.exceptions import ApiException as KubernetesApiException
import logging
import signal
import threading
from sigopt.run_context import RunContext
from controller.create_pod import create_run_pod
from controller.event_repeater import Even... | 1.890625 | 2 |
riscemu/instructions/RV32A.py | jodalyst/riscemu | 9 | 12778066 | from .InstructionSet import InstructionSet, LoadedInstruction
from ..Exceptions import INS_NOT_IMPLEMENTED
from ..helpers import int_from_bytes, int_to_bytes, to_unsigned, to_signed
class RV32A(InstructionSet):
"""
The RV32A instruction set. Currently, load-reserved and store conditionally are not supported
... | 2.296875 | 2 |
apps/interactor/interactor/commander/animations.py | Djelibeybi/photons | 51 | 12778067 | from photons_canvas.animations import register, AnimationRunner
from photons_canvas.animations.action import expand
from photons_app.errors import PhotonsAppError
from photons_app import helpers as hp
from delfick_project.option_merge import MergedOptions
from delfick_project.norms import sb
from textwrap import dede... | 1.984375 | 2 |
src/uploader.py | Marcellofabrizio/Python-Scheduled-Backup-Service | 0 | 12778068 | <filename>src/uploader.py
import os
import boto3
import logging
from botocore.exceptions import NoCredentialsError
from botocore.exceptions import ClientError
from file_handler import remove_file
AWS_ACCESS_KEY_ID= 'YOUR AWS ID '
AWS_SECRET_ACCESS_KEY= 'YOUR SUPER SECRET AWS ACCESS KEY'
def upload_to_aws(file_name, b... | 2.703125 | 3 |
lib/python/treadmill/scheduler/zkbackend.py | bretttegart/treadmill | 2 | 12778069 | <gh_stars>1-10
"""Zookeeper scheduler/master backend.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import kazoo
from treadmill import zknamespace as z
from treadmill import zkutils
from . impo... | 1.953125 | 2 |
guillotina_volto/interfaces/image.py | enfold/guillotina-volto | 5 | 12778070 | <gh_stars>1-10
from zope.interface import Interface
class IHasImage(Interface):
pass
| 0.832031 | 1 |
tests/test_echo_clips.py | hainesm6/basicsynbio | 0 | 12778071 | <reponame>hainesm6/basicsynbio
from platemap.PlateUtils import add_volume
from platemap.plate import Plate
import basicsynbio as bsb
import zipfile
import os
import pandas as pd
import numpy as np
from pathlib import Path
import pytest
from .test_fixtures import small_build_example
def getLinkerPlate():
linkerPla... | 2.03125 | 2 |
ret_benchmark/losses/contrastive_loss.py | alibaba-edu/Ranking-based-Instance-Selection | 20 | 12778072 | <reponame>alibaba-edu/Ranking-based-Instance-Selection<gh_stars>10-100
from __future__ import absolute_import
import torch,pickle
from torch import nn
from torch.autograd import Variable
import numpy as np
from ret_benchmark.losses.registry import LOSS
from ret_benchmark.utils.log_info import log_info
import os
@LOSS... | 1.882813 | 2 |
tests/unit/test_table_pandas.py | KoffieLabs/python-bigquery | 1 | 12778073 | # Copyright 2021 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 2.140625 | 2 |
common/aist_common/grammar/observation_in_collection.py | sfahad1414/AGENT | 15 | 12778074 | from aist_common.grammar.observation import Observation
class ObservationInCollection(Observation):
def __init__(self):
super().__init__()
self.capture = None
def with_capture(self, capture):
self.capture = capture
def __str__(self):
output = "OBSERVE" if self.observe els... | 2.796875 | 3 |
handlers/users/change_datas.py | KARTASAR/DatingBot | 12 | 12778075 | <reponame>KARTASAR/DatingBot
from keyboards.inline.lifestyle_choice_inline import lifestyle_inline_kb
from keyboards.inline.change_profile_inline import change_profile_kb
from aiogram.utils.exceptions import MessageToReplyNotFound
from aiogram.types import CallbackQuery, ContentType
from keyboards.inline.main_menu impo... | 2.21875 | 2 |
backend/app/app/db/init_db.py | reppertj/earworm | 18 | 12778076 | <reponame>reppertj/earworm
from sqlalchemy.orm import Session
from app import crud, schemas
from app.core.config import settings
from app.db import base # noqa: F401
# make sure all SQL Alchemy models are imported (app.db.base) before initializing DB
# otherwise, SQL Alchemy might fail to initialize relationships pr... | 2 | 2 |
train/basketball/multi.py | jypark0/mrtl | 10 | 12778077 | <reponame>jypark0/mrtl
import logging
import os
import time
from math import ceil
import torch
import utils
from config import config
from train.basketball import model
from train.basketball.model import DataParallelPassthrough
logger = logging.getLogger(config.parent_logger_name).getChild(__name__)
class Basketba... | 2.203125 | 2 |
fonts/font10mono.py | robert-hh/SSD1963-TFT-Library-for-PyBoard | 16 | 12778078 | <reponame>robert-hh/SSD1963-TFT-Library-for-PyBoard<filename>fonts/font10mono.py
# Code generated by cfonts_to_trans_py.py
import TFTfont
_font10mono = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\
b'\x00\x02\x00\x80\x20\x08\x02\x00\x80\x20\x08\x02\x00\x80\x00\x08\x00\x00\x00\x00'... | 1.882813 | 2 |
starter_code/organism/utilities.py | mbchang/societal-decision-making | 38 | 12778079 | <gh_stars>10-100
from collections import OrderedDict
import numpy as np
def get_second_highest_bid(bids, winner):
if len(bids) == 1:
second_highest_bid = 0
else:
second_highest_bid = -np.inf
for index, b in bids.items():
if b > second_highest_bid and index != winner:
... | 2.515625 | 3 |
data/load_local_dataset.py | marridG/2020-EI339 | 0 | 12778080 | import os
import inspect
from tqdm import tqdm
import numpy as np
import typing
import cv2
import torchvision
import torch
from PIL import Image
from torch.utils.data import Dataset, DataLoader
# root (correct even if called)
CRT_ABS_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# ke... | 2.3125 | 2 |
gym_flock/__init__.py | katetolstaya/gym-flock | 19 | 12778081 | <filename>gym_flock/__init__.py
from gym.envs.registration import register
register(
id='ExploreEnv-v0',
entry_point='gym_flock.envs.spatial:ExploreEnv',
max_episode_steps=100000,
)
register(
id='ExploreFullEnv-v0',
entry_point='gym_flock.envs.spatial:ExploreFullEnv',
max_episode_steps=100000,... | 1.5625 | 2 |
divide_them_all.py | SamTech803/Miscellaneous-Tasks | 0 | 12778082 | def center(s):
if s[0] == 1:
x = (s[1] + s[5]) / 2
y = (s[2] + s[6]) / 2
return [x, y]
elif s[0]==0:
return [s[2], s[3]]
else:
print("Invalid Inputs!")
n = int(input("Enter Number of Targets:"))
lst = []
if n >= 1 and n <= 100000:
for i in range(n)... | 3.3125 | 3 |
testme.py | linrio/WhetherOrNotMe | 0 | 12778083 | # -*- coding utf-8 -*-
import cv2
import os
import numpy as np
from sklearn.model_selection import train_test_split
import random
import tensorflow as tf
def read_data(img_path, image_h = 64, image_w = 64):
image_data = []
label_data = []
image = cv2.imread(img_path)
#cv2.namedWindow("Image... | 3.0625 | 3 |
examples/urlopen.py | mikelolasagasti/bandit | 4,016 | 12778084 | ''' Example dangerous usage of urllib[2] opener functions
The urllib and urllib2 opener functions and object can open http, ftp,
and file urls. Often, the ability to open file urls is overlooked leading
to code that can unexpectedly open files on the local server. This
could be used by an attacker to leak information ... | 3.5 | 4 |
src/feature.py | junha-l/DHVR | 28 | 12778085 | import logging
import os
from abc import ABC
import gin
import MinkowskiEngine as ME
import numpy as np
import open3d as o3d
import torch
from src.models import get_model
class BaseFeatureExtractor(ABC):
def __init__(self):
logging.info(f"Initialize {self.__class__.__name__}")
def extract_feature(s... | 2.109375 | 2 |
wrex/meeting/section_kind.py | mikiTesf/wrex-py | 1 | 12778086 | <filename>wrex/meeting/section_kind.py
from enum import Enum
class SectionKind(Enum):
TREASURES = "TREASURES"
IMPROVE_IN_MINISTRY = "IMPROVE_IN_MINISTRY"
CHRISTIAN_LIVING = "CHRISTIAN_LIVING"
| 2.1875 | 2 |
src/datamodules/mouse_datamodule.py | Jaakik/hydra-ml | 0 | 12778087 | <reponame>Jaakik/hydra-ml<filename>src/datamodules/mouse_datamodule.py
from typing import Optional, Tuple
from .datasets.mouse_dataset import MouseDataset
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader, Dataset, random_split
from torchvision.transforms import transforms
clas... | 2.53125 | 3 |
.github/scripts/process_commit.py | vitaut/pytorch | 1 | 12778088 | <gh_stars>1-10
#!/usr/bin/env python3
"""
This script finds the merger responsible for labeling a PR by a commit SHA. It is used by the workflow in
'.github/workflows/pr-labels.yml'. If there exists no PR associated with the commit or the PR is properly labeled,
this script is a no-op.
Note: we ping the merger only, n... | 2.171875 | 2 |
src/Core/BetaFunctions/YukawaCouplings.py | NuxDD/pyrate | 7 | 12778089 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from sympy import transpose, Rational as r
from .BetaFunction import BetaFunction
from Definitions import tensorContract
class YukawaBetaFunction(BetaFunction):
def compute(self, a,i,j, nLoops):
ret = self.Beta(a,i,j, nLoops=nLoops)
if i!=j:... | 2.484375 | 2 |
dynamic/hanoi_dp.py | goldsborough/algs4 | 17 | 12778090 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
import copy
from collections import namedtuple
Move = namedtuple('Move', 'source, target, disc')
def hanoi(discs):
seen = set()
def __solve(rods, depth=0):
if len(rods[2]) == discs:
return []
if rods in seen:
return None
seen.add(rods)
best ... | 3.71875 | 4 |
registrator.py | anbo-de/PythonClientForSpringBootAdmin | 2 | 12778091 | import threading
import time
import requests
import json
import logging
from requests.auth import AuthBase, HTTPBasicAuth
class Registrator(threading.Thread):
"""
class running as thread to contact the Spring Boot Admin Server
"""
jsonHeaders = {"Content-type": "application/json",
... | 2.65625 | 3 |
Python/JSON/readCPU.py | Mastermindzh/Code-examples | 0 | 12778092 | <reponame>Mastermindzh/Code-examples<gh_stars>0
# Python read JSON example :)
# execute: clear && python3 readCPU.py
# make sure "example.json" resides in the same directory as this file
import json
from pprint import pprint
#lees json file in (of voer script uit die het maakt)
with open('example.json') as inputFile:... | 3.453125 | 3 |
backend/player_management/models.py | flokain/ulti-players | 0 | 12778093 | <filename>backend/player_management/models.py
from datetime import date
from random import choices
from django.contrib.auth.models import User
from django.db import models
from django.contrib.auth import models as authModels
# Create your models here.
class Person(models.Model):
SEX = [
['male']*2,
... | 3.0625 | 3 |
WebBrickLibs/EventHandlers/HVAC.py | AndyThirtover/wb_gateway | 0 | 12778094 | # Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence
# $Id: HVAC.py 3201 2009-06-15 15:21:25Z philipp.schuster $
#
# Heating, Ventilation and Air Conditioning File
#
# This file includes the following classes to create a full HVAC solution
# class HeatingVentilationAC( BaseHandler ):
# ... | 2.390625 | 2 |
modules/structure.py | zhester/hzpy | 3 | 12778095 | ##############################################################################
#
# structure.py - Structure Data Access Class
#
##############################################################################
import struct
#=============================================================================
class structur... | 3.0625 | 3 |
python_web/config.py | LouisYZK/Frodo | 123 | 12778096 | import os
import configparser
import yaml
import ast
from pathlib import Path
HERE = Path(__file__).parent.absolute()
print(HERE)
config_dir = HERE / 'config/config.ini.model'
config = configparser.ConfigParser()
config.read(config_dir)
ACCESS_TOKEN_EXPIRE_MINUTES = config.get('security', 'access_token_expire_minute... | 2.0625 | 2 |
examples/gurobipy/metrorail/create_xls_file.py | adampkehoe/ticdat | 15 | 12778097 | <filename>examples/gurobipy/metrorail/create_xls_file.py
# Use this file to convert the metrorail_sample_data.json data set
# to Excel format.
#
# python create_xls_file.py
#
# will create a file named Metro Rail Data.xlsx.
#
# metrorail.py will produce the same result regardless of whether
# it is run on metrorail_... | 2.828125 | 3 |
flydra_core/flydra_core/align.py | elhananby/flydra | 45 | 12778098 | <filename>flydra_core/flydra_core/align.py
from __future__ import print_function
import numpy as np
import scipy.linalg
def estsimt(X1, X2):
# from estsimt.m in MultiCameSelfCal
# ESTimate SIMilarity Transformation
#
# [s,R,T] = estsimt(X1,X2)
#
# X1,X2 ... 3xN matrices with corresponding 3D ... | 3.171875 | 3 |
src/base/XVII/getLastEventID.py | sockball/logistics | 3 | 12778099 | <gh_stars>1-10
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pip3 install requests PyExecJS
# linux下同时需要nodejs环境或其他JS Runtime
import execjs
import sys, getopt
import re, requests, json
def getWaybillNo ():
# sys.argv[1:]表示取索引1之后的值, 0为文件名
# c: 表示短选项 -c 后面应有参数
# code= 表示长选项 --code 后应有参数
# options为分析出的格式信... | 2.546875 | 3 |
ros_system_ws/src/vector79/scripts/light_system.py | DrClick/ARCRacing | 7 | 12778100 | <filename>ros_system_ws/src/vector79/scripts/light_system.py<gh_stars>1-10
#!/usr/bin/env python
import rospy
import socket
from std_msgs.msg import String
import serial
import time
import subprocess
#TODO: figure out how to figure out this port programatically
_serial = serial.Serial('/dev/ttyUSB0', 115200, timeout=... | 2.25 | 2 |
data_collection/misc/manual_ir_test.py | PUTvision/thermo-presence | 0 | 12778101 | <gh_stars>0
"""
Code example from
https://makersportal.com/blog/2020/6/8/high-resolution-thermal-camera-with-raspberry-pi-and-mlx90640
"""
##########################################
# MLX90640 Thermal Camera w Raspberry Pi
# -- 2Hz Sampling with Simple Routine
##########################################
#
import time,b... | 2.859375 | 3 |
src/core.py | OdatNurd/OdatNurdTestPackage | 1 | 12778102 | import sublime
import sublime_plugin
import os
from ..lib import log, setup_log_panel, yte_setting, dotty
from ..lib import select_video, select_playlist, select_tag, select_timecode
from ..lib import Request, NetworkManager, stored_credentials_path, video_sort
# TODO:
# - Hit the keyword in the first few lines and... | 1.671875 | 2 |
src/client.py | tomkcook/tunnel-server | 3 | 12778103 | #!/usr/bin/env python3
from argparse import ArgumentParser
from util import startTunnel, stopTunnel, addressesForInterface, srcAddressForDst
import logging
import signal
import requests
import socket
def main():
parser = ArgumentParser()
parser.add_argument("--bridge", type=str)
parser.add_argument("remot... | 3.046875 | 3 |
release/stubs.min/System/Windows/Forms/__init___parts/KeysConverter.py | tranconbv/ironpython-stubs | 0 | 12778104 | <reponame>tranconbv/ironpython-stubs
class KeysConverter(TypeConverter,IComparer):
"""
Provides a System.ComponentModel.TypeConverter to convert System.Windows.Forms.Keys objects to and from other representations.
KeysConverter()
"""
def Instance(self):
""" This function has been arbitrarily put into ... | 3.015625 | 3 |
erasmus/protocols.py | gpontesss/Erasmus | 10 | 12778105 | from __future__ import annotations
from typing import Protocol
from .data import Passage, SearchResults, VerseRange
class Bible(Protocol):
command: str
name: str
abbr: str
service: str
service_version: str
rtl: bool | None
books: int
class Service(Protocol):
async def get_passage(s... | 2.921875 | 3 |
tensorflow/ac_to_tf.py | nimish15shah/AC_GPU_profiling | 0 | 12778106 |
## This file converts ac to tensorflow graph
## It takes as input a pickle file which contains the AC as a dictionary
## Each value in the dictionary is node_obj class object from Nimish's graph_analysis project
import tensorflow as tf
import pickle
import networkx as nx
import random
import numpy as np
def loa... | 2.765625 | 3 |
deepcave/runs/converters/bohb.py | PhMueller/DeepCAVE | 0 | 12778107 | import os
import json
import glob
import pandas as pd
from typing import Dict, Type, Any
import ConfigSpace
from deepcave.runs.run import Status
from deepcave.runs.converters.converter import Converter
from deepcave.runs.run import Run
from deepcave.runs.objective import Objective
from deepcave.utils.hash import file_... | 2.296875 | 2 |
utils.py | minsukchang/exponential_family_embeddings | 86 | 12778108 | <filename>utils.py
# The functions below are copied from this tutorial:
# https://github.com/tensorflow/tensorflow/blob/r0.11/tensorflow/examples/tutorials/word2vec/word2vec_basic.py
#
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... | 2.6875 | 3 |
tests/io/polling/serial/endpoints_console.py | ethanjli/phyllo-python | 0 | 12778109 | <reponame>ethanjli/phyllo-python<filename>tests/io/polling/serial/endpoints_console.py
"""Expose an example endpoints text console on the polling I/O implementation."""
# Builtins
import logging
import time
# Packages
from phylline.links.clocked import ClockedLink, LinkClockRequest
from phylline.util.timing import ... | 2.234375 | 2 |
pandas_api/mit_model.py | cfong32/lpp | 0 | 12778110 | import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from xgboost import XGBRegressor
import os
from django.conf import settings
import numpy as np
from functools import lru_cache
RANDOM_STATE = 42
def get_path(course, file):
return os.path.join(settings.PROJECT_ROOT, '..', 'pandas_api', 'static', ... | 2.53125 | 3 |
BKGLycanExtractor/attic/basenamefrompath.py | glygen-glycan-data/GlycanImageExtract | 0 | 12778111 | <reponame>glygen-glycan-data/GlycanImageExtract
import ntpath
path = "test/p19-578.png"
basename = ntpath.basename(path).split('.')[0]
print(basename) | 1.90625 | 2 |
vedastr/metrics/__init__.py | csmasters/vedastr | 475 | 12778112 | from .accuracy import Accuracy
from .builder import build_metric
| 1.070313 | 1 |
c14/p274_test1442.py | pkingpeng/-python- | 0 | 12778113 | import json
pythonValueDic = {
'name': 'zhangsan',
'isCat': True,
'miceCaught': 0
}
data = json.dumps(pythonValueDic)
print(data)
"""
{"name": "zhangsan", "isCat": true, "miceCaught": 0}
"""
| 2.765625 | 3 |
demo/user_roles/endpoints/admin.py | seijihirao/apys | 4 | 12778114 | filters = [
'check_params',
['auth.is_owner', 'auth.is_admin']
]
def post(req, api):
"""
return success if user has rights to access server
user needs to have role owner or admin
Input:
role: string
Output:
result: string
"""
return {
'result': 'success'
... | 2.140625 | 2 |
alipay/aop/api/domain/ApInvoiceBillLinkOrderRequest.py | antopen/alipay-sdk-python-all | 213 | 12778115 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi
class ApInvoiceBillLinkOrderRequest(object):
def __init__(self):
self._amt = None
self._daily_bill_... | 2.171875 | 2 |
packages/pyright-internal/src/tests/samples/paramSpec4.py | Jasha10/pyright | 3,934 | 12778116 | # This sample tests the type checker's handling of ParamSpec
# and Concatenate as described in PEP 612.
from typing import Callable, Concatenate, ParamSpec, TypeVar
P = ParamSpec("P")
R = TypeVar("R")
class Request:
...
def with_request(f: Callable[Concatenate[Request, P], R]) -> Callable[P, R]:
def inner... | 3.234375 | 3 |
src/Actions/While.py | willfleetw/Joy | 2 | 12778117 | <gh_stars>1-10
from Actions.Action import Action
from Actions.Condition import ConditionEvaluator, ConditionSet
class While(Action, ConditionEvaluator):
_actions: list[Action]
def __init__(self, condition_sets: list[ConditionSet] = [], actions: list[Action] = []) -> None:
self._condition_sets = condit... | 2.5625 | 3 |
PyCTPM/core/config.py | sinagilassi/CTPM | 1 | 12778118 | # CONFIG APP
# -----------
# import packages/modules
import enum
# app config
appConfig = {
"calculation": {
"roundAccuracy": 2,
"roundAccuracyRoot": 4
}
}
# round function accuracy
ROUND_FUN_ACCURACY = appConfig['calculation']['roundAccuracy']
# eos root accuracy
EOS_ROOT_ACCURACY = appConfi... | 2.0625 | 2 |
manage.py | Semprini/cbe-telco | 1 | 12778119 | <reponame>Semprini/cbe-telco
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "utilities.settings")
if len(sys.argv) == 5 and sys.argv[1] == "createsuperuser":
# when used as python manage.py createsuperuser <username> <email> <passw... | 2.171875 | 2 |
dataset/test.py | DavidZechm/BikeSight | 0 | 12778120 | <reponame>DavidZechm/BikeSight<gh_stars>0
import cv2
def click_event(event, x, y, flags, param):
global img
if event == cv2.EVENT_LBUTTONDOWN:
print(x,y)
cv2.circle(img, (x, y), 10, (0, 0, 255), -1)
cv2.imshow('image', img)
if event == cv2.EVENT_RBUTTONDBLCLK:
img = cv2.imr... | 2.71875 | 3 |
pyjobs/core/migrations/0015_job_ad_interested.py | Mdslino/PyJobs | 132 | 12778121 | <filename>pyjobs/core/migrations/0015_job_ad_interested.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-04 18:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0014_auto_20180... | 1.40625 | 1 |
src/protocols/create_water_container/protocol.py | scottbecker/delve_tx_public | 2 | 12778122 | <reponame>scottbecker/delve_tx_public
from __future__ import print_function
from transcriptic_tools.utils import ml, ul
from transcriptic_tools.harness import run
from transcriptic_tools.custom_protocol import CustomProtocol as Protocol
from autoprotocol.protocol import Container
def main(p, params):
assert is... | 2.109375 | 2 |
grip/model/test/test_dependency.py | Eugeny/grip | 16 | 12778123 | import pkg_resources
import unittest
from grip.model import Dependency, Version, Package
class TestDependency(unittest.TestCase):
def test_ctor_str(self):
dep = Dependency('django==2.0')
self.assertEqual(dep.name, 'django')
self.assertTrue(dep.matches_version('2.0'))
self.assertFal... | 2.546875 | 3 |
modules/sensor_stat/api_controllers.py | srcc-msu/job_statistics | 0 | 12778124 | from flask import Blueprint, Response, request, jsonify
from sqlalchemy import func
from application.database import global_db
from application.helpers import crossdomain, gen_csv_response
from core.monitoring.models import SENSOR_CLASS_MAP
sensor_stat_api_pages = Blueprint('sensor_stat_api', __name__
, template_fol... | 2.21875 | 2 |
src/blueprints/legal/__init__.py | primeithard/yandex-disk-telegram-bot | 15 | 12778125 | <reponame>primeithard/yandex-disk-telegram-bot
from .bp import bp as legal_blueprint
from . import views
| 1.015625 | 1 |
spongeauth/accounts/migrations/0004_create_dummy_group.py | felixoi/SpongeAuth | 10 | 12778126 | <reponame>felixoi/SpongeAuth
# -*- coding: utf-8 -*-
# Creates "Dummy" group, used to flag dummy accounts created by API.
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
Group = apps.get_model("accounts", "Group")
db_alias = schema_editor.conne... | 2.25 | 2 |
pollsapp/tests.py | queenfiona/polls | 0 | 12778127 | """docstring for pollsapp tests."""
import datetime
from django.test import TestCase, Client
from django.utils import timezone
from django.urls import reverse
from .models import Question
client = Client()
def create_question(question_text, days):
"""Create a question and add no. of days to now."""
time = ti... | 2.828125 | 3 |
autokeras/__init__.py | MustafaKadioglu/autokeras | 1 | 12778128 | <gh_stars>1-10
from autokeras.image.image_supervised import ImageClassifier, ImageRegressor
from autokeras.text.text_supervised import TextClassifier, TextRegressor
from autokeras.tabular.tabular_supervised import TabularClassifier, TabularRegressor
from autokeras.net_module import CnnGenerator, MlpModule | 1.210938 | 1 |
members/views.py | KonichiwaKen/band-dashboard | 0 | 12778129 | import json
from django.forms import model_to_dict
from rest_framework import views
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from attendance.models import Attendance
from attendance.models import Event
from attendance.permi... | 1.96875 | 2 |
cascad/server/routes/home.py | Will-Holden/cascadv2 | 0 | 12778130 | <filename>cascad/server/routes/home.py
from flask import Blueprint, render_template, url_for, request
from cascad.models.datamodel import AgentTypeModel, ComputeExperimentModel, ComputeExperimentTypeModel, AgentModel
from pyecharts import options as opts
from pyecharts.charts import Bar, Scatter
from jinja2 import Mark... | 2.1875 | 2 |
application/profiles/manage.py | kendog/coalman | 3 | 12778131 | <reponame>kendog/coalman
"""Routes for user authentication."""
from flask import redirect, render_template, flash, Blueprint, request, url_for
from flask_login import login_required
from flask import current_app as app
from flask_security import roles_required, current_user
#from .assets import compile_auth_assets
#fro... | 2.46875 | 2 |
task1/clean.py | Save404/captcha | 3 | 12778132 | #-*- coding: utf-8 -*-
import os
from PIL import Image, ImageDraw, ImageEnhance
def denoise(img):
im = Image.open(img)
enhancer = ImageEnhance.Contrast(im)
im = enhancer.enhance(3)
im = im.convert('1')
data = im.getdata()
w, h = im.size
for x in range(1, w-1):
l = []
... | 3.171875 | 3 |
abagen/allen.py | abkosar/abagen | 0 | 12778133 | # -*- coding: utf-8 -*-
"""
Functions for mapping AHBA microarray dataset to atlases and and parcellations
in MNI space
"""
from functools import reduce
from nilearn._utils import check_niimg_3d
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from abagen import datasets, io, process, ... | 2.53125 | 3 |
python_design_patterns/singleton.py | johanvergeer/python-design-patterns | 0 | 12778134 | """
Singleton pattern ensures that the class can have only one existing instance per Java
classloader instance and provides global access to it.
One of the risks of this pattern is that bugs resulting from setting a singleton up in a
distributed environment can be tricky to debug, since it will work fine if you debug ... | 3.921875 | 4 |
src/python/Tools/vcfcallerinfo.py | Steven-N-Hart/hap.py | 0 | 12778135 | # coding=utf-8
#
# Copyright (c) 2010-2015 Illumina, Inc.
# All rights reserved.
#
# This file is distributed under the simplified BSD license.
# The full text can be found here (and in LICENSE.txt in the root folder of
# this distribution):
#
# https://github.com/sequencing/licenses/blob/master/Simplified-BSD-License.... | 2.1875 | 2 |
examples/reconstruct.py | stefanv/lulu | 3 | 12778136 | <gh_stars>1-10
import sys
sys.path.insert(0, '..')
from demo import load_image
import numpy as np
import matplotlib.pyplot as plt
import os
import time
import lulu
import lulu.connected_region_handler as crh
img = load_image()
print("Decomposing a %s matrix." % str(img.shape))
tic = time.time()
regions = lulu.de... | 2.109375 | 2 |
game_data.py | Ammarpad/OutreachyProject | 5 | 12778137 | #!/usr/local/bin/python3
import common
import pywikibot
import wikitextparser as parser
from pywikibot import pagegenerators
GAME_MODE_PROP_ID = 'P404'
TEMPLATE = 'Infobox video game'
def main():
site = pywikibot.Site('en', 'wikipedia')
repo = site.data_repository()
temp = pywikibot.Page(site, TEMPLATE, ... | 2.828125 | 3 |
pyston/pyston_lite/setup.py | sthagen/pyston-pyston | 0 | 12778138 | <filename>pyston/pyston_lite/setup.py
from distutils.core import setup, Extension, Distribution
from distutils.command.build_ext import build_ext
from distutils import sysconfig
import os
import subprocess
import sys
class pyston_build_ext(build_ext):
def run(self):
subprocess.check_call(["../../pyston/too... | 1.984375 | 2 |
src/fridayUI/kitchen_gui_func.py | ThiefOfTime/KitchenOrganisator | 0 | 12778139 | <reponame>ThiefOfTime/KitchenOrganisator<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mai 11, 2018
@author: ThiefOfTime
"""
import re
import cv2
import queue
import threading
import multiprocessing
# import kitchen gui
import fridayUI.kitchen_gui as kitchen
# import Hive modules
from connections.HiveIO import R... | 1.726563 | 2 |
nes/video/video_out.py | Hexadorsimal/pynes | 1 | 12778140 | <reponame>Hexadorsimal/pynes
class VideoOut:
def power_up(self):
pass
def power_down(self):
pass
def pixel(self, x, y, color):
raise NotImplementedError
def hsync(self):
raise NotImplementedError
def vsync(self):
raise NotImplementedError
| 2.421875 | 2 |
upload_file.py | smartdan/dsrace | 2 | 12778141 | <reponame>smartdan/dsrace<filename>upload_file.py
#!/usr/bin/env python
'''
Copyright 2017 <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/L... | 2.265625 | 2 |
robosuite/scripts/Final_Copy/train.py | spatric5/robosuite | 0 | 12778142 | <gh_stars>0
import numpy as np
import gym
import os, sys
import robosuite
from arguments import get_args
from mpi4py import MPI
from subprocess import CalledProcessError
from ddpg_agent import ddpg_agent
import robosuite as suite
from robosuite.wrappers import GymWrapper
from robosuite import load_controller_config
""... | 2.25 | 2 |
src/project/models/user.py | farzadghanei/flask-skel | 0 | 12778143 | '''
project.models.user
-------------------
Defines a user model class
'''
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from itsdangerous import SignatureExpired, BadSignature
from flask.ex... | 2.8125 | 3 |
test/server/test_mailbox.py | BoniLindsley/pymap | 18 | 12778144 | <reponame>BoniLindsley/pymap
from textwrap import dedent
import pytest
from .base import TestBase
pytestmark = pytest.mark.asyncio
class TestMailbox(TestBase):
async def test_list_sep(self, imap_server):
transport = self.new_transport(imap_server)
transport.push_login()
transport.push... | 2.3125 | 2 |
mprotect.py | anakrish/mystikos-debug-utils | 1 | 12778145 | import gdb
import math
import tempfile
class myst_mprotect_tracker(gdb.Breakpoint):
def __init__(self):
#super(myst_mprotect_tracker, self).__init__('myst_mprotect_ocall', internal=True)
#self.bp = gdb.Breakpoint.__init__(self,'exec.c:637', internal=True)
#self.bp = gdb.Breakpoint.__init__(... | 2.296875 | 2 |
setup.py | azafred/skeletor | 0 | 12778146 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from sample.version import __version__
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='sample',
vers... | 1.203125 | 1 |
ElevatorBot_old/slashCommands/externalWebsites.py | LukasSchmid97/destinyBloodoakStats | 3 | 12778147 | <filename>ElevatorBot_old/slashCommands/externalWebsites.py<gh_stars>1-10
from discord.ext import commands
from discord_slash import cog_ext, SlashContext, ButtonStyle
from discord_slash.utils import manage_components
from discord_slash.utils.manage_commands import create_option, create_choice
from ElevatorBot.backend... | 2.34375 | 2 |
python/fileSearch/fileSearch.py | ped998/scripts | 0 | 12778148 | <gh_stars>0
#!/usr/bin/env python
"""search for files using python"""
# version 2021.02.23
# usage: ./backedUpFileList.py -v mycluster \
# -u myuser \
# -d mydomain.net \
# -s server1.mydomain.net \
# -... | 2.1875 | 2 |
relaxrender/rasterization.py | hefangwuwu/relaxrender | 4 | 12778149 | <reponame>hefangwuwu/relaxrender
import numpy as np
from .points import Point, Vector, Points
from .triangle import Triangle, Triangles
class Raster:
# for OpenGL alike forward rendering.
def __init__(self, context):
self.context = context
def rasterize(self, triangles):
pass
class Simp... | 2.78125 | 3 |
DataWorkflow/file_deletion/migrations/0010_remove_batch_number.py | Swiss-Polar-Institute/data-workflow | 0 | 12778150 | <reponame>Swiss-Polar-Institute/data-workflow
# Generated by Django 2.2.6 on 2019-10-30 11:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('file_deletion', '0009_filetobedeleted_batch'),
]
operations = [
migrations.RemoveField(
mo... | 1.453125 | 1 |