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 |
|---|---|---|---|---|---|---|
tencentcloud/vpc/v20170312/models.py | yangyimincn/tencentcloud-sdk-python | 0 | 6700 | # -*- coding: utf8 -*-
# Copyright 1999-2017 Tencent Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 2.03125 | 2 |
mlcsim/dist.py | nobodywasishere/MLCSim | 0 | 6701 | #!/usr/bin/env python
"""Distribution functions
This module provides functions for dealing with normal distributions
and generating error maps.
When called directly as main, it allows for converting a threshold map
into an error map.
```
$ python -m mlcsim.dist --help
usage: dist.py [-h] [-b {1,2,3,4}] -f F [-o O]... | 3 | 3 |
Pr-Lab5/lab5.py | JackShen1/pr-labs | 2 | 6702 | earth = {
"Asia":
{'Japan': ("Tokyo", 377975, 125620000)},
"Europe":
{'Austria': ("Vienna", 83800, 8404000),
'Germany': ("Berlin", 357000, 81751000),
'Great Britain': ("London", 244800, 62700000),
'Iceland': ("Reykjavík", 103000, 317630),
'Italy': ("Rome", 301... | 3.796875 | 4 |
vue/repositories.bzl | ubiquitoustech/rules_vue | 0 | 6703 | """Declare runtime dependencies
These are needed for local dev, and users must install them as well.
See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
#... | 1.601563 | 2 |
endpoints/api/test/test_tag.py | kwestpharedhat/quay | 0 | 6704 | import pytest
from playhouse.test_utils import assert_query_count
from data.registry_model import registry_model
from data.database import Manifest
from endpoints.api.test.shared import conduct_api_call
from endpoints.test.shared import client_with_identity
from endpoints.api.tag import RepositoryTag, RestoreTag, Li... | 1.890625 | 2 |
inventory.py | Jongerr/vendor_receiving | 0 | 6705 | import json
import os
import random
import requests
from passlib.hash import pbkdf2_sha256 as pbk
from PyQt5.QtSql import QSqlDatabase, QSqlQuery
from pprint import pprint
ENCODING = 'utf-8'
DB_PATH = os.path.join(os.path.curdir, 'inventory.db')
def scrambleWord(word):
"""Randomize the letters in word and retur... | 3.15625 | 3 |
lnbits/core/views/lnurl.py | frennkie/lnbits | 0 | 6706 | import requests
from flask import abort, redirect, request, url_for
from lnurl import LnurlWithdrawResponse, handle as handle_lnurl
from lnurl.exceptions import LnurlException
from time import sleep
from lnbits.core import core_app
from lnbits.helpers import Status
from lnbits.settings import WALLET
from ..crud impo... | 2.28125 | 2 |
driver_training/driver_training.py | munishm/MLOpsPython | 0 | 6707 | # Import libraries
import argparse
from azureml.core import Run
import joblib
import json
import os
import pandas as pd
import shutil
# Import functions from train.py
from train import split_data, train_model, get_model_metrics
# Get the output folder for the model from the '--output_folder' parameter
parser = argpar... | 2.828125 | 3 |
tests/__init__.py | madman-bob/python-lua-imports | 3 | 6708 | from lua_imports import lua_importer
lua_importer.register()
| 1.0625 | 1 |
app/models/product.py | VyachAp/SalesFABackend | 80 | 6709 | <filename>app/models/product.py
from sqlalchemy import Column, Integer, String, Float
from app.database.base_class import Base
class Product(Base):
id = Column(Integer, primary_key=True, index=True)
name = Column(String, nullable=False)
price = Column(Float, nullable=False)
| 2.703125 | 3 |
katana/utils/directory_traversal_utils.py | warriorframework/Katanaframework | 1 | 6710 | <reponame>warriorframework/Katanaframework<gh_stars>1-10
import glob
import os
import re
import errno
import shutil
def get_sub_dirs_and_files(path, abs_path=False):
"""
Gets the direct child sub-files and sub-folders of the given directory
Args:
path: Absolute path to the directory
abs_p... | 3 | 3 |
alignment.py | LucaOnline/theanine-synthetase | 0 | 6711 | <gh_stars>0
"""The `alignment` module provides an implementation of the Needleman-Wunsch alignment algorithm."""
from typing import Tuple, Literal, List
from math import floor
import numpy as np
from stats import variance
MOVE_DIAGONAL = 0
MOVE_RIGHT = 1
MOVE_DOWN = 2
EditMove = Literal[MOVE_DIAGONAL, MOVE_RIGHT, ... | 3.234375 | 3 |
examples/the-feeling-of-success/mock_grasp_object_op.py | yujialuo/erdos | 0 | 6712 | from mock_gripper_op import MockGripType
from std_msgs.msg import Bool
from erdos.op import Op
from erdos.data_stream import DataStream
from erdos.message import Message
class MockGraspObjectOperator(Op):
"""
Sends a "close" action to the gripper.
"""
gripper_stream = "gripper-output-stream"
acti... | 2.59375 | 3 |
src/pyfsa/lib/fsa.py | taliamax/pyfsa | 1 | 6713 | <filename>src/pyfsa/lib/fsa.py
# -*- coding: utf-8 -*-
import pygraphviz as gv # type: ignore
import itertools as it
from typing import (
List,
Optional,
)
from pyfsa.lib.types import TransitionsTable
def get_state_graph(
transitions: TransitionsTable,
start: Optional[str] = None,
end: Optional... | 2.6875 | 3 |
examples/multimedia/mmimdb_MFM.py | kapikantzari/MultiBench | 148 | 6714 | import torch
import sys
import os
sys.path.append(os.getcwd())
from utils.helper_modules import Sequential2
from unimodals.common_models import Linear, MLP, MaxOut_MLP
from datasets.imdb.get_data import get_dataloader
from fusions.common_fusions import Concat
from objective_functions.objectives_for_supervised_learnin... | 1.953125 | 2 |
subeana/migrations/0001_initial.py | izumin2000/izuminapp | 0 | 6715 | # Generated by Django 4.0.2 on 2022-06-01 04:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Channel',
fields=[
... | 1.851563 | 2 |
bifacialvf/vf.py | shirubana/bifacialvf | 1 | 6716 | <reponame>shirubana/bifacialvf
# -*- coding: utf-8 -*-
"""
ViewFactor module - VF calculation helper files for bifacial-viewfactor
@author <NAME>
@translated to python by sayala 06/09/17
"""
# ensure python3 compatible division and printing
from __future__ import division, print_function, absolute_import
import ... | 1.929688 | 2 |
tests/test_slison.py | Habidatum/slisonner | 2 | 6717 | <reponame>Habidatum/slisonner
from slisonner import decoder, encoder
from tests import mocker
from tempfile import mkdtemp
from shutil import rmtree
def test_full_encode_decode_cycle():
temp_out_dir = mkdtemp()
slice_id = '2015-01-02 00:00:00'
x_size, y_size = 10, 16
temp_slice_path = mocker.generate... | 2.3125 | 2 |
cartrade/cartrade/doctype/category/category.py | vignesharumainayagam/cartrade | 0 | 6718 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Tridots Tech Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
class Category(WebsiteGenerator):
def validate(self):
if ' '... | 2.171875 | 2 |
exercises/pyfiles/ex812_polarsincos.py | TUDelft-AE-Python/ae1205-exercises | 1 | 6719 | import matplotlib.pyplot as plt
import math
xtab = []
ytab = []
for i in range(0, 628):
# Calculate polar coordinates for provided equation
phi = float(i) / 100.0
r = 4 * math.cos(2 * phi)
# Convert to Cartesian and store in lists
x = r * math.cos(phi)
y = r * math.sin(phi)
xtab.append(x)... | 3.15625 | 3 |
vendor/packages/logilab-astng/__pkginfo__.py | jgmize/kitsune | 2 | 6720 | # Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:<EMAIL>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (a... | 1.132813 | 1 |
W-DCGAN/model.py | lmyybh/pytorch-networks | 0 | 6721 | <filename>W-DCGAN/model.py
import torch
import torch.nn as nn
class Generator(nn.Module):
def __init__(self, signal_size, out_channels=3):
super(Generator, self).__init__()
self.linear = nn.Linear(signal_size, 1024*4*4)
convs = []
channels = [1024, 512, 256, 128]
fo... | 2.296875 | 2 |
bioinformatics/analysis/rnaseq/prepare/split_gtf_by_type.py | bioShaun/omsCabinet | 0 | 6722 | import fire
import gtfparse
from pathlib import Path
GENCODE_CATEGORY_MAP = {
'IG_C_gene': 'protein_coding',
'IG_D_gene': 'protein_coding',
'IG_J_gene': 'protein_coding',
'IG_V_gene': 'protein_coding',
'IG_LV_gene': 'protein_coding',
'TR_C_gene': 'protein_coding',
'TR_J_gene': 'protein_cod... | 1.359375 | 1 |
rational.py | navel0810/chibi | 0 | 6723 | import math
class Q(object):
def __init__(self,a,b=1):
gcd=math.gcd(a,b)
self.a=a//gcd
self.b=b//gcd
def __repr__(self):
if self.b==1:
return str(self.a)
return f'{self.a}/{self.b}'
def __add__(self,q):
a=self.a
b=self.b... | 3.78125 | 4 |
cities_light/tests/test_import.py | jsandovalc/django-cities-light | 0 | 6724 | from __future__ import unicode_literals
import glob
import os
from dbdiff.fixture import Fixture
from .base import TestImportBase, FixtureDir
from ..settings import DATA_DIR
class TestImport(TestImportBase):
"""Load test."""
def test_single_city(self):
"""Load single city."""
fixture_dir = ... | 2.109375 | 2 |
custom_components/hoymiles/__init__.py | Cosik/HAHoymiles | 0 | 6725 | <reponame>Cosik/HAHoymiles<gh_stars>0
import datetime
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
from .const import (
CONF_PLANT_ID,
)
_LOGGE... | 2.015625 | 2 |
views/auth.py | bluebibi/flask_rest | 0 | 6726 | <reponame>bluebibi/flask_rest
from flask import Blueprint, redirect, render_template, request, flash, session
from database import base
from database.base import User
from forms import UserForm, LoginForm, MyPageUserForm
from flask_login import login_required, login_user, logout_user, current_user
import requests
aut... | 2.578125 | 3 |
doc/.src/book/exer/cable_sin.py | hplgit/fem-book | 86 | 6727 | <reponame>hplgit/fem-book<gh_stars>10-100
import matplotlib.pyplot as plt
def model():
"""Solve u'' = -1, u(0)=0, u'(1)=0."""
import sympy as sym
x, c_0, c_1, = sym.symbols('x c_0 c_1')
u_x = sym.integrate(1, (x, 0, x)) + c_0
u = sym.integrate(u_x, (x, 0, x)) + c_1
r = sym.solve([u.subs(x,0) - ... | 2.890625 | 3 |
skgmm.py | liuliu663/speaker-recognition-py3 | 0 | 6728 | from sklearn.mixture import GaussianMixture
import operator
import numpy as np
import math
class GMMSet:
def __init__(self, gmm_order = 32):
self.gmms = []
self.gmm_order = gmm_order
self.y = []
def fit_new(self, x, label):
self.y.append(label)
gmm = GaussianM... | 2.75 | 3 |
duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/12_features/numtrees_20/rule_6.py | apcarrik/kaggle | 0 | 6729 | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Gender, obj[4]: Age, obj[5]: Education, obj[6]: Occupation, obj[7]: Bar, obj[8]: Coffeehouse, obj[9]: Restaurant20to50, obj[10]: Direction_same, obj[11]: Distance
# {"feature": "Age", "instances": 51, "metric_value": 0.9662, "depth": 1}
... | 2.765625 | 3 |
lib/loss/__init__.py | kennethwdk/PINet | 10 | 6730 | <filename>lib/loss/__init__.py
from .heatmaploss import HeatmapLoss
from .offsetloss import OffsetLoss
from .refineloss import RefineLoss | 1.0625 | 1 |
eth2/beacon/types/historical_batch.py | AndrewBezold/trinity | 0 | 6731 | from typing import Sequence
from eth.constants import ZERO_HASH32
from eth_typing import Hash32
import ssz
from ssz.sedes import Vector, bytes32
from eth2.configs import Eth2Config
from .defaults import default_tuple, default_tuple_of_size
class HistoricalBatch(ssz.Serializable):
fields = [("block_roots", Vec... | 2.234375 | 2 |
app/settings.py | nikosk/fastAPI-microservice-example- | 0 | 6732 | import os
from pydantic import BaseSettings
class Settings(BaseSettings):
DEBUG: bool
DATABASE_URL: str
class Config:
env_file = os.getenv("CONFIG_FILE", ".env")
| 2.03125 | 2 |
ADVECTOR/io_tools/create_bathymetry.py | john-science/ADVECTOR | 7 | 6733 | <filename>ADVECTOR/io_tools/create_bathymetry.py
import numpy as np
import xarray as xr
def create_bathymetry_from_land_mask(land_mask: xr.DataArray) -> xr.DataArray:
"""Method: identifies the lower depth bound of the shallowest
ocean cell (non-null) in each vertical grid column.
:param land_mask: dim... | 3.203125 | 3 |
unitconvert/distance.py | cr2630git/unitconvert | 0 | 6734 | <reponame>cr2630git/unitconvert
"""
A simple python module for converting kilometers to miles or vice versa.
So simple that it doesn't even have any dependencies.
"""
def kilometers_to_miles(dist_in_km):
"""
Actually does the conversion of distance from km to mi.
PARAMETERS
--------
dist_in_km: float
A distan... | 3.796875 | 4 |
contacts/migrations_old/0006_data_status.py | I-TECH-UW/mwachx | 3 | 6735 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import itertools as it
from django.db import models, migrations
def convert_status(apps, schema_editor):
''' Migrate Visit.skipped and ScheduledPhoneCall.skipped -> status
(pending,missed,deleted,attended)
'''
Visit = apps.get_model(... | 2.25 | 2 |
core/tests/test_base_time_range_controller.py | One-Green/plant-keeper-master | 2 | 6736 | import os
import sys
from datetime import time
import unittest
sys.path.append(
os.path.dirname(
os.path.dirname(os.path.join("..", "..", "..", os.path.dirname("__file__")))
)
)
from core.controller import BaseTimeRangeController
class TestTimeRangeController(unittest.TestCase):
def test_time_ran... | 2.734375 | 3 |
generator_code/mp3_generator.py | jurganson/spingen | 0 | 6737 | <gh_stars>0
from gtts import gTTS as ttos
from pydub import AudioSegment
import os
def generate_mp3 (segments, fade_ms, speech_gain, comment_fade_ms, language = "en", output_file_name = "generated_program_sound") :
def apply_comments (exercise_audio, segment) :
new_exercise_audio = exercise_audio
... | 2.8125 | 3 |
relaax/algorithms/ddpg/parameter_server.py | deeplearninc/relaax | 71 | 6738 | from __future__ import absolute_import
from relaax.server.parameter_server import parameter_server_base
from relaax.server.common import session
from . import ddpg_model
class ParameterServer(parameter_server_base.ParameterServerBase):
def init_session(self):
self.session = session.Session(ddpg_model.Sha... | 2.015625 | 2 |
scripts/make_VFS.py | nvoron23/brython | 1 | 6739 | # -*- coding: utf-8 -*-
import json
import os
import pyminifier
try:
import io as StringIO
except ImportError:
import cStringIO as StringIO # lint:ok
# Check to see if slimit or some other minification library is installed and
# Set minify equal to slimit's minify function.
try:
import slimit
js_mi... | 2.4375 | 2 |
main.py | rcox771/spectrum_scanner | 0 | 6740 | <gh_stars>0
from rtlsdr import RtlSdr
from contextlib import closing
from matplotlib import pyplot as plt
import numpy as np
from scipy.signal import spectrogram, windows
from scipy import signal
from skimage.io import imsave, imread
from datetime import datetime
import json
import os
from tqdm import tqdm
import time
... | 2.140625 | 2 |
test/__init__.py | donbowman/rdflib | 1,424 | 6741 | #
import os
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
| 1.476563 | 1 |
examples/mnist1.py | braingineer/pyromancy | 0 | 6742 | from __future__ import print_function
import argparse
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
from tqdm import tqdm
from pyromancy import pyromq
from pyromancy.losses import LossGroup, NegativeLogLik... | 2.15625 | 2 |
selfdrive/locationd/calibrationd.py | matthewklinko/openpilot | 3 | 6743 | #!/usr/bin/env python
import os
import copy
import json
import numpy as np
import selfdrive.messaging as messaging
from selfdrive.locationd.calibration_helpers import Calibration
from selfdrive.swaglog import cloudlog
from common.params import Params
from common.transformations.model import model_height
from common.tra... | 2.140625 | 2 |
hunter/main.py | datastax-labs/hunter | 17 | 6744 | import argparse
import copy
import logging
import sys
from dataclasses import dataclass
from datetime import datetime, timedelta
from slack_sdk import WebClient
from typing import Dict, Optional, List
import pytz
from hunter import config
from hunter.attributes import get_back_links
from hunter.config import ConfigEr... | 2.078125 | 2 |
docs/python/conf.py | jun-yoon/onnxruntime | 2 | 6745 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
import os
import sys
import shutil
# Check these extensions were installed.
import sphinx_gallery.gen_gallery
# The package should be insta... | 1.601563 | 2 |
traffic_sim/__main__.py | ngngardner/toc_project | 0 | 6746 | """Traffic simulator code."""
import sys
from os import path
from traffic_sim.analysis import TrafficExperiment
from traffic_sim.console import console
if not __package__:
_path = path.realpath(path.abspath(__file__))
sys.path.insert(0, path.dirname(path.dirname(_path)))
def main():
"""Run code from CL... | 2.21875 | 2 |
TSFpy/debug/sample_fibonacci.py | ooblog/TSF1KEV | 0 | 6747 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division,print_function,absolute_import,unicode_literals
import sys
import os
os.chdir(sys.path[0])
sys.path.append('/mnt/sda2/github/TSF1KEV/TSFpy')
from TSF_io import *
#from TSF_Forth import *
from TSF_shuffle import *
from TSF_match import *
fro... | 1.96875 | 2 |
Tomboy2Evernote.py | rguptan/Tomboy2Evernote | 0 | 6748 | <reponame>rguptan/Tomboy2Evernote<filename>Tomboy2Evernote.py<gh_stars>0
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
import sys, getopt
import glob
import os
def process_files(inputdir, outputdir):
os.chdir(inputdir)
enex_notes = []
output_filename = 'Tomboy2Evernote.enex'
i = 0
for file ... | 2.703125 | 3 |
demo.py | williamfzc/pyat | 20 | 6749 | from pyatool import PYAToolkit
# 个性化的函数需要toolkit形参,即使不需要使用
def test_b(toolkit):
return 'i am test_b, running on {}'.format(toolkit.device_id)
# 封装adb命令成为方法
PYAToolkit.bind_cmd(func_name='test_a', command='shell pm list package | grep google')
# 或者绑定个性化的函数
PYAToolkit.bind_func(real_func=test_b)
# 是否需要log
PYAToo... | 2.234375 | 2 |
nnlab/nn/graph.py | nlab-mpg/nnlab | 0 | 6750 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from six.moves import xrange, zip
import tensorflow as tf
from .tensor import Tensor
class Graph(object):
"""The class for defining computational graph."""
def __init__(self, loss=N... | 2.84375 | 3 |
local-rotations.py | katiekruzan/masters-thesis | 0 | 6751 | """
Here we're going to code for the local rotations. We're doing an object oriented approach
Left and right are in reference to the origin
"""
__version__ = 1.0
__author__ = '<NAME>'
import string # just to get the alphabet easily iterable
import sys # This just helps us in our printing
from typing import Dict # ... | 4.15625 | 4 |
PT-FROST/frost.py | EtienneDavid/FROST | 2 | 6752 | import random
import argparse
import numpy as np
import pandas as pd
import os
import time
import string
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
from model import WideResnet
from cifar import get_train_loader, get_val_loader
from ... | 2.046875 | 2 |
Logistic Regression/main.py | Frightera/LR-and-NN-for-Cancer-Data | 4 | 6753 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
data = pd.read_csv("data.csv")
data.info()
"""
Data columns (total 33 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 id 569 no... | 2.8125 | 3 |
fine-tune/inference_embedding.py | LinHuiqing/nonparaSeq2seqVC_code | 199 | 6754 | import os
import numpy as np
import torch
import argparse
from hparams import create_hparams
from model import lcm
from train import load_model
from torch.utils.data import DataLoader
from reader import TextMelIDLoader, TextMelIDCollate, id2sp
from inference_utils import plot_data
parser = argparse.ArgumentParser()
p... | 2.234375 | 2 |
dalme_app/migrations/0001_initial.py | DALME/dalme | 6 | 6755 | <gh_stars>1-10
# Generated by Django 3.1.2 on 2020-11-29 13:25
import dalme_app.models._templates
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_currentuser.middleware
import uuid
import wagtail.search.index
class Migration(migrations.Migratio... | 1.648438 | 2 |
django_app/DataEntrySystem/apps.py | Hezepeng/Financial-Acquisition-And-Editing-System | 0 | 6756 | <gh_stars>0
from django.apps import AppConfig
class DataentrysystemConfig(AppConfig):
name = 'DataEntrySystem'
| 1.210938 | 1 |
bombgame/recursive_bt_maze.py | JeFaProductions/bombgame2 | 0 | 6757 | <filename>bombgame/recursive_bt_maze.py
# recursive_bt_maze.py
#
# Author: <NAME>
# Created On: 16 Feb 2019
import os
import random
import numpy as np
class RecursiveBTMaze:
def __init__(self, width, height):
if width % 2 == 0 or height % 2 == 0:
raise ValueError("Width and height need to be ... | 3.484375 | 3 |
KV_Reader.py | Nibuja05/KVConverter | 2 | 6758 |
import re
import math
class KVPart():
"""docstring for KVPart"""
def __init__(self, name, tab_count = 0):
#super(KVPart, self).__init__()
self.name = name
self.values = []
self.tab_count = tab_count
self.parent = None
self.master = False
def add_simple_value(self, value):
self.values.append(value)
... | 3.03125 | 3 |
scripts/updatetestsuiterefimages.py | PaulDoessel/appleseed | 0 | 6759 | #!/usr/bin/python
#
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2014-2016 <NAME>, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person ob... | 1.414063 | 1 |
raidquaza/poll/polls.py | Breee/raidquaza | 2 | 6760 | from typing import List, Any
import time
from discord import Embed, Reaction
from utils import uniquify
# EMOJIS regional_indicator_A to regional_indicator_T
reaction_emojies = ['\U0001F1E6',
'\U0001F1E7',
'\U0001F1E8',
'\U0001F1E9',
'\U00... | 2.625 | 3 |
Python/Regex and Parsing/Validating and Parsing Email Addresses.py | pavstar619/HackerRank | 61 | 6761 | import email.utils as em
import re
class Main():
def __init__(self):
self.n = int(input())
for i in range(self.n):
self.s = em.parseaddr(input())
if re.match(r'^[a-zA-Z](\w|-|\.|_)+@[a-zA-Z]+\.[a-zA-Z]{0,3}$', self.s[1]):
print(em.format... | 3.171875 | 3 |
chatbot/train.py | codingsoo/virtaul_girlfriend | 4 | 6762 | <reponame>codingsoo/virtaul_girlfriend
# -*- coding: utf-8 -*-
import tensorflow as tf
import random
import math
import os
from config import FLAGS
from model import Seq2Seq
from dialog import Dialog
def train(dialog, batch_size=100, epoch=100):
model = Seq2Seq(dialog.vocab_size)
with tf.Session() as sess:... | 2.421875 | 2 |
evaluation/dmp_behavior.py | rock-learning/approxik | 1 | 6763 | # Author: <NAME> <<EMAIL>>
import numpy as np
from bolero.representation import BlackBoxBehavior
from bolero.representation import DMPBehavior as DMPBehaviorImpl
class DMPBehavior(BlackBoxBehavior):
"""Dynamical Movement Primitive.
Parameters
----------
execution_time : float, optional (default: 1)
... | 2.578125 | 3 |
logger.py | oxsoftdev/bitstampws-logger | 0 | 6764 | import logging.config
import tornado
from bitstampws import Client as Websocket
import lib.configs.logging
from lib.subscribers import SimpleLoggerSubscriber
logging.config.dictConfig(lib.configs.logging.d)
if __name__ == '__main__':
with Websocket() as client:
with SimpleLoggerSubscriber(client):
... | 2 | 2 |
engine/tree.py | dougsc/gp | 0 | 6765 | import random
from pprint import pformat
from copy import deepcopy
from utils.logger import GP_Logger
from terminal_set import TerminalSet
class Tree:
@classmethod
def log(cls):
return GP_Logger.logger(cls.__name__)
def __init__(self):
self.terminal_set=None
self.function_set=None
self.function_... | 2.5625 | 3 |
src/pyrin/packaging/__init__.py | wilsonGmn/pyrin | 0 | 6766 | <reponame>wilsonGmn/pyrin
# -*- coding: utf-8 -*-
"""
packaging package.
"""
from pyrin.packaging.base import Package
class PackagingPackage(Package):
"""
packaging package class.
"""
NAME = __name__
COMPONENT_NAME = 'packaging.component'
CONFIG_STORE_NAMES = ['packaging']
| 1.257813 | 1 |
chap7/heapq_merge.py | marble-git/python-laoqi | 0 | 6767 | <reponame>marble-git/python-laoqi
#coding:utf-8
'''
filename:heapq_merge.py
chap:7
subject:4-2
conditions:heapq.merge,sorted_list:lst1,lst2
lst3=merged_list(lst1,lst2) is sorted
solution:heapq.merge
'''
import heapq
lst1 = [1,3,5,7,9]
lst2 = [2,4,6,8]
if __name__ == '__main__... | 2.90625 | 3 |
lib/googlecloudsdk/third_party/apis/serviceuser/v1/serviceuser_v1_client.py | kustodian/google-cloud-sdk | 0 | 6768 | """Generated client library for serviceuser version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.serviceuser.v1 import serviceuser_v1_messages as messages
class ServiceuserV1(base_api.BaseApiClient):
"""Generat... | 1.929688 | 2 |
bindings/python/examples/feature_example.py | lithathampan/wav2letter | 1 | 6769 | #!/usr/bin/env python3
# adapted from wav2letter/src/feature/test/MfccTest.cpp
import itertools as it
import os
import sys
from wav2letter.feature import FeatureParams, Mfcc
def load_data(filename):
path = os.path.join(data_path, filename)
path = os.path.abspath(path)
with open(path) as f:
retu... | 2.4375 | 2 |
app.py | shreyashack/PY_Message_Decryption | 1 | 6770 | <gh_stars>1-10
from tkinter import *
import onetimepad
class Message_Decrypt:
def __init__(self,root):
self.root=root
self.root.title("Message Decryption")
self.root.geometry("400x475")
self.root.iconbitmap("logo368.ico")
self.root.resizable(0,0)
def on_enter1(e):
... | 2.96875 | 3 |
examples/rrbot_p2p_low_energy.py | abcamiletto/urdf2optcontrol | 0 | 6771 | #!/usr/bin/env python3
from urdf2optcontrol import optimizer
from matplotlib import pyplot as plt
import pathlib
# URDF options
urdf_path = pathlib.Path(__file__).parent.joinpath('urdf', 'rrbot.urdf').absolute()
root = "link1"
end = "link3"
in_cond = [0] * 4
def my_cost_func(q, qd, qdd, ee_pos, u, t):
return u.... | 2.71875 | 3 |
SocketServer/apps/django-db-pool-master/dbpool/db/backends/postgresql_psycopg2/base.py | fqc/SocketSample_Mina_Socket | 23 | 6772 | """
Pooled PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django import get_version as get_django_version
from django.db.backends.postgresql_psycopg2.base import \
DatabaseWrapper as OriginalDatabaseWrapper
from django.db.backends.signals import connection_c... | 2.671875 | 3 |
backend/tests/test_api/test_api_auth.py | abodacs/fastapi-ml-skeleton | 0 | 6773 | <gh_stars>0
# Skeleton
from fastapi_skeleton.core import messages
def test_auth_using_prediction_api_no_apikey_header(test_client) -> None:
response = test_client.post("/api/model/predict")
assert response.status_code == 400
assert response.json() == {"detail": messages.NO_API_KEY}
def test_auth_using_p... | 2.109375 | 2 |
docker/cleanup_generators.py | hashnfv/hashnfv-nfvbench | 0 | 6774 | <filename>docker/cleanup_generators.py
# Copyright 2016 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | 2.09375 | 2 |
object_detection/box_coders/mean_stddev_box_coder.py | ophirSarusi/TF_Object_Detection | 59 | 6775 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 2.65625 | 3 |
storage/aug_buffer.py | nsortur/equi_rl | 9 | 6776 | <filename>storage/aug_buffer.py
from storage.buffer import QLearningBuffer
from utils.torch_utils import ExpertTransition, augmentTransition
from utils.parameters import buffer_aug_type
class QLearningBufferAug(QLearningBuffer):
def __init__(self, size, aug_n=9):
super().__init__(size)
self.aug_n =... | 2.21875 | 2 |
hlrl/torch/agents/wrappers/agent.py | Chainso/HLRL | 0 | 6777 | <reponame>Chainso/HLRL<filename>hlrl/torch/agents/wrappers/agent.py<gh_stars>0
import torch
from typing import Any, Dict, List, OrderedDict, Tuple
from hlrl.core.agents import RLAgent
from hlrl.core.common.wrappers import MethodWrapper
class TorchRLAgent(MethodWrapper):
"""
A torch agent that wraps its exper... | 2.28125 | 2 |
PixivConstant.py | NHOrus/PixivUtil2 | 0 | 6778 | <reponame>NHOrus/PixivUtil2
# -*- coding: utf-8 -*-
PIXIVUTIL_VERSION = '20191220-beta1'
PIXIVUTIL_LINK = 'https://github.com/Nandaka/PixivUtil2/releases'
PIXIVUTIL_DONATE = 'https://bit.ly/PixivUtilDonation'
# Log Settings
PIXIVUTIL_LOG_FILE = 'pixivutil.log'
PIXIVUTIL_LOG_SIZE = 10485760
PIXIVUTIL_LOG_COUNT = 10
PI... | 1.101563 | 1 |
dynamic_schemas/views.py | Threemusketeerz/DSystems | 1 | 6779 | from django.http import Http404
from django.shortcuts import render, redirect, reverse
from django.views.generic import ListView
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from rest_framework import st... | 1.976563 | 2 |
my_classes/.history/ModulesPackages_PackageNamespaces/example3a/main_20210725220637.py | minefarmer/deep-Dive-1 | 0 | 6780 |
import os.path
import types
import sys
| 1.023438 | 1 |
api/views.py | conscience99/lyriko | 0 | 6781 | from django.shortcuts import render
from rest_framework import response
from rest_framework.serializers import Serializer
from . import serializers
from rest_framework.response import Response
from rest_framework.views import APIView
from django.views import View
from rest_framework import status
from . models import S... | 2 | 2 |
__dm__.py | AbhilashDatta/InstagramBot | 12 | 6782 | from selenium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
def Dm(driver,user,message):
''' This functio... | 2.8125 | 3 |
mashov.py | Yotamefr/BeitBiram | 1 | 6783 | import requests
from datetime import datetime
import json
from extras import Day, Lesson
class PasswordError(Exception):
pass
class LoginFailed(Exception):
pass
class MashovAPI:
"""
MashovAPI
Originally made by Xiddoc. Project can be found here: https://github.com/Xiddoc/MashovAPI
Modifica... | 2.703125 | 3 |
lab6.py | jschmidtnj/CS115 | 0 | 6784 | '''
Created on 10/11/2017
@author: <EMAIL>
Pledge: I pledge my honor that I have abided by the Stevens Honor System -<NAME>
CS115 - Lab 6
'''
def isOdd(n):
'''Returns whether or not the integer argument is odd.'''
#question 1: base_2 of 42: 101010
if n == 0:
return False
if n % 2 != 0:
... | 3.734375 | 4 |
clover.py | imyz/25000 | 8 | 6785 | #!/usr/bin/env python
from math import *
import sys
def rotate(x, y, degrees):
c = cos(pi * degrees / 180.0)
s = sin(pi * degrees / 180.0)
return x * c + y * s, y * c - x * s
def move(verb, **kwargs):
keys = kwargs.keys()
keys.sort()
words = [verb.upper()]
for key in keys:
words.a... | 2.953125 | 3 |
scripts/mnist_inference.py | asiakaczmar/noise2self | 0 | 6786 | import torch
from torchvision.datasets import MNIST
from torchvision import transforms
from torch.utils.data import DataLoader
from scripts.utils import SyntheticNoiseDataset
from models.babyunet import BabyUnet
CHECKPOINTS_PATH = '../checkpoints/'
mnist_test = MNIST('../inferred_data/MNIST', download=True,
... | 2.46875 | 2 |
src/processing/augmentation.py | sdcubber/kaggle_carvana | 0 | 6787 | # Script for data augmentation functions
import numpy as np
from collections import deque
from PIL import Image
import cv2
from data.config import *
def imread_cv2(image_path):
"""
Read image_path with cv2 format (H, W, C)
if image is '.gif' outputs is a numpy array of {0,1}
"""
image_format = ima... | 3.296875 | 3 |
substitute_finder/templatetags/substitute_finder_extra.py | tohugaby/pur_beurre_web | 1 | 6788 | <reponame>tohugaby/pur_beurre_web<gh_stars>1-10
"""
substitute_finder app custom templatetags module
"""
from django import template
register = template.Library()
@register.filter
def range_tag(value, min_value=0):
"""
tag that return a range
"""
if value:
return range(min_value, value)
r... | 2.171875 | 2 |
terrafirma/core/views/env.py | AlexandraAlter/django-terrafirma | 0 | 6789 | <filename>terrafirma/core/views/env.py
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse_lazy
from django import views
from django.views import generic as g_views
from django.views.generic import base as b_views, edit as e_views
from .. import forms, models
class NewEnv... | 2.234375 | 2 |
geoviz/__init__.py | JustinGOSSES/geoviz | 6 | 6790 | from load_las_data import LoadLasData
from altair_log_plot import AltAirLogPlot
from load_shapefile_data import LoadShpData
from alitair_well_location_map import WellLocationMap
| 1.078125 | 1 |
core/data/utils.py | ahmad-PH/auto_lcc | 2 | 6791 | <reponame>ahmad-PH/auto_lcc<filename>core/data/utils.py
import pickle
import pandas as pd
from typing import List, Tuple
def load_libofc_df(data_path):
def tuple_to_df(data: List[Tuple]) -> pd.DataFrame:
return pd.DataFrame(data, columns=["class", "title", "synopsis", "id"])
with open(data_path, 'rb')... | 2.875 | 3 |
apps/users/adminx.py | hhdMrLion/mxshop-api | 0 | 6792 | <reponame>hhdMrLion/mxshop-api<filename>apps/users/adminx.py
import xadmin
from users.models import VerifyCode
from xadmin import views
class BaseSetting(object):
# 添加主题功能
enable_themes = True
user_bootswatch = True
class GlobalSettings(object):
# 全局配置,后端管理标题和页脚
site_title = '天天生鲜后台... | 1.773438 | 2 |
Archive/train_cnn.py | Yeok-c/Urban-Sound-Classification | 0 | 6793 | ### Load necessary libraries ###
import numpy as np
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
import tensorflow as tf
from tensorflow import keras
from sklearn.metrics import ConfusionMatrixDisplay
model = get_network()
model.summary()
### Train and evaluate via 10-Folds ... | 2.515625 | 3 |
Python3/1436-Destination-City/soln.py | wyaadarsh/LeetCode-Solutions | 5 | 6794 | <filename>Python3/1436-Destination-City/soln.py
class Solution:
def destCity(self, paths: List[List[str]]) -> str:
bads = set()
cities = set()
for u, v in paths:
cities.add(u)
cities.add(v)
bads.add(u)
ans = cities - bads
return list(ans)[0... | 2.859375 | 3 |
metaflow/plugins/kfp/tests/flows/resources_flow.py | zillow/metaflow | 7 | 6795 | import os
import pprint
import subprocess
import time
from typing import Dict, List
from kubernetes.client import (
V1EnvVar,
V1EnvVarSource,
V1ObjectFieldSelector,
V1ResourceFieldSelector,
)
from metaflow import FlowSpec, step, environment, resources, current
def get_env_vars(env_resources: Dict[st... | 2.234375 | 2 |
src/nb_utils/general.py | redfrexx/osm_association_rules | 0 | 6796 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions used for data handling
"""
__author__ = "<NAME>, GIScience Research Group, Heidelberg University"
__email__ = "<EMAIL>"
import os
import yaml
from shapely.geometry import box
import numpy as np
import pandas as pd
import geopandas as gpd
import json
from nb_... | 2.296875 | 2 |
keystoneclient/auth/identity/v3/federated.py | darren-wang/ksc | 1 | 6797 | <filename>keystoneclient/auth/identity/v3/federated.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 ... | 1.96875 | 2 |
bin/Python27/Lib/site-packages/tables/utilsExtension.py | lefevre-fraser/openmeta-mms | 0 | 6798 | from warnings import warn
from tables.utilsextension import *
_warnmsg = ("utilsExtension is pending deprecation, import utilsextension instead. "
"You may use the pt2to3 tool to update your source code.")
warn(_warnmsg, DeprecationWarning, stacklevel=2)
| 1.304688 | 1 |
config.py | iDevHank/i18n | 0 | 6799 | <gh_stars>0
#!/usr/bin/env python3
# The format of your own localizable method.
# This is an example of '"string".localized'
SUFFIX = '.localized'
KEY = r'"(?:\\.|[^"\\])*"'
LOCALIZABLE_RE = r'%s%s' % (KEY, SUFFIX)
# Specify the path of localizable files in project.
LOCALIZABLE_FILE_PATH = ''
LOCALIZABLE_FILE_NAMES =... | 2.09375 | 2 |