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 |
|---|---|---|---|---|---|---|---|---|---|---|
bakery/feeds.py | j-e-d/django-bakery | 314 | 1751493 | from __future__ import annotations
import os
import six
import logging
from django.conf import settings
from bakery.views import BuildableMixin
from django.contrib.syndication.views import Feed
logger = logging.getLogger(__name__)
class BuildableFeed(Feed, BuildableMixin):
"""
Extends the base Django Feed cla... | 2 | 4 | 1 | 0 | 7 | 0 |
safety/tests/base.py | ulule/django-safety | 157 | 1751494 | # -*- coding: utf-8 -*-
from __future__ import annotations
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.timezone import now
from exam.cases import Exam
from exam.decorators import fixture
from safety.models import Session
f... | 1 | 2 | 4 | 0 | 7 | 0 |
office365/onedrive/driveitems/thumbnail_set.py | rikeshtailor/Office365-REST-Python-Client | 544 | 1751502 | from office365.entity import Entity
from office365.onedrive.driveitems.thumbnail import Thumbnail
class ThumbnailSet(Entity):
"""The ThumbnailSet resource is a keyed collection of thumbnail resources.
It is used to represent a set of thumbnails associated with a DriveItem."""
@property
def large(self... | 0 | 4 | 0 | 0 | 4 | 0 |
tools/perf/benchmarks/page_cycler_v2.py | google-ar/chromium | 777 | 1751511 | # Copyright 2016 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.
"""The page cycler v2.
For details, see design doc:
https://docs.google.com/document/d/1EZQX-x3eEphXupiX-Hq7T4Afju5_sIdxPWYetj7ynd0
"""
from core import pe... | 0 | 23 | 1 | 0 | 24 | 0 |
tensorflow_privacy/privacy/bolt_on/models_test.py | amad-person/privacy | 2,327 | 1751562 | # Copyright 2019, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 3 | 13 | 0 | 0 | 16 | 0 |
importlab/output.py | KGerring/importlab | 130 | 1751601 | from __future__ import print_function
import networkx as nx
from . import graph
from . import resolve
def inspect_graph(import_graph):
keys = set(x[0] for x in import_graph.graph.edges)
for key in sorted(keys):
k = import_graph.format(key)
for _, value in sorted(import_graph.graph.edges([key... | 1 | 5 | 0 | 0 | 6 | 0 |
release/tune_tests/scalability_tests/workloads/test_durable_trainable.py | 77loopin/ray | 21,382 | 1751616 | """Durable trainable (16 trials, checkpoint to cloud)
In this run, we will start 16 trials on a cluster. The trials create
10 MB checkpoints every 10 seconds and should only keep 2 of these. This test
ensures that durable checkpoints don't slow down experiment progress too much.
Cluster: cluster_16x2.yaml
Test owner... | 0 | 0 | 0 | 0 | 0 | 0 |
pystiche/image/__init__.py | dooglewoogle/pystiche | 129 | 1751622 | <reponame>dooglewoogle/pystiche<filename>pystiche/image/__init__.py<gh_stars>100-1000
from .utils import *
from .io import *
from .guides import *
| 0 | 0 | 0 | 0 | 0 | 0 |
liota/disc_listeners/socket_svr.py | swatishs/liota | 361 | 1751626 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------#
# Copyright © 2015-2016 VMware, Inc. All Rights Reserved. #
# #
# Licensed under the BSD 2-Clause License (the “License... | 0 | 0 | 0 | 0 | 0 | 0 |
internal/core/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py | chriswarnock/milvus | 10,504 | 1751627 | # 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.
#! /usr/bin/env python3
from __future__ import print_function
import numpy as np
import faiss
import time
import os
import argparse
parser ... | 0 | 0 | 0 | 0 | 0 | 0 |
dfirtrack_main/views/case_views.py | stuhli/dfirtrack | 273 | 1751628 | <gh_stars>100-1000
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils import timezone
from django.views.generic import DetailView, ListView
from django.views.generic.edit import Cre... | 0 | 0 | 0 | 0 | 0 | 0 |
src/resources/clients/python_client/viewermethods.py | visit-dav/vis | 226 | 1751629 | <gh_stars>100-1000
import sys
import inspect
import base64
if (sys.version_info > (3, 0)):
import io
else:
import cStringIO as io
from viewerstate import *
from visitstate import RPCType as RPC
class ViewerMethods:
def __init__(self,_state):
self.state = _state
def sync(self):
gmap = s... | 0 | 0 | 0 | 0 | 0 | 0 |
vega/metrics/pytorch/__init__.py | jie311/vega | 724 | 1751630 | from .metrics import Metrics
from vega.common.class_factory import ClassFactory
ClassFactory.lazy_register("vega.metrics.pytorch", {
"lane_metric": ["trainer.metric:LaneMetric"],
"regression": ["trainer.metric:MSE", "trainer.metric:mse"],
"detection_metric": ["trainer.metric:CocoMetric", "trainer.metric:co... | 0 | 0 | 0 | 0 | 0 | 0 |
mGui/core/progress.py | theodox/mGui | 105 | 1751650 | from __future__ import annotations
import sys
import maya.cmds as cmds
from mGui.core import Control
import maya.mel as mel
class UserCancelledProgress(RuntimeError):
pass
class ProgressBar(Control):
"""
mGui style wrapper for ProgressBar
Use start() and end() to avoid the cumbersome (cmds.progress... | 12 | 2 | 3 | 0 | 17 | 0 |
blender_bindings/source1/bsp/entities/bms_entity_classes.py | anderlli0053/SourceIO | 199 | 1751712 |
from __future__ import annotations
def parse_source_value(value) -> int | object:
if type(value) is str:
value: str
if value.replace('.', '', 1).replace('-', '', 1).isdecimal():
return float(value) if '.' in value else int(value)
return 0
else:
return value
def par... | 1 | 2,537 | 223 | 0 | 2,761 | 0 |
release/stubs.min/Rhino/Geometry/__init___parts/SurfaceCurvature.py | htlcnn/ironpython-stubs | 182 | 1751745 | class SurfaceCurvature(object):
""" Maintains computed information for surface curvature evaluation. """
def Direction(self,direction):
"""
Direction(self: SurfaceCurvature,direction: int) -> Vector3d
Gets the principal curvature direction vector.
direction: Direction index,valid value... | 0 | 0 | 0 | 0 | 0 | 0 |
src/prompt_toolkit/eventloop/dummy_contextvars.py | jonathanslenders/python-prompt-toolkit | 4,028 | 1751755 | """
Dummy contextvars implementation, to make prompt_toolkit work on Python 3.6.
As long as there is only one application running at a time, we don't need the
real contextvars. So, stuff like the telnet-server and so on requires 3.7.
"""
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, TypeVar
if T... | 8 | 8 | 0 | 0 | 16 | 0 |
pythreejs/core/Geometry.py | aliddell/pythreejs | 451 | 1751779 | <filename>pythreejs/core/Geometry.py<gh_stars>100-1000
from ipywidgets import register
from .Geometry_autogen import Geometry as AutogenGeometry
from .._base.Three import ThreeWidget
@register
class Geometry(AutogenGeometry):
@classmethod
def from_geometry(cls, geometry, store_ref=False):
"""Creates ... | 0 | 0 | 0 | 0 | 0 | 0 |
Assets/Script/python/Test1.py | wenanlee/Unity-Python | 101 | 1751787 | import UnityEngine as u
class Test1():
def Awake(self, this):
u.Debug.Log("Awake Method")
pass
def Start(self, this):
u.Debug.Log("Start Method")
pass
def Update(self, this):
this.transform.Rotate(u.Vector3(2,2,1)) | 0 | 0 | 0 | 0 | 0 | 0 |
bindings/pydeck/docs/scripts/utils.py | StijnAmeloot/deck.gl | 7,702 | 1751832 | <reponame>StijnAmeloot/deck.gl
import os
def to_presentation_name(s):
"""Convert a snake_case string to a camelCase string (if a layer or view)
or just a standard title"""
# Format deck.gl layer names from their file names
if "layer" in s or "view" in s:
return s.replace("_", " ").title().repl... | 0 | 0 | 0 | 0 | 0 | 0 |
conans/test/functional/graph_lock/lock_install_test.py | Wonders11/conan | 6,205 | 1751834 | from conans.test.utils.tools import TestClient, GenConanfile
def test_install():
client = TestClient()
client.save({"conanfile.py": GenConanfile("pkga", "0.1").with_package_file("file.h", "0.1")})
client.run("create . user/channel")
# Use a consumer with a version range
client.save({"conanfile.py... | 0 | 0 | 0 | 0 | 0 | 0 |
cirq-core/cirq/optimizers/drop_negligible_test.py | dabacon/Cirq | 3,326 | 1751846 | # Copyright 2018 The Cirq Developers
#
# 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 ... | 2 | 0 | 0 | 0 | 2 | 0 |
plugin/CustomerSupportArchive/Lane_Diagnostics/tools/efuse.py | iontorrent/TS | 125 | 1751847 | # python2 and python3 compatible
class EfuseClass:
""" A class for parsing efuses """
normal: tuple[str, str, str, str, str, str, str, str, str, str, str, str, str] = ('lot','wafer','assembly','part','comment','flowcell','y' ,'x' ,'bin','noise','softbin','chiptype','barcode')
codes: tuple[str, str, str, str... | 0 | 0 | 2 | 0 | 2 | 0 |
mozillians/phonebook/cron.py | divyamoncy/mozillians | 202 | 1751907 | from django.contrib.auth.models import User
import commonware.log
import cronjobs
from models import Invite
log = commonware.log.getLogger('m.cron')
@cronjobs.register
def invite(filename):
f = open(filename)
for addr in f.xreadlines():
addr = addr.strip()
invites = Invite.objects.filter(re... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/kinect/kinectviewer.py | Galland/kivy | 13,889 | 1751916 | <gh_stars>1000+
import freenect
from time import sleep
from threading import Thread
from collections import deque
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import NumericProperty, StringProperty
from kivy.graphics import RenderContext, Color, Rectangle
from kivy.graphics.texture import ... | 0 | 0 | 0 | 0 | 0 | 0 |
appimagebuilder/modules/generate/package_managers/apt/file_package_resolver.py | goldstar611/appimage-builder | 155 | 1751947 | # Copyright 2021 <NAME>
#
# 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 restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute... | 0 | 3 | 0 | 0 | 3 | 0 |
fas_sgtd_multi_frame/generate_data_train.py | matineh24/FAS-SGTD | 210 | 1751949 | <gh_stars>100-1000
import numpy as np
import tensorflow as tf
from PIL import Image
from FLAGS import flags
from util.util_dataset import *
import glob
import os
import cv2
import datetime
import random
import scipy.io as sio
#print(flags.paras.padding_info)
Dataset=tf.data.Dataset
suffix1='scene.jpg'
suffix2='de... | 0 | 0 | 0 | 0 | 0 | 0 |
model-experiments/token-based-similarity-classification/src/PostProcessor/MapAtR.py | yingkitw/Project_CodeNet | 1,156 | 1751984 | """
Program for computing MAP at R metric
using matrix of predicted similarity strength for all sample pairs
Input data are expected to be in the form of two pickled files:
- problem_indices.pcl -- specifies indices of tested problem
for each similarity test experiment
- s... | 0 | 1 | 0 | 0 | 1 | 0 |
scripts/models/wider_resnet.py | hluedemann/inplace_abn | 1,288 | 1751994 | import sys
from collections import OrderedDict
from functools import partial
import torch.nn as nn
from inplace_abn import ABN
from modules import IdentityResidualBlock, GlobalAvgPool2d
class WiderResNet(nn.Module):
def __init__(self,
structure,
norm_act=ABN,
c... | 3 | 2 | 0 | 0 | 5 | 0 |
geopandas/explore.py | cloudscenes/geopandas | 2,914 | 1752027 | from statistics import mean
import geopandas
from shapely.geometry import LineString
import numpy as np
import pandas as pd
_MAP_KWARGS = [
"location",
"prefer_canvas",
"no_touch",
"disable_3d",
"png_enabled",
"zoom_control",
"crs",
"zoom_start",
"left",
"top",
"position",
... | 0 | 0 | 0 | 0 | 0 | 1 |
scripts/check-package-naming.py | Costallat/hunter | 440 | 1752063 | #!/usr/bin/env python3
# Copyright (c) 2019, <NAME>
# All rights reserved.
from __future__ import annotations
import argparse
import os
import re
import shutil
import tempfile
import git
# Returns False if there was an error.
def checkPackageName(queriedPackageName, performFix: bool=False) -> bool | object:
if no... | 1 | 1 | 0 | 0 | 2 | 0 |
sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/models/_azure_orbital_enums.py | vincenttran-msft/azure-sdk-for-python | 2,728 | 1752071 | <gh_stars>1000+
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
sympy/core/benchmarks/bench_basic.py | iamabhishek0/sympy | 445 | 1752097 | from __future__ import print_function, division
from sympy.core import symbols, S
x, y = symbols('x,y')
def timeit_Symbol_meth_lookup():
x.diff # no call, just method lookup
def timeit_S_lookup():
S.Exp1
def timeit_Symbol_eq_xy():
x == y
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_visitors/test_ast/test_imports/test_relative_imports.py | cdhiraj40/wemake-python-styleguide | 1,931 | 1752107 | import pytest
from wemake_python_styleguide.violations.consistency import (
LocalFolderImportViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
# Wrong:
same_level_relative_import = 'from . import some_thing'
same_level_relative_import_sibling = 'from .some_thing import MyCl... | 0 | 0 | 0 | 0 | 0 | 0 |
support/distribute/binbuild/shell/customize/sitecustomize.py | rknop/amuse | 131 | 1752109 | <gh_stars>100-1000
import sys
import os.path
from io import StringIO
from amuse.support import options
amuserc_template = """
[data]
input_data_root_directory={0}
"""
def setup_directories():
if not options.GlobalOptions.INSTANCE is None:
options.GlobalOptions.INSTANCE = None
input_data_root_dir... | 0 | 0 | 0 | 0 | 0 | 0 |
matchzoo/modules/bert_module.py | Ambitioner-c/MatchZoo-py | 468 | 1752123 | <reponame>Ambitioner-c/MatchZoo-py<filename>matchzoo/modules/bert_module.py
"""Bert module."""
import typing
import torch
import torch.nn as nn
from pytorch_transformers import BertModel
class BertModule(nn.Module):
"""
Bert module.
BERT (from Google) released with the paper BERT: Pre-training of Deep
... | 0 | 0 | 0 | 0 | 0 | 0 |
desktop_local_tests/windows/test_windows_packet_capture_disrupt_wifi_power.py | UAEKondaya1/expressvpn_leak_testing | 219 | 1752125 | from desktop_local_tests.local_packet_capture_test_case_with_disrupter import LocalPacketCaptureTestCaseWithDisrupter
from desktop_local_tests.windows.windows_wifi_power_disrupter import WindowsWifiPowerDisrupter
class TestWindowsPacketCaptureDisruptWifiPower(LocalPacketCaptureTestCaseWithDisrupter):
'''Summary:
... | 0 | 0 | 0 | 0 | 0 | 0 |
bluezero/device.py | garretthagen21/bluepi | 296 | 1752130 | <reponame>garretthagen21/bluepi<filename>bluezero/device.py
"""Class and methods that represent a remote Bluetooth Device.
Classes:
- Device -- Remote Bluetooth Device Class
"""
import dbus
import dbus.exceptions
from bluezero import constants
from bluezero import dbus_tools
import bluezero.adapter
from bluezero imp... | 0 | 0 | 0 | 0 | 0 | 0 |
web_console_v2/api/test/fedlearner_webconsole/utils/metrics_test.py | Hsy-Intel/fedlearner | 772 | 1752135 | <reponame>Hsy-Intel/fedlearner<gh_stars>100-1000
# Copyright 2021 The FedLearner 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/li... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_gcp/logging/metric.py | sisisin/pulumi-gcp | 121 | 1752137 | <reponame>sisisin/pulumi-gcp<gh_stars>100-1000
# 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, Opt... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tinyusdz/Usd/__init__.py | GermanAizek/tinyusdz | 159 | 1752146 | <filename>python/tinyusdz/Usd/__init__.py
from . import Stage
| 0 | 0 | 0 | 0 | 0 | 0 |
detectron2/export/api.py | wangyidong3/detectron2 | 377 | 1752167 | from __future__ import annotations
import logging
import os
import torch
from caffe2.proto import caffe2_pb2
from torch import nn
from detectron2.config import CfgNode as CN
from .caffe2_export import export_caffe2_detection_model, run_and_save_graph
from .caffe2_inference import ProtobufDetectionModel
from .caffe2_m... | 1 | 6 | 0 | 1 | 8 | 0 |
examples/text_to_sql/RAT-SQL/text2sql/optim.py | JeremyZhao1998/PaddleNLP | 7,091 | 1752199 | <reponame>JeremyZhao1998/PaddleNLP
# 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/LIC... | 0 | 0 | 0 | 0 | 0 | 0 |
Imaging/Core/Testing/Python/TestMapToRGBABlockStreaming.py | forestGzh/VTK | 1,755 | 1752211 | <reponame>forestGzh/VTK
#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
vtk.vtkMultiThreader.SetGlobalMaximumNumberOfThreads(1)
reader = vtk.vtkImageReader()
reader.SetDataByteOrderToLittleEndian()
reader.SetDataExtent(0,63,0,63,1,93)
reader.SetDataSpacing(3.... | 0 | 0 | 0 | 0 | 0 | 0 |
infinite_nature/config.py | DionysisChristopoulos/google-research | 23,901 | 1752219 | # coding=utf-8
# Copyright 2021 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-2.0
#
# Unless required by applicab... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/testing_module/test_hooks.py | sirhc/taskcat | 920 | 1752233 | import unittest
from pathlib import Path
from unittest.mock import MagicMock, patch
from taskcat import Config
from taskcat.exceptions import TaskCatException
from taskcat.testing import CFNTest
def get_config() -> object:
project_root_path = Path(__file__).parent / "../data/hook_plugin"
input_file_path = pr... | 6 | 1 | 0 | 0 | 7 | 0 |
examples/datasets/plot_rrlyrae_mags.py | aragilar/astroML | 735 | 1752239 | <reponame>aragilar/astroML
"""
RR-Lyrae Magnitudes
-------------------
This example downloads and plots the colors of RR Lyrae stars along with those
of the non-variable stars. Several of the classification examples in the
book figures use this dataset.
"""
# Author: <NAME> <<EMAIL>>
# License: BSD
# The figure is a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils/test_logging_utils.py | PeterSulcs/mlflow | 10,351 | 1752247 | <reponame>PeterSulcs/mlflow
import logging
import sys
import pytest
import mlflow
import mlflow.utils.logging_utils as logging_utils
from mlflow.utils.logging_utils import eprint
logger = logging.getLogger(mlflow.__name__)
LOGGING_FNS_TO_TEST = [logger.info, logger.warning, logger.critical, eprint]
@pytest.fixture... | 0 | 0 | 0 | 0 | 0 | 0 |
codigo/Live22/pyjobs.py | cassiasamp/live-de-python | 572 | 1752253 | <reponame>cassiasamp/live-de-python<filename>codigo/Live22/pyjobs.py
from collections import namedtuple
from pprint import pprint
from bs4 import BeautifulSoup as bs
from requests import get
def get_last_page(url: str) -> str:
pyjobs = get(url)
pyjobs_page = bs(pyjobs.text, 'html.parser')
links = pyjobs_p... | 0 | 0 | 0 | 0 | 0 | 0 |
macgraph/cell/messaging_cell_test.py | Octavian-ai/mac-graph | 116 | 1752316 | import unittest
import tensorflow as tf
tf.enable_eager_execution()
import numpy as np
import math
import random
from .messaging_cell import *
class TestMessagingCell(unittest.TestCase):
def test_basic_write(self) -> object:
args = {
"mp_state_width": 2,
"kb_node_max_len": 23,
... | 0 | 2 | 0 | 0 | 2 | 0 |
operators/example-custom-operator/server.py | AmyYH/phantoscope | 144 | 1752341 | import os
import logging
import grpc
from concurrent import futures
import rpc.rpc_pb2
import rpc.rpc_pb2_grpc
from custom_operator import CustomOperator as Operator
ENDPOINT = os.getenv("OP_ENDPOINT", "127.0.0.1:80")
class OperatorServicer(rpc.rpc_pb2_grpc.OperatorServicer):
def __init__(self):
self.ope... | 0 | 3 | 0 | 0 | 3 | 0 |
cvnets/models/classification/config/vit.py | apple/ml-cvnets | 209 | 1752343 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
from typing import Dict
from utils import logger
def get_configuration(opts) -> Dict:
mode = getattr(opts, "model.classification.vit.mode", "tiny")
if mode is None:
logger.error("Please specify mo... | 0 | 1 | 0 | 0 | 1 | 0 |
watson/management/commands/__init__.py | forkhammer/django-watson | 892 | 1752352 | """Management commands used by django-watson."""
from __future__ import unicode_literals
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/simple-workspace/my-project/src/main.py | fosskers/tab-rs | 600 | 1752378 | <filename>examples/simple-workspace/my-project/src/main.py
for i in range(0, 30):
time.sleep(1.0)
print("Hello!")
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/tables/azure-data-tables/tests/perfstress_tests/_base.py | rsdoherty/azure-sdk-for-python | 2,728 | 1752410 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 1 | 2 | 0 | 3 | 0 |
scenic/dataset_lib/big_transfer/builder.py | Forbu/scenic | 688 | 1752415 | # Copyright 2022 The Scenic Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 2 | 2 | 0 | 0 | 4 | 0 |
imiss-django-master/imiss/imiss/category/model_tool.py | WiitterSimithYU/-scollview-imissMusic | 121 | 1752421 | <reponame>WiitterSimithYU/-scollview-imissMusic
import uuid
import os
# 管理平台上传图片
def user_directory_path(instance, filename):
ext = filename.split('.')[-1]
filename = '{}.{}'.format(uuid.uuid4().hex[:10], ext)
str = os.path.join("music", filename)
return str
# 保存APP上传的图片
def upload_image(f, song):
... | 0 | 0 | 0 | 0 | 0 | 0 |
pr/binary_model_evaluation/evaluation_example_code.py | GaoX2015/intro_ds | 314 | 1752514 | <reponame>GaoX2015/intro_ds
# -*- coding: UTF-8 -*-
"""
此脚本用于展示二分类问题的不同评估指标
"""
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import metrics
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
def transL... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/examples/OpenMV/03-Drawing/image_drawing_advanced.py | jiskra/openmv | 1,761 | 1752558 | <reponame>jiskra/openmv
# Draw Image Testing script with bounce
#
# Exercise draw image with many different values for testing
import sensor, image, time, pyb
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE...
sensor.set_framesize(sensor.QVGA) # or QQVGA...
sensor.skip_frames(time = 2000)
clock = ti... | 0 | 0 | 0 | 0 | 0 | 0 |
solutions/LeetCode/Python3/30.py | timxor/leetcode-journal | 854 | 1752564 | __________________________________________________________________________________________________
48ms
class Solution:
def findSubstring(self, s, words):
"""
:type s: str
:type words: List[str]
:rtype: List[int]
"""
if not s or words==[]:
return []
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/syntax/assign_to_function_call_2.py | matan-h/friendly | 287 | 1752589 | <reponame>matan-h/friendly<filename>tests/syntax/assign_to_function_call_2.py<gh_stars>100-1000
"""Should raise SyntaxError: can't assign to function call
Python 3.8: SyntaxError: cannot assign to function call
"""
func(a, b=3) = 4
| 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin.mock/packages/multimethod-diamond-parent/package.py | kkauder/spack | 2,360 | 1752593 | <filename>var/spack/repos/builtin.mock/packages/multimethod-diamond-parent/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.pkg.builtin.mock.multimet... | 0 | 0 | 0 | 0 | 0 | 0 |
torchtext/utils.py | pmeier/text | 3,172 | 1752623 | from __future__ import annotations
import torch
import csv
import hashlib
import os
import tarfile
import logging
import sys
import zipfile
import gzip
from ._download_hooks import _DATASET_DOWNLOAD_MANAGER
from torchtext import _CACHE_DIR
def reporthook(t) -> object:
"""
https://github.com/tqdm/tqdm.
"""... | 12 | 5 | 0 | 0 | 17 | 0 |
tensorstore/generate_interval_slice_overloads.py | google/tensorstore | 106 | 1752653 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2020 The TensorStore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test-cases/with_stmt_case.py | SMAT-Lab/Scalpel | 102 | 1752664 | import os
import numpy as np
import sys, unicodedata
# In[2]:
tbl = dict.fromkeys(i for i in range(sys.maxunicode)
if unicodedata.category(chr(i)).startswith('P'))
# In[4]:
for root,dirs, files in os.walk('tsv_files/'):
tsv_list = [file for file in files if file[-3:]=="tsv"]
whole_class_info=[[]... | 0 | 0 | 0 | 0 | 0 | 0 |
bzt/environment_helpers.py | Avi-Labs/taurus | 1,743 | 1752665 | <reponame>Avi-Labs/taurus
import re
import os
VARIABLE_EXPAND_DEPTH = 2
def expand_envs_with_os(envs):
for var_name in envs:
if envs[var_name] is not None:
envs[var_name] = expand_variable_with_os(envs[var_name])
return envs
def expand_variable_with_os(variable):
for i in range(VARI... | 0 | 0 | 0 | 0 | 0 | 0 |
maskrcnn_benchmark/data/datasets/utils/load_files.py | SkrighYZ/scene_graph_benchmark | 210 | 1752674 | <filename>maskrcnn_benchmark/data/datasets/utils/load_files.py
# Copyright (c) 2021 Microsoft Corporation. Licensed under the MIT license.
import json
import os
import os.path as op
import errno
import yaml
from collections import OrderedDict
def load_labelmap_file(labelmap_file):
label_dict = None
... | 0 | 0 | 0 | 0 | 0 | 0 |
cmsplugin_cascade/migrations/0002_auto_20150530_1018.py | teklager/djangocms-cascade | 139 | 1752692 | from django.db import models, migrations
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('cmsplugin_cascade', '0001_initial'),
]
operations: list[object] = [
migrations.CreateModel(
name='Segmentation',
fields=[
('id... | 0 | 0 | 2 | 0 | 2 | 0 |
simulation&control/webots_ros/source/catkin_webots_demo/src/webots_controller/scripts/8_iu_sensor_ros_controller.py | Hinson-A/guyueclass | 227 | 1752703 | <filename>simulation&control/webots_ros/source/catkin_webots_demo/src/webots_controller/scripts/8_iu_sensor_ros_controller.py
#!/usr/bin/env python
# _*_ coding:UTF-8 _*_
# Author:罗伯特祥
import rospy
import math
import tf
from std_msgs.msg import String
from webots_ros.srv import set_float
from webots_ros.srv import set_... | 0 | 0 | 0 | 0 | 0 | 0 |
lightkurve/prf/__init__.py | JoseALermaIII/lightkurve | 235 | 1752706 | <filename>lightkurve/prf/__init__.py
from .prfmodel import *
from .tpfmodel import *
| 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/rclpy/service/client-stress-test.py | mattrichard/rclnodejs | 193 | 1752719 | <filename>benchmark/rclpy/service/client-stress-test.py<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2018 Intel Corporation. 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
client/libs/logdog/varint.py | maruel/swarming | 14,668 | 1752733 | <reponame>maruel/swarming
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import os
import struct
import sys
def write_uvarint(w, val):
"""Writes a varint value to the supplied file-like obj... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/west_commands/run_tests.py | maxvankessel/zephyr | 6,224 | 1752743 | #!/usr/bin/env python3
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
# A convenience script provided for running tests on the runners
# package. Runs mypy and pytest. Any extra arguments in sys.argv are
# passed along to pytest.
#
# Using tox was considered, but rejected as ove... | 0 | 0 | 0 | 0 | 0 | 0 |
vcsi/__init__.py | riganf/vcsi | 283 | 1752745 | def main():
import vcsi.vcsi
vcsi.vcsi.main()
| 0 | 0 | 0 | 0 | 0 | 0 |
packages/pyright-internal/src/tests/samples/genericTypes53.py | sasano8/pyright | 4,391 | 1752779 | # This sample tests situations where bidirectional type inference
# influences the type of a generic function call.
from typing import Callable, Iterable, List, Literal, TypeVar
_T = TypeVar("_T")
def func1(arg: _T) -> _T:
return arg
v1: Literal["test"] = func1("test")
x: List[Literal["test"]] = ["test"]
v2... | 4 | 3 | 8 | 0 | 15 | 0 |
pygccxml/declarations/elaborated_info.py | RoyVorster/pygccxml | 945 | 1752784 | <reponame>RoyVorster/pygccxml
# Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
class elaborated_info(object):
"""
This class stores the name of the elaborated type specifier.... | 0 | 0 | 0 | 0 | 0 | 0 |
sleekxmpp/stanza/htmlim.py | E-Tahta/sleekxmpp | 499 | 1752791 | <gh_stars>100-1000
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 <NAME>
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.stanza import Message
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins.xep_0071 import XHTML_... | 0 | 0 | 0 | 0 | 0 | 0 |
applications/MultilevelMonteCarloApplication/external_libraries/PyCOMPSs/exaqute/local/functions.py | lkusch/Kratos | 778 | 1752840 | from exaqute.common import ExaquteException
from .internals import (
ValueWrapper,
_check_accessed,
_check_init,
_delete_accessed,
_init,
_submit_point,
)
def init():
_init()
def get_value_from_remote(obj) -> object:
_check_init()
_submit_point()
t = type(obj)
if t is li... | 0 | 1 | 0 | 0 | 1 | 0 |
data/task_scripts/main/task00311.py | aallaire91/phyre | 432 | 1752845 | <filename>data/task_scripts/main/task00311.py<gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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.or... | 0 | 0 | 0 | 0 | 0 | 0 |
bot/utils/halloween/spookifications.py | hedyhli/pydis-lance | 122 | 1752851 | import logging
from random import choice, randint
from PIL import Image, ImageOps
log = logging.getLogger()
def inversion(im: Image) -> Image:
"""
Inverts the image.
Returns an inverted image when supplied with an Image object.
"""
im = im.convert("RGB")
inv = ImageOps.invert(im)
return... | 4 | 4 | 0 | 0 | 8 | 0 |
tools/add_image_pull_policy.py | r0ck3rt/metarget | 295 | 1752901 | #!python3
import yaml
import glob
vuln_files = glob.glob('../vulns_app/*/*/*-deployment.yaml', recursive=False)
for vf in vuln_files:
with open(vf, 'r') as f:
vuln = yaml.load(f, Loader=yaml.SafeLoader)
with open(vf, 'w') as f:
vuln['spec']['template']['spec']['containers'][0]['imagePullPoli... | 0 | 0 | 0 | 0 | 0 | 0 |
pythonx/validator/api.py | maralla/validator.vim | 255 | 1752906 | import functools
import vim
from . import load_checkers
from .utils import to_unicode
def _api(func) -> object:
@functools.wraps(func)
def wrapper() -> object:
return func(vim.bindeval('a:'))
return wrapper
@_api
def get_checkers(args) -> object:
loaded = load_checkers(args['ft'])
check... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/test_mysql.py | JordonPhillips/pygments | 940 | 1752911 | <reponame>JordonPhillips/pygments
"""
Pygments MySQL lexer tests
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.lexers.sql import MySqlLexer
from pygments.token import Comment, Keyw... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/www/unsubscribe.py | sleepingAnt/viewfinder | 645 | 1752913 | <filename>backend/www/unsubscribe.py
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Handler for unsubscribing to email alerts.
Emails that we send contain a link that allows the recipient to unsubscribe to future emails.
The handler only supports GET requests, since POST updates are not supported by email.
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/suite/categories.py | Udbhavbisarya23/owtf | 1,514 | 1752918 | <reponame>Udbhavbisarya23/owtf
"""
tests.suite.categories
~~~~~~~~~~~~~~~~~~~~~~
Test categories.
"""
from tests.functional.cli.test_empty_run import OWTFCliEmptyRunTest
from tests.functional.cli.test_list_plugins import OWTFCliListPluginsTest
from tests.functional.cli.test_nowebui import OWTFCliNoWebUITest
from tests... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/modules/user/models/user.py | Bension/osroom | 579 | 1752928 | #!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : <NAME>
from __future__ import annotations
import time
from werkzeug.security import generate_password_hash
from apps.core.utils.get_config import get_config
def user_model(**kwargs) -> object | None:
"""
Provide parameters, ... | 0 | 1 | 0 | 0 | 1 | 0 |
llvm-external-projects/iree-compiler-api/unittests/tools/compiler_tflite_test.py | smit-hinsu/iree | 1,163 | 1752942 | <filename>llvm-external-projects/iree-compiler-api/unittests/tools/compiler_tflite_test.py<gh_stars>1000+
# Lint as: python3
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.... | 0 | 0 | 0 | 0 | 0 | 0 |
MainUI.py | neeru1207/AISudoku | 980 | 1752950 | <filename>MainUI.py
'''
The Main UI File that controls and executes all the other files.
'''
from tkinter import *
from PIL import ImageTk, Image
from tkinter import messagebox, filedialog
from RecognizeAndConstructBoard import ConstructGrid
from BoardExtractor import BoardExtractor
from SudokuSolver import Solver
impo... | 0 | 0 | 0 | 0 | 0 | 0 |
rasterio/rio/transform.py | nmandery/rasterio | 1,479 | 1752963 | <gh_stars>1000+
"""Fetch and edit raster dataset metadata from the command line."""
import json
import logging
import click
from cligj import precision_opt
import rasterio.shutil
@click.command(short_help="Transform coordinates.")
@click.argument('INPUT', default='-', required=False)
@click.option('--src-crs', '--... | 0 | 0 | 0 | 0 | 0 | 0 |
djangox/lib/python3.8/site-packages/requests_oauthlib/compliance_fixes/weibo.py | DemarcusL/django_wiki_lab | 1,263 | 1752968 | <reponame>DemarcusL/django_wiki_lab<filename>djangox/lib/python3.8/site-packages/requests_oauthlib/compliance_fixes/weibo.py<gh_stars>1000+
from json import loads, dumps
from oauthlib.common import to_unicode
def weibo_compliance_fix(session):
def _missing_token_type(r):
token = loads(r.text)
tok... | 0 | 0 | 0 | 0 | 0 | 0 |
kws_streaming/models/inception.py | DionysisChristopoulos/google-research | 23,901 | 1752987 | <reponame>DionysisChristopoulos/google-research<filename>kws_streaming/models/inception.py
# coding=utf-8
# Copyright 2021 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 Li... | 0 | 0 | 0 | 0 | 0 | 0 |
HVAC Controller/hvaccontrol.py | Silenoz93/RaspberryPiThermostat | 160 | 1753007 | #!/usr/bin/python
########################################################################################################################
#
# RasPi Smart HVAC
# Written by <NAME> - http://willseph.com/
#
##################################################################################################################... | 0 | 0 | 0 | 0 | 0 | 0 |
context_menu/linux_menus.py | saleguas/context_menu | 301 | 1753038 | <filename>context_menu/linux_menus.py
# imports -------------------------------------------------
import os
from enum import Enum
# code_preset.py -------------------------------------
class ExistingCode(Enum):
'''
Preset values important for metaprogramming.
'''
CODE_HEAD = '''
import gi
import sys... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdet2trt/models/roi_heads/bbox_heads/__init__.py | tehkillerbee/mmdetection-to-tensorrt | 496 | 1753048 | <reponame>tehkillerbee/mmdetection-to-tensorrt
from .bbox_head import BBoxHeadWraper
from .double_bbox_head import DoubleConvFCBBoxHeadWraper
from .sabl_head import SABLHeadWraper
__all__ = ['BBoxHeadWraper', 'DoubleConvFCBBoxHeadWraper', 'SABLHeadWraper']
| 0 | 0 | 0 | 0 | 0 | 0 |
neutron/extensions/security_groups_shared_filtering_lib.py | congnt95/neutron | 1,080 | 1753055 | <gh_stars>1000+
# 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 | 0 | 0 | 0 | 0 | 0 |
perma_web/perma/settings/deployments/settings_dev.py | rachelaus/perma | 317 | 1753092 | <gh_stars>100-1000
from .settings_common import *
import os
DEBUG = True
#
# HOSTS
#
HOST = 'perma.test:8000'
PLAYBACK_HOST = 'perma-archives.test:8092'
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS ... | 0 | 0 | 0 | 0 | 0 | 0 |
dnachisel/MutationSpace/MutationChoice.py | simone-pignotti/DnaChisel | 124 | 1753125 | from __future__ import annotations
from ..biotools import windows_overlap
import itertools
import numpy as np
class MutationChoice:
"""Represent a segment of a sequence with several possible variants.
Parameters
----------
segment
A pair (start, end) indicating the range of nucleotides concern... | 1 | 5 | 1 | 0 | 7 | 0 |
observations/r/drinks_wages.py | hajime9652/observations | 199 | 1753140 | # -*- 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 drinks_wages(path) -> tuple[object, object]:
"""Elderton and Pearson'... | 0 | 1 | 0 | 0 | 1 | 0 |
burness/0016/txt2xls3.py | saurabh896/python-1 | 3,976 | 1753146 | <reponame>saurabh896/python-1<filename>burness/0016/txt2xls3.py
#-*- coding: utf-8-*-
import xlwt3
import json
def txt_to_xls(txt_file):
with open(txt_file,'r') as f:
# print(f)
file_content = json.load(f)
print(file_content)
print(file_content[0])
xls_workbook = xlwt3.Workbook()
xls_sheet = xls_workbook... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python/mod_python/util.py | Datatope/mod_python | 183 | 1753148 | # vim: set sw=4 expandtab :
#
# Copyright (C) 2000, 2001, 2013 <NAME>
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation
#
# 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 t... | 8 | 34 | 12 | 1 | 55 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.