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 |
|---|---|---|---|---|---|---|
imagetagger/imagetagger/administration/forms.py | jbargu/imagetagger | 212 | 40500 | <reponame>jbargu/imagetagger
from django import forms
from imagetagger.annotations.models import AnnotationType
class AnnotationTypeCreationForm(forms.ModelForm):
class Meta:
model = AnnotationType
fields = [
'name',
'active',
'node_count',
'vector_... | 2.203125 | 2 |
fhir/resources/tests/test_terminologycapabilities.py | mmabey/fhir.resources | 0 | 40501 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import terminologycapabilities
from ..fhirdate imp... | 2.078125 | 2 |
omstools/RNAseq/general/expression_table_tools.py | bioShaun/OM004script | 0 | 40502 | #! /usr/bin/env python
import pandas as pd
import click
'''
gene expression matrix, with gene id in first column,
gene expression level of each sample in othre columns.
'''
@click.group(chain=True, invoke_without_command=True)
@click.argument('exp_table', type=click.STRING, required=True)
@click.pass_con... | 2.859375 | 3 |
app/main/service/wishlist_service.py | victortrinh/cabronis-be | 0 | 40503 | <reponame>victortrinh/cabronis-be
from datetime import datetime
from app.main import db
from app.main.model.sellable import Sellable
from app.main.model.user import User
from app.main.model.wishlist import Wishlist
def get_wishlist(user_id):
user = User.query.filter_by(user_id=user_id).first()
if not user:
... | 2.421875 | 2 |
container/omnilint/checkers/yaml.py | lpenz/omnilint | 3 | 40504 | # Copyright (C) 2017 <NAME> <<EMAIL>>
# This file is subject to the terms and conditions defined in
# file 'LICENSE', which is part of this source code package.
'''yaml checker'''
import yaml
from omnilint.error import Error
from omnilint.checkers import Checker
class Yaml(Checker):
extensions = ['yaml', 'yml'... | 2.328125 | 2 |
tests/test_scale.py | aaronfinke/fast_dp | 0 | 40505 | <gh_stars>0
#!/usr/local/crys-local/ccp4-7.0/bin/cctbx.python
import unittest
from scale import scale
class TestScale(unittest.TestCase):
def setUp(self):
pass
def test_scale(self):
unit_cell = (232.96666666666667, 232.96666666666667, 232.96666666666667, 90.0, 90.0, 90.0)
meta = {'beam': (120.5572614476484... | 1.90625 | 2 |
netcad_demo_meraki1/profiles/__init__.py | jeremyschulman/netcad-demo-meraki-1 | 0 | 40506 | from netcad.device.l2_interfaces import InterfaceL2Access, InterfaceL2Trunk
from netcad.device import PeerInterfaceId
from netcad_demo_meraki1.vlans import vlan_native_1
from .physical import port_UTP_1G
class AccessVlan1(InterfaceL2Access):
port_profile = port_UTP_1G
vlan = vlan_native_1
desc = PeerInte... | 1.835938 | 2 |
modules/SemanticWebImport/src/main/resources/fr/inria/edelweiss/examples/autolayout.py | cmatties/gephi-plugins | 7 | 40507 | import org.openide.util.Lookup as Lookup
import org.gephi.ranking.api.RankingController
import org.gephi.ranking.api.Ranking as Ranking
import org.gephi.ranking.api.Transformer as Transformer
import java.awt.Color as Color
rankingController = Lookup.getDefault().lookup(org.gephi.ranking.api.RankingController)
# Set ... | 2.375 | 2 |
coastline/sqs/__init__.py | JuniorCru/coastline | 1 | 40508 | <filename>coastline/sqs/__init__.py<gh_stars>1-10
from functools import lru_cache
import boto.sqs
from .. import di
@di.dependsOn('config')
@di.dependsOn('secrets')
@di.dependsOn('envstate')
class SqsConfig:
def __init__(self, *args, **kwargs):
full_config, secrets, full_state = di.resolver.unpack(SqsCo... | 2.1875 | 2 |
tests/ast/parsers/test_uppaal_xml_model_parser.py | S-Lehmann/uppyyl-simulator | 2 | 40509 | <reponame>S-Lehmann/uppyyl-simulator<gh_stars>1-10
import os
import pathlib
import pprint
import unittest
from uppyyl_simulator.backend.ast.parsers.uppaal_xml_model_parser import (
uppaal_xml_to_dict, uppaal_dict_to_system, uppaal_system_to_dict, uppaal_dict_to_xml
)
pp = pprint.PrettyPrinter(indent=4, compact=Tr... | 2.375 | 2 |
catalog_get_product.py | cognitivefashion/cf-sdk-python | 9 | 40510 | <reponame>cognitivefashion/cf-sdk-python
#-----------------------------------------------------------------------------
# Get product from a catalog.
# GET /v1/catalog/{catalog_name}/products/{id}
#------------------------------------------------------------------------------
import os
import json
import requests
fr... | 2.5625 | 3 |
fvhexperiments/decoders/ruuvicounter.py | VekotinVerstas/DjangoHttpBroker-FVH-Experiments | 0 | 40511 | """
Ruuvi Counter (LoRaWAN) decoder
See: https://bitbucket.org/iotpetri/hki_kuva_iot/src/master/ESP32/LORA/ESP32_RuuviTagGW_Lora_v2/
"""
import json
import pytz
from dateutil.parser import parse
from broker.providers.decoder import DecoderProvider
from broker.utils import create_dataline
from fvhexperiments.parsers.r... | 2.21875 | 2 |
src_flask/application.py | jphacks/ON_1801 | 0 | 40512 | <gh_stars>0
import sqlite3
from flask import Flask, request, jsonify, g
import logging
import cek
import os
import peewee as pe
import zaim
from datetime import datetime, date,timedelta
db = pe.SqliteDatabase('my_database.db')
class BaseModel(pe.Model):
class Meta:
database = db
# データテーブルのモデル
class Us... | 2.34375 | 2 |
setup.py | riomyers/guld-ai-telegram | 4 | 40513 | from bot import __version__
from setuptools import setup, find_packages
REQUIREMENTS = [line.strip() for line in open("requirements.txt").readlines()]
setup(name='guldai-telegram-bot',
version=__version__,
description='Telegram interface for the guldai bot',
author='isysd',
author_email='<EMAI... | 1.4375 | 1 |
CalibMuon/DTCalibration/python/Workflow/DTDQMValidation.py | pasmuss/cmssw | 0 | 40514 | <reponame>pasmuss/cmssw
from tools import loadCmsProcess,loadCrabCfg,loadCrabDefault,addCrabInputFile,writeCfg,prependPaths
from addPoolDBESSource import addPoolDBESSource
from CrabTask import *
import os
class DTDQMValidation:
#def __init__(self, run, dir, input_db, config):
def __init__(self, run, dir, confi... | 1.945313 | 2 |
src/uwds3_simulation/underworlds_simulation.py | uwds3/uwds3_simulation | 0 | 40515 | <filename>src/uwds3_simulation/underworlds_simulation.py
import rospy
import pybullet as p
import numpy as np
from proprioception.joint_states_listener import JointStatesListener
from estimation.perspective_estimator import PerspectiveEstimator
import tf2_ros
import message_filters
from sensor_msgs.msg import Image
fro... | 2.015625 | 2 |
fabfile/testbeds/testbed_setup80.py | GaryGaryWU/contrail_fabric_util | 0 | 40516 | <gh_stars>0
from fabric.api import env
os_username = 'admin'
os_password = '<PASSWORD>'
os_tenant_name = 'demo'
host1 = 'root@10.84.21.1'
host2 = 'root@10.84.21.2'
host3 = 'root@10.84.21.3'
host4 = 'root@10.84.21.4'
host5 = 'root@10.84.21.5'
host6 = 'root@10.84.21.6'
host7 = 'root@10.84.21.7'
host8 = 'root@10... | 1.414063 | 1 |
docs/spoiler/simple.py | snehilvj/dmc-docs | 6 | 40517 | import dash_mantine_components as dmc
component = dmc.Spoiler(
showLabel="Show more",
hideLabel="Hide",
maxHeight=50,
children=[
dmc.Text(
"""We Butter the Bread with Butter was founded in 2007 by <NAME>, who was originally guitarist
for <NAME>'s band, and <NAME>. The b... | 2.390625 | 2 |
backend/tests/test_verify.py | uwplse/stng | 14 | 40518 | <filename>backend/tests/test_verify.py
import unittest
from grammar import *
from verify import *
import assertion_grammar as ag
class TestVerification(unittest.TestCase):
def test_while(self):
# Verifier(tst_ast)
pass
class TestWPC(unittest.TestCase):
def test_trivial(self):
tst_ast = ... | 3.140625 | 3 |
tests/test_credential.py | deepan10/python-jenkins | 2 | 40519 | import json
from mock import patch
import jenkins
from tests.base import JenkinsTestBase
class JenkinsCredentialTestBase(JenkinsTestBase):
config_xml = """<com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
<scope>GLOBAL</scope>
<id>Test Credential</id>
<username>Test... | 2.34375 | 2 |
typeidea/comment/views.py | nishuidey/typeidea | 0 | 40520 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.views.generic import TemplateView
from .forms import CommentForm
class CommentView(TemplateView):
template_name = 'comment/result.html'
def get(self, request, *args, **kwargs):
return sup... | 2.046875 | 2 |
tests/test_pdf_images_component.py | cofiem/leaf-focus | 0 | 40521 | import logging
import pytest
from pathlib import Path
from leaf_focus.pdf.images.component import Component
from tests.base_test import BaseTest
class TestPdfImagesComponent(BaseTest):
def test_no_exe(self):
with pytest.raises(ValueError, match="Must supply exe file."):
Component(logging.getLo... | 2.296875 | 2 |
Virus Project/Key Logger/KeyLog/Keylogger/Keylogger.py | nickh671/CS216-Cyber-Security | 1 | 40522 | import pynput
from pynput.keyboard import Key, Listener
def on_press(key):
print(key + " was pressed")
def on_release(key):
if key == key.esc:
return False
with Listener(on_press=on_press, on_release=on_release) as listener:
listener.join() | 3.375 | 3 |
tenkit/lib/python/striped_smith_waterman/pyssw.py | qiangli/cellranger | 239 | 40523 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@package pyssw
@brief Python standalone program for ssw alignment using the C library
Complete-Striped-Smith-Waterman-Library
Biopython module is require for fastq/fastq parsing
@copyright [The MIT licence](http://opensource.org/licenses/MIT)
@autho... | 2.296875 | 2 |
juggling/analyse_profile.py | sioux-technologies/pyjuggling | 0 | 40524 | import pstats
p = pstats.Stats('output.prof')
p.sort_stats('cumulative').print_stats(15)
| 1.765625 | 2 |
py2/ex20.py | iamovrhere/lpthw | 0 | 40525 | <filename>py2/ex20.py
from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
def seek_a_line(seek, f):
f.seek(seek)
print seek, f.readline()
current_file = open(input_file)
print ... | 3.953125 | 4 |
test.py | insertinterestingnamehere/cython_overload_except | 0 | 40526 | <filename>test.py<gh_stars>0
import pyadd as pa
print "running test"
pa.test()
print "passed!"
| 1.5625 | 2 |
code_source/script_frame.py | zeddo123/voidgame | 7 | 40527 | <filename>code_source/script_frame.py
import sys
import os
import re
f = open(sys.argv[1]+"/frames.txt","w");
regex = re.compile(r"png$")
for i in sorted(os.listdir(sys.argv[1])):
if regex.search(i):
f.write(sys.argv[1]+"/"+i+'\n')
f.close() | 2.84375 | 3 |
restaurants/models.py | 32xnabin/DjangoRestHeroku | 0 | 40528 | from django.db import models
class Restaurant(models.Model):
"""
Restaurants' Model.
"""
id = models.CharField(primary_key = True, editable = True, max_length = 255, verbose_name = u'Id')
rating = models.IntegerField(verbose_name = u'Rating')
name = models.CharField(max_length = 255, verbose_na... | 2.46875 | 2 |
image_labeller/admin/admin_utils.py | alan-turing-institute/ImageLabeller | 0 | 40529 | """
Useful functions for the admin panel of ImageLabeller. In particular:
* Download labels from database to json or csv
* Upload images to the database, from json (catalogue of image locations) or zip archive
NOTE:
When uploading files, or an archive full of files, we will attempt to
match the filename to a regex wi... | 2.8125 | 3 |
goals_search/apps.py | machakux/dgs | 6 | 40530 | <filename>goals_search/apps.py
from django.apps import AppConfig
class GoalsSearchConfig(AppConfig):
name = 'goals_search'
| 1.257813 | 1 |
gammapy/scripts/check.py | joleroi/gammapy | 0 | 40531 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Command line tool to run tests.
This file is called `check` instead of `test` to prevent confusion
for developers and the test runner from including it in test collection.
"""
from __future__ import (absolute_import, division, print_function,
... | 1.859375 | 2 |
pythpy/state/core.py | johnstonematt/pythpy | 1 | 40532 | import json
from abc import ABC, abstractmethod
from construct import Struct, Container
class StateCore(ABC):
layout: Struct = None
@classmethod
@abstractmethod
def from_container(cls, container: Container):
pass
@classmethod
def parse(cls, bytes_data: bytes, factor: int):
co... | 3 | 3 |
charms_hardening/host/checks/apt.py | ChrisMacNaughton/charms.hardening | 1 | 40533 | <gh_stars>1-10
# Copyright 2016 Canonical Limited.
#
# This file is part of charms.hardening.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed... | 1.664063 | 2 |
ExamPrep/06 Differentiation/shigRichardson.py | FHomewood/ScientificComputing | 0 | 40534 | #This script takes a pair of inputs, one of a point and another of an interval width, then differentates f(x) at the selected point, using the given step size. to input f(x) and f'(x) simply replace " 'FUNC' " or " 'FUNCPRIME' " with the function.
import numpy as np
#User inputs below.
x=input('Please pick an x value... | 4 | 4 |
Udacity/Intro_to_Data_Structures_and_Algorithms!/Ex1LinkedList.py | dhivadeekshi/Algorithms-Samples | 0 | 40535 | <reponame>dhivadeekshi/Algorithms-Samples
"""The LinkedList code from before is provided below.
Add three functions to the LinkedList.
"get_position" returns the element at a certain position.
The "insert" function will add an element to a particular
spot in the list.
"delete" will delete the first element with that
pa... | 4.125 | 4 |
todobackend/todo/domain/value_objects.py | zhangcheng/todobackend_python | 0 | 40536 | <filename>todobackend/todo/domain/value_objects.py
TodoId = str
| 1.125 | 1 |
server/client-server/app/models/detection.py | ioangatop/yolo | 1 | 40537 | from pydantic import BaseModel
from typing import List
class DetectionModel(BaseModel):
class Detection(BaseModel):
bbox: List[int]
score: float
category_id: int
label: str
segmentation: List[List[List[int]]]
detections: List[Detection]
| 2.578125 | 3 |
gtfsjpcli/commands/init/db/main.py | tadashi-aikawa/gtfsjp-cli | 1 | 40538 | <gh_stars>1-10
"""GTFSデータからデータベースを作成します
Usage:
{cli} <gtfs_dir> [-d | --drop-duplicates] [<dst>]
{cli} (-h | --help)
Options:
<gtfs_dir> GTFSディレクトリ
-d --drop-duplicates 完全一致するレコードを削除する
<dst> DB作成先 [default: gtfs-jp.sqlite3]
-h --help ... | 2.15625 | 2 |
examples/show_vault.py | andy-maier/secureserveraccess | 1 | 40539 | <reponame>andy-maier/secureserveraccess<gh_stars>1-10
#!/usr/bin/env python
"""
Example script that shows the content of a vault file.
"""
import sys
import os
from pprint import pprint
import easy_server
def main():
"""Main function"""
if len(sys.argv) < 2:
print("Usage: {} VAULTFILE".format(sys.ar... | 3.046875 | 3 |
conanfile.py | bincrafters/conan-clara | 0 | 40540 | from conans import ConanFile, tools
import os
class ClaraConan(ConanFile):
name = "clara"
version = "1.1.5"
description = "A simple to use, composable, command line parser for C++ 11 and beyond"
url = "https://github.com/bincrafters/conan-clara"
homepage = "https://github.com/catchorg/Clara"
t... | 2.421875 | 2 |
openamundsen/fileio/meteo.py | openamundsen/openamundsen | 3 | 40541 | <reponame>openamundsen/openamundsen
import loguru
from openamundsen import constants, errors, forcing, util
import pandas as pd
from pathlib import Path
import xarray as xr
def read_meteo_data(
meteo_format,
meteo_data_dir,
start_date,
end_date,
meteo_crs=None,
grid_crs=None,
bounds=None,
... | 2.84375 | 3 |
shadowfiend/conductor/handlers/account_api.py | RogerYuQian/shadowfiend | 1 | 40542 | <filename>shadowfiend/conductor/handlers/account_api.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http... | 1.8125 | 2 |
tests/test_others.py | EchoShoot/Sheen | 9 | 40543 | # -*- coding: utf-8 -*-
# @Time : 2019-09-01 17:49
# @Author : EchoShoot
# @Email : <EMAIL>
# @URL : https://github.com/EchoShoot
# @File : test_others.py
# @Explain :
from sheen import Str
import pytest
class TestOthers(object):
raw = 'xxooAß西xoox'
obj = Str.red(raw)
obj[2:-2] = Str.green
... | 2.46875 | 2 |
encoded_client/submission.py | detrout/encoded_client | 0 | 40544 | <gh_stars>0
"""Partially through ENCODE3 the DCC switched to needing to upload via AWS
"""
from argparse import ArgumentParser
import logging
import json
import os
import pandas
import subprocess
import time
from .encoded import ENCODED, DCCValidator, HTTPError
from .sheet import open_book, save_book
logger = logging... | 2.421875 | 2 |
authors/apps/authentication/backends.py | andela/Ah-backend-valkyrie | 0 | 40545 | <reponame>andela/Ah-backend-valkyrie<filename>authors/apps/authentication/backends.py
import jwt
import datetime
from django.conf import settings
from rest_framework import authentication, exceptions, status
from .models import User
from .jwt_helper import JWTHelper
"""Configure JWT Here"""
class JWTAuthentication(... | 2.1875 | 2 |
python/valDACsettings.py | fermi-lat/calibGenCAL | 0 | 40546 | """
Validate CAL DAC settings XML files. The command line is:
valDACsettings [-V] [-r] [-R <root_file>] [-L <log_file>] FLE|FHE|LAC|ULD <MeV | margin> <dac_slopes_file> <dac_xml_file>
where:
-r = generate ROOT output with default name
-R <root_file> = output validation diagnostics in ROOT... | 2.15625 | 2 |
pyclustering/cluster/tests/rock_templates.py | JosephChataignon/pyclustering | 1,013 | 40547 | """!
@brief Test templates for ROCK clustering module.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster.rock import rock;
from pyclustering.utils import read_sample;
from random import random;
class RockTestTemplates:
@staticmethod
def ... | 2.46875 | 2 |
perfvis/perfvis.py | serendipiddy/openflow-performance-visualizer | 2 | 40548 | from ryu.app.wsgi import WSGIApplication
from ryu.base import app_manager
from ryu.lib import hub
from ryu.lib.dpid import dpid_to_str
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER, CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.controller import ofp_event
from ryu.lib.p... | 1.875 | 2 |
putput/validator.py | cicorias/putput | 1 | 40549 | <gh_stars>1-10
import itertools
import re
from functools import reduce
from typing import Any
from typing import Iterable
from typing import Mapping
from typing import Sequence
from typing import Set
from typing import Tuple
from typing import Union
RANGE_REGEX = r'^\d+(\-\d+)?$'
OPTIONAL_REGEX = r'^\(\|?\w+(\|\w+)*\)... | 2.921875 | 3 |
src/search_algorithm/dfs.py | yasuo-00/path_finding_visualization | 0 | 40550 | import painter
import sys
from utils import distance
from collections import deque
#returns last node (destination_node)
def dfs(origin_node, dest_node, board, screen):
#put origin node on open_nodes_list (first to be expanded)
open_nodes=deque()
closed_nodes=list()
open_nodes.append(origin_node)
... | 3.0625 | 3 |
medzibrod/__init__.py | mnalevanko/medzibrod | 0 | 40551 | # -*- coding: utf-8 -*-
"""Top-level package for Medzibrod."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.0'
| 1.054688 | 1 |
fileapi/tests/test_functional.py | mlavin/fileapi | 12 | 40552 | <filename>fileapi/tests/test_functional.py
import os
import shutil
import tempfile
from django.contrib.auth.models import User
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core.files.storage import FileSystemStorage
from selenium import webdriver
from selenium.common.exceptions ... | 2.234375 | 2 |
roomai/sevenking/SevenKingEnv.py | 1696012928/RoomAI | 1 | 40553 | #!/bin/python
import roomai.common
from roomai.sevenking import SevenKingPublicState
from roomai.sevenking import SevenKingPrivateState
from roomai.sevenking import SevenKingPersonState
from roomai.sevenking import SevenKingAction
from roomai.sevenking import SevenKingPokerCard
from roomai.sevenking import AllSevenKing... | 2.703125 | 3 |
oops_fhir/r4/code_system/request_resource_type.py | Mikuana/oops_fhir | 0 | 40554 | <filename>oops_fhir/r4/code_system/request_resource_type.py
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["RequestResourceType"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class RequestResourceType:
... | 2.59375 | 3 |
projetos/morse_code_converter.py | Guilherme-Cruz-Ferreira/My_repository | 0 | 40555 | <gh_stars>0
# conversor de código morse
# muita linha pra pouca coisa
import string
s2m = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.',\
'F': '..-.', 'G': '--.', 'H': '....', 'I': '..', 'J':'.---',\
'L':'.-..', 'M':'--','N':'-.','O':'---','P':'.--.','Q':'--.-',\
'R':'.-.','S':'...', 'T':'-','U... | 3.125 | 3 |
example_nodes/__init__.py | 996268132/NodeGraphQt | 582 | 40556 | <reponame>996268132/NodeGraphQt
#!/usr/bin/python
import os
import sys
import ast
VALID_NODE_TYPE = ['BaseNode', 'AutoNode']
def detectNodesFromText(filepath):
"""returns Node names from a python script"""
froms = []
with open(filepath, "r") as source:
tree = ast.parse(source.read())
f... | 2.59375 | 3 |
reviewboard/avatars/templatetags/tests.py | bcskda/reviewboard | 1 | 40557 | from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser, User
from django.http import HttpRequest
from django.template import RequestContext, Template
from djblets.avatars.services.gravatar import GravatarService
from reviewboard.testing import TestCase
from reviewboard.avatars im... | 2.09375 | 2 |
study/fft_scratch/fft_scratch.py | ooshyun/filterdesign | 1 | 40558 | <filename>study/fft_scratch/fft_scratch.py
"""FFT Scratch
Reference.
Kor, proof of formula,
https://ghebook.blogspot.com/2020/09/dft-discrete-fourier-transform.html
Eng, Cooley and Tukey,
http://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
"""
import time
import nump... | 3.109375 | 3 |
DomJudge/practica4/GRIDGRAP.py | Camiloasc1/AlgorithmsUNAL | 0 | 40559 | <gh_stars>0
import sys
def solve2(n, m):
if n == 1 and m == 1:
return []
check = []
count = 1
for i in xrange(n):
for j in xrange(m):
if j + 1 <= m and (count + 1 <= (n * m)) and not(count + 1 > m * (i + 1)):
check.append([count, count + 1])
if (i... | 3.15625 | 3 |
naive_bayesian_classifier.py | sharathbp/Machine-Learning-Lab | 0 | 40560 | <reponame>sharathbp/Machine-Learning-Lab<filename>naive_bayesian_classifier.py
import csv
from sklearn.model_selection import train_test_split
import math
def mean(numbers):
return sum(numbers)/float(len(numbers))
def stdev(numbers):
avg = mean(numbers)
return math.sqrt( sum([ pow(x-avg, 2) for x... | 3.125 | 3 |
openid.py | DaniilSezonov/AuthServerClient | 0 | 40561 | import jwt
import requests
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers
from oauth2 import Oauth2, ResponseObject, RemoteUserProfile, OAuthDiscoveryError
class OpenID(Oauth2):
state_token: str or None = None
well_know_pat... | 2.640625 | 3 |
AllToDec.py | jeppard/infotrainer | 0 | 40562 | def AllToDec_ui():
i = int(input('Ausgangsystem (z.B. 8 für Oktal) '))
zahl = input('Ausgangszahl: ')
input('Dezimalzahl: ')
print(All2dec(zahl, i))
def All2dec(z, p):
s = ''
n = 0
for i in range(0, len(z)):
n += int(z[len(z) - (i + 1)], p) * (p ** i)
s += str(int(z[len(z) ... | 3.453125 | 3 |
tool/alignment/pyalign/AbstractArchitecture.py | ssrg-vt/mklinux-compiler | 0 | 40563 | <gh_stars>0
"""
We put everything common to each in this class which act as an abstract class.
Basically, this contains evething that is done per-architecture, but is done
relatively the same way for each architecture.
"""
import subprocess, sys, os, re
import Globals, ReadElfParser, Symbol
from Globals import er, war... | 2.46875 | 2 |
frame_example.py | svortega/steelpy | 4 | 40564 | <reponame>svortega/steelpy<filename>frame_example.py
from steelpy import Trave3D
from steelpy import Units
from steelpy import f2uModel
f2umodel = f2uModel(component='test2', mesh_type="inmemory") #
units = Units()
#
material = f2umodel.materials
material[1] = 'elastic'
material[1].Fy = 345.0 * units.MPa
material[1].E... | 2.203125 | 2 |
dvc_preprocessing/macros.py | pedrodamas0803/dvc_preprocessing | 0 | 40565 | from dvc_preprocessing import plot, preprocessing, constants
from skimage.filters import threshold_otsu
import numpy as np
def auto_processing(filename, dirpath='./', data_type=np.int16, init_slice=0, final_slice="last", outname="output", ret="True"):
'''
TODO: add outpath
'''
stack = preprocessing.r... | 2.296875 | 2 |
nanopores/scripts/ahemIV.py | jhwnkim/nanopores | 8 | 40566 | <reponame>jhwnkim/nanopores<filename>nanopores/scripts/ahemIV.py
import math, nanopores, dolfin
# @Benjamin, Gregor TODO:
# -) check permittivity and surface charge of ahem
# -) what biased voltage to use?
# some default values for parameters
### geo params [nm]
geo_name = "aHem"
domscale = 1.
l4 = 15.
l3 = 15.
R = ... | 2.5 | 2 |
cardea/fhir/ExplanationOfBenefit.py | sarahmish/Cardea | 69 | 40567 | from .fhirbase import fhirbase
class ExplanationOfBenefit(fhirbase):
"""
This resource provides: the claim details; adjudication details from
the processing of a Claim; and optionally account balance information,
for informing the subscriber of the benefits provided.
Args:
resourceType: T... | 1.835938 | 2 |
homageapp/models.py | Isaacg94/-Awwards | 0 | 40568 | <reponame>Isaacg94/-Awwards<filename>homageapp/models.py
from django.db import models
from django.contrib.auth.models import User
from pyuploadcare.dj.models import ImageField
from tinymce.models import HTMLField
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User,on_delete=mo... | 2.21875 | 2 |
2020/1/main.py | Samplasion/advent-of-code | 0 | 40569 | # Copyright (c) 2020 Samplasion <<EMAIL>>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
TARGET = 2020
def main():
print("=============")
print("= AoC Day 1 =")
print("=============")
print()
with open("input.txt") as f:
file = f.read()
... | 3.953125 | 4 |
pysynphot/test/test_tokenizer.py | dobos/pysynphot | 24 | 40570 | from __future__ import absolute_import, division, print_function
import pytest
from ..spparser import Scanner
scanner = Scanner()
# Test of a single instance of each token. Does not test them in
# context, but at least it tests that each one is recognized.
tokens = [
# bug: the original pysynphot could not reco... | 2.5 | 2 |
launch/full_recording.launch.py | Valts-M/ros2_com | 0 | 40571 | <filename>launch/full_recording.launch.py
import launch
from launch.substitutions import Command, LaunchConfiguration
from launch_ros.actions import LifecycleNode
from launch.actions import EmitEvent
from launch.actions import RegisterEventHandler
from launch_ros.events.lifecycle import ChangeState
from launch_ros.even... | 2.078125 | 2 |
scuole/stats/schemas/tapr/schema_v2.py | texastribune/scuole | 1 | 40572 | SCHEMA = {
# staff-and-student-information
"all_students_count": "{short_code}PETALLC",
"african_american_count": "{short_code}PETBLAC",
"african_american_percent": "{short_code}PETBLAP",
"american_indian_count": "{short_code}PETINDC",
"american_indian_percent": "{short_code}PETINDP",
"asian... | 1.023438 | 1 |
python/test/twotemplates_test.py | jasonrbriggs/proton | 3 | 40573 | #
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be use... | 2.625 | 3 |
python/ccxt/tprexchange.py | ThePeoplesReserve/ccxt | 0 | 40574 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import BadRequest
from ccxt.base.e... | 1.664063 | 2 |
nine/c5.py | xiaolinzi-xl/python_imooc | 0 | 40575 | from c6 import People
# Student类继承People
class Student(People):
def __init__(self,school,name,age):
self.school = school
# People.__init__(self,name,age)
super(Student,self).__init__(name,age)
Student.sum += 1
def do_homework(self):
print('do homework')
student1 = ... | 3.359375 | 3 |
portal/libs/social_auth_pipeline/__init__.py | Artis-Physis/utopia-cms | 8 | 40576 | from django.http import HttpResponseRedirect
from thedaily.models import OAuthState
from thedaily.views import get_or_create_user_profile
def get_phone_number(backend, uid, user=None, social=None, *args, **kwargs):
subscriber = get_or_create_user_profile(user)
if not subscriber.phone:
state = kwargs[... | 2.296875 | 2 |
serverless/aws/resources/sqs.py | epsyhealth/serverless-builder | 3 | 40577 | <reponame>epsyhealth/serverless-builder
from troposphere.sqs import Queue as SQSQueue
from serverless.aws.features.encryption import Encryption
from serverless.aws.resources import Resource
from serverless.aws.resources.kms import EncryptableResource
from serverless.service.types import Identifier
class Queue(Resour... | 2.171875 | 2 |
losses/rmse.py | borhanMorphy/facial-keypoints-detection | 0 | 40578 | <reponame>borhanMorphy/facial-keypoints-detection
import torch
import torch.nn as nn
import torch.nn.functional as F
class RMSELoss(nn.Module):
def __init__(self, reduction:str='mean'):
super(RMSELoss, self).__init__()
self.reduction = reduction
def forward(self, input: torch.Tensor, target: t... | 2.546875 | 3 |
iati/__init__.py | mcarans/hdx-scraper-iati-viz | 0 | 40579 | # -*- coding: utf-8 -*-
from iati.covid_checks import CovidChecks
from iati.ebola_checks import EbolaChecks
checks = {'covid': CovidChecks, 'ebola': EbolaChecks}
| 1.132813 | 1 |
33. Python Programs/FactorialOfNumbers.py | Ujjawalgupta42/Hacktoberfest2021-DSA | 225 | 40580 | <reponame>Ujjawalgupta42/Hacktoberfest2021-DSA
for i in range(int(input())):
fact=1
a=int(input())
for j in range(1,a+1,1):
fact=fact*j
print(fact)
def factorial(n):
return 1 if (n==1 or n==0) else n * factorial(n - 1);
num = int(input('Enter number'))
print("Factorial of",num,... | 3.953125 | 4 |
Stocks.py | ya332/stock-advisor | 19 | 40581 | __author__ = '<NAME>'
# I need the datetime module for telling the current date when I compare todays stock values to 5 days ago and such.
import datetime
# Yahoo Finance V. 1.1.4
from yahoo_finance import Share
# Arrow -- replaced the old date module
import arrow
# Checks to see if it is currently the weekend, and d... | 3.8125 | 4 |
old/Basics/exampleButtons.py | JCTLearning/Project-Runner | 0 | 40582 | from tkinter import *
isOpen = True
x = True
"""This Script is the Basic logic for the GUI (It will obviously have
custom buttons and not be default buttons. Just created this to refer
to creating buttons. We aren't using Datalists. We'll be putting their
inputs into a .json file so we can call it back and average the... | 3.59375 | 4 |
users/migrations/0013_auto_20190516_1528.py | JianaXu/productivity | 0 | 40583 | <reponame>JianaXu/productivity<gh_stars>0
# Generated by Django 2.1.1 on 2019-05-16 07:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.... | 1.75 | 2 |
alipay/aop/api/domain/AlipaySecurityProdIfaaDevicepubkeyQueryModel.py | articuly/alipay-sdk-python-all | 0 | 40584 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipaySecurityProdIfaaDevicepubkeyQueryModel(object):
def __init__(self):
self._ecdh_publickey = None
self._max_id = None
self._security_device_i... | 2.046875 | 2 |
server/baseball/management/commands/populate_player_stats.py | louisliv/baseball | 0 | 40585 | from django.core.management.base import BaseCommand
import numpy as np
import pandas as pd
from django.conf import settings
from baseball.models import Player, PlayerStats
import sys
import requests
import datetime
HITTING_BASE_URL = 'http://lookup-service-prod.mlb.com/json/named.sport_hitting_tm.bam'
PITCHING_BASE_... | 2.25 | 2 |
modules/dbnd-airflow-monitor/src/airflow_monitor/shared/base_server_monitor_config.py | dmytrostriletskyi/dbnd | 0 | 40586 | from typing import Optional
from uuid import UUID
import attr
from airflow_monitor.shared.base_monitor_config import BaseMonitorConfig
@attr.s
class BaseServerConfig(object):
source_name: str = attr.ib()
source_type: str = attr.ib()
tracking_source_uid: UUID = attr.ib()
sync_interval: int = attr.ib... | 2.171875 | 2 |
130.py | whoophee/DCP | 2 | 40587 | <reponame>whoophee/DCP
# This problem was asked by Facebook.
# Given an array of numbers representing the stock prices of a company in chronological
# order and an integer k, return the maximum profit you can make from k buys and sells.
# You must buy the stock before you can sell it, and you must sell the stock befo... | 3.609375 | 4 |
tests/graphql/objects/object_with_field_parameters/tests.py | ladal1/simple_api | 1 | 40588 | from .objects import schema
from tests.graphql.graphql_test_utils import GraphQLTestCase, remove_ws
class Test(GraphQLTestCase):
GRAPHQL_SCHEMA = schema
REF_GRAPHQL_SCHEMA = """
schema {
query: Query
}
type ActionInfo {
name: String!
parameters: [... | 2.109375 | 2 |
digaws/digaws.py | dcarrillo/digaws | 7 | 40589 | <reponame>dcarrillo/digaws
#!/usr/bin/env python3
import argparse
import ipaddress
import json
import logging
import sys
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, List
from dateutil import tz
import requests
from requests.exceptions import RequestException
from . import __... | 2.25 | 2 |
setup.py | ztw33/code-sim | 0 | 40590 | <gh_stars>0
from setuptools import setup, find_packages
VERSION = "0.1.0"
setup(name="codesim",
version=VERSION,
description="A tool for measuring the similarity between two c++ code files.",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
packages=find_packages(),
in... | 1.046875 | 1 |
wdfn-server/waterdata/tests/commands/lookup_generation/test_wqp_lookups.py | skaymen/waterdataui | 0 | 40591 |
from unittest import TestCase, mock
import requests
from waterdata.commands.lookup_generation.wqp_lookups import (
get_lookup_by_json, is_us_county, get_nwis_state_lookup, get_nwis_county_lookup)
@mock.patch('waterdata.commands.lookup_generation.wqp_lookups.execute_get_request')
class GetLookupByJsonTestCase(T... | 2.71875 | 3 |
src/SPARQL_BAMS_Store_Query_Example.py | rsoscia/BAMS-to-NeuroLex | 1 | 40592 | <gh_stars>1-10
#SPARQL_BAMS_Store_Query_Example.py
#Accessing Python Interactive Mode:
#python -i SPARQL_BAMS_Store_Query_Example.py
#This program demonstrates a basic query pulling data out of a persisted SPARQL store
#For Parsing
import rdflib
from rdflib import plugin
#for getting the length of the files
import o... | 3 | 3 |
basic_statistics.py | YitengZhou/cgcnn | 1 | 40593 | import csv
# # Calculate the proportion of Four types of datasets - energy, piezo, elasticity, diel
# # Energy
# energy = []
# with open('training/energy/energy.csv', 'r', encoding='utf-8') as en:
# reader = csv.reader(en)
# for row in reader:
# energy.append(row[0])
# print(len(energy))
#
# # elas... | 2.984375 | 3 |
web2py-appliances-master/SurveyAppFlourish/models/db.py | wantsomechocolate/WantsomeBeanstalk | 0 | 40594 | <reponame>wantsomechocolate/WantsomeBeanstalk
#########################################################################
# This scaffolding model makes your app work on Google App Engine too #
#########################################################################
try:
from gluon.contrib.gql import * # ... | 2.5625 | 3 |
bax_insertion/plots/bax_bax_fret_nbd_release/plot_all_fret_fits.py | johnbachman/bax_insertion_paper | 0 | 40595 | <reponame>johnbachman/bax_insertion_paper
import os
import sys
import cPickle
import itertools
import numpy as np
from matplotlib import pyplot as plt
from bax_insertion.util import set_fig_params_for_publication, format_axis, \
fontsize
from bax_insertion.plots.bax_bax_fret_nbd_release.pre... | 1.921875 | 2 |
Code/htmlfileread.py | coolvikas/pythonHTTPWebServer | 0 | 40596 | <reponame>coolvikas/pythonHTTPWebServer
def file_html(fname):
fptr=open(fname,"r")
to_send = ""
for lines in fptr:
to_send += lines;
return to_send
#file_html("myfile.html");
| 2.796875 | 3 |
welib/FEM/fem_model.py | moonieann/welib | 24 | 40597 | import numpy as np
import pandas as pd
from welib.tools.clean_exceptions import *
from welib.FEM.graph import Node as GraphNode
from welib.FEM.graph import Element as GraphElement
from welib.FEM.graph import NodeProperty
from welib.FEM.graph import GraphModel
class MaterialProperty(NodeProperty):
def __init__(se... | 2.515625 | 3 |
authentication.py | Daniel-Timothy-Leads/dtleads-api-helper-reference | 0 | 40598 | <gh_stars>0
import dtleads_api_helper
dtl = dtleads_api_helper.DanielTimothyLeads() # create instance of DTLeads helper
## Authentication/Authorization
results = dtl.authorize_login("<username>", "<password>")
token_details = dtl.handle_response(results)
print(token_details)
## refresh the token
refresh_token = toke... | 2.21875 | 2 |
QuizApp/admin.py | mokosaur/legit-quizzes | 1 | 40599 | from django.contrib import admin
from .models import Label, Choice, Quiz, Question, Answer, Submit
# Register your models here.
admin.site.register(Quiz)
admin.site.register(Question)
admin.site.register(Answer)
admin.site.register(Label)
admin.site.register(Submit)
admin.site.register(Choice) | 1.585938 | 2 |