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 |
|---|---|---|---|---|---|---|
Python/python-practice/chapter5-if/toppints.py | jiaoqiyuan/Tests | 0 | 12796551 | <filename>Python/python-practice/chapter5-if/toppints.py
requested_topping = 'mushrooms'
if requested_topping != 'anchovies':
print("Hold the anchovies!")
answer = 17
if answer != 42:
print("That is not the correct answer. Please try again!")
requested_toppings = ['mushrooms', 'extra cheese']
if 'mushrooms' in req... | 4.375 | 4 |
tools/initialcompdata/abundngc5286.py | lukeshingles/evelchemevol | 2 | 12796552 | from abundsolar import elsolarlogepsilon
zfactor = 10 ** -1.92
# mean of s-poor population in NGC5286
# from Marino et al. (2015) 2015MNRAS.450..815M
# [Fe/H] = -1.92
# log X/Fe = [X/Fe] + log(X/Fe)_solar
targetlogxtofe = { 'o': 0.58 + elsolarlogepsilon['o'] - elsolarlogepsilon['fe'],
'na': 0.18 + e... | 1.875 | 2 |
log/basic_log.py | nkzmsb/howto | 0 | 12796553 | <filename>log/basic_log.py
import time
# print("===start: not use logging===")
# # logレベルの設定
# MODE = "INFO"
# for i in range(5): # 適当な繰り返しの処理を再現
# # 適当な処理・処理時間を再現
# a = i
# b = i * 2
# c = a + b
# time.sleep(1)
#
# if MODE == "DEBUG" or MODE == "INFO":
# print("a:{}, b:{}".format(a,b... | 3.71875 | 4 |
wqxlib/wqx_v3_0/OrganizationAddress.py | FlippingBinary/wqxlib-python | 0 | 12796554 | from yattag import Doc
from .SimpleContent import (
AddressText,
AddressTypeName,
CountryCode,
CountyCode,
LocalityName,
PostalCode,
StateCode,
SupplementalAddressText,
)
class OrganizationAddress:
"""
The physical address of an organization.
"""
__... | 2.765625 | 3 |
tests/flag_test.py | harrybrwn/dispatch | 0 | 12796555 | <filename>tests/flag_test.py
import pytest
from pytest import raises
import sys
from os.path import dirname
sys.path.insert(0, dirname(dirname(__file__)))
from typing import List, Set, Dict, Sequence, Mapping
from dispatch import command
from dispatch.flags import Option, _from_typing_module, _is_iterable
class ATy... | 2.71875 | 3 |
JellyBot/api/ar/__init__.py | RaenonX/Jelly-Bot-API | 5 | 12796556 | from .add import AutoReplyAddView, AutoReplyAddExecodeView
from .validate import ContentValidationView
from .tag import AutoReplyTagPopularityQueryView
| 0.902344 | 1 |
tests/test_filename.py | mverbowski/beets-copyartifacts | 0 | 12796557 | import os
import sys
from helper import CopyArtifactsTestCase
from beets import config
class CopyArtifactsFilename(CopyArtifactsTestCase):
"""
Tests to check handling of artifacts with filenames containing unicode characters
"""
def setUp(self):
super(CopyArtifactsFilename, self).setUp()
... | 2.609375 | 3 |
jina_commons/logging.py | chuangfengwang/jina-commons | 5 | 12796558 | import functools
import os
import time
from typing import List
from jina import DocumentArray
from jina.logging.logger import JinaLogger
from jina.enums import LogVerbosity
def _get_non_empty_fields_doc_array(docs: DocumentArray) -> List[str]:
non_empty_fields = list(docs[0].non_empty_fields)
for doc in docs... | 2.375 | 2 |
otscrape/core/extractor/file/file.py | SSripilaipong/otscrape | 0 | 12796559 | <gh_stars>0
from otscrape.core.base.extractor import Extractor
from otscrape.core.loader.file import LineObject
class FileContent(Extractor):
def __init__(self, target=None, *, project=True, replace_error=None, **kwargs):
super().__init__(target=target, project=project, replace_error=replace_error)
... | 2.3125 | 2 |
kungfucms/apps/account/signals.py | youngershen/kungfucms | 0 | 12796560 | # PROJECT : kungfucms
# TIME : 2020/6/9 12:54
# AUTHOR : <NAME>
# EMAIL : <EMAIL>
# PHONE : 13811754531
# WECHAT : 13811754531
# https://github.com/youngershen
from django.core.signals import request_started, \
request_finished
from django.dispatch import Signal, receiver
before_sign_in = Signal(providing_args... | 1.929688 | 2 |
Topics/Algorithms in Python/Last index of max/main.py | soukalli/jetbrain-accademy | 0 | 12796561 | def last_indexof_max(numbers):
# write the modified algorithm here
index = 0
for i in range(len(numbers)):
if numbers[i] >= numbers[index]:
index = i
return index
| 3.890625 | 4 |
aula2/exercicio2.py | ArseniumGX/bluemer-modulo1-python | 0 | 12796562 | <filename>aula2/exercicio2.py
""" 02 - Qual o valor do troco?
Defina uma variável para o valor de uma compra que custou R$100,98;
Defina uma variável para o valor que o cliente pagou R$150,00;
Defina uma variável que calcula o valor do troco e exiba-o no console com o valor final arredondado.
"""
valor_... | 2.984375 | 3 |
model/contact.py | dmi-vor/python_training | 0 | 12796563 | <reponame>dmi-vor/python_training<gh_stars>0
from sys import maxsize
class Contact:
def __init__(self, firstname=None, middlename=None, lastname=None, id=None,
nickname=None, title=None, company=None, address=None,
homephone=None, mobilephone=None, workphone=None, fax=None,
... | 2.765625 | 3 |
reo/src/load_profile_chiller_thermal.py | akuam1/REopt_Lite_API | 0 | 12796564 | <reponame>akuam1/REopt_Lite_API<gh_stars>0
from reo.src.load_profile import BuiltInProfile
import os
import json
import pandas as pd
import numpy as np
from datetime import datetime
from reo.utilities import TONHOUR_TO_KWHT
class LoadProfileChillerThermal(BuiltInProfile):
"""
Chiller Load Profiles based on CR... | 2.484375 | 2 |
ac/messagepgp.py | juga0/djac | 0 | 12796565 | <reponame>juga0/djac
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab
# Copyright 2017 juga (juga at riseup dot net), under MIT license.
"""Extend Django email classes for MIME multipart/pgp-encrypted
type messages.
"""
__all__ = ['EmailMessageEnc', 'EmailMessagePGP']
from django.conf import settings
from django.co... | 2.140625 | 2 |
lib/googlecloudsdk/command_lib/dataproc/batches/sparksql_batch_factory.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2 | 12796566 | # -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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 requir... | 2.125 | 2 |
data_prep_step/BERT_PYTORCH/data_prep_bert_pytorch.py | sampathkumaran90/pytorch-pipeline | 0 | 12796567 | <reponame>sampathkumaran90/pytorch-pipeline<filename>data_prep_step/BERT_PYTORCH/data_prep_bert_pytorch.py
import shutil
from collections import defaultdict
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from sklearn.model_selection import train_test_split
from torch import nn
from ... | 2.671875 | 3 |
test.py | 12beesinatrenchcoat/yt-playlist-discord-webhook | 2 | 12796568 | <filename>test.py<gh_stars>1-10
# Unit tests, I guess.
import unittest
import typing
import main
# A test playlist created by myself to test various features of the script.
# It contains five videos, added by two different users,
# and some videos don't have maxres thumbnails.
# This playlist shouldn't be changed.
TES... | 2.71875 | 3 |
src/main/python/imschrm/hrm.py | sandflow/imscHRM | 3 | 12796569 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2021, Pearl TV LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# l... | 1.507813 | 2 |
month02/multiprocessing/day13-2/myprocess.py | chaofan-zheng/python_learning_code | 4 | 12796570 | <reponame>chaofan-zheng/python_learning_code<gh_stars>1-10
"""
自定义进程类
"""
from multiprocessing import Process
# 使用面向对象的思想 创建自己的进程类
class MyProcess(Process):
def __init__(self,value):
self.value = value
super().__init__() # 引入父类
def fun(self):
print(self.value)
# 进程执行内容的入口函数
de... | 3.96875 | 4 |
exe066a.py | Alexmachado81/ExerciciosPython_Resolvidos | 0 | 12796571 | soma = cont =0
while True:
numero = int(input('Informe um numero inteiro[digite 999 para ele parar ]:'))
if numero == 999:
break
soma = soma + numero
cont += 1
print(f' A soma dos {cont} numeros digitador é {soma}')
| 3.765625 | 4 |
examples/resources/football_court/court_image.py | ereide/pyga-camcal | 5 | 12796572 | <gh_stars>1-10
import os
import numpy as np
from interface.camera_calibration import ModelImage
dir_path = os.path.dirname(os.path.realpath(__file__))
class FootballManCityCourtImage2(ModelImage):
def __init__(self):
alpha = 13000
self.K = np.matrix([[alpha, 0.0, 800],
... | 2.203125 | 2 |
0845 Enclosed Islands.py | ansabgillani/binarysearchcomproblems | 1 | 12796573 | <filename>0845 Enclosed Islands.py
class Solution:
def solve(self, matrix):
total = sum(sum(row) for row in matrix)
escapable = 0
seen = set()
for r in range(len(matrix)):
for c in [0,len(matrix[0])-1]:
if (r,c) in seen or matrix[r][c] != 1:
... | 2.9375 | 3 |
tv-script-generation/full_test/neural_network.py | AlphaGit/deep-learning | 0 | 12796574 | <filename>tv-script-generation/full_test/neural_network.py
import tensorflow as tf
import timeit
import datetime
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow.contrib import seq2seq
class NeuralNetwork():
def get_inputs(self):
p_input = tf.placeholder(tf.in... | 2.484375 | 2 |
vibration_compensation/tests/test_smoothed_toolpath.py | fredizzimo/VibrationCompensation | 0 | 12796575 | import os
from vibration_compensation import read_gcode, Data
import pytest
from numpy.testing import *
import numpy as np
import scipy as sp
import vibration_compensation.bokeh_imports as plt
@pytest.fixture(scope="module")
def figures():
path, filename = os.path.split(os.path.realpath(__file__))
... | 2.15625 | 2 |
appify/scan.py | akx/appify | 0 | 12796576 | import subprocess
import threading
from collections import defaultdict
from concurrent.futures import Executor
from concurrent.futures.thread import ThreadPoolExecutor
class RecursiveLibraryScanner:
def __init__(self, executor: Executor, scan_private: bool):
self.executor = executor
self.libraries... | 2.5625 | 3 |
aslprep/workflows/asl/__init__.py | lawlessrd/aslprep | 2 | 12796577 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Pre-processing ASL - ASL signal workflows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: aslprep.workflows.asl.base
.. automodule:: aslprep.workflows.asl.hmc
.. automodule:: aslprep.workf... | 1.953125 | 2 |
keepworking/settings.py | yelijing18/KeepWorking | 0 | 12796578 | <gh_stars>0
# -*- coding: utf-8 -*-
from decouple import config
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv('.env', usecwd=True))
load_dotenv(find_dotenv('default.env', raise_error_if_not_found=True))
COUNTDOWN = config('COUNTDOWN', default=5, cast=int)
EVENT_INTERVAL = config('EVENT_INTERVAL... | 1.5 | 2 |
convert_png_images_using_clahe.py | tybrad11/kaggle_ich | 0 | 12796579 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 21 14:21:03 2019
@author: tjb129
"""
import numpy as np
from PIL import Image
from skimage.exposure import equalize_adapthist
import os
from matplotlib import pyplot as plt
parent = '/data/Kaggle'
folders = [ 'pos-all-png',
... | 2.203125 | 2 |
datamodeling/dscreator.py | AI-Traiding-Team/paired_trading | 1 | 12796580 | <reponame>AI-Traiding-Team/paired_trading
import os
import sys
import time
import copy
import pytz
import numpy as np
import datetime
import pandas as pd
from typing import Tuple
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import RobustScale... | 2.078125 | 2 |
utils/bn_sn_chen.py | sebemery/Lipschitz-constrained-neural-networks | 0 | 12796581 | <reponame>sebemery/Lipschitz-constrained-neural-networks
"""
Spectral Normalization borrowed from https://arxiv.org/abs/1802.05957
SN for batch normalization layers to be of Lipschtz constant sigma (default=1.0).
"""
import torch
from torch.nn.parameter import Parameter
class BatchNormSpectralNorm(object):
def _... | 2.625 | 3 |
checkers/kettle/libsimplecrypto.py | SharLike-CTF-Team/altayctf-2019 | 7 | 12796582 | import time
import base64
import binascii
from secrets import token_hex
from rsa import prime
from arc4 import ARC4
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def imod(a, n):
i = 1
while True:
c = n * i + 1
if(c % a == 0... | 2.625 | 3 |
src/datastore/persistence_store.py | dgpatelgit/fabric8-analytics-bigquery-manifests-job | 0 | 12796583 | # Copyright © 2020 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 1.96875 | 2 |
methods/model_n.py | behrouzsh/deepPhosAPI | 0 | 12796584 | <filename>methods/model_n.py
import functools
import itertools
import os
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from sklearn import metrics
from sklearn import preprocessing
from sklearn.model_selection import train_test_split, KFold, cross_val_score
fr... | 2.4375 | 2 |
models/MAF.py | mahkons/Dreamer | 0 | 12796585 | import torch
import torch.nn as nn
import torchvision.transforms as T
from .MADE import MADE
from .Shuffle import Shuffle
from .Flow import SequentialConditionalFlow
from .NormFunctions import ActNorm, RunningBatchNorm1d
from utils.logger import log
class MAF(nn.Module):
def __init__(self, flow_dim, condition_dim... | 2.03125 | 2 |
sdk/python/pulumi_okta/profile/_inputs.py | brinnehlops/pulumi-okta | 0 | 12796586 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | 1.992188 | 2 |
deprecated/drivers/sub8_videoray_m5_thruster/nodes/thruster_driver.py | ericgorday/SubjuGator | 27 | 12796587 | #!/usr/bin/env python
import numpy as np
import copy
import rospy
import rospkg
import rosparam
import threading
import argparse
from geometry_msgs.msg import Vector3
from std_msgs.msg import Header, Float64
from sub8_msgs.msg import Thrust, ThrusterStatus
from mil_ros_tools import wait_for_param, thread_lock, numpy_to... | 2.515625 | 3 |
scripts/bib4txt.py | cpitclaudel/bibstuff | 9 | 12796588 | <filename>scripts/bib4txt.py
#!/usr/bin/env python
# bib4txt.py
"""
Creates formatted references for a text document.
Uuseful for reStructuredText documents.
Interacts with a Bibtex-style database file
(without using LaTeX or bibtex).
Dependencies:
- Python 2.4 or higher
- SimpleParse (binaries available!)
- BibStuff... | 2.53125 | 3 |
pineboolib/flparser/postparse.py | Miguel-J/pineboo-buscar | 0 | 12796589 | <reponame>Miguel-J/pineboo-buscar<filename>pineboolib/flparser/postparse.py<gh_stars>0
#!/usr/bin/python
from builtins import str
from builtins import object
from optparse import OptionParser
import os
import os.path
import sys
import imp
import traceback
from lxml import etree
try:
from pineboolib.flparser impor... | 2.296875 | 2 |
src/libs/Web3Client/tests/testGetBlock.py | JorgePadilla/crabada.py | 0 | 12796590 | <gh_stars>0
from src.common.config import nodeUri
from src.libs.Web3Client.AvalancheCWeb3Client import AvalancheCWeb3Client
from pprint import pprint
from src.libs.Web3Client.helpers.debug import pprintAttributeDict
# VARS
client = AvalancheCWeb3Client(nodeUri=nodeUri)
# TEST FUNCTIONS
def test() -> None:
print(... | 1.835938 | 2 |
runserver.py | pipelinedb/pipelinedht | 15 | 12796591 | #!/usr/bin/env python
from argparse import ArgumentParser
from dht.server import app
if __name__ == '__main__':
parser = ArgumentParser(
description='PiplineDHT -- A simple distributed hash table')
parser.add_argument('-n', '--name', action='store', required=True,
help='name of node')
... | 2.625 | 3 |
misc/ConvertOrdersCSVtoJS.py | celstark/MSTonline | 1 | 12796592 | <filename>misc/ConvertOrdersCSVtoJS.py
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 17:05:31 2020
@author: craig
We've been using some online order files in our original PsychoPy-derived
web-based MST. This converts those actual .csv files into the .js ones
we'll be using here
"""
import os, csv, glob
inpath=... | 2.265625 | 2 |
poketrainer/views.py | hinnefe2/poketrainer | 0 | 12796593 | <gh_stars>0
import base64
import logging
import requests
from flask import redirect, render_template, request, session
from requests_oauthlib import OAuth2Session
from poketrainer.app import flask_app
from poketrainer.api.syncs.fitbit import _generate_fitbit_token, \
FITBIT_CALLBACK_URI
LOGGER = logging.getLogg... | 2.234375 | 2 |
snpdb/models/models_variant.py | SACGF/variantgrid | 5 | 12796594 | import collections
import logging
import re
from typing import Optional, Pattern, Tuple, Iterable, Set
import django.dispatch
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models, IntegrityError
from django.db.models import Value as V, QuerySet, F
from django.db.mod... | 1.671875 | 2 |
setup.py | KaiAnalytics/qualtrics_mailer | 6 | 12796595 | <filename>setup.py
from setuptools import setup
setup(
name='qualtrics_mailer',
version='0.1',
description='A package for distributing pre-built surveys in Qualtrics',
keywords='qualtrics survey',
url='http://github.com/kaianalytics/qualtrics_mailer',
author='<NAME>',
author_email='<EMAIL>'... | 1.460938 | 1 |
models/__init__.py | respect5716/Tensorflow_Cifar10 | 0 | 12796596 | <reponame>respect5716/Tensorflow_Cifar10<gh_stars>0
import tensorflow as tf
from .vgg import *
from .resnet import *
from .resnext import *
from .preact_resnet import *
from .densenet import *
from .dpn import *
from .dla import *
from .senet import *
def create_model(model_name, initializer, weight_decay):
mode... | 2.078125 | 2 |
codewars/python/Inc_dec_test.py | James992927108/practice | 0 | 12796597 | <gh_stars>0
import sys
sys.dont_write_bytecode = True
import unittest
import inc_dec
class Test_TestIncrementDecrement(unittest.TestCase):
def test_increment(self):
self.assertEquals(inc_dec.increment(3), 4)
def test_decrement(self):
self.assertEquals(inc_dec.decrement(3), 2)
if __name__ =... | 2.65625 | 3 |
understanding_loop_control.py | brucestull/PythonLearning | 2 | 12796598 | # Second edit.
# Added feature_01.
# Create two nested 'for' loops.
for x in range(1,5):
print(f"Start of x:{x} loop.")
for y in range(1,5):
print(f"Start of y:{y} loop.")
if y == 3:
print(x, y, 'breaking')
# print("Only 'break' out of inner 'y' loop.")
break
... | 4.125 | 4 |
setup.py | timniven/hsdbi | 0 | 12796599 | <reponame>timniven/hsdbi<gh_stars>0
from setuptools import setup, find_packages
# python setup.py sdist upload -r pypi
setup(
name='hsdbi',
packages=find_packages(exclude=['testing']),
version='0.1a18',
description='A simple interface for accessing databases.',
author='<NAME>',
author_email=... | 1.234375 | 1 |
fabfile/__init__.py | doutriaux1/ocgis | 1 | 12796600 | from fabric.decorators import task
from fabric.operations import run, sudo, local
from ConfigParser import ConfigParser
import geospatial
from fabric.context_managers import lcd
cp = ConfigParser()
cp.read('ocgis.cfg')
if cp.get('install','location') == 'local':
run = local
cd = lcd
def lsudo(op):
... | 2 | 2 |
examples/simpleApp.py | tgolsson/appJar | 666 | 12796601 | <filename>examples/simpleApp.py
# import the library
from appJar import gui
app = gui() # top slice - CREATE the GUI
app.addLabel("title", "Welcome to appJar") # add a label
app.setLabelBg("title", "red") # set the label's background to be red
app.go() # bottom s... | 3.015625 | 3 |
example/simple/lib.py | viniciusfeitosa/pychecko | 5 | 12796602 | <reponame>viniciusfeitosa/pychecko
def bar(self):
self.email = '<EMAIL>'
| 1.359375 | 1 |
trainGlobalIllumination.py | YouweiLyu/SingleImageShapeAndSVBRDF | 60 | 12796603 | import torch
import numpy as np
from torch.autograd import Variable
import torch.optim as optim
import argparse
import random
import os
import models
import torchvision.utils as vutils
import utils
import dataLoader
from torch.utils.data import DataLoader
parser = argparse.ArgumentParser()
# The locationi of training ... | 2.3125 | 2 |
examples/plot_read_raw_data.py | arokem/mne-python | 0 | 12796604 | """
==========================
Reading a raw file segment
==========================
"""
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
print __doc__
import os
from mne import fiff
fname = os.environ['MNE_SAMPLE_DATASET_PATH']
fname += '/MEG/sample/sample_audvis_raw.fif'
raw = fiff.setup_read_raw(fname)
ex... | 2.53125 | 3 |
openprocurement/auctions/geb/managers/changers/actions/cancellations.py | andrey484/openprocurement.auctions.geb | 0 | 12796605 | from openprocurement.auctions.core.utils import (
log_auction_status_change
)
from openprocurement.auctions.geb.constants import (
AUCTION_STATUSES_FOR_CLEAN_BIDS_IN_CANCELLATION
)
from openprocurement.auctions.geb.managers.changers.base import (
BaseAction
)
class CancellationActivationAction(BaseAction)... | 2.390625 | 2 |
tool_test/test_v_output4_8_get_map_zip_data.py | BerkeleyLibrary/geodata_pre_ingest | 0 | 12796606 | <reponame>BerkeleyLibrary/geodata_pre_ingest<filename>tool_test/test_v_output4_8_get_map_zip_data.py
#!/usr/bin/python
import os
import sys
import shutil
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pre_ingestion import zip_data,geo_helper,par,validate_csv
dirname = os.path.d... | 2.140625 | 2 |
src/archan_pylint/__init__.py | Pawamoy/archan-pylint | 1 | 12796607 | import sys
try:
from archan import Provider, Argument, DomainMappingMatrix, Logger
from pylint.lint import Run
class LoggerWriter:
def __init__(self, level):
self.level = level
def write(self, message):
if message != '\n':
self.level('from pylint:... | 2.40625 | 2 |
example_snippets/multimenus_snippets/NewSnippets/SymPy/Functions/Combinatorial functions/Stirling number of the second kind.py | kuanpern/jupyterlab-snippets-multimenus | 0 | 12796608 | stirling(n, k) | 0.96875 | 1 |
openapi_core/schema/contacts/models.py | eyadgaran/openapi-core | 0 | 12796609 | <gh_stars>0
"""OpenAPI core contacts models module"""
class Contact(object):
def __init__(self, name=None, url=None, email=None, extensions=None):
self.name = name
self.url = url
self.email = email
self.extensions = extensions and dict(extensions) or {}
| 1.984375 | 2 |
codebasin/walkers/tree_walker.py | jasonsewall-intel/code-base-investigator | 17 | 12796610 | # Copyright (C) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
import logging
import collections
log = logging.getLogger('codebasin')
class TreeWalker():
"""
Generic tree walker class.
"""
def __init__(self, _tree, _node_associations):
self.tree = _tree
self._node_as... | 2.21875 | 2 |
daiquiri/files/migrations/0002_depth.py | agy-why/daiquiri | 14 | 12796611 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-09 14:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('daiquiri_files', '0001_initial'),
]
operations = [
migrations.AddField(
... | 1.570313 | 2 |
webserver.py | Linerly/linerlybot-rewritten | 3 | 12796612 | <reponame>Linerly/linerlybot-rewritten
from threading import Thread
from flask import Flask
app = Flask("")
@app.route("/")
def home():
return """
<!DOCTYPE="html">
<html>
<head>
<link rel="icon" href="https://linerly.github.io/assets/linerlybot/linerlybot.png" type="image/png">... | 2.53125 | 3 |
fairscale/nn/moe/top2gate.py | vfdev-5/fairscale | 6 | 12796613 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# Implementation of Top2Gating described in https://arxiv.org/pdf/2006.16668.pdf
# Code is inspired by Top2GatingOnLogits... | 2.40625 | 2 |
refgenie/helpers.py | lmfaber-dkfz/refgenie | 32 | 12796614 | import errno
import os
from refgenconf import MissingRecipeError
from ubiquerg import is_writable
from .asset_build_packages import asset_build_packages
from .exceptions import MissingFolderError
def _parse_user_build_input(input):
"""
Parse user input specification. Used in build for specific parents and i... | 2.5 | 2 |
clarisse/var/lib/linux/menus/main_menu/file/open_recent_clear_recent.py | GuillaumeVFX/pipel | 2 | 12796615 | ix.application.clear_recent_files("project") | 1.023438 | 1 |
example_project/example_project/urls.py | pwilczynskiclearcode/django-nuit | 5 | 12796616 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^', include('demo.urls')),
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'nuit/generic/login.html'}),
url(r'^logout/$', 'django.contrib.auth.views.logout'),
)
| 1.734375 | 2 |
scripts/sensitivity_analysis/iceswe.py | gavento/epimod | 26 | 12796617 | """
:code:`iceswe.py`
Holdout both iceland and sweden
"""
import pymc3 as pm
from epimodel import EpidemiologicalParameters
from epimodel.preprocessing.data_preprocessor import preprocess_data
import argparse
import pickle
from scripts.sensitivity_analysis.utils import *
import os
os.environ['OMP_NUM_THREADS'] =... | 2.125 | 2 |
django/privat_gos_sait/about_company/templatetags/test_teg.py | Netromnik/python | 0 | 12796618 | <reponame>Netromnik/python
from django import template
register = template.Library()
@register.filter('modF')
def modF(value, arg):
print (not (int( value)%int(arg)))
return not (int( value)%int(arg)) | 2.46875 | 2 |
small_number.py | ambivert143/PythonProgram | 0 | 12796619 | <filename>small_number.py
class Small_Number:
def __init__(self, list):
self.list = list
def sma(self):
for x in range(len(self.list)):
for y in range(len(self.list)):
if self.list[x] > self.list[y]:
self.list[x], self.list[y] = self.list[y]... | 3.609375 | 4 |
coding_interviews/leetcode/medium/reduce_array_size_to_the_half/reduce_array_size_to_the_half.py | LeandroTk/Algorithms | 205 | 12796620 | <reponame>LeandroTk/Algorithms<filename>coding_interviews/leetcode/medium/reduce_array_size_to_the_half/reduce_array_size_to_the_half.py
# https://leetcode.com/problems/reduce-array-size-to-the-half
'''
Time Complexity: O(NlogN)
Space Complexity: O(N)
'''
def min_set_size(arr):
num_to_count, counts, min_size, cur... | 3.890625 | 4 |
configs/nas_fcos/ranksort_nas_fcos_r50_caffe_fpn_1x_coco_lr0010.py | yinchimaoliang/ranksortloss | 210 | 12796621 | _base_ = 'ranksort_nas_fcos_r50_caffe_fpn_1x_coco.py'
optimizer = dict(lr=0.010)
| 0.941406 | 1 |
app/tests/courses/factories.py | Valaraucoo/raven | 3 | 12796622 | import datetime
import random
import factory
import factory.fuzzy as fuzzy
from django.core.files.base import ContentFile
from courses import models
from courses.models import LANGUAGE_CHOICES, PROFILE_CHOICES
from tests.users import factories as users_factories
from users import models as users_models
PROFILE_CHOIC... | 2.390625 | 2 |
geotrek/common/tests/__init__.py | ker2x/Geotrek-admin | 0 | 12796623 | <filename>geotrek/common/tests/__init__.py<gh_stars>0
# -*- encoding: utf-8 -*-
from django.utils import translation
from django.utils.translation import ugettext as _
# Workaround https://code.djangoproject.com/ticket/22865
from geotrek.common.models import FileType # NOQA
from mapentity.tests import MapEntityTest... | 2 | 2 |
yepes/fields/char.py | samuelmaudo/yepes | 0 | 12796624 | <reponame>samuelmaudo/yepes
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.core import checks
from django.core.validators import MinLengthValidator
from django.db import models
from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import ug... | 2.15625 | 2 |
tests/test_utility.py | jrepp/redis-bus | 0 | 12796625 | from redisbus.utility import DictObj
def test_dictobj():
subject_dict = {
"foo": "bar",
"left": "right"
}
subject_obj = DictObj(subject_dict)
assert hasattr(subject_obj, 'foo')
assert hasattr(subject_obj, 'left')
assert subject_obj.foo == "bar"
assert subject_obj.left == ... | 2.75 | 3 |
examples/ModelMocks.py | pedro19v/GIMME | 0 | 12796626 | <reponame>pedro19v/GIMME<filename>examples/ModelMocks.py<gh_stars>0
from GIMMECore import TaskModelBridge
from GIMMECore import PlayerModelBridge
class PlayerModelMock(object):
def __init__(self, id, name, currState, pastModelIncreasesGrid, currModelIncreases, preferencesEst, realPreferences):
self.currState = curr... | 2.53125 | 3 |
src/conv_net.py | chatdip98/Acoustic-Scene-Classification | 0 | 12796627 | <reponame>chatdip98/Acoustic-Scene-Classification
#----convolutional neural network for classification------
#importing required libraries and modules
import os
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input... | 3.109375 | 3 |
previous code/lea_1.py | hyywestwood/Spider-of-Water-data | 2 | 12796628 | # -*- coding: utf-8 -*-
# @Time : 2019/4/22 14:57
# @Author : hyy
# @Email : <EMAIL>
# @File : lea_1.py
# @Software: PyCharm
import urllib.request
def download(url, num_retries = 2):
print('Downloading:',url)
headers = {'User-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101... | 3.265625 | 3 |
kale/tests/unit_tests/test_jupyter_utils.py | klolos/kale | 0 | 12796629 | # Copyright 2020 The Kale Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 1.78125 | 2 |
python_modules/dagster/dagster/core/snap/repository_snapshot.py | flowersw/dagster | 3 | 12796630 | <filename>python_modules/dagster/dagster/core/snap/repository_snapshot.py
from collections import OrderedDict, namedtuple
from dagster import RepositoryDefinition, check
from dagster.core.snap.pipeline_snapshot import PipelineIndex, PipelineSnapshot
from dagster.serdes import whitelist_for_serdes
class RepositoryInd... | 2.234375 | 2 |
spider_frame/framework/build/lib/scrapy_plus/middlwares/spider_middlewares.py | originx-23/spider_frame | 1 | 12796631 | # 下载器中间件模块: 用于对请求和响应数据进行预处理
class SpiderMiddleware(object):
def process_request(self, request):
# 用于处理请求的: 在请求对象交给引擎之前调用
print("SpiderMiddleware-process_request-{}".format(request.url))
return request
def process_response(self, response):
# 用于处理响应数据: 在响应对象交给爬虫之前调用
pri... | 3.15625 | 3 |
src/tests/hoplalib/hatchery/test_hatchpotionmodels.py | rickie/hopla | 0 | 12796632 | <reponame>rickie/hopla<filename>src/tests/hoplalib/hatchery/test_hatchpotionmodels.py<gh_stars>0
#!/usr/bin/env python3
import random
from typing import List
import click
import pytest
from hopla.hoplalib.errors import YouFoundABugRewardError
from hopla.hoplalib.hatchery.hatchdata import HatchPotionData
from hopla.ho... | 2.59375 | 3 |
firmware/common/pyrogue/common/AppCore.py | ruck314/dev-board-cryo | 1 | 12796633 | <filename>firmware/common/pyrogue/common/AppCore.py
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Title : PyRogue AMC Carrier Cryo Demo Board Application
#-----------------------------------------------------------------------------
# File : AppCore.py... | 1.460938 | 1 |
shooting_game/assets/Shooter-Game.py | rodsam9/cse210-project | 0 | 12796634 | <filename>shooting_game/assets/Shooter-Game.py<gh_stars>0
import random
import arcade
import math
import os
from arcade.color import BLACK, WHITE
SPRITE_SCALING_PLAYER = .60
SPRITE_SCALING_ENEMY = 0.5
SPRITE_SCALING_ENEMY_2 = 0.15
SPRITE_SCALING_ENEMY_3 = 0.3
SPRITE_SCALING_BULLET = 0.7
ENEMY_COUNT = 15
SCREEN_WIDT... | 3.078125 | 3 |
portal/portal/legacy/operators.py | sneaxiy/PaddlePaddle.org | 47 | 12796635 | <gh_stars>10-100
import json
import os
import re
import codecs
from bs4 import BeautifulSoup
from django.template import Template, Context
import markdown
from deploy.utils import reserve_formulas, MARKDOWN_EXTENSIONS
OPERATOR_TEMPLATE = '<div class="section" id="{{ type }}">' + (
'<h2>{{ type }}</h2>') + (... | 2.375 | 2 |
mysql2sqlite/config/__init__.py | MFrat/mysql2sqlite | 0 | 12796636 | import yaml
from pkg_resources import resource_stream
def load(filename):
with resource_stream(__name__, filename) as config_file:
return yaml.load(config_file)
def load_cluster_config(name):
return load('{0}.yml'.format(name))
_env = load('context.yml')
_configs = {}
def get_config(env):
i... | 2.328125 | 2 |
crawl.py | doudounannan/python-crawl | 0 | 12796637 | import requests, urllib, urllib2, os
from bs4 import BeautifulSoup
import style
def getImg(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
imgs = soup.find_all('img')
for img in imgs:
print(img.get('src'))
def downloadImg(imgUrl, targetUrl):
arr = imgUrl.spl... | 3.21875 | 3 |
fsc/detect.py | wsx66848/tsd | 4 | 12796638 | <reponame>wsx66848/tsd
import sys
from myutils import my_config
from mmdet.apis.inference import inference_detector, init_detector, show_result_pyplot,show_result
import os.path as osp
from app import *
debug = False
# only for debug
def load_result():
lines = ""
with open("test_image/standard_result_6411.txt"... | 1.765625 | 2 |
bin/iupred2a.py | tomasMasson/baculovirus_phylogenomics | 0 | 12796639 | <gh_stars>0
#!/usr/bin/env python3
import sys
import textwrap
import math
import os
from Bio import SeqIO
def avg(lst):
return sum(lst) / len(lst)
def aa_freq(_seq):
_freq = {}
for _aa in _seq:
if _aa in _freq:
_freq[_aa] += 1
else:
_freq[_aa] = 1
for _aa, _i... | 2.796875 | 3 |
Badger/DataLoader/AMGA/readAttributes.py | zhangxt-ihep/IHEPDIRAC | 0 | 12796640 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: linlei
#for data/all name of file like run_0023454_All_file014_SFO-2.dst
#for data/skim & mc, we use new file naming rule,
#file name like resonance_eventType_streamId_runL_runH_*.dst
import os
import os.path
import ROOT
from ROOT import gROOT
from amga import ... | 2.125 | 2 |
rivet/views.py | DruidGreeneyes/rivet_site | 0 | 12796641 | <reponame>DruidGreeneyes/rivet_site<gh_stars>0
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from .models import Comparison
from pyrivet_core.sqlite3_lexicon import Lexicon
from pyrivet_core import rivet
#... | 2.171875 | 2 |
openuav-app/dockerfiles/openuav_sample/ros-setups/intel-edison/setpoint_demo.py | harishanand95/openuav-playground | 23 | 12796642 | #!/usr/bin/env python
# vim:set ts=4 sw=4 et:
#
#
# ****************************************************************************
# *
# * Copyright (c) 2015 UAVenture AG. All rights reserved.
# * Author: <NAME> <<EMAIL>>
# *
# * Redistribution and use in source and binary forms, with or without
# * modification, are... | 1.632813 | 2 |
tests/models/test_models.py | kynk94/torch-firewood | 1 | 12796643 | import importlib
import sys
import pytest
from firewood import models
gan = ["gan." + model for model in models.gan.__all__]
semantic_segmentation = [
"semantic_segmentation." + model
for model in models.semantic_segmentation.__all__
]
all_models = gan + semantic_segmentation
@pytest.mark.parametrize("mod... | 2.0625 | 2 |
keylogger_remoto.py | HerikCarvalho/keylogger_remoto_py | 0 | 12796644 | # keylogger_remoto_py
#Um Keylogger Remoto em Python
import keyboard # para keylogs
import smtplib # para enviar email usando o protocolo SMTP (gmail)
# O semáforo é para bloquear o segmento atual
# O temporizador é para executar um método após uma quantidade de tempo "intervalo"
from threading import Semaphore, Timer... | 3.375 | 3 |
Hash/keyword-rows.py | nishantml/Data-Structure-And-Algorithms | 0 | 12796645 | <filename>Hash/keyword-rows.py
"""
Given a List of words, return the words that can be typed using letters of alphabet on only one row's
of American keyboard like the image below.
Example:
Input: ["Hello", "Alaska", "Dad", "Peace"]
Output: ["Alaska", "Dad"]
Note:
You may use one character in the keyboard mor... | 4.375 | 4 |
strings/split_join.py | janbodnar/Python-Course | 13 | 12796646 | <reponame>janbodnar/Python-Course
#!/usr/bin/python
# split_join.py
nums = "1,5,6,8,2,3,1,9"
n = nums.split(",")
print (n)
m = ':'.join(n)
print (m)
| 3.8125 | 4 |
src/pangadfs_gui/resources.py | sansbacon/pangadfsGUI | 0 | 12796647 | <gh_stars>0
# Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.2.2
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x03m\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00\x10\x00\x... | 1.28125 | 1 |
apis_configs/config_helper.py | yewu/icdc-demo | 2 | 12796648 | import json
import os
# make it easy to change this for testing
XDG_DATA_HOME=os.getenv('XDG_DATA_HOME','/usr/share/')
def default_search_folders(app_name):
'''
Return the list of folders to search for configuration files
'''
return [
'%s/cdis/%s' % (XDG_DATA_HOME, app_name),
'/usr/share/cdis/%s' % a... | 2.703125 | 3 |
maza/modules/exploits/routers/zyxel/p660hn_t_v1_rce.py | ArturSpirin/maza | 2 | 12796649 | from maza.core.exploit import *
from maza.core.http.http_client import HTTPClient
class Exploit(HTTPClient):
__info__ = {
"name": "Zyxel P660HN-T v1 RCE",
"description": "Module exploits Remote Command Execution vulnerability in Zyxel P660HN-T v1 devices. "
"If the target is... | 2.328125 | 2 |
Code/webscrape.py | tcampbell3/Black-Lives-Matter-Lethal-Force | 1 | 12796650 | #Instructions from https://www.youtube.com/watch?v=XQgXKtPSzUI&t=174s
#How to open python in command prompt:
#1) Shift+Right Click -> open command prompt
#2) type "conda activate"
#3) type "python"
#To run the python script, type the following line into the command prompt:
#python "C:\Users\travi\Dropbox\P... | 3.71875 | 4 |