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 |
|---|---|---|---|---|---|---|
MachineLearning/Ensemble/GradientBoostingTree.py | percycat/Tutorial | 0 | 31600 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 19 06:10:55 2018
@author: <NAME>
Demo of gradient boosting tree
A very nice reference for gradient boosting
http://homes.cs.washington.edu/~tqchen/pdf/BoostedTree.pdf
LightGBM
https://github.com/Microsoft/LightGBM/tree/master/examples/python-guide
Catboost
https://gith... | 3.015625 | 3 |
rurouni/exceptions.py | PinkDiamond1/Kenshin | 219 | 31601 | # coding: utf-8
class RurouniException(Exception):
pass
class ConfigException(RurouniException):
pass
class TokenBucketFull(RurouniException):
pass
class UnexpectedMetric(RurouniException):
pass | 1.546875 | 2 |
aydin/it/transforms/test/test_fixed_pattern.py | royerloic/aydin | 78 | 31602 | import numpy
from scipy.ndimage import gaussian_filter
from skimage.data import binary_blobs
from skimage.util import random_noise
from aydin.it.transforms.fixedpattern import FixedPatternTransform
def add_patterned_noise(image, n):
image = image.copy()
image *= 1 + 0.1 * (numpy.random.rand(n, n) - 0.5)
... | 2.625 | 3 |
lib/geovista/__init__.py | trexfeathers/geovista | 11 | 31603 | from os import environ
from pathlib import Path
from appdirs import user_cache_dir
from ._version import version as __version__ # noqa: F401
from .bridge import Transform # noqa: F401
from .core import combine # noqa: F401
from .geodesic import BBox, line, panel, wedge # noqa: F401
from .geometry import get_coast... | 1.804688 | 2 |
app.py | Nohossat/Smart-tic-tac-toe | 0 | 31604 | from morpion import Morpion
import argparse
if __name__=='__main__':
parser = argparse.ArgumentParser(description="Play Tic-Tac-Toe\n")
parser.add_argument('-mode', '--mode', help='play against Human', default=False)
args = parser.parse_args()
mode = False
if args.mode in ["h", "human", "humain",... | 2.765625 | 3 |
src/dcos_e2e_cli/dcos_docker/commands/_cgroup_mount_option.py | jongiddy/dcos-e2e | 63 | 31605 | """
Mount /sys/fs/cgroup Option
"""
from typing import Callable
import click
def cgroup_mount_option(command: Callable[..., None]) -> Callable[..., None]:
"""
Option for choosing to mount `/sys/fs/cgroup` into the container.
"""
function = click.option(
'--mount-sys-fs-cgroup/--no-mount-sys-... | 2.734375 | 3 |
soapfish/soap.py | jocassid/soapfish | 0 | 31606 | <reponame>jocassid/soapfish
# -*- coding: utf-8 -*-
'''
SOAP protocol implementation, dispatchers and client stub.
'''
from __future__ import absolute_import
import logging
import string
import requests
import six
from . import core, namespaces as ns, soap11, soap12, wsa
from .utils import uncapitalize
SOAP_HTTP_T... | 2.03125 | 2 |
performance/build/testsuite.py | marksantos/thrust | 28 | 31607 | """functions that generate reports and figures using the .xml output from the performance tests"""
__all__ = ['TestSuite', 'parse_testsuite_xml']
class TestSuite:
def __init__(self, name, platform, tests):
self.name = name
self.platform = platform
self.tests = tests
def __repr__(self)... | 2.875 | 3 |
snippets_dataset.py | AAlben/kaggle_SETI_search_ET | 0 | 31608 | <reponame>AAlben/kaggle_SETI_search_ET<filename>snippets_dataset.py
import os
import pdb
import torch
import random
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
class SnippetsDataset(Dataset):
def __init__(self, data_path, labels_csv_file, mode, transform=None, train_valid_rate=0.8... | 2.171875 | 2 |
tf_agents/keras_layers/bias_layer.py | FlorisHoogenboom/agents | 2 | 31609 | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 2.71875 | 3 |
Example/Algo/LinearRegressionTest.py | m-payal/AlgorithmsAndDataStructure | 4 | 31610 | # __Date__ : 1/5/2020.
# __Author__ : CodePerfectPlus
# __Package__ : Python 3
# __GitHub__ : https://www.github.com/codeperfectplus
#
from Algorithms import LinearRegression
X = [12, 24, 36]
y = [25, 49, 73]
lr = LinearRegression()
lr.fit(X, y)
y_predict = lr.predict(12)
print(y_predict)
| 2.71875 | 3 |
release/stubs.min/System/Windows/Forms/__init___parts/ControlStyles.py | htlcnn/ironpython-stubs | 182 | 31611 | class ControlStyles(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the style and behavior of a control.
enum (flags) ControlStyles,values: AllPaintingInWmPaint (8192),CacheText (16384),ContainerControl (1),DoubleBuffer (65536),EnableNotifyMessage (32768),FixedHeight (64),FixedWidth (32),Opaque ... | 2.296875 | 2 |
scripts/venv/lib/python2.7/site-packages/cogent/align/progressive.py | sauloal/cnidaria | 3 | 31612 | <gh_stars>1-10
#!/usr/bin/env python
from __future__ import with_statement
from cogent import LoadTree
from cogent.phylo import nj as NJ
from cogent.phylo.distance import EstimateDistances
from cogent.core.info import Info
from cogent.util import progress_display as UI
__author__ = "<NAME>"
__copyright__ = "Copyright... | 2.265625 | 2 |
di_scoring/admin.py | tboz203/django-scoring | 0 | 31613 | from django.contrib import admin
from di_scoring import models
# copypastad with love from :
# `http://stackoverflow.com/questions/10543032/how-to-show-all-fields-of-model-in-admin-page`
# subclassed modeladmins' list_displays will contain all model fields except
# for id
class CustomModelAdminMixin(object):
def _... | 2.09375 | 2 |
Day Pogress - 18~100/Day 17/constructor.py | Abbhiishek/Python | 1 | 31614 | """
how to create a class
a class is constructed through constructor
=> a class can be constructed through specific function called "__init__(self)"
"""
# let's create a Class
class Person:
"""
A class to create a person with the following attributes:
age, marks, phone, user_id, profession, goal
... | 4.875 | 5 |
src/compas_rhino/artists/networkartist.py | duchaoyu/compas | 0 | 31615 | <gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from functools import partial
import compas_rhino
from compas.geometry import centroid_points
from compas.utilities import color_to_colordict
from compas.artists import NetworkArtist
from .artist ... | 2.28125 | 2 |
tests/x7/lib/test_shell_tools.py | gribbg/x7-lib | 0 | 31616 | # Originally auto-generated on 2021-02-15-12:14:36 -0500 EST
# By '--verbose --verbose x7.lib.shell_tools'
from unittest import TestCase
from x7.lib.annotations import tests
from x7.testing.support import Capture
from x7.lib import shell_tools
from x7.lib.shell_tools_load import ShellTool
@tests(shell_tools)
class T... | 2.234375 | 2 |
HmacCalculation/Hmac256Calculation.py | likloadm/cross_platform_crypto | 15 | 31617 | from Crypto.Hash import HMAC, SHA256
import base64
def hmac256Calculation(keyHmac, data):
h = HMAC.new(keyHmac.encode("ascii"), digestmod=SHA256)
h.update(data.encode("ascii"))
return h.digest()
def base64Encoding(input):
dataBase64 = base64.b64encode(input)
dataBase64P = dataBase64.decode("UTF-8"... | 3.578125 | 4 |
elvaapp/elvaapp/doctype/vache/vache_dashboard.py | ovresko/elvadesk | 1 | 31618 | <reponame>ovresko/elvadesk
from frappe import _
def get_data():
return {
'fieldname': 'vache',
'non_standard_fieldnames': {
'Insemination': 'vache'
},
'transactions': [
{
'label': _('Reproduction'),
'items': ['Insemination','Velage','Diagnostique']
},
{
'label': _('Production'),
'i... | 1.46875 | 1 |
setup.py | patlegu/python-SNS-API | 9 | 31619 | <reponame>patlegu/python-SNS-API
#!/usr/bin/python
import setuptools
import os
version = {}
with open(os.path.join('stormshield', 'sns', 'sslclient', '__version__.py'), 'r') as fh:
exec(fh.read(), version)
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="stormshiel... | 1.53125 | 2 |
vpc_hyp2/ansible/roles/vm_create/files/variables.py | dhanraj-vedanth/IaaS_VPC_CDN | 0 | 31620 | <filename>vpc_hyp2/ansible/roles/vm_create/files/variables.py
dom_list = ['an_h1']
| 1.351563 | 1 |
Examples/ApiExamples/ex_structured_document_tag.py | alex-dudin/Aspose.Words-for-Python-via-.NET | 3 | 31621 | # Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved.
#
# This file is part of Aspose.Words. The source code in this file
# is only intended as a supplement to the documentation, and is provided
# "as is", without warranty of any kind, either expressed or implied.
import uuid
from datetime import datetime
im... | 2.3125 | 2 |
tests/emulator/kernel/test_kernel.py | FKD13/RCPU | 17 | 31622 | <filename>tests/emulator/kernel/test_kernel.py
from .utils import init_kernel
def test_read_string():
k = init_kernel()
k.RAM.load([ord(char) for char in "ABCDE"] + [0])
assert k.read_string(0) == "ABCDE"
k.RAM.load([ord(char) for char in "PYTHON"] + [0], base_address=40)
assert k.read_string(40) ... | 2.671875 | 3 |
tensorflow_graphics/rendering/barycentrics.py | Tensorflow-Devs/graphics | 0 | 31623 | # Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 2.203125 | 2 |
to_remove/Crawler/measurement_loc_crawler.py | jsdelivrbot/SeoulWind | 0 | 31624 | <reponame>jsdelivrbot/SeoulWind
from parameters import Parameters
from bs4 import BeautifulSoup
import requests
import json
def addr2latlng(addr):
params = Parameters('parameters.txt').load()
payload = {'clientID': params['apikey_naver_id'], 'query': addr}
headers = {
'Host': 'openapi.nav... | 2.796875 | 3 |
google_analytics/predictor.py | hadisotudeh/jads_kaggle | 11 | 31625 | <reponame>hadisotudeh/jads_kaggle
import numpy as np
from sklearn.metrics import mean_squared_error, make_scorer
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.base import BaseEstimator
from utils import timing # noqa
TUNING_OUTPUT_DEFAULT = 'tuning.txt'
RANDOM_STATE = 42 # Used fo... | 3.03125 | 3 |
py/fft.py | bradowen2011/lightshowpi | 3 | 31626 | #
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: <NAME> (<EMAIL>)
"""FFT methods for computing / analyzing frequency response of audio.
This is simply a wrapper around FFT support in numpy.
Initial FFT code inspired from the code posted here:
http://www... | 2.890625 | 3 |
benchmark/test.py | franklx/misaka | 1 | 31627 | # -*- coding: utf-8 -*-
from misaka import Markdown, BaseRenderer, HtmlRenderer, \
SmartyPants, \
EXT_FENCED_CODE, EXT_TABLES, EXT_AUTOLINK, EXT_STRIKETHROUGH, \
EXT_SUPERSCRIPT, HTML_USE_XHTML, \
TABLE_ALIGN_L, TABLE_ALIGN_R, TABLE_ALIGN_C, \
TABLE_ALIGNMASK, TABLE_HEADER
class BleepRenderer(Htm... | 2.296875 | 2 |
sample_project/batchimport/batchimport_settings.py | gitdaniel228/realtor | 0 | 31628 | """
The batchimport_settings.py module initializes itself with defaults but
allows for the values to be overridden via the django project's settings
file.
NOTE: These values should be considered CONSTANTS even though I'm kind
of cheating and using them as variables to initialize them here.
"""
import settings
def ... | 2.484375 | 2 |
tests/test_xunit_plugin.py | omergertel/slash | 0 | 31629 | <gh_stars>0
import os
import pytest
import slash
from lxml import etree
def test_xunit_plugin(results, xunit_filename):
assert os.path.exists(xunit_filename), 'xunit file not created'
schema_root = etree.XML(_XUNIT_XSD)
schema = etree.XMLSchema(schema_root)
parser = etree.XMLParser(schema=schema)
... | 1.992188 | 2 |
slides/figs/draw.py | hiyouga/AMP-Poster-Slides-LaTeX | 8 | 31630 | import matplotlib
import numpy as np
import matplotlib.pyplot as plt
default_params = {
'text.usetex': False,
'font.family': 'Times New Roman',
'font.serif': 'Times New Roman'
}
if __name__ == '__main__':
plt.rcParams.update(default_params)
myfont1 = matplotlib.font_manager.FontProperties(fname='C... | 2.484375 | 2 |
tests/unit/test_u_wsgi.py | p15r/HYOK-Wrapper | 2 | 31631 | import wsgi # noqa: F401
def test_connect_to_app(http_client):
response = http_client.get('/')
assert response.status_code == 404
| 1.835938 | 2 |
ceefax/pages/index.py | mscroggs/CEEFAX | 1 | 31632 | <reponame>mscroggs/CEEFAX<filename>ceefax/pages/index.py
from ceefax.page import Page
from ceefax import config
from ceefax import Ceefax
class IndexPage(Page):
def __init__(self, n):
super(IndexPage, self).__init__(n)
self.importance = 5
self.title = "Index"
def generate_content(self... | 2.828125 | 3 |
bin/award_ebadge_declare.py | ervikey/SA-ctf_scoreboard | 106 | 31633 | <filename>bin/award_ebadge_declare.py
# encode = utf-8
import os
import sys
import re
ta_name = 'SA-ctf_scoreboard'
ta_lib_name = 'sa_ctf_scoreboard'
pattern = re.compile(r"[\\/]etc[\\/]apps[\\/][^\\/]+[\\/]bin[\\/]?$")
new_paths = [path for path in sys.path if not pattern.search(path) or ta_name in path]
new_paths.i... | 2.25 | 2 |
books/migrations/0009_library_waitlist_items.py | rodbv/kamu | 70 | 31634 | <filename>books/migrations/0009_library_waitlist_items.py
# Generated by Django 2.0.1 on 2019-01-07 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waitlist', '0001_initial'),
('books', '0008_bookcopy_borrow_date'),
]
operations =... | 1.726563 | 2 |
main.py | drdoof2019/Twitter-Sentiment-Analysis | 0 | 31635 | import re
import tweepy
from tweepy import OAuthHandler
from textblob import TextBlob
# pip install tweepy
# pip install textblob
# developer.twitter.com/en/portal/dashboard
def istenmeyen_karakter_temizle(text):
istenmeyen_karakterler = [':',';','!','*','$','½','&']
for karakter in istenmeyen_... | 2.859375 | 3 |
todo/__init__.py | maxios/gtd.py | 0 | 31636 | <filename>todo/__init__.py<gh_stars>0
'''gtd.py'''
__version__ = '0.7.0'
__author__ = 'delucks'
| 1.101563 | 1 |
SubredditScraper/scrape.py | tomhennessey/Subreddit-Scrape | 0 | 31637 | <gh_stars>0
#!/usr/bin/env python3
"""
A simple subreddit scraper
"""
import datetime as dt
import logging
import time
import os
import sys
import getopt
import praw
from psaw import PushshiftAPI
if __package__ == None:
import db
else:
from . import db
def init_log():
"""
Initiates a logger for psaw... | 3.03125 | 3 |
expressive_regex/exceptions.py | fsadannn/expressive_regex | 2 | 31638 | class BadStatement(Exception):
pass
| 1.085938 | 1 |
trieste/models/gpflow/__init__.py | henrymoss/trieste | 1 | 31639 | # Copyright 2021 The Trieste Contributors
#
# 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.40625 | 1 |
expenses_tracker/expenses_tracker/web/vaidators.py | LBistrev/python-web-basic | 0 | 31640 | <filename>expenses_tracker/expenses_tracker/web/vaidators.py<gh_stars>0
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
VALIDATE_ONLY_LETTERS_EXCEPTION_MESSAGE = 'Ensure this value contains only letters.'
def validate_only_letters(value):
if not value.isalp... | 2.265625 | 2 |
seleniumwire/thirdparty/mitmproxy/net/http/multipart.py | KozminMoci/selenium-wire | 975 | 31641 | <reponame>KozminMoci/selenium-wire
import mimetypes
import re
from urllib.parse import quote
from seleniumwire.thirdparty.mitmproxy.net.http import headers
def encode(head, l):
k = head.get("content-type")
if k:
k = headers.parse_content_type(k)
if k is not None:
try:
... | 2.390625 | 2 |
pretalx_mattermost/apps.py | toshywoshy/pretalx-mattermost | 0 | 31642 | <gh_stars>0
from django.apps import AppConfig
from django.utils.translation import gettext_lazy
class PluginApp(AppConfig):
name = 'pretalx_mattermost'
verbose_name = 'MatterMost integration for pretalx'
class PretalxPluginMeta:
name = gettext_lazy('MatterMost integration for pretalx')
au... | 1.609375 | 2 |
flexselect/views.py | twerp/django-admin-flexselect-py3 | 0 | 31643 | import json
from django.http import HttpResponse
from django.forms.widgets import Select
from django.contrib.auth.decorators import login_required
from flexselect import (FlexSelectWidget, choices_from_instance,
details_from_instance, instance_from_request)
@login_required
def field_changed(... | 2.234375 | 2 |
mscreen/autodocktools_prepare_py3k/AutoDockTools/VisionInterface/Adt/Macro/AutodockVS.py | e-mayo/mscreen | 9 | 31644 | <reponame>e-mayo/mscreen
########################################################################
#
# Vision Macro - Python source code - file generated by vision
# Thursday 01 July 2010 13:22:44
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
... | 2.046875 | 2 |
taotao-cloud-python/taotao-cloud-oldboy/day70-EdmureBlog/EdmureBlog/backend/views/trouble.py | shuigedeng/taotao-cloud-paren | 47 | 31645 | from django.shortcuts import render,redirect,HttpResponse
from repository import models
def trouble_list(request):
# user_info = request.session.get('user_info') # {id:'',}
current_user_id = 1
result = models.Trouble.objects.filter(user_id=current_user_id).order_by('status').\
only('title','status',... | 2 | 2 |
examples/single_camera.py | Hikki12/camio | 0 | 31646 | import cv2
from camio import Camera
camera = Camera(
src=0,
fps=30,
size=None,
emitterIsEnabled=False,
queueModeEnabled=False,
backgroundIsEnabled=True,
)
camera.start()
while True:
image = camera.read()
if image is not None:
c... | 3.203125 | 3 |
setup.py | Seojiyoon/pydata_jy | 0 | 31647 | <gh_stars>0
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pydata_jy',
version='1.0.0',
description='PyData Loc... | 1.429688 | 1 |
src/modules/bot_info.py | 490720818/jx3_bot | 22 | 31648 | from datetime import datetime
from typing import Optional
from src.utils.config import config
from tortoise import fields
from tortoise.models import Model
defaule_nickname: str = config.get('default').get('nickname')
class BotInfo(Model):
'''QQ机器人表'''
bot_id = fields.IntField(pk=True)
'''机器人QQ号'''
... | 2.4375 | 2 |
ckan/tests/legacy/functional/test_admin.py | ogdch/ckan | 0 | 31649 | import ckan.model as model
from ckan.tests.legacy import url_for, CreateTestData, WsgiAppCase
class TestAdminController(WsgiAppCase):
@classmethod
def setup_class(cls):
# setup test data including testsysadmin user
CreateTestData.create()
@classmethod
def teardown_class(self):
... | 2.03125 | 2 |
main/PublicEmotionDatasets/Adobe/process/train_glove.py | cvlab-stonybrook/Emotion-Prediction | 10 | 31650 | <filename>main/PublicEmotionDatasets/Adobe/process/train_glove.py
"""
Copyright (c) 2019 <NAME>
Licensed under the MIT License
Author: <NAME>
Email: <EMAIL>
Last modified: 18/12/2019
Usage:
Run this script to train GloVe model on Adobe tags.
"""
import os
import gluonnlp as nlp
import numpy as np
import matplotlib.py... | 2.546875 | 3 |
src/py/fi3201/vis-anim/plot-sine-wave.py | butiran/butiran.github.io | 0 | 31651 | #
# plot-sine-wave.py
# Produce a PNG file of a sine wave plot
#
# <NAME> | https://butiran.github.io
#
# Execute: py plot-sine-wave.py
# Output: sine-t-<time>.png
#
# 20210212
# 1901 Create this by modifying moving-sine-wave.py from [1].
# 1902 Remove FuncAnimation from matplotlib.animation.
# 1904 Can save as PNG... | 2.796875 | 3 |
app/grandchallenge/emails/urls.py | comic/comic-django | 7 | 31652 | <filename>app/grandchallenge/emails/urls.py
from django.urls import path
from grandchallenge.emails.views import (
EmailCreate,
EmailDetail,
EmailList,
EmailUpdate,
)
app_name = "emails"
urlpatterns = [
path("", EmailList.as_view(), name="list"),
path("create/", EmailCreate.as_vi... | 1.921875 | 2 |
sdk/python/pulumi_azure_native/security/v20170801preview/_enums.py | pulumi-bot/pulumi-azure-native | 31 | 31653 | <reponame>pulumi-bot/pulumi-azure-native
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'AlertNotifications',
'AlertsToAdmins',
'DataSource',
'Expo... | 1.53125 | 2 |
Python-For-Everyone-Horstmann/Chapter4-Loops/P4.12.py | islayy/Books-solutions | 0 | 31654 | <filename>Python-For-Everyone-Horstmann/Chapter4-Loops/P4.12.py<gh_stars>0
# Write a program that reads a word and prints all substrings, sorted by length. For
# example, if the user provides the input "rum" , the program prints
# r
# u
# m
# ru
# um
# rum
word = str(input("Enter a word: "))
... | 4.3125 | 4 |
openprocurement/auction/esco/utils.py | ProzorroUKR/openprocurement.auction.esco | 0 | 31655 | # -*- coding: utf-8 -*-
import json
from functools import partial
from fractions import Fraction
from barbecue import chef
from decimal import Decimal
def prepare_initial_bid_stage(bidder_name="",
bidder_id="",
time="",
amount_f... | 2.46875 | 2 |
src/octopus/dispatcher/model/pool.py | smaragden/OpenRenderManagement | 35 | 31656 | <filename>src/octopus/dispatcher/model/pool.py
####################################################################################################
# @file pool.py
# @package
# @author
# @date 2008/10/29
# @version 0.1
#
# @mainpage
#
############################################################################... | 2.265625 | 2 |
optimiser.py | FJFranklin/DomeBuilder | 0 | 31657 | <gh_stars>0
import argparse
import csv
import sys
import numpy as np
from BeesEtAl.BA_Garden import BA_Garden
from BeesEtAl.F3_Garden import F3_Garden
from BeesEtAl.Base_Coster import Base_Coster
from DomeBuilder.MaterialLib import MaterialLib
from DomeBuilder.Frame import Frame
# Defaults
... | 2.046875 | 2 |
File_Counts.py | juliaviolet/Google_IT_Python_Crash_Course | 0 | 31658 | <gh_stars>0
file_counts = {"jpg":10, "txt":14, "csv":2, "py":23}
print(file_counts)
file_counts["txt"]
14
"jpg" in file_counts
True
"html" in file_counts
False
file_counts["cfg"] = 8
print file_counts
{"jpg":10, "txt":14, "csv":2, "py":23, "cfg" = 8 }
file_counts["csv"]= 17
print file_counts
{"jpg":10, "txt":14, "csv":... | 2.609375 | 3 |
monolithic/order_transaction.py | liks79/sample-saga-with-step-functions | 3 | 31659 | <reponame>liks79/sample-saga-with-step-functions
"""
Database model for Monolithic application
~~~~~~~~~~~~~~~~~~~~~~~
:created date: Thursday, March 12, 2020
:description: Monolithic application implementation of simple order transaction scenario
:copyright: © 2020 written by sungshik (<EMAIL>)
... | 2.390625 | 2 |
build.py | FrederichRiver/neutrino3 | 1 | 31660 | #!/usr/bin/python3
import os
PROJ_PATH = os.getenv('NEU_PATH')
# Test
lib_list = [
'dev_global','libutils', 'libmysql_utils',
'libbasemodel', 'libspider', 'libnlp',
'libcontext', 'service_api', 'libstrategy', 'libtask']
# lib_list = ['libstrategy',]
for lib in lib_list:
print(f"[Building {lib}]")
#... | 1.984375 | 2 |
problem0116.py | kmarcini/Project-Euler-Python | 0 | 31661 | <gh_stars>0
###########################
#
# #116 Red, green or blue tiles - Project Euler
# https://projecteuler.net/problem=116
#
# Code by <NAME>
#
###########################
| 1.328125 | 1 |
src_adsabs/ads_dataviz.py | mlares/iate_audit | 0 | 31662 | <reponame>mlares/iate_audit
import numpy as np
import pickle
import pandas as pd
import random
from matplotlib import pyplot as plt
from plot_styles import *
# #################################################################
# Load data
# #################################################################
df_papers_... | 2.109375 | 2 |
p2p/__init__.py | jperezlatimes/p2p-python | 2 | 31663 | from builtins import str
from builtins import range
from builtins import object
import os
import re
import json
import math
import logging
import requests
import warnings
from time import mktime
from copy import deepcopy
from datetime import datetime
from datetime import date
from p2p import utils
from p2p.cache import... | 2.078125 | 2 |
plots/ttest.py | Denbergvanthijs/imbDRLAppendix | 0 | 31664 | <filename>plots/ttest.py
import pandas as pd
from scipy.stats import ttest_ind
experiments = ("creditcardfraud", "histology", "aki")
usecols = ("F1", ) # "Precision", "Recall"
alpha = 0.05
for experiment in experiments:
df_nn = pd.read_csv(f"./results/{experiment}/nn.csv", usecols=usecols)
df_dqn = pd.read_c... | 2.96875 | 3 |
build/lib/acousondePy/__init__.py | SvenGastauer/acousondePy | 0 | 31665 | <gh_stars>0
from .MTRead import MTread,spec_plot,read_multiple_MT
from .main import MTreadgui,acousonde | 1.132813 | 1 |
references/encase/code/resNet_3.py | wenh06/cinc2020 | 4 | 31666 | <filename>references/encase/code/resNet_3.py<gh_stars>1-10
# -*- coding: utf-8 -*-
'''
split long seq into small sub_seq,
feed sub_seq to lstm
'''
from __future__ import division, print_function, absolute_import
import tflearn
import tflearn.data_utils as du
import numpy as np
import ReadData
import tensorflow as ... | 1.859375 | 2 |
experiments/data_manager.py | bekirufuk/longformer | 0 | 31667 | import os
import json
import config
import pandas as pd
def create_data_files(patents, ipcr):
chunk_count = 0
patent_count = 0
for chunk in patents:
# Combine patent with respective section info.
data = chunk.merge(ipcr, how='left', on='patent_id')
# Replace the letters with integ... | 2.6875 | 3 |
batch.py | jazevedo620/RepoMigrator | 0 | 31668 | import migrate
import argparse
import shutil
__author__ = "<NAME>"
__version__ = "1.0"
DESCRIPTION = "Migrates multiple repositories at once"
HTTPS_START = "https://"
REPO_FORMAT = "{}/{}/{}.git"
def main(source_site, dest_site, repos, dest_user=None, dest_token=None, source_user=None, source_token=None,
t... | 2.875 | 3 |
coherence/upnp/services/servers/switch_power_server.py | palfrey/Cohen3 | 60 | 31669 | # -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, <NAME> <<EMAIL>>
'''
Switch Power service
====================
'''
from twisted.web import resource
from coherence.upnp.core import service
from coherence.upnp.core.soap_service import UPnPPu... | 1.945313 | 2 |
enumerate_and_map_and_reduce.py | aslange/Python_Basics | 0 | 31670 | # função enumerate
lista = ['abacate', 'bola', 'cachorro'] # lista
for i in range(len(lista)):
print(i, lista[i])
for i, nome in enumerate(lista):
print(i, nome)
# função map
def dobro(x):
return x * 2
valor = [1, 2, 3, 4, 5]
print(dobro(valor))
valor_dobrado = map(dobro, valor)
valor_dobrado = list... | 3.859375 | 4 |
VKActivityAnalisys/ActivityAnalysis.py | Rig0ur/VKAnalysis | 54 | 31671 | import datetime
import json
import logging
import operator
import os
from collections import defaultdict
from datetime import date
import vk_api
import vk_api.exceptions
from vk_api import execute
#from .TimeActivityAnalysis import VKOnlineGraph
from .VKFilesUtils import check_and_create_path, DIR_PREFIX
class VKAc... | 2.1875 | 2 |
tipos de datos/integer1.py | gabys12/portafolio-fundamento-de-programacion | 0 | 31672 | x = 100
y = 50
print('x=', x, 'y=', y)
| 3.078125 | 3 |
tests/package/aeronpy/archive_test.py | welly87/aeron-python | 9 | 31673 | import os
from hamcrest import *
from pytest import fixture
from tempfile import _get_candidate_names as temp_dir_candidates, tempdir
from time import sleep
from aeronpy import Archive
from aeronpy.driver import archiving_media_driver
@fixture()
def aeron_directory():
temp_dirs = temp_dir_candidates()
where ... | 1.953125 | 2 |
app/script.py | tallywiesenberg/spotter-blocker | 0 | 31674 | import edits
from edits import PageEditor
pe = PageEditor(keyword='spider', orientation='block')
pe.edit() | 1.84375 | 2 |
src/cascade_at/settings/base_case.py | ihmeuw/cascade-at | 1 | 31675 | <gh_stars>1-10
BASE_CASE = {
"model": {
"random_seed": 495279142,
"default_age_grid": "0 0.01917808 0.07671233 1 5 10 20 30 40 50 60 70 80 90 100",
"default_time_grid": "1990 1995 2000 2005 2010 2015 2016",
"add_calc_emr": "from_both",
"birth_prev": 0,
"ode_step_size"... | 1.148438 | 1 |
navrep/scripts/train_rnn.py | ReykCS/navrep | 48 | 31676 | <gh_stars>10-100
from __future__ import print_function
import numpy as np
import os
from datetime import datetime
import random
import time
import pickle
from pyniel.python_tools.path_tools import make_dir_if_not_exists
import pandas as pd
from navrep.models.vae2d import ConvVAE
from navrep.models.vae1d import Conv1DV... | 2.0625 | 2 |
Programming I Python/Chapter 5/b project 5a/Eric Blanco Problem 13.py | eebr99/Python-Projects | 0 | 31677 | <gh_stars>0
#Write a function named "falling_distance" that accepts an object's falling time
#(in seconds) as an argument. The function should return the distance, in meters
#, that the object has fallen during the time interval.Write a program that
#calls the function in a loop that passes the values 1 through 10 a... | 4.25 | 4 |
prepare_data.py | aascode/OMGEmotionChallenge | 0 | 31678 | <reponame>aascode/OMGEmotionChallenge<gh_stars>0
from __future__ import print_function
import argparse
import os
import sys
import subprocess
import datetime
def get_formatted_time(seconds):
return str(datetime.timedelta(seconds=seconds))
# microsecond = int((seconds - int(seconds)) * 1000 * 1000)
# int_se... | 2.609375 | 3 |
PyBlokusTools/pyblokustools/testserver/Message.py | HenrikThoroe/SWC-2021 | 0 | 31679 | <gh_stars>0
from typing import Any, Final, Tuple, List
from enum import IntEnum
from .MsgType import MsgType
class Message():
"""Base Message
Arguments:
type {MsgType} -- Type of message
payload {Any} -- Payload used for later handling
"""
def __init__(self, type: MsgType, payl... | 3.125 | 3 |
celo_sdk/tests/stable_token_tests.py | rcroessmann/celo-sdk-py | 7 | 31680 | import time
import unittest
from web3 import Web3
from celo_sdk.kit import Kit
from celo_sdk.tests import test_data
class TestStableTokenWrapper(unittest.TestCase):
@classmethod
def setUpClass(self):
self.kit = Kit('http://localhost:8544')
self.stable_token_wrapper = self.kit.base_wrapper.c... | 2.140625 | 2 |
compipe/utils/parameters.py | ImagineersHub/pyspinner | 0 | 31681 | <reponame>ImagineersHub/pyspinner<gh_stars>0
"""Represent the command parameter strings."""
ARG_COMMAND = 'command'
ARG_ARGUMENT = 'argument'
ARG_COUNT = 'count'
ARG_CHANNEL = 'channel'
ARG_CLIENT = 'client'
ARG_GUID = 'guid'
ARG_CHANGELIST = 'cl'
ARG_DEV_CHANNEL = 'dev_channel'
ARG_QUEUE_WORKER_NUMBER = 'worker_number... | 2.296875 | 2 |
python/avi/migrationtools/f5_converter/test/excel_reader.py | thisisshi/sdk | 37 | 31682 | <reponame>thisisshi/sdk
import json
import pandas
def output_sanitization(path_to_excel, path_to_out_json=None):
''' Find the Success percentage of each output report '''
path = path_to_excel
out_obj = []
excel_obj = []
# Output Sanitization
wb = pandas.read_excel(path, engine='openpyxl')
... | 2.546875 | 3 |
full_mode/rx.py | diegoa314/daphne | 0 | 31683 | <filename>full_mode/rx.py
from litex.soc.cores.code_8b10b import Decoder
from transmitter32b import Transmitter32b
from alignment_corrector import Alignment_Corrector
from migen.genlib.fifo import *
from migen import *
class RX(Module):
def __init__(self):
self.data_in=Signal(40)
self.rx_init_done = rx_init_done =... | 2.1875 | 2 |
vsts/vsts/work/v4_1/models/parent_child_wIMap.py | kenkuo/azure-devops-python-api | 0 | 31684 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 1.984375 | 2 |
dash/migrations/0001_initial.py | mohammedaliyu136/degree_pln2 | 0 | 31685 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-08-03 08:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 1.578125 | 2 |
blockchain.py | jdacode/Blockchain_voting_system | 2 | 31686 | <gh_stars>1-10
""" ANACONDA: To open anaconda use the command line $ anaconda-navigator
ANACONDA: And the in Pycharm you can activate your Environtments, in this case is on terminal:
$ source activate pycoin
ANACONDA: Now it will change to (pycoin) at the beginning of the user. For instance, (pycoin) w11@w11... | 3.375 | 3 |
examples/src/python/example/tensorflow_custom_op/zero_out_custom_op.py | anthonyjpratti/pants | 1 | 31687 | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import tensorflow as tf
# TODO: It would be great if we could maintain the example.tensorflow_custom_op package prefix for
# this python_dist()!
from wrap_lib.wrap_zero_out_op import zero_... | 2.078125 | 2 |
frozen_box/frozen_class.py | leavers/frozen-box | 0 | 31688 | from typing import List, Optional, Sequence, Union
from abc import abstractmethod, ABC
from copy import deepcopy
from sys import _getframe as get_stack
from frozen_box.exception import FrozenException, FrozenKeyError, FrozenValueError
QueryableItem = Union[str, int, slice]
Queryable = Union[QueryableItem, Sequence[Qu... | 2.609375 | 3 |
tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py | tmpsantos/chromium | 0 | 31689 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import unittest
from telemetry.core import exceptions
from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import simpl... | 2.109375 | 2 |
demo_app_3pages_deep.py | MarijaAP/freezeyt | 0 | 31690 | from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
"""Create the home page of the web app.
Link to the second page.
"""
return """
<html>
<head>
<title>Hello world</title>
</head>
<body>
Hello world!
<br>
... | 3.578125 | 4 |
Main.py | Farhad-Shabani/TSETMC_Dashboard | 5 | 31691 | <filename>Main.py
import re, time, requests
from bs4 import BeautifulSoup
from openpyxl import workbook
from openpyxl import load_workbook
from src.Scrape_Index import Scrape_Index
from src.Database_Maker import Database_Maker, Sorted_Database
def Export_Database(portfolio,Selected_Stocks):
StartTime = t... | 2.65625 | 3 |
ace/api/apikey.py | ace-ecosystem/ace2-core | 0 | 31692 | from dataclasses import dataclass, asdict
from typing import Optional
from ace.data_model import ApiKeyModel
@dataclass
class ApiKey:
# the api key value
api_key: str
# the unique name of the api key
name: str
# optional description of the api key
description: Optional[str] = None
# is t... | 2.8125 | 3 |
src/data/1135.py | NULLCT/LOMC | 0 | 31693 | from sys import setrecursionlimit
setrecursionlimit(10**7)
N, Q = [int(x) for x in input().split()]
to = [[] for _ in range(N)]
for _ in range(N - 1):
a, b = [int(x) - 1 for x in input().split()]
to[a].append(b)
to[b].append(a)
depth = [-1] * N
def dfs(v, p, d):
depth[v] = d
for u in to[v]:
... | 2.984375 | 3 |
src/import_dbf/migrations/0001_initial.py | iplweb/django-bpp | 1 | 31694 | # Generated by Django 2.1.13 on 2019-11-03 14:05
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
... | 1.773438 | 2 |
examples/ssh_to_appliance.py | grelleum/SteelConnect | 9 | 31695 | <reponame>grelleum/SteelConnect<gh_stars>1-10
#!/usr/bin/env python3
# coding: utf-8
# ______ __
# / __/ /____ ___ / /
# ____\ \/ __/ -_) -_) / __ _
# / _____/\__/\__/\__/_/_ ____/ /_(_)__ ___
# / /__/ _ \/ _ \/ _ \/ -_) __/ __/ / _ \/ _ \
# \___/\___/_//_/_//_/\__/\__/\__/_/\___... | 2.171875 | 2 |
habittest.py | Stephenjcl/GalaxyMapGeneration | 0 | 31696 | #Viability test
from garnets import generate_stellar_system, random_star
from enviroment import BreathabilityPhrase
breathableair = False
moon = False
attempts = 0
# while breathableair is False or attempts <= 35000:
# try:
# stellar_system = generate_stellar_system(random_star())
# for i in range... | 3.21875 | 3 |
app/account/urls.py | mohit4/BucketCrab | 0 | 31697 | <reponame>mohit4/BucketCrab<filename>app/account/urls.py
from django.contrib.auth.views import LogoutView
from django.urls import path
from django.contrib.auth.views import LogoutView
from .views import UserRegisterView, UserLoginView, ProfileDetailView, ProfileUpdateView
app_name = 'account'
urlpatterns = [
pat... | 2.0625 | 2 |
premailer/__init__.py | locationlabs/premailer | 0 | 31698 | <reponame>locationlabs/premailer
__version__ = '1.12.1-LL'
__build__ = '' # set by the build server
| 0.976563 | 1 |
bootstrap.py | mikesname/ocropodium | 1 | 31699 | """
Virtualenv bootstrap script, borrowed from:
http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/
"""
import os
import subprocess
if "VIRTUAL_ENV" not in os.environ:
sys.stderr.write("$VIRTUAL_ENV not found.\n\n")
parser.print_usage()
sys.exit(-1)
virt... | 1.84375 | 2 |