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
pyAI-OpenMV4/2.机器视觉/5.人脸检测/2.人脸追踪/face_tracking.py
01studio-lab/MicroPython_Examples
73
12763251
# 人脸追踪例程 # # 这个例程展示了如何使用关键特征来追踪一个已经使用Haar Cascade检测出来的人脸。 # 程序第一阶段先使用 Haar Cascade 找出人脸.然后使用关键特征来学习,最后不停的找这个人脸。 # 关键特征点可以用来追踪任何栋。 # #翻译:01Studio import sensor, time, image # Reset sensor sensor.reset() sensor.set_contrast(3) sensor.set_gainceiling(16) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) ...
3
3
lang/py/pylib/code/warnings/warnings_showwarning.py
ch1huizong/learning
1
12763252
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 <NAME> All rights reserved. # """ """ #end_pymotw_header import warnings import logging logging.basicConfig(level=logging.INFO) def send_warnings_to_log(message, category, filename, lineno, file=None): logging.warning( '%s:%s: %s:%s' % ...
2.34375
2
setup.py
stfc/HartreeParticleDSL
0
12763253
#!/usr/bin/env python3 """Setup script. Used by easy_install and pip.""" import os from setuptools import setup, find_packages BASE_PATH = os.path.dirname(os.path.abspath(__file__)) SRC_PATH = os.path.join(BASE_PATH, "src") PACKAGES = find_packages(where=SRC_PATH) NAME = 'HartreeParticleDSL' AUTHOR = ("<NAME> <<EMAI...
2.171875
2
course_project/K33401/Zolotov_Pavel/backend/classified/migrations/0001_initial.py
pavel-zolotov/ITMO-ICT-Frontend-2021
4
12763254
<filename>course_project/K33401/Zolotov_Pavel/backend/classified/migrations/0001_initial.py # Generated by Django 4.0.1 on 2022-01-22 17:45 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): ...
1.773438
2
pyzipcin/__init__.py
ravigoel08/Zipcin
4
12763255
<gh_stars>1-10 from .modules import * """ decode: Convert PINCODE to Information(District, State etc.). encode: Convert District to PINCODE. validate: Verify if Pincode is Correct or Not """ __version__ = "0.1.0" __all__ = [decode.__name__, encode.__name__, validate.__name__]
1.828125
2
greykite/common/features/timeseries_features.py
CaduceusInc/greykite
1
12763256
# BSD 2-CLAUSE LICENSE # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # Redistributions i...
1.726563
2
bin/lib/releases.py
jfalcou/infra
135
12763257
<filename>bin/lib/releases.py<gh_stars>100-1000 from enum import Enum from typing import Optional, Tuple from attr import dataclass @dataclass(frozen=True) class Hash: hash: str def __str__(self) -> str: return f'{str(self.hash[:6])}..{str(self.hash[-6:])}' class VersionSource(Enum): value: Tu...
2.453125
2
agent_code/amy_santiago/train.py
stefanDeveloper/bomberman
3
12763258
<reponame>stefanDeveloper/bomberman<filename>agent_code/amy_santiago/train.py import pickle import random import numpy as np from collections import namedtuple, deque from typing import List import torch from torch import optim import torch.nn.functional as F import events as e # This is only an example! import sett...
2.4375
2
Backend/movie_reviews_back/api/views.py
Zhaisan/WEB-Project
2
12763259
<filename>Backend/movie_reviews_back/api/views.py from django.http.response import JsonResponse from api.models import * from api.serializers import * from rest_framework.decorators import api_view from django.http.response import JsonResponse from rest_framework.permissions import IsAuthenticated from rest_frame...
2.234375
2
matmodlab2/materials/vonmises.py
matmodlab/matmodlab2
6
12763260
<reponame>matmodlab/matmodlab2<filename>matmodlab2/materials/vonmises.py import numpy as np from ..core.logio import logger from ..core.material import Material from ..core.tensor import VOIGT ROOT2 = np.sqrt(2.) ROOT3 = np.sqrt(3.) ROOT23 = np.sqrt(2./3.) TOLER = 1e-8 class VonMisesMaterial(Material): name = 'v...
2.25
2
week6/code6.py
suhas1999/EE2703
0
12763261
# coding: utf-8 # In[2]: #start of code #importing packages import numpy as np import scipy.signal as sp import matplotlib.pyplot as plt # In[3]: def time_domain_output(f,H,t_start,t_end): t = np.linspace(t_start,t_end,10*(t_end-t_start)) t2,y,svec=sp.lsim(H,f,t) return y # In[4]: t_start ...
2.71875
3
tests/unit/states/test_ssh_known_hosts.py
yuriks/salt
1
12763262
<filename>tests/unit/states/test_ssh_known_hosts.py # -*- coding: utf-8 -*- ''' :codeauthor: <NAME> <<EMAIL>> ''' # Import Python libs from __future__ import absolute_import, unicode_literals, print_function import os # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.supp...
2.390625
2
src/f.py
kissy24/atcoder-past-exam
0
12763263
import re def sort_by_double_camel(chars: str) -> str: """ダブルキャメルケースで分割ソートする Args: chars(str): ソート対象の文字列 Returns: (list[str]): 昇順でソートされたダブルキャメルケース文字列 """ double_camels = sorted(re.findall("[A-Z][a-z]*[A-Z]", chars), key=str.lower) return "".join(double_camels) def main(): ...
4.09375
4
src/webpub_manifest_parser/opds2/__init__.py
tdilauro/webpub-manifest-parser
1
12763264
<gh_stars>1-10 from webpub_manifest_parser.core import ManifestParser, ManifestParserFactory from webpub_manifest_parser.opds2.registry import ( OPDS2CollectionRolesRegistry, OPDS2LinkRelationsRegistry, OPDS2MediaTypesRegistry, ) from webpub_manifest_parser.opds2.semantic import OPDS2SemanticAnalyzer from w...
2.046875
2
python/coroutines/pyos5.py
ASMlover/study
22
12763265
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2020 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright...
1.8125
2
flaskr/cac.py
juliasliu/application
0
12763266
'''Python script to generate CAC''' '''Authors - <NAME> ''' import numpy as np import pandas as pd from datetime import datetime import collections from .helpers import * class CAC: def __init__(self, fin_perf, oper_metrics, oth_metrics): print("INIT CAC") self.fin_perf = pd.DataFrame(fin_perf) ...
2.421875
2
tests/test_config.py
gaby/wireguard
11
12763267
import pytest from unittest.mock import ( call, mock_open, patch, ) from subnet import ip_network, IPv4Network, IPv4Address from wireguard import ( Config, ServerConfig, Peer, Server, ) from wireguard.utils import IPAddressSet def test_basic_server(): subnet = '192.168.0.0/24' a...
2.5
2
cloudwatch_metrics/cloudwatch_metrics/cloudwatch_metrics.py
tbma2014us/ops-tools
2
12763268
<gh_stars>1-10 import datetime import logging import os import re import signal import subprocess import sys import threading import time from pprint import pformat import argparse import boto3 import botocore.client import botocore.exceptions import requests __version__ = '1.0.0' logger = logging.getLogger() # noi...
2.109375
2
src/common/database.py
asimonia/pricing-alerts
0
12763269
<reponame>asimonia/pricing-alerts import pymongo class Database: URI = 'mongodb://127.0.0.1:27017' DATABASE = None @staticmethod def initialize(): client = pymongo.MongoClient(Database.URI) Database.DATABASE = client['fullstack'] @staticmethod def insert(collection, data): """Insert data into a collectio...
2.609375
3
pyhole/plugins/search.py
jk0/pyhole
12
12763270
# Copyright 2010-2016 <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 agreed to ...
3.015625
3
hlwtadmin/management/commands/resolve_orgs_without_concerts.py
Kunstenpunt/havelovewilltravel
1
12763271
<filename>hlwtadmin/management/commands/resolve_orgs_without_concerts.py from hlwtadmin.models import Artist, GigFinderUrl, GigFinder, ConcertAnnouncement, Venue, Location, Organisation, Country, Concert, RelationConcertOrganisation, Location from django.core.management.base import BaseCommand, CommandError class Co...
2.25
2
modelchimp/migrations/0049_auto_20190516_0759.py
samzer/modelchimp-server
134
12763272
# Generated by Django 2.2 on 2019-05-16 07:59 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('modelchimp', '0048_auto_20190515_1032'), ] operations = [ migrations.RemoveField( model_name='experiment', name='algorithm', ...
1.460938
1
pywraps/py_expr.py
cclauss/src
7
12763273
# -------------------------------------------------------------------------- #<pycode(py_expr)> try: import types import ctypes # Callback for IDC func callback (On Windows, we use stdcall) # typedef error_t idaapi idc_func_t(idc_value_t *argv,idc_value_t *r); try: _IDCFUNC_CB_T = ctypes.WIN...
2.078125
2
dfirtrack_artifacts/tests/artifact/test_artifact_creator_forms.py
stuhli/dfirtrack
273
12763274
from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_artifacts.forms import ArtifactCreatorForm from dfirtrack_artifacts.models import Artifactpriority, Artifactstatus, Artifacttype from dfirtrack_main.models import System, Systemstatus, Tag, Tagcolor class ArtifactCreatorFormT...
2.359375
2
Core/Rate.py
sybila/eBCSgen
1
12763275
import numpy as np import sympy from lark import Transformer, Tree from sortedcontainers import SortedList from TS.State import Vector class Rate: def __init__(self, expression): self.expression = expression def __eq__(self, other): return self.expression == other.expression def __repr_...
2.75
3
python/src/gans/cycle_gan.py
d-ikeda-sakurasoft/deep-learning
0
12763276
import sys, time, os, json import numpy as np import matplotlib.pylab as plt from PIL import Image from keras.models import * from keras.layers import * from keras.optimizers import * from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from google.colab import drive def...
2.515625
3
python_patterns/factory_method.py
detector-m/AppPythonServer
0
12763277
<filename>python_patterns/factory_method.py #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @文件 :factory_method.py @说明 :工厂方法模式(Factory Method) https://www.cnblogs.com/taosiyu/p/11293949.html @时间 :2020/08/14 22:33:15 @作者 :Riven @版本 :1.0.0 ''' ''' 工厂方法模式(Factory Method): 定义一个用于创建对...
3.5
4
transfermarkt/__init__.py
omerbd21/transfermarkt
0
12763278
<gh_stars>0 from .team import Team from .player import Player
1.148438
1
dynamic-programming/on_the_way_home.py
izan-majeed/archives
0
12763279
def ways(n, m): grid = [[None]*m]*n for i in range(m): grid[n-1][i] = 1 for i in range(n): grid[i][m-1] = 1 for i in range(n-2,-1,-1): for j in range(m-2,-1,-1): grid[i][j] = grid[i][j+1] + grid[i+1][j] return grid[0][0] if __name__ == "__main__": t = int(input("Number of times you want to run thi...
3.46875
3
05-Lists_Advanced/Exercises/7-Decipher_This.py
eclipse-ib/Software-University-Fundamentals_Module
0
12763280
message = input().split() def asci_change(message): numbers = [num for num in i if num.isdigit()] numbers_in_chr = chr(int(''.join(numbers))) letters = [letter for letter in i if not letter.isdigit()] letters_split = ''.join(letters) final_word = numbers_in_chr + str(letters_split) return fina...
3.796875
4
cnn/struct/updatelist_module.py
hslee1539/GIS_GANs
0
12763281
<filename>cnn/struct/updatelist_module.py from import_lib import lib from cnn.struct.updateset_module import UpdateSet from ctypes import Structure, c_int, POINTER, c_float class _UpdateList(Structure): _fields_ = [ ('sets', POINTER(UpdateSet)), ('setSize', c_int) ] def _create(size): retu...
2.4375
2
constants/download_data.py
zagaran/instant-census
1
12763282
<reponame>zagaran/instant-census TS_FORMAT = "%Y-%m-%d__%I-%M-%S%p" JAVASCRIPT_NULL_VALUE = "__NULL__"
0.925781
1
privacy_preserving.py
jchenglin/CODE-FOR-FBDE-MODEL
0
12763283
<reponame>jchenglin/CODE-FOR-FBDE-MODEL import os import argparse from utils import * from FBDE import FBDE """parsing and configuration""" def parse_args(): desc = "Tensorflow implementation of FBDE" parser = argparse.ArgumentParser(description=desc) parser.add_argument('--phase', type=str, default='train...
2.71875
3
shuffles.py
trigunshin/tsm
0
12763284
<reponame>trigunshin/tsm class DE: def __init__(self, reagent_per_craft, reagent_price, name="None"): self.reagent_per_craft = reagent_per_craft self.reagent_price = reagent_price self.name = name # DE constants self.dust_per_shard = 20 self.base_dust_per_de = 10 self.shard_percent = .13 self.dust_perc...
2.796875
3
fhi_lib/distance_estimator.py
yhsueh/FHI_RCNN
0
12763285
import argparse import os import sys import cv2 import numpy as np from matplotlib import pyplot as plt from functools import cmp_to_key from fhi_lib.geometry import Point, Line class DistanceEstimator(): def __init__(self, img): self.img = img self.panel_length = 2235 self.scale_length = 100 def initialize...
2.46875
2
tests/test_scan.py
translationalneurosurgery/app-vernier
2
12763286
<reponame>translationalneurosurgery/app-vernier from subprocess import Popen, PIPE def test_scan(): p = Popen(["vernier-lsl", "--scan"], stdout=PIPE, stderr=PIPE) out, err = p.communicate() assert ( "Available devices. Default sensors are marked by *." in out.decode() )
2.28125
2
tests/rekey.py
g-ongetta/CCF
0
12763287
<reponame>g-ongetta/CCF # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import infra.ccf import infra.notification import suite.test_requirements as reqs import infra.e2e_args import time from loguru import logger as LOG @reqs.description("Rekey the ledger once") ...
1.882813
2
tefla/core/encoder.py
mkulariya1/tefla
40
12763288
<filename>tefla/core/encoder.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc from collections import namedtuple import copy import yaml import numpy as np from .layers import conv1d, avg_pool_1d from .rnn_cell import LSTMCell, MultiRNNCell, Ex...
2.046875
2
.venv/lib/python3.8/site-packages/pycrop/__init__.py
amon-wanyonyi/publication
0
12763289
from .tools import contain, cover
0.972656
1
Data Scientist Career Path/11. Foundations of Machine Learning Supervised Learning/4. Classification/1. KNN/2. distance2.py
myarist/Codecademy
23
12763290
<gh_stars>10-100 star_wars = [125, 1977] raiders = [115, 1981] mean_girls = [97, 2004] def distance(movie1, movie2): length_difference = (movie1[0] - movie2[0]) ** 2 year_difference = (movie1[1] - movie2[1]) ** 2 distance = (length_difference + year_difference) ** 0.5 return distance print(distance(star_wars,...
3.234375
3
policygradientpytorch.py
biancanevo/deeprl-snes
10
12763291
<gh_stars>1-10 # Agent that learns how to play a SNES game by using Proximal Policy Optimization import retro import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Categorical import argparse import skimage from skimage import ...
2.5
2
utils/types.py
fomula91/todoapp
4
12763292
<reponame>fomula91/todoapp # Annotaion(함수나 클래스의 인자값 또는 반환값의 형태를 알려주기 위해 타입을 지정하는 방법)을 위한 클래스 # bool 타입의 ok class BooleanOk: @staticmethod def __type__(): return bool # dict 타입의 uses class DictionaryUser: @staticmethod def __type__(): fields = { "_id": str, "use...
2.515625
3
algorithms/implementation/fair_rations.py
avenet/hackerrank
0
12763293
<filename>algorithms/implementation/fair_rations.py def get_distribution_steps(distribution): i = 0 distributed_loaves = 0 while i < len(distribution): if distribution[i] % 2 == 0: i += 1 continue next_item_index = i + 1 if next_item_ind...
3.765625
4
tests/som/test_utilities.py
ifsm/apollon
0
12763294
<gh_stars>0 import unittest from hypothesis import strategies as hst from hypothesis import given import numpy as np from scipy.spatial import distance from apollon.som import utilities as asu from apollon.types import SomDims dimension = hst.integers(min_value=2, max_value=50) som_dims = hst.tuples(dimension, dimen...
2.296875
2
arch/cpu/arm/CMSIS/CMSIS/DSP/PythonWrapper/setup.py
Lkiraa/Contiki-ng
41
12763295
from distutils.core import setup, Extension import glob import numpy import config import sys import os from config import ROOT includes = [os.path.join(ROOT,"Include"),os.path.join(ROOT,"PrivateInclude"),os.path.join("cmsisdsp_pkg","src")] if sys.platform == 'win32': cflags = ["-DWIN",config.cflags,"-DUNALIGNED_SU...
1.820313
2
tensorflow_privacy/privacy/keras_models/dp_keras_model_test.py
SoaringChicken/tensorflow-privacy
0
12763296
# Copyright 2021, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
2.65625
3
transifex-data-fetcher.py
dhis2/translation-linker
0
12763297
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: philld """ import os import json from transifex.api import transifex_api print(os.getenv("PWD")) transifex_api.setup(auth=os.getenv("TX_TOKEN")) organization = transifex_api.Organization.get(slug="hisp-uio") projects = organization.fetch('projects') lang...
1.984375
2
eta/modules/video_stream_info.py
saiprakash-c/504
0
12763298
#!/usr/bin/env python ''' A module for getting the stream info for a video. Info: type: eta.core.types.Module version: 0.1.0 Copyright 2017-2018, Voxel51, LLC voxel51.com <NAME>, <EMAIL> ''' # pragma pylint: disable=redefined-builtin # pragma pylint: disable=unused-wildcard-import # pragma pylint: disable=wi...
2.359375
2
src/extensions/cleanup/cleanup.py
mikeshardmind/salamander
2
12763299
# Copyright 2020-present <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 agreed ...
2.015625
2
bastion_ssh/plugins/ssh/ssh_transport.py
wcc526/bastion-ssh
13
12763300
<filename>bastion_ssh/plugins/ssh/ssh_transport.py<gh_stars>10-100 import paramiko import socket import time import logging from paramiko.ssh_exception import SSHException import bastion_ssh.errors LOG = logging.getLogger(__name__) class SSHTransport(object): """ This object wraps a shell in yet another shell. W...
2.546875
3
python/scripts/create_synology_package.py
olefriis/simplepvr
5
12763301
#!/usr/bin/python # -*- coding: utf-8 -*- from shutil import copytree, make_archive import os import sys import shutil def main(argv=None): syno_package_dir = "syno_package" build_dir = os.path.abspath(os.path.join(os.path.curdir, syno_package_dir)) os.mkdir(build_dir) create_info(build_dir) cop...
2.296875
2
fungit/commands/module/file.py
zlj-zz/pyzgit
0
12763302
class File: def __init__( self, name: str, display_str: str, short_status: str, has_staged_change: bool, has_unstaged_change: bool, tracked: bool, deleted: bool, added: bool, has_merged_conflicts: bool, has_inline_merged_conflic...
2.375
2
mythril/laser/smt/solver/independence_solver.py
RainOfPhone/mythril
1
12763303
import z3 from mythril.laser.smt.model import Model from mythril.laser.smt.bool import Bool from mythril.laser.smt.solver.solver_statistics import stat_smt_query from typing import Set, Tuple, Dict, List, cast def _get_expr_variables(expression: z3.ExprRef) -> List[z3.ExprRef]: """ Gets the variables that m...
2.375
2
2020/08/08.py
jackcogdill/Advent-of-Code-2019
0
12763304
<reponame>jackcogdill/Advent-of-Code-2019 with open('input') as f: instructions = [] for line in f: op, arg = line.split() instructions.append((op, int(arg))) # Part 1 executed = [False] * len(instructions) accumulator = 0 i = 0 while i < len(instructions): if executed[i]: break execute...
3.65625
4
tunnel/config.py
zrthxn/tunnel-worker
0
12763305
<gh_stars>0 from typing import List from yaml import load, loader from os import environ from satellite import Satellite def build_satellites() -> List[Satellite]: config_path = environ.get("CONFIG_FILE") if config_path != None: with open(config_path) as f: config = load(f, Loader=loader.SafeLoader) satelli...
2.546875
3
alipay/aop/api/response/ZolozIdentificationUserWebQueryResponse.py
snowxmas/alipay-sdk-python-all
213
12763306
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class ZolozIdentificationUserWebQueryResponse(AlipayResponse): def __init__(self): super(ZolozIdentificationUserWebQueryResponse, self).__init__() self._extern_info = None ...
2.03125
2
tests/test_route.py
kr41/TraversalKit
4
12763307
<gh_stars>1-10 import re from traversalkit.route import Node, Route def test_node(): node = Node(object, name='foo') assert str(node) == 'foo' assert repr(node) == '<Node: foo>' assert node.type == 'single' node = Node(object, metaname='foo') assert str(node) == '{foo}' assert repr(node)...
2.953125
3
third-party/gtd/gtd/ml/tests/test_vocab.py
timpowellgit/phrasenode
81
12763308
import numpy as np import pytest from gtd.ml.vocab import SimpleVocab, SimpleEmbeddings @pytest.fixture def vocab(): return SimpleVocab(['a', 'b', 'c']) @pytest.fixture def embeds(vocab): array = np.eye(len(vocab)) return SimpleEmbeddings(array, vocab) class TestSimpleVocab(object): def test_save...
2.390625
2
Test/assi_test.py
shemaaali/lambdata-shimadaoud-ds18
0
12763309
# Import a library related to my test called unittest import unittest from pandas import DataFrame from lambdata.assi import add_state_names_column class TestAssi(unittest.TestCase): def test_assi(self): df = DataFrame({"abbrev": ["CA", "CO", "CT", "DC", "TX"]}) self.assertEqual(len(df.col...
3.125
3
project_handwritten-character-recognition-with-convolutional-neural-network-master/Codes/image_creation_in_directories.py
akash519-gif/Handwritten-letter-detection.
0
12763310
""" Here I am going to convert array to image from it's pixel value and put those images in their respective directory for both in train and test set. train set -------> [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] test set -------> [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] """ # Import requi...
3.109375
3
tests/__init__.py
szabosteve/eland
335
12763311
<filename>tests/__init__.py # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "Li...
1.882813
2
ucsmsdk/methodmeta/ApeGetIpFromSerialMeta.py
Kego/ucsmsdk
78
12763312
"""This module contains the meta information of ApeGetIpFromSerial ExternalMethod.""" from ..ucscoremeta import MethodMeta, MethodPropertyMeta method_meta = MethodMeta("ApeGetIpFromSerial", "apeGetIpFromSerial", "Version142b") prop_meta = { "cookie": MethodPropertyMeta("Cookie", "cookie", "Xs:string", "Version14...
2.078125
2
terrascript/dnsimple/r.py
hugovk/python-terrascript
0
12763313
# terrascript/dnsimple/r.py import terrascript class dnsimple_record(terrascript.Resource): pass
1.304688
1
src/tpot_caller.py
NMNS93/snakepot
0
12763314
<gh_stars>0 #!/usr/bin/env python3 """tpot.py Run tpot on an input training dataset.""" import sys import os import importlib.util import joblib import tempfile from src.log import Logger log = Logger('tpot') import argparse import pandas as pd import numpy as np from tpot import TPOTClassifier class TPOTCleaner():...
2.546875
3
Scripts/naive_bayes.py
MathewTWilliams/News-Category-Classifiers
0
12763315
<reponame>MathewTWilliams/News-Category-Classifiers #Author: <NAME> #Version: 06/24/2022 from sklearn.naive_bayes import ComplementNB from utils import ClassificationModels, WordVectorModels, CV_BEST_DICT_KEY from run_classification import run_classifier from save_load_json import load_cv_result # Parameter grid for ...
3.140625
3
app/apps/api/fields.py
lawi21/escriptorium
4
12763316
<reponame>lawi21/escriptorium from rest_framework import serializers class DisplayChoiceField(serializers.ChoiceField): def to_representation(self, obj): if obj == '' and self.allow_blank: return obj return self._choices[obj] def to_internal_value(self, data): # To support...
2.546875
3
config.py
kendallnguyen/Rik-with-Personalization
0
12763317
# encoding: utf-8 SECRET_KEY = 'a unique and long key' TITLE = 'Riki' HISTORY_SHOW_MAX = 30 PIC_BASE = '/static/content/' CONTENT_DIR = '///D:\\School\\Riki\\content' USER_DIR = '///D:\\School\\Riki\\user' NUMBER_OF_HISTORY = 5 PRIVATE = False
1.125
1
src/sentry/auth/utils.py
tobetterman/sentry
1
12763318
<filename>src/sentry/auth/utils.py from __future__ import absolute_import def is_active_superuser(user): # TODO(dcramer): add VPN support via INTERNAL_IPS + ipaddr ranges return user.is_superuser
1.59375
2
mfi_customization/mfi/doctype/asset_movement.py
anuradha-88/mfi_customization
0
12763319
# -*- coding: utf-8 -*- # Copyright (c) 2020, bizmap technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe # lst = [] # for i in frappe.get_all('Task',filters,['asset']): # lst.append(i.asset) # return [(d,) for d in lst] ...
2.109375
2
tests/core/test_record_components.py
ai-fast-track/mantisshrimp
580
12763320
import pytest from icevision.all import * @pytest.fixture def dummy_class_map(): return ClassMap(["dummy-1", "dummy-2"], background=None) @pytest.fixture def dummy_class_map_elaborate(): return ClassMap(["dummy-1", "dummy-2", "dummy-3", "dummy-4"], background=None) def test_classification_multilabel(dummy...
2.625
3
grr/server/grr_response_server/__init__.py
tsehori/grr
1
12763321
<reponame>tsehori/grr #!/usr/bin/env python # Lint as: python3 """Server-specific GRR classes."""
1.09375
1
src/awkward1/_connect/_pandas.py
martindurant/awkward-1.0
0
12763322
<filename>src/awkward1/_connect/_pandas.py<gh_stars>0 # BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import distutils.version import numpy import awkward1.layout import awkward1._util import awkward1.operations.convert import awkward1....
2.234375
2
poly/primaryremotedevice.py
firstone/RESTRemote
6
12763323
from poly.remotedevice import RemoteDevice class PrimaryRemoteDevice(RemoteDevice): drivers = [ {'driver': 'ST', 'value': 0, 'uom': 2} ] def __init__(self, controller, address, driverName, deviceName, config, deviceDriver): super(PrimaryRemoteDevice, self).__init__(controller, self, address,...
2.6875
3
earth_enterprise/src/update_fusion_version.py
ezeeyahoo/earthenterprise
2,661
12763324
<reponame>ezeeyahoo/earthenterprise #!/usr/bin/env python2.7 # # Copyright 2017 Google 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...
2.25
2
simple_queue/circular_queue.py
dhrubach/python-code-recipes
0
12763325
############################################################### # LeetCode Problem Number : 622 # Difficulty Level : Medium # URL : https://leetcode.com/problems/design-circular-queue/ ############################################################### class CircularQueue: def __init__(self, size): """initializ...
4.0625
4
publishtimer/custom_exceptions.py
paragguruji/publishtimer
0
12763326
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Apr 27 19:05:53 2016 @author: <NAME>, <EMAIL> """ from werkzeug.exceptions import HTTPException class WriteScheduleFailedError(HTTPException): """Exception to be raised when schedule is computed successfully by the publishtimer but save_schedule API returns ...
2
2
Farmacia/apps/compras/forms.py
cluco91/Django_Farmacia
2
12763327
from .models import * # Change as necessary from django.forms import ModelForm from django import forms class TodoListForm(ModelForm): class Meta: model = Cabecera exclude =('trabajador',) widgets = { 'codigo': forms.TextInput(attrs={'class': 'form-control'}), 'distribuidor': forms.Select(attr...
2.203125
2
an.py
Vladislav2018/soundclassification_analyzer
0
12763328
import pandas as pd import datetime import json def parse_txt_report(path: str, path_tpl:str, separators: tuple = (':', ',')): report = {} with open(path) as file: tpl = pd.read_csv(path_tpl) for row in tpl['predicted_class']: report.update({row: []}) for line in file: ...
2.796875
3
lstchain/calib/camera/drs4.py
yukihok/cta-lstchain
0
12763329
import argparse import numpy as np from astropy.io import fits from numba import jit class DragonPedestal: n_pixels = 7 roisize = 40 size4drs = 4*1024 high_gain = 0 low_gain = 1 def __init__(self): self.first_capacitor = np.zeros((2, 8)) self.meanped = np.zeros((2, self.n_pixe...
2.09375
2
ros/niryo_one_ros/niryo_one_tcp_server/clients/python/examples/simple_scripts/video_stream.py
paubrunet97/astrocytes
5
12763330
<filename>ros/niryo_one_ros/niryo_one_tcp_server/clients/python/examples/simple_scripts/video_stream.py """ This script allows to capture Niryo One's video streaming and to make some image processing on it """ # Imports from niryo_one_tcp_client import * from niryo_one_camera import * # Set robot address robot_ip_add...
2.625
3
office365/sharepoint/sharing/sharingLinkInfo.py
rikeshtailor/Office365-REST-Python-Client
544
12763331
<gh_stars>100-1000 from office365.runtime.client_value import ClientValue class SharingLinkInfo(ClientValue): def __init__(self): """ Specifies the information about the tokenized sharing link. """ super(SharingLinkInfo, self).__init__() self.AllowsAnonymousAccess = None ...
2.109375
2
setup.py
avanc/mopidy-headless
6
12763332
from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Mopidy-Headless', version=get_versio...
1.664063
2
ansible/roles/blade.cumulus/library/ssh_user_alias.py
ClashTheBunny/cmdb
111
12763333
<filename>ansible/roles/blade.cumulus/library/ssh_user_alias.py #!/usr/bin/python DOCUMENTATION = """ --- module: ssh_user_alias.py short_description: Create alias for users in SSH authorized_keys options: user: description: - base user to make alias for groups: description: - list of groups we...
2.375
2
setup.py
cloudify-incubator/cloudify-ecosystem-test
1
12763334
<filename>setup.py from setuptools import setup, find_packages setup( name='cloudify-ecosystem-test', version='2.5.35', license='LICENSE', packages=find_packages(), description='Stuff that Ecosystem Tests Use', entry_points={ "console_scripts": [ "ecosystem-test = ecosystem_...
1.421875
1
pioneer/das/tests/validate_imu_flow.py
leddartech/pioneer.das.api
8
12763335
#TODO: move this to pioneer.das.acquisition from pioneer.das.api import platform try: import folium #pip3 install folium except: pass import math import matplotlib.pyplot as plt import numpy as np import os import tqdm import utm def easting_northing_from_lat_long(latitude, longitude): easting, northing, ...
2.53125
3
mmdet/datasets/logos_dataset.py
guigarfr/Robust_Logo_Detection
0
12763336
import os.path as osp import numpy as np import mmcv from . import XMLDataset from .builder import DATASETS import xml.etree.ElementTree as ET from PIL import Image @DATASETS.register_module() class LogosDataset(XMLDataset): def load_annotations(self, ann_file): """Load annotation from XML style ann_...
2.53125
3
Python/CeV/Exercicios/ex67.py
WerickL/Learning
0
12763337
<filename>Python/CeV/Exercicios/ex67.py while True: T = int(input('Digite um número para mostrar a tabuada:')) if T > 0: print(f"""{T} X 1 = {T*1} {T} X 2 = {T*2} {T} X 3 = {T*3} {T} X 4 = {T*4} {T} X 5 = {T*5} {T} X 6 = {T*6} {T} X 7 = {T*7} {T} X 8 = {T*8} {T} X 9 = {T*9} {T} X 10 = {T*10}""") eli...
4.125
4
brain/tests/model/test_Position.py
siddharthkundu/raspberry-pi-os-image-builder
0
12763338
import json import random import unittest from model.position import Position class PositionTest(unittest.TestCase): def test_given_a_position_then_it_is_serializable(self): x = random.randint(1, 100) y = random.randint(1, 100) z = random.randint(1, 100) expected_json = { ...
3.25
3
simplegexf.py
demux/simplegexf
6
12763339
import os from collections import OrderedDict, MutableMapping, MutableSequence from operator import itemgetter, attrgetter from copy import deepcopy import xmltodict TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?> <gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" ...
2.578125
3
machin/frame/helpers/servers.py
lethaiq/machin
0
12763340
from typing import Callable, Any, List from machin.parallel.distributed import ( get_world, get_cur_name ) from machin.parallel.server import ( PushPullGradServerImpl, PushPullModelServerImpl ) from torch.optim import Adam def grad_server_helper(model_creators: List[Callable], optim...
2.390625
2
my/google/paths.py
ktaranov/HPI
1
12763341
""" Module for locating and accessing [[https://takeout.google.com][Google Takeout]] data """ from dataclasses import dataclass from typing import Optional from my.config import google as user_config from ..core.common import Paths @dataclass class google(user_config): # directory to unzipped takeout data ...
2.78125
3
pcg_libraries/src/pcg_gazebo/parsers/sdf/script.py
boschresearch/pcg_gazebo_pkgs
42
12763342
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # 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 # #...
2.15625
2
boundaries/ocd-division/country:ca/csd:3520005/2010/definition.py
imhangoo/represent-canada-data
0
12763343
import re from datetime import date import boundaries boundaries.register('Toronto wards (2010)', singular='Toronto ward', domain='Toronto, ON', last_updated=date(2018, 1, 16), name_func=boundaries.attr('NAME'), id_func=lambda f: re.sub(r'\A0', '', f.get('SCODE_NAME')), authority='City of Toro...
1.921875
2
guides/migrations/0016_participant_attending.py
kesara/ietf-guides
0
12763344
# -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-11-08 04:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('guides', '0015_auto_20200220_1619'), ] operations = [ migrations.AddField(...
1.757813
2
obb/views/platforms.py
marcmelchor/OBB-Train-Station
0
12763345
from obb.models.platform import Platform, Train from django.shortcuts import get_object_or_404 from obb.serializers.serializers import PlatformSerializer from rest_framework import viewsets from rest_framework.response import Response class PlatformViewSet(viewsets.ViewSet): def list(self, request): quer...
2.234375
2
data/external/repositories_2to3/141822/AXA_Telematics-master/Trip_Matching/RDP_Trip_Matching/find_matches.py
Keesiu/meta-kaggle
0
12763346
import csv import os import sys import time import numpy as np import matplotlib.pyplot as plt #from sklearn.neighbors import NearestNeighbors from path import Path from vector_math import * from find_matches import * import search_matches #******************** #**** this compares two sets of an...
3.09375
3
code/fastai_ext/fastai_ext/utils.py
jandremarais/TabularLearner
14
12763347
from matplotlib import pyplot as plt from fastai.callback import Callback from fastai.callbacks import hook_output def request_lr(learn, **kwargs): learn.lr_find(**kwargs) learn.recorder.plot()#suggestion=False plt.show() return float(input('Select LR: ')) def auto_lr(learn, **kwargs): learn.lr_fi...
2.375
2
scrape/apollo13/apollo13.py
jumpjack/ApolloTranscriptScraper
1
12763348
<reponame>jumpjack/ApolloTranscriptScraper #!/usr/bin/env python3 import os, glob, re import requests from bs4 import BeautifulSoup import json """ Apollo 13 Lunar Flight Journals: https://www.hq.nasa.gov/alsj/main.html Apollo 13 Lunar Surface Journals: https://www.hq.nasa.gov/alsj/a13/a13.html """ SCRAPE_DIR = '...
2.90625
3
ttsplay/__init__.py
yuj09161/word
0
12763349
__all__=['ttsmake']
1.09375
1
location_register/migrations/0022_auto_20210415_0936.py
OlexandrTopuzov/Data_converter
0
12763350
<gh_stars>0 # Generated by Django 3.0.7 on 2021-04-15 09:36 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('location_register', '0021_auto_20210330_1650'), ] operations = [ migrations.AlterModelOptions( name='country', o...
1.445313
1