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 |
|---|---|---|---|---|---|---|
examples/source/benchmarks/googlenet_model.py | ably77/dcos-tensorflow-tools | 7 | 7800 | <reponame>ably77/dcos-tensorflow-tools
# Copyright 2017 The TensorFlow Authors. 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://www.apache.org/licenses/LIC... | 1.890625 | 2 |
demos/prey-predator/prey_predator_abm/sim_params.py | neo-empresarial/covid-19 | 3 | 7801 | """
Simulation parameters.
"""
SIMULATION_TIME_STEPS = 300
| 0.964844 | 1 |
process_ops.py | gcosne/generative_inpainting | 11 | 7802 | <reponame>gcosne/generative_inpainting
import cv2
import numpy as np
try:
import scipy
# scipy.ndimage cannot be accessed until explicitly imported
from scipy import ndimage
except ImportError:
scipy = None
def flip_axis(x, axis):
x = np.asarray(x).swapaxes(axis, 0)
x = x[::-1, ...]
x = x... | 2.59375 | 3 |
keystone/tests/unit/token/test_provider.py | maestro-hybrid-cloud/keystone | 0 | 7803 | <filename>keystone/tests/unit/token/test_provider.py
# 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... | 2.046875 | 2 |
fasm2bels/database/connection_db_utils.py | mithro/symbiflow-xc-fasm2bels | 0 | 7804 | import functools
def create_maybe_get_wire(conn):
c = conn.cursor()
@functools.lru_cache(maxsize=None)
def get_tile_type_pkey(tile):
c.execute('SELECT pkey, tile_type_pkey FROM phy_tile WHERE name = ?',
(tile, ))
return c.fetchone()
@functools.lru_cache(maxsize=None... | 2.28125 | 2 |
ppr-api/src/services/payment_service.py | bcgov/ppr-deprecated | 1 | 7805 | """A module that provides functionality for accessing the Payments API."""
import enum
import http
import logging
import requests
from fastapi import Depends, Header, HTTPException
from fastapi.security.http import HTTPAuthorizationCredentials
import auth.authentication
import config
import schemas.payment
logger ... | 3.125 | 3 |
SmerekaRoman/HW_6/HW 6.3.py | kolyasalubov/Lv-639.pythonCore | 0 | 7806 | <reponame>kolyasalubov/Lv-639.pythonCore
def numb_of_char(a):
d = {}
for char in set(a):
d[char] = a.count(char)
return d
a = numb_of_char(str(input("Input the word please: ")))
print(a)
| 3.5625 | 4 |
0201-0300/0251-Flatten 2D Vector/0251-Flatten 2D Vector.py | jiadaizhao/LeetCode | 49 | 7807 | <reponame>jiadaizhao/LeetCode
class Vector2D:
def __init__(self, v: List[List[int]]):
def getIt():
for row in v:
for val in row:
yield val
self.it = iter(getIt())
self.val = next(self.it, None)
def next(self) -> int:
... | 3.40625 | 3 |
logger_decorator.py | jbhayback/reconciliation-manager | 0 | 7808 | from datetime import datetime
import inspect
def log_time(msg=None):
def decorator(f):
nonlocal msg
if msg is None:
msg = '{} time spent: '.format(f.__name__)
def inner(*args, **kwargs):
# check if the object has a logger
global logger
if ar... | 2.9375 | 3 |
lf3py/di/__init__.py | rog-works/lf3py | 0 | 7809 | <gh_stars>0
from lf3py.di.di import DI # noqa F401
| 1.109375 | 1 |
critical/tasks.py | lenarother/django-critical-css | 2 | 7810 | <reponame>lenarother/django-critical-css
import logging
from django.utils.safestring import mark_safe
from django_rq import job
from inline_static.css import transform_css_urls
logger = logging.getLogger(__name__)
@job
def calculate_critical_css(critical_id, original_path):
from .exceptions import CriticalExcep... | 1.921875 | 2 |
test.py | wei2912/bce-simulation | 0 | 7811 | <filename>test.py<gh_stars>0
#!/usr/bin/env python
# coding=utf-8
"""
This script tests the simulations of the experiments.
"""
import math
from utils import coin_var, needle_var
def main():
needle_var_vals = [
(1.1, 1.0),
(1.4, 1.0),
(2.0, 1.0),
(2.9, 1.0),
(3.3, 1.0),
... | 2.75 | 3 |
instructions/instructions.py | fernandozanutto/PyNES | 0 | 7812 | <reponame>fernandozanutto/PyNES
from addressing import *
from instructions.base_instructions import SetBit, ClearBit
from instructions.generic_instructions import Instruction
from status import Status
# set status instructions
class Sec(SetBit):
identifier_byte = bytes([0x38])
bit = Status.StatusTypes.carry
... | 2.71875 | 3 |
python/530.minimum-absolute-difference-in-bst.py | vermouth1992/Leetcode | 0 | 7813 | #
# @lc app=leetcode id=530 lang=python3
#
# [530] Minimum Absolute Difference in BST
#
# https://leetcode.com/problems/minimum-absolute-difference-in-bst/description/
#
# algorithms
# Easy (55.23%)
# Total Accepted: 115.5K
# Total Submissions: 209K
# Testcase Example: '[4,2,6,1,3]'
#
# Given the root of a Binary S... | 3.796875 | 4 |
tensorflow/python/eager/remote_cloud_tpu_test.py | abhaikollara/tensorflow | 26 | 7814 | <reponame>abhaikollara/tensorflow<filename>tensorflow/python/eager/remote_cloud_tpu_test.py<gh_stars>10-100
# Copyright 2019 The TensorFlow Authors. 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 obtai... | 1.820313 | 2 |
test/functional/bsv-blocksize-params.py | gbtn/bitcoin-sv-gbtn | 3 | 7815 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test that the blockmaxsize and excessiveblocksize paramete... | 2.21875 | 2 |
yotta/test/cli/outdated.py | headlessme/yotta | 0 | 7816 | <reponame>headlessme/yotta
#!/usr/bin/env python
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
# internal modules:
from . import util
from . import cli
Test_Outdated = {
'module.json':'''{
"name": "tes... | 2.046875 | 2 |
geoposition/tests/urls.py | Starcross/django-geoposition | 0 | 7817 | <filename>geoposition/tests/urls.py
from django.urls import path, include
from django.contrib import admin
from example.views import poi_list
admin.autodiscover()
urlpatterns = [
path('', poi_list),
path('admin/', admin.site.urls),
]
| 1.835938 | 2 |
A_Stocker/Stocker.py | Allen1218/Python_Project_Interesting | 1 | 7818 | <reponame>Allen1218/Python_Project_Interesting<filename>A_Stocker/Stocker.py
import threading
import tushare as ts
import pandas as pd
import datetime
STOCK = {#'002594':[1,170.15], ## 比亚迪 / 几手,成本价
'601012':[11,99.9], ## 隆基股份
'002340':[12,8.72], ## 格林美
'603259':[1,141.7], ## 药明康德
... | 2.671875 | 3 |
tests/extractors/test_etrade.py | mkazin/StatementRenamer | 0 | 7819 | <filename>tests/extractors/test_etrade.py
from datetime import datetime
from statement_renamer.extractors.etrade import ETradeDateExtractor as EXTRACTOR_UNDER_TEST
from statement_renamer.extractors.factory import ExtractorFactory
TESTDATA = (
"""
PAGE 1 OF 6 February 1, 2019 - March 31, 2019AccountNumber:###... | 2.75 | 3 |
Estrutura_Decisao/who.py | M3nin0/supreme-broccoli | 0 | 7820 | <reponame>M3nin0/supreme-broccoli<gh_stars>0
prod1 = float(input("Insira o valor do produto A: "))
prod2 = float(input("Insira o valor do produto B: "))
prod3 = float(input("Insira o valor do produto C: "))
if prod1 < prod2 and prod1 < prod3:
print ("Escolha o produto A é o mais barato")
elif prod2 < prod1 and pro... | 3.828125 | 4 |
ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/train/experimental/__init__.py | Lube-Project/ProgettoLube | 2 | 7821 | <reponame>Lube-Project/ProgettoLube
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Public API for tf.train.experimental namespace.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.pyth... | 1.28125 | 1 |
SciDataTool/Methods/VectorField/plot_3D_Data.py | BenjaminGabet/SciDataTool | 0 | 7822 | <gh_stars>0
def plot_3D_Data(
self,
*arg_list,
is_norm=False,
unit="SI",
component_list=None,
save_path=None,
x_min=None,
x_max=None,
y_min=None,
y_max=None,
z_min=None,
z_max=None,
z_range=None,
is_auto_ticks=True,
is_auto_range=False,
is_2D_view=False,
... | 2.609375 | 3 |
tests/unittests/plotting/test_plotly_backend.py | obilaniu/orion | 1 | 7823 | <reponame>obilaniu/orion<filename>tests/unittests/plotting/test_plotly_backend.py
"""Collection of tests for :mod:`orion.plotting.backend_plotly`."""
import copy
import numpy
import pandas
import plotly
import pytest
import orion.client
from orion.analysis.partial_dependency_utils import partial_dependency_grid
from ... | 2.0625 | 2 |
autodiff/debug_vjp.py | Jakob-Unfried/msc-legacy | 1 | 7824 | import pdb
import warnings
from jax import custom_vjp
@custom_vjp
def debug_identity(x):
"""
acts as identity, but inserts a pdb trace on the backwards pass
"""
warnings.warn('Using a module intended for debugging')
return x
def _debug_fwd(x):
warnings.warn('Using a module intended for debu... | 2.28125 | 2 |
mileage.py | vwfinley/mileage | 0 | 7825 | #!/usr/bin/env python
# Some helpful links
# https://docs.python.org/3/library/tkinter.html
# https://www.python-course.eu/tkinter_entry_widgets.php
import tkinter as tk
class Application(tk.Frame):
def __init__(self, root=None):
super().__init__(root)
self.root = root
... | 4.0625 | 4 |
rankings/elo.py | ulternate/table_tennis_league | 0 | 7826 | def elo(winner_rank, loser_rank, weighting):
"""
:param winner: The Player that won the match.
:param loser: The Player that lost the match.
:param weighting: The weighting factor to suit your comp.
:return: (winner_new_rank, loser_new_rank) Tuple.
This follows the ELO ranking method.
"""
... | 3.75 | 4 |
src/samplics/regression/glm.py | samplics-org/samplics | 14 | 7827 | <gh_stars>10-100
from __future__ import annotations
from typing import Any, Callable, Optional, Union
import numpy as np
# import pandas as pd
import statsmodels.api as sm
from samplics.estimation.expansion import TaylorEstimator
from samplics.utils.formats import dict_to_dataframe, fpc_as_dict, numpy_array, remove... | 2.125 | 2 |
tests/test_scopes.py | leg100/scopes | 0 | 7828 | <filename>tests/test_scopes.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `scopes` package."""
import os
print(os.getenv('PYTHONPATH'))
import pytest
from click.testing import CliRunner
from scopes.tasks import tasks, bolt, spout, builder
from scopes.graph import G, build, topological_sort, traver... | 2.328125 | 2 |
timeparse/LunarSolarConverter/__init__.py | tornadoyi/timeparse | 0 | 7829 | # -*- coding: utf-8 -*-
__author__ = 'isee15'
import LunarSolarConverter
converter = LunarSolarConverter.LunarSolarConverter()
def LunarToSolar(year, month, day, isleap = False):
lunar = LunarSolarConverter.Lunar(year, month, day, isleap)
solar = converter.LunarToSolar(lunar)
return (solar.solarYear, sol... | 3.21875 | 3 |
examples/hello-pt/custom/cifar10validator.py | ArnovanHilten/NVFlare | 155 | 7830 | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 1.859375 | 2 |
lambda/enable-traffic-mirroring.py | wrharding/aws-infra | 1 | 7831 | # MIT License
# Copyright (c) 2020-2021 <NAME> (https://www.chrisfarris.com)
# 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 restriction, including without limitation the rights
# t... | 1.554688 | 2 |
src/value_function.py | wu6u3/async_trpo | 6 | 7832 | <reponame>wu6u3/async_trpo
"""
State-Value Function
Written by <NAME> (pat-coady.github.io)
Modified by <NAME> (wu6u3) into asynchronous version
"""
import tensorflow as tf
import numpy as np
from sklearn.utils import shuffle
#import os
class NNValueFunction(object):
""" NN-based state-value function """
de... | 2.21875 | 2 |
mdepub/actions/__init__.py | bkidwell/mdepub | 35 | 7833 | <reponame>bkidwell/mdepub
"""mdepub actions -- these modules do the actual work."""
import archive
import clean
import create
import epub
import extract
import html
import newid
import version
| 0.84375 | 1 |
gbe/views/make_bid_view.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 1 | 7834 | from django.views.generic import View
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import never_cache
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.urls import reverse
from... | 1.90625 | 2 |
epicteller/core/dao/character.py | KawashiroNitori/epicteller | 0 | 7835 | <reponame>KawashiroNitori/epicteller<filename>epicteller/core/dao/character.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from collections import defaultdict
from typing import List, Optional, Iterable, Dict
import base62
from sqlalchemy import select, and_
from sqlalchemy.dialects.mysql import insert ... | 2.140625 | 2 |
examples/sentence_classfication/task_sentiment_classification_roformer_v2.py | Tongjilibo/bert4torch | 49 | 7836 | <gh_stars>10-100
#! -*- coding:utf-8 -*-
# 情感分类例子,RoPE相对位置编码
# 官方项目:https://github.com/ZhuiyiTechnology/roformer-v2
# pytorch参考项目:https://github.com/JunnYu/RoFormer_pytorch
from bert4torch.tokenizers import Tokenizer
from bert4torch.models import build_transformer_model, BaseModel
from bert4torch.snippets import seque... | 2.453125 | 2 |
pyscf/nao/test/test_0037_aos.py | fdmalone/pyscf | 1 | 7837 | # Copyright 2014-2018 The PySCF Developers. 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 1.984375 | 2 |
code_week12_713_719/is_graph_bipartite_hard.py | dylanlee101/leetcode | 0 | 7838 | '''
给定一个无向图graph,当这个图为二分图时返回true。
如果我们能将一个图的节点集合分割成两个独立的子集A和B,并使图中的每一条边的两个节点一个来自A集合,一个来自B集合,我们就将这个图称为二分图。
graph将会以邻接表方式给出,graph[i]表示图中与节点i相连的所有节点。每个节点都是一个在0到graph.length-1之间的整数。这图中没有自环和平行边: graph[i] 中不存在i,并且graph[i]中没有重复的值。
示例 1:
输入: [[1,3], [0,2], [1,3], [0,2]]
输出: true
解释:
无向图如下:
0----1
| |
| |
3----2
我们可以将... | 3.90625 | 4 |
data_preprocessing/decision_tree_regression.py | Frost199/Machine_Learning | 0 | 7839 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 06:44:47 2018
@author: <NAME>
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeRegressor
# importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
# take all the columns but leave the last on... | 3.265625 | 3 |
user_messages/apps.py | everaccountable/django-user-messages | 0 | 7840 | <filename>user_messages/apps.py
from django.apps import AppConfig
from django.conf import settings
from django.core import checks
from django.template import engines
from django.template.backends.django import DjangoTemplates
from django.utils.text import capfirst
from django.utils.translation import gettext_lazy as _
... | 1.976563 | 2 |
evalml/tests/objective_tests/test_standard_metrics.py | sharshofski/evalml | 0 | 7841 | from itertools import product
import numpy as np
import pandas as pd
import pytest
from sklearn.metrics import matthews_corrcoef as sk_matthews_corrcoef
from evalml.objectives import (
F1,
MAPE,
MSE,
AccuracyBinary,
AccuracyMulticlass,
BalancedAccuracyBinary,
BalancedAccuracyMulticlass,
... | 2.28125 | 2 |
server-python3/server.py | Aaron-Ming/websocket_terminal | 40 | 7842 | <reponame>Aaron-Ming/websocket_terminal<filename>server-python3/server.py<gh_stars>10-100
import os
import urllib.parse
import eventlet
import eventlet.green.socket
# eventlet.monkey_patch()
import eventlet.websocket
import eventlet.wsgi
import wspty.pipe
from flask import Flask, request, redirect
from wspty.EchoTermi... | 2.4375 | 2 |
tests/unit/test_roger_promote.py | seomoz/roger-mesos-tools | 0 | 7843 | # -*- encoding: utf-8 -*-
"""
Unit test for roger_promote.py
"""
import tests.helper
import unittest
import os
import os.path
import pytest
import requests
from mockito import mock, Mock, when
from cli.roger_promote import RogerPromote
from cli.appconfig import AppConfig
from cli.settings import Settings
from cl... | 2.21875 | 2 |
data/collectors.py | papb/COVID-19 | 6 | 7844 | <filename>data/collectors.py
import json
import pandas as pd
import requests
def load_dump_covid_19_data():
COVID_19_BY_CITY_URL='https://raw.githubusercontent.com/wcota/covid19br/master/cases-brazil-cities-time.csv'
by_city=(pd.read_csv(COVID_19_BY_CITY_URL)
.query('country == "Brazil"')
... | 3.109375 | 3 |
testsuite/testsuite_helpers.py | freingruber/JavaScript-Raider | 91 | 7845 | <gh_stars>10-100
import config as cfg
import utils
import native_code.executor as executor
number_performed_tests = 0
expectations_correct = 0
expectations_wrong = 0
def reset_stats():
global number_performed_tests, expectations_correct, expectations_wrong
number_performed_tests = 0
expectations_correc... | 2.40625 | 2 |
examples/my_configs/two.py | davidhyman/override | 0 | 7846 | <filename>examples/my_configs/two.py
from .one import *
fruit = 'banana'
colour = 'orange'
sam['eggs'] = 'plenty'
sam.pop('ham')
| 1.742188 | 2 |
students/K33402/Komarov_Georgy/LAB2/elevennote/src/api/urls.py | aglaya-pill/ITMO_ICT_WebDevelopment_2021-2022 | 0 | 7847 | <filename>students/K33402/Komarov_Georgy/LAB2/elevennote/src/api/urls.py
from django.urls import path, include
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework.routers import DefaultRouter
from .views import NoteViewSet
app_name = 'api'
router = DefaultRouter(trailing_slash=False)
router.reg... | 1.78125 | 2 |
PathPlanning/run.py | CandleStein/VAlg | 0 | 7848 | from planning_framework import path
import cv2 as cv
import numpy as np
import argparse
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(description="Path Planning Visualisation")
parser.add_argument(
"-n",
"--n_heuristic",
default=2,
help="Heuristic for A* Algorithm (default = 2). 0 f... | 2.984375 | 3 |
Codeforces/problems/0136/A/136A.py | object-oriented-human/competitive | 2 | 7849 | <gh_stars>1-10
n = int(input())
line = list(map(int, input().split()))
l = {}
res = ""
for i, j in enumerate(line):
l[j] = i+1
for k in range(n):
res += str(l[k+1]) + " "
print(res.rstrip()) | 2.875 | 3 |
generatey.py | YiLisa/DSCI560-hw2 | 0 | 7850 | <filename>generatey.py
import pandas as pd
def main():
input = pd.read_csv('random_x.csv', header=None)
x=input[0].tolist()
y = []
for n in x:
y.append(3*int(n)+6)
df = pd.DataFrame(y)
df.to_csv('output_y.csv', index=False, header=False)
if __name__ == '__main__':
main()
print... | 3.453125 | 3 |
setup.py | burn874/mtg | 0 | 7851 | import re
from pkg_resources import parse_requirements
import pathlib
from setuptools import find_packages, setup
README_FILE = 'README.md'
REQUIREMENTS_FILE = 'requirements.txt'
VERSION_FILE = 'mtg/_version.py'
VERSION_REGEXP = r'^__version__ = \'(\d+\.\d+\.\d+)\''
r = re.search(VERSION_REGEXP, open(VERSION_FILE).r... | 1.984375 | 2 |
avilla/core/resource/interface.py | RF-Tar-Railt/Avilla | 0 | 7852 | <filename>avilla/core/resource/interface.py
from __future__ import annotations
from dataclasses import dataclass
from avilla.core.platform import Base
from avilla.core.resource import Resource, ResourceProvider
@dataclass
class ResourceMatchPrefix:
resource_type: type[Resource]
keypath: str | None = None
... | 2.3125 | 2 |
viewer_examples/plugins/median_filter.py | atemysemicolon/scikit-image | 0 | 7853 | <filename>viewer_examples/plugins/median_filter.py
from skimage import data
from skimage.filter.rank import median
from skimage.morphology import disk
from skimage.viewer import ImageViewer
from skimage.viewer.widgets import Slider, OKCancelButtons, SaveButtons
from skimage.viewer.plugins.base import Plugin
def media... | 2.3125 | 2 |
autotest/test_gwf_buy_lak01.py | scharlton2/modflow6 | 3 | 7854 | <gh_stars>1-10
# Test the buoyancy package and the variable density flows between the lake
# and the gwf model. This model has 4 layers and a lake incised within it.
# The model is transient and has heads in the aquifer higher than the initial
# stage in the lake. As the model runs, the lake and aquifer equalize and
... | 2.484375 | 2 |
lesson-08/roll_dice_v1.0.py | hemiaoio/pylearning | 1 | 7855 | """
功能:模拟掷骰子
版本:1.0
"""
import random
def roll_dice():
roll = random.randint(1, 6)
return roll
def main():
total_times = 100000
result_list = [0] * 6
for i in range(total_times):
roll = roll_dice()
result_list[roll-1] += 1
for i, x in enumerate(result_list):
... | 3.703125 | 4 |
composer/dataflow-python3/main.py | gxercavins/gcp-snippets | 2 | 7856 | <filename>composer/dataflow-python3/main.py
import argparse
import logging
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
def run(argv=None, save_main_session=True):
"""Dummy pipeline to test Python3 operator... | 2.09375 | 2 |
dingtalk/message/conversation.py | kangour/dingtalk-python | 88 | 7857 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/11/30 下午3:02
# @Author : Matrix
# @Github : https://github.com/blackmatrix7/
# @Blog : http://www.cnblogs.com/blackmatrix/
# @File : messages.py
# @Software: PyCharm
import json
from ..foundation import *
from json import JSONDecodeError
__author__ = 'blackm... | 1.84375 | 2 |
backend/garpix_page/setup.py | griviala/garpix_page | 0 | 7858 | <reponame>griviala/garpix_page<filename>backend/garpix_page/setup.py
from setuptools import setup, find_packages
from os import path
here = path.join(path.abspath(path.dirname(__file__)), 'garpix_page')
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='... | 1.328125 | 1 |
.kodi/addons/plugin.video.p2p-streams/resources/core/livestreams.py | C6SUMMER/allinclusive-kodi-pi | 0 | 7859 | # -*- coding: utf-8 -*-
""" p2p-streams (c) 2014 enen92 fightnight
This file contains the livestream addon engine. It is mostly based on divingmule work on livestreams addon!
Functions:
xml_lists_menu() -> main menu for the xml list category
addlista() -> add a new list. It'll ask for local or rem... | 2.203125 | 2 |
RainIt/rain_it/ric/Procedure.py | luisgepeto/RainItPi | 0 | 7860 | <gh_stars>0
from ric.RainItComposite import RainItComposite
class Procedure(RainItComposite):
def __init__(self):
super().__init__()
def get_pickle_form(self):
return self
| 2.015625 | 2 |
1067.py | FahimFBA/URI-Problem-Solve | 3 | 7861 | <gh_stars>1-10
valor = int(input())
for i in range(valor+1):
if(i%2 != 0):
print(i) | 2.9375 | 3 |
api-reference-examples/python/te-tag-query/api-example-update.py | b-bold/ThreatExchange | 997 | 7862 | #!/usr/bin/env python
# ================================================================
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# ================================================================
import sys
import json
import TE
TE.Net.setAppTokenFromEnvName("TX_ACCESS_TOKEN")
postPar... | 1.882813 | 2 |
loaner/web_app/backend/api/shelf_api_test.py | Bottom-Feeders/GrabNGO | 0 | 7863 | # Copyright 2018 Google Inc. 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 1.679688 | 2 |
app/views/main.py | ArmandDS/ai_bert_resumes | 1 | 7864 | from flask import render_template, jsonify, Flask, redirect, url_for, request
from app import app
import random
import os
# import tensorflow as tf
# import numpy as np
# import sys
# import spacy
# nlp = spacy.load('en')
# sys.path.insert(0, "/content/bert_experimental")
# from bert_experimental.finetuning.text_pre... | 2.21875 | 2 |
ahrs/filters/complementary.py | jaluebbe/ahrs | 0 | 7865 | # -*- coding: utf-8 -*-
"""
Complementary Filter
====================
Attitude quaternion obtained with gyroscope and accelerometer-magnetometer
measurements, via complementary filter.
First, the current orientation is estimated at time :math:`t`, from a previous
orientation at time :math:`t-1`, and a given ... | 2.515625 | 3 |
aliyun-python-sdk-ehpc/aliyunsdkehpc/request/v20180412/EditJobTemplateRequest.py | yndu13/aliyun-openapi-python-sdk | 1,001 | 7866 | <gh_stars>1000+
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"... | 1.632813 | 2 |
tests/common/models/test_execution.py | angry-tony/ceph-lcm-decapod | 41 | 7867 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 1.882813 | 2 |
board/models.py | Fahreeve/TaskManager | 0 | 7868 | from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Task(models.Model):
CLOSE = 'cl'
CANCEL = 'ca'
LATER = 'la'
UNDEFINED = 'un'
CHOICES = (
... | 2.0625 | 2 |
test/test_hex_line.py | bicobus/Hexy | 72 | 7869 | import numpy as np
import hexy as hx
def test_get_hex_line():
expected = [
[-3, 3, 0],
[-2, 2, 0],
[-1, 2, -1],
[0, 2, -2],
[1, 1, -2],
]
start = np.array([-3, 3, 0])
end = np.array([1, 1, -2])
print(hx.get_hex_line(start, end))
... | 2.984375 | 3 |
wofry/propagator/propagators2D/integral.py | PaNOSC-ViNYL/wofry | 0 | 7870 | <reponame>PaNOSC-ViNYL/wofry<filename>wofry/propagator/propagators2D/integral.py
# propagate_2D_integral: Simplification of the Kirchhoff-Fresnel integral. TODO: Very slow and give some problems
import numpy
from wofry.propagator.wavefront2D.generic_wavefront import GenericWavefront2D
from wofry.propagator.propagat... | 2.875 | 3 |
Problems/Study Plans/Dynamic Programming/Dynamic Programming I/07_delete_and_earn.py | andor2718/LeetCode | 1 | 7871 | <filename>Problems/Study Plans/Dynamic Programming/Dynamic Programming I/07_delete_and_earn.py
# https://leetcode.com/problems/delete-and-earn/
class Solution:
def deleteAndEarn(self, nums: list[int]) -> int:
num_profits = dict()
for num in nums:
num_profits[num] = num_profits.get(num, ... | 3.375 | 3 |
Desafio051.py | GabrielSanchesRosa/Python | 0 | 7872 | <gh_stars>0
# Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final mostre, os 10 primeiros termos dessa prograssão.
primeiro = int(input("Primeiro Termo: "))
razao = int(input("Razão: "))
decimo = primeiro + (10 - 1) * razao
for c in range(primeiro, decimo + razao, razao):
print(f"{c}", en... | 3.953125 | 4 |
tiddlyweb/filters/limit.py | tiddlyweb/tiddlyweb | 57 | 7873 | """
A :py:mod:`filter <tiddlyweb.filters>` type to limit a group of entities
using a syntax similar to SQL Limit::
limit=<index>,<count>
limit=<count>
"""
import itertools
def limit_parse(count='0'):
"""
Parse the argument of a ``limit`` :py:mod:`filter <tiddlyweb.filters>`
for a count and index... | 3.328125 | 3 |
pytorch_keras_converter/API.py | sonibla/pytorch_keras_converter | 17 | 7874 | """
Simple API to convert models between PyTorch and Keras
(Conversions from Keras to PyTorch aren't implemented)
"""
from . import utility
from . import tests
from . import io_utils as utils
import tensorflow
def convert(model,
input_shape,
weights=True,
quiet=True,
i... | 3.53125 | 4 |
examples/enable_notifications.py | kjwill/bleak | 0 | 7875 | # -*- coding: utf-8 -*-
"""
Notifications
-------------
Example showing how to add notifications to a characteristic and handle the responses.
Updated on 2019-07-03 by hbldh <<EMAIL>>
"""
import sys
import logging
import asyncio
import platform
from bleak import BleakClient
from bleak import _logger as logger
CH... | 2.90625 | 3 |
pyrules/storages/base.py | miraculixx/pyrules | 17 | 7876 | <reponame>miraculixx/pyrules<gh_stars>10-100
class BaseStorage(object):
def get_rule(self, name):
raise NotImplementedError()
def get_ruleset(self, name):
raise NotImplementedError()
| 1.8125 | 2 |
src/15 listener_and_backdoor/listener_2.py | raminjafary/ethical-hacking | 0 | 7877 | <filename>src/15 listener_and_backdoor/listener_2.py<gh_stars>0
#!/usr/bin/python
import socket
class Listener:
def __init__(self,ip,port):
listener = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
listener.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
#options to reuse sockets
#listener.bind(("loc... | 2.953125 | 3 |
dialogflow/history2xls.py | ray-hrst/temi-tools | 1 | 7878 | <filename>dialogflow/history2xls.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Convert Dialogflow history to spreadsheet
User must manually copy the history from the browser and save this in a text file.
This reads the textfile, parses the data, and saves it to a spreadsheet.
Example training sample:
USER
... | 3.515625 | 4 |
recognition/views.py | usathe71-u/Attendance-System-Face-Recognition | 3 | 7879 | from django.shortcuts import render,redirect
from .forms import usernameForm,DateForm,UsernameAndDateForm, DateForm_2
from django.contrib import messages
from django.contrib.auth.models import User
import cv2
import dlib
import imutils
from imutils import face_utils
from imutils.video import VideoStream
from imutils.fa... | 2.171875 | 2 |
2018/05.py | GillesArcas/Advent_of_Code | 0 | 7880 | import re
import string
DATA = '05.txt'
def react(polymer):
pairs = '|'.join([a + b + '|' + b + a for a, b in zip(string.ascii_lowercase, string.ascii_uppercase)])
length = len(polymer)
while 1:
polymer = re.sub(pairs, '', polymer)
if len(polymer) == length:
retu... | 3.265625 | 3 |
lib/fbuild/builders/__init__.py | felix-lang/fbuild | 40 | 7881 | <reponame>felix-lang/fbuild
import abc
import contextlib
import os
import sys
from functools import partial
from itertools import chain
import fbuild
import fbuild.db
import fbuild.path
import fbuild.temp
from . import platform
# ------------------------------------------------------------------------------
class Mi... | 2.46875 | 2 |
WebServer.py | i3uex/CompareML | 0 | 7882 | import json
import cherrypy
import engine
class WebServer(object):
@cherrypy.expose
def index(self):
return open('public/index.html', encoding='utf-8')
@cherrypy.expose
class GetOptionsService(object):
@cherrypy.tools.accept(media='text/plain')
def GET(self):
return json.dumps({
... | 2.609375 | 3 |
tuprolog/solve/exception/error/existence/__init__.py | DavideEva/2ppy | 1 | 7883 | from typing import Union
from tuprolog import logger
# noinspection PyUnresolvedReferences
import jpype.imports
# noinspection PyUnresolvedReferences
import it.unibo.tuprolog.solve.exception.error as errors
from tuprolog.core import Term, Atom
from tuprolog.solve import ExecutionContext, Signature
ExistenceError = err... | 2.046875 | 2 |
cptk/core/fetcher.py | RealA10N/cptk | 5 | 7884 | <filename>cptk/core/fetcher.py
from __future__ import annotations
from typing import TYPE_CHECKING
import pkg_resources
from bs4 import BeautifulSoup
from requests import session
from cptk.scrape import PageInfo
from cptk.scrape import Website
from cptk.utils import cptkException
if TYPE_CHECKING:
from cptk.scr... | 2.75 | 3 |
machine_learning/deep_reinforcement_learning_grasping/drlgrasp/drlgrasp/pybullet_envs/kuka_reach_with_visual.py | Hinson-A/guyueclass | 227 | 7885 | import pybullet as p
import pybullet_data
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from math import sqrt
import random
import time
import math
import cv2
import torch
import os
def random_crop(imgs, out):
"""
args:
imgs: shape (B,C,H,W)
... | 2.328125 | 2 |
bucket_4C/python-Pillow/patches/patch-setup.py | jrmarino/ravensource | 17 | 7886 | <reponame>jrmarino/ravensource
--- setup.py.orig 2019-07-02 19:13:39 UTC
+++ setup.py
@@ -465,9 +465,7 @@ class pil_build_ext(build_ext):
_add_directory(include_dirs, "/usr/X11/include")
elif (
- sys.platform.startswith("linux")
- or sys.platform.startswith("gnu")
- ... | 1.382813 | 1 |
tests/ut/cpp/python_input/gtest_input/pre_activate/ir_fusion_test.py | GeekHee/mindspore | 0 | 7887 | <reponame>GeekHee/mindspore
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 1.703125 | 2 |
tdx/abc.py | TrainerDex/DiscordBot | 2 | 7888 | <reponame>TrainerDex/DiscordBot
from abc import ABC
from typing import Dict
from redbot.core import Config
from redbot.core.bot import Red
from trainerdex.client import Client
class MixinMeta(ABC):
"""
Base class for well behaved type hint detection with composite class.
Basically, to keep developers sa... | 2.546875 | 3 |
app.py | PolinaRomanchenko/Victorious_Secret_DSCI_532 | 0 | 7889 | import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
import numpy as np
import altair as alt
import vega_datasets
alt.data_transformers.enable('default')
alt.data_transformers.disable_max_rows()
app = dash.Dash(__name__, assets_f... | 2.4375 | 2 |
catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/bala/duckietown/catkin_ws/src:/home/bala/duckietown/catkin_ws/src/lib/python2.7/site-packages/geometry/subspaces/__init__.py | johnson880319/Software | 0 | 7890 | <reponame>johnson880319/Software
# coding=utf-8
from .subspaces import *
| 0.898438 | 1 |
detection/contor.py | chika626/chainer_rep | 0 | 7891 | <reponame>chika626/chainer_rep
import json
import math
from PIL import Image,ImageDraw
import pandas as pd
import glob
import argparse
import copy
import numpy as np
import matplotlib.pyplot as plt
import pickle
import cv2
from PIL import ImageEnhance
import chainer
from chainer.datasets import Concate... | 2.140625 | 2 |
train.py | hjl-yul154/autodeeplab | 1 | 7892 | import os
import pdb
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn
import torch.optim as optim
import dataloaders
from utils.utils import AverageMeter
from utils.loss import build_criterion
from utils.metrics import Evaluator
from utils.step_... | 2 | 2 |
test.py | xxaxdxcxx/miscellaneous-code | 0 | 7893 | class Solution:
# dictionary keys are tuples, storing results
# structure of the tuple:
# (level, prev_sum, val_to_include)
# value is number of successful tuples
def fourSumCount(self, A, B, C, D, prev_sum=0, level=0, sums={}):
"""
:type A: List[int]
:type B: List[int]
... | 3.46875 | 3 |
src/boot.py | johngtrs/krux | 0 | 7894 | # The MIT License (MIT)
# Copyright (c) 2021 <NAME>
# 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 restriction, including without limitation the rights
# to use, copy, modify, merg... | 2.15625 | 2 |
smartfields/processors/video.py | suhaibroomy/django-smartfields | 0 | 7895 | <reponame>suhaibroomy/django-smartfields<filename>smartfields/processors/video.py
import re
import six
from smartfields.processors.base import ExternalFileProcessor
from smartfields.utils import ProcessingError
__all__ = [
'FFMPEGProcessor'
]
class FFMPEGProcessor(ExternalFileProcessor):
duration_re = re.com... | 2.453125 | 2 |
tests/test_vmtkScripts/test_vmtksurfaceconnectivity.py | ramtingh/vmtk | 0 | 7896 | ## Program: VMTK
## Language: Python
## Date: January 12, 2018
## Version: 1.4
## Copyright (c) <NAME>, <NAME>, All rights reserved.
## See LICENSE file for details.
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PAR... | 2.265625 | 2 |
sssoon/forms.py | Kingpin-Apps/django-sssoon | 2 | 7897 | <gh_stars>1-10
from django import forms
from nocaptcha_recaptcha.fields import NoReCaptchaField
class NewsletterForm(forms.Form):
email = forms.EmailField(label='Email', required=True,
widget=forms.TextInput(attrs={
'id': 'newsletter-email',
... | 2.375 | 2 |
simple_run_menu.py | william01110111/simple_run_menu | 0 | 7898 | <reponame>william01110111/simple_run_menu
#! /bin/python3
# simple run menu
import os
import stat
def is_file_executable(path):
executable = stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH
if not os.path.isfile(path):
return False
st = os.stat(path)
mode = st.st_mode
if not mode & executable:
return False
return... | 2.90625 | 3 |
mne/io/cnt/tests/test_cnt.py | stevemats/mne-python | 1,953 | 7899 |
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
from numpy.testing import assert_array_equal
import pytest
from mne import pick_types
from mne.datasets import testing
from mne.io.tests.test_raw import _test_raw_reader
from mne.io.cnt import rea... | 2.125 | 2 |