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 |
|---|---|---|---|---|---|---|---|---|---|---|
framework/boards/HEXBADGE.py | leeeastwood/Haiway | 162 | 152149 | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.o... | 0 | 1 | 0 | 0 | 1 | 0 |
alipay/aop/api/domain/AlipayDataDataservicePropertyBusinesspropertyModifyModel.py | antopen/alipay-sdk-python-all | 213 | 152173 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayDataDataservicePropertyBusinesspropertyModifyModel(object):
def __init__(self):
self._biz_owner_id = None
self._business_profile_cate... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/make_ceph_disk_list.py | mbaldessari/tripleo-heat-templates-1 | 135 | 152176 | <gh_stars>100-1000
#!/usr/bin/env python3
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
utils_nlp/models/bert/common.py | Anita1017/nlp-recipes | 4,407 | 152179 | <gh_stars>1000+
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This script reuses some code from
# https://github.com/huggingface/transformers/blob/master/examples
# /run_glue.py
import csv
import linecache
import subprocess
import warnings
from collections.abc import... | 0 | 0 | 0 | 0 | 0 | 0 |
texar/torch/modules/connectors/connectors.py | qinzzz/texar-pytorch | 746 | 152259 | # Copyright 2019 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 32 | 14 | 1 | 1 | 48 | 0 |
jetstream/models.py | simpsonw/atmosphere | 197 | 152265 | from django.db import models
from django.conf import settings
from django.utils import timezone
from .allocation import TASAPIDriver
AUTH_USER_MODEL = getattr(settings, "AUTH_USER_MODEL", 'auth.User')
class TASAllocationReport(models.Model):
"""
Keep track of each Allocation Report that is sent to TACC.API
... | 1 | 3 | 1 | 0 | 5 | 0 |
tests/test_an.py | MapleCCC/inflect | 174 | 152273 | import inflect
def test_an():
p = inflect.engine()
assert p.an("cat") == "a cat"
assert p.an("ant") == "an ant"
assert p.an("a") == "an a"
assert p.an("b") == "a b"
assert p.an("honest cat") == "an honest cat"
assert p.an("dishonest cat") == "a dishonest cat"
assert p.an("Honolulu sun... | 0 | 0 | 0 | 0 | 0 | 0 |
Experimental/MNIST_image_Classification.py | ProGamerCode/FitML | 171 | 152274 | '''
MNIST dataset classification with Keras.
Credits to fchollet. Find him on github.
'''
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense,Dropout,Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras impo... | 0 | 0 | 0 | 0 | 0 | 0 |
videoanalyst/engine/monitor/monitor_base.py | TragedyN/SiamFCpp | 737 | 152336 | <gh_stars>100-1000
# -*- coding: utf-8 -*
from copy import deepcopy
from typing import Dict
from videoanalyst.utils import Registry
TRACK_MONITORS = Registry('TRACK_MONITOR')
VOS_MONITORS = Registry('VOS_MONITOR')
TASK_MONITORS = dict(
track=TRACK_MONITORS,
vos=VOS_MONITORS,
)
class MonitorBase:
r"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | vishalbelsare/pca-magic | 218 | 152340 | from setuptools import setup, find_packages
if __name__ == '__main__':
name = 'ppca'
setup(
name = name,
version = "0.0.4",
author = '<NAME>',
author_email = '<EMAIL>',
description = 'Probabilistic PCA',
packages = find_packages(),
classifiers = [
'Develop... | 0 | 0 | 0 | 0 | 0 | 0 |
winrm/exceptions.py | Ferenc-/pywinrm | 887 | 152349 | from __future__ import unicode_literals
class WinRMError(Exception):
""""Generic WinRM error"""
code: int = 500
class WinRMTransportError(Exception):
"""WinRM errors specific to transport-level problems (unexpected HTTP error codes, etc)"""
@property
def protocol(self) -> object:
return... | 0 | 5 | 4 | 0 | 9 | 0 |
SimG4CMS/HcalTestBeam/test/python/run_tb06_all_cfg.py | Purva-Chaudhari/cmssw | 852 | 152369 | <filename>SimG4CMS/HcalTestBeam/test/python/run_tb06_all_cfg.py
#!/usr/bin/env python
from __future__ import print_function
import os, sys
#====================== check input ==========================
VERSION = os.environ.get('CMSSW_VERSION')
if VERSION is None:
print('''No environment CMSSW_VERSION''')
sy... | 0 | 0 | 0 | 0 | 0 | 0 |
office365/sharepoint/fields/field_type.py | wreiner/Office365-REST-Python-Client | 544 | 152376 | <reponame>wreiner/Office365-REST-Python-Client
class FieldType:
def __init__(self):
pass
Invalid = 0
Integer = 1
Text = 2
Note = 3
DateTime = 4
Counter = 5
Choice = 6
Lookup = 7
Boolean = 8
Number = 9
Currency = 10
URL = 11
Computed = 12
Threading = 1... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/tutorial-7-mdpa.py | vishalbelsare/PyGeM | 223 | 152377 | <reponame>vishalbelsare/PyGeM<filename>tutorials/tutorial-7-mdpa.py
import pygem as pg
from pygem.mdpahandler import MdpaHandler
import vedo
import meshio
ffd = pg.FFD()
ffd.read_parameters('../tests/test_datasets/parameters_test_ffd_pipe_unv_C0.prm')
mdpa_handler = MdpaHandler()
mesh_points = mdpa_handler.parse('../... | 0 | 0 | 0 | 0 | 0 | 0 |
test/python/conftest.py | yiranwang52/makisu | 2,355 | 152390 | <reponame>yiranwang52/makisu<gh_stars>1000+
import subprocess
import pytest
import os
import requests
import shutil
import tempfile
import time
from .utils import docker_pull_image
REGISTRY_IMAGE = "registry:2.4.1"
REGISTRY1_PORT = 5002
REGISTRY2_PORT = 5003
REGISTRY1_CONTAINER = "test-registry1"
REGISTRY2_CONTAINER ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/demo.py | andrewschreiber/atari-model-zoo | 206 | 152396 | <filename>examples/demo.py
# Copyright (c) 2018 Uber Technologies, 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 requi... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/make_assignments_txt_file.py | elihschiff/Submitty | 411 | 152425 | <reponame>elihschiff/Submitty
#!/usr/bin/env python3
"""
# USAGE
# make_assignments_txt_file.py <path to forms directory> <path to ASSIGNMENTS.txt file> <OPTIONAL GRADEABLES>
"""
import argparse
import json
import os
import stat
import sys
def parse_args():
parser = argparse.ArgumentParser()
parser.ad... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/adders.py | kaustubhgupta/PortfolioFy | 110 | 152435 |
class Adder:
'''
This class of functions contains all the additional functions required to add the website components.
'''
def __init__(self):
pass
def addBlogsL1(self, index_file: str) -> str:
'''
Function to add blogs section and meta text (comment) needed for blogpost ... | 18 | 8 | 0 | 0 | 26 | 0 |
db/data/submission_files/hello.py | Xyene/Markus | 149 | 152439 | <filename>db/data/submission_files/hello.py
class Hello(object):
""" Hello class """
def __init__(self, msg):
self.msg = msg
def print_msg(self):
""" Print a hello message. """
print "Hello " + self.msg
if (__name__ == "__main__"):
hello = Hello("Joe")
hello.print_msg()
| 0 | 0 | 0 | 0 | 0 | 0 |
apps/extention/models/cijob.py | rainydaygit/testtcloudserver | 349 | 152442 | <reponame>rainydaygit/testtcloudserver
from library.api.db import EntityModel, db
class CiJob(EntityModel):
ACTIVE = 0
DISABLE = 1
number = db.Column(db.Integer) # job number
url = db.Column(db.String(300)) # job url
ci_id = db.Column(db.Integer) # ci id
start_name = db.Column(db.String(30... | 0 | 0 | 0 | 0 | 0 | 0 |
vedacore/optimizers/builder.py | jie311/vedadet | 424 | 152455 | # adapted from https://github.com/open-mmlab/mmcv
import copy
import inspect
import torch
from vedacore.misc import build_from_cfg, registry
def register_torch_optimizers() -> object:
torch_optimizers = []
for module_name in dir(torch.optim):
if module_name.startswith('__'):
continue
... | 0 | 3 | 0 | 0 | 3 | 0 |
jrieke/utils.py | ArneBinder/Pytorch-LRP | 117 | 152462 | from __future__ import annotations
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.animation
import json
import nibabel as nib
from scipy.ndimage.interpolation import zoom
def save_history(filename, trainer):
"""Save the history from a torchsample ... | 19 | 5 | 0 | 0 | 24 | 0 |
selene_sdk/predict/_in_silico_mutagenesis.py | taskina-alena/selene | 307 | 152492 | from __future__ import annotations
import itertools
import numpy as np
from ..sequences import Genome
def in_silico_mutagenesis_sequences(sequence,
mutate_n_bases: int=1,
reference_sequence=Genome,
start_posi... | 3 | 3 | 0 | 0 | 6 | 0 |
storm/__main__.py | novagodb/storm | 2,293 | 152514 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import print_function
try:
import __builtin__ as builtins
except ImportError:
import builtins
from storm import Storm
from storm.parsers.ssh_uri_parser import parse
from storm.utils import (get_formatted_message, co... | 21 | 1 | 0 | 0 | 22 | 0 |
04/createArray.py | dunjin/DataAnalysisInAction | 656 | 152543 | # encoding:utf-8
import numpy as np
a = np.array([1, 2, 3])
b = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
b[1, 1] = 10
print a.shape
print b.shape
print a.dtype
print b
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter2/ex_2_14.py | zxjzxj9/PyTorchIntroduction | 205 | 152550 | """ 为了能够现实下列代码的执行效果,请在安装PyTorch之后,在Python交互命令行界面,
即在系统命令行下输入python这个命令回车后,在>>>提示符后执行下列代码
(#号及其后面内容为注释,可以忽略)
"""
import torch
a = torch.randn(3,4) # 建立一个3×4的张量
b = torch.randn(4,3) # 建立一个4×3的张量
torch.mm(a,b) # 矩阵乘法,调用函数,返回3×3的矩阵乘积
a.mm(b) # 矩阵乘法,内置方法
a@b # 矩阵乘法,@运算符号
a = torch.randn(2,3,4) # 建立一个大小为2×3×4的张量
b ... | 0 | 0 | 0 | 0 | 0 | 0 |
eve_sqlalchemy/tests/integration/nested_relations.py | gllmbernard/eve-sqlalchemy | 126 | 152558 | # -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import unicode_literals
from sqlalchemy import (
Column, DateTime, ForeignKey, Integer, String, Table, func,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from eve_sqlalchemy.config impor... | 1 | 0 | 4 | 0 | 5 | 0 |
mle/tests/__init__.py | vezeli/python-mle | 121 | 152570 | from __future__ import annotations
from scipy import stats
import numpy as np
__all__ = ['chisquare', 'kolsmi']
def kolsmi(dist, fit_result, data) -> tuple[object, object]:
"""Perform a Kolmogorow-Smirnow-Test for goodness of fit.
This tests the H0 hypothesis, if data is a sample of dist
Args:
... | 2 | 2 | 0 | 0 | 4 | 0 |
scripts/post_editing/apply-edits.py | zhrlove/seq2seq_attention_1 | 383 | 152572 | <gh_stars>100-1000
#!/usr/bin/env python3
import argparse
from translate.utils import reverse_edits
parser = argparse.ArgumentParser()
parser.add_argument('source')
parser.add_argument('edits')
parser.add_argument('--not-strict', action='store_false', dest='strict')
parser.add_argument('--no-fix', action='store_false... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/translation/helper/grd_helper.py | zealoussnow/chromium | 14,668 | 152589 | # Copyright 2019 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.
import os
import sys
import tempfile
here = os.path.dirname(os.path.realpath(__file__))
repo_root = os.path.normpath(os.path.join(here, '..', '..', '..'))
... | 0 | 2 | 0 | 0 | 2 | 0 |
quora_problems/problem_2.py | loftwah/Daily-Coding-Problem | 129 | 152630 | """This problem was asked by Quora.
Given an absolute pathname that may have . or .. as part of it,
return the shortest standardized path.
For example, given "/usr/bin/../bin/./scripts/../", return "/usr/bin/".
""" | 0 | 0 | 0 | 0 | 0 | 0 |
utils.py | navanil018/EMTech-2019 | 930 | 152631 | <reponame>navanil018/EMTech-2019
import os
import io
import pickle
import time
import bz2
import numpy as np
class TextLoader():
# Call this class to load text from a file.
def __init__(self, data_dir, batch_size, seq_length):
# TextLoader remembers its initialization arguments.
self.data_dir =... | 0 | 0 | 0 | 0 | 0 | 0 |
main/plugins/state.py | fakegit/gxgk-wechat-server | 1,564 | 152639 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
from .. import redis
def set_user_state(openid, state) -> None:
"""设置用户状态"""
redis.hset('wechat:user:' + openid, 'state', state)
return None
def get_user_state(openid) -> object:
"""获取用户状态"""
return redis.hget('wec... | 0 | 4 | 0 | 0 | 4 | 0 |
alipay/aop/api/response/AlipayMarketingCampaignCertQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 152643 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.KnCertSendOrderDetail import KnCertSendOrderDetail
class AlipayMarketingCampaignCertQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayMarket... | 0 | 2 | 0 | 2 | 4 | 0 |
extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/tests/rust/get_completions_test.py | Sunshengjin/RoboWare-Studio | 239 | 152681 | <filename>extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/tests/rust/get_completions_test.py
#!/usr/bin/env python
#
# Copyright (C) 2015 ycmd contributors.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | 0 | 0 | 0 | 0 | 0 | 0 |
games/Python/HeadsorTails.py | takshaygoyal/al-go-rithms | 1,253 | 152738 | import random
print('Enter the two different values')
first = input('Enter first side : ')
second = input('Enter second side : ')
fate = [first,second]
x=random.randint(0,1)
print(fate[x])
| 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/file_caching/apps.py | atitaya1412/Mayan-EDMS | 343 | 152759 | from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.classes import ModelPermission
from mayan.apps.acls.permissions import permission_acl_edit, permission_acl_view
from mayan.apps.common.apps import MayanAppConfig
from mayan.apps.common.menus import (
menu_multi_item, menu_object, menu_sec... | 0 | 0 | 4 | 0 | 4 | 0 |
upnpy/exceptions.py | f1d094/CallStranger | 376 | 152761 | class SOAPError(Exception):
"""
**Custom SOAP exception**
Custom SOAP exception class.
Raised whenever an error response has been received during action invocation.
"""
def __init__(self, description, code):
self.description = description
self.error = code
class ... | 0 | 0 | 0 | 0 | 0 | 0 |
dictionary/urls/user.py | ankitgc1/django-sozluk-master | 248 | 152796 | from django.conf import settings
from django.urls import path
from dictionary.views.detail import Chat, ChatArchive, UserProfile
from dictionary.views.edit import UserPreferences
from dictionary.views.images import ImageList, ImageUpload, ImageDetailProduction, ImageDetailDevelopment
from dictionary.views.list import ... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.6/site-packages/altair/vegalite/v2/examples/trellis_area.py | anthowen/duplify | 1,134 | 152799 | <filename>env/lib/python3.6/site-packages/altair/vegalite/v2/examples/trellis_area.py
"""
Trellis Area Chart
------------------
This example shows small multiples of an area chart.
"""
# category: area charts
import altair as alt
from vega_datasets import data
iowa = data.iowa_electricity()
alt.Chart(iowa).mark_area(... | 0 | 0 | 0 | 0 | 0 | 0 |
privacy/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant_test.py | tkgsn/P3GM | 1,605 | 152816 | <reponame>tkgsn/P3GM<gh_stars>1000+
# Copyright 2018 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/LICENS... | 0 | 0 | 0 | 0 | 0 | 0 |
openfoodfacts/autosuggest.py | Pablohn26/openfoodfacts-python | 176 | 152817 | <reponame>Pablohn26/openfoodfacts-python
# -*- coding: utf-8 -*-
def get_autosuggest_url(tag_type, language, geography):
base_url = "https://" + geography + ".openfoodfacts.org"
autosuggest = base_url + "/cgi/suggest.pl?lc=" + language
autosuggest += "&tagtype=" + tag_type
return autosuggest
| 0 | 0 | 0 | 0 | 0 | 0 |
test/make_global_settings/ld/make_global_settings_ld.gyp | chlorm-forks/gyp | 2,151 | 152832 | <reponame>chlorm-forks/gyp
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style licence that can be
# found in the LICENSE file.
{
'variables': {
'custom_ld_target%': '',
'custom_ld_host%': '',
},
'conditions': [
['"<(custom_ld_target)"!=""', {
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_gcp/compute/router_status.py | la3mmchen/pulumi-gcp | 121 | 152847 | # 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... | 15 | 10 | 0 | 0 | 25 | 0 |
example/fcn-xs/data.py | Vikas-kum/incubator-mxnet | 399 | 152878 | <reponame>Vikas-kum/incubator-mxnet
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version ... | 0 | 0 | 0 | 0 | 0 | 0 |
Contributions/Last Digit of the Sum of Fibonacci Numbers.py | sattwik21/Hacktoberfest2021-1 | 215 | 152885 | <reponame>sattwik21/Hacktoberfest2021-1<gh_stars>100-1000
>>
def fibo(n):
a,b = 0, 1
for _ in range(2,n+1):
c = a+b
c = c%10
b,a = c,b
if (c!=0): print(c-1)
else: print(9)
n = int(input())
if (n<=1): print(n)
else:
q = (n+2)%60
if q==1:
print(0)
elif q==0:... | 0 | 0 | 0 | 0 | 0 | 0 |
src/utf8lite/util/property.py | cran/utf8 | 115 | 152888 |
import re
PATTERN = re.compile(r"""^([0-9A-Fa-f]+) # (first code)
(\.\.([0-9A-Fa-f]+))? # (.. last code)?
\s*
; # ;
\s*
(\w+) # (property name)
... | 1 | 1 | 0 | 0 | 2 | 0 |
koku/sources/kafka_message_processor.py | rubik-ai/koku | 157 | 152913 | <filename>koku/sources/kafka_message_processor.py
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
import json
import logging
from rest_framework.exceptions import ValidationError
from api.provider.models import Provider
from sources import storage
from sources.config import Config
from sources... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/periodicities/Business_Hour/Cycle_Business_Hour_200_BH_15.py | shaido987/pyaf | 377 | 152946 | <filename>tests/periodicities/Business_Hour/Cycle_Business_Hour_200_BH_15.py
import tests.periodicities.period_test as per
per.buildModel((15 , 'BH' , 200));
| 0 | 0 | 0 | 0 | 0 | 0 |
hummingbot/connector/exchange/gate_io/gate_io_api_user_stream_data_source.py | pecuniafinance/hummingbot | 542 | 152962 | <gh_stars>100-1000
#!/usr/bin/env python
import asyncio
import logging
from typing import Any, AsyncIterable, List, Optional
from hummingbot.connector.exchange.gate_io import gate_io_constants as CONSTANTS
from hummingbot.core.web_assistant.web_assistants_factory import WebAssistantsFactory
from hummingbot.core.data_t... | 0 | 0 | 0 | 0 | 0 | 0 |
python-package/brainflow/__init__.py | ddoyon92/brainflow | 528 | 152967 | from brainflow.board_shim import *
from brainflow.exit_codes import *
from brainflow.data_filter import *
from brainflow.ml_model import *
from brainflow.utils import * | 0 | 0 | 0 | 0 | 0 | 0 |
apps/controllerx/cx_core/feature_support/light.py | francoisauclair911/controllerx | 204 | 152992 | <gh_stars>100-1000
class LightSupport:
EFFECT = 4
FLASH = 8
TRANSITION = 32
| 0 | 0 | 0 | 0 | 0 | 0 |
session-5/examples/simple_emm_plugin.py | numba/nvidia-cuda-tutorial | 142 | 153007 | from ctypes import CDLL, POINTER, byref, c_void_p, c_size_t
from numba import cuda
from numba.cuda import (HostOnlyCUDAMemoryManager, GetIpcHandleMixin,
MemoryPointer, MemoryInfo)
# Open the CUDA runtime DLL and create bindings for the cudaMalloc, cudaFree,
# and cudaMemGetInfo functions.
cud... | 0 | 6 | 0 | 0 | 6 | 0 |
env/lib/python3.8/site-packages/fiona/fio/main.py | CristianCristanchoT/predyctiva | 778 | 153016 | <gh_stars>100-1000
"""
Main click group for the CLI. Needs to be isolated for entry-point loading.
"""
import logging
from pkg_resources import iter_entry_points
import sys
import click
from click_plugins import with_plugins
from cligj import verbose_opt, quiet_opt
import fiona
from fiona import __version__ as fio... | 0 | 0 | 0 | 0 | 0 | 0 |
reclist/utils/config.py | nsbits/reclist | 183 | 153027 | from appdirs import *
from pathlib import Path
import requests
from tqdm import tqdm
from enum import Enum
COVEO_INTERACTION_DATASET_S3_URL = 'https://reclist-datasets-6d3c836d-6djh887d.s3.us-west-2.amazonaws.com/coveo_sigir.zip'
SPOTIFY_PLAYLIST_DATASET_S3_URL = 'https://reclist-datasets-6d3c836d-6djh887d.s3.us-west-... | 0 | 1 | 4 | 0 | 5 | 0 |
train_model/XGB_HMM.py | mapicccy/Stock-Market-Trend-Analysis-Using-HMM-LSTM | 147 | 153031 | <gh_stars>100-1000
"""
train the XGB_HMM model, return A, B(XGB model), pi
"""
import numpy as np
from XGB_HMM.GMM_HMM import GMM_HMM
from XGB_HMM.re_estimate import re_estimate
from XGB_HMM.predict import self_pred
from XGB_HMM.xgb import self_xgb
def XGB_HMM(O, lengths, verbose=True):
n_states ... | 0 | 0 | 0 | 0 | 0 | 0 |
anuga/culvert_flows/tests/test_culvert_routines_box_10pct.py | samcom12/anuga_core | 136 | 153037 | #!/usr/bin/env python
from __future__ import division
from past.utils import old_div
import unittest
import os.path
import sys
from anuga.utilities.system_tools import get_pathname_from_package
from anuga.culvert_flows.culvert_routines import boyd_generalised_culvert_model
import numpy as num
class Test_culvert_ro... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/syntax/assign_to_debug.py | matan-h/friendly | 287 | 153043 | """Should raise SyntaxError: cannot assign to __debug__ in Py 3.8
and assignment to keyword before."""
__debug__ = 1
| 0 | 0 | 0 | 0 | 0 | 0 |
src/metrics/jupyter_dashboard.py | ZackPashkin/toloka-kit | 153 | 153052 | <reponame>ZackPashkin/toloka-kit
"""Classes for creating online dashboards with tolokas metrics in jupyter notebooks.
For usage examples see DashBoard.
"""
__all__ = [
'DashBoard',
'Chart',
]
import plotly.graph_objects as go
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash... | 0 | 0 | 0 | 0 | 0 | 0 |
preprocessing/up_crop.py | nanopoteto/bodynet | 264 | 153067 | <reponame>nanopoteto/bodynet<filename>preprocessing/up_crop.py
def get_crop(imageshape, person_center):
crop = 513
"""Crop the image to the given maximum size. Use the person center."""
if imageshape[0] > crop:
crop_y = _np.array([int(_np.floor(person_center[1]) - _np.floor(crop / 2.)),
... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/pysixd/config.py | AlbertoRemus/GDR_Net | 132 | 153087 | <gh_stars>100-1000
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
"""Configuration of the BOP Toolkit."""
import os
######## Basic ########
# Folder with the BOP datasets.
if "BOP_PATH" in os.environ:
datasets_path = os.environ["BOP_PATH"]
else:
datasets_pa... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/TuitionQueryOrder.py | antopen/alipay-sdk-python-all | 213 | 153099 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class TuitionQueryOrder(object):
def __init__(self):
self._alipay_payment_id: None = None
self._isv_payment_id: None = None
@property
def ali... | 0 | 4 | 0 | 2 | 6 | 0 |
hydroDL/data/dbCsv.py | csiro-hydroinformatics/hydroDL | 109 | 153104 | <gh_stars>100-1000
"""
read and extract data from CSV database.
This module allows you to read time series inputs/forcings and define subsets
to read from.
"""
import os
import numpy as np
import pandas as pd
import time
import datetime as dt
import hydroDL.utils as utils
from . import Dataframe, DataModel
import hydr... | 0 | 0 | 0 | 0 | 0 | 0 |
python/fate_client/pipeline/backend/config.py | hust-suwb/FATE | 3,787 | 153136 | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 3 | 15 | 0 | 18 | 0 |
reddit2telegram/channels/~inactive/r_hmmm/app.py | mainyordle/reddit2telegram | 187 | 153146 | # encoding:utf-8
from __future__ import annotations
from utils import get_url
subreddit = 'hmmm'
t_channel = '@r_hmmm'
NSFW_EMOJI = u'\U0001F51E'
def send_post(submission, r2t) -> bool | object:
what, url, ext = get_url(submission)
title = submission.title
link = submission.shortlink
text = '{}\n... | 0 | 1 | 0 | 0 | 1 | 0 |
test/python/testexport.py | personx000/paperai | 743 | 153178 | """
Export module tests
"""
import unittest
from paperai.export import Export
# pylint: disable=C0411
from utils import Utils
class TestExport(unittest.TestCase):
"""
Export tests
"""
def testRun(self):
"""
Test export run
"""
Export.run(Utils.PATH + "/export.txt",... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/python/mus/marco.py | jar-ben/z3 | 7,746 | 153214 | ############################################
# Copyright (c) 2016 Microsoft Corporation
#
# Basic core and correction set enumeration.
#
# Author: <NAME> (nbjorner)
############################################
from __future__ import annotations
"""
Enumeration of Minimal Unsatisfiable Cores and Maximal Satisfying Sub... | 0 | 11 | 4 | 1 | 16 | 0 |
generator/lib/awsapigen.py | HouWill/leonidas | 353 | 153256 | <filename>generator/lib/awsapigen.py
"""
Code to generate the Leonidas API
"""
import os
class AWSAPIGen:
"""
Generates the Flask API used to execute the attacker actions
"""
def __init__(self, config, env):
self.templates = {}
self.env = env
self.config = config
self... | 0 | 0 | 0 | 0 | 0 | 0 |
self_deblur_net/model_self_flow_net.py | adityakrishnavamsy/SelfDeblur | 104 | 153262 | import torch
import torch.nn as nn
from losses import *
from net_pwc import *
from model_base import *
from reblur_package import *
from flow_utils import *
class ModelSelfFlowNet(ModelBase):
def __init__(self, opts):
super(ModelSelfFlowNet, self).__init__()
self.opts = opts
# cr... | 0 | 3 | 0 | 2 | 5 | 0 |
tests/mdts/tests/functional_tests/test_router_peering.py | xavileon/midonet | 221 | 153278 | <reponame>xavileon/midonet
# Copyright 2017 Midokura SARL
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
codalab/codalab/celery.py | AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public | 333 | 153308 | <filename>codalab/codalab/celery.py
from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'codalab.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
from django.conf ... | 0 | 0 | 0 | 0 | 0 | 0 |
infra/bots/recipes/android_compile.py | despairblue/esy-skia | 2,151 | 153321 | <filename>infra/bots/recipes/android_compile.py
# Copyright 2018 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.
import math
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
]
def... | 0 | 0 | 0 | 0 | 0 | 0 |
dydx3/modules/onboarding.py | clifton/dydx-v3-python | 109 | 153382 | <filename>dydx3/modules/onboarding.py
import base64
from web3 import Web3
from dydx3.constants import OFF_CHAIN_ONBOARDING_ACTION
from dydx3.constants import OFF_CHAIN_KEY_DERIVATION_ACTION
from dydx3.eth_signing import SignOnboardingAction
from dydx3.helpers.requests import request
class Onboarding(object):
d... | 0 | 0 | 0 | 0 | 0 | 0 |
baseline/remi/note-level/train.py | tokaho/MIDI-BERT | 109 | 153386 | <reponame>tokaho/MIDI-BERT
import tqdm
import torch
import torch.nn as nn
import utils_bestloss as utils
from sklearn.metrics import confusion_matrix
def training(model, device, train_loader, optimizer, bs, class_num):
model.train()
train_loss = 0
pbar = tqdm.tqdm(train_loader, disable = False)
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/test/library-tests/frameworks/internal-ql-helpers/test.py | angie1148/codeql | 643 | 153392 | def func():
print("func")
func() # $ resolved=func
class MyBase:
def base_method(self):
print("base_method", self)
class MyClass(MyBase):
def method1(self):
print("method1", self)
@classmethod
def cls_method(cls):
print("cls_method", cls)
@staticmethod
def stat... | 0 | 0 | 0 | 0 | 0 | 0 |
anchore_engine/db/db_catalog_image.py | rbrady/anchore-engine | 1,484 | 153400 | <gh_stars>1000+
from sqlalchemy import and_, desc, or_
from anchore_engine import db
from anchore_engine.db import CatalogImage, CatalogImageDocker
from anchore_engine.subsys import logger
def add_record(input_image_record, session=None):
if not session:
session = db.Session
image_record = {}
im... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/asset-inventory/asset_inventory/export.py | ruchirjain86/professional-services | 2,116 | 153425 | <filename>tools/asset-inventory/asset_inventory/export.py<gh_stars>1000+
#!/usr/bin/env python
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... | 0 | 0 | 0 | 0 | 0 | 0 |
cartography/intel/gsuite/__init__.py | sckevmit/cartography | 2,322 | 153447 | import logging
import os
from collections import namedtuple
import googleapiclient.discovery
import neo4j
from googleapiclient.discovery import Resource
from oauth2client.client import ApplicationDefaultCredentialsError
from oauth2client.client import GoogleCredentials
from cartography.config import Config
from carto... | 4 | 3 | 0 | 0 | 7 | 0 |
scripts/add_devel_repo.py | JStech/rosdistro | 617 | 153468 | #!/usr/bin/env python
from __future__ import annotations
from __future__ import print_function
import argparse
import sys
import yaml
from sort_yaml import sort_yaml_data
def add_devel_repository(yaml_file, name, vcs_type, url, version: object | None=None) -> None:
data = yaml.safe_load(open(yaml_file, 'r'))
... | 1 | 1 | 0 | 0 | 2 | 0 |
core/homography.py | Kaktusava/Vis-MVSNet | 131 | 153493 | import time
import os
import torch
from utils.utils import NanError
def depth2class(depth, depth_start, depth_interval, depth_num, inv: bool=False) -> object:
if not inv:
return (depth - depth_start) / (depth_interval + 1e-9)
else:
depth_end = depth_start + (depth_num-1) * depth_interval
... | 3 | 6 | 0 | 0 | 9 | 0 |
tests/walkers/test_anonymous.py | heureka-labs/pyRDF2Vec | 154 | 153504 | <reponame>heureka-labs/pyRDF2Vec<filename>tests/walkers/test_anonymous.py<gh_stars>100-1000
import itertools
import pytest
from pyrdf2vec.graphs import KG, Vertex
from pyrdf2vec.walkers import AnonymousWalker
LOOP = [
["Alice", "knows", "Bob"],
["Alice", "knows", "Dean"],
["Bob", "knows", "Dean"],
["... | 0 | 0 | 0 | 0 | 0 | 0 |
trackpy/masks.py | freemansw1/trackpy | 315 | 153521 | from __future__ import annotations
import numpy as np
from .utils import memo, validate_tuple
__all__ = ['binary_mask', 'r_squared_mask', 'cosmask', 'sinmask',
'theta_mask']
@memo
def binary_mask(radius, ndim) -> object:
"Elliptical mask in a rectangular array"
radius = validate_tuple(radius, ndim... | 6 | 12 | 0 | 0 | 18 | 0 |
Modules/languageDetect.py | A1S0N/Qu1cksc0pe | 255 | 153539 | <reponame>A1S0N/Qu1cksc0pe
#!/usr/bin/python3
import sys
try:
import puremagic as pr
except:
print("Error: >puremagic< module not found.")
sys.exit(1)
try:
from colorama import Fore, Style
except:
print("Error: >colorama< module not found.")
sys.exit(1)
# Getting name of the file for executa... | 0 | 0 | 0 | 0 | 0 | 0 |
bayesmark/builtin_opt/random_optimizer.py | goncaloperes/bayesmark | 102 | 153556 | <reponame>goncaloperes/bayesmark<gh_stars>100-1000
# Copyright (c) 2019 Uber Technologies, 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-... | 0 | 0 | 0 | 0 | 0 | 0 |
kitsune/groups/urls.py | AndrewDVXI/kitsune | 929 | 153571 | from django.conf.urls import url, include
from kitsune.groups import views
group_patterns = [
url(r"^$", views.profile, name="groups.profile"),
url(r"^/edit$", views.edit, name="groups.edit"),
url(r"^/avatar$", views.edit_avatar, name="groups.edit_avatar"),
url(r"^/avatar/delete$", views.delete_avata... | 0 | 0 | 0 | 0 | 0 | 0 |
ppgan/datasets/paired_dataset.py | pcwuyu/PaddleGAN | 6,852 | 153589 | <gh_stars>1000+
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
valentyusb/usbcore/rx/crc_test.py | rjeschmi/valentyusb | 105 | 153613 | <reponame>rjeschmi/valentyusb<gh_stars>100-1000
#!/usr/bin/env python3
import unittest
from migen import *
from migen.fhdl.decorators import ResetInserter
from ..test.common import BaseUsbTestCase
from .crc import RxCrcChecker
class TestRxCrcChecker(BaseUsbTestCase):
def shifter_test(self, i, vector):
d... | 0 | 0 | 0 | 0 | 0 | 0 |
engineer/render/registry.py | lingtengqiu/Open-PIFuhd | 191 | 153614 | <gh_stars>100-1000
from engineer.registry import Registry
NORMAL_RENDER = Registry('normal_render') | 0 | 0 | 0 | 0 | 0 | 0 |
ctools/utils/config_helper.py | XinyuJing/DI-star | 267 | 153655 | <filename>ctools/utils/config_helper.py
import copy
import json
import os
from typing import NoReturn, Optional, List
import yaml
from easydict import EasyDict
def read_config(path: str) -> EasyDict:
"""
Overview:
read configuration from path
Arguments:
- path (:obj:`str`): Path of source... | 0 | 0 | 0 | 0 | 0 | 0 |
kombu/utils/debug.py | kaiix/kombu | 1,920 | 153681 | <reponame>kaiix/kombu
"""Debugging support."""
import logging
from vine.utils import wraps
from kombu.log import get_logger
__all__ = ('setup_logging', 'Logwrapped')
def setup_logging(loglevel=logging.DEBUG, loggers=None):
"""Setup logging to stdout."""
loggers = ['kombu.connection', 'kombu.channel'] if n... | 0 | 0 | 0 | 0 | 0 | 0 |
orgnavigation.py | Sinamore/orgextended | 120 | 153698 | <gh_stars>100-1000
import sublime
import sublime_plugin
import datetime
import re
from pathlib import Path
import os
import fnmatch
import OrgExtended.orgparse.node as node
from OrgExtended.orgparse.sublimenode import *
import OrgExtended.orgutil.util as util
import OrgExtended.orgutil.navigation as nav
import OrgEx... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_datasets/core/features/tensor_feature.py | jvishnuvardhan/datasets | 3,380 | 153699 | <filename>tensorflow_datasets/core/features/tensor_feature.py
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
backprop/utils/load.py | lucky7323/backprop | 200 | 153768 | import dill
import json
import os
def load(path) -> object:
"""
Loads a saved model and returns it.
Args:
path: Name of the model or full path to model.
Example::
import backprop
backprop.save(model_object, "my_model")
model = backprop.load("my_model")
"""
# ... | 0 | 1 | 0 | 0 | 1 | 0 |
downunderctf2021/outbackdoor/exploit.py | nhtri2003gmail/ctf-write-ups | 101 | 153777 | <reponame>nhtri2003gmail/ctf-write-ups
#!/usr/bin/env python3
from pwn import *
binary = context.binary = ELF('./outbackdoor')
if args.REMOTE:
p = remote('pwn-2021.duc.tf', 31921)
else:
p = process(binary.path)
payload = b''
payload += 0x18 * b'A'
payload += p64(binary.sym.outBackdoor+1)
p.sendlineafter(b'song?... | 0 | 0 | 0 | 0 | 0 | 0 |
data/dataset/coco_class.py | donnyyou/centerX | 350 | 153778 | <filename>data/dataset/coco_class.py
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import BoxMode
from pycocotools.coco import COCO
import os
__all__ = ["load_coco_class_instances", "register_coco_class"]
# fmt: off
#CLASS_NAMES = ("person",)
# fmt: on
def load_coco_class_i... | 0 | 0 | 0 | 0 | 0 | 0 |
infoblox_client/object_manager.py | Maciejzzzz/infoblox-client | 108 | 153784 | # Copyright 2015 Infoblox Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 23 | 30 | 0 | 0 | 53 | 0 |
icefuzz/export.py | jaxnb/icestorm | 612 | 153811 | #!/usr/bin/env python3
import os
device_class = os.getenv("ICEDEVICE")
with open("../icebox/iceboxdb.py", "w") as f:
files = [ "database_io", "database_logic", "database_ramb", "database_ramt", "database_ipcon_5k"]
for device_class in ["8k"]:
files.append("database_ramb_" + device_class)
files.app... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/nipype/interfaces/dtitk/utils.py | richung99/digitizePlots | 585 | 153825 | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import annotations
"""DTITK utility interfaces
DTI-TK developed by <NAME>, <EMAIL>
For additional help, visit http://dti-tk.sf.net
The high-dimensional tensor-based... | 0 | 2 | 6 | 0 | 8 | 0 |
deps/pybind11/tests/test_python_types.py | Mistobaan/coremltools | 11,356 | 153863 | <reponame>Mistobaan/coremltools
# Python < 3 needs this: coding=utf-8
import pytest
from pybind11_tests import ExamplePythonTypes, ConstructorStats, has_optional, has_exp_optional
def test_repr():
# In Python 3.3+, repr() accesses __qualname__
assert "ExamplePythonTypes__Meta" in repr(type(ExamplePythonTypes... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/camera/_display_frame.py | adam-urbanczyk/pymba | 107 | 153874 | from typing import Optional
import cv2
from pymba import Frame
# todo add more colours
PIXEL_FORMATS_CONVERSIONS = {
'BayerRG8': cv2.COLOR_BAYER_RG2RGB,
}
def display_frame(frame: Frame, delay: Optional[int] = 1) -> None:
"""
Displays the acquired frame.
:param frame: The frame object to display.
... | 2 | 1 | 0 | 0 | 3 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.