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 |
|---|---|---|---|---|---|---|
aioscrapy/middleware/middleware_Itempipeline.py | conlin-huang/aio-scrapy | 13 | 12787351 | <reponame>conlin-huang/aio-scrapy
import logging
from scrapy.utils.conf import build_component_list
from .middleware import MiddlewareManager
logger = logging.getLogger(__name__)
class ItemPipelineManager(MiddlewareManager):
component_name = 'item pipeline'
@classmethod
def _get_mwlist_... | 2.1875 | 2 |
tbcompanion/main/forms.py | GiorginoSerbuciano/techbasicscompanion | 0 | 12787352 | from flask_wtf.form import FlaskForm
from wtforms.fields.core import StringField
from wtforms.fields.simple import SubmitField
from wtforms.validators import DataRequired
class SearchBox(FlaskForm):
"""Placeholder for a future implementation"""
string = StringField('Search for a post, user or project', validators=... | 2.609375 | 3 |
tests/formats/dataclass/parsers/test_xml.py | pashashocky/xsdata | 0 | 12787353 | <reponame>pashashocky/xsdata
from unittest import mock
from tests.fixtures.books import Books
from xsdata.formats.dataclass.models.elements import XmlType
from xsdata.formats.dataclass.parsers.nodes import PrimitiveNode
from xsdata.formats.dataclass.parsers.nodes import SkipNode
from xsdata.formats.dataclass.parsers.x... | 2.390625 | 2 |
modules/module1/Week1/5_fofin_interactive.py | tetov/ITA19 | 7 | 12787354 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
import compas_rhino
from compas.utilities import geometric_key
from fofin.shell import Shell
from fofin.shellartist import ShellArtist
from compas_rhino.selectors import VertexSelector
from compas_... | 1.578125 | 2 |
[1] BEGINNER/2708 - Turistas no Parque Huacachina.py | tiago040/URI-SOLUTIONS | 1 | 12787355 | '''
A agência de turismo municipal da cidade de Ica, no Peru montou um posto de controle de jipes de aventura que sobem para as dunas do parque Hucachina. Como durante o dia, são vários os off-roads que sobem e descem do parque nacional, e nem sempre os turistas usam um mesmo transporte para a ida e volta, a prefeitura... | 3.515625 | 4 |
kalliope/core/ShellGui.py | joshuaboniface/kalliope | 1 | 12787356 | # coding: utf8
import locale
import logging
from dialog import Dialog
from kalliope.core import OrderListener
from kalliope.core.ConfigurationManager import SettingLoader
from kalliope.core.SynapseLauncher import SynapseLauncher
from kalliope.neurons.say.say import Say
logging.basicConfig()
logger = logging.getLogg... | 2.375 | 2 |
src/edges_cal/cli.py | edges-collab/edges-cal | 0 | 12787357 | """CLI functions for edges-cal."""
import click
import papermill as pm
import yaml
from datetime import datetime
from nbconvert import PDFExporter
from pathlib import Path
from rich.console import Console
from traitlets.config import Config
from edges_cal import cal_coefficients as cc
console = Console()
main = clic... | 1.953125 | 2 |
Donation/moneymovement_test.py | arnoldcheung/porticode3 | 0 | 12787358 | #
# SPDX-Copyright: Copyright 2018 Capital One Services, LLC
# SPDX-License-Identifier: MIT
# Copyright 2018 Capital One Services, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without ... | 2.078125 | 2 |
coala_json/reporters/cli/cli.py | chay2199/coala-json | 0 | 12787359 | <reponame>chay2199/coala-json<gh_stars>0
import os
import argparse
import sys
from coala_json.reporters.ReporterFactory import ReporterFactory
from coala_json.loader.coalaJsonLoader import coalaJsonLoader
from coala_json.reporters.AppveyorReporter import AppveyorReporter
def get_path(filepath):
return os.path.jo... | 2.53125 | 3 |
examples/TfcBook/Chapter_3/Problem_8.py | leakec/tfc | 15 | 12787360 | import jax.numpy as np
from tfc import mtfc
from tfc.utils import egrad, NLLS
from tfc.utils.PlotlyMakePlot import MakePlot
# Constants:
n = [40,40]
nC = [2,[1,2]]
m = 40
r0 = 2.
rf = 4.
th0 = 0.
thf = 2.*np.pi
realSoln = lambda r,th: 4.*(-1024.+r**10)*np.sin(5.*th)/(1023.*r**5)
# Create TFC class:
myTfc = mtfc(n,n... | 1.828125 | 2 |
SaintsServer/team.py | johnsextro/saintsApp | 0 | 12787361 | <reponame>johnsextro/saintsApp
from google.appengine.ext import db
import logging
import string
package = 'SaintsSchedule'
class Team(db.Model):
teamId = db.StringProperty()
coach = db.StringProperty()
school = db.StringProperty()
grade = db.StringProperty()
year = db.IntegerProperty()
schedule = db.TextPropert... | 2.90625 | 3 |
truth.py | kirichoi/NSSR | 0 | 12787362 | # -*- coding: utf-8 -*-
# COPYRIGHT 2017 <NAME>
# Truth network model analysis
from __future__ import print_function
import numpy as np
import tellurium as te
import antimony
import generate
import util
import clustering
def classify(setup, s_arr, c_arr):
"""
Ground truth classification. Returns initial per... | 2.609375 | 3 |
coding_intereview/merge_interval.py | purusharthmalik/Python-Bootcamp | 2 | 12787363 | <reponame>purusharthmalik/Python-Bootcamp
def insert(intervals, new_interval):
n = len(intervals)
start, end = 0, 0
while end < n:
if new_interval[0] <= intervals[end][1]:
if new_interval[1] < intervals[end][0]:
break
new_interval[0] = min(new_interval[0], in... | 3.875 | 4 |
zenithml/torch/layers/__init__.py | zenith-ml/zenithml | 0 | 12787364 | from zenithml.torch.layers.preprocess.numerical import NumericalLayer
from zenithml.torch.layers.preprocess.normalizers import MinMaxNormalizeLayer, LogNormalizeLayer, BucketizedLayer
from zenithml.torch.layers.preprocess.nhotencoder import NHotEncodingLayer
from zenithml.torch.layers.preprocess.embedding import Embedd... | 1.421875 | 1 |
stock_report/analysis.py | pfeiffer-dev/stock-report | 0 | 12787365 | <filename>stock_report/analysis.py<gh_stars>0
# analysis.py
# stock-report
# Copyright 2022 <NAME>
# MIT License
import os
import plotly.express as px
import pandas as pd
class ANALYSIS:
def __init__(self, data):
"""
Inherit ANALYSIS class with its default arguments.
"""
self.data... | 3 | 3 |
assignment1.py | walter2645-cmis/walter2645-cmis-cs2 | 0 | 12787366 | myName = "Walter"#defines myName
myAgeinYears = 19.1#defines myAgeinYears
myHeightinMeters = 1.73#defines myHeightinMeters
sideofsquare = 1#defines sideofsquare
lengthofrectangle = 2#defines lengthofrectangle
heightofrectangle = 3#defines heightofrectangle
myAgeinMonths = myAgeinYears*12#calculates myAgeinMonths using ... | 3.890625 | 4 |
py_moysklad/entities/meta_entity.py | upmarket-cc/py_moysklad | 0 | 12787367 | <filename>py_moysklad/entities/meta_entity.py
from typing import Optional
from py_moysklad.entities.entity import Entity
from py_moysklad.entities.meta import Meta
class MetaEntity(Entity):
id: Optional[str] # noqa: VNE003
account_id: Optional[str]
name: Optional[str]
meta: Optional[Meta]
| 1.851563 | 2 |
dic_maps.py | fraglord94/hackerrank-solutions | 0 | 12787368 | <reponame>fraglord94/hackerrank-solutions
n =int(input())
d = dict(input().split() for _ in range(n))
for _ in d:
str_1 = str(input())
if(str_1 in d):
print(str_1+"="+d[str_1])
else:
print('Not found')
| 3.65625 | 4 |
eap_radius_test/scripts/gen_conf_kem.py | crest42/hostapd | 0 | 12787369 | import sys
from jinja2 import Environment, FileSystemLoader
from os import path, makedirs, getcwd
curves = []
curves_string = ""
PQ_L1_CURVES = ["bike1l1cpa", "bike1l1fo",
"frodo640aes", "frodo640shake",
"hqc128_1_cca2",
"kyber512", "kyber90s512",
"ntru_hps20... | 2.015625 | 2 |
Ch1-Arrays-and-Strings/05_one_away.py | fatima-rizvi/CtCI-Solutions-6th-Edition | 0 | 12787370 | # There are 3 types of edits that can be made on a string, insert a character, replace a character, or remove a character.
# Check how many edits were made. Return True if the two strings are 0 to 1 edits apart.
def one_away(str1, str2):
edits = 0
dif = len(str1) - len(str2)
if abs(dif) > 1:
return False
... | 3.9375 | 4 |
nnet/separate.py | on1262/conv-tasnet | 149 | 12787371 | <gh_stars>100-1000
#!/usr/bin/env python
# wujian@2018
import os
import argparse
import torch as th
import numpy as np
from conv_tas_net import ConvTasNet
from libs.utils import load_json, get_logger
from libs.audio import WaveReader, write_wav
logger = get_logger(__name__)
class NnetComputer(object):
def _... | 1.953125 | 2 |
leetcode-python/num056.py | shuaizi/leetcode | 0 | 12787372 | __author__ = 'shuai'
# Definition for an interval.
class Interval(object):
def __init__(self, s=0, e=0):
self.start = s
self.end = e
def __str__(self):
return str(self.start) + "-" + str(self.end)
class Solution(object):
def merge(self, intervals):
"""
:type interv... | 3.796875 | 4 |
tests/test_solvers_rt1d_const_flux.py | jlashner/ares | 0 | 12787373 | """
test_const_ionization.py
Author: <NAME>
Affiliation: University of Colorado at Boulder
Created on: Thu Oct 16 14:46:48 MDT 2014
Description:
"""
import ares
import numpy as np
import matplotlib.pyplot as pl
from ares.physics.CrossSections import PhotoIonizationCrossSection as sigma
s_per_yr = ares.physics.Co... | 1.75 | 2 |
PythonFiles/SUWSS/dataCollection.py | VijayS02/Random-Programming-Items | 0 | 12787374 | import scipy.io
import numpy as np
import sys
import os.path
import matplotlib.pyplot as plt
trans = [139.62,119.43,36.48,14.5]
mdata = []
def avgWaveSpeed(data,ampStart,ampEnd,freq,transducers,index1,index2):
total = 0
count = 0
print(data)
zer = highestPoint(data,ampStart,0)[0]
tz = np.arange(a... | 2.640625 | 3 |
Server/sputnik.py | SergeyMakeev/Sputnik | 2 | 12787375 | <filename>Server/sputnik.py
# coding=utf-8
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import urlparse
import os
import traceback
import datetime
import math
from stat import *
import json
import urllib2
import gzip
import StringIO
import struct
# encode binary string to ascii string
def binary_enco... | 3.078125 | 3 |
projects/fred-snyder-examples/send-emails-csv-with-smtp/test-smtp-server.py | fred-snyder/notes-on-python | 1 | 12787376 | <reponame>fred-snyder/notes-on-python
import smtplib, ssl
# import smtp_server, port, login, password
import production_config
# Create SSL context
context = ssl.create_default_context()
# test the smtp server
try:
server = smtplib.SMTP(smtp_server,port)
server.ehlo()
server.starttls(context=context)
... | 2.453125 | 2 |
apps/menuplans/apps.py | jajadinimueter/recipe | 0 | 12787377 | from django.apps import AppConfig
class MenuplansConfig(AppConfig):
name = 'menuplans'
verbose_name = 'Menuplans'
| 1.046875 | 1 |
bikes_prediction/bikesmtl/api.py | cheer021/BikesPrediction_DP | 0 | 12787378 | <filename>bikes_prediction/bikesmtl/api.py
# from rest_framework import generics, permissions
# from .models import Station, StationDataNow
# from .serializers import StationSerializer, StationDataNowSerializer
# class StationList(generics.ListCreateAPIView):
# model = Station
# serializer_class = StationSeri... | 2.28125 | 2 |
notify_by_email.py | hysds/lightweight-jobs | 0 | 12787379 | #!/usr/bin/env python
import os
import getpass
import requests
import json
import base64
import socket
from smtplib import SMTP
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.header import Header
from email.utils import parseaddr, for... | 2.421875 | 2 |
exercicios_curso_em_video/Exercicio 69.py | Sposigor/Caminho_do_Python | 1 | 12787380 | m = f = maiores = 0
while True:
print('=' * 20)
print('CADASTRE UMA PESSOA')
print('=' * 20)
idade = int(input('Digite a sua Idade:'))
while idade < 1 or idade > 120:
print('Você digitou uma idade inválida, digite a sua idade novamente')
idade = int(input('Digite a sua Idade :'))
... | 4.03125 | 4 |
utils.py | t3kv/DCKM | 7 | 12787381 | <gh_stars>1-10
from sklearn.model_selection import StratifiedShuffleSplit
from scipy.sparse import csr_matrix
import numpy as np
import os
from collections import Counter
import tensorflow as tf
import datetime
import inspect
import gc
# DEFAULT SETTINGS
_NOW = datetime.datetime.now()
_DATETIME = str(_NOW.year) + '-'... | 2.25 | 2 |
src/ecr/core/manager.py | eXceediDeaL/edl-coderunner | 1 | 12787382 | <reponame>eXceediDeaL/edl-coderunner
# pylint: disable=W0611
from ._manager import getSystemCommand
from ._WorkItem import WorkItem, WorkItemType, initializeCodeDirectory
from ._WorkManager import WorkManager, WorkManagerState, hasInitialized, initialize, clear, load
from ._Runner import runCommands
| 1.070313 | 1 |
end2end/soloist/experiment_management/ems.py | boliangz/dstc9 | 17 | 12787383 | <filename>end2end/soloist/experiment_management/ems.py
# experiment management system
import argparse
import logging
import os
import subprocess
import json
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=logging.INFO)
logg... | 2.03125 | 2 |
scvi/models/vaec.py | maxime1310/fuzzy_labeling_scRNA | 8 | 12787384 | import torch
from torch.distributions import Normal, Categorical, kl_divergence as kl
from scvi.models.classifier import Classifier
from scvi.models.modules import Encoder, DecoderSCVI
from scvi.models.utils import broadcast_labels
from scvi.models.vae import VAE
class VAEC(VAE):
r"""A semi-supervised Variationa... | 2.375 | 2 |
Packages/matplotlib-2.2.2/lib/mpl_examples/userdemo/demo_gridspec02.py | NightKirie/NCKU_NLP_2108_industry3 | 1 | 12787385 | """
===============
Demo Gridspec02
===============
"""
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
def make_ticklabels_invisible(fig):
for i, ax in enumerate(fig.axes):
ax.text(0.5, 0.5, "ax%d" % (i+1), va="center", ha="center")
ax.tick_params(labelbottom=False, labe... | 3.328125 | 3 |
pycaw/api/mmdeviceapi/depend/structures.py | Jan-Zeiseweis/pycaw | 234 | 12787386 | <gh_stars>100-1000
from ctypes import Structure, Union
from ctypes.wintypes import (
DWORD, LONG, LPWSTR, ULARGE_INTEGER, VARIANT_BOOL, WORD)
from comtypes import GUID
from comtypes.automation import VARTYPE, VT_BOOL, VT_CLSID, VT_LPWSTR, VT_UI4
from future.utils import python_2_unicode_compatible
class PROPVARI... | 1.984375 | 2 |
web/templatetags/sortable_column.py | winny-/sillypaste | 3 | 12787387 | from django import template
register = template.Library()
@register.inclusion_tag('sortable_column_snippet.html')
def sortable_column(request, pretty_name, identifier, default=False):
current = request.GET.get('sort', identifier if default else None)
return {
'pretty_name': pretty_name,
'ide... | 2.171875 | 2 |
organizer/__main__.py | darkanakin41/media-organizer | 1 | 12787388 | <filename>organizer/__main__.py
from typing import List
import click
from organizer import config
from organizer.model.media import Media
from organizer.util.arguments import is_option
from organizer.util.logger import logger
from organizer.util.scanner import scan_folder
from prettytable import PrettyTable
... | 2.625 | 3 |
CSV_build_GUI.py | sassystacks/Brisco_Devel | 0 | 12787389 | <reponame>sassystacks/Brisco_Devel<filename>CSV_build_GUI.py<gh_stars>0
from Tkinter import *
class Application(Frame):
def Build_CSV(self):
dt_selected = self.var1.get()
print(dt_selected)
try:
indx_date = self.lst1.index(dt_selected)+1
print(indx_date)
exce... | 2.640625 | 3 |
savegame.py | ronanpaixao/SkyAlchemy | 0 | 12787390 | # -*- coding: utf-8 -*-
"""
SkyAlchemy
Copyright ©2016 <NAME>
Licensed under the terms of the MIT License.
See LICENSE for details.
@author: <NAME>
"""
from __future__ import unicode_literals
import struct
from collections import OrderedDict
from io import BytesIO
import os
import os.path as osp
import ctypes
impor... | 2.203125 | 2 |
test/test_basic_flow_rpm.py | Albatrosina/dev | 0 | 12787391 | <filename>test/test_basic_flow_rpm.py
# -*- coding: utf-8 -*-
from dev.model.fill_row import Filling
def test_r_p_m_accept(app):
app.action.switch_to_rpm_tab()
app.fill.corn(Filling(bt="20000", fp="5", hta="1", spread="1", roll="1", flex="1", basis="1", note="some test note"))
app.action.confirm_targets_r... | 1.671875 | 2 |
drawingClass.py | crealu/py-writing | 0 | 12787392 | <reponame>crealu/py-writing
import turtle
from turtle import *
import random
turtle.colormode(255)
bw = [
[29, 255],
[208, 255],
[236, 255]
]
rw = [
[234, 255],
[6, 255],
[6, 255]
]
gw = [
[47, 255],
[245, 255],
[108, 255]
]
yw = [
[249, 255],
[243, 255],
[44, 255]
]... | 2.765625 | 3 |
mpu6050/__init__.py | streamnsight/mpu6050 | 0 | 12787393 | from .mpu6050 import mpu6050
from .mpu6050 import utils_3d | 1.039063 | 1 |
setup.py | PythonCHB/NumpyExtras | 0 | 12787394 | #!/usr/bin/env python
try:
from setuptools import setup, Extension
except ImportError:
print "You need setuptools to build this module"
from Cython.Build import cythonize
import numpy as np #for the include dirs...
#import os, sys
include_dirs = [np.get_include()]
ext_modules = cythonize(Extension("numpy_e... | 1.757813 | 2 |
text2cc/gui/tk.py | dlehman83/text2cc | 1 | 12787395 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021, <NAME>
# Copyright (c) 2020, <NAME>
# All rights reserved.
#
# Licensed under the BSD 3-Clause License:
# http://opensource.org/licenses/BSD-3-Clause
#
import os
import pathlib
import shutil
import time
import tkinter as tk
import tkinter.filedialog
import webbrowser
fr... | 3.109375 | 3 |
median-of-two-sorted-arrays/main.py | hotpxl/code-forces | 0 | 12787396 | <filename>median-of-two-sorted-arrays/main.py
class Solution(object):
def isMedian(self, nums1, nums2, i):
j = (len(nums1) + len(nums2) - 1) / 2 - i
if len(nums2) == 0:
if j == 0:
return 0
if j < 0:
return 1
if 0 < j:
... | 3.796875 | 4 |
app/manager.py | actini/storage-manager | 0 | 12787397 | from flask import Flask, request, jsonify
from services import MongoDBService
app = Flask(__name__)
@app.route("/")
def root():
return "Welcome to Storage Manager!"
@app.route("/health")
def health():
return "ok"
@app.route("/databases", methods=["GET"])
def all_databases():
databases = MongoDBService(... | 2.984375 | 3 |
Exercises/Registration101.py | kmader/qbi-2019-py | 2 | 12787398 | #!/usr/bin/env python
# coding: utf-8
# # Registration 101
#
# Image registration is a critical tool in longitudinal monitoring:
#
# - Estimation of local changes
# - Comparison to same animal (less variance)
# - [3R's](https://www.nc3rs.org.uk/the-3rs)
#
#
#
# ## Goal of tutorial:
# - Introduce the concept of aligni... | 3.421875 | 3 |
Grade 7/Lesson 28/sender.py | arm-university/ASP_International-Intro-to-Computing | 0 | 12787399 | # Add your Python code here. E.g.
#radio 1
from microbit import *
import radio
radio.on()
# any channel from 0 to 100 can be used for privacy.
radio.config(channel=5)
while True:
if button_a.was_pressed():
radio.send('HAPPY')
sleep(200)
elif button_b.was_pressed():
radio.send('SAD')
... | 3.125 | 3 |
build/lib/SciDataTool/Methods/DataLinspace/get_axis_periodic.py | enjoyneer87/SciDataTool | 24 | 12787400 | from SciDataTool.Functions import AxisError
from SciDataTool.Classes.Norm_vector import Norm_vector
def get_axis_periodic(self, Nper, is_aper=False):
"""Returns the vector 'axis' taking symmetries into account.
Parameters
----------
self: DataLinspace
a DataLinspace object
Nper: int
... | 3.28125 | 3 |
ic/settings/dev.py | shoorday/IC | 2 | 12787401 | from .base import *
# 开发环境
DEBUG = True
SECRET_KEY = '<KEY>'
# debug_toolbar
INTERNAL_IPS = ['127.0.0.1', ]
SITE_HOST = 'http://127.0.0.1:8000'
FRONT_HOST = 'http://127.0.0.1:8080'
# Github登录
GITHUB_APP_KEY = 'xxxxx'
GITHUB_APP_SECRET = 'xxxxx'
| 1.359375 | 1 |
buildmenuviews/login_menu.py | acadianshadow237/BA_MDI1 | 0 | 12787402 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'login.ui'
##
## Created by: Qt User Interface Compiler version 6.1.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#####################... | 1.851563 | 2 |
pymagnitude/third_party/allennlp/modules/token_embedders/token_characters_encoder.py | tpeng/magnitude | 1,520 | 12787403 | <filename>pymagnitude/third_party/allennlp/modules/token_embedders/token_characters_encoder.py
from __future__ import absolute_import
import torch
from allennlp.common import Params
from allennlp.data.vocabulary import Vocabulary
from allennlp.modules.token_embedders.embedding import Embedding
from allennlp.modules.s... | 2.421875 | 2 |
161019/test/8-tests.py | yeputons/fall-2016-paradigms | 1 | 12787404 | tests = []
inout = (
("\n", ""),
("set 123\n0\n",
["lock guard", "get flag", "set flag 1", "set result 123", "unlock guard"],
["lock guard", "get flag", "set result 123", "set flag 1", "unlock guard"]
),
("set 123\n1\n", ["lock guard", "get flag", "unlock guard"]),
("get\n0\n", [... | 2.75 | 3 |
mapping_parenting_tech/analysis/prototyping/archived/initial-play-store-analysis.py | nestauk/mapping_parenting_tech | 0 | 12787405 | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# comment_magics: true
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.8
# kernelspec:
# display_name: Python 3
# lang... | 2.375 | 2 |
lib/googlecloudsdk/command_lib/tasks/app.py | kustodian/google-cloud-sdk | 0 | 12787406 | <filename>lib/googlecloudsdk/command_lib/tasks/app.py
# -*- coding: utf-8 -*- #
# Copyright 2017 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:/... | 2.09375 | 2 |
cloud2015-1/cloudTrabajo/ArrRef.py | paurisg/U | 0 | 12787407 | <reponame>paurisg/U<gh_stars>0
class ArrRef:
def __init__(self, A):
self.A = A
self.N = len(self.A)
def get(self,i):
if(i < self.N):
return self.A[i]
def getF(self):
if(len(self.A) == 2):
return self.A[0]
def getS(self):
if(len(self.A) == 2):
return self.A[1]
def eBitsExec(self,w):
return ... | 2.875 | 3 |
openstack/tests/functional/network/v2/test_sfc_port_chain.py | gthiemonge/openstacksdk | 0 | 12787408 | # 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 writing, software
# distributed under t... | 1.78125 | 2 |
tests/Unit/PointwiseFunctions/GeneralRelativity/IndexManipulation.py | nilsvu/spectre | 117 | 12787409 | <reponame>nilsvu/spectre
# Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
def raise_or_lower_first_index(tensor, metric):
return np.einsum("ij,ikl", metric, tensor)
def trace_last_indices(tensor, metric):
return np.einsum("ij,kij", metric, tensor)
| 2.15625 | 2 |
Code/Multiply_two_numbers.py | satyambharti171/Python-Guide-for-Beginners | 54 | 12787410 | <reponame>satyambharti171/Python-Guide-for-Beginners<gh_stars>10-100
def multiply(a,b):
c=a*b
return c
print(multiply(3,5)) | 3.6875 | 4 |
redis_i_action/django_c2/c2/urls.py | enixdark/im-r-e-d-i-s | 0 | 12787411 | from django.conf.urls import patterns, include, url
from .views import HelloView
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'django_c2.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'',HelloView.as_view(),name="index"),
)
| 2.03125 | 2 |
visualization/multiple_draw_accuracy_graph.py | jireh-father/tensorflow-triplet-loss | 0 | 12787412 | <reponame>jireh-father/tensorflow-triplet-loss<filename>visualization/multiple_draw_accuracy_graph.py<gh_stars>0
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob, os
import argparse
import json
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--model_dir', ... | 2.421875 | 2 |
classes/__init__.py | Jollyfant/EPOS-TURTLE | 1 | 12787413 | <filename>classes/__init__.py
from Agent import Agent
from Annotation import Annotation
from Catalog import Catalog
from CatalogRecord import CatalogRecord
from Checksum import Checksum
from Concept import Concept
from ConceptScheme import ConceptScheme
from ContactPoint import ContactPoint
from CreativeWork import Cre... | 1.679688 | 2 |
main.py | mrcrow85/python-password-utils | 1 | 12787414 | #!/usr/bin/env python3
import sys
from password.generate import generate
from password.validate import validate
from password.pwn_check import main
if __name__ == "__main__":
if not sys.argv[1:]:
while True:
try:
text = input(
"""Select the option you like ... | 3.890625 | 4 |
file_processing_pipeline/cli.py | mariusfeteanu/file-processing-pipeline | 0 | 12787415 | """A command line interface to processes files."""
import click
from file_processing_pipeline.process import process_end_of_day
from file_processing_pipeline.io import CSV
@click.command()
@click.option("-d", "--data-set",
help="The data set to import, e.g. end_of_day.",
default='end_of_d... | 2.921875 | 3 |
datasets/sunrgbd.py | danjia21/3detr | 0 | 12787416 | <reponame>danjia21/3detr
# Copyright (c) Facebook, Inc. and its affiliates.
"""
Modified from https://github.com/facebookresearch/votenet
Dataset for 3D object detection on SUN RGB-D (with support of vote supervision).
A sunrgbd oriented bounding box is parameterized by (cx,cy,cz), (l,w,h) -- (dx,dy,dz) in upright ... | 2.171875 | 2 |
catalog/views.py | gcrsaldanha/sms | 0 | 12787417 | from rest_framework import generics
from .models import (
Item,
Manufacturer,
Catalog,
)
from .serializers import (
ItemSerializer,
ManufacturerSerializer,
CatalogSerializer,
)
class ItemListCreate(generics.ListCreateAPIView):
queryset = Item.objects.all()
serializer_class = ItemSeria... | 2.03125 | 2 |
xymon_monitors/icecast_json.py | UniversityRadioYork/xymon-monitors | 0 | 12787418 | <filename>xymon_monitors/icecast_json.py
#!/usr/bin/env python3
import logging
import xymon_monitors.logging as xm_logging
import urllib.request
import json
l = logging.getLogger()
xm_logging.configure('icecast_json')
@xm_logging.exception_quit(l, Exception, 'Icecast JSON unavailable')
def get_HTTP(url):
return ... | 2.40625 | 2 |
setup.py | a-musing-moose/bakedbeans | 6 | 12787419 | <reponame>a-musing-moose/bakedbeans
import io
import os
from setuptools import setup
NAME = 'bakedbeans'
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = '\n' + f.read()
about = {}
with open(os.path.join(here, NAME, '__... | 1.242188 | 1 |
src/py/route.py | AlecioFuranze/zeloo7 | 0 | 12787420 | <gh_stars>0
from ast import arg
class Route:
def RETURN():
return None
| 1.460938 | 1 |
utils_nlp/eval/question_answering.py | Anita1017/nlp-recipes | 4,407 | 12787421 | """ Official evaluation script for SQuAD version 2.0.
Modified by XLNet authors to update `find_best_threshold` scripts for SQuAD V2.0
"""
import collections
import json
import re
import string
def get_raw_scores(qa_ids, actuals, preds):
"""
Computes exact match and F1 scores without applying any una... | 2.6875 | 3 |
datatypes.py | andreasjansson/music-inpainting-bert | 1 | 12787422 | <reponame>andreasjansson/music-inpainting-bert<filename>datatypes.py
# need this class because autoreloading frozen dataclasses is broken
# in jupyter https://github.com/ipython/ipython/issues/12185
from fractions import Fraction
from typing import List, Tuple
from dataclasses import dataclass
import music21 as m21
... | 2.953125 | 3 |
edk2toolext/tests/capsule/capsule_helper_test.py | cfernald/edk2-pytool-extensions | 32 | 12787423 | <reponame>cfernald/edk2-pytool-extensions<gh_stars>10-100
## @file capsule_helper_test.py
# This unittest module contains test cases for the capsule_helper module.
#
##
# Copyright (C) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import uuid
import unittest
import tempfile
from... | 2.109375 | 2 |
tests/pyflakes_bears/pep8_naming_test_files/E05/invalid_nested_class.py | MacBox7/coala-pyflakes | 0 | 12787424 | <reponame>MacBox7/coala-pyflakes<filename>tests/pyflakes_bears/pep8_naming_test_files/E05/invalid_nested_class.py
def foo():
'''
>>> class Good():
... class bad():
... pass
'''
pass
| 1.445313 | 1 |
cellacdc/bioformats/formatwriter.py | SchmollerLab/Cell_ACDC | 29 | 12787425 | # Python-bioformats is distributed under the GNU General Public
# License, but this file is licensed under the more permissive BSD
# license. See the accompanying file LICENSE for details.
#
# Copyright (c) 2009-2014 Broad Institute
# All rights reserved.
'''formatwriter.py - mechanism to wrap a bioformats WriterWrap... | 2.5 | 2 |
cv_interactive/utils.py | kovarn/computervision-interactive | 0 | 12787426 | from matplotlib import pyplot as plt
def imshow(img, **kwargs):
if len(img.shape) == 2 and 'cmap' not in kwargs:
return plt.imshow(img, cmap=plt.cm.gray, **kwargs)
if len(img.shape) == 3 and img.shape[2] == 3:
return plt.imshow(img[:, :, ::-1], **kwargs)
return plt.imshow(img, **kwargs)
| 3.125 | 3 |
scripts/issues/issue15.py | Jhsmit/awesome-panel | 179 | 12787427 | <reponame>Jhsmit/awesome-panel
import panel as pn
text = r"""
```math
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
```
"""
app = pn.Column(pn.pane.Markdown(text))
app.servable()
| 1.898438 | 2 |
cohesity_management_sdk/models/type_gpfs_protection_source_enum.py | nick6655/management-sdk-python | 18 | 12787428 | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class TypeGpfsProtectionSourceEnum(object):
"""Implementation of the 'Type_GpfsProtectionSource' enum.
Specifies the type of the entity in an GPFS file system
like 'kCluster', 'kFilesystem', or, 'kFileset'.
'kCluster' indicates an GPFS Cluster.
... | 2.03125 | 2 |
Game of Life/game_of_life_interface.py | Pedro-W21/Game-of-Life-py | 0 | 12787429 | # -*- coding: utf-8 -*-
"""
Ce fichier contient l'implémentation dans une interface graphique de la logique du Game of Life
Il ne contient pas le code de la Class Espace utilisée pour
Created on Wed Feb 17 14:36:56 2021
@author: <NAME>
"""
import os
import game_of_life_logique as gol
from tkinter import *
o... | 3.734375 | 4 |
tests/CSIRO_wire_break_validation.py | BillMills/AutoQC | 17 | 12787430 | <filename>tests/CSIRO_wire_break_validation.py
import qctests.CSIRO_wire_break
import util.testingProfile
import numpy
##### CSIRO_wire_break_test ---------------------------------------------------
def test_CSIRO_wire_break():
'''
Spot-check the nominal behavior of the CSIRO wire break test.
'''
# t... | 2.21875 | 2 |
arekit/contrib/experiment_rusentrel/entities/factory.py | nicolay-r/AREk | 18 | 12787431 | <reponame>nicolay-r/AREk
from arekit.contrib.experiment_rusentrel.entities.str_rus_cased_fmt import RussianEntitiesCasedFormatter
from arekit.contrib.experiment_rusentrel.entities.str_rus_nocased_fmt import RussianEntitiesFormatter
from arekit.contrib.experiment_rusentrel.entities.str_simple_fmt import StringEntitiesSi... | 2.078125 | 2 |
parslr/__init__.py | maximmenshikov/parslr | 0 | 12787432 | from parslr.Parslr import Parslr
from parslr.parslr_args import prepare_parser
| 1.101563 | 1 |
pyassim/apf.py | ZoneTsuyoshi/pyassim | 0 | 12787433 | <reponame>ZoneTsuyoshi/pyassim
"""
==========================================
Inference with Auxiliary Particle Filter
==========================================
This module implements the Particle Filter and Particle Smoother,
for Nonlinear Non-Gaussian state space models
"""
import numpy as np
import numpy.random as... | 3.078125 | 3 |
problems/leetcode/lt-1839.py | neerajp99/algorithms | 1 | 12787434 | <filename>problems/leetcode/lt-1839.py<gh_stars>1-10
# 1839. Longest Substring Of All Vowels in Order
"""
A string is considered beautiful if it satisfies the following conditions:
- Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least once in it.
- The letters must be sorted... | 3.734375 | 4 |
3ds/tests/file-test.py | Katistic/3ds_monty | 16 | 12787435 | <reponame>Katistic/3ds_monty
from citrus import *
gfx.init_default()
console.init(gfx.SCREEN_TOP)
d = open('/tmp.py', 'r').read()
print(d)
while apt.main_loop():
hid.scan_input()
if hid.keys_down() & hid.KEY_START:
break
gfx.flush_buffers()
gfx.swap_buffers()
gsp.wait_for_vblank()
gfx... | 1.914063 | 2 |
app/main.py | acutaia/goeasy-ublox_api | 0 | 12787436 | """
App main entry point
:author: <NAME>
:copyright: Copyright 2021, LINKS Foundation
:version: 1.0.0
..
Copyright 2021 LINKS Foundation
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 Licen... | 1.90625 | 2 |
utils/ignore.py | ayieko168/Ternary-Metal-Nitrides-Research | 0 | 12787437 | import os, json
with open("PubChemElements_all.json") as fo:
data = json.load(fo)
all_elements = []
for j in data['Table']['Row']:
element_obj = {}
for element in list(zip(data['Table']['Columns']['Column'], j['Cell'])):
property = element[0]
value = element[1]
... | 3.015625 | 3 |
reflection/main.py | junaruga/py-sample | 0 | 12787438 | from a.filea import ClassA
from a.b.fileb import ClassB
# class_name: foo.bar.Bar
def import_class(class_name):
components = class_name.split('.')
module = __import__(components[0])
for comp in components[1:]:
# print(repr(comp))
module = getattr(module, comp)
return module
if __name... | 2.78125 | 3 |
rlkit/events/visualize_beta_v.py | Asap7772/railrl_evalsawyer | 1 | 12787439 | <filename>rlkit/events/visualize_beta_v.py
import argparse
import numpy as np
import matplotlib.pyplot as plt
import joblib
from rlkit.misc.visualization_util import make_heat_map, plot_heatmap
from rlkit.policies.simple import RandomPolicy
from rlkit.state_distance.rollout_util import multitask_rollout
if __name__ ... | 2.234375 | 2 |
scripts/ckpt_processor/read_fti_ckpts.py | Knoxort/fti | 34 | 12787440 | # This module initiates the checkpoint
# processing of FTI files.
import os
import glob
import os.path
import time
from fnmatch import fnmatch
import configparser
import posix_read_ckpts
import subprocess
import sys
# variables used for input validation
fti_levels = (1, 2, 3, 4)
output_formats = ('CSV', 'HDF5', 'dat... | 2.34375 | 2 |
strategy/indicator/bsawe/bsawe.py | firebird631/siis | 0 | 12787441 | <gh_stars>0
# @date 2019-04-14
# @author <NAME>, All rights reserved without prejudices.
# @license Copyright (c) 2018 Dream Overflow
# Awesome based buy/sell signal indicator
from strategy.indicator.indicator import Indicator
from strategy.indicator.utils import crossunder, crossover # , down_sample
# import numpy ... | 2.484375 | 2 |
shop/management/commands/recommendation.py | knkemree/django_ecommerce_website | 0 | 12787442 | import rec as rec
from django.core.management.base import BaseCommand
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
import plotly.offline as py
import plotly.graph_objects as go
from django.db.models import Sum
import slug
import http.client
import json
from shop.models import Rec, Produc... | 2.171875 | 2 |
kinetics/reaction_classes/michaelis_menton_modifiers.py | wlawler45/kinetics | 13 | 12787443 | <reponame>wlawler45/kinetics
""" Modifiers (eg inhibtion) """
class Modifier():
def __init__(self):
self.substrate_names = []
self.substrate_indexes = []
self.parameter_names = []
self.parameter_indexes = []
def get_substrate_indexes(self, substrate_names):
self.substr... | 3.125 | 3 |
circuit_benchmarks/toffoli.py | eddieschoute/circuit-benchmarks | 7 | 12787444 | import itertools
import math
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister
from qiskit.circuit import Gate, InstructionSet
from qiskit.dagcircuit import DAGCircuit
from qiskit.extensions.standard import *
from qiskit.qasm import pi
def toffoli(number_qubits: int):
assert number_qubits >= ... | 2.328125 | 2 |
users/migrations/0005_userpronoun.py | jazzyeagle/chatbot_website | 0 | 12787445 | <reponame>jazzyeagle/chatbot_website
# Generated by Django 3.2.8 on 2021-10-24 21:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0004_user_email'),
]
operations = [
migrations.CreateModel(
... | 1.882813 | 2 |
tests/useful_scripts/reindex_stix.py | ukncsc/edge-mod | 2 | 12787446 | <reponame>ukncsc/edge-mod
from mongoengine.connection import get_db
from pymongo import MongoClient
client = MongoClient()
db = client.inbox
# full-text-search index
db.stix.ensure_index(
[('fts', 'text')],
name='idx_fts',
background=True,
)
# create default indexes
db.stix.ensure_index... | 2.09375 | 2 |
example.py | pudo/docstash | 1 | 12787447 | from docstash import Stash
# open a stash in the current working directory:
stash = Stash(path='.stash')
# print a list of collections:
print list(stash)
# access (or create) a specific collection:
collection = stash.get('test')
# import a file from the local working directory:
collection.ingest('README.md')
# imp... | 2.84375 | 3 |
examples/imap-store.py | karpierz/libcurl | 0 | 12787448 | <gh_stars>0
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# ... | 2.15625 | 2 |
mxnet/doc/tutorials/onnx/utils.py | anirudhacharya/web-data | 0 | 12787449 | <reponame>anirudhacharya/web-data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Get top n indices of an array
get_top_n = lambda array, n: (-array).argsort()[:,:n]
# Get the labels for a given list of predictions
get_predictions = lambda predictions, categories: [[categor... | 2.921875 | 3 |
fxm/task/apps.py | panyuan5056/fx | 0 | 12787450 | from django.apps import AppConfig
class TaskConfig(AppConfig):
name = 'task'
verbose_name = "敏感数据发现"
main_menu_index = 2
| 1.179688 | 1 |