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 |
|---|---|---|---|---|---|---|
demae/dest/__init__.py | uiureo/demae | 6 | 12769651 | # flake8: noqa
from .s3_dest import S3Dest
| 0.921875 | 1 |
bots/draftsimtools/nnet_architecture.py | khakhalin/mtg | 14 | 12769652 | <reponame>khakhalin/mtg
# Torch imports
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data.dataset import Dataset
# Implements NN
class DraftNet(nn.Module):
def __init__(self, set_tensor, use_features = False):
"""Placeholder NN. ... | 2.453125 | 2 |
src/vectorgen/run_genev.py | davehadley/hk-vectorgen | 0 | 12769653 | <filename>src/vectorgen/run_genev.py
import ROOT
import shutil
import tempfile
ROOT.PyConfig.IgnoreCommandLineOptions = True
import subprocess
import os
import glob
import argparse
import itertools
import collections
import runtime
#Jobs:
# (1) Merge flux files.
# (2) Create geometry.
# (3) Run event_rate.
... | 2.203125 | 2 |
comics.py | wormsparty/python-comics-reader | 1 | 12769654 | <filename>comics.py
#!/usr/bin/env python3
#
# Copyright (C) 2012 <NAME> <wormsparty [at] gmail [dot] com>
#
# This program is a free software: you can redistribute it
# and/or modify it under the terms of the 'New BSD License'.
# See COPYING for more information.
#
import archive
import pyglet
import sys
import io
... | 2.953125 | 3 |
stack/doubly_linked_list.py | Oyekunle-Mark/tangled-mystery | 0 | 12769655 | <gh_stars>0
from typing import TypeVar, Generic, Optional, Any, Union
T = TypeVar('T')
class ListNode(Generic[T]):
"""Each ListNode holds a reference to its previous node
as well as its next node in the List."""
def __init__(self, value: T, prev: Optional[Any] = None, next: Optional[Any] = None) -> None... | 3.609375 | 4 |
py4e103/w4.e12.graded2.py | markhorsfield/py4e101 | 0 | 12769656 | <reponame>markhorsfield/py4e101<gh_stars>0
#!/usr/bin/python3
# In this assignment you will write a Python program that
# expands on https://www.py4e.com/code3/urllinks.py.
#
# The program will use urllib to read the HTML from the data files below,
# extract the href= values from the anchor tags,
# scan for a tag that... | 3.953125 | 4 |
jobcrawler/core/email/address.py | amakus/JobCrawler | 0 | 12769657 | class EmailAddress:
def __init__(self, email):
self.email = email
self._email_tpl = tuple(self._email.split('@'))
def __str__(self):
return self.email
def __repr__(self):
return f"{EmailAddress.__name__}('{self.email}')"
@property
def email(self):
return s... | 3.46875 | 3 |
plaster/run/lnfit/lnfit_params.py | zack-erisyon/plaster_v1 | 0 | 12769658 | <reponame>zack-erisyon/plaster_v1<filename>plaster/run/lnfit/lnfit_params.py<gh_stars>0
from munch import Munch
from plaster.tools.schema.schema import Schema as s, Params
class LNFitParams(Params):
defaults = Munch(photometry_only=False)
schema = s(
s.is_kws_r(
dye_on_threshold=s.is_int(... | 1.804688 | 2 |
python/osr/osr_getprojectionmethods_test.py | schwehr/gdal-autotest2 | 0 | 12769659 | <reponame>schwehr/gdal-autotest2
#!/usr/bin/env python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 1.703125 | 2 |
nith_results/__init__.py | sauravchandra1/Nith_results | 63 | 12769660 | __version__ = '0.0.1'
__mod_name__ = 'nith_results'
| 1.015625 | 1 |
tests/test_sso.py | fmarco76/DiscourseSSO | 14 | 12769661 | <filename>tests/test_sso.py
# Copyright 2015 INFN
# 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
#
# ... | 2.578125 | 3 |
src/testing/acceptance/test_drives.py | cloudsigma/pycloudsigma | 13 | 12769662 | from multiprocessing import Process, Queue
import os
import struct
import tempfile
import unittest
import random
from logging import getLogger
from nose.plugins.attrib import attr
from past.builtins import basestring
import cloudsigma.resource as cr
import cloudsigma.errors as errors
from testing.utils import DumpRes... | 2.046875 | 2 |
common/src/stack/command/stack/commands/load/json/plugin_global.py | shivanshs9/stacki | 0 | 12769663 | <gh_stars>0
# @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
import json
from stack.exception import CommandError
class Plugin(stack.commands.Plugin, stack.commands.Comma... | 1.992188 | 2 |
rct_full_res/rct_patch.py | jeFF0Falltrades/Tutorials | 24 | 12769664 | # rct_patch.py
#
# Author: jeFF0Falltrades
#
# A patching script for the Roller Coaster Tycoon (1999) game
# executable for play on modern systems at full resolution.
#
# Homepage with Video Tutorial:
# https://github.com/jeFF0Falltrades/Game-Patches/tree/master/rct_full_res
#
# MIT License
#
# Copyright (c) 2020 <NAME... | 1.742188 | 2 |
notes.py | Lianaghn/pin | 0 | 12769665 | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QListWidget, QLineEdit, QTextEdit, QInputDialog, QHBoxLayout, QVBoxLayout, QFormLayout
import json
app = QApplication([])
notes = {
"Добро пожаловать!" : {
"текст" : "Это самое лучшее приложени... | 2.65625 | 3 |
settings.py | chingandy/intelligent-space-invaders-player | 1 | 12769666 |
class Settings():
"""A class to store all settings for Allien Invation."""
def __init__(self):
"""Initialize the game's static settings"""
# Screen Settings
self.screen_width = 800
self.screen_height = 600
# self.bg_color = (0, 0, 0)
self.bg_color = (10, 10, 10)... | 3.421875 | 3 |
acondbs/auth/__init__.py | simonsobs/acondbs | 0 | 12769667 | <reponame>simonsobs/acondbs
from flask import request
from ..models import (
GitHubToken,
GitHubUser,
AccountAdmin
)
##__________________________________________________________________||
def is_signed_in():
"""
"""
token = _get_token_from_http_headers()
if not token:
return False
... | 2.375 | 2 |
tests/unit/service/test_business_super_man.py | thiagortz/justice-league | 2 | 12769668 | from unittest import TestCase
from unittest.mock import patch
from app.service.business_service import SuperMan
class TestSuperMan(TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
def setUp(self):
pass
def tearDown(self):
... | 2.875 | 3 |
talker.py | Allahcadrimbo/RandomTalker | 0 | 12769669 | <gh_stars>0
"""
Author: <NAME>
Date: 10/4/19
PA #2 NLP
In this PA we are attempting to create a random text generator. The program (talker) will learn an N-gram language model
from an arbitrary number of plain text files, and then use the generated model to generate the random sentences. An
N-gram is a probabil... | 3.234375 | 3 |
renkler.py | 0xberkay/renkler | 1 | 12769670 | #<NAME>
#<EMAIL>
#github.com/bksec
#####################################
###############RENKLER###############
#####################################
sifirla = '\033[0m'
beyaz = '\033[37m'
kirmizi= '\033[31m'
turuncu = '\u001b[38;5;208m'
yesil= '\033[32m'
sari= '\033[33m'
lacivert= '\033[34m'
pembe= '\033[35m'
mor = ... | 1.226563 | 1 |
nlp/nn.py | hanxiao/tf-attentive-conv | 34 | 12769671 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <<EMAIL>> <https://hanxiao.github.io>
import tensorflow as tf
initializer = tf.contrib.layers.variance_scaling_initializer(factor=1.0,
mode='FAN_AVG',
... | 2.625 | 3 |
tacker/tests/unit/vnfm/policy_actions/respawn/test_respawn.py | takahashi-tsc/tacker | 116 | 12769672 | <reponame>takahashi-tsc/tacker
# Copyright (c) 2014-2018 China Mobile (SuZhou) Software Technology Co.,Ltd.
# 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
#
# ... | 1.5 | 2 |
tests/unit_tests/dagmc/test.py | ornlneutronimaging/openmc | 0 | 12769673 | import shutil
import numpy as np
import pytest
import openmc
import openmc.capi
from tests import cdtemp
pytestmark = pytest.mark.skipif(
not openmc.capi._dagmc_enabled(),
reason="DAGMC CAD geometry is not enabled.")
@pytest.fixture(scope="module", autouse=True)
def dagmc_model(request):
model = open... | 2.03125 | 2 |
planet4/hdf2csv.py | CitizenScienceInAstronomyWorkshop/P4_sandbox | 1 | 12769674 | """This script requires to launch a local ipcontroller. If you execute this
locally, do it with `ipcluster start`.
"""
import argparse
import glob
import logging
import os
import sys
import time
from ipyparallel import Client
from ipyparallel.util import interactive
logging.basicConfig(format='%(levelname)s: %(messag... | 2.453125 | 2 |
EasyLaMa/utils/cli.py | kanttouchthis/EasyLaMa | 1 | 12769675 | import argparse
from EasyLaMa import TextRemover
from .util import load_image
from .util import load_images
import os
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("images", nargs="+", help="Images to process. Required")
parser.add_argument("-e", "--edge", type=int, default=1, help... | 2.65625 | 3 |
dataset/cifar10.py | JuliousHurtado/Meta-Iteration | 0 | 12769676 | <reponame>JuliousHurtado/Meta-Iteration
import torch
import random
import copy
import numpy as np
from collections import defaultdict
from PIL import Image
from torchvision import transforms
import torchvision.transforms.functional as F
import learn2learn as l2l
from dataset.datasets_utils import create_bookkeeping
... | 2.671875 | 3 |
Week_2/02_pymongo_query_find.py | KartikKannapur/MongoDB_M101P | 0 | 12769677 | <filename>Week_2/02_pymongo_query_find.py<gh_stars>0
__author__ = "<NAME>"
# #Import Python Libraries
from pymongo import MongoClient
import json
# #Import Property Files
# import properties as prop
json_properties_file = open("properties.json")
json_properties = json.loads(json_properties_file.read())
# #Connect to... | 3.109375 | 3 |
kattis/python/quadrant_selection.py | PixPanz/VariousTomfoolery | 0 | 12769678 | x = int(input())
y = int(input())
ans = 0
if x > 0:
if y > 0:
ans = 1
else: ans = 4
else:
if y > 0:
ans = 2
else: ans = 3
print(ans) | 3.65625 | 4 |
dynamo/vectorfield/utils.py | davisidarta/dynamo-release | 0 | 12769679 | from tqdm import tqdm
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from scipy.sparse import issparse
import numdifftools as nd
from multiprocessing.dummy import Pool as ThreadPool
import multiprocessing as mp
import itertools, functools
from ..tools.utils import timeit
def is_outsid... | 2.203125 | 2 |
finance_ml/features/__init__.py | zli69/finance_ml | 51 | 12769680 | from .importance import feat_imp_MDA, feat_imp_MDI, feat_imp_SFI
from .orth import get_evec, ortho_feats
from .entropy import match_length, lempel_zib_lib, get_entropy_rate, plug_in, konto
from .fraction import get_opt_d, frac_diff_FFD | 1.015625 | 1 |
scripts/OshAdjustGradient.py | ebhoward/QgisIMPTools | 0 | 12769681 | """
***************************************************************************
OshAdjustGradient.py
---------------------
Date : Nov 2020
Copyright : (C) 2020 by <NAME>
Email : <EMAIL> at g<EMAIL> dot <EMAIL>
************************************************... | 1.492188 | 1 |
high_dimensional_sampling/procedures.py | williamjameshandley/high-dimensional-sampling | 0 | 12769682 | <reponame>williamjameshandley/high-dimensional-sampling
from abc import ABC, abstractmethod
class Procedure(ABC):
"""
Abstract base class for all sampling procedures
All sampling procedure subjected to an experiment should be derived from this
class. It requires the implementation of the __init__, __... | 3.546875 | 4 |
setup.py | JevexEndo/qtdesign6 | 0 | 12769683 | import codecs
import os.path
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
def get_version(rel_... | 1.742188 | 2 |
scripts/inline_examples.py | NHSDigital/fhir-converter | 0 | 12769684 | #!/usr/bin/env python
import json
import os
import sys
from jsonpath_ng import parse
from lxml import etree
SPEC_DIR = f"{os.path.dirname(os.path.realpath(__file__))}/../specification"
def main(file: str):
with open(file, 'r') as f:
spec = json.load(f)
req_path = parse("$.paths.['/$convert'].p... | 2.734375 | 3 |
csc_checks.py | mvollandt/csc | 1 | 12769685 | # filename : csc_checks.py
# description : check definitions (security best practices and CVEs)
# create date : 2018-05-07 14:07:33.569768
csc1_1 = {'check_name': 'csc1_1',
'check_type': 'check_in_simple',
'match1': 'banner motd',
'match2': 'n/a',
'required': 'yes',
'result_ok': 'Test successful.... | 1.640625 | 2 |
Albedo/AlbedoPh1Queue.py | bradrubin/PycharmProjects | 0 | 12769686 | bucketName = 'org.cicsnc.albedo'
basePath = 'Input/area/'
satellite = 'goes13'
year = '2017'
startDay = 1
endDay = 10
filterBand = 'BAND_01'
dryrun = False
import re
from os import fdopen, remove
from shutil import move
from tempfile import mkstemp
import boto3
def replace(file_path, pattern, subst):
fh, abs_pa... | 1.851563 | 2 |
tests/modin/modin_tests.py | sumanthratna/nlu | 1 | 12769687 | <reponame>sumanthratna/nlu
import unittest
import pandas as pd
import numpy as np
import modin.pandas as mpd
import numpy as np
import nlu
import sparknlp
import pyspark
class MyTestCase(unittest.TestCase):
def test_print_pipe_info(self):
# ## works with RAY and DASK backends
data = {"text": ['This... | 2.8125 | 3 |
backend/resolver/resolver.py | bb111189/Tora-Zilliqa | 0 | 12769688 | # -*- coding:utf-8 -*-
# Copyright 2019 TEEX
#
# 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 ... | 2.390625 | 2 |
var/spack/repos/builtin/packages/tensorflow/package.py | electronicvisions/spack | 2 | 12769689 | from spack import *
from glob import glob
import os
class Tensorflow(Package):
"""TensorFlow is an Open Source Software Library for Machine Intelligence"""
homepage = "https://www.tensorflow.org"
url = "https://github.com/tensorflow/tensorflow/archive/v0.10.0.tar.gz"
version('2.0.0-alpha0', 'a26... | 2.234375 | 2 |
YASDSSSS.py | lonomoji/vampy-portfolio | 0 | 12769690 | <filename>YASDSSSS.py<gh_stars>0
print("What is yas?")
word = input()
def isYas(word):
Yasses = True
state=0
for i in range(len(word)):
if word[i].isalpha():
if state == 0:
if word[i] in ["Y","y"]:
state=1
else:
Yasses = False
elif state == 1:
if word[i] in ["Y","y"]:
state=1
e... | 4 | 4 |
0501-0600/0537-N-Gram (Map Reduce)/0537-N-Gram (Map Reduce).py | jiadaizhao/LintCode | 77 | 12769691 | <filename>0501-0600/0537-N-Gram (Map Reduce)/0537-N-Gram (Map Reduce).py
class NGram:
# @param {int} n a integer
# @param {str} string a string
def mapper(self, _, n, string):
# Write your code here
# Please use 'yield key, value' here
for i in range(len(string) - n + 1):
... | 3.203125 | 3 |
dist/uploadutils.py | bwbarrett/ompi-scripts | 1 | 12769692 | #!/usr/bin/python
#
# Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights
# Reserved.
#
# Additional copyrights may follow
#
import boto3
import botocore
import sys
import re
import os
import json
import tarfile
import hashlib
from io import StringIO
import datetime
import u... | 2.9375 | 3 |
tests/test_articles.py | Mzazi25/newsApp | 0 | 12769693 | <reponame>Mzazi25/newsApp<gh_stars>0
import unittest
from app.models import Articles
class ArticleSourceTest(unittest.TestCase):
'''
Test Class to test the behavior of the Article Sources
'''
def setUp(self):
'''
setup method that runs before every test
'''
self.new_art... | 3.171875 | 3 |
eip96/eip_96_test_script.py | kevaundray/research | 1,351 | 12769694 | from ethereum import tester, vm
from ethereum.utils import sha3, encode_int32, safe_ord, encode_hex
from ethereum.state_transition import apply_message
s = tester.state()
c = s.contract('eip_96_blockhash_getter.se.py')
blockhash_addr = b'\x00' * 19 + b'\x10'
system_addr = b'\xff' * 19 + b'\xfe'
s.state.set_code(blockha... | 2.078125 | 2 |
django_docutils/lib/tests/test_utils.py | tony/django-docutils | 10 | 12769695 | from django_docutils.lib.utils import chop_after_docinfo, chop_after_title
def test_chop_after_title():
content = """=============================================
Learn JavaScript for free: The best resources
=============================================
first section
-------------
some content
""".strip()
... | 2.421875 | 2 |
example_config.py | ff781/PFERD | 0 | 12769696 | <reponame>ff781/PFERD
import argparse
from pathlib import Path, PurePath
from PFERD import Pferd
from PFERD.ilias import IliasElementType
from PFERD.transform import (attempt, do, glob, keep, move, move_dir,
optionally, re_move, re_rename)
tf_ss_2020_numerik = attempt(
re_move(r"Übung... | 2.125 | 2 |
warehouse/packaging/models.py | domenkozar/warehouse | 0 | 12769697 | <reponame>domenkozar/warehouse
# Copyright 2013 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 2.125 | 2 |
tests/test_docstrings.py | pquinterome/https-github.com-Radiomics-pyradiomics | 1 | 12769698 | # to run this test, from directory above:
# setenv PYTHONPATH /path/to/pyradiomics/radiomics
# nosetests --nocapture -v tests/test_docstrings.py
import logging
from nose_parameterized import parameterized
import six
from radiomics import getFeatureClasses
from testUtils import custom_name_func
featureClasses = getF... | 2.28125 | 2 |
server/fm_server/device/rabbitmq_messages.py | nstoik/farm_monitor | 1 | 12769699 | """Device RabbitMQ messages module."""
import json
import logging
import time
import pika
from fm_server.settings import get_config
LOGGER = logging.getLogger("fm.device.rabbitmq")
def get_connection(config=None):
"""This method connects to RabbitMQ, returning the connection handle.
When th... | 2.75 | 3 |
simulasi/lab0.5/pamer-saham/script.py | reiva5/struktur-data-dan-algoritma | 0 | 12769700 | <reponame>reiva5/struktur-data-dan-algoritma<filename>simulasi/lab0.5/pamer-saham/script.py
import sys
import os
import glob
cnt = 0
os.system("tcframe build")
os.system("./runner")
os.system("rm -rf tc/input")
os.system("mkdir tc/input")
for x in sorted(glob.glob("tc/*.in")):
newFileName = "tc/input/input%02d.txt" %... | 2.15625 | 2 |
formalchemy/config.py | pombreda/formalchemy | 2 | 12769701 | # -*- coding: utf-8 -*-
import sys
from formalchemy import templates
__doc__ = """
There is two configuration settings available in a global config object.
- encoding: the global encoding used by FormAlchemy to deal with unicode. Default: utf-8
- engine: A valide :class:`~formalchemy.templates.TemplateEngine`
- dat... | 2.421875 | 2 |
tests/test_flask_dynamodb_sessions.py | siran/flask-dynamodb-sessions | 4 | 12769702 | import pytest
import re
from pytest_mock import mocker
import flask
import flask.sessions
from flask_dynamodb_sessions import Session
def test_session_boto_settings(mocker):
client_mock = mocker.patch('flask_dynamodb_sessions.boto3.client')
app = flask.Flask(__name__)
app.config.update(
SESSION... | 2.09375 | 2 |
reference/apps.py | tanyong8520/tushare | 0 | 12769703 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ReferenceConfig(AppConfig):
name = 'reference'
| 1.101563 | 1 |
ResourceStatusSystem/Service/ResourceManagementIHEPHandler.py | zhangxt-ihep/IHEPDIRAC | 0 | 12769704 | <filename>ResourceStatusSystem/Service/ResourceManagementIHEPHandler.py
''' ResourceManagementHandler
Module that allows users to access the ResourceManagementDB remotely.
'''
from DIRAC import gConfig, S_OK, gLogger
from DIRAC.Core.DISET.RequestHandler ... | 2.203125 | 2 |
kinbot/jobs.py | rubenvdvijver/KinBot | 0 | 12769705 | ###################################################
## ##
## This file is part of the KinBot code v2.0 ##
## ##
## The contents are covered by the terms of the ##
## BSD 3-clause license included in the LICENSE ##
## file,... | 1.125 | 1 |
test/test_add.py | mcraig2/uplink | 0 | 12769706 | import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
from uplink.add_entry import add_entry
class TestAddEntry(unittest.TestCase):
def test_one_one(self):
self.assertEqual(1 + 1, 2)
if __name__ == '__main__':
unittest.main()
| 2.25 | 2 |
pycles/pycles.py | matthewkovacs/pycles | 0 | 12769707 | """
PyCLES
Desc: This is an implementation of the Common Language Effect Size (CLES) in Python
Author: <NAME>
Date: 04/05/20
"""
import numpy as np
from scipy.stats import norm
def nonparametric_cles(a, b, half_credit=True) -> float:
"""Nonparametric solver for the common language effect size. This solves
... | 3.390625 | 3 |
tests/test_importers.py | zweifisch/klar | 1 | 12769708 | import klar
class TestImporters:
def test_template_import(self):
import templates.index
expected = "<html><i>html</i></html>\n"
assert templates.index({'html': '<i>html</i>'}) == expected
def test_json_import(self):
from schemas import product
assert produ... | 2.421875 | 2 |
hex.py | funkaoshi/hexenbracken | 17 | 12769709 | <reponame>funkaoshi/hexenbracken<gh_stars>10-100
import argparse
import csv
import os
import re
import string
import sys
import jinja2
import hexmap as hm
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--format', dest='fmt', default='html',
help="Format of output: html or text")
pa... | 3.125 | 3 |
setup.py | house-of-vanity/homebank-wui | 0 | 12769710 | #!/usr/bin/env python
try:
from debian.changelog import Changelog
except ImportError:
class Changelog(object):
def __init__(self, _):
pass
def get_version(self):
return '0.0.0'
from os import environ
from os.path import abspath, dirname, join
from setuptools import setu... | 1.929688 | 2 |
packages/eclipse/plugins/org.python.pydev_4.4.0.201510052309/pysrc/pydevd_custom_frames.py | liangazhou/django-rdp | 0 | 12769711 | from pydevd_constants import * #@UnusedWildImport
from pydevd_file_utils import GetFilenameAndBase
from _pydev_imps import _pydev_thread
threadingCurrentThread = threading.currentThread
DEBUG = False
#====================================================================================================================... | 1.796875 | 2 |
one_more_layer_of_stacking/src/sf_utils.py | guitarmind/HPA-competition-solutions | 0 | 12769712 | <reponame>guitarmind/HPA-competition-solutions
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
plt.style.use('seaborn-white')
import seaborn as sns
sns.set_style("white")
from skimage.transform import r... | 1.625 | 2 |
layout_instructions.py | Susanne-ICDS/gsd-designer | 0 | 12769713 | <filename>layout_instructions.py
import dash_html_components as html
import dash_bootstrap_components as dbc
spacing_variables = {'offset': 1, 'size': 10, 'int_input': 1, 'float_input': 2}
vub_blue = '#003399'
label = html.B
def my_jumbo_box(header, sub_header):
return dbc.Row(
dbc.Col(width={'offset': ... | 2.3125 | 2 |
src/rpds.py | hyubiglab/CAFE | 0 | 12769714 | <reponame>hyubiglab/CAFE
#!/share/apps/python/bin/python
import sys, os
import copy, math
import config as conf
import data as data
import module as module
import sam as sam
type = conf.rpds_type
order = conf.rpds_order
assembly = sys.argv[1]
unstranded = sys.argv[2]
stranded = sys.argv[3]
chr = sys.argv[4]
outputdi... | 2.140625 | 2 |
vector.py | progs2002/Langton-s-Ant | 4 | 12769715 | <gh_stars>1-10
class Vector:
def __init__(self,x,y):
self.x=x
self.y=y
def __repr__(self):
return str(self.x) +"i, "+ str(self.y)+"j"
def dotProduct(v1,v2):
return v1.x*v2.x + v1.y*v2.y | 2.96875 | 3 |
src/container/cni/cni/common/macvlan.py | casek14/contrail-controller | 1 | 12769716 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
"""
CNI implementation
Demultiplexes on the CNI_COMMAND and runs the necessary operation
"""
import ctypes
import errno
import inspect
import json
import os
import sys
import logging
from pyroute2 import ... | 2.453125 | 2 |
L1TriggerConfig/L1TConfigProducers/python/L1TMuonEndcapParamsOnlineProxy_cfi.py | pasmuss/cmssw | 0 | 12769717 | <filename>L1TriggerConfig/L1TConfigProducers/python/L1TMuonEndcapParamsOnlineProxy_cfi.py<gh_stars>0
import FWCore.ParameterSet.Config as cms
#from L1Trigger.L1TMuonEndcap.fakeEmtfParams_cff import *
L1TMuonEndcapParamsOnlineProxy = cms.ESProducer("L1TMuonEndcapParamsOnlineProxy",
PtAssignVersion = cms.untracked.... | 1.265625 | 1 |
qharv/field/kyrt.py | Paul-St-Young/harvest_qmcpack | 2 | 12769718 | # Author: Yubo "Paul" Yang
# Email: <EMAIL>
# Kyrt is a versatile fabric exclusive to the planet Florina of Sark.
# The fluorescent and mutable kyrt is ideal for artsy decorations.
# OK, this is a library of reasonable defaults for matplotlib figures.
# May this library restore elegance to your plots.
import matplotli... | 2.40625 | 2 |
src/client/client.py | martingaston/bangbangnapster | 2 | 12769719 | <gh_stars>1-10
import socket
import socketserver
import struct
from src.client.name_generator import generate_username
from src.packet import Packet, read_packet
from src.packet_type import PacketType
from src.client.search_result import SearchResult
from pathlib import Path
from typing import Optional
import threadin... | 2.953125 | 3 |
examples/wipac_tracing/span_multithreaded_multiproccessed.py | WIPACrepo/wipac-telemetry-prototype | 0 | 12769720 | <reponame>WIPACrepo/wipac-telemetry-prototype
"""Examples for spanned() decorator with multi-threaded/processed tracing."""
# pylint: disable=protected-access
import logging
import os
import sys
import time
from concurrent.futures import (
Future,
ProcessPoolExecutor,
ThreadPoolExecutor,
as_completed... | 2.015625 | 2 |
knowledge_graph/crawler/text_crawler/text_crawler/spiders/xywy/__init__.py | Syhen/knowledge-graph | 2 | 12769721 | <reponame>Syhen/knowledge-graph
# -*- coding: utf-8 -*-
"""
Author: @heyao
Created On: 2019/6/24 下午1:57
"""
| 0.667969 | 1 |
wikimedia_thumbor/error_handlers/logstash/__init__.py | wikimedia/operations-software-thumbor-plugins | 2 | 12769722 | from .logstash import ErrorHandler
__all__ = ['ErrorHandler']
| 1.15625 | 1 |
strucpara/processing.py | alayah2626517/strucpara | 0 | 12769723 | <gh_stars>0
from os import path, system
from io import StringIO
import pandas as pd
from strucpara.miscell import check_dir_exist_and_make
ensemble_exec = '/home/yizaochen/opt/x3dna-v2.3/bin/x3dna_ensemble'
class BasePairAgent:
def __init__(self, rootfolder, host, time_interval):
self.rootfolder = rootfo... | 2.421875 | 2 |
vul_module.py | KirieHaruna/web_scanner | 0 | 12769724 | <reponame>KirieHaruna/web_scanner
# coding:utf8
import mysql
import requests
import urllib.parse
from urllib.parse import quote as urlencode
from urllib.parse import unquote as urldecode
import hashlib
import sys
import re
import urllib.parse
import threading
import dbms as dbms
from config import *
import... | 2.65625 | 3 |
mayan/apps/common/queues.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 2 | 12769725 | from django.utils.translation import ugettext_lazy as _
from mayan.apps.task_manager.classes import CeleryQueue
from mayan.apps.task_manager.workers import worker_d
queue_tools = CeleryQueue(label=_('Tools'), name='tools', worker=worker_d)
| 1.554688 | 2 |
eye/lexers.py | hydrargyrum/eye | 12 | 12769726 | # this project is licensed under the WTFPLv2, see COPYING.txt for details
"""Helpers for lexer use
In EYE, builtin lexers from QScintilla are used. See :any:`PyQt5.Qsci.QsciLexer`.
"""
import mimetypes
from PyQt5.QtGui import QColor, QFont
from PyQt5.Qsci import (
QsciLexerBash, QsciLexerBatch, QsciLexerCPP, QsciL... | 1.875 | 2 |
applications/tensorflow/detection/yolov3/evaluate.py | payoto/graphcore_examples | 260 | 12769727 | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2021 Graphcore Ltd. All Rights Reserved.
# Copyright (c) 2019 YunYang1994 <<EMAIL>>
# License: MIT (https://opensource.org/licenses/MIT)
# This file has been modified by Graphcore Ltd.
import argparse
import json
import math
import os
import shutil
import time
imp... | 1.851563 | 2 |
scripts/train.py | MathieuTuli/autoHyper | 9 | 12769728 | """
MIT License
Copyright (c) 2020
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, s... | 1.882813 | 2 |
cogs/game.py | DoggieLicc/InfoBot | 1 | 12769729 | from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from mojang import MojangAPI as Mojang
from pyosu import OsuApi
import discord
import pyosu
from custom_funcs import embed_create, is_uuid4
def sync_minecraft(ctx, account):
try:
if is_uuid4(account):
... | 2.359375 | 2 |
pygenome/fitness/loss.py | jorgetavares/pygenome | 1 | 12769730 | <reponame>jorgetavares/pygenome
import numpy as np
def mean_squared_error(x, y):
'''
Mean Squared Error (MSR)
Args:
x (array): array of predictions
y (array): array of labels
Returns:
the mean squared error
'''
return np.sum(np.sqrt(np.square(x - y)))
| 3.125 | 3 |
globals.py | alexandrefresnais/Cobra | 1 | 12769731 | import math
# Nb grid square
GRID_WIDTH = 10
GRID_HEIGHT = 10
# Absolute size of a grid square
GRIDSIZE = 20
# Size of window
SCREEN_WIDTH = GRID_WIDTH * GRIDSIZE
SCREEN_HEIGHT = GRID_HEIGHT * GRIDSIZE
UP = (0, -1)
DOWN = (0, 1)
LEFT = (-1, 0)
RIGHT = (1, 0)
# Returns true if a and b have same signs
def same_sign(... | 3.546875 | 4 |
video/migrations/0003_auto_20210427_1528.py | AxelConceicao/youtube-django | 1 | 12769732 | # Generated by Django 3.1.5 on 2021-04-27 15:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video', '0002_auto_20210427_1508'),
]
operations = [
migrations.AlterField(
model_name='video',
name='views',
... | 1.507813 | 2 |
search_svc/search.py | mannyfin/aioget | 1 | 12769733 | import asyncio
from datetime import datetime
from itertools import combinations
import json
import glob
import os
import time
from typing import Optional, Tuple
import re
import sys
from aiohttp.client import ClientSession, TCPConnector
import redis
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
... | 2.265625 | 2 |
code/metrics/logger.py | HS-YN/PanoAVQA | 3 | 12769734 | # Simple tb logger
import torch
from exp import ex
'''
geometry_normalizer = {
'cartesian': 4, # [0,1]x[0,1]x[0,1]x[0,1]
'angular': 98.696, # [-pi,pi]x[-.5pi,.5pi]x[0,2pi]x[0,pi]
'spherical': 61.348, # [-1,1]x[-1,1]x[-1,1]x[0,2pi]x[0,pi]
'quaternion': 17 # [0,1]x[-1,1]x[-1,1]x[0,2]x[0,2]
... | 2.25 | 2 |
complete/31 - 40/Problem31/main2.py | this-jacob/project-euler | 0 | 12769735 | from time import time
def main():
start = time()
target = 200
ways = 0
for a in range(target, -1, -200):
for b in range(a, -1, -100):
for c in range(b, -1, -50):
for d in range(c, -1, -20):
for e in range(d, -1, -10):
fo... | 3 | 3 |
app.py | Siddhesh268/Fleet-Management-system | 0 | 12769736 | <reponame>Siddhesh268/Fleet-Management-system
import sys,pickle
from flask import Flask,flash, redirect, url_for, request, render_template, abort, jsonify,g
from socket import socket, AF_INET, SOCK_STREAM
from connection import setConnection
from Analysis import *
app = Flask(__name__)
app.secret_key = 'my unobvious ... | 2.34375 | 2 |
apps/init_before_startup.py | osroom/osroom | 579 | 12769737 | <filename>apps/init_before_startup.py
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2020/03/14 12:44
# @Author : <NAME>
import sys
from signal import signal, SIGCHLD, SIG_IGN
from pymongo.errors import OperationFailure
from apps.configs.db_config import DB_CONFIG
from apps.core.db.config_mdb import DatabaseConfi... | 1.984375 | 2 |
tests/test_jdla_basic.py | JosueDLA/BasicModule | 0 | 12769738 | <gh_stars>0
import unittest
from jdla_basic import basic_operations
class Test_basic_opea(unittest.TestCase):
def test_add(self):
self.assertEqual(basic_operations.addition(10, 5), 15)
self.assertEqual(basic_operations.addition(-1, 1), 0)
self.assertEqual(basic_operations.addition(1, -1),... | 3.09375 | 3 |
jionlp/gadget/split_sentence.py | Hello-Toufu/jionlp | 0 | 12769739 | <gh_stars>0
# -*- coding=utf-8 -*-
import os
import re
import pdb
class SplitSentence(object):
def __init__(self):
self.puncs_fine = None
def _prepare(self):
self.puncs_fine = ['……', '\r\n', ',', '。', ';', ';', '…', '!',
'!', '?', '?', '\r', '\n', '“', '”',... | 3.046875 | 3 |
pycti/__init__.py | Cix-16/client-python | 0 | 12769740 | <reponame>Cix-16/client-python
# -*- coding: utf-8 -*-
from .api.opencti_api_client import OpenCTIApiClient
from .api.opencti_api_connector import OpenCTIApiConnector
from .api.opencti_api_job import OpenCTIApiJob
from .connector.opencti_connector import ConnectorType
from .connector.opencti_connector import OpenCTICo... | 1.109375 | 1 |
src/calculator/calculator.py | Rafiatu/calculator | 0 | 12769741 | <reponame>Rafiatu/calculator<filename>src/calculator/calculator.py
class CalculatorException(Exception):
pass
class Calculator:
"""
This is a simple Calculator that performs basic addition, subtraction,
division, multiplication and root calculation of numbers.
"""
def __init__(self):
... | 4.21875 | 4 |
sprint/tools_sam/recover_sam.py | jumphone/sprint | 44 | 12769742 | <gh_stars>10-100
#poly_limit=10
def poly_check(seq,poly_limit):
if 'A'*poly_limit not in seq and 'T'*poly_limit not in seq and 'G'*poly_limit not in seq and 'C'*poly_limit not in seq:
return True
else:
return False
def var_check(change_from, change_to, seq,var_limit):
ALL=['A','T','C','G']
tmp=[]
for on... | 2.65625 | 3 |
hivwholeseq/patients/get_region_haplotypes.py | neherlab/hivwholeseq | 3 | 12769743 | # vim: fdm=marker
'''
author: <NAME>
date: 11/11/14
content: Get local haplotypes from single read pairs, including insertions
and deletions. This includes aggressive clustering to keep the
multiple sequence alignments efficient.
'''
# Modules
import os
import argparse
from operator... | 2.390625 | 2 |
test/test_contact_details_db.py | tankisleva/python_training | 0 | 12769744 | <reponame>tankisleva/python_training<filename>test/test_contact_details_db.py
from model.contact import Contact
def test_deatails_on_contact_tabe(app, db):
contact_from_table_list = app.contact.get_contact_list_all_data_from_table()
contact_list_db = db.get_contact_list_all_data()
assert sorted(contact_from_... | 2.5625 | 3 |
tf/siamese_network.py | zxlzr/atec_back | 0 | 12769745 | <gh_stars>0
#!/usr/bin/env python
# coding=utf-8
import tensorflow as tf
class SiameseNets(object):
"""
A Siamese CNN/RNN based network for text similarity.
Uses a character/word level embedding layer, followed by a {`BiLSTM`, `CNN`, `combine`} network
and Energy Loss layer.
"""
def __init__(s... | 2.65625 | 3 |
settingfaz.py | INIDboyzz/Juliana | 1 | 12769746 | x = input()
if x == ".helpf":
print(".help : to show help menu")
| 2.8125 | 3 |
setup.py | nullablebool/django-templated-mail | 0 | 12769747 | <reponame>nullablebool/django-templated-mail
#!/usr/bin/env python
import os
from setuptools import setup
with open('README.rst', 'r') as f:
readme = f.read()
def get_packages(package):
return [
dirpath for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path.join(dirp... | 1.492188 | 1 |
app/storage/dynamo_api.py | uk-gov-mirror/ONSdigital.eq-survey-runner | 27 | 12769748 | <reponame>uk-gov-mirror/ONSdigital.eq-survey-runner
from flask import current_app
from structlog import get_logger
logger = get_logger()
def put_item(table_name, key_field, item, overwrite=True):
"""Insert an item into table"""
table = get_table(table_name)
put_kwargs = {'Item': item}
if not overwri... | 2.40625 | 2 |
mapry/cpp/generate/jsoncpp_impl.py | Parquery/mapry | 11 | 12769749 | <filename>mapry/cpp/generate/jsoncpp_impl.py
"""Generate the implementation of de/serialization from/to Jsoncpp values."""
# pylint: disable=too-many-lines
# pylint: disable=too-many-arguments
import re
import textwrap
from typing import ( # pylint: disable=unused-import
Dict, List, Mapping, MutableMapping, Set,... | 2.515625 | 3 |
relier/web/views/events.py | citruspi/relier-api | 0 | 12769750 | <filename>relier/web/views/events.py
from relier.web.views import AuthenticatedView
from relier.models import Event
from flask import g, render_template
class Events(AuthenticatedView):
def get(self):
events = Event.select().where(Event.organization == g.user.organization)
if events.count() == 0... | 1.96875 | 2 |