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 |
|---|---|---|---|---|---|---|
src/models.py | tonouchi510/tensorflow-design | 0 | 12785051 | <filename>src/models.py
import tensorflow as tf
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
from typing import List
from absl import flags
FLAGS = flags.FLAGS
def build_model(input_shape: List, num_classes: int):
"""トレーニングに使用するモデルを作成する.
Args:
input_shape {List} -- 入力デ... | 2.796875 | 3 |
undaqTools/examples/example01__daq_to_hdf5_batch_conversion.py | rogerlew/undaqTools | 0 | 12785052 | <filename>undaqTools/examples/example01__daq_to_hdf5_batch_conversion.py
from __future__ import print_function
# Copyright (c) 2013, <NAME>
# All rights reserved.
# undaq.py in the scripts folder is more fully featured version of this
# example. This code is a bit easier to follow though.
"""
Batch convert daq files ... | 2.78125 | 3 |
viz.py | huanzhang12/tensorflow-alexnet-model | 7 | 12785053 | <gh_stars>1-10
import tensorflow as tf
from tensorflow.python.platform import gfile
import sys
if len(sys.argv) < 2:
print("Usage: {} model_file log_dir".format(sys.argv[0]))
sys.exit(0)
model_filename = sys.argv[1]
LOGDIR = sys.argv[2]
with tf.Session() as sess:
with gfile.FastGFile(model_filename, 'rb'... | 2.578125 | 3 |
views/game_over_view.py | AnotherCat/dtc-level-2-game | 0 | 12785054 | <gh_stars>0
from typing import TYPE_CHECKING
from arcade import View, draw_text, set_viewport, start_render
from arcade.color import WHITE
from static_values import HEIGHT, START_LEVEL, WIDTH
if TYPE_CHECKING:
from main import GameWindow
class GameOverView(View):
"""View to show when game is over"""
d... | 3.09375 | 3 |
tests/unit/test_cluster.py | kishkaru/python-driver | 0 | 12785055 | # Copyright 2013-2016 DataStax, 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 law or agreed to in writi... | 1.921875 | 2 |
envreader/field_getter.py | vd2org/envreader | 11 | 12785056 | # Copyright (C) 2020-2021 by Vd.
# This file is part of EnvReader, the modern environment variables processor.
# EnvReader is released under the MIT License (see LICENSE).
from typing import Callable, Optional
from .field import Field
class FieldGetter(Field):
def __init__(self, default, alias: str, transform:... | 2.453125 | 2 |
Advance/5.Regex.py | AMZEnterprise/Python_Course_Jadi | 0 | 12785057 | <reponame>AMZEnterprise/Python_Course_Jadi
import re
str = 'Hello ali, how are you ali? I am fine. And you?'
result = re.search(r'ali', str)
print(result)
result = re.sub(r'ali', 'Mahdi', str)
print(result) | 3.671875 | 4 |
flash/video/classification/input_transform.py | Actis92/lightning-flash | 1,457 | 12785058 | # Copyright The PyTorch Lightning team.
#
# 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 i... | 2.0625 | 2 |
compileman/Compile_Result.py | danilocgsilva/CompileMan | 0 | 12785059 | class Compile_Result:
def __init__(self):
self.success = None
self.message = None
def setSuccess(self):
self.success = True
return self
def setError(self, message: str):
self.success = False
self.message = message
return self
def getResult(self... | 2.75 | 3 |
dict.py | jlogans/vampy2017cs | 1 | 12785060 | d1 = {"key1":1, "key2":2, "key3":3, "key4":4, "key5":5}
sorted_keys = sorted(d1)
print(sorted_keys)
for key in sorted_keys:
print(d1[key])
| 3.96875 | 4 |
chapter3/run23.py | donngchao/python_code_snippets | 0 | 12785061 | # encoding: utf-8
'''
@author: developer
@software: python
@file: run23.py
@time: 2021/8/7 7:10
@desc:
'''
'''
描述
2008年北京奥运会,A国的运动员参与了n天的决赛项目(1≤n≤17)。现在要统计一下A国所获得的金、银、铜牌数目及总奖牌数。
输入
输入n+1行,第1行是A国参与决赛项目的天数n,其后n行,每一行是该国某一天获得的金、银、铜牌数目,以一个空格分开。
输出
输出1行,包括4个整数,为A国所获得的金、银、铜牌总数及总奖牌数,以一个空格分开。
样例输入
3
1 0 3
3 1 0
0 3 0
样例输出
4 4... | 3.59375 | 4 |
ozet/settings/dev.py | ozet-team/ozet-server | 0 | 12785062 | <filename>ozet/settings/dev.py
# fmt: off
# flake8: noqa
from .base import *
INSTAGRAM_OAUTH_REDIRECT_URL = "https://staging-api.ozet.app/api/v1/member/user/me/instagram/oauth/authorize/"
CRONJOBS = []
| 1 | 1 |
scripts/rule_system/POTATO/frontend/app.py | GKingA/offensive_text | 0 | 12785063 | import argparse
import configparser
import copy
import datetime
import json
import os
import random
import re
import sys
import time
from collections import Counter, defaultdict
from contextlib import contextmanager
from io import StringIO
from threading import current_thread
import networkx as nx
import pandas as pd
... | 1.851563 | 2 |
benchmark/lue/benchmark/export_results.py | computationalgeography/lue | 2 | 12785064 | import lue.data_model as ldm
import numpy as np
import csv
def export_partition_shape_results(
lue_dataset,
csv_writer):
# Assert that the number of array shapes for which experiments where
# performed is 1
lue_array = lue_dataset.array.array
assert lue_array.shape.value.nr_arrays == ... | 2.3125 | 2 |
src/playbacker/clock.py | vrslev/playbacker | 1 | 12785065 | import time
from dataclasses import dataclass, field
from threading import Event, Thread
from typing import Callable, NoReturn
@dataclass
class Clock:
callback: Callable[[], None] = field(repr=False)
thread: Thread = field(init=False, repr=False)
started: Event = field(default_factory=Event, init=False, r... | 2.859375 | 3 |
examples/varying_model_parameters/scan_torsions/scan_torsions.py | shirtsgroup/foldamers | 1 | 12785066 | import os
from statistics import mean
import numpy as np
import matplotlib.pyplot as pyplot
from simtk import unit
from simtk.openmm.app.pdbfile import PDBFile
from foldamers.cg_model.cgmodel import CGModel
from foldamers.parameters.reweight import *
from foldamers.thermo.calc import *
from foldamers.ensembles.ens_buil... | 1.929688 | 2 |
extract_pin_function_from_liberty.py | hrshishym/ExtractPinFunctionFromLibertySource | 0 | 12785067 | <reponame>hrshishym/ExtractPinFunctionFromLibertySource<filename>extract_pin_function_from_liberty.py
#!/usr/bin/env python
### Setting
cell_attributes = ["clock_gating_integrated_cell"]
ff_attributes = []
pin_attributes = ["direction", "clock", "function", "state_function"]
import os
import sys
import r... | 2.484375 | 2 |
PyPoll/Resources/main.py | alcazar007/python-challenge | 0 | 12785068 | '''
## PyPoll

* In this challenge, you are tasked with helping a small, rural town
modernize its vote-counting process. (Up until now, Uncle Cleetus had
been trustfully tallying them one-by-one, but unfortunately, his concentration isn't what it used to be.)
* You will be ... | 3.703125 | 4 |
mantabot/core/private.py | spectras/turbot | 2 | 12785069 | <gh_stars>1-10
import asyncio
class PrivateChat(object):
""" A direct messaging channel to a specific user
There should be only one per user per bot. The intent is to provide a way for
multiple plugins to claim, acquire and release the private chat, preventing
several of them from interact... | 2.8125 | 3 |
lib/TestTaxonAPI/TestTaxonAPIImpl.py | scanon/testtaxonapi | 0 | 12785070 | <reponame>scanon/testtaxonapi
#BEGIN_HEADER
from biokbase.workspace.client import Workspace as workspaceService
import doekbase.data_api.taxonomy.taxon.api
from doekbase.data_api import cache
import logging
#END_HEADER
class TestTaxonAPI:
'''
Module Name:
TestTaxonAPI
Module Description:
A KBase ... | 1.820313 | 2 |
models/head/box_head.py | nota-github/ssd_tf2 | 8 | 12785071 | import tensorflow as tf
from utils import box_utils
from models import registry
from .loss import MultiBoxLoss
from .inference import PostProcessor
from models.head.box_predictor import make_box_predictor
from models.anchors.prior_box import PriorBox
@registry.BOX_HEADS.register('SSDBoxHead')
class SSDBoxHe... | 2.015625 | 2 |
mahjong/ai/test/test_mahjong_comb.py | feiyaaaa/mahjong | 0 | 12785072 | import pymysql
import sys
from mahjong.ai.comb.perm_comb_mahjong import PermCombMahjongGenerator
Tiles = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
db = pymysql.connect(host='127.0.0.1', user='root',
password='<PASSWORD>', db='mahjong', port=3306, charset='utf8')
cur... | 2.6875 | 3 |
catalog/Marshall PY/plugins/games.py | derwear/bots.hub | 8 | 12785073 | <reponame>derwear/bots.hub
import datetime, random, time
from kutana.vksm import *
from kutana import Plugin
from kutana.database import *
import aiohttp, json, re, xmltodict
plugin = Plugin(name="other")
cases = (2, 0, 1, 1, 1, 2)
def plural_form(n: int, v: (list, tuple), need_n=False, need_cases=False):
"""Фун... | 2.25 | 2 |
plugins/niux2_hermit_player/__init__.py | sdphome/blog-content | 0 | 12785074 | # -*- coding: UTF-8 -*-
from .niux2_hermit_player import *
| 0.917969 | 1 |
Crypt/Crypt/Crypt.py | wtglover/TOR | 0 | 12785075 | from Crypto.PublicKey import RSA
from Crypto.Signature import pss
from Crypto.Hash import SHA256
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Protocol.KDF import PBKDF2
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from os import urandom
import struct
import logging
import sys
crypt_log... | 2.453125 | 2 |
sphinxcontrib/pylit/PylitFile.py | rblack42/sphinxcontrib-pylit | 0 | 12785076 | from sphinx.directives.code import CodeBlock
class PylitFile(CodeBlock):
def run(self):
caption = self.options.get('caption')
if not caption:
caption = ""
newcaption = '<<' + caption + '>>=='
self.options['caption'] = newcaption
# format the block and return
... | 2.625 | 3 |
Incident-Response/Tools/grr/grr/client/grr_response_client/unprivileged/memory/client.py | sn0b4ll/Incident-Playbook | 1 | 12785077 | #!/usr/bin/env python
"""Unprivileged memory RPC client code."""
import abc
from typing import TypeVar, Generic
from grr_response_client.unprivileged import communication
from grr_response_client.unprivileged.proto import memory_pb2
class ConnectionWrapper:
"""Wraps a connection, adding protobuf serialization of ... | 2.578125 | 3 |
{{cookiecutter.project_name}}/{{cookiecutter.app_name}}/api/graphql/views.py | Anyesh/cookiecutter-flask-all-in-one | 35 | 12785078 | <gh_stars>10-100
from flask import Blueprint
from flask_graphql import GraphQLView
from {{cookiecutter.app_name}}.api.graphql.schemas import schema
bp = Blueprint('graphql', __name__)
def graphql():
view = GraphQLView.as_view('graphql', schema=schema, graphiql=True)
return view
bp.add_url_rule('/graphql',... | 2.0625 | 2 |
bbt_bpm/bbt_bpm/report/obsolescence_report/obsolescence_report.py | rathodjitendra/BBT-I2E | 0 | 12785079 | <reponame>rathodjitendra/BBT-I2E
# Copyright (c) 2013, Bakelite and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
from frappe.utils import has_common
import json
from six import StringIO, string_types
from datetime imp... | 1.710938 | 2 |
ubxlib/cid.py | albard00/ubxlib | 3 | 12785080 | <gh_stars>1-10
class UbxCID(object):
# UBX Class IDs
CLASS_NAV = 0x01
CLASS_ACK = 0x05
CLASS_CFG = 0x06
CLASS_UPD = 0x09
CLASS_MON = 0x0A
CLASS_ESF = 0x10
CLASS_MGA = 0x13
def __init__(self, cls, id):
super().__init__()
self.__cls = cls
self.__id = id
@... | 2.5 | 2 |
mpqa.py | trondth/master | 0 | 12785081 | <reponame>trondth/master<gh_stars>0
import ast
import os
import random
import re
from collections import OrderedDict
from future_builtins import zip
import shlex
from masters_project_config import *
def pairwise(iterable):
"""
@param iterable: List or other iterable
@return: List of tuples
"""
a = ... | 2.453125 | 2 |
bookyourcab/models.py | shankarj67/bookyouruber | 0 | 12785082 | from django.db import models
# Create your models here.
class Uber(models.Model):
source = models.CharField(max_length=150)
destination = models.CharField(max_length=150)
time = models.TimeField()
email = models.EmailField()
| 2.234375 | 2 |
0062 The Accountant.py | ansabgillani/binarysearchcomproblems | 1 | 12785083 | <filename>0062 The Accountant.py
class Solution:
def solve(self, n):
ans = []
while n > 0:
ans.append(chr(ord("A") + (n-1)%26))
n = (n-1)//26
ans.reverse()
return "".join(ans)
| 3.328125 | 3 |
pytorch/sje_gmpool.py | tchittesh/zsl-project | 0 | 12785084 | import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from utils import normalizeFeaturesL2
class SJE_GMPool(nn.Module):
def __init__(self, img_feature_size, num_attributes, margin):
super(SJE_GMPool, self).__ini... | 2.28125 | 2 |
market/migrations/0008_auto_20161206_2042.py | zhanhailiu/Market | 39 | 12785085 | <filename>market/migrations/0008_auto_20161206_2042.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-06 12:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('market', '0007_goods_publish_time'),
... | 1.390625 | 1 |
pyscreenshot/__init__.py | audreyr/pyscreenshot | 1 | 12785086 | <gh_stars>1-10
from easyprocess import EasyProcess
from pyscreenshot.backendloader import BackendLoader
from PIL import Image
import logging
import tempfile
import sys
__version__ = '0.3.2'
log = logging.getLogger(__name__)
log.debug('version=' + __version__)
def _grab(to_file, childprocess=False, backend=None, bbo... | 2.328125 | 2 |
scripts/hyphy_simulated.py | ThibaultLatrille/NucleotideBias | 0 | 12785087 | <reponame>ThibaultLatrille/NucleotideBias
# GLOBAL IMPORTS
import argparse
import pandas as pd
from plot_module import *
from hyphy_format import *
import statsmodels.api as sm
from stat_simulated import stats_from_ali, open_fasta_file, omega_pairwise_from_profile
from scipy.linalg import null_space
def plot_pairwise... | 2.5625 | 3 |
src/h_matchers/matcher/number.py | hypothesis/h-matcher | 0 | 12785088 | """A collection of matchers for various number types."""
# pylint: disable=too-few-public-methods
from decimal import Decimal
from h_matchers.matcher.core import Matcher
class AnyNumber(Matcher):
"""Matches any number."""
_types = (int, float, complex, Decimal)
_type_description = "number"
def __i... | 3.109375 | 3 |
turbo/__init__.py | blopker/turbo-django | 0 | 12785089 | <gh_stars>0
from django.db.models import Model
default_app_config = 'turbo.apps.TurboDjangoConfig'
def make_channel_name(model_label, pk):
return f"BROADCAST-{model_label}-{pk}".lower()
def channel_name_for_instance(instance: Model):
return make_channel_name(instance._meta.label, instance.pk)
| 2 | 2 |
src/py/4.3.4-Task-API-Multi-label.py | saibaldas/automl-in-action-notebooks | 1 | 12785090 | <filename>src/py/4.3.4-Task-API-Multi-label.py
"""shell
pip install -r https://raw.githubusercontent.com/datamllab/automl-in-action-notebooks/master/requirements.txt
"""
import tensorflow as tf
import autokeras as ak
"""
### Create synthetic multi-label dataset
"""
from sklearn.datasets import make_multilabel_classi... | 3.109375 | 3 |
oz/error_pages/uimodules.py | dailymuse/oz | 36 | 12785091 | """UIModules for the error pages plugin"""
import oz
import base64
import pprint
import oz.error_pages
import tornado.web
import tornado.escape
TABLE_FORMAT = """
<table %s %s>
<thead>
<tr>
<th>Variable</th>
<th>Value</th>
</tr>
</thead>
<tbody>
%s
</tbo... | 2.59375 | 3 |
subsync.py | Xwaler/Subsync-headless | 0 | 12785092 | import os
import time
import shlex
import shutil
import requests
import threading
import json
from watchdog.observers import Observer
from watchdog.events import FileSystemEvent, FileSystemEventHandler
from subprocess import check_call, DEVNULL, check_output, STDOUT, CalledProcessError
BAZARR_URL = os.environ.get('BA... | 2.109375 | 2 |
source/functions/Key_generate.py | GucciHsuan/CampusCyberInspectionTool2021 | 0 | 12785093 | from cryptography.fernet import Fernet
class Key_generate:
def write_key():
"""
Generates a key and save it into a file
"""
key = Fernet.generate_key()
with open("key.key", "wb") as key_file:
key_file.write(key)
key = open("key.key", "rb").read()
pr... | 3.453125 | 3 |
github_commit.py | Aaron1011/CloudBotPlugins | 0 | 12785094 | <filename>github_commit.py<gh_stars>0
from cloudbot import hook
import requests
GITHUB_URL = "https://api.github.com/repos/{}/{}/branches/{}"
DEFAULT_OWNER = "SpongePowered"
DEFAULT_REPO = "SpongeAPI"
DEFAULT_BRANCH = "master"
@hook.command("latest", "l")
def latest(text, message):
data = None
owner = DEFAU... | 2.640625 | 3 |
stagecraft/apps/dashboards/models/__init__.py | alphagov-mirror/stagecraft | 3 | 12785095 | <gh_stars>1-10
from .dashboard import Dashboard, Link
from .module import Module, ModuleType
| 1.101563 | 1 |
RecoTauTag/Configuration/python/tools/adaptToRunAtMiniAOD.py | menglu21/cmssw | 0 | 12785096 | <reponame>menglu21/cmssw<filename>RecoTauTag/Configuration/python/tools/adaptToRunAtMiniAOD.py
import FWCore.ParameterSet.Config as cms
######
# Tools to adapt Tau sequences to run tau ReReco+PAT at MiniAOD samples
# <NAME>, <NAME>
# based on work of <NAME>, CERN
# Created: 9 Nov. 2017
######
import PhysicsTools.PatA... | 1.984375 | 2 |
oscar/lib/python2.7/site-packages/_pytest/__init__.py | bhav11esh/Oscar-Bookshelf | 1 | 12785097 | #
__version__ = '3.0.6'
| 1.054688 | 1 |
instance.py | Elaina-Alex/PixivCrawler | 1 | 12785098 | <filename>instance.py
import os
import re
import time
from rich import print
import yaml
class Msg:
msg_help = [
"输入首字母",
"h | help\t\t\t\t\t\t--- 显示说明",
"q | quit\t\t\t\t\t\t--- 退出正在运作的程序",
"d | picture\t\t\t\t\t\t--- 输入id或url下载插画",
"t | recommend\t\t\t\t\t---... | 2.484375 | 2 |
_doc/examples/gallery1/plot_project_name.py | sdpython/python_project_template | 0 | 12785099 | <filename>_doc/examples/gallery1/plot_project_name.py
# -*- coding: utf-8 -*-
"""
===============================
Example with the project itself
===============================
Example with a simple import.
"""
##############################
# import
import python3_module_template
print(python3_module_template.__ver... | 1.898438 | 2 |
lib/data_stores/tdb_data_store_test.py | nahidupa/grr | 1 | 12785100 | #!/usr/bin/env python
"""Tests the tdb data store - in memory implementation."""
import shutil
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import... | 2.109375 | 2 |
imaging.py | jinjiaho/project57 | 0 | 12785101 | <gh_stars>0
from PIL import Image
import os
## A library for all your image manipulation needs!
## Requires Pillow for Python 2.7/3.3+
class Imaging(object):
# set proposed dimension of thumbnail
# assume max height/width of 255
def __init__(self, dim=255, path="static/img/items/", fallback="default.thum... | 3.078125 | 3 |
tests/test_copyright.py | jbwang1997/pre-commit-hooks | 12 | 12785102 | <filename>tests/test_copyright.py
import os
import os.path as osp
from pre_commit_hooks.check_copyright import check_copyright
def test_copyright():
includes = ['./tests/data']
excludes = ['./tests/data/exclude']
suffixes = ['.py', '.cpp', '.h', '.cu', '.cuh', '.hpp']
contain_copyright = ['./tests/da... | 2.453125 | 2 |
android-runner/ExperimentRunner/MonkeyRunner.py | S2-group/mobilesoft-2020-caching-pwa-replication-package | 0 | 12785103 | import subprocess
from ExperimentRunner.Script import Script
class MonkeyRunner(Script):
"""
Subclass of `Script` for running MonkeyRunner scripts directly.
As opposed to `MonkeyReplay`, it runs the scripts directly using MonkeyRunner.
Thanks to that it's not necessary to go through a layer of indir... | 2.6875 | 3 |
mysite/slhpa/admin.py | jeffb4real/SLHPA-Web-App | 1 | 12785104 | from django.contrib import admin
from .models import PhotoRecord, KeyValueRecord
admin.site.register(PhotoRecord)
admin.site.register(KeyValueRecord)
| 1.273438 | 1 |
nmastudio/tools/storage.py | silviametelli/nmastudio | 2 | 12785105 | <reponame>silviametelli/nmastudio
import pandas as pd
from nmastudio.tools.utils import get_network
from collections import OrderedDict
NET_DATA = pd.read_csv('db/psoriasis_wide.csv')
NET_DATA2 = NET_DATA.drop(["TE", "seTE", "n1", "n2"], axis=1)
NET_DATA2 = NET_DATA2.rename(columns={"TE2": "TE", "seTE2": "seTE", "n2.... | 2.5625 | 3 |
data_structures/tests/test_union_find.py | tzaffi/PyAlgo | 0 | 12785106 | <filename>data_structures/tests/test_union_find.py
from data_structures.union_find import UnionFind
def test_init():
ds = UnionFind([1, 2, 3])
assert ds._elts == {1, 2, 3}
assert ds._reps == {1, 2, 3}
assert ds._comp_count == 3
assert ds._parent[2] == 2
def test_union_find():
ds = UnionFind(... | 3.046875 | 3 |
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/contextlib.py | bidhata/EquationGroupLeaks | 9 | 12785107 | <reponame>bidhata/EquationGroupLeaks
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: contextlib.py
"""Utilities for with-statement contexts. See PEP 343."""
import sys
from functools import wraps
... | 2.921875 | 3 |
ituro/orders/management/commands/linefollowerdeleteorders.py | kayduemre/ituro | 9 | 12785108 | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from orders.models import RaceOrder, LineFollowerRaceOrder
class Command(BaseCommand):
args = '<day>'
help = 'Deletes line follower race orders of the specified day.'
def handle(self, *args, **options):
... | 2.296875 | 2 |
leitor.py | rjribeiro/trabalho-formais | 3 | 12785109 | <gh_stars>1-10
import re
class Leitor:
def __init__(self, arquivo):
self.__terminais = self.__monta_terminais(arquivo)
self.__variaveis = self.__monta_variaveis(arquivo)
self.__inicial = self.__le_linha(arquivo).strip()[2:-2]
self.__producoes = self.__monta_producoes(arquivo)
d... | 3.1875 | 3 |
assignment1/mapper.py | IITDU-BSSE06/ads-demystifying-the-logs-Sabir001 | 0 | 12785110 | #!/usr/bin/python
import sys
for line in sys.stdin:
data = line.strip().split("- -")
if len(data) == 2:
ipAddress, rest = data
if ipAddress.strip() == "10.99.99.186":
print "{0}".format(ipAddress)
| 3.21875 | 3 |
blender-processing-scripts/render/master_image_from_angle.py | MikeFesta/3xr | 7 | 12785111 | # SPDX-License-Identifier: Apache-2.0
import bpy
import math
import os
import time
from xrs import automate as xra
## Depricated - used to render asset submissions
# rename
xra.log_info('Rendering Asset Master Image from angle')
arguments = xra.get_command_line_arguments()
working_dir = arguments[0]
asset_name = argu... | 2.046875 | 2 |
examples/add_vm_nic.py | oliel/python-ovirt-engine-sdk4 | 3 | 12785112 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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... | 2.28125 | 2 |
python_packaging/sample_restraint/tests/test_binding.py | kassonlab/gmxapi | 43 | 12785113 | <gh_stars>10-100
# The myplugin module must be locatable by Python.
# If you configured CMake in the build directory ``/path/to/repo/build`` then,
# assuming you are in ``/path/to/repo``, run the tests with something like
# PYTHONPATH=./cmake-build-debug/src/pythonmodule mpiexec -n 2 python -m mpi4py -m pytest test... | 1.859375 | 2 |
tests/util/test_filetimes.py | dariusbakunas/rawdisk | 3 | 12785114 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from rawdisk.util.filetimes import dt_to_filetime, filetime_to_dt, UTC, ZERO
from datetime import datetime
class TestFiletimesModule(unittest.TestCase):
def test_dt_to_filetime(self):
value = datetime(2009, 7, 25, 23, 0)
self.assertEqu... | 2.8125 | 3 |
migrations/sqlite_versions/2020-05-15_ccc37f794db6_update_add_constraints.py | debrief/pepys-import | 4 | 12785115 | """update, add constraints
Revision ID: ccc37f794db6
Revises: <PASSWORD>
Create Date: 2020-05-15 14:02:21.163220
"""
from datetime import datetime
from uuid import uuid4
from alembic import op
from geoalchemy2 import Geometry
from sqlalchemy import DATE, Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Stri... | 1.789063 | 2 |
predictatops/checkdata_runner.py | bluetyson/predictatops | 0 | 12785116 | # -*- coding: utf-8 -*-
##### import from other modules
from checkdata import *
from configurationplusfiles_runner import input_data_inst, config, output_data_inst
##### running functions called from elsewhere #####
tops = TopsAvailable(input_data_inst, config)
print("finding unique tops:")
tops.find_unique_tops_li... | 3.03125 | 3 |
remote/python/src/main.py | magnusoy/Sparkie | 15 | 12785117 | <filename>remote/python/src/main.py
# #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module ...
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, Sparkie Quadruped Robot"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__version__ = "1.0.0"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>... | 2.09375 | 2 |
AnEnsembleForPointEstimate/PredictWindSpd.py | AmateurZhang/EnjoyWithDataOnPowerSystems | 0 | 12785118 | <reponame>AmateurZhang/EnjoyWithDataOnPowerSystems
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 2 22:39:11 2017
@author: thuzhang
"""
#Predict WindSpeed(WINDSPD)
#packages
import numpy as np
import pandas as pd
import sklearn.svm as svm
from sklearn.cross_validation import train_test_split
import matplotlib.pyplo... | 3.140625 | 3 |
wca/components.py | Rajpratik71/workload-collocation-agent | 40 | 12785119 | # Copyright (c) 2018 Intel 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 in... | 1.703125 | 2 |
tensorflow_graphics/datasets/features/camera_feature_test.py | Liang813/graphics | 2,759 | 12785120 | # Copyright 2020 The TensorFlow Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 2.3125 | 2 |
MFCN_SMC/code_MFCN/stage3_line_reconnection.py | kskim-phd/MFCN | 0 | 12785121 | <reponame>kskim-phd/MFCN
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 17 2020
@author: <NAME> (<EMAIL>)
"""
import header
# common
import torch, torchvision
import numpy as np
# dataset
import mydataset
from torch.utils.data import DataLoader
from PIL import Image
# model
import torch.nn as nn
# post processing
... | 2.34375 | 2 |
python/sqlflow_submitter/xgboost/feature_column.py | brightcoder01/sqlflow | 0 | 12785122 | <reponame>brightcoder01/sqlflow<gh_stars>0
# Copyright 2020 The SQLFlow 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/LICENSE-... | 2.453125 | 2 |
extract_bert_model.py | to-aoki/my-pytorch-bert | 21 | 12785123 | <reponame>to-aoki/my-pytorch-bert
# Author <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 2.203125 | 2 |
gallery/admin.py | lukacu/django-gallery | 2 | 12785124 | <reponame>lukacu/django-gallery
#!/usr/bin/python
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from django.conf import settings
from django.contrib.admin.util import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.sh... | 2.0625 | 2 |
ilexconf/config.py | vduseev/holly-config | 9 | 12785125 | from mapz import Mapz
from typing import (
Any,
Hashable,
Mapping,
)
class Config(Mapz):
def __init__(self, *mappings: Mapping[Hashable, Any], **kwargs: Any):
super().__init__(*mappings)
for k, v in kwargs.items():
self.set(
k,
v,
... | 2.90625 | 3 |
rcnn_dff/symbol/rcnn_iou_loss.py | tonysy/mx-rcnn-flow | 2 | 12785126 | <filename>rcnn_dff/symbol/rcnn_iou_loss.py
import mxnet as mx
import numpy as np
def check_equal(lst, errstr='check_equal'):
assert len(set(lst)) <= 1, '%s:%s' % (errstr, lst)
class RCNNIoULossOperator(mx.operator.CustomOp):
def __init__(self, num_classes, grad_scale):
super(RCNNIoULossOperator, sel... | 2.125 | 2 |
Python/Ex069.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 0 | 12785127 | cont_pes = homens = mulheres_20 = 0
while True:
print('-' * 20)
print('CADASTRO DE UMA PESSOA')
print('-' * 20)
idade = int(input('Idade: '))
sexo = ' '
while sexo not in 'MF':
sexo = str(input('Sexo: [M/F]')).strip().upper()[0]
print('-' * 20)
if idade > 18:
cont_pes +=... | 3.6875 | 4 |
tests/test_secret_sources.py | jroslaniec/top-secret | 3 | 12785128 | import os
import shutil
import pytest
from top_secret import FileSecretSource, DirectorySecretSource
from top_secret import SecretMissingError
SECRET_BASE_PATH = os.path.join("/tmp", ".top_secret_test")
@pytest.fixture(scope="module", autouse=True)
def setup_teardown_module():
# Setup
os.makedirs(SECRET_BA... | 2.078125 | 2 |
api/migrations/0078_lightningtalk.py | pythonkr/pyconkr-api | 25 | 12785129 | <reponame>pythonkr/pyconkr-api<filename>api/migrations/0078_lightningtalk.py
# Generated by Django 2.2 on 2019-08-04 07:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappab... | 1.554688 | 2 |
dolosse/data_formats/ldf/header.py | Tobias2023/dolosse | 9 | 12785130 | <reponame>Tobias2023/dolosse
"""
file: header.py
brief: Defines how to handle an LDF Header buffer
author: <NAME>
date: February 04, 2019
"""
import struct
import dolosse.constants.data as data
class LdfHeader:
"""
Defines a structure that reads the header information from a ORNL HEAD buffer
"""
def ... | 2.6875 | 3 |
Views/Roles.py | GhostyCatt/TheCloud | 2 | 12785131 | # Library Imports
from os import execl
import nextcord, json
from nextcord.ui import button, View, Select
# Custom Imports
from Functions.Embed import *
# Options from Json
with open('Config/Options.json') as RawOptions:
Options = json.load(RawOptions)
# Note: The roles are fetched from IDs. These id's are store... | 2.53125 | 3 |
Server_free_login_script/main.py | Ahrli/fast_tools | 1 | 12785132 | <reponame>Ahrli/fast_tools
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
' a test module '
import time
__author__ = '<NAME>'
import paramiko
# username = "ahrli"
# password = "<PASSWORD>"
'''需要免密码登录服务器列表'''
################## 修改这里 别的不要动 ##########################
# 用户 ip 密码
hostname_list=[
('root','192.168.0.108','... | 1.945313 | 2 |
mysite/article/views.py | wuhaoqiu/engr597-stable | 0 | 12785133 | from django.shortcuts import render, get_object_or_404, get_list_or_404
from .models import Article,Comment
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from .forms import ShareEmailForm,CommentForm,SearchForm,ArticleForm
# from django.core.mail import send_mail
from django.db.models import Co... | 2.25 | 2 |
snippet/social_oauth/backends.py | duoduo369/social_auth_demo | 45 | 12785134 | from django.contrib.auth.backends import ModelBackend
from 你个人的.models import UserProfile
from social_auth.models import UserSocialAuth
class OAuth2Backend(ModelBackend):
'''
oauth backend
'''
def authenticate(self, provider=None, uid=None):
try:
user_social = UserSocialAuth.object... | 2.21875 | 2 |
torch_glow/tests/nodes/floor_test.py | dreiss/glow | 1 | 12785135 | <gh_stars>1-10
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import torch
from tests.utils import jitVsGlow
class TestFloor(unittest.TestCase):
def test_floor(self):
"""Basic test of the PyTorch floor Node on Glow."""
def test_f(a, b):
... | 2.421875 | 2 |
konfuzio_sdk/regex.py | konfuzio-ai/konfuzio-sdk | 0 | 12785136 | """Generic way to build regex from examples."""
import logging
import regex as re
from typing import List, Dict
import pandas
from tabulate import tabulate
logger = logging.getLogger(__name__)
def merge_regex(regex_tokens: List[str]):
"""Merge a list of regex to one group."""
tokens = r'|'.join(sorted(regex... | 3.640625 | 4 |
viewers/auger_sync_raster_scan.py | ScopeFoundry/FoundryDataBrowser | 6 | 12785137 | <gh_stars>1-10
from ScopeFoundry.data_browser import DataBrowserView
import pyqtgraph as pg
import numpy as np
from qtpy import QtWidgets
import h5py
class AugerSyncRasterScanH5(DataBrowserView):
name = 'auger_sync_raster_scan'
def setup(self):
self.settings.New('frame', dtype=int)
... | 2.171875 | 2 |
src/deleteNode.py | JL1829/LeetCode | 0 | 12785138 | <gh_stars>0
"""
请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点。
传入函数的**唯一参数** 是 **要被删除的节点**
现在有一链表:
[4, 5, 1, 9]
它表示为:4 -> 5 -> 1 -> 9
删除节点5, 返回:[4, 1, 9], 因为: 5 被移除了,链表表示为: 4 -> 1 -> 9
**注意**
你只知道要被删除的节点,它的上一个节点你不知道。
**test case**
>>> head = ListNode(4)
>>> head.next = ListNode(5)
>>> head.next.next = ListNode(1)
>>> head.next.next.... | 4.125 | 4 |
sqlite_dissect/carving/__init__.py | Defense-Cyber-Crime-Center/sqlite-dissect | 12 | 12785139 |
"""
__init__.py
This init script will initialize any needed logic for this package.
This package will control signature generation and carving of SQLite files.
"""
| 1.632813 | 2 |
tests/test_cubicbez.py | simoncozens/kurbopy | 0 | 12785140 | from kurbopy import Point, CubicBez
import math
def test_cubicbez_deriv():
c = CubicBez(
Point(0.0, 0.0),
Point(1.0 / 3.0, 0.0),
Point(2.0 / 3.0, 1.0 / 3.0),
Point(1.0, 1.0),
);
deriv = c.deriv();
n = 10;
for i in range(1, n):
t = 1/(i*n)
delta = 1e-... | 2.65625 | 3 |
xcp_abcd/utils/qcmetrics.py | krmurtha/xcp_abcd | 5 | 12785141 | <reponame>krmurtha/xcp_abcd
import nibabel as nb
import numpy as np
def regisQ(bold2t1w_mask,t1w_mask,bold2template_mask,template_mask):
reg_qc ={'coregDice': [dc(bold2t1w_mask,t1w_mask)], 'coregJaccard': [jc(bold2t1w_mask,t1w_mask)],
'coregCrossCorr': [crosscorr(bold2t1w_mask,t1w_mask)],'coregCoverag':... | 2.34375 | 2 |
application.py | tg2648/cu-rooms-app | 0 | 12785142 | """
Main entrance to the application
"""
# Local application imports
from app import create_app
application = create_app()
if __name__ == '__main__':
application.run()
| 1.726563 | 2 |
adminlte_base/filters.py | kyzima-spb/adminlte-base | 0 | 12785143 | """
Provides ready-made implementations for filters used in templates.
"""
from string import Template
import arrow
from dateutil import tz
from .constants import ThemeColor
__all__ = ('humanize', 'if_true', 'navbar_skin', 'sidebar_skin', 'replace_with_flag')
def humanize(dt, locale='en_us', time_zone=None):
... | 3.109375 | 3 |
redbrick/version_check.py | dereklukacs/redbrick-sdk | 1 | 12785144 | """Management of versions to help users update."""
import os
from configparser import ConfigParser
from datetime import datetime
from distutils.version import StrictVersion
import requests
from .utils.logging import print_warning # pylint: disable=cyclic-import
def get_version() -> str:
"""Get current installe... | 2.390625 | 2 |
blitz_api/tests/tests_view_Users.py | Jerome-Celle/Blitz-API | 0 | 12785145 | <reponame>Jerome-Celle/Blitz-API
import json
from datetime import timedelta
from unittest import mock
from rest_framework import status
from rest_framework.test import APIClient, APITestCase
from django.contrib.auth import get_user_model
from django.core import mail
from django.urls import reverse
from django.test.u... | 2.046875 | 2 |
ray_examples/serving/modelserving/model_server_deployments.py | mlkimmins/scalingpythonml | 13 | 12785146 | import ray
from ray import serve
import requests
import os
import pickle
import numpy as np
import asyncio
# Models locations
RANDOM_FOREST_MODEL_PATH = os.path.join("wine-quality_random_forest.pkl")
XGBOOST_MODEL_PATH = os.path.join("wine-quality_xgboost.pkl")
GRBOOST_MODEL_PATH = os.path.join("wine-quality_grboost.... | 2.453125 | 2 |
tests/benchmarks.py | Bahus/easy_cache | 34 | 12785147 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import math
from contextlib import contextmanager
from timeit import default_timer
from redis import StrictRedis
import six
from django.conf import settings
# noinspection PyUnresolvedReferences
from six.moves import xrange
from easy_cac... | 1.96875 | 2 |
clothing/migrations/0003_test_data_clothCategories.py | AmitAharoni/iWear2021 | 0 | 12785148 | <gh_stars>0
from django.db import migrations, transaction
from clothing.models import ClothCategory
from iWear.resources.clothCategories import CLOTH_CATEGORIES_LIST
class Migration(migrations.Migration):
dependencies = [
('clothing', '0002_clothingitem_owner'),
]
def generate_clothcategories_dat... | 2.109375 | 2 |
tf_agents/keras_layers/transformer_encoder_layer.py | woerns/agents | 0 | 12785149 | <filename>tf_agents/keras_layers/transformer_encoder_layer.py
# coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# 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.... | 1.789063 | 2 |
hydroffice/ssp_manager/sspmanager_ui.py | hydroffice/hyo_sspmanager | 0 | 12785150 | from __future__ import absolute_import, division, print_function, unicode_literals
import wx
import logging
log = logging.getLogger(__name__)
MENU_FILE = wx.NewId()
MENU_VIEW = wx.NewId()
MENU_INTERACT = wx.NewId()
MENU_PROC = wx.NewId()
MENU_DB = wx.NewId()
MENU_SERVER = wx.NewId()
MENU_TOOLS = wx.NewId()
MENU_HEL... | 1.609375 | 2 |