max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
2017/bfjit/peachpyjit.py
mikiec84/code-for-blog
1,199
3265705
# BF JIT using the PeachPy x86-64 codegen library. # # Tested with Python 3.5+; PeachPy installed into a virtualenv following the # installation steps in its README: https://github.com/Maratyszcza # # <NAME> [http://eli.thegreenplace.net] # This code is in the public domain. import argparse from collections import name...
1
0
0
0
1
0
snippets/create.py
hit9/skylark
114
3265726
<filename>snippets/create.py<gh_stars>100-1000 from models import User user = User.create(name='jack', email='<EMAIL>') # model instance user = User(name='Kate', email='<EMAIL>') user.save() # last insert id
0
0
0
0
0
0
crossword/format_ipuz.py
jmviz/xd
179
3265771
# -*- coding: utf-8 -*- from crossword.core import Crossword, CrosswordCell from crossword.exceptions import CrosswordException def from_ipuz(ipuz_dict) -> object: for kind in ipuz_dict['kind']: if not kind.startswith("http://ipuz.org/crossword"): raise CrosswordException known_keys = ( ...
0
2
0
0
2
0
Python/572. SubtreeOfAnotherTree.py
nizD/LeetCode-Solutions
263
3265832
from __future__ import annotations ''' LeetCode Link: https://leetcode.com/problems/subtree-of-another-tree/ Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node's descen...
2
2
0
0
4
0
Codes/gracekoo/406_queue-reconstruction-by-height.py
liuxiaohui1221/algorithm
256
3265853
# -*- coding: utf-8 -*- # @Time: 2020/5/14 19:37 # @Author: GraceKoo # @File: 406_queue-reconstruction-by-height.py # @Desc: https://leetcode-cn.com/problems/queue-reconstruction-by-height/ from typing import List class Solution: def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]: # 按照...
1
1
0
0
2
0
web/pages/build.py
mhils/HoneyProxy
116
3265863
<gh_stars>100-1000 import os, re, time def update(): isPage = re.compile("^[^_].+\.html$") time.sleep(0.3) with open("_template.html", 'r') as tmpl: template = tmpl.read() for filename in os.listdir("."): if(isPage.match(filename)): with open(filename, 'r') as page:...
0
0
0
0
0
0
etc/Windows/package_map.py
pafri/DJV
456
3265908
#! python import glob import os import sys f = open(sys.argv[1], 'w') f.write('[Files]\n') # Appx manifest f.write('"DJV\\etc\\Windows\\AppxManifest.xml" "AppxManifest.xml"\n') # Executable f.write('"DJV-package\\build\\bin\\Release\\djv.exe" "bin\\djv.exe"\n') # DLLs for file in glob.glob('DJV-install-package\\bi...
0
0
0
0
0
0
.modules/.CMSeeK/cmseekdb/generator.py
termux-one/EasY_HaCk
1,103
3265911
<reponame>termux-one/EasY_HaCk #!/usr/bin/python3 # -*- coding: utf-8 -*- # This is a part of CMSeeK, check the LICENSE file for more information # Copyright (c) 2018 Tuhinshubhra # Precise and Hawt from html.parser import HTMLParser ga = '0' ga_content = '' class MyHTMLParser(HTMLParser): def handle_starttag(s...
0
0
0
0
0
0
src/masonite/mail/__init__.py
cercos/masonite
1,816
3265919
<reponame>cercos/masonite<filename>src/masonite/mail/__init__.py from .Mail import Mail from .Mailable import Mailable from .MockMail import MockMail
0
0
0
0
0
0
homeassistant/components/sql/__init__.py
domwillcode/home-assistant
22,481
3265951
"""The sql component."""
0
0
0
0
0
0
evaluate.py
pinaryazgan/GDN
156
3265960
<gh_stars>100-1000 from util.data import * import numpy as np from sklearn.metrics import precision_score, recall_score, roc_auc_score, f1_score def get_full_err_scores(test_result, val_result): np_test_result = np.array(test_result) np_val_result = np.array(val_result) all_scores = None all_normals...
0
0
0
0
0
0
davarocr/davarocr/davar_common/models/heads/cls_head.py
icedream2/DAVAR-Lab-OCR
387
3265991
from __future__ import annotations """ ################################################################################################## # Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved. # Filename : cls_head.py # Abstract : classification head. # Cur...
3
4
0
0
7
0
services/metadata_service/tests/integration_tests/utils.py
runsascoded/metaflow-service
103
3265995
from __future__ import annotations import json import os import psycopg2 import pytest from aiohttp import web from services.data.postgres_async_db import AsyncPostgresDB from services.utils.tests import get_test_dbconf from services.metadata_service.api.admin import AuthApi from services.metadata_service.api.flow imp...
63
9
0
0
72
0
count.py
retr0-13/JiuZhou
150
3266005
<reponame>retr0-13/JiuZhou #coding=utf-8 import re import os def get_file_path(root_path, file_list, dir_list): # 获取该目录下所有的文件名称和目录名称 dir_or_files = os.listdir(root_path) for dir_file in dir_or_files: # 获取目录或者文件的路径 dir_file_path = os.path.join(root_path, dir_file) # 判断该路径为文件还是路径 ...
0
0
0
0
0
0
bin/amazon/amazon_products_to_trec.py
cvangysel/SERT
107
3266030
import sys from cvangysel import argparse_utils, io_utils, logging_utils, trec_utils import argparse import ast import gzip import logging import os def main() -> object: parser = argparse.ArgumentParser() parser.add_argument('--loglevel', type=str, default='INFO') parser.add_argument('--shard_size', ...
0
1
0
0
1
0
openpoiservice/server/utils/geometries.py
larsrinn/openpoiservice
131
3266050
# openpoiservice/server/utils/geometries.py import pyproj from shapely.ops import transform def truncate(f, n) -> object: """ Truncates/pads a float f to n decimal places without rounding """ s = '{}'.format(f) if 'e' in s or 'E' in s: return '{0:.{1}f}'.format(f, n) i, p, d = s.parti...
0
4
1
0
5
0
Lib/gftools/tests/test_html.py
yanone/gftools
150
3266065
import pytest from glob import glob from fontTools.ttLib import TTFont import tempfile import os from gftools.html import * import re from copy import deepcopy TEST_DATA = os.path.join("data", "test") @pytest.fixture def SimpleTemplate() -> object: class SimpleTemplate(HtmlTemplater): def __init__(self,...
0
10
0
0
10
0
park/envs/multi_dim_index/monotonic_rmi2.py
utkarsh5k/park
180
3266106
<filename>park/envs/multi_dim_index/monotonic_rmi2.py import numpy as np import pickle import sklearn.linear_model as lm def get_single(val): try: return get_single(val[0]) except Exception as e: return val class LinearModel: def __init__(self, xs=None, ys=None): self.coef_ = 0 ...
0
0
0
0
0
0
examples/dialogue/plato-2/utils/__init__.py
JeremyZhao1998/PaddleNLP
7,091
3266110
<filename>examples/dialogue/plato-2/utils/__init__.py # Copyright (c) 2020 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.apac...
0
0
0
0
0
0
src/sensing/drivers/radar/umrr_driver/setup.py
P4nos/Aslan
227
3266139
<filename>src/sensing/drivers/radar/umrr_driver/setup.py #!/usr/bin/env Python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup setup_args = generate_distutils_setup( packages=['smartmicro'], package_dir={'': 'src'} ) setup(**setup_args)
0
0
0
0
0
0
framework/raven_qsub_command.py
rinelson456/raven
159
3266165
<gh_stars>100-1000 #!/usr/bin/env python # Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
0
0
0
0
0
0
openchem/utils/metrics.py
jmhayesesq/Open-Chem
466
3266178
from rdkit import Chem from rdkit.Chem import QED import numpy as np import networkx as nx from openchem.utils.sa_score import sascorer from rdkit.Chem import Descriptors def reward_penalized_log_p(smiles, return_mean: bool=True) -> object: """ Reward that consists of log p penalized by SA and # long cycles, ...
5
5
0
0
10
0
examples/pytorch/dtgrnn/model.py
ketyi/dgl
9,516
3266193
import numpy as np import scipy.sparse as sparse import torch import torch.nn as nn import dgl import dgl.nn as dglnn from dgl.base import DGLError import dgl.function as fn from dgl.nn.functional import edge_softmax class GraphGRUCell(nn.Module): '''Graph GRU unit which can use any message passing net to rep...
0
7
0
0
7
0
SymbolExtractorAndRenamer/swift-integration-tests/example-package-dealer.py
Polidea/SiriusObfuscator
427
3266230
<filename>SymbolExtractorAndRenamer/swift-integration-tests/example-package-dealer.py # Test the open source example packages. # # REQUIRES: have-network # # Make a sandbox dir. If you want to experiment with this test without waiting # for the clone, disable the first three lines here. # # RUN: rm -rf %t.dir # RUN: m...
0
0
0
0
0
0
mapboxcli/__init__.py
metroboomin427/mapbox-cli-py
128
3266239
<reponame>metroboomin427/mapbox-cli-py # Command line interface to Mapbox Web Services __version__ = '0.8.0'
0
0
0
0
0
0
async/aiohttp-get/main.py
whitmans-max/python-examples
140
3266252
import aiohttp import asyncio import json async def fetch(session, url) -> object: async with session.get(url) as response: return await response.text() async def main(urls) -> object: tasks = [] results = [] async with aiohttp.ClientSession() as session: for url in urls: t...
0
3
0
0
3
0
example_project/users/context_processors.py
webstar-commit/django-social-auth
490
3266253
<gh_stars>100-1000 from django.conf import settings def social_app_keys(request): return { 'facebook_key': settings.SOCIAL_AUTH_FACEBOOK_KEY, 'googleoauth2_key': settings.SOCIAL_AUTH_GOOGLE_OAUTH2_KEY, }
0
0
0
0
0
0
saleor/warehouse/migrations/0028_rewrite_checkouline_relations.py
eanknd/saleor
1,392
3266310
# Generated by Django 3.2.13 on 2022-04-29 09:47 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ("checkout", "0046_alter_checkout_line_pk"), ("warehouse", "0027_alter_reservation_models_chec...
0
0
2
0
2
0
ivis/utils/deprecation.py
wna26/ivis
271
3266319
<filename>ivis/utils/deprecation.py<gh_stars>100-1000 from functools import wraps from inspect import Parameter, signature from warnings import warn def check_deprecated_ntrees(ntrees, *, version="2.2"): """ Checks for the use of ntrees """ if ntrees is not None: warn(f"Received a value for `ntrees`. ...
0
0
0
0
0
0
Sign-Language-Recognition/code/transform_images.py
lhvubtqn/Sign-Language-Recognition
131
3266337
<gh_stars>100-1000 """ Takes a set of images as inputs, transforms them using multiple algorithms to make it suitable for ingestion into ML routines, then finally outputs them to disk. """ import csv import traceback import logging import os import numpy as np import cv2 from tqdm import tqdm from common.config impor...
0
0
0
0
0
0
src/fireo/fields/geo_point_field.py
isaacna/FireO
231
3266359
from fireo.fields import Field, errors from google.cloud import firestore class GeoPoint(Field): """GeoPoint field for firestore Examples ------- .. code-block:: python class User(Model): location = GeoPoint() u = User() u.location = fireo.GeoPoint(latitude=123.23...
0
1
0
0
1
0
regtests/list/pop.py
bpmbank/PythonJS
319
3266384
"""list.pop(n)""" def main(): a = list(range(10)) b = a.pop() TestError( b==9 ) c = a.pop(0) TestError( c==0 ) d = ['A', 'B'] TestError( d.pop(1)=='B' ) TestError( len(d)==1 )
0
0
0
0
0
0
src/canframe.py
kentindell/canhack
115
3266426
from binascii import hexlify from typing import Dict class CANFrame: """ Class for calculating the bitstream of a CAN frame. """ FIELD_NAMES: list[str] = ['sof', 'ida', 'idb', 'ide', 'srr', 'rtr', ...
15
6
12
8
41
0
pip_accel/config.py
mahmuuud/pip-accel
163
3266437
# Accelerator for pip, the Python package manager. # # Author: <NAME> <<EMAIL>> # Last Change: January 10, 2016 # URL: https://github.com/paylogic/pip-accel from __future__ import annotations """ Configuration handling for `pip-accel`. This module defines the :class:`Config` class which is used throughout the pip acc...
6
22
0
2
30
0
venv/Lib/site-packages/jsonschema/tests/test_utils.py
ajayiagbebaku/NFL-Model
3,324
3266453
<reponame>ajayiagbebaku/NFL-Model from unittest import TestCase from jsonschema._utils import equal class TestEqual(TestCase): def test_none(self): self.assertTrue(equal(None, None)) class TestDictEqual(TestCase): def test_equal_dictionaries(self): dict_1 = {"a": "b", "c": "d"} dict...
0
0
0
0
0
0
supplier/apps.py
wh8983298/GreaterWMS
1,063
3266540
<gh_stars>1000+ from django.apps import AppConfig class SupplierConfig(AppConfig): name = 'supplier'
0
0
0
0
0
0
Insert Node in a Binary Search Tree.py
RijuDasgupta9116/LintCode
321
3266543
""" Given a binary search tree and a new tree node, insert the node into the tree. You should keep the tree still be a valid binary search tree. Example Given binary search tree as follow: 2 / \ 1 4 / 3 after Insert node 6, the tree should be: 2 / \ 1 4 ...
0
1
0
0
1
0
L1Trigger/GlobalTriggerAnalyzer/python/l1GtAnalyzer_cfi.py
ckamtsikis/cmssw
852
3266550
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from L1Trigger.GlobalTriggerAnalyzer.L1ExtraInputTagSet_cff import * l1GtAnalyzer = cms.EDAnalyzer("L1GtAnalyzer", # non-keyed parameter sets first # input tags for L1Extra collections # used by: # ana...
0
0
0
0
0
0
modules/dbnd/test_dbnd/run/test_pandas_io.py
ipattarapong/dbnd
224
3266592
<reponame>ipattarapong/dbnd import logging from dbnd import PythonTask, data, output, parameter from targets import target logger = logging.getLogger(__name__) class TestPandasTask(object): def test_pandas_task(self, tmpdir, pandas_data_frame): class PandasTask(PythonTask): some_param = par...
0
0
0
0
0
0
Coupled-Electron-Pair-Approximation/OLCCD.py
andyj10224/psi4numpy
214
3266618
""" Computes the Orbital-Optimized LCCD correlation energy. Equations taken from [Bozkaya:2013:054104]. __authors__ = "<NAME>" __credits__ = ["<NAME>"] __copyright__ = "(c) 2014-2020, The Psi4NumPy Developers" __license__ = "BSD-3-Clause" """ import numpy as np import psi4 from scipy import linalg as spla fr...
0
0
0
0
0
0
glue/viewers/scatter/qt/__init__.py
HPLegion/glue
550
3266629
from .data_viewer import ScatterViewer # noqa def setup(): from glue.config import qt_client qt_client.add(ScatterViewer)
0
0
0
0
0
0
glue/viewers/matplotlib/qt/__init__.py
HPLegion/glue
550
3266632
from . import toolbar_mode # noqa
0
0
0
0
0
0
sandbox/jcrabtree/group_rnaseq_transcripts_by_read_alignment/3-timing-tests/read_and_split_only.py
senjoro/biocode
355
3266638
<filename>sandbox/jcrabtree/group_rnaseq_transcripts_by_read_alignment/3-timing-tests/read_and_split_only.py #!/usr/bin/env python3 """ Read BAM file and split each line into columns. """ import argparse import os import re import sys def main(): parser = argparse.ArgumentParser( description='Groups transcri...
0
0
0
0
0
0
advanced/debugging/segfault.py
zmoon/scipy-lecture-notes
2,538
3266661
""" Simple code that creates a segfault using numpy. Used to learn debugging segfaults with GDB. """ import numpy as np from numpy.lib import stride_tricks def make_big_array(small_array) -> object: big_array = stride_tricks.as_strided(small_array, shape=(2e6, 2e6), stride...
0
2
0
0
2
0
tests/_unittest_compat.py
TinkerBoard2-Android/external-python-asn1crypto
309
3266701
<reponame>TinkerBoard2-Android/external-python-asn1crypto # coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys import unittest import re if sys.version_info < (3,): str_cls = unicode # noqa else: str_cls = str _non_local = {'patched': False} def p...
0
0
0
0
0
0
gait_nn.py
gkcchaitu/Thesis_solution
333
3266703
<reponame>gkcchaitu/Thesis_solution import settings import os import tensorflow as tf import tensorflow.contrib.layers as layers import numpy as np from abc import abstractmethod slim = tf.contrib.slim SUMMARY_PATH = settings.LOGDIR_GAIT_PATH KEY_SUMMARIES = tf.GraphKeys.SUMMARIES SEED = 0 np.random.seed(SEED) c...
0
0
0
0
0
0
fool/trie.py
alanoooaao/FoolNLTK
1,718
3266726
#!/usr/bin/env python # -*-coding:utf-8-*- import queue class Match(object): def __init__(self, start, end, keyword): self.start = start self.end = end self.keyword = keyword def __str__(self) -> object: return str(self.start) + ":" + str(self.end) + "=" + self.keyword clas...
2
8
0
4
14
0
make/make.py
hirnimeshrampuresoftware/vispy
2,617
3266728
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for mo """ Convenience tools for vispy developers make.py command [arg] """ from __future__ import division, print_function import sys import os ...
0
1
0
0
1
0
tests/syntax/augmented_assignment_to_literal.py
matan-h/friendly
287
3266745
if "word" := True: pass
0
0
0
0
0
0
Code/Chenglong/extreme_ensemble_selection.py
ChenglongChen/Kaggle_Homedepot
465
3266754
# -*- coding: utf-8 -*- from __future__ import annotations """ @author: <NAME> <<EMAIL>> @brief: extreme ensemble selection module @note: - support multiprocessing (set multiprocessing = True and multiprocessing_num_cores = #cores) - support random weight in greedy forward model selection (set weight_o...
18
9
0
0
27
0
Lesson06/distinct.py
nawang87/codility_lessons
114
3266786
""" Task:Distinct Compute number of distinct values in an array. Write a function def solution(A) that, given an array A consisting of N integers, returns the number of distinct values in array A. For example, given array A consisting of six elements such that: A[0] = 2 A[1] = 1 A[2] = 1 A[3] = 2 A[4] =...
0
1
0
0
1
0
examples/login-default.py
hkr86/instapy-cli
341
3266820
<filename>examples/login-default.py from instapy_cli import client username = 'USERNAME' password = 'PASSWORD' with client(username, password) as cli: # do stuffs with cli ig = cli.api() print(ig.current_user())
0
0
0
0
0
0
examples/probability_forecast.py
leabeusch/pysteps
285
3266837
<reponame>leabeusch/pysteps<gh_stars>100-1000 #!/bin/env python """ Probability forecasts ===================== This example script shows how to forecast the probability of exceeding an intensity threshold. The method is based on the local Lagrangian approach described in Germann and Zawadzki (2004). """ import matp...
0
0
0
0
0
0
internal/js_library/test/transitive/transitive_declarations_test.bzl
Aghassi/rules_nodejs
645
3266846
<reponame>Aghassi/rules_nodejs "Unit tests for js_library rule" load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") load("//:providers.bzl", "DeclarationInfo") def _impl(ctx): env = unittest.begin(ctx) decls = [] for decl in ctx.attr.lib[DeclarationInfo].declarations.to_list(): decls.ap...
0
0
0
0
0
0
imageatm/utils/images.py
vishalbelsare/imageatm
215
3266856
from __future__ import annotations import numpy as np from typing import List, Tuple, Optional from pathlib import Path from PIL import Image IMG_FORMATS = ['JPEG', 'PNG'] def load_image(path: Path, target_size: object | None=None) -> Image: img = Image.open(path) f = img.format # store format after opening...
11
4
0
0
15
0
Dragon/python/dragon/io/data_batch.py
neopenx/Dragon
212
3266873
# -------------------------------------------------------- # Dragon # Copyright(c) 2017 SeetaTech # Written by <NAME> # -------------------------------------------------------- import time import pprint from multiprocessing import Queue from six.moves import range as xrange import dragon.core.mpi as mpi from .data_r...
0
1
0
4
5
0
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/EXT/draw_instanced.py
ShujaKhalid/deep-rl
210
3266907
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
0
1
0
0
1
0
SCRAPE/Lib/site-packages/hyperlink/test/__init__.py
Chinmoy-Prasad-Dutta/scrapy_scraper
247
3266927
<reponame>Chinmoy-Prasad-Dutta/scrapy_scraper # -*- coding: utf-8 -*- """ Tests for hyperlink """ __all = () def _init_hypothesis(): # type: () -> None from os import environ if "CI" in environ: try: from hypothesis import HealthCheck, settings except ImportError: ...
0
0
0
0
0
0
HLTriggerOffline/Egamma/python/doubleEle5SWL1RDQM_cfi.py
ckamtsikis/cmssw
852
3266943
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer doubleEle5SWL1RDQM = DQMEDAnalyzer('EmDQM', genEtaAcc = cms.double(2.5), genEtAcc = cms.double(2.0), reqNum = cms.uint32(2), filters = cms.VPSet(cms.PSet( PlotBounds = cms.vdouble(0.0, 0.0), ...
0
0
0
0
0
0
alipay/aop/api/response/AlipayIserviceCcmAgentGetResponse.py
antopen/alipay-sdk-python-all
213
3266971
<reponame>antopen/alipay-sdk-python-all<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.AgentChatInfo import AgentChatInfo from alipay.aop.api.domain.AgentHotlineInfo import AgentHotlineInfo from al...
0
0
0
0
0
0
lang/markdown.py
zachbarrow/talon_community
125
3266979
<reponame>zachbarrow/talon_community from talon.voice import Context, press from .. import utils from ..apps.atom import jump_to_bol from ..utils import is_filetype, optional_numerals FILETYPES = (".md",) def markdown(app, win): return is_filetype(FILETYPES)(app, win) or app.bundle == "info.pkpk.inkdrop" ctx ...
0
0
0
0
0
0
tg/urls.py
horacexd/clist
166
3267017
from django.views.decorators.csrf import csrf_exempt from django.conf.urls import re_path from tg import views import hashlib from django.conf import settings app_name = 'telegram' urlpatterns = [ re_path(r'^me/$', views.me, name='me'), re_path(r'^unlink/$', views.unlink, name='unlink'), re_path( ...
0
0
0
0
0
0
src/test/pythonFiles/folding/miscSamples.py
ChaseKnowlden/vscode-jupyter
615
3267020
def one(): """comment""" pass def two(): value = """a doc string with single and double quotes "This is how it's done" """ pass def three(): """a doc string with single and double quotes "This is how it's done" Another line """ pass def four(): '''a doc string with single and dou...
0
0
0
0
0
0
fum/ldap_helpers.py
jsavikko/futurice-ldap-user-manager
111
3267042
<filename>fum/ldap_helpers.py #encoding=utf8 from django.db import models from django.conf import settings from django.utils.dateformat import format from django.core.exceptions import ObjectDoesNotExist import logging, json, time, copy import ldap from ldap import modlist from datetime import datetime from pprint imp...
0
0
0
0
0
0
benchexec/tools/mucseq.py
MartinSpiessl/benchexec
137
3267043
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.util as util from . import cseq class Tool(cseq.CSeqTool): """ Tool...
0
2
1
0
3
0
agmcs/0006/0006.py
saurabh896/python-1
3,976
3267075
<filename>agmcs/0006/0006.py import os,re path = 'test/' dirlist = os.listdir(path) for x in dirlist: abspath = os.path.join(path,x) if os.path.isfile(abspath): if os.path.splitext(abspath)[1] == '.txt': with open(abspath,'r')as f: data = f.read() result = re.sp...
0
0
0
0
0
0
colossus/apps/subscribers/tests/factories.py
CreativeWurks/emailerpro
372
3267082
<filename>colossus/apps/subscribers/tests/factories.py from django.utils import timezone import factory from colossus.apps.lists.tests.factories import MailingListFactory from colossus.apps.subscribers.constants import Status, TemplateKeys from colossus.apps.subscribers.models import ( Activity, Domain, Subscribe...
0
0
0
0
0
0
py/kubeflow/kubeflow/cd/notebook_servers/notebook_server_jupyter_runner.py
zhyon404/kubeflow
9,272
3267143
<reponame>zhyon404/kubeflow # This file is only intended for development purposes from kubeflow.kubeflow.cd import base_runner base_runner.main(component_name="notebook_servers.notebook_server_jupyter", workflow_name="nb-jupyter-build")
0
0
0
0
0
0
notifications/migrations/0006_indexes.py
alvarovelezgalvez/django-notifications
1,354
3267177
# Generated by Django 2.0.2 on 2018-02-19 14:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('notifications', '0005_auto_20160504_1520'), ] operations: list[object] = [ migrations.AlterField( model_n...
0
0
2
0
2
0
salesman/admin/edit_handlers.py
icvntechstudio/django-salesman
222
3267268
from django.core.exceptions import FieldDoesNotExist from django.utils.html import format_html from django.utils.translation import gettext_lazy as _ from wagtail.admin.edit_handlers import EditHandler class ReadOnlyPanel(EditHandler): """ Read only panel for Wagtail. You can pass in a ``formatter`` function ...
0
4
0
0
4
0
mne/io/nihon/__init__.py
stevemats/mne-python
1,953
3267274
<filename>mne/io/nihon/__init__.py """Nihon Kohden module for conversion to FIF.""" # Author: <NAME> <<EMAIL>> # # License: BSD-3-Clause from .nihon import read_raw_nihon
0
0
0
0
0
0
urlserver/import.py
commonsearch/cosr-back
141
3267276
<gh_stars>100-1000 from __future__ import absolute_import, division, print_function, unicode_literals import os import sys import time sys.path.insert(-1, os.path.normpath(os.path.join(__file__, "../../"))) from cosrlib.dataproviders import list_dataproviders if len(sys.argv) > 1: to_import = sys.argv[1:] else: ...
0
0
0
0
0
0
src/dispatch/database/revisions/tenant/versions/2021-10-27_d1dc160533c7.py
axellaurelut/dispatch
3,417
3267357
<filename>src/dispatch/database/revisions/tenant/versions/2021-10-27_d1dc160533c7.py """Migrates the storage setting to the google drive plugin Revision ID: d1dc160533c7 Revises: <PASSWORD> Create Date: 2021-10-27 14:03:01.385859 """ import json from alembic import op from pydantic import SecretStr from pydantic.json...
0
0
0
0
0
0
src/api/filechange.py
piwaniuk/critic
216
3267359
<reponame>piwaniuk/critic # -*- mode: python; encoding: utf-8 -*- # # Copyright 2017 the Critic contributors, Opera Software ASA # # 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://...
0
0
0
0
0
0
tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/plugin/getPlatformInstance.py
Passer-D/GameAISDK
1,210
3267370
<gh_stars>1000+ # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code pac...
0
0
0
0
0
0
rotkehlchen/db/utils.py
rotkehlchenio/rotkehlchen
137
3267446
from sqlite3 import Cursor from typing import TYPE_CHECKING, Dict, List, Literal, NamedTuple, Optional, Tuple, Union from eth_utils import is_checksum_address from rotkehlchen.accounting.structures.balance import BalanceType from rotkehlchen.assets.asset import Asset from rotkehlchen.chain.substrate.types import Kusa...
14
9
21
0
44
0
lingvo/tasks/milan/tpu_utils.py
allenwang28/lingvo
2,611
3267447
# Lint as: python3 # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
6
2
0
0
8
0
diffengine/exceptions/twitter.py
jcoffi/diffengine
175
3267459
<filename>diffengine/exceptions/twitter.py class TwitterError(RuntimeError): pass class TwitterConfigNotFoundError(TwitterError): """Exception raised if the Twitter instance has not the required key and secret""" def __init__(self): self.message = "consumer key/secret not set up for feed." clas...
0
0
0
0
0
0
h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_change_missing_values_to_new_value.py
ahmedengu/h2o-3
6,098
3267483
df3[ df3["A"].isna(), "A"] = 5
0
0
0
0
0
0
Codeforces/244 Division 2/Problem A/A.py
VastoLorde95/Competitive-Programming
170
3267490
<reponame>VastoLorde95/Competitive-Programming ans, c, n = 0, 0, input() l = [int(x) for x in raw_input().split()] for num in l: if num == -1: if c == 0: ans += 1 else: c -= 1 else: c += num print ans
0
0
0
0
0
0
pixloc/pixlib/models/utils.py
jmorlana/pixloc
457
3267504
<gh_stars>100-1000 import torch def masked_mean(x, mask, dim): mask = mask.float() return (mask * x).sum(dim) / mask.sum(dim).clamp(min=1) def checkpointed(cls, do=True): '''Adapted from the DISK implementation of <NAME>.''' assert issubclass(cls, torch.nn.Module) class Checkpointed(cls): ...
0
0
0
0
0
0
controllers/edu.py
himansu1997/eden
205
3267508
# -*- coding: utf-8 -*- from __future__ import annotations """ Education """ if not settings.has_module(c): raise HTTP(404, body="Module disabled: %s" % c) # ----------------------------------------------------------------------------- def index() -> object: """ Module's Home Page """ return setting...
0
4
0
0
4
0
AIDog/serving/test_rebuild_model.py
BaranovArtyom/aiexamples
119
3267534
<reponame>BaranovArtyom/aiexamples import tensorflow as tf import numpy as np import base64 with tf.Session(graph=tf.Graph()) as sess: sess.run(tf.global_variables_initializer()) tf.saved_model.loader.load(sess, ["serve"], "./models/inception_v3/2") graph = tf.get_default_graph() with open("./n02085620_199.p...
0
0
0
0
0
0
Tests/Python/Indicators/IndicatorExtensionsTests.py
BlackBoxAM/Lean
6,580
3267539
# # 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 Lic...
0
0
0
0
0
0
Strings/Rabin_Karp.py
siddhi-244/CompetitiveProgrammingQuestionBank
931
3267541
""" Rabin Karp Algorithm for pattern searching in Python Rabin-Karp algorithm is an algorithm used for searching/matching patterns in the text using a hash function. It does not travel through every character in the initial phase rather it filters the characters that do not match and then performs the comparison. Wo...
0
0
0
0
0
0
src/main/starlark/core/repositories/configured_rules.bzl
mai93/rules_kotlin
286
3267630
<gh_stars>100-1000 def _rules_repository_impl(repository_ctx): attr = repository_ctx.attr repository_ctx.extract(attr.archive) rules_repository = repository_rule( implementation = _rules_repository_impl, attrs = { "archive": attr.label( doc = "label to repository archive", ...
0
0
0
0
0
0
cli/tests/pcluster/aws/test_iam.py
maclema/aws-parallelcluster
415
3267728
<reponame>maclema/aws-parallelcluster<gh_stars>100-1000 # Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amaz...
0
0
0
0
0
0
openvqa/models/mfb/model_cfgs.py
AcceptedDoge/openvqa
274
3267741
# -------------------------------------------------------- # OpenVQA # Written by <NAME> https://github.com/nbgao # -------------------------------------------------------- from openvqa.core.base_cfgs import BaseCfgs class Cfgs(BaseCfgs): def __init__(self): super(Cfgs, self).__init__() self.HIG...
0
0
0
8
8
0
RecoBTag/Skimming/python/btagDijet_OutputModule_cff.py
ckamtsikis/cmssw
852
3267743
import FWCore.ParameterSet.Config as cms from RecoBTag.Skimming.btagDijetOutputModuleAODSIM_cfi import * from RecoBTag.Skimming.btagDijetOutputModuleRECOSIM_cfi import *
0
0
0
0
0
0
tests/unit/viz/test_kuviz.py
CartoDB/cartoframes
236
3267759
# -*- coding: utf-8 -*- from __future__ import annotations from collections import namedtuple import pytest from cartoframes.auth import Credentials from cartoframes.viz import all_publications, delete_publication, Layer, Map from cartoframes.viz.source import Source from cartoframes.viz.kuviz import KuvizPublisher,...
2
0
0
0
2
0
selfdrive/mapd/lib/WayRelationIndex.py
kansakitw/dragonpilotamd
251
3267778
class WayRelationIndex(): """ A class containing an index of WayRelations by node ids of internal nodes and edge nodes. """ def __init__(self, way_relations): self._edge_nodes_index_dict: dict[object,object] = {} self._full_nodes_index_dict: dict[object,object] = {} for wr in way_relations: ...
0
2
0
2
4
0
lts/test/node-api/test_worker_terminate/binding.gyp
Dexus/node-compiler
1,666
3267827
<gh_stars>1000+ { "targets": [ { "target_name": "test_worker_terminate", "sources": [ "test_worker_terminate.c" ] } ] }
0
0
0
0
0
0
tests/benchmarks/dict-methods/exists.py
abeaumont/Dictu
116
3267855
<reponame>abeaumont/Dictu import time start = time.perf_counter() x = {"dictu": "is great!"} for _ in range(10000): "dictu" in x print(time.perf_counter() - start)
0
0
0
0
0
0
gpflow/inducing_variables/__init__.py
antonykamp/GPflow
1,724
3267882
from . import multioutput from .inducing_patch import InducingPatches from .inducing_variables import InducingPoints, InducingVariables, Multiscale from .multioutput import ( FallbackSeparateIndependentInducingVariables, FallbackSharedIndependentInducingVariables, MultioutputInducingVariables, SeparateI...
0
0
0
0
0
0
pytest-verbose-parametrize/tests/integration/parametrize_ids/tests/unit/test_non_parametrized.py
RaiVaibhav/pytest-plugins
282
3267883
def test_bar(): # unparametrized pass
0
0
0
0
0
0
etl/parsers/etw/Microsoft_Windows_WinHttp.py
IMULMUL/etl-parser
104
3267903
<reponame>IMULMUL/etl-parser # -*- coding: utf-8 -*- """ Microsoft-Windows-WinHttp GUID : 7d44233d-3055-4b9c-ba64-0d47ca40a232 """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl...
0
0
0
0
0
0
calvin/utilities/tests/test_attribute_resolver.py
gabrielcercel/calvin-base
334
3267929
# -*- coding: utf-8 -*- import unittest import pytest from calvin.utilities.attribute_resolver import AttributeResolver class AttributeResolverTester(unittest.TestCase): def test_cpu_resources(self): """ Tests valid cpu resources in the indexed_public field """ att = AttributeRes...
0
0
0
0
0
0
library/oci_app_catalog_subscription.py
slmjy/oci-ansible-modules
106
3267939
<filename>library/oci_app_catalog_subscription.py #!/usr/bin/python # Copyright (c) 2019, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ...
0
0
0
0
0
0
sphinx-sources/Examples/BesselBeam/BesselAnularSlit.py
jccmak/lightpipes
132
3267962
<reponame>jccmak/lightpipes<gh_stars>100-1000 from LightPipes import * import matplotlib.pyplot as plt import numpy as np #wavelength HeNe laser: wavelength=632.8*nm #grid size: size=6*mm #grid dimension: N=500 N2=int(N/2) #diameter of the annular slit: d=2.5*mm #width of the annular slit: deltaD=30*um #focal length a...
0
0
0
0
0
0
starfish/core/imagestack/test/factories/__init__.py
haoxusci/starfish
164
3267978
<reponame>haoxusci/starfish from .from_codebook import create_imagestack_from_codebook from .synthetic_stack import synthetic_stack from .unique_tiles import unique_tiles_imagestack from .with_coords import imagestack_with_coords_factory
0
0
0
0
0
0