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 |
|---|---|---|---|---|---|---|
saefportal/users/migrations/0024_auto_20210924_1403.py | harry-consulting/SAEF1 | 0 | 12779351 | # Generated by Django 3.1.6 on 2021-09-24 14:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0023_auto_20210924_1400'),
]
operations = [
migrations.RemoveField(
model_name='objectpermission',
name='pe... | 1.648438 | 2 |
source/code/testing/elbv2.py | mobri2a/aws-ops-automator | 94 | 12779352 | ######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 1.882813 | 2 |
mnist_cnn_gpu.py | cannin/mnist-cnn-gpu | 1 | 12779353 | from __future__ import print_function
import tensorflow
import tensorflow.keras as keras
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
from tensorflow.keras.c... | 2.890625 | 3 |
subs2srs/core/preview_item.py | TFarla/subs2srs-cross-platform | 3 | 12779354 | <gh_stars>1-10
class PreviewItem:
def __init__(self, from_time, end_time, target_sub, native_sub):
super().__init__()
self.from_time = from_time
self.end_time = end_time
self.target_sub = target_sub
self.native_sub = native_sub
def from_time_seconds(self):
if sel... | 2.296875 | 2 |
poc/backtest_in_memory.py | alexcwyu/python-trading | 17 | 12779355 | <reponame>alexcwyu/python-trading<filename>poc/backtest_in_memory.py
import math
from datetime import datetime
from datetime import timedelta
import numpy as np
import pandas as pd
from algotrader.config.app import BacktestingConfig
from algotrader.event.market_data import BarSize, BarType
from algotrader.chart.plott... | 2.546875 | 3 |
models/block_configs_trianglecnn.py | xuyongzhi/SparseVoxelNet | 0 | 12779356 | <filename>models/block_configs_trianglecnn.py
import numpy as np
def block_configs(net_flag='default'):
block_configs = {}
block_configs['use_face_global_scale0'] = False
block_configs['e2fl_pool'] = ['max']
block_configs['f2v_pool'] = ['max']
#***************************************************************... | 2.0625 | 2 |
geokey/contributions/tests/media/test_managers.py | chabies/config_socialauth_geokey | 0 | 12779357 | """Tests for managers of contributions (media files)."""
import os
import glob
from PIL import Image
from StringIO import StringIO
from django.core.files.base import ContentFile
from django.test import TestCase
from django.conf import settings
from nose.tools import raises
from geokey.core.exceptions import FileTy... | 2.25 | 2 |
apps/projects/models.py | gannetson/sportschooldeopenlucht | 1 | 12779358 | <gh_stars>1-10
import datetime
from apps.tasks.models import Task
from django.db import models
from django.db.models.aggregates import Count, Sum
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from django.conf import settings
from d... | 2.015625 | 2 |
RLBotPack/Kamael/States.py | robbai/RLBotPack | 0 | 12779359 | from Utilities import *
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from rlbot.utils.game_state_util import GameState, BallState, CarState, Physics, Vector3, Rotator
import random
"""
Right corner loc: (-2048, -2560... | 2.609375 | 3 |
datamining-toolbox/src/gpn_hack/luigi_tasks/__init__.py | SlamJam/gpn-hack | 0 | 12779360 | import logging
import luigi
import luigi.contrib.s3
from . import hh, index
# Disable all child loggers
for name in ["botocore", "boto3", "elasticsearch"]:
logging.getLogger(name).propagate = False
class MainTask(luigi.Task):
# 113 - Россия, 1 - Москва, 83 - Смоленск
# areas_ids = luigi.ListParameter([... | 2.09375 | 2 |
src/kapidox/models.py | KDE/kapidox | 7 | 12779361 | <reponame>KDE/kapidox
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: 2016 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: BSD-2-Clause
import logging
import os.path
import string
from kapidox import utils
## @package kapidox.models
#
# Contains the classes representing the objects used by kapidox
#
class Library(... | 2.453125 | 2 |
setup.py | authomatic/foundation-sphinx-theme | 0 | 12779362 | <filename>setup.py<gh_stars>0
from setuptools import setup, find_packages
setup(
name='foundation-sphinx-theme',
version='0.0.3',
packages=find_packages(),
package_data={'': ['*.txt', '*.rst', '*.html', '*.css', '*.js', '*.conf']},
author='<NAME>',
author_email='<EMAIL>',
description='',
... | 1.171875 | 1 |
annotation_backend/src/server/migrations/0012_auto_20200813_2200.py | INK-USC/LEAN-LIFE | 21 | 12779363 | # Generated by Django 2.1.7 on 2020-08-13 22:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('server', '0011_auto_20200721_1516'),
]
operations = [
migrations.AddField(
model_name='namedent... | 1.578125 | 2 |
coda/coda_mdstore/resourcesync.py | unt-libraries/coda | 2 | 12779364 | from urllib.parse import urlparse
import warnings
from django.contrib.sitemaps import Sitemap, views
from django.contrib.sites.shortcuts import get_current_site
from django.urls import reverse
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.http import Http404
from django.shortcuts import get... | 2.125 | 2 |
nesi/devices/keymile/keymile_resources/keymile_interface.py | inexio/NESi | 30 | 12779365 | # This file is part of the NESi software.
#
# Copyright (c) 2020
# Original Software Design by <NAME> <https://github.com/etingof>.
#
# Software adapted by inexio <https://github.com/inexio>.
# - <NAME> <https://github.com/unkn0wn-user>
# - <NAME> <https://github.com/Connyko65>
# - <NAME> <https://github.com/Dinker1996... | 1.914063 | 2 |
IPL matches data/stadium_details.py | jv640/Web-Scraping | 0 | 12779366 | import requests
from bs4 import BeautifulSoup
import html5lib as h5l
import json
import pandas as pd
import os
import time
r = requests.get("https://en.wikipedia.org/wiki/List_of_Indian_Premier_League_venues")
htmlContent = r.content
soup = BeautifulSoup(htmlContent, 'html.parser')
stadium_det = [['Stadium', 'Home T... | 3.3125 | 3 |
ingestion/Blocktrace/Schemas/Action.py | mharrisb1/blocktrace | 0 | 12779367 | <gh_stars>0
from dataclasses import dataclass
@dataclass(frozen=True)
class Action:
account: str
name: str
jsonData: dict
| 2.09375 | 2 |
token_service/main/client_credentials_handler.py | oslokommune/okdata-token-service | 0 | 12779368 | <reponame>oslokommune/okdata-token-service
import json
from aws_xray_sdk.core import patch_all, xray_recorder
from okdata.aws.logging import (
logging_wrapper,
log_add,
log_duration,
hide_suffix,
)
from token_service.main.keycloak_client import ClientTokenClient
from token_service.main.request_utils i... | 1.9375 | 2 |
catalog/__init__.py | stonescar/item-catalog-deploy | 0 | 12779369 | <reponame>stonescar/item-catalog-deploy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from catalog.modules.setup.app import app
if __name__ == '__main__':
app.secret_key = 'items'
app.debug = True
app.run(host='0.0.0.0', port=5000)
| 1.195313 | 1 |
src/streamlink/plugins/drdk.py | hymer-up/streamlink | 5 | 12779370 | import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
class DRDK(Plugin):
live_api_url = 'https://www.dr-massive.com/api/page'
url_re = re.compile(r'''
https?://(?:www\.)?dr\... | 2.1875 | 2 |
7_NN_L2_Regularizer_to_Reduce_Overfitting.py | Yazooliu/Ai_Lab_LinuxNN | 0 | 12779371 | <gh_stars>0
#coding:utf-8
# ----------------------------------------
# 以下将实现正则化对过拟合的缓解过程
# -----------------------------------------
#
# 正则化在损失函数中引入了了模型复杂度的指标,利用给w加权重来弱化训练数据的噪声(一般不正则化参数b)
# loss = loss (y 与 y_) + Regularizer * loss (w)
# loss(y 与 y_) 表示模型中所有参数的损失函数,,如MMSE/交叉熵 , 超参数regularizer 是用来给出参数w在总的Loss中所占有的比例,也就是... | 2.015625 | 2 |
1_multiply.py | benanne/theano-tutorial | 42 | 12779372 | import theano
import theano.tensor as T
a = T.scalar()
b = T.scalar()
y = a * b
f = theano.function([a, b], y)
print f(1, 2) # 2
print f(3, 3) # 9 | 2.828125 | 3 |
algorithms/sorting-algorithms/bubble_sort/bubble_sort.py | olaoluwa-98/ds-and-algorithms | 2 | 12779373 | def bubble_sort(arr):
n = len(arr)
# Traverse through all array elements
for i in range(n):
swapped = False
# Last i elements are already
# in place
for j in range(n- i - 1):
# traverse the array from 0 to
# n-i-1. Swap if the element
... | 4.46875 | 4 |
reshape_dataset.py | wjsutton/play_drawful_with_us | 0 | 12779374 | <reponame>wjsutton/play_drawful_with_us<gh_stars>0
# Drawful Submissions, matched with answers
# load python libraries
import pandas as pd
import numpy as np
# load source data sets
responses = pd.read_csv('data\\IronViz Art - Drawful Quiz (Responses) - Form Responses 1.csv')
answers = pd.read_csv('data\\answers.csv'... | 2.78125 | 3 |
tests/riscv/APIs/QueryResourceEntropyTest_force.py | jeremybennett/force-riscv | 0 | 12779375 | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... | 1.78125 | 2 |
torch3d/nn/utils.py | zhangmozhe/torch3d | 0 | 12779376 | from collections.abc import Iterable
from itertools import repeat
def _ntuple(n):
def parse(x):
if isinstance(x, Iterable):
return x
return tuple(repeat(x, n))
return parse
_single = _ntuple(1)
| 3.1875 | 3 |
odoo/addons/test_lint/tests/test_onchange_domains.py | SHIVJITH/Odoo_Machine_Test | 0 | 12779377 | <reponame>SHIVJITH/Odoo_Machine_Test
import ast
import itertools
import os
from . import lint_case
class OnchangeChecker(ast.NodeVisitor):
def visit(self, node):
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
return visitor(node)
def ge... | 2.265625 | 2 |
semantic_aware_models/models/recommendation/bert_recommender.py | ITAINNOVA/SAME | 0 | 12779378 | <reponame>ITAINNOVA/SAME
from semantic_aware_models.models.recommendation.abstract_recommender import AbstractRecommender
from semantic_aware_models.models.classification.bert_classifier import BertClassifier
from semantic_aware_models.dataset.movielens.movielens_data_model import *
from semantic_aware_models.utils.gpu... | 2.359375 | 2 |
LM-5551 intermediate-aci/dne-dci-intermediate-aci-mission1_health-dashboard/create_snv_apps.py | russellpope/devnet-express-dc | 0 | 12779379 | #!usr/bin/env python
import cobra.mit.access
import cobra.mit.request
import cobra.mit.session
import cobra.model.fv
import cobra.model.vz
import cobra.model.pol
from credentials import *
def main():
auth = cobra.mit.session.LoginSession(URL, LOGIN, PASSWORD)
session = cobra.mit.access.MoDirectory(auth)
session.l... | 1.773438 | 2 |
vial/plugins/misc/__init__.py | solarnz/vial | 0 | 12779380 | import vial
def init():
vial.register_command('VialEscape', '.plugin.escape')
vial.register_command('VialSearchOutline', '.plugin.search_outline')
vial.register_command('VialChangedProjects', '.plugin.changed_projects')
vial.register_command('VialNew', '.plugin.new', complete='file', nargs=1)
vial... | 1.820313 | 2 |
iv/Leetcode/easy/690_employee_importance.py | iamsuman/iv | 2 | 12779381 | <gh_stars>1-10
# Definition for Employee.
class Employee:
def __init__(self, id: int, importance: int, subordinates: list):
self.id = id
self.importance = importance
self.subordinates = subordinates
class Solution:
def getImportance(self, employees: list, id: int) -> int:
emap... | 3.28125 | 3 |
DropStudy/VideoScripts/test_data2.py | RossDynamics/team-samara | 0 | 12779382 | <reponame>RossDynamics/team-samara
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 8 15:17:51 2019
@author: <NAME>
"""
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.interpolate as interp
import scipy.signal as spsig
from scipy import fftpack
from scipy.optimi... | 1.914063 | 2 |
networking-calico/networking_calico/timestamp.py | mikestephen/calico | 3,973 | 12779383 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Tigera, 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 re... | 2.859375 | 3 |
game.py | osmith93/str8ts | 0 | 12779384 | <reponame>osmith93/str8ts
from board import Cell, Board
vertical = "vertical"
horizontal = "horizontal"
class Game:
EMPTY = 0
BLOCKED = True
def __init__(self, size=9):
self.size = size
self.board = Board(size)
self.selected_cell = None
def load(self, filename):
"""
... | 3.140625 | 3 |
src/enums/__init__.py | Freonius/tranquillity | 0 | 12779385 | <filename>src/enums/__init__.py
from enum import Enum, IntFlag, auto
class ConnType(Enum):
COUCHDB = auto()
ELASTICSEARCH = auto()
MONGO = auto()
SQLITE = auto()
MYSQL = auto()
PGSQL = auto()
DB2 = auto()
MSSQL = auto()
HAZELCAST = auto()
SPRING_CONFIG = auto()
KAFKA = auto... | 2.25 | 2 |
noval/toolbar.py | bopopescu/NovalIDE | 0 | 12779386 | <filename>noval/toolbar.py
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: toolbar.py
# Purpose:
#
# Author: wukan
#
# Created: 2019-01-16
# Copyright: (c) wukan 2019
# Licence: GPL-3.0
#------------------------------------... | 2.609375 | 3 |
02-array-seq/bisect_demo.py | oxfordyang2016/learnfluentpython | 1 | 12779387 | # BEGIN BISECT_DEMO
#list comprehension
#this is list comprelist ,you can use it do such as cartesian product
#about cartesian product https://en.wikipedia.org/wiki/Cartesian_product
'''
>>> colors = ['black', 'white']
>>> sizes = ['S', 'M', 'L']
>>> tshirts = [(color, size) for color in colors for size in sizes]
>>> t... | 4 | 4 |
src/main.py | Mysigyeong/ADOAG | 0 | 12779388 | <reponame>Mysigyeong/ADOAG
import angr
import claripy
import subprocess
import avatar2
import sys
import os
import networkx
import signal
from angr_targets import AvatarGDBConcreteTarget
if __name__ == "__main__" and __package__ is None:
from sys import path
from os.path import dirname as dir
path.append(... | 2.140625 | 2 |
ml_enabler/exceptions.py | gaoxm/ml-enabler-cli | 5 | 12779389 |
class InvalidData(Exception):
pass
class InvalidModelResponse(Exception):
pass
class ImageFetchError(Exception):
pass
| 1.476563 | 1 |
make_pizzas.py | yiyidhuang/PythonCrashCrouse2nd | 0 | 12779390 | # import pizza
# pizza.make_pizza(16, 'pepperoni')
# pizza.make_pizza(12, 'mushrooms', 'green peppers', 'extra cheese')
# from pizza import make_pizza
# make_pizza(16, 'pepperoni')
# make_pizza(12, 'mushrooms', 'green peppers', 'extra cheese')
# from pizza import make_pizza as mp
# mp(16, 'pepperoni')
# mp(12, ... | 2.59375 | 3 |
level2/124_country_numbers.py | hyo-jae-jung/programmers | 0 | 12779391 | <reponame>hyo-jae-jung/programmers<gh_stars>0
def solution(n):
temp = []
while n/3 > 0:
if n%3 == 0:
temp.append(4)
n = n//3 - 1
else:
temp.append(n%3)
n = n//3
return ''.join(str(i) for i in reversed(temp))
print(solution(1))
print(solution(... | 3.484375 | 3 |
fedlab_benchmarks/fedavg_v1.1.2/scale/mnist-cnn/client.py | KarhouTam/FedLab-benchmarks | 46 | 12779392 | import torch
import argparse
import sys
import os
import torchvision
import torchvision.transforms as transforms
from fedlab.core.client.scale.trainer import SubsetSerialTrainer
from fedlab.core.client.scale.manager import ScaleClientPassiveManager
from fedlab.core.network import DistNetwork
from fedlab.utils.logger... | 2.03125 | 2 |
alternateController/supervised_policy.py | ranok92/deepirl | 2 | 12779393 | <reponame>ranok92/deepirl<filename>alternateController/supervised_policy.py
import sys
import pdb
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import MSELoss
from torch.utils.data import DataLoader
import torch.optim as optim
import numpy as np
import math
fr... | 2.34375 | 2 |
nimbus/fabnet/network.py | fabregas/nimbusfs-node | 0 | 12779394 | """
Package for interacting on the network at a high level.
"""
import asyncio
import random
import pickle
from .protocol import ManagementProtocol
from .utils import digest, logger, future_list, future_dict
from .storage import ForgetfulStorage
from .node import DHTNode
from .crawling import ValueSpiderCrawl
from .cr... | 3 | 3 |
hloc/match_features.py | oldshuren/Hierarchical-Localization | 0 | 12779395 | import argparse
import torch
from pathlib import Path
import h5py
import logging
from tqdm import tqdm
import pprint
import numpy as np
from . import matchers
from .utils.base_model import dynamic_load
from .utils.parsers import names_to_pair
'''
A set of standard configurations that can be directly selected from th... | 2.203125 | 2 |
HW/hw07/tests/interleave.py | IZUMI-Zu/CS61A | 3 | 12779396 | <reponame>IZUMI-Zu/CS61A
test = {
'name': 'interleave',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (interleave (list 1 3 5) (list 2 4 6))
(1 2 3 4 5 6)
""",
'hidden': False,
'locked': False
},
{
... | 1.929688 | 2 |
Python3/0734-Sentence-Similarity/soln.py | wyaadarsh/LeetCode-Solutions | 5 | 12779397 | class Solution:
def areSentencesSimilar(self, words1, words2, pairs):
"""
:type words1: List[str]
:type words2: List[str]
:type pairs: List[List[str]]
:rtype: bool
"""
if len(words1) != len(words2):
return False
sims = collections.defaultdi... | 3.453125 | 3 |
coop/models/base.py | lionls/coop | 15 | 12779398 | <reponame>lionls/coop
import torch
import torch.nn as nn
class Model(nn.Module):
def __init__(self,
hidden_size: int,
latent_dim: int):
super().__init__()
self.hidden_size = hidden_size
self.latent_dim = latent_dim
def forward(self,
s... | 2.546875 | 3 |
allhub/activity/starring.py | srinivasreddy/allhub | 2 | 12779399 | <gh_stars>1-10
from allhub.response import Response
from allhub.util import ErrorAPICode, config
from enum import Enum
class StarringDirection(Enum):
ASC = "asc"
DESC = "desc"
class StarringSort(Enum):
CREATED = "created"
UPDATED = "updated"
_mime_option = "application/vnd.github.v{version}.star+{... | 2.59375 | 3 |
load_data.py | sufianj/bert4bsv-tf1.13 | 0 | 12779400 | <reponame>sufianj/bert4bsv-tf1.13<filename>load_data.py
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
le = LabelEncoder()
###origine
###df = pd.read_csv("data/train.csv", sep=';', encoding='utf-8') #En cas d'erreur essayez avec d'autres encoding... | 2.8125 | 3 |
bot.py | iryabuhin/proictis_dialogflow_webhook | 0 | 12779401 | from app import app, db
from app.models import ProjectInfo
from app import route
| 1.25 | 1 |
Project/fourier.py | ART-Students/E-media | 2 | 12779402 | <filename>Project/fourier.py
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
class Fourier:
@staticmethod
def show_plots(path):
plt.figure(figsize=(10, 8))
image = Image.open(path)
image_1 = np.array(image.convert('L'))
image_2 = np.fft.fft2(image... | 3.359375 | 3 |
news/config.py | ruslan-ok/ruslan | 0 | 12779403 | <filename>news/config.py
from task.const import *
app_config = {
'name': APP_NEWS,
'app_title': 'news',
'icon': 'newspaper',
'role': ROLE_NEWS,
'main_view': 'all',
'use_groups': True,
'sort': [
('event', 'event date'),
('name', 'name'),
],
'views': {
'all': {... | 1.5625 | 2 |
dailyQuestion/2020/2020-10/10-07/python/solution_huosu.py | russellgao/algorithm | 3 | 12779404 | <filename>dailyQuestion/2020/2020-10/10-07/python/solution_huosu.py
def generateParenthesis(n: int) -> [str]:
result = []
def dfs(S, left, right) :
if len(S) == 2 * n :
result.append("".join(S))
return
if left < n :
S.append("(")
dfs(S, left+1 , ri... | 3.9375 | 4 |
tests/test_main.py | OriHoch/kvfile | 0 | 12779405 | import datetime
import decimal
def test_sanity():
from kvfile import KVFile
kv = KVFile()
data = dict(
s='value',
i=123,
d=datetime.datetime.fromtimestamp(12325),
n=decimal.Decimal('1234.56'),
ss=set(range(10)),
o=dict(d=decimal.Decimal('1234.58'), n=dat... | 2.5 | 2 |
tacred/lifelong/model/module/lstm_layer.py | qcw9714/FewShotContinualRE | 21 | 12779406 | <filename>tacred/lifelong/model/module/lstm_layer.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
from ..base_model import base_model
class lstm_layer(base_model):
def __init__(self, max_length = 128, input_size = 50, hidden_size = 256, dropout = 0, bidirection... | 2.765625 | 3 |
tests/editor/i18n_test.py | gariel/lazyetl | 0 | 12779407 |
from unittest import TestCase
from i18n import translate, LangText
langs = {
"lang1": "asd.text=aaa",
"lang2": "asd.text=bbb"
}
class TestLangText(LangText):
def load(self, langname):
super(TestLangText, self)._loadText(langs[langname])
@translate(TestLangText)
class TestTranslation:
def __... | 3.0625 | 3 |
src/main/python/missing_item.py | mohnoor94/ProblemsSolving | 8 | 12779408 | """
*** 'Airbnb' interview question ***
Problem statement: https://youtu.be/cdCeU8DJvPM
"""
from numbers import Number
from typing import List
def find_missing1(first: list, second: list) -> Number:
"""
- Time Complexity: O(len(first))
- Space Complexity: O(len(first))
:param first: a list of items
... | 4.09375 | 4 |
esp_flasher.py | pratikmokashi/ESP-FLASH-TOOL | 0 | 12779409 | <gh_stars>0
import os
import time
from tkinter import *
print(os.getcwd())
window = Tk()
window.title("esp flash tool")
window.geometry('500x210')
lbl = Label(window, text="Hello this is esp flashing tool",font=("Arial Bold",10))
lb_make = Label(window,text="click to make the project")
lb_path = Label(window,text="in... | 2.90625 | 3 |
src/simulator/cache/algorithms/landlord.py | pskopnik/htc-cache-simulator | 1 | 12779410 | <filename>src/simulator/cache/algorithms/landlord.py
from apq import KeyedItem, KeyedPQ
from dataclasses import dataclass, field
from enum import auto, Enum
from typing import Iterable, Optional
from ..state import AccessInfo, FileID, StateDrivenProcessor, StateDrivenOnlineProcessor, Storage
from ...params import pars... | 2.71875 | 3 |
2017/day10.py | iKevinY/advent | 11 | 12779411 | <gh_stars>10-100
import fileinput
def knot_hash(elems, lengths, pos=0, skip=0):
for l in lengths:
for i in range(l // 2):
x = (pos + i) % len(elems)
y = (pos + l - i - 1) % len(elems)
elems[x], elems[y] = elems[y], elems[x]
pos = pos + l + skip % len(elems)
... | 3.25 | 3 |
lnkr/import_section.py | yjpark/lnkr | 0 | 12779412 | <reponame>yjpark/lnkr
import os
import sys
import lnkr
import term
KEY_LOCAL = 'local'
KEY_REMOTE = 'remote'
KEY_MODE = 'mode'
KEY_MODE_WIN = 'mode_win'
MODE_COPY = 'copy'
MODE_LINK = 'link'
MODE_SYMLINK = 'symlink'
windows_mode = sys.platform.startswith('win')
class ImportSection:
def __init__(self, path, key,... | 2.1875 | 2 |
venv/lib/python3.6/site-packages/ansible/module_utils/facts/virtual/sunos.py | usegalaxy-no/usegalaxy | 1 | 12779413 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 2.03125 | 2 |
docs/snippets/ov_auto_batching.py | ryanloney/openvino-1 | 1 | 12779414 | #include <openvino/runtime/core.hpp>
int main() {
ov::Core core;
auto model = core.read_model("sample.xml");
//! [compile_model]
{
auto compiled_model = core.compile_model(model, "GPU", ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT));
}
//! [compile_model]
//! [compile_model_no_auto_ba... | 1.859375 | 2 |
django_doc/apps.py | bgreatfit/locallibrary | 0 | 12779415 | from django.apps import AppConfig
class DjangoDocConfig(AppConfig):
name = 'django_doc'
| 1.15625 | 1 |
bin/start_worker.py | zhiyue/cola | 1 | 12779416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2013 <NAME> <<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... | 2.03125 | 2 |
blog/app/forms.py | shazlycode/testsite-blog | 1 | 12779417 | from django import forms
from app.models import Post, Comment, Profile
from django.contrib.auth.models import User
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('name','email','comment_body' )
class RegisterForm(forms.ModelForm):
... | 2.5625 | 3 |
InayatBashir/Places/urls.py | muminfarooq190/InayatBashir.in | 0 | 12779418 | <reponame>muminfarooq190/InayatBashir.in
from django.urls import path
from . import views
app_name = 'places'
urlpatterns = [
path('', views.AllPlacesList.as_view(), name='all_places_list'),
path('places/list/<int:pk>/', views.DetailPlace.as_view(), name='detail_place')
] | 1.9375 | 2 |
newpipe_crash_report_importer/lmtp_server.py | TeamNewPipe/CrashReportImporter | 9 | 12779419 | import traceback
from email.parser import Parser
import sentry_sdk
from aiosmtpd.controller import Controller
from aiosmtpd.lmtp import LMTP
from aiosmtpd.smtp import Envelope
from . import make_logger
class CustomLMTP(LMTP):
"""
A relatively simple wrapper around the LMTP/SMTP classes that implements some ... | 2.234375 | 2 |
Day18/Extract_Unique_Dictionary_Values.py | tushartrip1010/100_days_code_py | 0 | 12779420 | def Extract_Dictionary_Values(Test_dict):
return [sorted({numbers for ele in Test_dict.values() for numbers in ele})]
Test_dict = {'Challenges': [5, 6, 7, 8],
'are': [10, 11, 7, 5],
'best': [6, 12, 10, 8],
'for': [1, 2, 5]}
print(*(Extract_Dictionary_Values(Test_dict... | 3.515625 | 4 |
keyboards/menu_keyboards.py | gdetam/aiogram_telegram_bot | 1 | 12779421 | <reponame>gdetam/aiogram_telegram_bot<gh_stars>1-10
"""this is menu's keyboards creator."""
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
def create_start_menu():
"""Start keyboard."""
menu_keyboard = InlineKeyboardMarkup(row_width=1)
select_book = InlineKeyboardButton(
... | 2.65625 | 3 |
src/test/dataset/reader/csv_reader_test.py | KlemenGrebovsek/Cargo-stowage-optimization | 2 | 12779422 | import unittest
from src.dataset.reader.csv_reader import CSVDatasetReader
from src.dataset.reader.dataset_reader_errors import InvalidFileContentError
class CSVReaderTest(unittest.TestCase):
def test_empty_path(self):
try:
reader = CSVDatasetReader()
_ = reader.read('')
... | 3.078125 | 3 |
Theories/DataStructures/QueueAndStack/StackDFS/BSTInorderTraversal/bst_inorder_traversal.py | dolong2110/Algorithm-By-Problems-Python | 1 | 12779423 | from typing import List
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
# Recursively
# def inorderTraversal(root: TreeNode) -> List[int]:
# traversal_list = []
#
# def traver... | 4 | 4 |
dimsdk/plugins/ecc.py | dimchat/sdk-py | 0 | 12779424 | # -*- coding: utf-8 -*-
# ==============================================================================
# MIT License
#
# Copyright (c) 2020 <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 S... | 1.75 | 2 |
scripts/dates.py | clayrisser/node-git-filter-repo | 0 | 12779425 | <filename>scripts/dates.py<gh_stars>0
# Copyright 2021 Silicon Hills LLC
#
# 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 ... | 2.640625 | 3 |
peregrine/urls.py | FlipperPA/peregrine | 52 | 12779426 | <gh_stars>10-100
from django.urls import include, path, re_path
from wagtail.core import urls as wagtail_urls
from .views import PostsListView, AuthorPostsListView, CategoryPostsListView, PostsFeed
urlpatterns = [
path("rss/", PostsFeed(), name="peregrine-rss"),
path("author/<str:name>/", AuthorPosts... | 1.9375 | 2 |
PseudoGenerator.py | yxn-coder/Inf-Net | 273 | 12779427 | # -*- coding: utf-8 -*-
"""Preview
Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans'
submit to Transactions on Medical Imaging, 2020.
First Version: Created on 2020-05-13 (@author: <NAME>)
"""
# ---- base lib -----
import os
import argparse
from datetime import datetime
import cv2
impo... | 1.976563 | 2 |
source_enhancement_evaluator.py | jhuiac/cocktail-party-Visually-derived-Speech- | 0 | 12779428 | <filename>source_enhancement_evaluator.py
import argparse
import os
import subprocess
import tempfile
import re
import uuid
import numpy as np
from mediaio import ffmpeg
def pesq(pesq_bin_path, source_file_path, enhanced_file_path):
temp_dir = tempfile.gettempdir()
temp_source_path = os.path.join(temp_dir, str(u... | 2.5 | 2 |
prerequisites/matplotlib.py | julien-amar/date-a-scientist | 4 | 12779429 | <reponame>julien-amar/date-a-scientist
import codecademylib
from matplotlib import pyplot as plt
x = [0, 1, 2, 3, 4, 5]
y1 = [0, 1, 4, 9, 16, 25]
y2 = [0, 1, 8, 27, 64, 125]
# Plot y1 & y2 vs x axis
plt.plot(x, y1, color='pink', marker='o',label='square')
plt.plot(x, y2, color='gray', marker='o',label='cubic')
# De... | 4.15625 | 4 |
mirumon/api/devices/http_endpoints/registration_controller.py | mirumon/mirumon-backend | 19 | 12779430 | <filename>mirumon/api/devices/http_endpoints/registration_controller.py
from fastapi import APIRouter, Depends, HTTPException
from starlette import status
from mirumon.api.dependencies.services import get_service
from mirumon.api.dependencies.users.permissions import check_user_scopes
from mirumon.api.devices.http_end... | 2.109375 | 2 |
innexia/innexiaBot/modules/tagall.py | MikeOwino/curly-garbanzo | 0 | 12779431 | # Copyright (C) 2020-2021 by <EMAIL>, < https://github.com/DevsExpo >.
#
# This file is part of < https://github.com/DevsExpo/FridayUserBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/DevsExpo/blob/master/LICENSE >
#
# All rights reserved.
from pyrogram impor... | 1.976563 | 2 |
src/nodeList/node/Node.py | mnm-team/pydht | 1 | 12779432 | <filename>src/nodeList/node/Node.py
class Node:
def __init__(self, id: int, virtId: int = 0, capacity: int = 100, master: bool = True, additional={}) -> None:
assert(type(id) == int)
self.id = id
self.virtId = virtId
self.capacity = capacity
self.master = master
self... | 3.40625 | 3 |
train.py | vitormeriat/nlp-based-text-gcn | 0 | 12779433 | from modules.trainer.configs import TrainingConfigs
from modules.trainer.train_model import train_model
from tsne import tsne_visualizer
import matplotlib.pyplot as plt
from sys import argv
def create_training_cfg() -> TrainingConfigs:
conf = TrainingConfigs()
# conf.data_sets = ['20ng', 'R8', 'R52', 'ohsume... | 2.390625 | 2 |
python/excel_reader.py | extrabacon/pyspreadsheet | 24 | 12779434 | import sys, json, traceback, datetime, glob, xlrd
from xlrd import open_workbook, cellname, xldate_as_tuple, error_text_from_code
def dump_record(record_type, values):
print(json.dumps([record_type, values]));
def parse_cell_value(sheet, cell):
if cell.ctype == xlrd.XL_CELL_DATE:
year, month, day, hour, minut... | 2.859375 | 3 |
EC3/Thu.py | CSUpengyuyan/ECExperiment | 0 | 12779435 | <reponame>CSUpengyuyan/ECExperiment
import thulac
string = open('paper','r',encoding='UTF-8').read()
t = thulac.thulac()
result = t.cut(string)
print(len(result),result)
| 2.71875 | 3 |
Code/lucid_ml/run.py | beatobongco/Quadflor | 0 | 12779436 | <reponame>beatobongco/Quadflor<filename>Code/lucid_ml/run.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv, json, random, sys, os, argparse, logging, datetime, traceback
from collections import defaultdict
from pprint import pprint
from timeit import default_timer
from classifying.neural_net import MLP, Th... | 1.773438 | 2 |
param_table.py | sharvadim07/DeletionsIslands | 0 | 12779437 | <reponame>sharvadim07/DeletionsIslands
import space
import multiDim
class ParTable:
def __init__(self, par_table_file_name, special_features_cols, add_features_name_val_list):
self.header = None
self.param_tuple_list = []
self.special_features_cols_idx_dict = {}
with open(par_table_... | 2.59375 | 3 |
h/migrations/versions/6f86796f64e0_add_user_profile_columns.py | ssin122/test-h | 2 | 12779438 | """
Add user profile columns
Revision ID: 6f86796f64e0
Revises: <KEY>
Create Date: 2016-07-06 11:28:50.075057
"""
from __future__ import unicode_literals
from alembic import op
import sqlalchemy as sa
revision = '6f86796f64e0'
down_revision = '<KEY>'
def upgrade():
op.add_column('user', sa.Column('display_na... | 1.75 | 2 |
pandaharvester/harvestertest/stageOutTest_go_bulk_stager.py | tsulaiav/harvester | 11 | 12779439 | <filename>pandaharvester/harvestertest/stageOutTest_go_bulk_stager.py
import sys
import os
import os.path
import hashlib
import datetime
import uuid
import random
import string
import time
import threading
import logging
from future.utils import iteritems
from pandaharvester.harvesterconfig import harvester_config
from... | 1.898438 | 2 |
generate/python/__init__.py | Luthaf/Chemharp-bindgen | 0 | 12779440 | <gh_stars>0
# -* coding: utf-8 -*
"""Generate FFI for Python ctypes module"""
from .ffi import write_ffi
| 1 | 1 |
tests/unit_tests/running_modes/reinforcement_learning/reaction_filters/__init__.py | marco-foscato/Lib-INVENT | 26 | 12779441 | from tests.unit_tests.running_modes.reinforcement_learning.reaction_filters.test_non_selective_reaction_filter import \
TestNonSelectiveReactionFilters, TestNonSelectiveReactionFiltersNoReaction
from tests.unit_tests.running_modes.reinforcement_learning.reaction_filters.test_selective_reaction_filter import \
T... | 1.109375 | 1 |
vertexPlus/apps.py | FelixTheC/onlineOrderForm | 0 | 12779442 | from django.apps import AppConfig
class VertexplusConfig(AppConfig):
name = 'vertexPlus'
| 1.0625 | 1 |
ECD_control/__init__.py | AndrewOriani/ECD_control | 0 | 12779443 | <reponame>AndrewOriani/ECD_control
from . import ECD_optimization
from . import ECD_pulse_construction
from .ECD_pulse_construction import FakeStorage, FakeQubit, FakePulse
from .ECD_optimization import BatchOptimizer, OptimizationSweepsAnalysis, OptimizationAnalysis, VisualizationMixin, tf_quantum, optimization_sweep... | 0.925781 | 1 |
src/notepad/forms.py | vijaykumarmcp/StockChartVisual | 0 | 12779444 | from django import forms
from .models import Note
class NoteModelForm(forms.ModelForm):
class Meta:
model=Note
fields=['title','url','image']
| 1.929688 | 2 |
main.py | hertai86/GIEAA | 0 | 12779445 | <filename>main.py<gh_stars>0
import csv
import os
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.parasite_axes import HostAxes, ParasiteAxes
gdp_list = {}
edu_list = {}
interval = 0
normalize_factor = 2e10
firstDSpath = os.getcwd() + "\input\GDP by Country.csv"
secondDSpath = os.getcwd() + "\input\BL201... | 2.734375 | 3 |
test/basic/kafka_test/producer.py | KentWangYQ/mongo2es | 5 | 12779446 | <gh_stars>1-10
from datetime import datetime
from kafka.errors import KafkaError
from common.kafka.producer import Producer
producer = Producer()
future = producer.send('kent_topic', {'now': datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
try:
record_metadata = future.get(timeout=10)
except KafkaError as ex:
... | 2.546875 | 3 |
client.py | blockchainhelppro/Security-Flag-Installation | 0 | 12779447 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2016 Red Hat, Inc.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your... | 1.804688 | 2 |
ska-tmc/ska-tmc-centralnode-low/src/ska_tmc_centralnode_low/central_node_low.py | ska-telescope/tmc-prototype | 3 | 12779448 | <reponame>ska-telescope/tmc-prototype<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# This file is part of the CentralNode project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""
Central Node is a coordinator of the complete M&C system. Central Node implements the standar... | 1.757813 | 2 |
LMRt-example/main.py | FossilizedContainers/fossilized-controller | 1 | 12779449 | import LMRt
import os
import numpy as np
import pandas as pd
import xarray as xr
# preprocessing
print("\n======== Preprocessing ========\n")
config = 'configs.yml'
recon_iterations = 1
figure = 'graph'
job = LMRt.ReconJob()
job.load_configs(config, verbose=True)
job.load_proxydb(verbose=True)
job.filter_proxydb(ve... | 2.234375 | 2 |
src/geocurrency/units/models.py | OpenPrunus/geocurrency | 5 | 12779450 | """
Units models
"""
import logging
from datetime import date
import pint.systems
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext as _
from geocurrency.converters.models import BaseConverter, ConverterResult, \
... | 2.390625 | 2 |