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 |
|---|---|---|---|---|---|---|
maru/lemmatizer/pymorphy.py | chomechome/maru | 47 | 37500 | from maru import pymorphy
from maru.lemmatizer.abstract import ILemmatizer
from maru.tag import Tag
from maru.types import Word
class PymorphyLemmatizer(ILemmatizer):
def lemmatize(self, word: Word, tag: Tag) -> Word:
best_parse = max(
pymorphy.analyze(word),
key=lambda parse: (
... | 2.703125 | 3 |
scripts/read_value.py | jayantpatil/brownie-simple-storage | 0 | 37501 | <gh_stars>0
from brownie import accounts, config, SimpleStorage
def read_contract():
# -1 index gets most recent transaction
simple_storage = SimpleStorage[-1]
print(simple_storage.retrieve())
def main():
read_contract()
| 2.078125 | 2 |
freetile/helper/xcb.py | rbn42/freetile | 10 | 37502 | import os
import xcffib
from xcffib.testing import XvfbTest
from xcffib.xproto import Atom, ConfigWindow, EventMask, GetPropertyType
conn = xcffib.connect(os.environ['DISPLAY'])
xproto = xcffib.xproto.xprotoExtension(conn)
def arrange(layout, windowids):
for lay, winid in zip(layout, windowids):
xproto.... | 2.109375 | 2 |
MusicApp/forms.py | krishnasagar14/Project | 0 | 37503 | __author__ = 'krishnasagar'
from django import forms
# Refer for forms.MultipleChoiceField always, its helpful -
# http://www.programcreek.com/python/example/58199/django.forms.MultipleChoiceField
class TrackForm(forms.Form):
def __init__(self, *args, **kwargs):
if 'choices' in kwargs:
choic... | 2.71875 | 3 |
gen_util/__init__.py | CUrW-SL/DSS-Framework | 0 | 37504 | from .controller_util import get_triggering_dags | 1.054688 | 1 |
yb66/run_xoppy_crystal_YB66.py | 91902078/yb66 | 0 | 37505 | import numpy
from xoppy_dabax_util import bragg_calc2
from run_diff_pat import run_diff_pat
from srxraylib.plot.gol import plot
if __name__ == "__main__":
descriptor = 'YB66'
SCANFROM = 0 # in microradiants
SCANTO = 100 # in microradiants
MILLER_INDEX_H = 4
MILLER_INDEX_K = 0
MILLER_INDEX_L = ... | 2.21875 | 2 |
code/arc012_1_01.py | KoyanagiHitoshi/AtCoder | 3 | 37506 | <reponame>KoyanagiHitoshi/AtCoder<filename>code/arc012_1_01.py
d=({"Saturday":0,"Sunday":0,"Monday":5,"Tuesday":4,"Wednesday":3,"Thursday":2,"Friday":1})
print(d[input()]) | 2.265625 | 2 |
ooi_harvester/utils/parser.py | ooi-data/ooi_harvester | 4 | 37507 | import os
import datetime
import math
import traceback
from typing import List
import requests
from loguru import logger
from lxml import etree
from siphon.catalog import TDSCatalog
from dask.utils import memory_repr
import numpy as np
from dateutil import parser
from ooi_harvester.settings import harvest_settings
... | 2.296875 | 2 |
oro_plugins/migrations/0002_galleryitem_gallery.py | mikeh74/orocus_djangocms | 0 | 37508 | <gh_stars>0
# Generated by Django 3.0.6 on 2020-06-05 20:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('oro_plugins', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ga... | 1.453125 | 1 |
src/mcedit2/widgets/propertylist.py | elcarrion06/mcedit2 | 673 | 37509 | """
propertylist
"""
from __future__ import absolute_import, division, print_function
from collections import namedtuple
import logging
from PySide.QtCore import Qt
from mceditlib import nbt
from PySide import QtGui, QtCore
from mcedit2.util.load_ui import registerCustomWidget
log = logging.getLogger(__name__)
cl... | 2.078125 | 2 |
src/architectures/nmp/adjacency/simple/physics.py | isaachenrion/jets | 9 | 37510 | <reponame>isaachenrion/jets
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from ._adjacency import _Adjacency
def construct_physics_adjacency(alpha=None, R=None, trainable_physics=False):
if trainable_physics:
assert R is None
as... | 2.25 | 2 |
code/ui.py | Navi-d/Survive | 0 | 37511 | import pygame
class UI:
def __init__(self, surface):
# setup
self.display_surface = surface
# health
self.health_border = pygame.image.load(
'graphics/ui/Border_0.png').convert_alpha()
self.health_bar = pygame.image.load(
'graphics/ui/... | 3.015625 | 3 |
Buy/migrations/0003_singlecardpurchase_initial_sell_price.py | eliilek/TCGProject | 0 | 37512 | # Generated by Django 2.0.3 on 2018-04-18 19:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Buy', '0002_standardset'),
]
operations = [
migrations.AddField(
model_name='singlecardpurchase',
name='initial_sell... | 1.804688 | 2 |
ksp_login/__init__.py | trojsten/ksp_login | 2 | 37513 | __version__ = '0.6.2'
__version_info__ = tuple(map(int, __version__.split('.')))
from django.utils.translation import ugettext_lazy as _
def __activate_social_auth_monkeypatch():
from social_core.backends.base import BaseAuth
from social_core.backends.open_id import (OPENID_ID_FIELD, OpenIdAuth)
from soc... | 1.664063 | 2 |
agents/rule_based/keywords.py | didi/MEEP | 17 | 37514 | <filename>agents/rule_based/keywords.py
from enum import Enum
class IndicatorType(Enum):
CLEAR_CONTEXT = 1
YES = 2
NO = 3
PLACES_NEARBY = 4
RELATIVE_LANDMARK = 5
EMPTY_AFTER_FILTERING = 6
INDICATORS = {
IndicatorType.CLEAR_CONTEXT:
set(['hm', 'hmm', 'hrm', 'oops', 'sorry', 'actua... | 2.25 | 2 |
tensordata/utils/conda/_conda.py | Hourout/tensordata | 13 | 37515 | import subprocess
__all__ = ['view_env', 'create_env', 'remove_env']
def view_env():
"""Get virtual environment info."""
cmd = f"conda info -e"
s = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).communicate()[0]
s = s.decode('utf-8').strip().split('\n')[2:]
s = [i.split(' ') for i in s]... | 2.75 | 3 |
ebrains_drive/__init__.py | apdavison/ebrains-drive | 5 | 37516 | <filename>ebrains_drive/__init__.py
"""
A Python package for working with the Human Brain Project Model Validation Framework.
<NAME> and <NAME>, CNRS, 2017-2020
License: BSD 3-clause, see LICENSE.txt
"""
from ebrains_drive.client import DriveApiClient
def connect(username=None, password=None, token=None, env=""):
... | 1.648438 | 2 |
test/mock/mock_lens.py | AshKelly/PyAutoLens | 0 | 37517 | from test.mock.mock_inversion import MockMapper
from test.mock.mock_galaxy import MockHyperGalaxy
class MockTracer(object):
def __init__(self, unblurred_image_1d, blurring_image_1d, has_light_profile, has_pixelization, has_hyper_galaxy,
has_grid_mappers=False):
self.unblurred_image_1d = ... | 2.9375 | 3 |
blog/models.py | florimondmanca/personal-api | 4 | 37518 | """Blog models."""
from typing import Union
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.utils import timezone
from django.utils.text import Truncator, slugify
from markdownx.models import MarkdownxField
from .dbfunctions import Unnest
from .signals import post_publ... | 2.421875 | 2 |
backend/app/db/base.py | jnana-cetana/XMeme | 19 | 37519 | # Import all the models, so that Base has them before being imported by Alembic
from app.db.base_class import Base
from app.models.meme import Meme
| 1.367188 | 1 |
viseron/watchdog/thread_watchdog.py | magicmonkey/viseron | 0 | 37520 | <filename>viseron/watchdog/thread_watchdog.py
"""Watchdog for long-running threads."""
import datetime
import logging
import threading
from typing import Callable, Dict, List, Optional
from viseron.watchdog import WatchDog
LOGGER = logging.getLogger(__name__)
class RestartableThread(threading.Thread):
"""Thread... | 2.5625 | 3 |
day3/main.py | jaydom28/Advent-Of-Code-2021 | 0 | 37521 | def read_lines(file_path):
with open(file_path, 'r') as handle:
return [line.strip() for line in handle]
def count_bits(numbers):
counts = [0] * len(numbers[0])
for num in numbers:
for i, bit in enumerate(num):
counts[i] += int(bit)
return counts
lines = read_lines('test... | 3.421875 | 3 |
tests/torch_api/test_multi_models.py | mmathys/bagua | 635 | 37522 | <reponame>mmathys/bagua<gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
from tests.internal.common_utils import find_free_port
import unittest
import multiprocessing
import os
from bagua.torch_api.utils import flatten
import bagua.torch_api as bagua
from tests import skip_if_cuda_no... | 2.15625 | 2 |
2-6 motto2.py | Holaplace/path_to_python | 1 | 37523 | <reponame>Holaplace/path_to_python
famous_name = "<NAME>"
motto = "A person who never made a mistake never tried anything new."
message = famous_name.title() + "once said, " + '"' + motto + '"'
print(message) | 2.375 | 2 |
dataset/classification_datasets/__init__.py | JetBrains-Research/contrastive-learning-framework | 4 | 37524 | from .code_transformer_dataset import CodeTransformerDataset
from .graph_dataset import GraphDataset
from .path_dataset import PathDataset
from .text_dataset import TextDataset
__all__ = [
"TextDataset",
"PathDataset",
"GraphDataset",
"CodeTransformerDataset"
]
| 1.007813 | 1 |
sovtokenfees/sovtokenfees/test/conftest.py | brentzundel/plugin | 0 | 37525 | <reponame>brentzundel/plugin
from sovtoken.constants import XFER_PUBLIC, RESULT
from sovtoken.main import integrate_plugin_in_node as enable_token
from sovtokenfees.main import integrate_plugin_in_node as enable_fees
from plenum.common.util import randomString
from plenum.common.constants import TARGET_NYM, TRUSTEE_ST... | 1.617188 | 2 |
peregrinearb/utils/single_exchange.py | kecheon/peregrine | 954 | 37526 | import asyncio
import math
import networkx as nx
import ccxt.async_support as ccxt
import datetime
import logging
from .logging_utils import FormatForLogAdapter
__all__ = [
'FeesNotAvailable',
'create_exchange_graph',
'load_exchange_graph',
]
adapter = FormatForLogAdapter(logging.getLogger('peregrinearb.u... | 2.453125 | 2 |
week3/utilities/foo_synonyms.py | fredriko/search_with_machine_learning_course | 0 | 37527 | from pathlib import Path
import fasttext
if __name__ == "__main__":
targets = [
"red", "black", "orange", "white", "gray/black", # colors
"sony", "apple", "canon", "nikon", "dell", # brands
"32", "an", "the", "4", "to", # numbers and stopwords
"inch", "cm", "oz", "gb", "mb", # ... | 2.859375 | 3 |
tests/conftest.py | BookOps-CAT/cat-maintenance | 0 | 37528 | import json
import pytest
@pytest.fixture
def test_bib():
with open(".\\test_files\\bib.json") as file:
return json.load(file)
@pytest.fixture
def test_mixed_bib():
with open(".\\test_files\\mixed_bib.json") as file:
return json.load(file)
| 1.867188 | 2 |
PROJECTS/CHALLENGE_BAXTER_PY/denavit_hartenberg.py | san99tiago/MY_ROBOTICS | 1 | 37529 | <filename>PROJECTS/CHALLENGE_BAXTER_PY/denavit_hartenberg.py
#!/usr/bin/env python
# <NAME> FOR NUMERICAL INPUTS
# <NAME> AND <NAME>
import numpy as np
import math
import transformation as transf
def denavit_hartenberg(dh_table, show_info):
"""
Get transformation matrix from Denavit Hartenberg input table
... | 3.609375 | 4 |
reid.py | vyzboy92/Accelerated-Face-Reidentification-and-Emotion-Recognition | 2 | 37530 | <reponame>vyzboy92/Accelerated-Face-Reidentification-and-Emotion-Recognition
from __future__ import print_function
import face_recognition
import cv2
import numpy as np
import pymongo
import sys
import time
import logging as log
from imutils.video import WebcamVideoStream
from openvino.inference_engine import IENetwork... | 2.5625 | 3 |
ch02/q2-1.py | iamnicoj/ctci | 0 | 37531 | <reponame>iamnicoj/ctci
from linked_list import linked_list
#O(N^2)
def remove_dups(linked_list):
# I can use a sorting structure like a balanced binary search tree
# I am going to be just working with the same list
if linked_list.count < 1: return True
anchor = linked_list.head
whi... | 3.6875 | 4 |
lib/test_collect_args.py | agnes-yang/firecam | 10 | 37532 | <reponame>agnes-yang/firecam<gh_stars>1-10
# Copyright 2018 The Fuego 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 re... | 2.25 | 2 |
python/test/grammar_translator/testCallEnd.py | ROCmSoftwarePlatform/gpufort | 57 | 37533 | <filename>python/test/grammar_translator/testCallEnd.py
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
import addtoplevelpath
import sys
import test
import translator.translator
import grammar as translator
testdata = """
1 )
a_d )
psi_d )
2... | 2.09375 | 2 |
nnef/fold_os.py | lahplover/nnef | 2 | 37534 | import numpy as np
import pandas as pd
import torch
from physics.protein_os import Protein
import options
from utils import write_pdb, write_pdb_sample, transform_profile, load_protein
from physics.anneal import AnnealCoords, AnnealFrag
# from physics.move import SampleICNext
from physics.grad_minimizer import *
from p... | 1.859375 | 2 |
Bookshelf/MotorTest2.py | anju777/Baby-BB8 | 1 | 37535 | import RPi.GPIO as GPIO
import time
# for GPIO numbering, choose BCM
#GPIO.setmode(GPIO.BCM)
# or, for pin numbering, choose BOARD
GPIO.setmode(GPIO.BOARD)
# battery1 = 2
# battery2 = 4
AEnable = 13 #27
AIN1 = 22 #25
AIN2 = 18 #24
# BIN1 = 23 # 16
# BIN2 = 18 # 12
GPIO.setup(AEnable, GPIO.OUT)
GPIO.set... | 3.296875 | 3 |
routes/customer.py | trqanees94/braintree_fast | 0 | 37536 | <gh_stars>0
#bson
from bson import ObjectId
# clients
from clients.mongodb import MongoDB
# braintree/ stripes gateway
from gateway import generate_client_token, transact, find_transaction, find_customer, customer, update_customer ,find_all_customers, \
stripe_customer, update_stripe_customer
# f... | 2.609375 | 3 |
src/python/web/handler/status.py | AlekLT/seedsync | 255 | 37537 | # Copyright 2017, <NAME>, All rights reserved.
from bottle import HTTPResponse
from common import Status, overrides
from ..web_app import IHandler, WebApp
from ..serialize import SerializeStatusJson
class StatusHandler(IHandler):
def __init__(self, status: Status):
self.__status = status
@overrides... | 2.40625 | 2 |
scraper/scraper.py | JimmyAustin/Dota2TeamBuilder | 0 | 37538 | <filename>scraper/scraper.py
import dota2api
from ratelimit import limits, sleep_and_retry
import os
import json
from time import sleep
import random
directory = 'scrape_results'
all_files = [os.path.join(directory, x) for x in os.listdir(directory)]
seen_players = set()
unseen_player_list = []
seen_match_ids = set... | 2.5625 | 3 |
datasets/ett/ett.py | leondz/datasets | 3,395 | 37539 | # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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.... | 1.867188 | 2 |
04_Data Manipulation with pandas/02_Aggregating Data/09_Multiple grouped summaries.py | mohd-faizy/DataScience-With-Python | 5 | 37540 | '''
09 - Multiple grouped summaries
Earlier in this chapter, you saw that the .agg() method is useful to
compute multiple statistics on multiple variables. It also works with
grouped data. NumPy, which is imported as np, has many different summary
statistics functions, including: np.min, np.max, np.mean, and np.median... | 3.875 | 4 |
TestGenerator.py | HIAOAIH/MeRGAN | 0 | 37541 | <gh_stars>0
import torch
import torch.nn as nn
from torchvision import datasets, transforms
from ACGAN import Generator
class TestGenerator(object):
def __init__(self, args):
self.dataset = args.dataset
self.method = args.method
self.classifier = torch.hub.load('pytorch/vision:v0.5.0', 're... | 2.34375 | 2 |
tests/test_rpReaction.py | brsynth/rplibs | 0 | 37542 | <reponame>brsynth/rplibs
"""
Created on May 28 2021
@author: <NAME>
"""
from unittest import TestCase
from copy import deepcopy
from rplibs import rpReaction
class Test_rpReaction(TestCase):
def setUp(self):
self.reactants = {
"CMPD_0000000010": 1,
"MNXM1": 1
}
s... | 2.09375 | 2 |
MatrixSqrt.py | aminya/smop | 0 | 37543 | <filename>MatrixSqrt.py
# Generated with SMOP 0.41
from libsmop import *
# MatrixSqrt.m
@function
def MatrixSqrt(matrixSize=None,mX=None,mY=None,*args,**kwargs):
varargin = MatrixSqrt.varargin
nargin = MatrixSqrt.nargin
mY=dot(mX.T,mX)
# MatrixSqrt.m:3
mA=sqrtm(mY)
# MatrixSqrt.m:5
return mA... | 2.125 | 2 |
networks/std/__init__.py | Chappie733/MLPack | 0 | 37544 | from .layers import *
from .network import *
| 1.0625 | 1 |
VGG19.py | Ralph-Finn/Deep-Image-Analogy-MXNet | 2 | 37545 | """
This code is modified from harveyslash's work (https://github.com/harveyslash/Deep-Image-Analogy-PyTorch)
"""
import mxnet as mx
from mxnet.gluon.model_zoo import vision as models
from mxnet.gluon import nn
from mxnet import nd
from mxnet import autograd
from time import time
from mxnet import optimizer
import sys... | 2.578125 | 3 |
backend/indexing/test_fragment_doc.py | rsimmons/massif | 24 | 37546 | import json
from .fragment_doc import fragment_srt, fragment_syosetu, has_unbalanced_quotes, extract_kana_kanji
EXTRACT_KANA_KANJI_CASES = [
['asdf.!ä', ''],
['あいうえお', 'あいうえお'],
['asdこfdれ', 'これ'],
['「ああ、畜生」foo', 'ああ畜生'],
]
for [text, target] in EXTRACT_KANA_KANJI_CASES:
if extract_kana_kanji(text)... | 2.8125 | 3 |
tetrapod/session.py | uwekamper/tetrapod | 0 | 37547 | import os
import math
import time
import datetime
import logging
from . import podio_auth
log = logging.getLogger(__file__)
def try_environment_token():
"""
Try to get the token from the environment variables TETRAPOD_CLIENT_ID and TETRAPOD_ACCESS_TOKEN.
:return:
"""
try:
client_id = os.... | 2.453125 | 2 |
src/minerva_db/sql/models/group.py | labsyspharm/minerva-db | 0 | 37548 | <reponame>labsyspharm/minerva-db
from sqlalchemy import Column, ForeignKey, String
from sqlalchemy.orm import relationship
# from sqlalchemy.ext.associationproxy import association_proxy
from .subject import Subject
class Group(Subject):
__mapper_args__ = {
'polymorphic_identity': 'group',
}
uui... | 2.3125 | 2 |
web-ui/AIOT-635/instance/config.py | kenhutaiwan/learning-practice | 0 | 37549 | <filename>web-ui/AIOT-635/instance/config.py<gh_stars>0
JIRA_DOMAIN = {'RD2': ['innodiv-hwacom.atlassian.net','innodiv-hwacom.atlassian.net'],
'RD5': ['srddiv5-hwacom.atlassian.net']}
API_PREFIX = 'rest/agile/1.0'
# project_id : column_name
STORY_POINT_COL_NAME = {'10005': 'customfield_10027',
... | 1.25 | 1 |
script/hardware/create_hardware_settings.py | bohanjason/website | 0 | 37550 | import sys
import csv
import json
import shutil
from collections import OrderedDict
HW = OrderedDict()
with open('ec2_instance_types.csv', 'r') as f:
reader = csv.reader(f)
for i,row in enumerate(reader):
if i == 0:
header = row
else:
entry = {}
entry['type'... | 2.984375 | 3 |
export_onnx.py | ak9250/BackgroundMattingV2 | 1 | 37551 | <reponame>ak9250/BackgroundMattingV2<filename>export_onnx.py
"""
Export MattingRefine as ONNX format
Example:
python export_onnx.py \
--model-type mattingrefine \
--model-checkpoint "PATH_TO_MODEL_CHECKPOINT" \
--model-backbone resnet50 \
--model-backbone-scale 0.25 \
--mod... | 2.375 | 2 |
htm_rl/htm_rl/modules/empowerment.py | cog-isa/htm-rl | 1 | 37552 | <gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
from tqdm import trange
from htm.bindings.sdr import SDR
from htm.bindings.algorithms import TemporalMemory
from htm.bindings.algorithms import SpatialPooler
from itertools import product
from copy import deepcopy
import json
EPS = 1e-12
class Memory:... | 2.625 | 3 |
integration/python/instantiate_docker.py | DomainDrivenArchitecture/dda-smeagol-crate | 2 | 37553 | <filename>integration/python/instantiate_docker.py<gh_stars>1-10
import docker
import sys
import os
import argparse
# Please perform the following steps in order to use this script
# 1) Install pyton 3 and pip3: sudo apt install python3-pip python3
# 2) Install the docker sdk with pip: pip3 install docker
parser = ar... | 2.5 | 2 |
Classdef.py | gregoryng/subradar | 0 | 37554 | <filename>Classdef.py<gh_stars>0
"""Various Python classes"""
__author__ = '<NAME>'
from . import roughness, utils
from numpy import inf
nan = float('nan')
class Signal(object):
"""Signal relationships"""
def __init__(self, wf=nan, bw=nan, th=0., bmw=nan, h=nan, **kwargs):
self.wf = wf # Signal ce... | 2.5 | 2 |
tests/test_setup.py | TheCheapestPixels/panda3d-simplepbr | 0 | 37555 | import panda3d.core as p3d
import pytest #pylint:disable=wrong-import-order
import simplepbr
#pylint:disable=redefined-outer-name
@pytest.fixture(scope='session')
def showbase():
from direct.showbase.ShowBase import ShowBase
p3d.load_prc_file_data(
'',
'window-type offscreen\n'
'fram... | 1.789063 | 2 |
hivedata.py | PENGsBIT/DifferentialAnalysis | 1 | 37556 | <filename>hivedata.py
from impala.dbapi import connect
import numpy as np
from different import *
args = ["10.141.212.155", 10010, "", "", "bigbench_100g", "websales_home_myshop"]
# conn = hive.Connection(host="10.141.212.155", port=10010, database='bigbench_100g')
conn = connect(host="10.141.212.155", port=10010, dat... | 2.453125 | 2 |
blin/config.py | cyber-chuvash/blinBlinskiyNoviyGod | 0 | 37557 | <gh_stars>0
import json
import logging
import os
class _JsonConfig:
def __init__(self):
self._conf = \
json.loads(open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '../config.json'), 'r').read())
@property
def log_level(self):
return logging.getLevelName(self._conf... | 2.4375 | 2 |
gryphon/core/common_operations.py | vittorfp/labskit_cli | 0 | 37558 | <gh_stars>0
"""
File containing operations that are common to the commands.
"""
import os
import sys
import json
import glob
import logging
import platform
import shutil
from datetime import datetime
from pathlib import Path
import git
from .registry.template import Template
from .core_text import Text
from ..constants... | 2.515625 | 3 |
src/cho_util/math/transform.py | yycho0108/cho-util | 0 | 37559 | import numpy as np
from .common import *
from . import rotation
def to_homogeneous(x):
x = np.asarray(x)
o = np.ones_like(x[..., :1])
return np.concatenate([x, o], axis=-1)
def from_homogeneous(x):
return x[..., :-1] / x[..., -1:]
def compose(r, t, rtype, out=None):
if out is None:
shape ... | 2.828125 | 3 |
LinearRegression-GradientDescent/GradientDescent.py | saurabbhsp/machineLearning | 3 | 37560 |
# coding: utf-8
# In[1]:
get_ipython().run_cell_magic('javascript', '', '<!-- Ignore this block -->\nIPython.OutputArea.prototype._should_scroll = function(lines) {\n return false;\n}')
# # Data preprocessing
# 1. convert any non-numeric values to numeric values.
# 2. If required drop out the rows with missi... | 3.625 | 4 |
src/pagure/validators.py | yifengyou/learn-pagure | 0 | 37561 | <gh_stars>0
import re
import six
from wtforms import validators
class EmailValidator(object):
"""Validates wtform email field"""
def __init__(self, message="The field data was not an email"):
self._message = message
def __call__(self, form, email):
if not isinstance(email.data, six.text... | 3.125 | 3 |
code/vendor/node_js2c.py | thorium-cfx/fivem | 5,411 | 37562 | <filename>code/vendor/node_js2c.py
import os
import subprocess
import sys
inputs = [
'lib/assert/strict.js',
'lib/assert.js',
'lib/async_hooks.js',
'lib/buffer.js',
'lib/child_process.js',
'lib/cluster.js',
'lib/console.js',
'lib/constants.js',
'lib/crypto.js',
'lib/dgram.js',
'lib/diagnostics_cha... | 1.984375 | 2 |
docs/util.py | simplebutneeded/python-measurement | 0 | 37563 | from __future__ import print_function
from measurement.base import MeasureBase, BidimensionalMeasure
from measurement.utils import get_all_measures
for measure in get_all_measures():
classname = measure.__name__
print(classname)
print('-' * len(classname))
print()
if issubclass(measure, MeasureBas... | 2.78125 | 3 |
gibson2/core/render/mesh_renderer/mesh_renderer_tensor.py | myalfred03/GibsonEnvV2 | 0 | 37564 | <reponame>myalfred03/GibsonEnvV2
import cv2
import sys
import numpy as np
from gibson2.core.render.mesh_renderer.mesh_renderer_cpu import MeshRenderer, GL
import torch
from gibson2.core.render.mesh_renderer.get_available_devices import get_cuda_device
class MeshRendererG2G(MeshRenderer):
"""
Similar to MeshRen... | 2.484375 | 2 |
BasicConcepts/SyntaxErrors/Volume1_Chapter6_SyntaxErrors_Fixed.py | jpike/PythonProgrammingForKids | 0 | 37565 | # Commenting syntax errors.
print("Printing out a message!") # This is a comment.
floating_point_number = 1.5 * 2.7
| 3.046875 | 3 |
setup.py | piotrmaslanka/python-cassandra-jaeger | 0 | 37566 | <reponame>piotrmaslanka/python-cassandra-jaeger<filename>setup.py
#!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import python_cassandra_jaeger
setup(version=python_cassandra_jaeger.__version__,
packages=find_packages(include=['python_cassandra_jaeger']),
)
| 1.226563 | 1 |
demultiplexer/demultiplexing.py | DominikBuchner/demultiplexer | 0 | 37567 | <filename>demultiplexer/demultiplexing.py
import openpyxl, gzip, datetime, psutil, time
from Bio.Data.IUPACData import ambiguous_dna_values
from itertools import product
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from pathlib import Path
from joblib import Parallel, delayed
def extend_ambiguous_dna(seq):
... | 2.625 | 3 |
test.py | rapidrabbit76/PaintsTensorFlow | 63 | 37568 | <reponame>rapidrabbit76/PaintsTensorFlow<gh_stars>10-100
import tensorflow as tf
import numpy as np
import cv2
from dataset.Datasets import Datasets_512
import utils
__DRAFT_MODEL_PATH__ = "./GUI/src/saved_model/PaintsTensorFlowDraftModel"
__MODEL_PATH__ = "./GUI//src/saved_model/PaintsTensorFlowModel"
class Paints... | 2.15625 | 2 |
ipython/attachments/Weave/iterators_example.py | cassiasamp/scipy-cookbook | 408 | 37569 | #!/usr/bin/env python
import sys
import numpy as npy
import pylab as P
from scipy.weave import inline, converters, blitz
from scipy.testing import measure
# Blitz conversion is terrific, but sometimes you don't have fixed array sizes
# in your problem. Fortunately numpy iterators still make writing inline
# weave code ... | 2.65625 | 3 |
object_detection2/data/transforms/autoaugment.py | vghost2008/wml | 6 | 37570 | #coding=utf-8
import tensorflow as tf
import tfop
contrib_image = tf.contrib.image
def blend(image1, image2, factor):
"""Blend image1 and image2 using 'factor'.
Factor can be above 0.0. A value of 0.0 means only image1 is used.
A value of 1.0 means only image2 is used. A value between 0.0 and
1.0 means we ... | 3.484375 | 3 |
selco/selco/doctype/cash_payment_entry/cash_payment_entry.py | codingCoffee/selco_v2 | 0 | 37571 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, SELCO and contributors
# For license information, please see license.txt
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
fr... | 1.984375 | 2 |
measure.py | mtenenholtz/vehicle_footprint | 0 | 37572 | class PixelMeasurer:
def __init__(self, coordinate_store, is_one_calib_block, correction_factor):
self.coordinate_store = coordinate_store
self.is_one_calib_block = is_one_calib_block
self.correction_factor = correction_factor
def get_distance(self, calibration_length):
distance... | 2.953125 | 3 |
feedback-Python/models.py | gforghieri/code-demo | 0 | 37573 | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Feature(models.Model):
name = models.CharField('Feature Name', max_length=50, blank=True, unique=True)
description = models.CharField('Feature Description', max_length=150, blank=True)
info_link = models.CharField('... | 2.078125 | 2 |
jupyterhub_client/tests/test_async.py | minrk/jupyterhub-client | 2 | 37574 | <reponame>minrk/jupyterhub-client
from pytest import fixture
from tornado import gen
from tornado.ioloop import IOLoop
from .conftest import TOKEN
from ..async import AsyncJupyterHubClient
@fixture
def client(app, io_loop):
# include io_loop to avoid clear_instance calls resetting the current loop
return Asy... | 2.171875 | 2 |
app/ml.py | JeffreyAsuncion/fastapi_test | 0 | 37575 | <reponame>JeffreyAsuncion/fastapi_test
"""Machine learning functions"""
from fastapi import APIRouter
from sklearn.neighbors import NearestNeighbors
import pandas as pd
from joblib import load
import pickle
from app.city_state_json import city_state_2_id_num
router = APIRouter()
# filename = 'app/recommend/recommen... | 3.203125 | 3 |
worker/server.py | OmarZOS/remote-extraction-proxy-and-worker | 0 | 37576 | <gh_stars>0
import json
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
from multiprocessing import Process
import xmlrpc.client
from locator import locator
from constants import *
from functions import *
import os
import constants
current_tasks = [{"id":1}]
print("S... | 2.484375 | 2 |
get_player.py | jason-sa/baseball_lin_regression | 0 | 37577 | '''
Script to loop through all baseballrefernce.com pages and store the HTML in data frames
'''
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
import requests
imp... | 2.9375 | 3 |
src/puzzle_1_you_will_all_conform/site/line-exercise1.py | foryourselfand/mit_6_S095_programming_for_the_puzzled | 0 | 37578 | # Programming for the Puzzled -- <NAME>
# You Will All Conform
# Input is a vector of F's and B's, in terms of forwards and backwards caps
# Output is a set of commands (printed out) to get either all F's or all B's
# Fewest commands are the goal
caps = ['F', 'F', 'B', 'B', 'B', 'F', 'B', 'B', 'B', 'F', 'F', 'B', 'F']... | 3.828125 | 4 |
python3/python-tk/tk_busybar_demo.py | cgoldberg/corey-projects | 0 | 37579 | <reponame>cgoldberg/corey-projects
#!/usr/bin/env python
# Python 3
# <NAME> - 2009
import tkinter
from tkinter import ttk
import BusyBar
class Application:
def __init__(self, root):
self.root = root
self.root.title('BusyBar Demo')
ttk.Frame(self.root, width=300, height=100... | 3.46875 | 3 |
abc110_c.py | hythof/atc | 0 | 37580 | <gh_stars>0
s=input()
t=input()
ss=sorted(map(s.count,set(s)))
tt=sorted(map(t.count,set(t)))
print('Yes' if ss==tt else 'No')
| 3.203125 | 3 |
app/schema/item.py | qateam123/eq | 0 | 37581 | <reponame>qateam123/eq
from abc import ABCMeta, abstractmethod
from app.questionnaire_state.exceptions import StateException
class Item(metaclass=ABCMeta):
"""
Abstract class for all items in a schema. Subclasses must provide an id and redefine State accordingly
"""
def __init__(self, item_id):
... | 2.90625 | 3 |
scripts/get_alignments.py | kant/transition-amr-parser | 1 | 37582 | import sys
from amr import JAMR_CorpusReader
if __name__ == '__main__':
args = sys.argv
infile = args[1]
cr = JAMR_CorpusReader()
cr.load_amrs(infile)
gold_amrs = cr.amrs
for sentidx, amr in enumerate(gold_amrs):
for n in amr.alignments:
print(str(sentidx)+'\t'+n+'\t'+','... | 2.546875 | 3 |
setup.py | HDembinski/bibtools | 0 | 37583 | <gh_stars>0
from setuptools import setup
from glob import glob
setup(
name='bibtools',
version='0.0.1',
scripts=glob('src/*.py'),
) | 1.078125 | 1 |
src/prodis/packets/handshaking/__init__.py | blubberdiblub/prodis | 0 | 37584 | #!/usr/bin/env python
from .serverbound import Packet as ServerBound
| 1.171875 | 1 |
send.py | EmelyanenkoK/freeton_scheduler | 0 | 37585 | import sys
from graphqlclient import GraphQLClient
from random import randint
import codecs, json
client = GraphQLClient("https://net.ton.dev/graphql")
mutation_template = '''
mutation {
postRequests(requests:[{id:"%(request_id)s",body:"%(base64_boc)s",expireAt:2e12}])
}
'''
def send_boc(client, boc):
data = {'re... | 2.25 | 2 |
scripts/exercicios/ex025.py | RuanBarretodosSantos/python | 0 | 37586 | <reponame>RuanBarretodosSantos/python
nome = str(input('Digite seu nome: ')).strip()
cap = nome.title()
print('Silva' in cap) | 3.65625 | 4 |
tests/test_tokenizer.py | AlessandroVol23/DEMorphy | 43 | 37587 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest
from demorphy.tokenizer import tokenize
class TestTokenizer:
def test_split_simple(self):
assert tokenize(u"Ich bin krank") == [u"Ich", u"bin", u"krank"]
def test_split_hypen(self):
assert tokenize(... | 2.5625 | 3 |
pandalog/cmd.py | bitpanda-labs/pandalog | 0 | 37588 | <filename>pandalog/cmd.py
"""Pandalog collection of entrypoint scripts
Scripts:
- pandalog
- pandalog-auth
To install the collection, use either one of the following options:
1) Build the Dockerfile and run the application
2) Run "python3 setup.py install"
The scripts are installed as executable binaries under /usr... | 2.4375 | 2 |
disaster_recovery/actions/views.py | openstack/freezer-web-ui | 32 | 37589 | <filename>disaster_recovery/actions/views.py
# 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 i... | 1.804688 | 2 |
osf_oauth2_adapter/apps.py | enrobyn/lookit-api | 0 | 37590 | import os
from django.apps import AppConfig
class OsfOauth2AdapterConfig(AppConfig):
name = 'osf_oauth2_adapter'
# staging by default so people don't have to run OSF to use this.
osf_api_url = os.environ.get('OSF_API_URL', 'https://staging-api.osf.io').rstrip('/') + '/'
osf_accounts_url = os.environ.... | 1.9375 | 2 |
wiktionarifier/scrape/core.py | lgessler/wiktionarifier | 1 | 37591 | <filename>wiktionarifier/scrape/core.py
import os
import requests as R
import click
import wiktionarifier.scrape.db as db
def process_page(page):
if not any(" lemma" in cat.title().lower() for cat in page.categories()) or any(
"non-lemma" in cat.title().lower() for cat in page.categories()
):
... | 2.84375 | 3 |
melange/event_serializer.py | Rydra/melange | 7 | 37592 | <gh_stars>1-10
import json
from typing import Generic, Dict, Optional
from melange.helpers.typing import T
class MessageSerializer(Generic[T]):
"""
You need to provide a way to convert a message from your sqs
into something meaningful for your domain (e.g. into a Domain Event)
"""
def manifest(s... | 2.625 | 3 |
utils/decorators/__init__.py | jemand2001/python-utils | 0 | 37593 | <reponame>jemand2001/python-utils<gh_stars>0
from .strict import (strict)
from .overload import (overload)
from .template import (template)
from .convert import (convert)
from .auto_slots import (auto_slots)
| 1.296875 | 1 |
src/ebonite/ext/numpy/dataset.py | geffy/ebonite | 1 | 37594 | from typing import Tuple, Type
import numpy as np
from pyjackson.core import ArgList, Field
from pyjackson.generics import Serializer
from ebonite.core.analyzer.base import CanIsAMustHookMixin, TypeHookMixin
from ebonite.core.analyzer.dataset import DatasetHook
from ebonite.core.objects.dataset_type import DatasetTyp... | 2.15625 | 2 |
where my anagrams at.py | faaiqbilal/codewars-code | 0 | 37595 | <reponame>faaiqbilal/codewars-code
def anagrams(word, words):
agrams = []
s1 = sorted(word)
for i in range (0, len(words)):
s2 = sorted(words[i])
if s1 == s2:
agrams.append(words[i])
return agrams | 3.71875 | 4 |
src/scenic/simulators/gta/img_modf.py | cahartsell/Scenic | 141 | 37596 | <gh_stars>100-1000
'''
This file has basic image modification functions
'''
from PIL import Image
import cv2
from scipy.spatial import Voronoi
from itertools import product
import numpy as np
def convert_black_white(img_data=None, img_file=None, threshold=100):
assert img_data is not None or img_file is not None... | 3.046875 | 3 |
scripts/uri_checks.py | geological-survey-of-queensland/vocabularies | 15 | 37597 | <reponame>geological-survey-of-queensland/vocabularies
# This script checks the redirect status of vocabs' URIs
#
# as of 2020-06-03, all 64 vocab' URIs are resulting in successful redirects to GSQ VocPrez
import requests
import os
from os.path import join, dirname
import glob
from rdflib import Graph
from rdflib.name... | 2.609375 | 3 |
src/analysis/measurement.py | rabenstefan/epp1819 | 0 | 37598 | <filename>src/analysis/measurement.py
"""Measurement class: organizes measurements and parameters per factor.
MeasurementDimensionError class: exception if dimensions do not fit.
"""
import numpy as np
import pandas as pd
from scipy.stats import norm
class Measurement:
"""Organize measurement-data and parameters ... | 3.46875 | 3 |
tests/processors/test_processors.py | foxis/EasyVision | 7 | 37599 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pytest import raises, approx
from EasyVision.vision.base import *
from EasyVision.processors.base import *
from tests.common import VisionSubclass, ProcessorA, ProcessorB
@pytest.mark.main
def test_abstract():
with raises(TypeError):... | 2.515625 | 3 |