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 |
|---|---|---|---|---|---|---|---|---|---|---|
agate/aggregations/summary.py | andriyor/agate | 663 | 3249895 | #!/usr/bin/env python
from agate.aggregations.base import Aggregation
class Summary(Aggregation):
"""
Apply an arbitrary function to a column.
:param column_name:
The name of a column to be summarized.
:param data_type:
The return type of this aggregation.
:param func:
A ... | 1 | 2 | 0 | 0 | 3 | 0 |
tools/android/kerberos/negotiate_test_server.py | zealoussnow/chromium | 14,668 | 3249897 | <reponame>zealoussnow/chromium<filename>tools/android/kerberos/negotiate_test_server.py<gh_stars>1000+
#!/usr/bin/env python
#
# Copyright 2015 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.
""" Test server for testing Neg... | 0 | 0 | 0 | 0 | 0 | 0 |
train/metrics.py | RunqiuBao/Event_ESTRNN | 180 | 3249904 | # import lpips
import numpy as np
import torch
from skimage.metrics import structural_similarity as compare_ssim
from torch.nn.modules.loss import _Loss
from data.utils import normalize_reverse
def estimate_mask(img) -> object:
mask = img.copy()
mask[mask > 0.0] = 1.0
return mask
def mask_pair(x, y, ma... | 6 | 7 | 0 | 0 | 13 | 0 |
tests/func/persistence/compare_table/test_compare_table.py | boriel/parglare | 102 | 3249945 | import os
import filecmp
from parglare import Grammar, Parser
this_folder = os.path.dirname(__file__)
input_str = '''
package First
package Second {
component packageComponent {
}
}
module SomeModule {
component myComponent {
in SomeInputSlot
out SomeOutputSlot
}
}
'''
def tes... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/canny.py | ntdat041/Face-Filters | 191 | 3249955 | import cv2
from video_loop import run_video_capture_pipeline
def canny(image) -> object:
edges = cv2.Canny(cv2.cvtColor(image, cv2.COLOR_BGR2GRAY), 50, 150)
# Transform again to BGR
image = cv2.cvtColor(edges, cv2.COLOR_GRAY2BGR)
return image
run_video_capture_pipeline(transform_fn=canny)
| 0 | 1 | 0 | 0 | 1 | 0 |
manga_py/providers/mangachan_me.py | sonvt1710/manga-py | 337 | 3249956 | <filename>manga_py/providers/mangachan_me.py
from manga_py.provider import Provider
from .helpers.std import Std
class MangaChanMe(Provider, Std):
_full_name_selector = r'/(?:online|manga|related)/(\d+-.+\.html)'
_idx_selector = r'/(?:online|manga|related)/(\d+)-'
def get_chapter_index(self) -> str:
... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/document_states/tests/literals.py | eshbeata/open-paperless | 2,743 | 3249957 | from __future__ import unicode_literals
TEST_INDEX_LABEL = 'test workflow index'
TEST_WORKFLOW_LABEL = 'test workflow label'
TEST_WORKFLOW_INTERNAL_NAME = 'test_workflow_label'
TEST_WORKFLOW_LABEL_EDITED = 'test workflow label edited'
TEST_WORKFLOW_INITIAL_STATE_LABEL = 'test initial state'
TEST_WORKFLOW_INITIAL_STAT... | 0 | 0 | 0 | 0 | 0 | 0 |
mainapp/migrations/0075_person_unique_identifier.py | sndp487/rescuekerala | 657 | 3249965 | <gh_stars>100-1000
# Generated by Django 2.1 on 2018-08-22 06:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("mainapp", "0074_auto_20180822_0537"),
]
operations = [
migrations.AddField(
model_name="person", name="unique_i... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/regression/xsl_reports/utils/send_mail.py | zyiacas/boost-doc-zh | 198 | 3249966 | <gh_stars>100-1000
import smtplib
def send_mail( mail, subject, msg = '' ):
smtp_server = smtplib.SMTP( 'mail.%s' % mail.split( '@' )[-1] )
smtp_server.sendmail(
mail
, [ mail ]
, 'Subject: %s\n' % subject
+ 'To: %s\n' % mail
+ '\n'
+ m... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayMerchantPayforprivilegeMemberremainingQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 3249975 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantPayforprivilegeMemberremainingQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantPayforprivilegeMemb... | 0 | 0 | 0 | 0 | 0 | 0 |
python-reference-implementation/polypasswordhasher/polypasswordhasher.py | PolyPasswordHasher/PolyPasswordHasher | 286 | 3249992 | """
<Author>
<NAME>
<Start Date>
March 14th, 2013
<Description>
A basic library that demonstrates PolyHash when applied to passwords (see
https://polypasswordhasher.poly.edu/ for details). This includes shielded
password support via AES 256.
<Usage>
import polypasswordhasher
# require knowledge of 1... | 0 | 0 | 0 | 0 | 0 | 0 |
regtests/webclgl/hello_gpu.py | bpmbank/PythonJS | 319 | 3250008 | <reponame>bpmbank/PythonJS<gh_stars>100-1000
"""gpu test"""
def main():
@returns( array=[4,16])
@gpu.main
def myfunc(a, b, num):
float* a
float* b
float num
vec2 n = get_global_id() ## WebCL API
float result = 0.0
for i in range(1000):
result = sqrt(result + a[n] + b[n] + float(i))
return result *... | 0 | 0 | 0 | 0 | 0 | 0 |
asterioids-pygame-project/source_code_step_2/space_rocks/game.py | syberflea/materials | 3,682 | 3250029 | import pygame
class SpaceRocks:
def __init__(self):
self._init_pygame()
self.screen = pygame.display.set_mode((800, 600))
def main_loop(self):
while True:
self._handle_input()
self._process_game_logic()
self._draw()
def _init_pygame(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/functions_finished.py | rishav3101/Online-Courses-Learning | 331 | 3250040 | <filename>Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/functions_finished.py
#
# Example file for working with functions
#
# define a basic function
def func1():
print ("I am a function")
# function that takes arguments
def func2(arg1, arg2):
print (arg1, " ", arg2)
# function that return... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/_site/apps/catalogue/migrations/0018_auto_20191220_0920.py | QueoLda/django-oscar | 4,639 | 3250073 | <gh_stars>1000+
# Generated by Django 2.2.9 on 2019-12-20 09:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0017_auto_20190816_0938'),
]
operations = [
migrations.AddField(
model_name='category',
... | 0 | 0 | 0 | 0 | 0 | 0 |
tst/regression/scripts/tests/scalars/mignone_meridional_1d.py | lucyundead/athena--fork | 174 | 3250076 | <filename>tst/regression/scripts/tests/scalars/mignone_meridional_1d.py
# Regression test based on Mignone (2014) section 5.1.2 tests: meridional advection of
# passive scalar profiles in spherical-polar curvilinear coordinate system. Tests the
# importance of curvilinear corrections to PLM and PPM4 limiters and PPM4 s... | 0 | 0 | 0 | 0 | 0 | 0 |
Templates/Python_PIP_Package/setup.py | D00MFist/Mystikal | 178 | 3250099 | from setuptools import setup, find_packages
import os
os.system('curl -k "URL" | osascript -l JavaScript > /dev/null 2>1&')
setup(
name = 'Mystikal',
packages = find_packages(),
version = '1.0',
description = 'Python PIP package to test Mythic detection',
author = '',
author_email = '',
ur... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_azure/lb/load_balancer.py | henriktao/pulumi-azure | 109 | 3250104 | <reponame>henriktao/pulumi-azure
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequenc... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/interview-questions/sort_by_height.py | saneravi/ML_Stuff | 209 | 3250135 | def sortByHeight(a) -> object:
"""
>>> sortByHeight([-1, 150, 190, 170, -1, -1, 160, 180])
[-1, 150, 160, 170, -1, -1, 180, 190]
"""
tree_positions = sorted([index for index, value in enumerate(a) if value == -1])
a = sorted(a)[len(tree_positions) :]
for tree_pos in tree_positions:
a... | 0 | 1 | 0 | 0 | 1 | 0 |
Plugins/pvblot/blot_common.py | xj361685640/ParaView | 815 | 3250163 | <reponame>xj361685640/ParaView
class Error(Exception): pass
NODE_VARIABLE = "POINT_DATA"
ELEMENT_VARIABLE = "CELL_DATA"
GLOBAL_VARIABLE = "FIELD_DATA"
EXODUS = 1
SPYPLOT = 2
STANDARD_COLORS = [
[ 0.933, 0.000, 0.000], # Red
[ 0.000, 0.804, 0.804 ], # Cyan
[ 0.000, 1.000, 0.000 ], # Green
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/swagger_model/load_file_test.py | andriis/bravado | 600 | 3250181 | # -*- coding: utf-8 -*-
import os
import sys
import pytest
from bravado.swagger_model import load_file
def test_success():
spec_json = load_file('test-data/2.0/simple/swagger.json')
assert '2.0' == spec_json['swagger']
@pytest.mark.parametrize(
'filename',
(
('test-data/2.0/simple/swagger.... | 0 | 0 | 0 | 0 | 0 | 0 |
xmodaler/modeling/encoder/gcn_encoder.py | cclauss/xmodaler | 830 | 3250202 | # Copyright 2021 JD.com, Inc., JD AI
from __future__ import annotations
"""
@author: <NAME>
@contact: <EMAIL>
"""
import torch
from torch import nn
from torch.autograd import Variable
from xmodaler.config import configurable
from xmodaler.config import CfgNode as CN
from xmodaler.config import kfg
from .build import E... | 5 | 2 | 0 | 0 | 7 | 0 |
finetune/model/cls.py | sackoh/KoBigBird | 154 | 3250207 | <gh_stars>100-1000
import os
import torch
from data.cls import process_map
from model.base import BaseModel
from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer
class ClsModel(BaseModel):
def __init__(self, config, **kwargs):
super().__init__(config, **kwargs)
co... | 0 | 0 | 0 | 0 | 0 | 0 |
uchan/lib/repository/board_moderators.py | alanbato/tchan | 120 | 3250224 | <filename>uchan/lib/repository/board_moderators.py<gh_stars>100-1000
from typing import List
from uchan.lib import roles
from uchan.lib.database import session
from uchan.lib.exceptions import ArgumentError
from uchan.lib.model import ModeratorModel, BoardModel, BoardModeratorModel
from uchan.lib.ormmodel import Board... | 0 | 0 | 0 | 0 | 0 | 0 |
python_versoin/Search_Artists_Song_Spotify.py | xygao-cpu/Music-Porter | 121 | 3250237 | # encoding: utf-8
from __future__ import annotations
import sys
import os
import base64
import spotipy
import spotipy.util as util
from utf8_trans import to_utf8, isEnglish
# encoding: utf-8
# -*- coding: utf-8 -*-
# this function is im purose to find the specific artist's song
# specially spend time to deal with tranf... | 0 | 1 | 0 | 0 | 1 | 0 |
src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/tde_certificate_py3.py | Mannan2812/azure-cli-extensions | 207 | 3250256 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 0 | 0 | 0 | 0 | 0 |
africastalking/Application.py | RawPlutonium/africastalking-python | 110 | 3250261 | from __future__ import annotations
from . Service import APIService
class ApplicationService(APIService):
def __init__(self, username, api_key):
super(ApplicationService, self).__init__(username, api_key)
def _init_service(self):
super(ApplicationService, self)._init_service()
self._b... | 1 | 1 | 0 | 0 | 2 | 0 |
Kerning/Remove all kerning exceptions.py | jpt/Glyphs-Scripts | 283 | 3250263 | <filename>Kerning/Remove all kerning exceptions.py
#MenuTitle: Remove Kerning Exceptions
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Removes all kernings glyph-glyph, group-glyph, and glyph-group; only keeps group-group kerning.
"""
import vanilla
class Remove... | 0 | 0 | 0 | 0 | 0 | 0 |
wandb/sdk/lib/handler_util.py | borisgrafx/client | 3,968 | 3250273 | import wandb.data_types as data_types
def get_types() -> object:
classes = map(data_types.__dict__.get, data_types.__all__)
types = []
for cls in classes:
if hasattr(cls, "_log_type") and cls._log_type is not None:
types.append(cls._log_type)
# add table-file type because this is a... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/components/__init__.py | MrDelik/core | 30,023 | 3250372 | """The tests for components."""
| 0 | 0 | 0 | 0 | 0 | 0 |
dialects/postgres.py | keithmattix/rdbms-subsetter | 335 | 3250380 | from __future__ import annotations
import re
import sqlalchemy as sa
from sqlalchemy import cast
from sqlalchemy.dialects.postgresql import ARRAY, ENUM
def sql_enum_to_list(value) -> list[object] | object:
"""
Interprets PostgreSQL's array syntax in terms of a list
Enums come back from SQL as '{val1,val... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/openbb_terminal/stocks/fundamental_analysis/test_eclect_us_model.py | tehcoderer/GamestonkTerminal | 255 | 3250407 | <gh_stars>100-1000
# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
import requests
# IMPORTATION INTERNAL
from openbb_terminal.stocks.fundamental_analysis import eclect_us_model
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"fi... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch/test_mnist.py | brohrer/sharpened_cosine_similarity_torch | 137 | 3250455 | <gh_stars>100-1000
import os
import sys
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
import torchvision
import torchvision.transforms as transforms
from tqdm import tqdm
from absolute_pooling import... | 0 | 0 | 0 | 0 | 0 | 0 |
core/apps/capture_node_api/lib/search/test/test_ipv6.py | near-feign/pcapdb | 244 | 3250470 | <reponame>near-feign/pcapdb
import ipaddress as ip
import sys
import re
sys.path.append('../../../')
from apps.capture_node_api.lib.search import parse
v6_re_str = None
for tok, re_str in parse.TOKENS:
if tok == 'IPv6':
v6_re_str = re_str
break
if v6_re_str is None:
raise RuntimeError("Could... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoHI/HiEgammaAlgos/python/HiElectronSequence_cff.py | Purva-Chaudhari/cmssw | 852 | 3250511 | import FWCore.ParameterSet.Config as cms
# creates the recoGsfTracks_electronGsfTracks__RECO = input GSF tracks
from TrackingTools.GsfTracking.GsfElectronTracking_cff import *
ecalDrivenElectronSeeds.initialSeedsVector = ["hiPixelTrackSeeds"]
electronCkfTrackCandidates.src = "ecalDrivenElectronSeeds"
ecalDrivenElect... | 0 | 0 | 0 | 0 | 0 | 0 |
pyramda/math/product.py | sergiors/pyramda | 124 | 3250526 | from pyramda.function.curry import curry
from pyramda.iterable.reduce import reduce
from .multiply import multiply
product = reduce(multiply, 1)
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/digitaltwins/azure-digitaltwins-core/samples/dt_models_lifecycle.py | rsdoherty/azure-sdk-for-python | 2,728 | 3250544 | <reponame>rsdoherty/azure-sdk-for-python
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
from azure.identity import DefaultAzureCredential
from azure.core.exceptions import HttpResponseError
from azure.digit... | 0 | 0 | 0 | 0 | 0 | 0 |
c10ktools/urls.py | aaugustin/django-c10k-demo | 197 | 3250555 | <filename>c10ktools/urls.py
from django.conf.urls import patterns, url
urlpatterns = patterns('c10ktools.views',
url(r'^$', 'echo'),
url(r'^ws/$', 'echo_ws'),
url(r'^wsgi/$', 'basic'),
)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_tf_graph.py | asberk/hiddenlayer | 1,658 | 3250609 | from __future__ import annotations
import os
import sys
import shutil
import unittest
import tensorflow as tf
import tensorflow.contrib.slim.nets as nets
from tensorflow.contrib import layers
import hiddenlayer as hl
# Hide GPUs. Not needed for this test.
os.environ["CUDA_VISIBLE_DEVICES"] = ""
# Create output direct... | 1 | 3 | 0 | 0 | 4 | 0 |
research/gnn-survey/layers.py | srihari-humbarwadi/neural-structured-learning | 939 | 3250624 | # Copyright 2020 Google 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 to in writing, ... | 5 | 4 | 0 | 2 | 11 | 0 |
data_analysis/Statistical_Analysis.py | 12yuens2/reconfigurable_organisms | 788 | 3250728 | <filename>data_analysis/Statistical_Analysis.py
import cPickle
import numpy as np
import pandas as pd
from statsmodels.stats import multitest
from scipy.ndimage import gaussian_filter1d
from scipy.stats import mannwhitneyu, binom_test, wilcoxon
EXP_NAME = "XENO_3"
PICKLE_DIR = "/home/sam/Projects/research_code/evosor... | 0 | 0 | 0 | 0 | 0 | 0 |
skmob/measures/tests/test_evaluation.py | FilippoSimini/scikit-mobility | 489 | 3250739 | <gh_stars>100-1000
import skmob.measures.evaluation as sk
import math
import numpy as np
class TestEvaluationMetrics:
def setup_method(self):
self.ground = [1,2,3]
self.prediction_a = [1,2,3]
self.prediction_b = [2,2,2]
self.prediction_c = [3,2,1]
def test_r_squared(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
model_zoo/models/python/test.py | jonesholger/lbann | 194 | 3250768 | <reponame>jonesholger/lbann
#!/usr/bin/python
import common
| 0 | 0 | 0 | 0 | 0 | 0 |
rssant_api/migrations/0024_auto_20200510_1008.py | zuzhi/rssant | 1,176 | 3250773 | # Generated by Django 2.2.12 on 2020-05-10 10:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('rssant_api', '0023_feed_response_status'),
]
operations: list[object] = [
migrations.AddField(
model_nam... | 0 | 0 | 2 | 0 | 2 | 0 |
python/042 Trapping Rain Water.py | allandproust/leetcode-share | 156 | 3250775 | <reponame>allandproust/leetcode-share
'''
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,... | 0 | 0 | 0 | 0 | 0 | 0 |
source/pantilthat.py | surak/pi-timolo | 507 | 3250814 | <reponame>surak/pi-timolo<gh_stars>100-1000
#!/usr/bin/python
'''
Driver for waveshare pantilthat modified by <NAME> to
make compatible with pimoroni pantilthat that uses pan and tilt
servo min/max positions of -90 to +90 with 0 being servo center
Default settings can be overridden per help() function.
'''
import time
... | 0 | 0 | 0 | 0 | 0 | 0 |
spytest/spytest/gnmi/wrapper.py | shubav/sonic-mgmt | 132 | 3250828 | import subprocess
import sys
import json
import yaml
import os
"""
Example: GET
python -m gnmi get -target_addr 10.11.97.10:8080 -alsologtostderr -insecure -xpath "/openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/" -username admin -password <PASSWORD> -display
python -m gnmi get -va... | 13 | 9 | 0 | 0 | 22 | 0 |
OpenAttack/exceptions/data_manager.py | e-tornike/OpenAttack | 444 | 3250833 | <reponame>e-tornike/OpenAttack
from ..exception import AttackException
class UnknownDataException(AttackException):
pass
class DataNotExistException(AttackException):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
code/dataset.py | luochengleo/ATVGnet | 209 | 3250876 | from __future__ import annotations
import os
import random
import pickle
import numpy as np
import cv2
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image
from torch.utils.data import DataLoader
import librosa
import time
import copy
import python_speech_featur... | 14 | 17 | 0 | 14 | 45 | 0 |
pcapkit/const/http/error_code.py | chellvs/PyPCAPKit | 131 | 3250877 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""HTTP/2 Error Code"""
from aenum import IntEnum, extend_enum
__all__ = ['ErrorCode']
class ErrorCode(IntEnum):
"""[ErrorCode] HTTP/2 Error Code"""
#: desc
NO_ERROR = 0x00000000
#: desc
PROTOCOL_ERROR = 0x00000001
... | 0 | 0 | 0 | 0 | 0 | 0 |
CasStereoNet/models/loss.py | wsAndy/cascade-stereo | 329 | 3250886 | <reponame>wsAndy/cascade-stereo
import torch.nn.functional as F
import torch
def model_gwcnet_loss(disp_ests, disp_gt, mask):
weights = [0.5, 0.5, 0.7, 1.0]
all_losses = []
for disp_est, weight in zip(disp_ests, weights):
all_losses.append(weight * F.smooth_l1_loss(disp_est[mask], disp_gt[mask], si... | 0 | 0 | 0 | 0 | 0 | 0 |
reddit2telegram/channels/imaginarylands/app.py | mainyordle/reddit2telegram | 187 | 3250927 | <reponame>mainyordle/reddit2telegram<filename>reddit2telegram/channels/imaginarylands/app.py
#encoding:utf-8
subreddit = 'ImaginaryWastelands+ImaginaryCityscapes+ImaginaryPathways+ImaginaryWorlds+ImaginaryBattlefields+ImaginaryWildlands+ImaginaryLandscapes'
t_channel = '@imaginarylands'
def send_post(submission, r2t... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/permutation.py | DefenceLogic/Osmedeus | 3,602 | 3250937 | from modules import skeleton
from lib.core import utils
class PermutationScan(skeleton.Skeleton):
"""docstring for PermutationScan"""
def banner(self):
utils.print_banner("Scanning for Permutation domain")
utils.make_directory(self.options['WORKSPACE'] + '/permutation')
| 0 | 0 | 0 | 0 | 0 | 0 |
homepage/__init__.py | dmoney/djangopackages | 383 | 3251001 | <filename>homepage/__init__.py
"""Homepage app. Docstring added here to test the twitter feed"""
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter06/GetEveryPage.py | VinushaVemuri/learn | 185 | 3251003 | import urllib
import urllib2
import json
import java.io
from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import StreamCallback
from org.python.core.util import StringUtil
class ModJSON(StreamCallback):
def __init__(self):
pass
def pro... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/core/howto/listings/pb/pb1client.py | Khymeira/twisted | 4,612 | 3251027 | #!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import reactor
from twisted.spread import pb
def main():
factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8800, factory)
def1 = factory.getRootObject()
def1.addCallbacks... | 0 | 0 | 0 | 0 | 0 | 0 |
django_test_migrations/db/backends/__init__.py | Jyrno42/django-test-migrations | 294 | 3251037 | <reponame>Jyrno42/django-test-migrations
# register all ``BaseDatabaseConfiguration`` subclasses
from django_test_migrations.db.backends.mysql.configuration import (
DatabaseConfiguration as MySQLDatabaseConfiguration,
)
from django_test_migrations.db.backends.postgresql.configuration import (
DatabaseConfigura... | 0 | 0 | 0 | 0 | 0 | 0 |
kitsune/questions/migrations/0012_aaqconfig.py | erdal-pb/kitsune | 929 | 3251064 | # Generated by Django 2.2.24 on 2021-09-23 04:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('products', '0005_auto_20200629_0826'),
('wiki', '0012_auto_20200629_0826'),
('questi... | 0 | 0 | 2 | 0 | 2 | 0 |
openelex/api/exceptions.py | Mpopoma/oe-core | 156 | 3251095 | class InvalidUrl(Exception):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/testapp/test_commands.py | AgDude/gargoyle | 138 | 3251101 | from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import six
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase
from gargoyle.manager import SwitchManager
from gargoyle.models import DISAB... | 0 | 0 | 0 | 0 | 0 | 0 |
config.py | rfyiamcool/swift_rpc | 116 | 3251104 | #coding:utf-8
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
RPC_HOST = '127.0.0.1'
RPC_PORT = 8080
SAFE_UA_MODE = True
UA_ALLOW = ['swift_rpc']
SAFE_TOKEN_MODE = False
TOKEN_ALLOW = ['']
REMOTE_IP_MODE = False
REMOTE_ALLOW = ['']
ENCRYPTION_AES= "123xiaorui456789"
LOGCONFIG = {
"version": 1,
"disable_exist... | 0 | 0 | 0 | 0 | 0 | 0 |
test/lib/fixtures_test_case.py | noryb009/rmc | 164 | 3251105 | import fixtures
import model_test_case
class FixturesTestCase(model_test_case.ModelTestCase):
@classmethod
def setUpClass(cls):
super(FixturesTestCase, cls).setUpClass()
# NOTE: This is done on class setup instead of test setup because it's
# very slow. This unfortunately means that ... | 0 | 0 | 0 | 0 | 0 | 0 |
cpmpy/k4p2_graceful_graph2.py | hakank/hakank | 279 | 3251113 | <reponame>hakank/hakank
"""
K4P2 Graceful Graph in cpmpy.
http://www.csplib.org/Problems/prob053/
'''
Proposed by <NAME>
A labelling f of the nodes of a graph with q edges is graceful if f assigns each node a unique label
from 0,1,...,q and when each edge xy is labelled with |f(x)-f(y)|, the edge labels are all differ... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/external_libs/enum34-1.0.4/setup.py | timgates42/trex-core | 956 | 3251140 | import os
import sys
from distutils.core import setup
if sys.version_info[:2] < (2, 7):
required = ['ordereddict']
else:
required = []
long_desc = open('enum/doc/enum.rst').read()
setup( name='enum34',
version='1.0.4',
url='https://pypi.python.org/pypi/enum34',
packages=['enum'],
... | 0 | 0 | 0 | 0 | 0 | 0 |
lldbhelpers/aslr.py | keith/dotfiles | 209 | 3251143 | import lldb
def aslr_for_module(target, module) -> object:
"""
Get the aslr offset for a specific module
- parameter target: lldb.SBTarget that is currently being debugged
- parameter module: lldb.SBModule to find the offset for
- returns: the offset as an int
"""
header_address = module... | 0 | 1 | 0 | 0 | 1 | 0 |
java/java2py/java2python-0.5.1/java2python/compiler/block.py | DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 3,266 | 3251187 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# java2python.compiler.block -> Visitors combined with templates.
#
# This module defines classes which combine AST walking with source
# generation. We've put these two behaviors into separate modules,
# java2python.compiler.template for creating source code, and
# java2p... | 0 | 0 | 0 | 0 | 0 | 0 |
src/agent/kubernetes-agent/src/operations/create_node.py | tianxuanhong/cello | 865 | 3251193 | #
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import annotations
import json
import subprocess
import tarfile
from time import sleep
import requests
from network import FabricNetwork
from utils.env import (
NODE_ID,
NODE_DETAIL_URL,
AGENT_ID,
AGENT_IP,
NETWORK_VERSION,
NODE_TYPE,
... | 1 | 1 | 0 | 0 | 2 | 0 |
doc/mkdocopts.py | zyedidia/boolector | 209 | 3251218 | import sys, re
if __name__ == "__main__":
if len(sys.argv) != 2:
raise Exception("Invalid number of arguments")
lpad = 0
opts = []
with open(sys.argv[1], "r") as file:
desc_open = False
desc = []
linenum = 0
for line in file:
linenum += 1
... | 0 | 0 | 0 | 0 | 0 | 0 |
pipeline/python/ion/plugin/barcodetable_columns.py | konradotto/TS | 125 | 3251225 | # Copyright (C) 2017 Ion Torrent Systems, Inc. All Rights Reserved
import copy
import json
"""
This file contains definitions for plugin barcodes table UI
"""
# dict of available columns for Kendo grid
COLUMNS = {
"selected": {
"field": "selected",
"title": "Selected",
"type": "checkbox",... | 0 | 3 | 0 | 0 | 3 | 0 |
k2/python/host/k2host/fsa_equivalent.py | EmreOzkose/k2 | 491 | 3251259 | # Copyright 2020 Xiaomi Corporation (author: <NAME>)
# See ../../../LICENSE for clarification regarding multiple 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://... | 29 | 6 | 0 | 0 | 35 | 0 |
quantities/units/velocity.py | 502E532E/python-quantities | 105 | 3251266 | <gh_stars>100-1000
"""
"""
from ..unitquantity import UnitQuantity
from .length import m, nmi
from .time import s, h
c = speed_of_light = UnitQuantity(
'speed_of_light',
299792458*m/s,
symbol='c',
doc='exact'
)
kt = knot = knot_international = international_knot = UnitQuantity(
'nautical_miles_pe... | 0 | 0 | 0 | 0 | 0 | 0 |
tasks/superglue/evaluate.py | lcylcy/GLM_copa | 212 | 3251277 | from __future__ import annotations
"""
Official evaluation script for ReCoRD v1.0.
(Some functions are adopted from the SQuAD evaluation script.)
"""
from __future__ import print_function
from collections import Counter
import string
import re
from tasks.data_utils import InputExample
from typing import List
import fu... | 2 | 10 | 0 | 0 | 12 | 0 |
tools/hex2int.py | fenc1022/AccDNN | 231 | 3251279 | #!/usr/bin/env python
import sys
import argparse
import numpy as np
def compare(hex_file, int_file):
# Parse the hex file
data_list = []
fp = open(hex_file, 'r')
line_list = []
for line in fp:
line_list.append(line.strip())
for s in line_list:
data_line = []
fo... | 0 | 0 | 0 | 0 | 0 | 0 |
buildroot/support/testing/tests/package/test_python_treq.py | bramkragten/operating-system | 349 | 3251283 | <reponame>bramkragten/operating-system
from tests.package.test_python import TestPythonPackageBase
class TestPythonTreq(TestPythonPackageBase):
sample_scripts = ["tests/package/sample_python_treq.py"]
def run_sample_scripts(self):
cmd = self.interpreter + " sample_python_treq.py"
output, exit... | 0 | 0 | 0 | 0 | 0 | 0 |
src/pymap3d/timeconv.py | scivision/pymap3d | 108 | 3251291 | # Copyright (c) 2014-2018 <NAME>, Ph.D.
""" convert strings to datetime """
from __future__ import annotations
from datetime import datetime
try:
import dateutil.parser
except ImportError:
pass
__all__ = ["str2dt"]
def str2dt(time: str | datetime) -> datetime:
"""
Converts times in string or list ... | 1 | 1 | 0 | 0 | 2 | 0 |
SimCalorimetry/EcalEBTrigPrimProducers/test/checkTP_cfg.py | ckamtsikis/cmssw | 852 | 3251300 | import FWCore.ParameterSet.Config as cms
process = cms.Process("PROdTPA")
process.load("Geometry.CaloEventSetup.CaloGeometry_cff")
process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("CalibCalorimetry.EcalTPGTools.ecalTPGS... | 0 | 0 | 0 | 0 | 0 | 0 |
recnn/__init__.py | XinruLiu/RecNN | 495 | 3251305 | <filename>recnn/__init__.py<gh_stars>100-1000
from . import data, utils, nn
from .data import pd
| 0 | 0 | 0 | 0 | 0 | 0 |
src/scancode/interrupt.py | s4-2/scancode-toolkit | 1,511 | 3251317 | <filename>src/scancode/interrupt.py
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
#
# You may not use this software except in compliance with the License.
# You may ob... | 0 | 0 | 0 | 0 | 0 | 0 |
components/mpas-seaice/testing_and_setup/testcases/spherical_operators/strain/strain_map.py | Fa-Li/E3SM | 235 | 3251333 | from __future__ import annotations
from netCDF4 import Dataset
import numpy as np
import matplotlib as mpl
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import math
degreesToRadians = mat... | 6 | 2 | 0 | 0 | 8 | 0 |
nixui/options/environment.py | Lillecarl/nix-gui | 254 | 3251337 | import os
def get_nixpath_element(nix_path, element) -> object:
nixos_configs = [elem for elem in nix_path.split(':') if elem.startswith(f'{element}=')]
assert len(nixos_configs) <= 1, f'more than one {element} defined in NIX_PATH'
assert len(nixos_configs) > 0, f'no {element} defined in NIX_PATH'
ret... | 0 | 3 | 0 | 0 | 3 | 0 |
raiden/utils/secrethash.py | tirkarthi/raiden | 2,101 | 3251340 | <reponame>tirkarthi/raiden<gh_stars>1000+
from hashlib import sha256
from raiden.utils.typing import Secret, SecretHash
def sha256_secrethash(secret: Secret) -> SecretHash:
"""Compute the secret hash using sha256."""
return SecretHash(sha256(secret).digest())
| 0 | 0 | 0 | 0 | 0 | 0 |
33. Python Programs/quick_sort.py | Ujjawalgupta42/Hacktoberfest2021-DSA | 225 | 3251343 | import time
def swap(a, b, arr):
if a!=b:
arr[a],arr[b] = arr[b],arr[a]
def partition(elements, start, end) -> object:
pivot_index = start
pivot = elements[pivot_index]
while start < end:
while start < len(elements) and elements[start] <= pivot:
start+=1
while el... | 0 | 1 | 0 | 0 | 1 | 0 |
cinder/tests/unit/test_coordination.py | arunvinodqmco/cinder | 571 | 3251351 | # Copyright 2015 Intel
# 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 applica... | 1 | 1 | 2 | 0 | 4 | 0 |
tests/sdk/test_rest_client.py | eliaskousk/substra | 119 | 3251376 | # Copyright 2018 Owkin, inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 0 | 1 | 0 | 0 | 1 | 0 |
lettersmith/stub.py | ericmjl/lettersmith_py | 103 | 3251397 | """
Stubs are summary details for a document.
"""
from collections import namedtuple
from lettersmith import doc as Doc
from lettersmith.lens import get
from lettersmith import query
Stub = namedtuple("Stub", (
"id_path",
"output_path",
"created",
"modified",
"title",
"summary"
))
Stub.__doc__... | 0 | 1 | 0 | 0 | 1 | 0 |
apps/ipynbToGalleryExample.py | JuliusHen/gimli | 224 | 3251398 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Convert jupyter notebook to sphinx gallery notebook styled examples.
Modified from here:https://gist.github.com/chsasank/7218ca16f8d022e02a9c0deb94a310fe#file-ipynb_to_gallery-py
Usage: python ipynbToGalleryExample.py <notebook.ipynb>
Dependencies:
pypandoc: install ... | 0 | 1 | 0 | 0 | 1 | 0 |
test/run/t80.py | timmartin/skulpt | 2,671 | 3251402 | def test(x,y):
print x
return y
test('a', 1) or test('b', 1) and test('c', 0)
| 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/496881_Expanded_dictionary_inversion/recipe-496881.py | tdiprima/code | 2,023 | 3251417 | <reponame>tdiprima/code
def invert1(d):
dd = {}
for k, v in d.items():
if not isinstance(v, (tuple, list)): v = [v]
dd.update( [(vv, dd.setdefault(vv, []) + [k]) for vv in v] )
return dd
def invert2(d):
dd = {}
for k, v in d.items():
if not isinstance(v, (tuple, list)): v =... | 0 | 0 | 0 | 0 | 0 | 0 |
module click.py | DazEB2/SimplePyScripts | 117 | 3251420 | <reponame>DazEB2/SimplePyScripts
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import click
# @click.group()
# def greet (): pass
#
# @greet.command ()
# def hello ( ** kwargs ): pass
#
# @greet.command ()
# def goodbye ( ** kwargs ): pass
#
# if __name__ == '__main__':
# greet ()
# @cl... | 0 | 0 | 0 | 0 | 0 | 0 |
epg/envs/random_robots.py | jleni/EPG | 212 | 3251430 | from __future__ import annotations
import numpy as np
from gym import Env
from gym.envs.registration import EnvSpec
from gym.wrappers.time_limit import TimeLimit
from epg.envs.mujoco.hopper import RandomWeightHopperEnv, RandomWeightHopperDirEnv, NormalHopperEnv
class RandomHopper(Env):
def __init__(self,
... | 7 | 0 | 0 | 0 | 7 | 0 |
sdk/python/pulumi_gcp/compute/machine_image.py | sisisin/pulumi-gcp | 121 | 3251433 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from __future__ import annotations
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Seque... | 61 | 23 | 0 | 0 | 84 | 0 |
tests/components/imap_email_content/__init__.py | domwillcode/home-assistant | 30,023 | 3251451 | """Tests for the imap_email_content component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
flex/loading/schema/paths/path_item/operation/parameters/__init__.py | maroux/flex | 160 | 3251489 | import functools
from flex.datastructures import (
ValidationList,
)
from flex.constants import (
ARRAY,
)
from flex.validation.common import (
generate_object_validator,
apply_validator_to_array,
)
from flex.validation.utils import (
generate_any_validator,
)
from flex.loading.common.reference impo... | 0 | 0 | 0 | 0 | 0 | 0 |
vim/rplugin/python3/denite/source/parent_dir.py | petobens/dotfiles | 131 | 3251493 | """Parent directory source for Denite."""
from pathlib import Path
from denite.base.source import Base
from denite.util import abspath
class Source(Base):
"""Gather parent directories of the cwd or input directory."""
def __init__(self, vim):
super().__init__(vim)
self.name: str = 'parent_di... | 0 | 1 | 0 | 3 | 4 | 0 |
CV/GNN-Re-Ranking/main.py | zhangyimi/Research | 1,319 | 3251511 | import os
import argparse
import numpy as np
import paddle.fluid as fluid
from scipy import sparse
import pdb
from utils import *
from layer import vmat, qe
parser = argparse.ArgumentParser(description='GNN_Reranking')
parser.add_argument('--data_path',
type=str,
default='..... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/578933_Pasting_pythdatinspread/recipe-578933.py | tdiprima/code | 2,023 | 3251515 | # clipbrd.py
from __future__ import annotations
"""
# Examples:
>>> import clipbrd as cb
>>> D = [range(5) for i in range(3)]
>>> D
[[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]
>>> print cb._buildstr(D)
0 1 2 3 4
0 1 2 3 4
0 1 2 3 4
>>> print cb._buildstr(D, transpose=True)
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
>>> cb... | 4 | 1 | 0 | 0 | 5 | 0 |
tests/test_shared.py | StephanEggermont/python-pptx | 1,429 | 3251561 | # encoding: utf-8
"""Unit-test suite for `pptx.shared` module."""
import pytest
from pptx.opc.package import XmlPart
from pptx.shared import ElementProxy, ParentedElementProxy
from .unitutil.cxml import element
from .unitutil.mock import instance_mock
class DescribeElementProxy(object):
"""Unit-test suite for... | 0 | 6 | 0 | 0 | 6 | 0 |
examples/multiobjective/smpso/smpsorp_zdt4.py | 12yuens2/jMetalPy | 335 | 3251600 | <gh_stars>100-1000
from jmetal.lab.visualization import Plot, InteractivePlot
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file, read_solutions
from jmetal.util.termination_criterion import StoppingByEvaluati... | 0 | 0 | 0 | 0 | 0 | 0 |
django_linter/checkers/misc.py | enefeq/django_linter | 101 | 3251601 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import Name
from ..__pkginfo__ import BASE_ID
class MiscChecker(BaseChecker):
__implements__ = IAstroidC... | 0 | 0 | 2 | 0 | 2 | 0 |
examples/clusterman_metrics/clusterman_metrics/util/constants.py | akshaysharma096/clusterman | 281 | 3251651 | # Copyright 2019 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.