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 |
|---|---|---|---|---|---|---|
LSTMText/utils.py | Cristina-cxq/models-1 | 0 | 45800 | """
imdb dataset saved in https://github.com/Oneflow-Inc/models/imdb
"""
import sys
sys.path.append("../")
from imdb.utils import pad_sequences, load_imdb_data, colored_string
__all__ = ["pad_sequences", "load_imdb_data", "colored_string"]
| 1.484375 | 1 |
src/ModuleManager.py | RhysRead/RhysRoom | 0 | 45801 | <filename>src/ModuleManager.py
#!/usr/bin/env python3
"""ModuleManager.py: This file contains the code for the module managing aspect of the RhysRoom software."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, <NAME>"
import logging
import os
from importlib.machinery import SourceFileLoader
import threading... | 2.78125 | 3 |
dependencies/svgwrite/tests/test_rect.py | charlesmchen/typefacet | 21 | 45802 | <filename>dependencies/svgwrite/tests/test_rect.py<gh_stars>10-100
#!/usr/bin/env python
#coding:utf-8
# Author: mozman --<<EMAIL>>
# Purpose: test rect object
# Created: 25.09.2010
# Copyright (C) 2010, <NAME>
# License: GPLv3
import sys
import unittest
from svgwrite.shapes import Rect
class TestRect(... | 2.640625 | 3 |
app/feature/get_details/service.py | KatlehoGxagxa/kk_secure | 0 | 45803 | from app.db_models.models import userModel
from sqlalchemy.orm import session
from app.db_models import Session
from app.db_models.users import User
import math
class get_details():
def __init__(self, inputs: userModel):
self.__inputs = inputs
self.session = Session()
| 2.265625 | 2 |
meiduo_mall/meiduo_mall/apps/verifications/views.py | zhiliangsu/MeiduoMall | 0 | 45804 | import logging
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from random import randint
from django_redis import get_redis_connection
from rest_framework import status
from meiduo_mall.libs.yuntongxun.sms import CCP
from . import constants
fr... | 1.890625 | 2 |
datasource.py | aliabbasjaffri/fashion_mnist-metaflow-bentoml-pipeline | 0 | 45805 | <gh_stars>0
import os
import random
import numpy as np
import torch
from torchvision import transforms
from torchvision.datasets import FashionMNIST
from torch.utils.data import DataLoader
# reproducible setup for testing
seed = 42
random.seed(seed)
np.random.seed(seed)
FASHION_MNIST_CLASSES = [
"T-shirt/top",
... | 2.453125 | 2 |
freenodejobs/urls.py | freenode/freenodejobs | 4 | 45806 | from django.conf import settings
from django.urls import path, include
from django.views.static import serve
urlpatterns = (
path('', include('freenodejobs.account.urls',
namespace='account')),
path('', include('freenodejobs.admin.urls',
namespace='admin')),
path('', include('freenodejob... | 1.734375 | 2 |
py/hwid/service/appengine/hwid_util_test.py | arccode/factory | 3 | 45807 | #!/usr/bin/env python3
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""AppEngine integration test for hwid_util"""
import os.path
import unittest
from cros.factory.hwid.service.appengine import hwid... | 2.203125 | 2 |
BubbleChart/BubbleChart.py | O-Aiden/Danim | 218 | 45808 | <reponame>O-Aiden/Danim
from manimlib.imports import *
from Danim.BubbleChart.BCutils import *
from Danim.BubbleChart.bubble_constants import *
class BubbleChart(VGroup):
# A class to quickly create the bubble chart animation
# may not have the freedom to change things
CONFIG = {
"show_axes_lable":... | 3.125 | 3 |
hobbify/habits/models/habits.py | Hobbify-Team/Hobbify-API | 1 | 45809 | <reponame>Hobbify-Team/Hobbify-API<filename>hobbify/habits/models/habits.py
""" Habits model """
# Django
from django.db import models
# Utils
from hobbify.utils.models import HobbifyModel
from django.utils import timezone
class Habit(HobbifyModel):
""" Habit model """
owner = models.ForeignKey('users.User'... | 2.59375 | 3 |
src/main.py | EOEPCA/um-pep-engine | 0 | 45810 | #!/usr/bin/env python3
from WellKnownHandler import WellKnownHandler
from WellKnownHandler import TYPE_UMA_V2, KEY_UMA_V2_RESOURCE_REGISTRATION_ENDPOINT, KEY_UMA_V2_PERMISSION_ENDPOINT, KEY_UMA_V2_INTROSPECTION_ENDPOINT
from flask import Flask, request, Response
from flask_swagger_ui import get_swaggerui_blueprint
fr... | 1.726563 | 2 |
fit.py | uoguelph-mlrg/cnn-moth-detection | 2 | 45811 | <filename>fit.py<gh_stars>1-10
import os
import sys
import time
import copy
import numpy as np
import theano
import theano.tensor as T
from tools_theano import shared_dataset
import logging
def fit(classifier, train_set,
flag_report_valid=False, valid_set=None,
flag_report_test=False, test_set=None,... | 2.34375 | 2 |
tests/test_transfertree.py | atiqm/adapt | 0 | 45812 | import copy
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from adapt.parameter_based import TransferTreeClassifier, TransferForestClassifier
methods = [
'relab',
'ser',
'strut',
'ser_nr',
'ser_no_ext',
'ser_nr_lambda',
... | 2.703125 | 3 |
inversefed/utils.py | hyunjoors/invertinggradients | 119 | 45813 | <reponame>hyunjoors/invertinggradients
"""Various utilities."""
import os
import csv
import torch
import random
import numpy as np
import socket
import datetime
def system_startup(args=None, defs=None):
"""Print useful system information."""
# Choose GPU device and print status information:
device = to... | 2.515625 | 3 |
pokerstats/statslogic.py | pokermania/pokernetwork | 57 | 45814 | <reponame>pokermania/pokernetwork
#
# Copyright (C) 2008, 2009 <NAME> <<EMAIL>>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as published by the Free
# Software Foundation (FSF)... | 2.125 | 2 |
core/views.py | DjangoBoston/django-mulsite | 0 | 45815 |
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django.contrib.sites.shortcuts import get_current_site
from rest_framework import viewsets
from core.models import SiteUser
from core import sites
from core.serializers import SiteUserSerializer, SiteSerializer, UserSeri... | 2.1875 | 2 |
Mutable Function.py | samli6479/PythonLearn | 0 | 45816 | <reponame>samli6479/PythonLearn<filename>Mutable Function.py
# A function with Behavior That varies Over Time
# A function compound value have a body and a parent frame
# The parent frame contains the balance, the local state of the withdraw function
# Non-Local Assignment & Persistent Local State
# Work for python... | 4.4375 | 4 |
downpour/resources.py | dhellmann/aerostat | 1 | 45817 | <filename>downpour/resources.py
# -*- coding: utf-8 -*-
# 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 la... | 2.21875 | 2 |
karanja_me/polls/admin.py | denisKaranja/django-dive-in | 0 | 45818 | <filename>karanja_me/polls/admin.py<gh_stars>0
from django.contrib import admin
# register Pools app in the admin interface
from .models import Choice, Question
class ChoiceInLine(admin.TabularInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
# re-order which field comes first
fieldse... | 2.015625 | 2 |
social_sim_ros/src/trial_runner.py | yale-sean/social_sim_ros | 5 | 45819 | #!/usr/bin/env python
'''
run social sim trials
'''
import actionlib
import rospy
from rospy_message_converter import message_converter
import tf
from geometry_msgs.msg import PoseArray, Pose
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal, MoveBaseActionGoal
from social_sim_ros.msg import TrialStart, Tria... | 2.109375 | 2 |
dnstap_receiver/fstrm.py | paukstis/dnstap-receiver | 0 | 45820 | <reponame>paukstis/dnstap-receiver
import struct
import logging
# https://farsightsec.github.io/fstrm/
# Frame Streams Control Frame Format
# |------------------------------------|----------------------|
# | Data frame length | 4 bytes |
# |------------------------------------|---------... | 1.390625 | 1 |
posthog/version.py | Algogator/posthog | 0 | 45821 | <reponame>Algogator/posthog
VERSION = "1.13.0"
| 0.757813 | 1 |
tests/src/main/python/rest/tests/extract/swagger_client/models/measure_parameter_info.py | IBM/quality-measure-and-cohort-service | 1 | 45822 | <reponame>IBM/quality-measure-and-cohort-service
# coding: utf-8
"""
IBM Cohort Engine
Service to evaluate cohorts and measures # noqa: E501
OpenAPI spec version: 2.1.0 2022-02-18T21:50:45Z
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F... | 1.710938 | 2 |
tests/__init__.py | vooon/hass-radiacode | 4 | 45823 | """Tests for RadiaCode 101 sensor component integration."""
| 0.882813 | 1 |
qconfig.py | zhuang-group/SAQ | 22 | 45824 | <gh_stars>10-100
import os
from core.config import create_dir, get_parser, params_check
def get_qparser():
parser = get_parser()
# general
parser.add_argument(
"--quantize_first_last",
type=bool,
default=True,
help="whether to quantize the first and last layer",
)
... | 2.265625 | 2 |
beartype_test/util/pyterror.py | jonathanmorley/beartype | 0 | 45825 | <reponame>jonathanmorley/beartype
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
**:mod:`pytest` exception-handling utilities.**
This submodule provides functions validating cal... | 2.109375 | 2 |
django_doctest_tests/src/urls.py | michilu/django-doctest | 0 | 45826 | <reponame>michilu/django-doctest<gh_stars>0
from django.conf.urls.defaults import *
import views
urlpatterns = patterns("",
(r'^render/(.*/)?', views.render),
(r'^use_template/(.*/)?', views.use_template),
)
| 1.507813 | 2 |
tests/utils.py | Upabjojr/matchpy | 0 | 45827 | <filename>tests/utils.py
# -*- coding: utf-8 -*-
from matchpy.expressions.constraints import Constraint
from matchpy.expressions.substitution import Substitution
from matchpy.expressions.expressions import Pattern
class MockConstraint(Constraint):
def __init__(self, return_value, *variables, renaming=None)... | 2.84375 | 3 |
Discrete2D/torch-ac-composable/torch_ac_composable/models/acmodel_modular_fixed.py | Lifelong-ML/Mendez2022ModularLifelongRL | 0 | 45828 | '''
This version uses a Q function for PPO, the same that is
later used for BCQ
'''
import torch
import torch.nn as nn
import torch.autograd as autograd
import torch.nn.functional as F
from torch.distributions.categorical import Categorical
import random
import numpy as np
# Function from https://github.com/ikostrik... | 2.140625 | 2 |
python/sorting/sort-list-on-binaryOnes.py | krishnaiitd/eagleicode | 0 | 45829 | <filename>python/sorting/sort-list-on-binaryOnes.py
# Complete the function below.
import operator
def swap_array( a):
a.sort(reverse=True)
# Get the decimal number:
dic = {}
for el in a:
dic[el] = GetOnesCount(el)
sorted_value = sorted(dic.items(), key = operator.itemgetter(1), reverse=Tr... | 3.734375 | 4 |
brain/src/model/firmware_error.py | siddharthkundu/raspberry-pi-os-image-builder | 0 | 45830 | from __future__ import annotations
from enum import unique, IntEnum
import json
@unique
class ErrorType(IntEnum):
WARNING = 5
ERROR = 6
OK = 4
class FirmwareError:
def __init__(self, number: int, task: str, description: str) -> None:
self.number = number
self.task = task
sel... | 2.640625 | 3 |
habitat/extravehicular/migrations/0001_initial.py | matrach/habitatOS | 1 | 45831 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-29 18:53
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import habitat.timezone.models.martian_standard_time
class Migration(migrations.Mi... | 1.726563 | 2 |
scraper/storage_spiders/vanphongphamanhkhoacom.py | chongiadung/choinho | 0 | 45832 | <reponame>chongiadung/choinho<gh_stars>0
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='clus']/h2[@class='nomargin title_sp']",
'price' : "//h2[@class='nomargin']/font... | 1.976563 | 2 |
src/pysonata/sonata/tests/circuit/test_file.py | AllenInstitute/project7 | 35 | 45833 | import pytest
import tempfile
from conftest import load_circuit_files
def test_load_files():
# load nodes file
net = load_circuit_files(data_files='examples/v1_nodes.h5', data_type_files='examples/v1_node_types.csv')
assert(net.nodes is not None)
assert(net.has_nodes)
assert(net.edges is None)
... | 2.359375 | 2 |
segeval/ml/test.py | cfournie/segmentation.evaluation | 27 | 45834 | <filename>segeval/ml/test.py
'''
Tests the machine learning (ML) statistics functions, and ml package.
.. moduleauthor:: <NAME> <<EMAIL>>
'''
from __future__ import absolute_import
import unittest
from decimal import Decimal
from segeval.ml import (
__precision__, precision, __recall__, recall, __fmeasure__,
f... | 2.796875 | 3 |
Gold_Badges/Ayuba_Badge/backend/frontend/tests.py | MoonX-Hub/Voting | 5 | 45835 | <filename>Gold_Badges/Ayuba_Badge/backend/frontend/tests.py
#from django.test import TestCase
# Create your tests here.
from algosdk import account,mnemonic
def generateAccount():
private_key, public_key = account.generate_account()
print('addr:',public_key)
print('mnemonic:',mnemonic.from_private_key(pr... | 1.671875 | 2 |
ez_utils/verify_code_utils.py | darkripples/none-web-frame | 2 | 45836 | <reponame>darkripples/none-web-frame<gh_stars>1-10
# !/usr/bin/env python
# coding:utf8
"""
@Time : 2019/11/23
@Author : fls
@Contact : <EMAIL>
@Desc : fls易用性utils-验证码相关utils
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2019/11/23 ... | 2.3125 | 2 |
blockchain/diophantine_equation.py | ikr4mm/Python | 79 | 45837 | <gh_stars>10-100
# https://en.wikipedia.org/wiki/Diophantine_equation
from typing import Tuple
def diophantine(a: int, b: int, c: int) -> Tuple[float, float]:
"""
Persamaan Diophantine : Diberikan bilangan bulat a,b,c
( setidaknya satu dari a dan b != 0),
persamaan diophantine a*x + b*y = c
memil... | 3.703125 | 4 |
pyrandall/network.py | kpn/pyrandall | 2 | 45838 | <gh_stars>1-10
import posixpath
from urllib.parse import urljoin, urlparse
def extend_url(base, path):
url_parsed = urlparse(base)
# append should not overwrite a path on the base (example: google.com/nl)
if path[0] == "/":
sanitized_path = path[1:]
else:
sanitized_path = path
retu... | 3.171875 | 3 |
pytesster.py | HuizhangXu/BJTU_Grab_Class | 4 | 45839 | from PIL import Image
import pytesser
import pytesseract
image = Image.open('test.jpg')
print(pytesseract.image_file_to_string('test.jpg'))
print(pytesseract.image_to_string(image))
| 2.828125 | 3 |
gpvdm_data/shape/Gaus/example.py | roderickmackenzie/gpvdm | 12 | 45840 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from gpvdm_api import gpvdm_api
def run():
a=gpvdm_api(verbose=True)
a.set_save_dir(device_data)
a.edit("light.inp","#light_model","qe")
a.edit("jv0.inp","#Vstop","0.8")
a.run() | 1.640625 | 2 |
scripts/npc/make_ston.py | varenty-x/v204.1 | 9 | 45841 | # Eurek the Alchemist (2040050)
from net.swordie.ms.constants import JobConstants
echoDict = {
112: 1005, # Hero
122: 1005, # Paladin
132: 1005, # Dark Knight
212: 1005, # F/P
222: 1005, # I/L
232: 1005, # Bishop
312: 1005, # Bowmaster
322: 1005, # Marksman
412: 1005, # Night Lord
... | 1.820313 | 2 |
parens/plistd.py | NoraCodes/pyparens | 2 | 45842 | # plistd.py
# Python LIsp STanDard library
def makelist(*args):
" Create a list from arguments. "
return list(args)
def quote(*args):
return ['"{}"'.format(a) if isinstance(a, str) else a for a in args]
def cond(test, then, else_=False, *, env):
from .eval import eval
return eval(then if test ... | 3.171875 | 3 |
mininet/mininet/mapper/mapper.py | a815027104/Distrinet | 16 | 45843 | from distriopt import VirtualNetwork
from distriopt.embedding.physical import PhysicalNetwork
from distriopt.embedding.algorithms import (
EmbedBalanced,
# EmbedILP,
EmbedPartition,
EmbedGreedy,
)
from distriopt.packing.algorithms import ( BestFitDopProduct,
Fir... | 2.375 | 2 |
login.py | fengli5588/test01 | 0 | 45844 | num = 1
val = 2
val2 = 333333
val2 = 333
val3 = 55555
| 1.40625 | 1 |
test_functions/test_edo.py | otoolej/envelope_derivative_operator | 7 | 45845 | <gh_stars>1-10
"""
functions to run through all 5 test signals and plot
<NAME>, University College Cork
Started: 05-09-2019
last update: <2019-09-04 13:36:01 (otoolej)>
"""
import numpy as np
from matplotlib import pyplot as plt
from energy_operators import edo as ed
from test_functions import gen_test_signals as gs
... | 3.0625 | 3 |
tests/python/cuda/test_features.py | jakeKonrad/torch-quiver | 196 | 45846 | import torch
import torch_quiver as torch_qv
import random
import numpy as np
import time
from typing import List
from quiver.shard_tensor import ShardTensor, ShardTensorConfig, Topo
from quiver.utils import reindex_feature
import torch.multiprocessing as mp
from torch.multiprocessing import Process
import os
import sy... | 1.976563 | 2 |
jpp_boosted_django/jpp_boosted/website/templatetags/project_overview_list.py | QualmandDriven/jpp_boosted | 1 | 45847 | from django import template
from django.template.loader import get_template
register = template.Library()
@register.inclusion_tag('project_overview_list.html')
def project_overview_list(project_list):
return {'project_list': project_list} | 1.664063 | 2 |
Swimple_Server/consumers.py | gordiig/Swimple-Server | 0 | 45848 | <reponame>gordiig/Swimple-Server<gh_stars>0
from channels.generic.websocket import WebsocketConsumer
from asgiref.sync import async_to_sync
import json
class ChatConsumer(WebsocketConsumer):
ONLINE_GROUP_NAME = 'online'
def connect(self):
print('Connect')
async_to_sync(self.channel_layer.grou... | 2.484375 | 2 |
billboard/display.py | setrofim/billboard | 1 | 45849 | import os
import logging
from PyQt4.QtCore import Qt, QObject, SIGNAL
from PyQt4.QtGui import (QMainWindow, QWidget, QPixmap, QLabel,
QGraphicsDropShadowEffect, QColor,
QDesktopWidget)
class BillboardDisplay(QMainWindow):
def __init__(self, parent=None, workdir=... | 2.375 | 2 |
platformio/test/command.py | ufo2011/platformio-core | 0 | 45850 | # Copyright (c) 2014-present PlatformIO <<EMAIL>>
#
# 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 ag... | 1.75 | 2 |
archives/learning/bp/ch24/asynchat-example-1.py | mcxiaoke/python-labs | 7 | 45851 | # File: asynchat-example-1.py
import asyncore, asynchat
import os, socket, string
PORT = 8000
class HTTPChannel(asynchat.async_chat):
def __init__(self, server, sock, addr):
asynchat.async_chat.__init__(self, sock)
self.set_terminator("\r\n")
self.request = None
self.data = ""
... | 3.09375 | 3 |
TEST_DATA.py | GundlackFelixDEV/pdf-template-service | 0 | 45852 | <reponame>GundlackFelixDEV/pdf-template-service<filename>TEST_DATA.py
PROFILE = {
"reciepientsFullName": "<NAME>",
"lastName": "Mustermann",
"title": "Mr.",
"reciepientsAddress": "Musterstraße 11",
"zipCode": "123456",
"city": "Musterhausen",
"IBAN": "DE07123412341234123412"
}
NF_FORM = {
... | 1.65625 | 2 |
tests/tflite_test_runner.py | xhuohai/nncase | 0 | 45853 | <filename>tests/tflite_test_runner.py
import tensorflow as tf
from test_runner import *
import os
import shutil
class TfliteTestRunner(TestRunner):
def __init__(self, case_name, targets=None, overwrite_configs: dict = None):
super().__init__(case_name, targets, overwrite_configs)
self.model_type =... | 2.390625 | 2 |
EfficientDetObjectDetector.py | atlan-antillia/EfficientDet-USA-RoadSigns | 0 | 45854 | <reponame>atlan-antillia/EfficientDet-USA-RoadSigns<gh_stars>0
# ==============================================================================
# Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 1.515625 | 2 |
algolib/graphs/simple_graph.py | ref-humbold/AlgoLib_Python | 0 | 45855 | # -*- coding: utf-8 -*-
"""Structure of simple graph"""
from abc import ABCMeta, abstractmethod
from typing import Any, Iterable, Optional, Union
from .graph import Edge, Graph, Vertex
class _GraphRepresentation:
def __init__(self, vertex_ids=None):
self._properties = {}
if vertex_ids is not Non... | 3.203125 | 3 |
r2d2.py | clumsyme/r2d2 | 0 | 45856 | <filename>r2d2.py
import os
from contextlib import contextmanager
@contextmanager
def goto(directory: str):
"""进入目标目录 -> 操作 -> 返回之前目录
用于临时进入目标目录进行操作,如果目标目录不存在,则会被创建
with goto('/my/directory'):
process()
"""
cwd = os.getcwd()
if not os.path.exists(directory):
os.makedirs(directo... | 2.96875 | 3 |
generate_password/random_sample.py | XinyueZ/some-python-codes | 0 | 45857 | <gh_stars>0
"""
This is another sample to generate password.
"""
import random
# Use an import statement at the top
word_file = "words.txt"
word_list = []
#fill up the word_list
with open(word_file,'r') as words:
for line in words:
# remove white space and make everything lowercase
word = line.st... | 3.78125 | 4 |
deepsim/test/test_deepsim/core/test_quaternion.py | aws-deepracer/deepsim | 1 | 45858 | <reponame>aws-deepracer/deepsim
#################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Ver... | 2.40625 | 2 |
ramda/ap.py | zydmayday/pamda | 1 | 45859 | from .map import map
from .private._concat import _concat
from .private._curry2 import _curry2
from .private._helper import getAttribute
from .private._isFunction import _isFunction
from .private._reduce import _reduce
def inner_ap(applyF, applyX):
if _isFunction(getAttribute(applyX, 'fantasy-land/ap')):
return... | 2.328125 | 2 |
scripts/client/set-override.py | JeffersonLab/jaws | 2 | 45860 | <reponame>JeffersonLab/jaws
#!/usr/bin/env python3
import os
import pwd
import types
import click
import time
from confluent_kafka import SerializingProducer
from confluent_kafka.schema_registry import SchemaRegistryClient
from jlab_jaws.avro.entities import AlarmOverrideUnion, LatchedOverride, FilteredOverride, Mas... | 1.859375 | 2 |
toxaway/views/contract/__init__.py | cmickeyb/toxaway | 0 | 45861 | <filename>toxaway/views/contract/__init__.py
#!/usr/bin/env python
#
# 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 ap... | 1.96875 | 2 |
src/config/schema-transformer/schema_transformer/resources/bgp_router.py | atsgen/tf-controller | 37 | 45862 | #
# Copyright (c) 2019 Juniper Networks, Inc. All rights reserved.
#
from builtins import str
from cfgm_common.exceptions import NoIdError, RefsExistError
from vnc_api.gen.resource_client import BgpRouter
from vnc_api.gen.resource_xsd import AddressFamilies, BgpSessionAttributes
from vnc_api.gen.resource_xsd import B... | 1.695313 | 2 |
Exercicios-Python/CursoEmVideo/ex035.py | bruno1906/ExerciciosPython | 0 | 45863 | <filename>Exercicios-Python/CursoEmVideo/ex035.py<gh_stars>0
print('-*-'*20)
print('Analisador de triângulos ')
print('-*-'*20)
r1=float(input('Primeiro segmento:'))
r2=float(input('Segundo segmento:'))
r3=float(input('Terceiro segmento:'))
if r1<r2+r3 and r2<r1+r3 and r3<r1+r2:
print('Os segmentos acima podem form... | 3.609375 | 4 |
startup/23-feedback.py | NSLS-II-ISS/profile_collection | 0 | 45864 | <filename>startup/23-feedback.py
from xas.pid import PID
from xas.image_analysis import determine_beam_position_from_fb_image
#
#
from piezo_feedback.piezo_fb import PiezoFeedback
from PyQt5.QtCore import QThread
machine_name = os.uname()[1]
if 'ws1' in machine_name:
local_hostname = 'ws01'
elif 'ws2' in machine... | 2.1875 | 2 |
views.py | pythonran/easy_server | 0 | 45865 | <reponame>pythonran/easy_server
from view_core import View
from easyserver import easyResponse
import json
class Index(View):
def get(self, request):
print request
data = {
"body": request.body,
"option": "test"
}
return easyResponse(json.dumps(data))
| 2.453125 | 2 |
3.py | hubieva-a/lab5 | 0 | 45866 | # Дано предложение. Удалить из него все буквы о, стоящие на нечетных местах.
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
n = str(input("Предложение - "))
m = len(n)
for i in range(1, m):
i = str(i)
if n.find(i) % 2 == 1:
n = n.replace('... | 4.15625 | 4 |
2015/03/fc_2015_03_12.py | mfwarren/FreeCoding | 0 | 45867 | <gh_stars>0
#!/usr/bin/env python3
# imports go here
import pika
import multiprocessing
import time
import random
import json
import logging
import datetime
#
# Free Coding session for 2015-03-12
# Written by <NAME>
#
logger = logging.getLogger(__name__)
def get_temperatures():
return {'celcius': [random.rand... | 2.515625 | 3 |
profbit/coinbase_stats.py | prof-bit/profbit-api | 43 | 45868 | <filename>profbit/coinbase_stats.py<gh_stars>10-100
import datetime
import re
from collections import defaultdict
from copy import copy
from enum import Enum
from functools import lru_cache
from urllib import parse
from coinbase.wallet.client import OAuthClient
from .app import app
from .currency_map import CURRENCY_... | 2.875 | 3 |
apps/staff/management/commands/addemall.py | mrtaalebi/sitigo | 0 | 45869 | from django.core.management import BaseCommand
from apps.staff.models import Team, Role, Staff
from apps.content.models import Event
class Command(BaseCommand):
help = '''
team_csv format:
team.persian_name, team.english_name, team.position_from_top
role_csv format:
role.... | 2.0625 | 2 |
test/test_trustProcessor/test_worker.py | mugpahug/pycu-sdr | 1 | 45870 | # Copyright: (c) 2021, <NAME>
import sys
sys.path.append('../../py-cuda-sdr/')
sys.path.append('../')
import importlib
import softCombiner
import json,rjsmin
importlib.reload(softCombiner)
import numpy as np
import matplotlib.pyplot as plt
import logging
import zmq
import time
import unittest
import numpy as np
imp... | 1.992188 | 2 |
Deployment/extract_chorus.py | Parvez13/Predicting-Hit-Songs-Using-Repeated-Chorus | 0 | 45871 | from pychorus import find_and_output_chorus
def extract_song_chorus(path, main):
# songname = path.split('/',2)[0].split('.')[0]
Newpath = main + '/' + "song_to_predict"+'.wav'
chorus = find_and_output_chorus(path, Newpath, 15)
if chorus == None:
return None
else:
return Newpath
| 2.875 | 3 |
api/stats.py | ryomakawakami/chess-app | 0 | 45872 | <filename>api/stats.py
from flask import request
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_restx import Namespace, Resource, fields
from models import Stats
stats_ns = Namespace('stats', description='A namespace for stats.')
stats_model = stats_ns.model('Stats', {
'id': fields.Inte... | 2.46875 | 2 |
aula7/exercicio/exercicio2.py | diegocolombo1989/Trabalho-Python | 0 | 45873 | #--- Exercício 2 - Dicionários
#--- Escreva um programa que leia os dados de 11 jogadores
#--- Jogador: Nome, Posicao, Numero, PernaBoa
#--- Crie um dicionario para armazenar os dados
#--- Imprima todos os jogadores e seus dados
#--- Resolução <NAME>
lista_jogadores=[]
for i in range(1,3):
Nome=input('Digite o no... | 3.953125 | 4 |
plotaif.py | dwsideriusNIST/adsorptioninformationformat | 5 | 45874 | <reponame>dwsideriusNIST/adsorptioninformationformat<filename>plotaif.py
# -*- coding: utf-8 -*-
"""Plot AIF from command line"""
import sys
import os
from gemmi import cif # pylint: disable-msg=no-name-in-module
import matplotlib.pyplot as plt
import numpy as np
filename = sys.argv[1]
aif = cif.read(filename)
block... | 2.578125 | 3 |
fastapi_token/oauth2.py | yangyaofei/fastapi-token-gen | 0 | 45875 | import hashlib
import math
import time
import typing
import jwt
import pydantic
from fastapi.exceptions import HTTPException
from fastapi.requests import Request
from fastapi.security import OAuth2PasswordBearer
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
from fastapi_token.encrypt import g... | 2.484375 | 2 |
Step02_Build_CNN_model/makeFiles4Basset.py | talkowski-lab/SMC_CNN_Model | 1 | 45876 | <filename>Step02_Build_CNN_model/makeFiles4Basset.py
#!/usr/bin/env python
from __future__ import division
import numpy.random as npr
import pysam
from Bio.Seq import reverse_complement
BASSET_FOLDER = ""
def makeBed(a,cl,inside=25,outside=75,reg=2):
d=[]
genome = pysam.Fastafile("../Input_data/GRCh37.fa")... | 2.40625 | 2 |
tests/unit_tests/test_system_program.py | 524119574/solana-py | 0 | 45877 | """Unit tests for solana.system_program."""
import solana.system_program as sp
from solana.account import Account
def test_transfer():
"""Test creating a transaction for transfer."""
params = sp.TransferParams(from_pubkey=Account().public_key(), to_pubkey=Account().public_key(), lamports=123)
txn = sp.tra... | 2.5625 | 3 |
vaultier/vaultier/urls_api.py | dz0ny/Vaultier | 30 | 45878 | <gh_stars>10-100
from django.conf.urls import patterns, url
from rest_framework import routers
from accounts.api import UserViewSet, LostKeyViewSet, AuthView, MemberViewSet
from nodes.api import NodeViewSet, NodePathView, NodeDataView, PolicyViewSet
from news.api import NewsApiView
from search.api import SearchView
fr... | 1.773438 | 2 |
code_reviews/palabras_largas/palabras_largas_refactored.py | proto-tools-docs/Soluciones | 0 | 45879 | <reponame>proto-tools-docs/Soluciones
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython
Solución completa en:
https://github.com/AyudaEnPython/Soluciones/blob/main/ejercicios/palabras_largas.py
"""
from prototools.entradas import entrada_int
def solver(s: str, n: int) -> bool:
return any(len(e) >= n ... | 3.5 | 4 |
classes/wars.py | aarkwright/pyThia | 0 | 45880 | from .helpers import *
class War(ESIBase):
def __init__(self, app, client):
super().__init__(app, client)
def get_wars(self):
pass
| 1.726563 | 2 |
rotkehlchen/db/ledger_actions.py | rotkehlchenio/rotkehlchen | 137 | 45881 | <filename>rotkehlchen/db/ledger_actions.py
import logging
from typing import TYPE_CHECKING, List, Optional, Tuple
from pysqlcipher3 import dbapi2 as sqlcipher
from rotkehlchen.accounting.ledger_actions import LedgerAction
from rotkehlchen.constants.limits import FREE_LEDGER_ACTIONS_LIMIT
from rotkehlchen.db.filtering... | 2.328125 | 2 |
sarcastic_bot/inference.py | sarvasvarora/sarcasm-generator | 1 | 45882 | <gh_stars>1-10
import transformers
from utils import get_tokenizer
import numpy as np
import torch as pt
def get_reply(comment: str, model_path: str) -> str:
# load model and tokenizer
try:
model = pt.load(model_path, map_location=pt.device('cpu'))
model.eval()
tokenizer = get_tokenize... | 2.640625 | 3 |
src/filter/filter_with_hvg/script.py | openpipeline-bio/openpipeline | 2 | 45883 | import scanpy as sc
import muon as mu
import numpy as np
## VIASH START
par = {
'input': 'resources_test/pbmc_1k_protein_v3/pbmc_1k_protein_v3_filtered_feature_bc_matrix.h5mu',
'modality': ['rna'],
'output': 'output.h5mu',
'var_name_filter': 'filter_with_hvg',
'do_subset': False,
'flavor': 'seurat',
'n_t... | 2.265625 | 2 |
Tests/test_database.py | nas-/steam-inv-dumper | 0 | 45884 | import decimal
import os
from datetime import datetime
from unittest import TestCase
from db.db import Listing, Item, init_db
TWODIGITS = decimal.Decimal('0.01')
class TestSteamDatabase(TestCase):
@classmethod
def tearDownClass(cls) -> None:
os.remove('sales_test.sqlite')
@classmethod
def s... | 2.828125 | 3 |
hub/models/__init__.py | harenlewis/api-hub | 0 | 45885 | <filename>hub/models/__init__.py
from .projects import Project
from .apis import Api
from .permissions import APIPermissions
from .types import * | 1.242188 | 1 |
adapter/acumos/tests/fixtures/models/example-model-listofm/example_model.py | onap/dcaegen2-platform | 0 | 45886 | <reponame>onap/dcaegen2-platform<gh_stars>0
# ============LICENSE_START====================================================
# org.onap.dcae
# =============================================================================
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
# ========================... | 1.96875 | 2 |
src/main/python/ftm/plot_events.py | lucb31/beam | 0 | 45887 | <gh_stars>0
import xml.etree.ElementTree as ET
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import datetime
import tikzplotlib
import numpy as np
from os import path
from python.ftm.charging_power_calculation import calc_avg_charging_power_numeric
from python.ftm.util import se... | 2.671875 | 3 |
test-grandchild-zombie.py | tsaarni/11th-init | 0 | 45888 | #!/usr/bin/env -S python3 -u
import os
import time
pid = os.fork()
if pid != 0:
print("Child pid={}".format(pid))
time.sleep(999999)
else:
time.sleep(1)
# child forks grandchild and exits
pid2 = os.fork()
if pid2 != 0:
print("Grandchild pid={}".format(pid2))
time.sleep(5)
print("Child exits a... | 2.859375 | 3 |
hello/views.py | CupOfJoe-L/python-docs-hello-django | 0 | 45889 | <reponame>CupOfJoe-L/python-docs-hello-django
from django.http import HttpResponse
from django.shortcuts import render
def hello(request):
return HttpResponse("Hello, World! And everyone out there! This is the Django Version of the App I'm trying to Deploy.")
| 1.84375 | 2 |
HuberyBlog/extra_apps/django_comments/migrations/0004_auto_20190130_1520.py | SomnambulistOfChina/ChineseSomnambulist | 5 | 45890 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2019-01-30 15:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_comments', '0003_add_submit_date_index'),
]
operations = [
migration... | 1.546875 | 2 |
inputs/stations/extract_china_station_raw.py | bearlin/tool_get_famous_scenery_station_airport_and_their_scws_tokens | 0 | 45891 | <filename>inputs/stations/extract_china_station_raw.py
#!/usr/bin/python
from sys import argv
import re
import codecs
print "Start."
script, filename = argv
print "script: %r." % script
print "filename: %r." % filename
print "Opening the rawfile..."
rawfile = codecs.open(filename, 'r', encoding='utf-8')
dumpfile = c... | 3.390625 | 3 |
test/test_1020.py | ralphribeiro/uri-projecteuler | 0 | 45892 | from unittest import TestCase
from exercicios.ex1020 import calcula_idade_em_dias
class TesteEx1020(TestCase):
def test_400_dever_retornar_1ano_1mes_5dia(self):
chamada = 400
esperado = '1 ano(s)\n1 mes(es)\n5 dia(s)'
self.assertEqual(calcula_idade_em_dias(chamada), esperado)
def te... | 3 | 3 |
operators/keycloak-operator/python/pulumi_pulumi_kubernetes_crds_operators_keycloak_operator/keycloak/v1alpha1/__init__.py | pulumi/pulumi-kubernetes-crds | 0 | 45893 | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .Keycloak import *
from .KeycloakBackup import *
from .KeycloakClient import *
from .KeycloakRealm import *
from .Ke... | 1.09375 | 1 |
atlas/foundations_events/src/integration/__init__.py | DeepLearnI/atlas | 296 | 45894 | <gh_stars>100-1000
import foundations
from integration.test_consumers import TestConsumers | 1.132813 | 1 |
APMSSO_Ansible/plugins/callback/apmsso_callback_log.py | CA-APM/infra-agent-automation | 0 | 45895 | <gh_stars>0
# (c) 2012-2014, <NAME> <<EMAIL>>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: default
type: stdout
s... | 1.921875 | 2 |
research/deeplab/datasets/add_voc2012_aug_dataset.py | dohai90/models | 0 | 45896 | # 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 the ... | 2.21875 | 2 |
customize/urls.py | soma115/wikikracja | 7 | 45897 | from django.urls import path
from . import views as v
app_name = 'customize'
# urlpatterns = (
# path('view/', v.view, name='view'),
# # path('edit/<int:pk>/', v.edit, name='edit'),
# )
| 1.796875 | 2 |
year1/python/coursework_(anagrams)/efficiency.py | OthmanEmpire/university | 1 | 45898 | ##### Student name: <NAME>
##### Student ID: 200 684 094
### This program has a series of functions/procedures that produce anagrams.
### The final procedure/function of the program reads from a text file, extracts
### all student names and then produces a one word and two word anagrams.
# This function takes two s... | 4.25 | 4 |
viewwork/management/commands/vw_namespace.py | pikhovkin/django-viewwork | 4 | 45899 | import sys
from django.apps import apps
from django.core.management import BaseCommand
from viewwork import BaseViewWork
from viewwork.models import Menu
class Command(BaseCommand):
def add_arguments(self, parser):
super().add_arguments(parser)
parser.add_argument('action', action='store', type... | 2.015625 | 2 |