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 |
|---|---|---|---|---|---|---|
FU_Berlin_code/PhaseNet_Run_catalog.py | Jazin2005/phasenet_chile-subduction-zone | 0 | 12764451 | <filename>FU_Berlin_code/PhaseNet_Run_catalog.py<gh_stars>0
import pandas as pd
import csv
import numpy as np
import obspy
import json
import os
import matplotlib.pyplot as plt
from subprocess import call
import pickle
class P_S_Picker(object):
def __init__(self, phasenet_traj:'str', working_traj:'str', expor... | 2.578125 | 3 |
addons/hw_drivers/controllers/driver.py | SHIVJITH/Odoo_Machine_Test | 0 | 12764452 | <gh_stars>0
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from base64 import b64decode
import json
import logging
import os
import subprocess
import time
from odoo import http, tools
from odoo.http import send_file
from odoo.modules.module import get_resource_path
... | 2.28125 | 2 |
Physics_aware_loss_function/scene.py | AlbanOdot/DeepPhysics-article | 1 | 12764453 | <filename>Physics_aware_loss_function/scene.py<gh_stars>1-10
import numpy as np
import torch
import helper
import os
# General global variable declaration
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
number_of_dofs = 12000
# Create the architecture and load the trained weights
n... | 2.359375 | 2 |
sdk/python/pulumi_aws_native/pinpointemail/identity.py | AaronFriel/pulumi-aws-native | 29 | 12764454 | <filename>sdk/python/pulumi_aws_native/pinpointemail/identity.py<gh_stars>10-100
# 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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import... | 1.789063 | 2 |
core/datasets.py | thomasweng15/RAFT | 0 | 12764455 | <reponame>thomasweng15/RAFT
# Data loading based on https://github.com/NVIDIA/flownet2-pytorch
import numpy as np
import torch
import torch.utils.data as data
import torch.nn.functional as F
import os
import math
import random
from glob import glob
import os.path as osp
from utils import frame_utils
from utils.augme... | 2.140625 | 2 |
Files/03-Concatenacao-Operadores-e-Metodos.py | michelelozada/Logica-de-Programacao_e_Algoritmos_em_Python | 0 | 12764456 | '''
* Concatenação: operadores e métodos
* Repositório: Lógica de Programação e Algoritmos em Python
* GitHub: @michelelozada
'''
# 1 - Operador +
nome = 'Denzel' + ' ' + 'Washington'
profissao = 'ator e produtor norte-americano'
print(nome) # <NAME>
print(nome + ', ' + profissao) # <NAME>, ator e produtor nor... | 4.25 | 4 |
python/run.py | poanchen/azure-iot-central-arm-sdk-samples | 0 | 12764457 | import os, uuid, sys
from azure.mgmt.iotcentral import IotCentralClient
from azure.mgmt.iotcentral.models import App, AppSkuInfo, AppPatch
from msrestazure.azure_active_directory import MSIAuthentication
from azure.common.credentials import UserPassCredentials, get_azure_cli_credentials
# login with az login
creds = g... | 2.046875 | 2 |
self_sup_comb_discrete_skills/algo/algorithm_discrete_skills.py | fgitmichael/SelfSupevisedSkillDiscovery | 0 | 12764458 | import numpy as np
from tqdm import tqdm
from typing import Dict, Union
import torch
import gtimer as gt
import matplotlib
from matplotlib import pyplot as plt
import self_supervised.utils.typed_dicts as td
from self_supervised.base.data_collector.data_collector import \
PathCollectorSelfSupervised
from self_sup_c... | 1.507813 | 2 |
src/plotting/figure3.py | UMCUGenetics/svMIL | 0 | 12764459 | <filename>src/plotting/figure3.py<gh_stars>0
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
import random
from scipy import stats
from statsmodels.sandbox.stats.multicomp import multipletests
import os
import os.path
import pandas as pd
import seaborn a... | 3.015625 | 3 |
functional_spec/spec/status.py | sayak119/GOJEK-Parking | 0 | 12764460 | <filename>functional_spec/spec/status.py
#! /usr/bin/env python3
"""
file used to give the leave command functionality
for parking lot
"""
from functional_spec.spec.parking_lot import ParkingLot
if __name__ == "__main__":
command = "status"
extra_arguments = list()
ParkingLot(**{'command': command,
... | 1.914063 | 2 |
cad_calc.py | heieisch/process-control | 0 | 12764461 | import cadquery as cq
import numpy as np
from OCP.Standard import Standard_ConstructionError
def linear_milling_vol(cut, start_point, end_point, mill_diameter):
"""creates the volume that gets milled from linear move
Keyword arguments:
start_point -- [x,y,z] toolcentrepoint mm
end_point -- [x,y,z] to... | 2.515625 | 3 |
app/red-packet2.py | consoles/dsa4js | 2 | 12764462 | #!/usr/bin python
#coding:utf-8
#
# 发一个随机红包,100块钱给10个人。每个人最多18块钱,最少4块钱。怎么分?
# ref:https://segmentfault.com/q/1010000006002081?_ea=979811
#
# 问题转化:
# 每个人先分配4元,问题就转化为“60块分给10个人,每人不多于14元”
# 将2个限制变成了一个限制
import random
total = 100.0
MIN = 4
MAX = 18
PEOPLE_NUM = 10
result = [MIN for x in range(PEOPLE_NUM)] # 每人先分4块
base ... | 3.296875 | 3 |
XmasShowPi.py | ndrogness/XmasShowPi | 7 | 12764463 | <filename>XmasShowPi.py<gh_stars>1-10
#!/usr/bin/env python3
import os
import sys
import time
import datetime
import syslog
import random
import RogyAudio
import RogySequencer
# Global list of objects
STATE = {'DO_RUN': True, 'LIGHTS_ON': False, 'SHOW_IS_RUNNING': False, 'last_show_time_check_detail': 'Never checked'... | 2.265625 | 2 |
tests/test_models.py | mliu-dark-knight/RNNG | 2 | 12764464 | <gh_stars>1-10
import pytest
import torch
import torch.nn as nn
from nltk.tree import Tree
from torch.autograd import Variable
from rnng.actions import NT, REDUCE, SHIFT, get_nonterm
from rnng.models import DiscRNNG, EmptyStackError, StackLSTM, log_softmax
torch.manual_seed(12345)
class MockLSTM(object):
def __... | 2.265625 | 2 |
book_2/sql/11_sql.py | D-Mbithi/Real-Python-Course-Solutions | 1 | 12764465 | import sqlite3
with sqlite3.connect('new.db') as conn:
cursor = conn.cursor()
cursor.execute(
"""
SELECT population.city, population.population, regions.region
FROM population, regions
WHERE population.city = regions.city
"""
)
rows = cursor.fetchall()
for... | 4.25 | 4 |
icetea/utils.py | pedersor/google-research | 0 | 12764466 | <filename>icetea/utils.py
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# U... | 2.5 | 2 |
test/test_system.py | alexander-l-stone/RogueSpace | 0 | 12764467 | <filename>test/test_system.py
from source.system.system import System
from source.draw.entity.entity import Entity
from source.draw.area.area import Area
from source.action.action import Action
from source.action.resolution_functions import resolve_move_action
def test_can_instantiate_system():
"""
Test that s... | 2.609375 | 3 |
nosco/Nosco.py | kamyarg/nosco | 0 | 12764468 | <filename>nosco/Nosco.py
# -*- coding: utf-8 -*-
"""nosco v0.5 - semantic version manager
nōscō(/ˈnoːs.koː/ - in possession of knowledge)
Semantic Version(http://semver.org)
Manager Aims to provide a simple interface for
determining the build version of software
using rules privided in nosco.yaml
... | 2.265625 | 2 |
mnist/evolve-minimal-test.py | Jn58/neat-python | 0 | 12764469 | """
2-input XOR example -- this is most likely the simplest possible example.
"""
from __future__ import print_function
import neat
import multiprocessing
# 2-input XOR inputs and expected outputs.
xor_inputs = [(0.0, 0.0), (0.0, 1.0), (1.0, 0.0), (1.0, 1.0)]
xor_outputs = [ (0.0,), (1.0,), (1.0,), (0.0... | 3.265625 | 3 |
src/lib/epub/directory.py | knarfeh/SinaBlog2e-book | 9 | 12764470 | <filename>src/lib/epub/directory.py
# -*- coding: utf-8 -*-
from src.tools.path import Path
from .tools.base import Base
class Directory(Base):
def __init__(self):
Base.__init__(self)
self.chapter_deep = 0
return
def add_html(self, src, title):
template = self.get_template('di... | 2.984375 | 3 |
dxtorchutils/utils/__init__.py | Ian-Dx/DxTorchUtils | 4 | 12764471 | __all__ = ["train", "utils", "optimizers", "metrics", "layers", "blocks", "losses", "info_logger"]
from .train import *
from .utils import *
from .metrics import *
from .layers import *
from .blocks import *
| 1.203125 | 1 |
todo-app/quarkus-todo-app/docker_build.py | rajesh-kumar/spring-native-quarkus | 0 | 12764472 | <reponame>rajesh-kumar/spring-native-quarkus
#!/usr/bin/env python3
import argparse
import re
import subprocess
from pathlib import Path
import docker
def main():
parser = argparse.ArgumentParser(description='This is the docker image builder for quarkus-todo-app')
parser.add_argument("build_type", help="set... | 2.078125 | 2 |
display.py | anthonycurtisadler/ARCADES | 7 | 12764473 | <reponame>anthonycurtisadler/ARCADES
""" Module containing the Display class, which is used to display formatted notes
pylint rated 9.20/10
"""
from globalconstants import BOX_CHAR, MARGINFACTOR,\
DASH, BLANK, EOL, EMPTYCHAR, COLON, UNDERLINE, POUND, \
LEFTBRACKET, RIGHTBRACKET, SLASH
from generalu... | 3.15625 | 3 |
list_input_if_else_ex137.py | gsandoval49/stp | 0 | 12764474 | # an ex. of how you might use a list in practice
colors = ["green", "red", "blue"]
guess = input("Please guess a color:")
if guess in colors:
print ("You guessed correctly!")
else:
print ("Negative! Try again please.")
| 4.0625 | 4 |
scripts/download_files.py | karry3775/AutomatingTheBoringStuffWithPython | 0 | 12764475 | #!/usr/bin/env python
import requests
import argparse
from colorama import Fore
DEFAULT_URL = "https://automatetheboringstuff.com/files/rj.txt"
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--url", default=DEFAULT_URL, type=str)
parser.add_argument("--verbose", default=False)
... | 2.640625 | 3 |
Classification/SupportVectorMachine/regularSupportVectorMachine.py | a-holm/MachinelearningAlgorithms | 0 | 12764476 | # -*- coding: utf-8 -*-
"""Support Vector Machine (SVM) classification for machine learning.
SVM is a binary classifier. The objective of the SVM is to find the best
separating hyperplane in vector space which is also referred to as the
decision boundary. And it decides what separating hyperplane is the 'best'
because... | 4.0625 | 4 |
first.py | leo0123456/Smart-camera | 9 | 12764477 | <reponame>leo0123456/Smart-camera<gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'first.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
# from PyQt5.QtCore import QCoreAppl... | 2.1875 | 2 |
Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/windows/extractcontents.py | bidhata/EquationGroupLeaks | 9 | 12764478 | <reponame>bidhata/EquationGroupLeaks
import dsz, dsz.path, dsz.lp, dsz.file
import re, os, time
from optparse import OptionParser
results = []
results_dict = {}
def get_files(file_name, file_path):
try:
list_files = dsz.file.GetNames(str(file_name), str(file_path))
return list_files
except Exc... | 2.53125 | 3 |
test/unit_tests/test_cluster_group.py | globocom/enforcement | 7 | 12764479 | <gh_stars>1-10
from unittest import TestCase
from unittest.mock import patch
from app.domain.cluster_group import ClusterGroup
from app.domain.entities import Cluster
from app.domain.repositories import ClusterRepository, ProjectRepository
class ClusterGroupTestCase(TestCase):
def setUp(self) -> None:
se... | 2.453125 | 2 |
nwid/widget/base/scrollable.py | hbradleyiii/nwid | 0 | 12764480 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# name: scrollable.py
# author: <NAME>
# email: <EMAIL>
# created on: 06/08/2017
#
"""
nwid.widget.base.scrollable
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains the Scrollable mixin object that describes a buffer that
can be scr... | 3.0625 | 3 |
source/bazel/deps/backward_cpp/get.bzl | luxe/unilang | 33 | 12764481 | # Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def backwardCpp():
http_archive(
name="backward_cpp" ,
build_file="//bazel/deps/backward_cpp:build.BUILD" ,
sha256... | 1.398438 | 1 |
backend/cloud-run-api/app/models/upload.py | tuxedocat/fast-annotation-tool | 24 | 12764482 | from app.functions.firestore import is_doc_exist
from app.models.firestore import AnnotationTypeEnum
from typing import Any, Dict, List
from pydantic import BaseModel, ValidationError, root_validator, validator
from app.models.firestore import annot_cls_dict
class RequestTaskUpload(BaseModel):
task_id: str
an... | 2.390625 | 2 |
onelya_sdk/aeroexpress/reservation/__init__.py | tmconsulting/onelya-sdk | 6 | 12764483 | from onelya_sdk.utils import get_datetime, get_array, get_item, get_money
from onelya_sdk.wrapper.types import ProviderPaymentForm
from .requests import (OrderFullCustomerRequest, OrderCustomerDocuments, AeroexpressReservationRequest,
AeroexpressAutoReturnRequest)
from onelya_sdk.wrapper import (... | 2.125 | 2 |
src/datahandler.py | Pathi-rao/Image-Similarity-Estimation-using-Siamese-Neural-Networks | 2 | 12764484 | import torch
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import dataLoader as dl
"""
A function which creates train and valid dataloaders that can be iterated over.
To do so, you need to structure your data as follows:
root_dir
|_train
|_class_1
|_xxx.... | 3.21875 | 3 |
socialpy/server/rest/views.py | axju/socialpy | 1 | 12764485 | from rest_framework import viewsets
from socialpy.server.rest.serializers import CategorySerializer, PostSerializer, PostSerializerUrl
from socialpy.server.data.models import Category, Post
class CategoryViewSet(viewsets.ModelViewSet):
"""
Returns a list of all categorys in the db.
"""
queryset = Categ... | 2.46875 | 2 |
athena/authentication/migrations/0001_initial.py | antonyryan/athena-backend-Django- | 5 | 12764486 | # Generated by Django 2.1.7 on 2019-04-05 22:00
import uuid
import django.contrib.auth.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import athena.authentication.models
class Migration(migrations.Migration):
initial = True
dependenci... | 2.046875 | 2 |
main.py | evertonse/Custom-DL-Model-using-MNIST | 0 | 12764487 | from src.mnist import load_mnist_data
from src.Model import Model
import matplotlib.pyplot as plt
def test_prediction(index, data, model:Model):
current_image = data["inputs"][index]
y_predict = model.predict(current_image)[0]
prediction = (y_predict == y_predict.max()).astype(int)
guess = list(predict... | 3.203125 | 3 |
common/data_refinery_common/models/keywords.py | AlexsLemonade/refinebio | 106 | 12764488 | from django.db import models
class SampleKeyword(models.Model):
"""An ontology term associated with a sample in our database"""
name = models.ForeignKey("OntologyTerm", on_delete=models.CASCADE, related_name="+")
sample = models.ForeignKey("Sample", on_delete=models.CASCADE, related_name="keywords")
... | 2.171875 | 2 |
src/001-050/P011.py | lord483/Project-Euler-Solutions | 0 | 12764489 | <reponame>lord483/Project-Euler-Solutions<gh_stars>0
'''
Largest product in a grid
Problem 11
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 1... | 2.46875 | 2 |
News Summarizer/summarise.py | iamharshit/ML_works | 1 | 12764490 | <filename>News Summarizer/summarise.py
import keras #for ML
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM
from collections import Counter #for tokenisation
import cPickle as pickle #for Data Processing
#Loading Data
with open('data/%s.pkl'%'vo... | 2.59375 | 3 |
axisproj/linear.py | yarden-livnat/axisproj | 0 | 12764491 | import numpy as np
import nudged
from scipy.linalg import eig, sqrtm, norm
from .utils import adjust
def find_linear_projections(X, d, objective, iters=20):
n = X.shape[1]
objective.X = X
XBXT = adjust(objective.XBXT)
sqrtXBXT = np.real(sqrtm(XBXT))
projections = []
selected = []
C = np... | 2.046875 | 2 |
ffi/python/tests/test_read_display_memory_record.py | Wave-View-Imaging/citi | 0 | 12764492 | <filename>ffi/python/tests/test_read_display_memory_record.py
import unittest
import os
from pathlib import Path
from citi import Record
import numpy.testing as npt
class TestReadDisplayMemoryRecord(unittest.TestCase):
@staticmethod
def __get_display_memory_filename() -> str:
relative_path = os.path.... | 2.40625 | 2 |
script_files/DUMMY_report_fun.py | lucaghislo/GAPS-FEB-report-generator | 0 | 12764493 | <filename>script_files/DUMMY_report_fun.py
import re
import math
from unittest import case
from matplotlib import lines
import os
import textwrap
from fpdf import FPDF
import csv
import re
from datetime import date
# configuration import
def read_config_file():
counter = 0
lines = []
nation_letter = ""
... | 2.6875 | 3 |
scripts/expandvars.py | fgiorgetti/qdr-image | 0 | 12764494 | <reponame>fgiorgetti/qdr-image
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0... | 2.046875 | 2 |
spacy/tests/lang/id/test_prefix_suffix_infix.py | cedar101/spaCy | 12 | 12764495 | # coding: utf-8
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize("text", ["(Ma'arif)"])
def test_id_tokenizer_splits_no_special(id_tokenizer, text):
tokens = id_tokenizer(text)
assert len(tokens) == 3
@pytest.mark.parametrize("text", ["Ma'arif"])
def test_id_tokenizer_splits_n... | 2.5625 | 3 |
pytorch_generative/models/gated_pixel_cnn.py | eyalbetzalel/pytorch-generative-v6 | 0 | 12764496 | """Implementation of the Gated PixelCNN [1].
Gated PixelCNN extends the original PixelCNN [2] by incorporating ideas
motivated by the more effective PixelRNNs. The first extension is to use
GatedActivations (instead of ReLUs) to mimic the gated functions in RNN. The
second extension is to use a two-stream architectur... | 3.203125 | 3 |
pycryptoki/ca_extensions/object_handler.py | LudovicRousseau/pycryptoki | 24 | 12764497 | """
Module to work with objects, specifically dealing with ca_extension functions
"""
import logging
from ctypes import byref, cast, c_ubyte
from _ctypes import POINTER
from pycryptoki.attributes import to_byte_array
from pycryptoki.ca_extensions.session import ca_get_session_info_ex
from pycryptoki.cryptoki import C... | 2.4375 | 2 |
scripts/old_scripts/pickle_database.py | leszkolukasz/minimalistic_english_vocabulary_app | 0 | 12764498 | """
Export pickled dictionary
"""
import pickle
from source.database.database_entry import Entry
def export():
dictionary = set()
with open('final_dictionary.txt', 'r') as source, open('dictionary', 'wb') as destination:
for line in source:
word, frequency = line.split()
frequ... | 3.09375 | 3 |
odps/models/tasks.py | ZZHGit/aliyun-odps-python-sdk | 0 | 12764499 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Ap... | 1.851563 | 2 |
pl2.py | kwadrat/pl_py | 0 | 12764500 | #!/usr/bin/env python2
import common_pl
if __name__ == '__main__':
common_pl.main()
| 1.195313 | 1 |
desafios/des071.py | Ericssm96/python | 0 | 12764501 | print('~'*30)
print('<NAME>')
print('~'*30)
nt50 = nt20 = nt10 = nt1 = 0
saque = int(input('Quantos R$ deseja sacar?\n'))
resto = saque
while True:
if resto > 50:
nt50 = resto // 50
resto = resto % 50
print(f'{nt50} nota(s) de R$ 50.')
if resto > 20:
nt20 = resto // 20
r... | 3.40625 | 3 |
1070.py | TheLurkingCat/TIOJ | 0 | 12764502 | s = set(r"""~!@#$%^&*()_+|`-=\{}[]:";'<>?,./ """)
while True:
up = True
low = True
digit = True
special = True
a = input()
b = input()
t = len(a)
if a != b:
print('Password settings are not consistent.')
elif a == 'END':
break
else:
if not 8 <= t <= 12:
... | 3.65625 | 4 |
Foundation/pytestpractice/test_warn.py | youaresherlock/PythonPractice | 0 | 12764503 | #!usr/bin/python
# -*- coding:utf8 -*-
"""
@pytest.fixture注册成为一个fixture函数,来为测试用例
提供一个fixture对象
"""
import pytest
import make_warning
class TestWarns():
def test_make_warn(self):
with pytest.warns(DeprecationWarning):
make_warning.make_warn()
def test_not_warn(self):
with pytest.wa... | 2.1875 | 2 |
pytglib/api/types/reply_markup_remove_keyboard.py | iTeam-co/pytglib | 6 | 12764504 |
from ..utils import Object
class ReplyMarkupRemoveKeyboard(Object):
"""
Instructs clients to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent
Attributes:
ID (... | 2.59375 | 3 |
examples/pipelines/df_dup.py | akashshah59/disdat | 1 | 12764505 | #
# Copyright 2017 Human Longevity, 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 ... | 3.140625 | 3 |
pynads/abc/monad.py | justanr/gonads | 19 | 12764506 | <filename>pynads/abc/monad.py
from abc import abstractmethod
from .applicative import Applicative
class Monad(Applicative):
r"""Monads are probably the most misunderstood concept in Haskell.
All a monad truly means is that it's a context for a value that
provides a mechanism for interacting with that valu... | 3.40625 | 3 |
Contents/Libraries/Shared/guessit/rules/properties/title.py | jippo015/Sub-Zero.bundle | 1,553 | 12764507 | <gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
title property
"""
from rebulk import Rebulk, Rule, AppendMatch, RemoveMatch, AppendTags
from rebulk.formatters import formatters
from .film import FilmTitleRule
from .language import SubtitlePrefixLanguageRule, SubtitleSuffixLanguageRule, SubtitleExte... | 2.40625 | 2 |
Kalecgos/config.py | Raka-loah/Kalecgos | 1 | 12764508 | <filename>Kalecgos/config.py<gh_stars>1-10
base_url = 'http://127.0.0.1:5700' | 1.171875 | 1 |
tests/populate_db.py | widal001/flask-api-template | 0 | 12764509 | <reponame>widal001/flask-api-template
from app.models import db, Library, Book, LibraryBook
from tests.data import BOOKS, LIBRARIES, LIBRARY_BOOKS
def populate():
"""Populates the database with sample data"""
# create the library and book records
libraries = {name: Library(**data) for name, data in LIBRAR... | 3.140625 | 3 |
test.py | jdhxyy/cip | 0 | 12764510 | <gh_stars>0
import cip
def main():
case2()
def case1():
cip.set_lib_path()
cip.set_requirements()
def case2():
cip.set_lib_path('d:\\package\\clib')
cip.set_requirements('d:\\package\\requirements.txt')
cip.update()
def case3():
cip.update('https://github.com/jdhxyy/lagan-clang.git')... | 1.585938 | 2 |
backend/ventserver/integration/__init__.py | raavilagoo/Test | 1 | 12764511 | """Modules for integration between Sans-I/O protocols and I/O drivers.
Modules:
_trio: integration between Sans-I/O protocols and trio I/O.
"""
| 1.015625 | 1 |
objects/obj_address.py | pbryzek/Freedom | 0 | 12764512 | import string
class AddressObj(object):
hot_words = ["reo", "vacant", "foreclosure", "short sale", "fixer upper", "distressed property", "distressed owner", "probate sale", "divorce", "as is", "motivated seller", "handyman special", "investor special", "tlc", "needs work", "potential", "price reduction", "red... | 3.109375 | 3 |
chatbottest.py | genethurston5/zodacare1 | 8 | 12764513 | import sys
#print(sys.path)
sys.path.append('/home/pi/.local/lib/python3.7/site-packages')
import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
from keras.models import load_model
model = load_model('chatbot_model4.h5')
import json
import rando... | 2.71875 | 3 |
code/visualization/plot_heteroplasmy.py | vtphan/HeteroplasmyWorkflow | 1 | 12764514 | <filename>code/visualization/plot_heteroplasmy.py
from bokeh.models import HoverTool, NumeralTickFormatter, FuncTickFormatter, FixedTicker
from bokeh.models import ColumnDataSource, LabelSet, TapTool, Spacer
from bokeh.models import LinearColorMapper, Range1d, Circle
from bokeh.models.widgets import AutocompleteInpu... | 2.8125 | 3 |
scripts/complete_release.py | krossovochkin/FiberyUnofficial | 16 | 12764515 | <reponame>krossovochkin/FiberyUnofficial<filename>scripts/complete_release.py
import json
import requests
import sys
version = sys.argv[1]
token = sys.argv[2]
headers = {
'Content-Type': 'application/json',
'Authorization': f"Token {token}"
}
data = '''[
{
"command": "fibery.entity/query",
"args": {... | 2.328125 | 2 |
lista/models/item_lista_model.py | guiadissy/pcs3643-BE | 0 | 12764516 | # -*- coding: utf-8 -*-
from dao import db, Base
class ItemLista(Base):
__tablename__ = 'itenslistas'
lista_id = db.Column(db.Integer, db.ForeignKey('listas.id'), primary_key=True)
item_id = db.Column(db.Integer, db.ForeignKey('itens.id'), primary_key=True)
preco = db.Column(db.String(100))
item =... | 2.625 | 3 |
samples/django/echo/views.py | potykion/drel | 1 | 12764517 | from django.http import HttpResponse, HttpRequest, JsonResponse
from rest_framework.decorators import api_view
from rest_framework.request import Request
@api_view(["POST"])
def success_view(request: Request) -> HttpResponse:
return JsonResponse({"status": "success", "body": request.data.get("field")})
def serv... | 2.140625 | 2 |
empyres/query/tech.py | waigore/empyres4x | 0 | 12764518 | <reponame>waigore/empyres4x
from empyres.core.tech import *
from empyres.core.player.tech import PlayerTechTypes
from empyres.core.unit.ship import *
class QueryPlayerTechCanBuildShip(object):
BuildableShipTypes = {
ShipTypes.Colony: ShipSizeTechs.I,
ShipTypes.Battleship: ShipSizeTechs.V,
S... | 2.453125 | 2 |
myAlbum/apps.py | Vitalis-Kirui/My-Album | 0 | 12764519 | from django.apps import AppConfig
class MyalbumConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'myAlbum'
| 1.226563 | 1 |
data/ecom-visitor-logs.py | gaurav-aiml/ecommerece-data-pipeline | 2 | 12764520 | <reponame>gaurav-aiml/ecommerece-data-pipeline<filename>data/ecom-visitor-logs.py
#!/usr/bin/python
import time
import datetime
import pytz
import numpy as np
import random
import gzip
import zipfile
import sys
import argparse
from faker import Faker
from random import randrange
from tzlocal import get_localzone
local ... | 2.328125 | 2 |
vpuu/templatetags/parent_geo.py | OpenUpSA/wazimap-vpuu | 0 | 12764521 | from django import template
register = template.Library()
def get_parent_geo(geo_levels, geo):
"""
only return the parent geo for a particular geography
"""
compare_level = []
for level in geo["parents"]:
compare_level.append(level)
return compare_level[:2]
register.filter("parent_g... | 2.578125 | 3 |
modin/experimental/engines/omnisci_on_ray/frame/partition_manager.py | bruce-lam/Modin | 0 | 12764522 | <reponame>bruce-lam/Modin<gh_stars>0
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Versi... | 1.476563 | 1 |
modelrestore.py | bsivanantham/word2vec | 6 | 12764523 | import dill
import numpy as np
import tensorflow as tf
from collections import defaultdict
from sklearn.model_selection import train_test_split
with open('motion_capture_20181011-1931.dill', 'rb') as f:
x = dill.load(f)
vec = [l[4] for l in x]
# print(len(vec))
x = map(str, vec)
x = list(x)
#X_train, X_test = ... | 2.171875 | 2 |
python/imageDisp.py | h-nari/NetLCD | 0 | 12764524 | <reponame>h-nari/NetLCD
from sys import argv
import time
from PIL import Image
import netLcd
usage = '%s ip_addr image_files...'
wait_time = 2;
if len(argv) < 3:
print(usage % argv[0])
exit(1)
nd = netLcd.NetLcd(argv[1])
size = (nd.width, nd.height)
for i in range(2,len(argv)):
file = argv[i]
im = I... | 2.6875 | 3 |
home/Markus/Speech.Markus.MaleFemale.py | rv8flyboy/pyrobotlab | 63 | 12764525 | from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# create ear and mouth
ear = Runtime.createAndStart("ear","Sphinx")
mouth = Runtime.createAndStart("mouth","Speech")
mouth.setGoogleURI("http://thehackettfamily.... | 3.53125 | 4 |
scripts/npc/shammos2.py | G00dBye/YYMS | 54 | 12764526 | <filename>scripts/npc/shammos2.py
# Message from Shammos (2022006) | Shammos PQ
sm.sendNext("Haha! FOOLS! I have betrayed you and have unsealed Rex, the Hoblin King!") | 1.210938 | 1 |
src/zope/app/server/wsgi.py | zopefoundation/zope.app.server | 0 | 12764527 | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 1.78125 | 2 |
shop/admin.py | ilvar/lotien | 0 | 12764528 | <reponame>ilvar/lotien
from django.contrib import admin
from django_markdown.admin import MarkdownModelAdmin
from shop.models import Collection, Flower
admin.site.register(Collection)
admin.site.register(Flower, MarkdownModelAdmin)
| 1.273438 | 1 |
Web/__init__.py | zhmsg/dms | 0 | 12764529 | # encoding: utf-8
# !/usr/bin/python
from redis import Redis
from functools import wraps
from flask import session, g, make_response, Blueprint, jsonify, request, redirect
from flask_login import LoginManager, UserMixin, login_required
from Tools.Mysql_db import DB
from Function.Common import *
from dms.utils.manager... | 2.109375 | 2 |
csv_schema/columns/base.py | TMiguelT/csvschema | 0 | 12764530 | <filename>csv_schema/columns/base.py<gh_stars>0
# -*- coding: utf-8 -*-
from builtins import object
import re
from csv_schema.exceptions import ImproperValueException
class BaseColumn(object):
"""Base for all column classes."""
value_template = '' # Schema of stored value
improper_type_error_msg = u'... | 3.078125 | 3 |
main.py | jabandersnatch/polebuilder | 0 | 12764531 | <gh_stars>0
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from Environment.test.physics_test import Test_Environment
from Train.train import TrainDDPGAgent
from Train.auto_train import ddpg_auto_train
import argparse
parser = argparse.ArgumentParser(description='The main file can recieve a number of arguments')
... | 2.203125 | 2 |
comparison_algorithm/tests/test_linking.py | diggr/game_title_utils | 4 | 12764532 | import pytest
import Levenshtein as lev
from ..comp import cmp_titles
from ..helpers import std
from ..config import *
#test linking by titles
@pytest.mark.parametrize(
"titles1, titles2, output",
[
(
[
"Resident Evil 2",
"Biohazard 2"
],
... | 2.4375 | 2 |
integration/test_operations.py | exhuma/fabric | 1 | 12764533 | <reponame>exhuma/fabric<filename>integration/test_operations.py
from __future__ import with_statement
from StringIO import StringIO
from fabric.api import run, path, put, sudo, abort, warn_only, env
from util import Integration
def assert_mode(path, mode):
assert run("stat -c \"%%a\" %s" % path).stdout == mode... | 2.015625 | 2 |
src/Controller.py | victorhenriquetx/mc861-nesemulator | 1 | 12764534 | <reponame>victorhenriquetx/mc861-nesemulator
ButtonA, ButtonB, ButtonSelect, ButtonStart, ButtonUp, ButtonDown, ButtonLeft, ButtonRight = range(8)
class Controller:
def __init__(self):
self.buttons = [False for _ in range(8)]
self.index = 0
self.strobe = 0
def set_buttons(self, butt... | 3.21875 | 3 |
rnn/data.py | flaviuvadan/tf-shakespeare | 0 | 12764535 | """ Holds the Data class """
import tensorflow as tf
import rnn
class Data:
""" Train holds functions responsible for producing training examples from Shakespearian text """
@staticmethod
def get_sequences():
"""
Returns batch sequences of the training text
:return: [sequences]
... | 3.890625 | 4 |
alt_bn128.py | meilof/python-libsnark | 9 | 12764536 | <filename>alt_bn128.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7... | 2.15625 | 2 |
src/main.py | saurabhkoshatwar/Intelligent-Home-Assistant | 0 | 12764537 | <filename>src/main.py<gh_stars>0
from flask import Flask
import RPi.GPIO as GPIO
app = Flask(__name__)
pin = 33
# Setup
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(pin,GPIO.OUT)
@app.route('/turnon', methods=['GET'])
def turnon():
# To turn on pin
GPIO.output(pin,GPIO.HIGH)
... | 2.96875 | 3 |
preprocess/pre-coco-data-format.py | gbegkas/Detectron | 0 | 12764538 | import os
from shutil import copyfile
from shutil import move
from random import randint
source = "/home/vegas/CBIS-DDSM"
destination = "/home/vegas/CBIS-DDSM-COCO_format"
train = os.path.join(destination, 'train')
test = os.path.join(destination, 'test')
val = os.path.join(destination, 'validation')
os.mk... | 2.21875 | 2 |
class7/json-vid-4-cmds.py | brutalic/pynet_brutal | 0 | 12764539 | <filename>class7/json-vid-4-cmds.py<gh_stars>0
#!/usr/bin/python
import jsonrpclib
import time
import ssl
from pprint import pprint
ssl._create_default_https_context = ssl._create_unverified_context
ip = '172.16.17.32'
port = '443'
username = 'admin1'
password = '<PASSWORD>'
switch_url = 'https://{}:{}@{}:{}'.for... | 2.0625 | 2 |
DQM/L1TMonitor/python/L1TdeStage2BMTFSecond_cff.py | SWuchterl/cmssw | 6 | 12764540 | import FWCore.ParameterSet.Config as cms
# the Emulator kBMTF DQM module
from DQM.L1TMonitor.L1TdeStage2BMTF_cfi import *
# compares the unpacked BMTF2 regional muon collection to the emulated BMTF2 regional muon collection (after the TriggerAlgoSelector decide which is BMTF2)
# Plots for BMTF
l1tdeStage2BmtfSecond =... | 1.75 | 2 |
antipetros_discordbot/auxiliary_classes/asking_items.py | official-antistasi-community/Antipetros_Discord_Bot | 0 | 12764541 | <filename>antipetros_discordbot/auxiliary_classes/asking_items.py<gh_stars>0
"""
[summary]
[extended_summary]
"""
# region [Imports]
# * Standard Library Imports ------------------------------------------------------------------------------------------------------------------------------------>
import gc
import os
... | 1.929688 | 2 |
lib/PyAMF-0.7.2/pyamf/tests/test_gateway.py | MiCHiLU/google_appengine_sdk | 87 | 12764542 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
General gateway tests.
@since: 0.1.0
"""
import unittest
import sys
import pyamf
from pyamf import remoting
from pyamf.remoting import gateway, amf0
class TestService(object):
def spam(self):
return 'spam'
def echo(self, x):
... | 2.3125 | 2 |
run_model_selection.py | asmyoo/MSAP | 1 | 12764543 | <reponame>asmyoo/MSAP<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Model selection running script.
Authors:
<NAME> - <EMAIL>
Todo:
* include reformat.
* I don;t like preprocessor...
* Help for clicks
"""
import os
import pickle
import logging
import numpy as np
import pandas as pd
from tqdm import tqdm
... | 2.28125 | 2 |
submissions/Tyson/mySearches.py | dysomni/aima-python | 0 | 12764544 | <reponame>dysomni/aima-python<filename>submissions/Tyson/mySearches.py
import search
from math import(cos, pi)
# A sample map problem
#sumner_map = search.UndirectedGraph(dict(
# Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
# Cottontown=dict(Portland=18),
# Fairfield=dict(Mitchellville=21, Por... | 2.578125 | 3 |
2015-09-23-2048/marko/twozerofoureight.py | EIK-LUG/CodeClubPython | 2 | 12764545 | from arrows import Arrow
from random import randrange
import os
def cls():
os.system(['clear','cls'][os.name == 'nt'])
class board:
board_list = []
def __init__(self):
for i in range(0,4):
self.board_list.append([0,0,0,0])
def move_left_right(self,direction):
for n in range(len(self.board_list)):
s... | 3.65625 | 4 |
rowpack/ingest.py | CivicKnowledge/rowpack | 0 | 12764546 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
"""
Try to automatically ingest row data from a URL into a Rowpack file.
"""
from . import RowpackWriter, RowpackReader, intuit_rows, intuit_types, run... | 2.546875 | 3 |
pybloom_pyqt/test_pybloom.py | kiteco/python-bloomfilter | 2 | 12764547 | <reponame>kiteco/python-bloomfilter
from __future__ import absolute_import
from .pybloom import (BloomFilter, ScalableBloomFilter,
make_hashfuncs)
from .utils import running_python_3, range_fn
try:
import StringIO
import cStringIO
except ImportError:
pass
import io
impor... | 2.28125 | 2 |
network/model_keras.py | kxvrh/GomokuAI | 4 | 12764548 | from core import GameConfig as Game
from core import Board
from config import TRAINING_CONFIG
from keras import Sequential, Model, Input
from keras.layers import InputLayer
from keras.layers.core import Activation, Dense, Flatten
from keras.layers.convolutional import Conv2D
from keras.layers.merge import Add
from kera... | 2.703125 | 3 |
binary_search.py | larion/algorithm-yoga | 0 | 12764549 | #! /usr/bin/python
def binary_search(lst, item):
""" Perform binary search on a sorted list.
Return the index of the element if it is in
the list, otherwise return -1.
"""
low = 0
high = len(lst) - 1
while low < high:
middle = (high+low)/2
current = lst[middle]
if c... | 4.1875 | 4 |
utils/calMeanStd.py | shakex/recurrent-decoding-cell | 3 | 12764550 | <filename>utils/calMeanStd.py
import os
import numpy as np
import scipy.misc as m
from loader import get_loader
from os.path import join as pjoin
m1_mean = []
m2_mean = []
m3_mean = []
m1_std = []
m2_std = []
m3_std = []
data_loader = get_loader("NeoBrainS12")
data_path = "/home/jwliu/disk/kxie/CNN_LSTM/dataset/neob... | 2.46875 | 2 |