max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
cartoframes/viz/popups/default_popup_element.py
CartoDB/cartoframes
236
11164355
<gh_stars>100-1000 def default_popup_element(title=None, operation=None, format=None): """Helper function for quickly adding a default popup element based on the style. A style helper is required. Args: title (str, optional): Title for the given value. By default, it's the name of the value. ...
Coupled-Electron-Pair-Approximation/integrals.py
andyj10224/psi4numpy
214
11164389
<reponame>andyj10224/psi4numpy<filename>Coupled-Electron-Pair-Approximation/integrals.py """ Returns the Fock matrix and needed two-electron integral blocks. __authors__ = "<NAME>" __credits__ = ["<NAME>"] __copyright__ = "(c) 2014-2020, The Psi4NumPy Developers" __license__ = "BSD-3-Clause" """ import numpy...
tests/integration/test_s3_low_cardinality_right_border/test.py
mrk-andreev/ClickHouse
8,629
11164460
<gh_stars>1000+ #!/usr/bin/env python3 # 1) Here we try to reproduce very rare error which is connected with # LowCardinality. When we read data from S3 we are trying to make sequential # reads without additional seeks. To achieve this we are trying to have as # large mark ranges as possible for each thread which ...
mmhuman3d/utils/demo_utils.py
ykk648/mmhuman3d
472
11164476
import colorsys import os from pathlib import Path import mmcv import numpy as np from scipy import interpolate from mmhuman3d.core.post_processing import build_post_processing try: from typing import Literal except ImportError: from typing_extensions import Literal def xyxy2xywh(bbox_xyxy): """Transfo...
AutotestWebD/apps/config/views/http_conf.py
yangjourney/sosotest
422
11164484
<filename>AutotestWebD/apps/config/views/http_conf.py from apps.config.services.http_confService import * from apps.common.config import commonWebConfig from apps.common.func.CommonFunc import * import math from django.shortcuts import HttpResponse def getDebugBtn(request): context = {} httpConf = HttpConfServ...
tools/bin/pythonSrc/lockfile-0.9.1/setup.py
YangHao666666/hawq
450
11164500
#!/usr/bin/env python V = "0.9.1" from distutils.core import setup setup(name='lockfile', author='<NAME>', author_email='<EMAIL>', url='http://code.google.com/p/pylockfile/', download_url=('http://code.google.com/p/pylockfile/downloads/' 'detail?name=lockfile-%s.tar.gz' % V...
wrappers/python/examples/box_dimensioner_multicam/calibration_kabsch.py
Moktarino/librealsense
6,457
11164538
<gh_stars>1000+ ################################################################################################## ## License: Apache 2.0. See LICENSE file in root directory. #### ################################################################################################## ## ...
test/setup_test_env.py
conan7882/CNN-Visualization
201
11164554
<reponame>conan7882/CNN-Visualization #!/usr/bin/env python # -*- coding: utf-8 -*- # File: setup_test_env.py # Author: <NAME> <<EMAIL>> import sys sys.path.append('lib/') IMPATH = 'data/' CLASS_IMPATH = 'data/class_test/' SAVE_DIR = 'data/'
Hash/to sha256.py
DazEB2/SimplePyScripts
117
11164590
<reponame>DazEB2/SimplePyScripts<filename>Hash/to sha256.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def to_sha256(text): import hashlib return hashlib.sha256(text.encode()).hexdigest() if __name__ == '__main__': print(to_sha256('Hello World!'))
tools/ttrace_parser/scripts/ttrace.py
ziyik/TizenRT-1
511
11164594
#!/usr/bin/env python ########################################################################### # # Copyright 2017 Samsung Electronics 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 ...
tests/opytimizer/optimizers/population/test_osa.py
anukaal/opytimizer
528
11164615
from opytimizer.optimizers.population import osa from opytimizer.spaces import search def test_osa_params(): params = { 'beta': 1.9 } new_osa = osa.OSA(params=params) assert new_osa.beta == 1.9 def test_osa_params_setter(): new_osa = osa.OSA() try: new_osa.beta = 'a' e...
tqsdk/lib/utils.py
contropist/tqsdk-python
3,208
11164647
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'mayanqiong' import numpy as np from pandas import DataFrame from tqsdk.datetime import _get_trading_timestamp, _get_trade_timestamp from tqsdk.rangeset import _rangeset_head, _rangeset_slice, _rangeset_length """ 检查参数类型 """ from inspect import isfunction ...
RecoMET/METProducers/python/GlobalHaloData_cfi.py
ckamtsikis/cmssw
852
11164681
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms # File: GlobalHaloData_cfi.py # Original Author: <NAME>, The University of Florida # Description: Module to build GlobalHaloData Object and put into the event # Date: Oct. 15, 2009 GlobalHaloData = cms.EDProducer("GlobalHaloDataProducer", ...
scripts/sentiment/process_usage_german.py
de9uch1/stanza
3,633
11164687
<filename>scripts/sentiment/process_usage_german.py """ USAGE is produced by the same people as SCARE. USAGE has a German and English part. This script parses the German part. Run the script as process_usage_german.py path Here, path should be where USAGE was unpacked. It will have the documents, files, etc su...
observations/r/strike.py
hajime9652/observations
199
11164691
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def strike(path): """Strike Duration Data a cross-section from 1968 to...
tests/commands/test__vi_big_g.py
my-personal-forks/Vintageous
1,146
11164727
from Vintageous.vi.utils import modes from Vintageous.tests import set_text from Vintageous.tests import add_sel from Vintageous.tests import get_sel from Vintageous.tests import first_sel from Vintageous.tests import ViewTest class Test_vi_big_g_InNormalMode(ViewTest): def testCanMoveInNormalMode(self): ...
pywebcopy/structures.py
wasim961/pywebcopy
257
11164731
# -*- coding: utf-8 -*- """ pywebcopy.structures ~~~~~~~~~~~~~~~~~~~~ Structures powering pywebcopy. """ from collections import MutableMapping import requests from requests.structures import OrderedDict from six.moves.urllib.robotparser import RobotFileParser __all__ = ['CaseInsensitiveDict', 'RobotsTxtParser']...
test/test_country_selector.py
Quentame/bimmer_connected
141
11164740
"""Test the country selection class.""" import unittest from bimmer_connected.country_selector import valid_regions, Regions, get_region_from_name class TestCountrySelector(unittest.TestCase): """Test the country selection class.""" def test_valid_regions(self): """Test getting list of regions.""" ...
examples/plot_hidden_short_snakes_typed_gen.py
LemonLison/pystruct
501
11164763
""" ============================================== Conditional Interactions on the Snakes Dataset ============================================== This is a variant of plot_snakes.py Snake are hidding, so we have 2 tasks: - determining if a snake is in the picture, - identifying its head to tail body. We use the N...
basenji/emerald.py
egilbertson-ucsf/basenji
232
11164773
<gh_stars>100-1000 # Copyright 2017 Calico 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed...
milk/tests/data/jugparallel_kmeans_jugfile.py
luispedro/milk
284
11164801
<gh_stars>100-1000 import milk.ext.jugparallel from milksets.wine import load from milk.tests.fast_classifier import fast_classifier features,labels = load() clustered = milk.ext.jugparallel.kmeans_select_best(features, ks=(2,8), repeats=2, max_iters=6)
example/example.py
GothAck/openpyscad
105
11164842
<reponame>GothAck/openpyscad import sys import os sys.path.append("") sys.path.insert( 0, "/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1]) ) from openpyscad import * Circle(10).offset(10).write("example.scad", with_print=True)
String/1374. Generate a String With Characters That Have Odd Counts.py
beckswu/Leetcode
138
11164846
<reponame>beckswu/Leetcode<filename>String/1374. Generate a String With Characters That Have Odd Counts.py class Solution: def generateTheString(self, n: int) -> str: if not n: return '' if n == 1: return 'a' if n % 2 == 0: return 'a'*(n-1) + 'b' r...
system/product.py
zhangyiiZ/saltshaker_backend
115
11164849
<reponame>zhangyiiZ/saltshaker_backend<filename>system/product.py<gh_stars>100-1000 # -*- coding:utf-8 -*- from flask_restful import Resource, reqparse from flask import g from common.log import loggers from common.audit_log import audit_log from common.db import DB from common.utility import uuid_prefix from common.ss...
scc.py
Ziyadsk/scc
122
11164861
<reponame>Ziyadsk/scc<filename>scc.py #!/usr/bin/env python3 import argparse import json import os import random import webbrowser import textwrap import sys # argument system home = os.path.expanduser("~") parser = argparse.ArgumentParser(description="SCC - Commandline Cheat Sheet") parser.add_argument("--export", c...
mici/__init__.py
matt-graham/mici
137
11164863
# -*- coding: utf-8 -*- """ MCMC samplers based on simulating Hamiltonian dynamics on a manifold. """ __authors__ = "<NAME>" __license__ = "MIT" import mici.adapters import mici.autodiff import mici.integrators import mici.matrices import mici.samplers import mici.solvers import mici.stagers import mici.states import...
examples/source_separation/conv_tasnet/__init__.py
popcornell/audio
1,718
11164872
<reponame>popcornell/audio from . import train, trainer __all__ = ["train", "trainer"]
scripts/migrations/es_migration_25042021.py
davidkartchner/rubrix
888
11164876
<reponame>davidkartchner/rubrix<filename>scripts/migrations/es_migration_25042021.py from itertools import zip_longest from typing import Any, Dict, List, Optional from elasticsearch import Elasticsearch from elasticsearch.helpers import scan, bulk from pydantic import BaseSettings from rubrix.server.tasks.commons imp...
src/adafruit_circuitplayground/__init__.py
julianrendell/vscode-python-devicesimulator
151
11164920
# added compatibility for new import structure in CircuitPython # https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/79 from .express import cpx as cp
paddlespeech/s2t/exps/__init__.py
JiehangXie/PaddleSpeech
1,540
11164933
# Copyright (c) 2021 PaddlePaddle 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.0 # # Unless required by appli...
yinyang/src/mutators/GenTypeAwareMutation/Util.py
rainoftime/yinyang
143
11165001
<filename>yinyang/src/mutators/GenTypeAwareMutation/Util.py # MIT License # # Copyright (c) [2020 - 2021] The yinyang authors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restric...
pyransac3d/__init__.py
jungerm2/pyRANSAC-3D
180
11165007
<reponame>jungerm2/pyRANSAC-3D from .aux_functions import * from .circle import Circle from .cuboid import Cuboid from .cylinder import Cylinder from .line import Line from .plane import Plane from .point import Point from .sphere import Sphere # from pyRANSAC_3D import Cylinder, Cuboid, Plane
deepscm/arch/medical.py
srtaheri/deepscm
183
11165015
<filename>deepscm/arch/medical.py from torch import nn import numpy as np class Encoder(nn.Module): def __init__(self, num_convolutions=1, filters=(16, 32, 64, 128), latent_dim: int = 128, input_size=(1, 192, 192)): super().__init__() self.num_convolutions = num_convolutions self.filters...
omd/versions/1.2.8p15.cre/lib/python/pysphere-0.1.7-py2.7.egg/pysphere/__init__.py
NCAR/spol-nagios
106
11165034
#-- # Copyright (c) 2012, <NAME> # 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 notice, # this list of conditions...
analysis/random_forest/sklearn.py
szilard/GBM-perf
201
11165046
<reponame>szilard/GBM-perf import pandas as pd import numpy as np from sklearn import preprocessing from scipy import sparse from sklearn import metrics, ensemble d_train = pd.read_csv("https://s3.amazonaws.com/benchm-ml--main/train-1m.csv") d_test = pd.read_csv("https://s3.amazonaws.com/benchm-ml--main/test.csv") ...
ui/spaces.py
fsanges/glTools
165
11165053
<gh_stars>100-1000 import maya.cmds as mc import glTools.tools.spaces class UserInputError(Exception): pass def charUI(): ''' ''' # Window win = 'spacesCharUI' if mc.window(win,q=True,ex=True): mc.deleteUI(win) win = mc.window(win,t='Spaces - Character UI') # Form Layout spacesCharFL = mc.formLayout(numberOfD...
bookwyrm/migrations/0146_auto_20220316_2352.py
mouse-reeve/fedireads
270
11165055
<reponame>mouse-reeve/fedireads # Generated by Django 3.2.12 on 2022-03-16 23:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0145_sitesettings_version"), ] operations = [ migrations.AddField( model_name="invi...
release/steam/create_steam_builds.py
noorbeast/blender
365
11165096
#!/usr/bin/env python3 import argparse import pathlib import requests import shutil import subprocess from typing import Callable, Iterator, List, Tuple # supported archive and platform endings, used to create actual archive names archive_endings = ["windows64.zip", "linux64.tar.xz", "macOS.dmg"] def add_optional_a...
response/migrations/0009_commschannel_channel_name.py
ojno/response
1,408
11165121
<reponame>ojno/response """ This is a slightly more complex migration. This change adds a new CommsChannel field to cache the channel name, updating it when the Slack API notifies us of a channel rename. For existing CommsChannel in the DB, we need to populate the channel_name by connecting to the Slack API. This appl...
pyGeno/tests/test_genome.py
cw00dw0rd/pyGeno
309
11165127
<reponame>cw00dw0rd/pyGeno import unittest from pyGeno.Genome import * import pyGeno.bootstrap as B from pyGeno.importation.Genomes import * from pyGeno.importation.SNPs import * class pyGenoSNPTests(unittest.TestCase): def setUp(self): # try : # B.importGenome("Human.GRCh37.75_Y-Only.tar.gz") # except KeyEr...
Python-3/basic_examples/python_wait.py
ghiloufibelgacem/jornaldev
1,139
11165142
<reponame>ghiloufibelgacem/jornaldev import time print('Hello There, next message will be printed after 5 seconds.') time.sleep(5) print('Sleep time is over.') sec = input('Let us wait for user input. Let me know how many seconds to sleep now.\n') print('Going to sleep for', sec, 'seconds.') time.sleep(int(sec)) ...
examples/stop_converged.py
farhansabir123/climin
140
11165151
<reponame>farhansabir123/climin<filename>examples/stop_converged.py import scipy from climin import GradientDescent from climin.stops import converged quadratic = lambda x: (x**2).sum() quadraticprime = lambda x: 2 * x if __name__ == '__main__': dim = 10 wrt = scipy.random.standard_normal((dim,)) * 10 + 5 ...
models/ddpm.py
4-geeks/score_sde_pytorch
355
11165176
<reponame>4-geeks/score_sde_pytorch # coding=utf-8 # Copyright 2020 The Google Research 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...
money/tests/test_docs.py
g--/money
212
11165206
<reponame>g--/money # -*- coding: utf-8 -*- """ Money doctests as unittest Suite """ # RADAR: Python2 from __future__ import absolute_import import doctest import unittest # RADAR: Python2 import money.six FILES = ( '../../README.rst', ) def load_tests(loader, tests, pattern): # RADAR Python 2.x if mone...
examples/hdf3.py
yang69can/pyngl
125
11165209
<gh_stars>100-1000 # # File: # hdf3.py # # Synopsis: # Unpacks and plots HDF5 data. # # Category: # Contours over maps # Labelbar # Maps # # Author: # <NAME> (based on NCL example from <NAME>) # # Date of initial publication: # April, 2015 # # Description: # This example reads precipitat...
Algo and DSA/LeetCode-Solutions-master/Python/find-the-kth-largest-integer-in-the-array.py
Sourav692/FAANG-Interview-Preparation
3,269
11165211
# Time: O(n) ~ O(n^2), O(n) on average # Space: O(1) import random class Solution(object): def kthLargestNumber(self, nums, k): """ :type nums: List[str] :type k: int :rtype: str """ def nth_element(nums, n, compare=lambda a, b: a < b): def tri_partiti...
configs/_base_/backends/ncnn-int8.py
grimoire/mmdeploy
746
11165233
<gh_stars>100-1000 backend_config = dict(type='ncnn', precision='INT8', use_vulkan=False)
docs/conf.py
electroniceel/Glasgow
1,014
11165245
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys, os import sphinx_rtd_theme # Configure our load path sys.path.insert(0, os.path.abspath('../software')) # Configure Sphinx extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinxarg.ext'] autodoc_member_order = 'bysource' source_suffix = '.rst' ma...
amqp-postgres/amqp_postgres/main.py
ilan-WS/cloudify-manager
124
11165250
import logging import argparse from cloudify._compat import queue from cloudify.amqp_client import get_client from manager_rest import config from manager_rest.flask_utils import setup_flask_app from .amqp_consumer import AMQPLogsEventsConsumer, AckingAMQPConnection from .postgres_publisher import DBLogEventPublisher...
cle/backends/externs/simdata/io_file.py
Atipriya/cle
317
11165265
import struct import logging from . import SimData, register from ...symbol import SymbolType from .common import PointTo l = logging.getLogger(name=__name__) # # Here, we define a specific structure (part of it at least) for the FILE structure. # These offsets are copied from glibc for maximum compatibility, but we...
pyleus/storm/serializers/msgpack_serializer.py
ecanzonieri/pyleus
166
11165269
<reponame>ecanzonieri/pyleus<filename>pyleus/storm/serializers/msgpack_serializer.py """Messagepack implementation of Pyleus serializer""" import os import msgpack from pyleus.storm import StormWentAwayError from pyleus.storm.serializers.serializer import Serializer def _messages_generator(input_stream): unpac...
pyNastran/dev/bdf_vectorized/cards/elements/spring/spring_element.py
ACea15/pyNastran
293
11165270
<gh_stars>100-1000 from pyNastran.dev.bdf_vectorized.cards.elements.element import Element class SpringElement(Element): def __init__(self, model): """ Defines the SpringElement object. Parameters ---------- model : BDF the BDF object """ Element....
socfaker/registry.py
priamai/soc-faker
122
11165280
<filename>socfaker/registry.py from .baseclass import BaseClass class Registry(BaseClass): __hives = [ 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS' ] __root = None __hive = None __key = None @property def hive(self): """A random registry hive ...
core_scripts/data_io/text_process/toolkit_all.py
Nijta/project-NN-Pytorch-scripts
150
11165296
#!/usr/bin/env python """ Simple text processer for all languages Based on https://github.com/fatchord/WaveRNN """ import os import sys import re __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2021, Xin Wang" ##### ## Parse the curly bracket ##### # from https://github.com/fatchord/WaveRNN...
dockerfiles/settings/proxito.py
mforbes/readthedocs.org
4,054
11165330
from readthedocs.settings.proxito.base import CommunityProxitoSettingsMixin from .docker_compose import DockerBaseSettings class ProxitoDevSettings(CommunityProxitoSettingsMixin, DockerBaseSettings): # El Proxito does not have django-debug-toolbar installed DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR_CAL...
riptable/rt_pdataset.py
wenjuno/riptable
307
11165452
__all__ = ['PDataset'] import os from typing import Union, List import warnings import numpy as np from .rt_fastarray import FastArray from .rt_enum import ( TypeRegister, DisplayJustification, ) from .rt_numpy import ( unique, empty, cumsum, searchsorted, max, ) from ...
lib/python/frugal/transport/memory_output_buffer.py
ariasheets-wk/frugal
144
11165453
<reponame>ariasheets-wk/frugal # Copyright 2017 Workiva # 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...
configs/cbnet/htc_cbv2_swin_large_patch4_window7_mstrain_400-1400_giou_4conv1f_adamw_1x_coco.py
minouei-kl/CBNetV2
271
11165493
_base_ = 'htc_cbv2_swin_base_patch4_window7_mstrain_400-1400_giou_4conv1f_adamw_20e_coco.py' model = dict( backbone=dict( embed_dim=192, depths=[2, 2, 18, 2], num_heads=[6, 12, 24, 48], window_size=7, ape=False, drop_path_rate=0.2, patch_norm=True, us...
neuralcompression/functional/_ndtr.py
tallamjr/NeuralCompression
233
11165522
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch from torch import Tensor def ndtr(x: Tensor) -> Tensor: """The normal cumulative distribution function (CDF)...
Algorithm.Python/Benchmarks/StatelessCoarseUniverseSelectionBenchmark.py
BlackBoxAM/Lean
6,580
11165536
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen...
minidump/utils/winapi/psapi.py
mrexodia/minidump
215
11165583
<reponame>mrexodia/minidump from minidump.utils.winapi.defines import * # typedef struct _MODULEINFO { # LPVOID lpBaseOfDll; # DWORD SizeOfImage; # LPVOID EntryPoint; # } MODULEINFO, *LPMODULEINFO; class MODULEINFO(Structure): _fields_ = [ ("lpBaseOfDll", LPVOID), # remote pointer (...
pycorrector/deepcontext/infer.py
ParikhKadam/pycorrector
3,153
11165611
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: Inference """ import operator import os import sys import time import torch from torch import optim sys.path.append('../..') from pycorrector.deepcontext.model import Context2vec from pycorrector.deepcontext.data_reader import read_config, load_word_di...
cogdl/layers/sgc_layer.py
cenyk1230/cogdl
1,072
11165639
import torch.nn as nn from cogdl.utils import spmm class SGCLayer(nn.Module): def __init__(self, in_features, out_features, order=3): super(SGCLayer, self).__init__() self.in_features = in_features self.out_features = out_features self.order = order self.W = nn.Linear(in_f...
src/test/pythonFiles/autocomp/suppress.py
ChaseKnowlden/vscode-jupyter
615
11165703
<filename>src/test/pythonFiles/autocomp/suppress.py "string" #comment """ content """ #comment 'un#closed
preprocess_matches.py
b01901143/DeepMatchVO
211
11165722
#!/usr/bin/python # <NAME>, HKUST, 2019. # Copyright reserved. # This file is an example to parse the feature and matching file, # in accord with our internal format. from __future__ import print_function import os import sys import glob import numpy as np import math from struct import unpack from PIL import Image,...
route/give_delete_admin_group.py
k0000k/openNAMU
126
11165732
from .tool.func import * def give_delete_admin_group_2(conn, name): curs = conn.cursor() if admin_check() != 1: return re_error('/error/3') if flask.request.method == 'POST': admin_check(None, 'alist del ' + name) curs.execute(db_change("delete from alist where name = ?"), [n...
infoxlm/fairseq/fairseq/iterative_refinement_generator.py
Maria-philna/unilm
5,129
11165755
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from collections import namedtuple import torch from fairseq import utils DecoderOut = namedtuple('IterativeRefinementDecoderOut', [ '...
oss_test/fileio/gen-classpath.py
venkattgg/venkey
493
11165756
''' Copyright (C) 2016 Turi This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope tha...
demo/text_spotting/text_perceptron_spot/configs/__base__.py
hikopensource/DAVAR-Lab-OCR
387
11165806
<gh_stars>100-1000 # """ # ######################################################################### # # Copyright (c) <NAME> @ Hikvision Research Institute. All rights reserved. # # Filename : __base__.py # # Abstract : Base model settings for text perceptron based text spotter. # # Current Version:...
eth/vm/forks/tangerine_whistle/state.py
ggs134/py-evm
1,641
11165810
<gh_stars>1000+ from eth.vm.forks.homestead.state import HomesteadState from .computation import TangerineWhistleComputation class TangerineWhistleState(HomesteadState): computation_class = TangerineWhistleComputation
tencentcloud/mps/v20190612/errorcodes.py
PlasticMem/tencentcloud-sdk-python
465
11165811
<reponame>PlasticMem/tencentcloud-sdk-python # -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 Lic...
lib/manalib.py
bcnoexceptions/mtgencode
159
11165842
<filename>lib/manalib.py<gh_stars>100-1000 # representation for mana costs and text with embedded mana costs # data aggregating classes import re import random import utils class Manacost: '''mana cost representation with data''' # hardcoded to be dependent on the symbol structure... ah well def get_...
components/policy/tools/make_policy_zip.py
google-ar/chromium
777
11165862
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Creates a zip archive with policy template files. The list of input files is extracted from a grd file with grit. This is to kee...
alipay/aop/api/domain/AlipayEbppBillkeyUpgradeModel.py
antopen/alipay-sdk-python-all
213
11165867
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayEbppBillkeyUpgradeModel(object): def __init__(self): self._bill_key = None self._biz_type = None self._charge_inst = None self._new_bill_key = None s...
tests/test_home.py
matrixorz/firefly
247
11165871
<reponame>matrixorz/firefly<gh_stars>100-1000 from __future__ import absolute_import # coding: utf-8 -*- from flask import url_for import pytest from firefly.models.topic import Category, Post @pytest.mark.usefixtures('client_class') class TestHome: def setup(self): c = Category.objects.create( ...
ppdet/utils/stats.py
leakyH/PaddleDetection
7,782
11165888
# Copyright (c) 2019 PaddlePaddle 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.0 # # Unless required by appli...
common/data_collector.py
iamlukewang/openpilot
121
11165898
<reponame>iamlukewang/openpilot from common.travis_checker import travis from selfdrive.swaglog import cloudlog from common.realtime import sec_since_boot from common.op_params import opParams import threading import os op_params = opParams() class DataCollector: def __init__(self, file_path, keys, write_frequency...
nogotofail/mitm/util/ip.py
kbfl0912/nogotofail
1,594
11165939
<reponame>kbfl0912/nogotofail r''' Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
learntools/computer_vision/ex4.py
roannav/learntools
359
11165942
from learntools.core import * import tensorflow as tf class Q1(ThoughtExperiment): _hint = r"Stacking the second layer expanded the receptive field by one neuron on each side, giving $3+1+1=5$ for each dimension. If you expanded by one neuron again, what would you get?" _solution = r"The third layer would hav...
django_dynamic_fixture/tests/test_ddf_copier.py
Kaniabi/django-dynamic-fixture
190
11165953
# -*- coding: utf-8 -*- from django.test import TestCase import pytest from django_dynamic_fixture.models_test import * from django_dynamic_fixture.ddf import * from django_dynamic_fixture.fixture_algorithms.sequential_fixture import SequentialDataFixture data_fixture = SequentialDataFixture() class DDFTestCase(Te...
src/anyconfig/processors/datatypes.py
Terrance-forks/python-anyconfig
213
11165957
# # Copyright (C) 2018 - 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: MIT # r"""Common functions and variables. """ import typing from ..models import processor ProcT = typing.TypeVar('ProcT', bound=processor.Processor) ProcsT = typing.List[ProcT] ProcClsT = typing.Type[ProcT] ProcClssT = typing.List[ProcClsT] ...
benchmarks/bench_string_similarity.py
joshlk/vtext
127
11165965
<gh_stars>100-1000 from time import time from glob import glob from pathlib import Path import nltk import nltk.metrics.distance import vtext base_dir = Path(__file__).parent.parent.resolve() try: import Levenshtein except ImportError: Levenshtein = None if __name__ == "__main__": input_files = list(gl...
examples/cairns_excel/setup/make_spatially_averaged_function.py
samcom12/anuga_core
136
11165967
<gh_stars>100-1000 """ Make function to compute average of another function inside mesh triangles <NAME>, Geoscience Australia 2014+ """ import scipy import anuga.utilities.spatialInputUtil as su from anuga.geometry.polygon import inside_polygon #######################################################################...
fsf-server/modules/template.py
akniffe1/fsf
259
11165969
#!/usr/bin/env python # # Author: # Description: # Date: ''' Copyright 2015 <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 ...
node_sampler/loss.py
maorp/NeuralGraph
117
11165981
import sys,os import torch import torch.nn as nn import numpy as np import math import config as cfg from utils.pcd_utils import * from nnutils.node_proc import convert_embedding_to_explicit_params, compute_inverse_occupancy, \ sample_rbf_surface, sample_rbf_weights, bounding_box_error, extract_view_omegas_from_...
tests/unit2/test_isometric.py
yegarti/arcade
824
11166011
<reponame>yegarti/arcade<filename>tests/unit2/test_isometric.py import arcade def test_isometric_grid_to_screen(window): tile_x = 0 tile_y = 0 width = 10 height = 10 tile_width = 64 tile_height = 64 x, y = arcade.isometric_grid_to_screen(tile_x, tile_y, ...
examples/map.py
artemigkh/cassiopeia
437
11166020
<gh_stars>100-1000 import cassiopeia as cass from cassiopeia import Map, Maps def get_maps(): maps = cass.get_maps(region="NA") for map in maps: print(map.name, map.id) map = Map(name="<NAME>", region="NA") print(map.id) if __name__ == "__main__": get_maps()
exercises/zh/exc_02_02_01.py
Jette16/spacy-course
2,085
11166022
<filename>exercises/zh/exc_02_02_01.py import spacy nlp = spacy.load("zh_core_web_sm") doc = nlp("我养了一只猫。") # 查找词汇"猫"的哈希值 cat_hash = ____.____.____[____] print(cat_hash) # 查找cat_hash来得到字符串 cat_string = ____.____.____[____] print(cat_string)
test/data/test_utils.py
parmeet/text
3,172
11166026
import io from torchtext.data import get_tokenizer from torchtext.utils import unicode_csv_reader from ..common.torchtext_test_case import TorchtextTestCase from ..common.assets import get_asset_path class TestUtils(TorchtextTestCase): TEST_STR = "A string, particularly one with slightly complex punctuation." ...
timeago/locales/guj_IN.py
s3q/andrunlook-apy
220
11166028
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2020-10-04 @author : Aashrut @Country : India @Language : Gujarati ''' LOCALE = [ ['હમણાં', 'થોડી વાર'], ['%s સેકંડ પહેલા', '%s સેકંડમાં'], ['1 મિનિટ પહેલા', '1 મિનિટમાં'], ['%s મિનિટ પહેલા', '%s મિનિટમાં'] , ['1 કલાક પહેલા', '1 કલાકમા...
esphome/components/ble_client/output/__init__.py
OttoWinter/esphomeyaml
249
11166074
<gh_stars>100-1000 import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import ble_client, esp32_ble_tracker, output from esphome.const import CONF_ID, CONF_SERVICE_UUID from .. import ble_client_ns DEPENDENCIES = ["ble_client"] CONF_CHARACTERISTIC_UUID = "characteristic_uuid" ...
vel/launcher.py
galatolofederico/vel
273
11166090
<reponame>galatolofederico/vel<filename>vel/launcher.py<gh_stars>100-1000 #!/usr/bin/env python import argparse import multiprocessing import sys from vel.internals.model_config import ModelConfig from vel.internals.parser import Parser def main(): """ Paperboy entry point - parse the arguments and run a command...
python/array/reorderarraybyindex.py
VinodKW/interview
11,393
11166103
# http://www.geeksforgeeks.org/reorder-a-array-according-to-given-indexes/ def reorder(input, index): if len(input) != len(index): raise ValueError for i in range(len(index)): while index[i] != i: s_index = index[index[i]] s_val = input[index[i]] index[index...
tests/admin_scripts/broken_app/models.py
jpmallarino/django
61,676
11166121
<filename>tests/admin_scripts/broken_app/models.py from django.db import modelz # NOQA
alipay/aop/api/domain/ItemSkuPropertyInfo.py
antopen/alipay-sdk-python-all
213
11166149
<filename>alipay/aop/api/domain/ItemSkuPropertyInfo.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ItemSkuPropertyInfo(object): def __init__(self): self._property_key = None self._property_value = None @property de...
char_cnn.py
PlayDeep/CharCNN
253
11166151
import tensorflow as tf from textify.models import _Classifier from textify.layers.embeddings import Embedding class CharCNN(_Classifier): def _get_embeddings(self, features, mode=tf.estimator.ModeKeys.TRAIN): embedding = Embedding(self._params['embedding_specs']) embedding...
html/semantics/links/downloading-resources/resources/inspect-header.py
meyerweb/wpt
14,668
11166155
<filename>html/semantics/links/downloading-resources/resources/inspect-header.py def main(request, response): headers = [(b"Content-Type", b"text/plain")] command = request.GET.first(b"cmd").lower() test_id = request.GET.first(b"id") header = request.GET.first(b"header") if command == b"put": ...
src/ostorlab/agent/message/proto/v2/report/event/start_process_agent_pb2.py
bbhunter/ostorlab
113
11166160
<reponame>bbhunter/ostorlab # Generated by the protocol buffer compiler. DO NOT EDIT! # source: start_process_agent.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message f...
pyxlib/xcomposite.py
helgeerbe/pi3d
177
11166177
<reponame>helgeerbe/pi3d import ctypes from xlib import Window, Display libXcomposite = ctypes.CDLL('libXcomposite.so.1') # void XCompositeRedirectSubwindows(Display *dpy, Window window, int update); XCompositeRedirectSubwindows = libXcomposite.XCompositeRedirectSubwindows XCompositeRedirectSubwindows.argtypes = [...
OnlineStudy/OnlineStudy/urls.py
NanRenTeam-9/MongoMicroCourse
132
11166184
<reponame>NanRenTeam-9/MongoMicroCourse """OnlineStudy URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: p...