hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f754171c57619c2a07ff4c8ab9e12ce2e217e068 | 495 | py | Python | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | taskana_api/entities/users.py | aK0nshin/taskana-api | eb511617d501aec0d07f83bc10f4159f09535d5b | [
"MIT"
] | null | null | null | # from datetime import datetime
# from typing import Optional
#
# from fastapi_users import models
# from sqlmodel import SQLModel
#
#
# class UserBase(models.BaseUser, SQLModel):
# first_name: str
# birthdate: Optional[datetime.date]
#
#
# class UserCreate(models.BaseUserCreate, SQLModel):
# first_name: st... | 22.5 | 52 | 0.727273 | true | true | |
f7541748cc0eef8e782681b9ba16f13b92650cbb | 848 | py | Python | FatherSon/HelloWorld2_source_code/Listing_11-6.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | FatherSon/HelloWorld2_source_code/Listing_11-6.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | FatherSon/HelloWorld2_source_code/Listing_11-6.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | # Listing_11-6.py
# Copyright Warren & Carter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# program to figure out combinations of hot dog ingredients
print "\tDog \tBun \tKetchup\tMustard\tOnions"
count = 1
for... | 42.4 | 82 | 0.445755 |
print "\tDog \tBun \tKetchup\tMustard\tOnions"
count = 1
for dog in [0, 1]: for bun in [0, 1]: for ketchup in [0, 1]: for mustard in [0, 1]: for onion in [0, 1]: ... | false | true |
f7541848daf36f22924dcb4499e5119c6f9ad3e0 | 14,750 | py | Python | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 7 | 2020-12-29T19:35:58.000Z | 2022-01-31T21:01:30.000Z | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 3 | 2020-02-06T16:44:17.000Z | 2020-09-26T05:26:14.000Z | odin/ml/plda.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 6 | 2019-02-14T01:36:28.000Z | 2020-10-30T13:16:32.000Z | # -*- coding: utf-8 -*-
""""
author: 'Omid Sadjadi, Timothee Kheyrkhah'
email: 'omid.sadjadi@nist.gov'
"""
import time
import warnings
from numbers import Number
import numpy as np
from scipy.linalg import cholesky, eigh, inv, solve, svd
from six import string_types
from odin.backend import calc_white_mat, length_nor... | 34.787736 | 92 | 0.609288 | import time
import warnings
from numbers import Number
import numpy as np
from scipy.linalg import cholesky, eigh, inv, solve, svd
from six import string_types
from odin.backend import calc_white_mat, length_norm
from odin.ml.base import BaseEstimator, Evaluable, TransformerMixin
from odin.ml.scoring import (VectorNo... | true | true |
f7541991f36ff68d8bba5c6f7185e51e3901f4b4 | 65,080 | py | Python | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/apis/template_permission_set_api.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | 41.531589 | 165 | 0.573141 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class TemplatePermissionSetApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
f75419c52f66e6ab2777422349398878fb237b39 | 11,402 | py | Python | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | 5 | 2021-12-25T23:26:00.000Z | 2022-03-26T09:13:41.000Z | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | null | null | null | catbird/core/optimizer/default_constructor.py | AfonsoSalgadoSousa/catbird | e285613f6e101115cccc1f88bbcf0cd435fbd4e9 | [
"MIT"
] | null | null | null | import warnings
import torch
from torch.nn import GroupNorm, LayerNorm
from torch.nn.modules.batchnorm import _BatchNorm
from torch.nn.modules.instancenorm import _InstanceNorm
from ..utils import build_from_cfg
from .builder import OPTIMIZER_BUILDERS, OPTIMIZERS
@OPTIMIZER_BUILDERS.register_module
class DefaultOpt... | 47.907563 | 87 | 0.617172 | import warnings
import torch
from torch.nn import GroupNorm, LayerNorm
from torch.nn.modules.batchnorm import _BatchNorm
from torch.nn.modules.instancenorm import _InstanceNorm
from ..utils import build_from_cfg
from .builder import OPTIMIZER_BUILDERS, OPTIMIZERS
@OPTIMIZER_BUILDERS.register_module
class DefaultOpt... | true | true |
f7541a9caea7fc2fbbf984045a54fe47eef4da3e | 480 | py | Python | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | Encoplot+Greedy/plagiarism.py | ML-UCV/Combining-Encoplot-and-Based-Deep-Learning-for-Plagiarism-Detection | 3c8bdddeac1e462635f6b23b5fbf8aca71184770 | [
"MIT"
] | null | null | null | """# Plagiarism Class - for document known plagiarism list - used for later evaluation
Members:
- this_offset
- this_length
- source_offset
- source_length
"""
class Plagiarism():
def __init__(self, this_offset, this_length, source_reference, source_offset, source_length):
self.this_offset = this_offset... | 30 | 95 | 0.758333 |
class Plagiarism():
def __init__(self, this_offset, this_length, source_reference, source_offset, source_length):
self.this_offset = this_offset
self.this_length = this_length
self.source_reference = source_reference
self.source_offset = source_offset
self.source_length = source_length | true | true |
f7541af445e01bc99a555c1a89c9023f3a9db5cf | 565 | py | Python | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | scripts/db-cleanup.py | willith/RPi-central-heating-controller | 3a8cc08c8a748c191f9713b52a47e7451596a1a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from shutil import copyfile
import sqlite3
from datetime import datetime, date
import dateutil.relativedelta
now = date.today()
date2 = now + dateutil.relativedelta.relativedelta(months=-1)
copyfile("/home/pi/database/centralheating.db", "/home/pi/database/archive/centralheating-%s.db" % date2)
c... | 26.904762 | 132 | 0.743363 | from shutil import copyfile
import sqlite3
from datetime import datetime, date
import dateutil.relativedelta
now = date.today()
date2 = now + dateutil.relativedelta.relativedelta(months=-1)
copyfile("/home/pi/database/centralheating.db", "/home/pi/database/archive/centralheating-%s.db" % date2)
conn=sqlite3.connect('/... | true | true |
f7541b624539c842fdcf009857033324a6d52760 | 473 | py | Python | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 9 | 2019-07-16T11:05:38.000Z | 2021-10-13T01:38:19.000Z | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 7 | 2019-05-02T17:51:39.000Z | 2020-03-02T16:34:49.000Z | setup.py | ehanson8/dspace-api-python-scripts | 0e51944e0bd4e009d11891dbafae82aa21801e35 | [
"Apache-2.0"
] | 1 | 2020-04-10T10:30:29.000Z | 2020-04-10T10:30:29.000Z | from setuptools import setup, find_packages
setup(
name="dsaps",
version="1.0.0",
description="",
packages=find_packages(exclude=["tests"]),
author="Eric Hanson",
author_email="ehanson@mit.edu",
install_requires=[
"requests",
"structlog",
"attrs",
"click",
... | 19.708333 | 46 | 0.539112 | from setuptools import setup, find_packages
setup(
name="dsaps",
version="1.0.0",
description="",
packages=find_packages(exclude=["tests"]),
author="Eric Hanson",
author_email="ehanson@mit.edu",
install_requires=[
"requests",
"structlog",
"attrs",
"click",
... | true | true |
f7541bd3e0eb570effbed79b595d2d83b57d318c | 4,397 | py | Python | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | processing/pcap.py | vnc0d9r/openMA | 6554515c32bbd5798cda57f5f648a5f5382a4abf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Cuckoo Sandbox - Automated Malware Analysis
# Copyright (C) 2010-2011 Claudio "nex" Guarnieri (nex@cuckoobox.org)
# http://www.cuckoobox.org
#
# This file is part of Cuckoo.
#
# Cuckoo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | 29.709459 | 72 | 0.51103 |
import os
import re
import sys
import socket
try:
import dpkt
except ImportError:
sys.exit(1)
class Pcap:
def __init__(self, filepath):
self.filepath = filepath
self.tcp_connections = []
self.udp_connections = []
self.http_requests = []
self.dns_requests = []
... | true | true |
f7541c0e892819beaf27ad97d7d41b8f963a4ab9 | 1,818 | py | Python | tensorflow/python/ops/nn_grad_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/ops/nn_grad_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/python/ops/nn_grad_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.102041 | 80 | 0.69857 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops import gradi... | true | true |
f7541c52eca7275c899e00821795d60ff04b5c34 | 233 | py | Python | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | setka/pipes/GarbageCollector.py | SlinkoIgor/setka | 70e9bda226ca924be9ba0a83e3f7aeff7884698c | [
"MIT"
] | null | null | null | from .Pipe import Pipe
import gc
class GarbageCollector(Pipe):
'''
Probably should be merged with the Dataset handler (?).
'''
def __init__(self):
gc.enable()
def after_epoch(self):
gc.collect() | 17.923077 | 59 | 0.618026 | from .Pipe import Pipe
import gc
class GarbageCollector(Pipe):
def __init__(self):
gc.enable()
def after_epoch(self):
gc.collect() | true | true |
f7541d3b1549e5d5d32e62014509e280da930637 | 5,422 | py | Python | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | 1 | 2019-11-21T23:11:28.000Z | 2019-11-21T23:11:28.000Z | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | ishiland/nyc-geoclient | 1bd7aaf3d9ee09d9cb87c43cefdaedd99b5bc731 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T18:37:11.000Z | 2022-01-19T18:37:11.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.955801 | 79 | 0.654924 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from geoclient.config import __version__, __author__
project = 'python-geoclient'
copyright = '2019, Ian Shiland'
author = __author__
version = __version__
release = __version__
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
]... | true | true |
f7541d67f3b115837313260eda555dcff3dbd76a | 6,168 | py | Python | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | null | null | null | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | null | null | null | rl_coach/rl_deepracer_coach_robomaker.py | jarrettj/deepracer | 2c9d083b2b0c8b3b3ac1468d154d7d7ebfb17961 | [
"Apache-2.0"
] | 1 | 2021-09-17T18:40:53.000Z | 2021-09-17T18:40:53.000Z | #!/usr/bin/env python
# coding: utf-8
import sagemaker
import boto3
import sys
import os
import glob
import re
import subprocess
from IPython.display import Markdown
from time import gmtime, strftime
sys.path.append("common")
from misc import get_execution_role, wait_for_s3_object
from sagemaker.rl import RLEstimator... | 46.727273 | 207 | 0.626946 |
import sagemaker
import boto3
import sys
import os
import glob
import re
import subprocess
from IPython.display import Markdown
from time import gmtime, strftime
sys.path.append("common")
from misc import get_execution_role, wait_for_s3_object
from sagemaker.rl import RLEstimator, RLToolkit, RLFramework
from markdown... | true | true |
f7541dccc7f828d5420d85d25341eedd35b1e6c6 | 1,984 | py | Python | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | 1 | 2017-12-07T02:18:17.000Z | 2017-12-07T02:18:17.000Z | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | null | null | null | src/universe-driving/drive.py | arminnh/deep-q-learning | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | [
"MIT"
] | null | null | null | #https://github.com/openai/universe-starter-agent/blob/master/envs.py
import gym
import universe
import socketio
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from TORCH_DQN import DQN
from enum import Enum
import torchvision.transforms as T
import ast
import torch
from env ... | 25.113924 | 83 | 0.611391 |
import gym
import universe
import socketio
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from TORCH_DQN import DQN
from enum import Enum
import torchvision.transforms as T
import ast
import torch
from env import create_flash_env
class Moves(Enum):
LEFT = 0
RIGHT = 1... | true | true |
f7541edfa8635da5971bc31e3241e7de26570977 | 3,192 | py | Python | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | Python/rmn.py | cga101/Retail-Me-Not-Contest | 7980a0d0f9614df9f750ec15c057c46cd33f8d80 | [
"MIT"
] | null | null | null | #imports (non-3rd Party)
import re
import csv
import operator
from math import sqrt
from collections import defaultdict, Counter
#Data Structures
##Hashtables for Operations
hashMerchant = defaultdict(list)
hashStore = defaultdict(list)
hashVisitors = defaultdict(list)
minA = Counter()
maxA = Counter()
#Question 1 ... | 27.050847 | 202 | 0.664474 | import re
import csv
import operator
from math import sqrt
from collections import defaultdict, Counter
hashMerchant = defaultdict(list)
hashStore = defaultdict(list)
hashVisitors = defaultdict(list)
minA = Counter()
maxA = Counter()
def getClick(x,z):
clicks = 0
for i in x:
if i == z:
clicks += 1
return c... | true | true |
f754211c39dc80d6f1c4348cf88943845734f8d1 | 7,271 | py | Python | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 41 | 2018-03-22T14:55:35.000Z | 2022-01-19T17:09:43.000Z | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 3 | 2018-03-30T09:29:28.000Z | 2019-01-20T22:51:17.000Z | experiments/mario/gym-nes-mario-bros-master/src/run-mario.py | selfemergence/NEAT-multiprocessing | 3dc57c6ec18658253398ae0b361b72f78e3fd0c9 | [
"MIT"
] | 14 | 2018-05-24T01:45:15.000Z | 2022-01-31T14:22:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# By Lilian Besson (Naereen)
# https://github.com/Naereen/gym-nes-mario-bros
# MIT License https://lbesson.mit-license.org/
#
from __future__ import division, print_function # Python 2 compatibility
import os
import sys
from collections import deque
from time import sleep... | 35.468293 | 255 | 0.625636 | from __future__ import division, print_function
import os
import sys
from collections import deque
from time import sleep
PARALLEL_EMULATORS = 1 PARALLEL_EMULATORS = int(os.getenv('N', PARALLEL_EMULATORS))
if PARALLEL_EMULATORS > 1:
print("WARNING: It's not working with more than one emulator in parallel!")
#... | true | true |
f7542263f291d725a6be30117d996cfa8a61d5dc | 2,528 | py | Python | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null | models/vae.py | susanwe/world-models | 0f246a430683e6ab741726df0a97f35830044356 | [
"MIT"
] | null | null | null |
"""
Variational encoder model, used as a visual model
for our model of the world.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
""" VAE decoder """
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size... | 33.263158 | 72 | 0.623418 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Decoder(nn.Module):
def __init__(self, img_channels, latent_size):
super(Decoder, self).__init__()
self.latent_size = latent_size
self.img_channels = img_channels
self.fc1 = nn.Linear(latent_size, 1024)
... | true | true |
f75422b4c55b8cdb52932fdd61bb5310a22e2332 | 935 | py | Python | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | stake_last_all_api/account_rpc_interface_account_manage/account_createAccount.py | DerWalundDieKatze/Yumekui | cb3174103ced7474ce6d1abd774b399557dcaf4f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
'''
@author: caroline
@license: (C) Copyright 2019-2022, Node Supply Chain Manager Corporation Limited.
@contact: caroline.fang.cc@gmail.com
@software: pycharm
@file: account_createAccount.py
@time: 2020/1/8 5:38 下午
@desc:
'''
from stake_last_all_api.API import request_Api
'''2... | 23.974359 | 152 | 0.718717 |
from stake_last_all_api.API import request_Api
def createAccount(api_name, params):
try:
result = request_Api(api_name, params)
print("创建本地账号成功,返回值为{}".format(result))
return result
except Exception as e:
print("创建本地账号失败,api返回错误,返回值为{}".format(e))
return -1
if __name__ == '__main__':
api_name = "acco... | true | true |
f75422faa66b80e55c177cfefdcbfb9ee6b32272 | 663 | py | Python | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | tests/helper.py | laszewsk/pandoc-codeblock-include | 183dc52b48d6dea9d1651ab0c2cb5e60cfff2781 | [
"BSD-3-Clause"
] | null | null | null | # This Python file uses the following encoding: utf-8
from panflute import *
import pandoc_codeblock_include
def conversion(markdown, format='markdown'):
doc = convert_text(markdown, standalone = True)
doc.format = format
pandoc_codeblock_include.main(doc)
return doc
def verify_conversion(markdown, ... | 30.136364 | 124 | 0.711916 |
from panflute import *
import pandoc_codeblock_include
def conversion(markdown, format='markdown'):
doc = convert_text(markdown, standalone = True)
doc.format = format
pandoc_codeblock_include.main(doc)
return doc
def verify_conversion(markdown, expected, format='markdown'):
doc = conversion(mar... | true | true |
f754233dfb866002dd6913814c66161604e47b09 | 4,027 | py | Python | autotest/gdrivers/srtmhgt.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 1 | 2015-04-21T19:52:03.000Z | 2015-04-21T19:52:03.000Z | autotest/gdrivers/srtmhgt.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 1 | 2016-04-04T09:14:19.000Z | 2016-04-14T19:17:10.000Z | autotest/gdrivers/srtmhgt.py | pramsey/gdal | 965421b79fe4d3332b0f2f633b072fdcab2b700a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test SRTMHGT support.
# Author: Even Rouault < even dot rouault @ mines-paris dot org >
#
#########################################################################... | 31.708661 | 158 | 0.610877 |
import os
import sys
from osgeo import gdal
sys.path.append( '../pymod' )
import gdaltest
def srtmhgt_1():
ds = gdal.Open( 'data/n43.dt0' )
bandSrc = ds.GetRasterBand(1)
driver = gdal.GetDriverByName( "GTiff" );
dsDst = driver.Create( 'tmp/n43.dt1.tif', 1201, 1201, 1, gdal.GDT_Int16 )
dsDst... | true | true |
f7542397efca9abb4281934911ddd53734ebee37 | 7,845 | py | Python | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | null | null | null | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | null | null | null | bin/azure/graphrbac/models/service_principal.py | zdmc23/bash-lambda-layer | e762df0189cfb894dab2d96bae1655b8857d5efb | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # 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 ... | 49.968153 | 112 | 0.679159 |
from .directory_object import DirectoryObject
class ServicePrincipal(DirectoryObject):
_validation = {
'object_id': {'readonly': True},
'deletion_timestamp': {'readonly': True},
'object_type': {'required': True},
'app_display_name': {'readonly': True},
'app_owner_tenant_i... | true | true |
f754242081f1e3709306660d14fa24ddf0e80485 | 4,822 | py | Python | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | 2 | 2021-04-13T11:01:18.000Z | 2021-04-15T09:33:27.000Z | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | null | null | null | from_yolov5repo_to_fork.py | airctic/yolov5-pip-converter | 5132a48d1da0b24970b35dccdc1e9d91eb142e4b | [
"Apache-2.0"
] | 1 | 2022-03-17T09:20:37.000Z | 2022-03-17T09:20:37.000Z | from pathlib import Path
import shutil
import os
import sys
def convert_repo_to_fork(path2repo):
path_fork = path2repo.parent / "yolov5-icevision" # path of our fork
if path_fork.is_dir():
shutil.rmtree(path_fork)
path_fork.mkdir(exist_ok=True)
_ = shutil.copytree(path2repo, path_fork, dir... | 25.924731 | 117 | 0.6292 | from pathlib import Path
import shutil
import os
import sys
def convert_repo_to_fork(path2repo):
path_fork = path2repo.parent / "yolov5-icevision"
if path_fork.is_dir():
shutil.rmtree(path_fork)
path_fork.mkdir(exist_ok=True)
_ = shutil.copytree(path2repo, path_fork, dirs_exist_ok=True)
... | true | true |
f75425cb72867c52da1ee234a418e13523daa8df | 1,507 | py | Python | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | 2 | 2020-06-11T13:44:30.000Z | 2020-06-11T13:44:32.000Z | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | null | null | null | Game23/Game23.py | dwlcreat/dsf | 51af9107367dd8abc34b90230465f40f6950cdec | [
"MIT"
] | 1 | 2020-04-27T15:13:50.000Z | 2020-04-27T15:13:50.000Z | '''
Function:
2048小游戏
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import cfg
import sys
import pygame
from modules.utils import *
from modules.Game2048 import *
from modules.endInterface import *
'''主程序'''
def main(cfg):
# 游戏初始化
pygame.init()
screen = pygame.display.set_mode(cfg.SCREENSIZE)
pygame.display.set_capti... | 25.116667 | 130 | 0.721964 | import cfg
import sys
import pygame
from modules.utils import *
from modules.Game2048 import *
from modules.endInterface import *
def main(cfg):
pygame.init()
screen = pygame.display.set_mode(cfg.SCREENSIZE)
pygame.display.set_caption('2048 —— 微信公众号:Charles的皮卡丘')
pygame.mixer.music.load(cfg.BGMPATH)
pygame.mix... | true | true |
f754265a4563f6595547699085ac86c96d9efe1a | 131 | py | Python | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | 20 | 2021-03-31T20:10:46.000Z | 2022-02-15T09:58:13.000Z | evan/api/permissions/contents.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | from .events import EventRelatedObjectPermission
class ContentPermission(EventRelatedObjectPermission):
allow_delete = False
| 21.833333 | 54 | 0.847328 | from .events import EventRelatedObjectPermission
class ContentPermission(EventRelatedObjectPermission):
allow_delete = False
| true | true |
f754270a92c68f45f74597a50ce492fb42044199 | 408 | py | Python | msgBoxBasic.py | witchOfTheEast/tkinter_tutorial | aeff45ce01cfca88795ec3b9c1be5835553cd907 | [
"MIT"
] | null | null | null | msgBoxBasic.py | witchOfTheEast/tkinter_tutorial | aeff45ce01cfca88795ec3b9c1be5835553cd907 | [
"MIT"
] | null | null | null | msgBoxBasic.py | witchOfTheEast/tkinter_tutorial | aeff45ce01cfca88795ec3b9c1be5835553cd907 | [
"MIT"
] | null | null | null | from Tkinter import *
import tkMessageBox
root = Tk()
def callback():
print 'called the callback!'
# code here
filename = 'x'
try:
fp = open(filename)
except:
tkMessageBox.showwarning(
'Open file',
'Cannot open this file\n(%s)' % filename
)
# return
if tkMessageBox.askye... | 15.692308 | 61 | 0.617647 | from Tkinter import *
import tkMessageBox
root = Tk()
def callback():
print 'called the callback!'
filename = 'x'
try:
fp = open(filename)
except:
tkMessageBox.showwarning(
'Open file',
'Cannot open this file\n(%s)' % filename
)
if tkMessageBox.askyesno('print', 'Print this fak... | false | true |
f7542729616b072cc26b2cf31dc82c463a20c77e | 1,753 | py | Python | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-scdn/aliyunsdkscdn/request/v20171115/SetScdnDomainBizInfoRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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 2.0 (the
# "License"); you may not u... | 35.06 | 74 | 0.763263 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkscdn.endpoint import endpoint_data
class SetScdnDomainBizInfoRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'scdn', '2017-11-15', 'SetScdnDomainBizInfo')
self.set_method('GET')
if hasattr(self, "endpoint_map"):
setattr(self, "e... | true | true |
f754276821deed0b2cf600e0a1bcae30113a2ba5 | 6,527 | py | Python | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 1 | 2020-10-17T19:48:38.000Z | 2020-10-17T19:48:38.000Z | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | 4 | 2020-05-27T16:38:56.000Z | 2020-11-21T21:09:23.000Z | tidepool_data_science_models/models/icgm_sensor_generator.py | tidepool-org/data-science-models | cd06e9aad95a0bc6cc2a81871e567c88159b86d3 | [
"BSD-2-Clause"
] | null | null | null | """
Creates iCGM Sensors given a trueBG trace
The Dexcom G6 Specifications in this file are publicly available from:
“EVALUATION OF AUTOMATIC CLASS III DESIGNATION FOR
Dexcom G6 Continuous Glucose Monitoring System.” n.d.
https://www.accessdata.fda.gov/cdrh_docs/reviews/DEN170088.pdf.
"""
# %% Libraries
... | 34.172775 | 104 | 0.629998 |
import numpy as np
from scipy.optimize import brute, fmin
from tidepool_data_science_models.models.icgm_sensor import iCGMSensor
import tidepool_data_science_models.models.icgm_sensor_generator_functions as sf
import multiprocessing
multiprocessing.set_start_method("fork")
class iCGMSensorGenerator(object):
def... | true | true |
f754282b4c0484e278cf3311f77c3440b8833e62 | 63,444 | py | Python | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | cctbx/crystal/tst_ext.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from cctbx import crystal
import cctbx.crystal.coordination_sequences
from cctbx import sgtbx, xray
import cctbx.crystal.direct_space_asu
from cctbx import uctbx
from cctbx.array_family import flex
from scitbx import matrix
from libtbx.test_utils import E... | 37.408019 | 88 | 0.655381 | from __future__ import absolute_import, division, print_function
from cctbx import crystal
import cctbx.crystal.coordination_sequences
from cctbx import sgtbx, xray
import cctbx.crystal.direct_space_asu
from cctbx import uctbx
from cctbx.array_family import flex
from scitbx import matrix
from libtbx.test_utils import E... | true | true |
f75428914e3310cbaa625cfc1f8d3b573ed9bc60 | 475 | py | Python | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 1 | 2017-10-25T17:11:44.000Z | 2017-10-25T17:11:44.000Z | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 3 | 2017-03-10T05:27:29.000Z | 2017-04-07T16:06:28.000Z | bitcoinscript/misc.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | null | null | null | """
Miscellaneous non-bitcoin-related tools used throughout this package.
"""
################################################################################
# source: http://stackoverflow.com/a/22729414
class classproperty(object):
""" @classmethod+@property """
def __init__(self, f):
self.f = class... | 29.6875 | 80 | 0.431579 |
class classproperty(object):
def __init__(self, f):
self.f = classmethod(f)
def __get__(self, *a):
return self.f.__get__(*a)()
| true | true |
f75428e93a7d3fe77968888bfabc162ffb40b85d | 35,842 | py | Python | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 5 | 2020-08-28T22:46:39.000Z | 2022-02-03T15:57:05.000Z | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 15 | 2020-08-14T22:10:38.000Z | 2022-02-03T16:09:26.000Z | iqplot/dist.py | tomroesch/iqplot | e13f9ac888d75093da05353ba80786804ec99418 | [
"MIT"
] | 2 | 2021-08-07T00:45:12.000Z | 2021-09-15T21:11:00.000Z | """Visualization of how data are distributed, split or colored by a
categorical variable."""
import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def ecdf(
data=None,
q=None,
cats=None,
q_axis="x",
pal... | 34.764306 | 260 | 0.578818 |
import copy
import warnings
import numpy as np
import pandas as pd
import colorcet
import bokeh.models
import bokeh.plotting
from . import utils
def ecdf(
data=None,
q=None,
cats=None,
q_axis="x",
palette=None,
order=None,
p=None,
show_legend=True,
legend_label=None,
legen... | true | true |
f75428ffe7b26cc320721d550ad2fb04dd73dad0 | 2,164 | py | Python | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | ansible/modules/windows/win_tempfile.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017 Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | 28.103896 | 90 | 0.701941 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_tempfile
version_added: "2.3"
author: Dag Wieers (@dagwieers)
short_description: Creates temporary files and directories.
description:
- C... | true | true |
f754299f7bee1c91d24ae7320ff2eceddd1a16fe | 1,972 | py | Python | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | icon.py | ccacNMorris/dat129_ccac | 587e35f7886d1e883ad988cbe2ec027eb9cf3043 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 2 18:34:05 2020
@author: leemshari
"""
# I wanted to create an n cubed icon
#My goal was to get this to get this to print with & or @ signs but I was unable to
#get this array to look decent with anything but integers.
#I changed the dtype to str ... | 32.866667 | 95 | 0.682556 | import numpy as np
def icon (tuple_list,int_array):
for a,b in tuple_list:
int_array[a,b] = 3
return int_array
def roll_rotate(a_tuple,a_array):
b_array = icon(a_tuple,a_array)
print(np.roll(b_array,1))
print('')
print(np.flipud(b_array))
def resize(b_tuple,b_array):
... | true | true |
f7542a47ff90fd77821f8c0265593087d8f9e65c | 3,665 | py | Python | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/node_service/publish/publish_service.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Dict as TypeDict
from typing import List as TypeList
from typing import Optional
from typing import Type
# third party
from nacl.signing import VerifyKey
# relative
from ......logger import traceback_and_raise # type: ignore
from .....adp.data_subject_ledger import DataSubjectLedger # ty... | 41.179775 | 101 | 0.612005 | from typing import Dict as TypeDict
from typing import List as TypeList
from typing import Optional
from typing import Type
from nacl.signing import VerifyKey
from ......logger import traceback_and_raise from .....adp.data_subject_ledger import DataSubjectLedger from .....common.uid import UID from .....store.stor... | true | true |
f7542a48738b3086c1f16e98ccdcd66df46f3a18 | 65 | py | Python | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 1 | 2020-10-18T11:29:03.000Z | 2020-10-18T11:29:03.000Z | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 4 | 2020-11-21T07:36:24.000Z | 2020-11-22T03:09:39.000Z | test/test_project/init_order/first.py | rob-smallshire/cosmic-ray | 4fd751b38eee30568f8366e09452d7aa60be4e26 | [
"MIT"
] | 1 | 2021-11-10T10:42:57.000Z | 2021-11-10T10:42:57.000Z | import init_order
init_order.initialized = True
print('first')
| 10.833333 | 29 | 0.784615 | import init_order
init_order.initialized = True
print('first')
| true | true |
f7542b024498b7a7e970ae6e8e7920fdd4e061e0 | 476 | py | Python | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 6 | 2015-04-13T23:47:37.000Z | 2021-12-09T17:48:01.000Z | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 53 | 2015-04-13T23:35:42.000Z | 2021-12-16T02:44:37.000Z | test/runtests.py | carneirofc/pyaccel | e639cb6191293eec4c05aeeaf513d9066de8da2b | [
"MIT"
] | 3 | 2015-11-06T05:20:57.000Z | 2022-02-08T13:10:20.000Z | #!/usr/bin/env python3
import unittest
import test_elements
import test_accelerator
import test_tracking
import test_lattice
import test_optics
suite_list = []
suite_list.append(test_elements.get_suite())
suite_list.append(test_accelerator.get_suite())
suite_list.append(test_lattice.get_suite())
suite_list.append(te... | 23.8 | 47 | 0.834034 |
import unittest
import test_elements
import test_accelerator
import test_tracking
import test_lattice
import test_optics
suite_list = []
suite_list.append(test_elements.get_suite())
suite_list.append(test_accelerator.get_suite())
suite_list.append(test_lattice.get_suite())
suite_list.append(test_tracking.get_suite()... | true | true |
f7542ba8526bc71f5ad701b7d7171ada72b47cfa | 8,557 | py | Python | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 4 | 2021-08-20T12:27:11.000Z | 2022-01-24T12:20:19.000Z | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 260 | 2021-06-29T00:50:44.000Z | 2022-03-30T12:25:26.000Z | tests/test_csek.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | 11 | 2021-06-14T16:25:31.000Z | 2022-03-22T19:42:49.000Z | #!/usr/bin/env python3
#
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.363208 | 84 | 0.623934 |
import base64
import hashlib
import unittest
from unittest.mock import ANY, Mock
import grpc
from werkzeug.test import create_environ
from werkzeug.wrappers import Request
from google.storage.v2 import storage_pb2
from testbench import csek, error
class TestCSEK(unittest.TestCase):
def test_extract_insert(sel... | true | true |
f7542ce646d836e4bbf6f685ba3aa38ff52dbfc5 | 5,063 | py | Python | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_filter.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | 1 | 2021-04-26T22:41:56.000Z | 2021-04-26T22:41:56.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
class TestDataFrameFilter:
def test_filter(self, float_frame, float_string_frame):
# Items
filtered = float_frame.filter(["A", "B", "E"])
assert len(filtered.columns)... | 36.164286 | 80 | 0.562117 | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
class TestDataFrameFilter:
def test_filter(self, float_frame, float_string_frame):
filtered = float_frame.filter(["A", "B", "E"])
assert len(filtered.columns) == 2
... | true | true |
f7542cf57a22ab608ffec77f9fdc75d21edc3583 | 1,596 | py | Python | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | 1 | 2020-07-17T07:02:09.000Z | 2020-07-17T07:02:09.000Z | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | spotty/commands/start.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | from argparse import Namespace, ArgumentParser
from spotty.commands.abstract_config_command import AbstractConfigCommand
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
from spotty.providers.abstract_instance_manager import AbstractInstanceManager
class StartCommand(AbstractConfigComm... | 48.363636 | 114 | 0.634712 | from argparse import Namespace, ArgumentParser
from spotty.commands.abstract_config_command import AbstractConfigCommand
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
from spotty.providers.abstract_instance_manager import AbstractInstanceManager
class StartCommand(AbstractConfigComm... | true | true |
f7542d6a17d0986919e414b1d927a35e40dcdb6c | 485 | py | Python | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | profiles_api/urls.py | c12121234/practice-REST-API | 72bfa241d520eea29b896598c79fb79dfdacc366 | [
"MIT"
] | null | null | null | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router = DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset')
router.register('profile',views.UserProfileViewSet)
router.register('feed',views.UserProfileFeedVie... | 32.333333 | 77 | 0.783505 | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router = DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset')
router.register('profile',views.UserProfileViewSet)
router.register('feed',views.UserProfileFeedVie... | true | true |
f7542e205841abba68a7bf9f11b9f9b5d6d3e90b | 6,101 | py | Python | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 20 | 2021-02-07T03:20:39.000Z | 2022-02-18T03:09:48.000Z | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 2 | 2021-04-12T14:33:55.000Z | 2021-10-21T21:49:21.000Z | onmt/translate/translation.py | KaijuML/data2text-macro-plan-py | 17cebc5db507723d601d21a075adea59b0bd9ffb | [
"MIT"
] | 6 | 2021-06-04T08:13:55.000Z | 2022-03-21T18:10:09.000Z | """ Translation main class """
from __future__ import unicode_literals, print_function
import torch
from onmt.inputters.text_dataset import TextMultiField
class TranslationBuilder(object):
"""
Build a word-based translation from the batch output
of translator and the underlying dictionaries.
Replace... | 37.89441 | 78 | 0.561711 | from __future__ import unicode_literals, print_function
import torch
from onmt.inputters.text_dataset import TextMultiField
class TranslationBuilder(object):
def __init__(self, data, fields, n_best=1, replace_unk=False,
has_tgt=False, phrase_table=""):
self.data = data
self.fiel... | true | true |
f7542f96f42dfed78ec29a48a83a1d0a8224aeaf | 250 | py | Python | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | funcx_endpoint/funcx_endpoint/version.py | sirosen/funcX | e41a08ec8d125f0a7c86cf2b3ca1c7e87ed3a0fc | [
"Apache-1.1"
] | null | null | null | # single source of truth for package version,
# see https://packaging.python.org/en/latest/single_source_version/
__version__ = "0.2.3"
VERSION = __version__
# app name to send as part of requests
app_name = "funcX Endpoint v{}".format(__version__)
| 31.25 | 67 | 0.764 | __version__ = "0.2.3"
VERSION = __version__
app_name = "funcX Endpoint v{}".format(__version__)
| true | true |
f754307242a8eb5a9177b06e508ec5e96687206e | 4,588 | py | Python | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | null | null | null | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | null | null | null | common/data/achievements.py | andresokol/vas3k.club | 4163c2c0a337feb492c2e7fbed26e4f44201f269 | [
"MIT"
] | 1 | 2021-10-04T13:45:58.000Z | 2021-10-04T13:45:58.000Z | ACHIEVEMENTS = [
("old", {
"name": "Олды здесь",
"description": "Почётный ранний член Клуба",
"image": "https://i.vas3k.club/3bl.png",
"style": "color: #FFF; background-color: #65c3ba;",
}),
("investor_1000", {
"name": "Ёрли Инвестор",
"description": "Человек,... | 42.091743 | 117 | 0.578248 | ACHIEVEMENTS = [
("old", {
"name": "Олды здесь",
"description": "Почётный ранний член Клуба",
"image": "https://i.vas3k.club/3bl.png",
"style": "color: #FFF; background-color: #65c3ba;",
}),
("investor_1000", {
"name": "Ёрли Инвестор",
"description": "Человек,... | true | true |
f754312d7b17181075436150ae42a5f3e9bdbfe3 | 549 | py | Python | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 19 | 2017-11-20T22:47:12.000Z | 2021-12-23T15:56:41.000Z | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 10 | 2018-01-11T12:53:01.000Z | 2020-01-27T20:05:51.000Z | tests/petstore/user/deleteUser_test.py | andriis/bravado | 0d2ef182df4eb38641282e2f839c4dc813ee4349 | [
"BSD-3-Clause"
] | 4 | 2017-11-18T12:37:14.000Z | 2021-03-19T14:48:13.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
def test_200_success(petstore):
result = petstore.user.deleteUser(username='bozo').result()
assert result is None
@pytest.mark.xfail(reason="Can't get this to 404")
def test_404_user_not_found(petstore):
result = petstore.user.... | 24.954545 | 63 | 0.734062 | from __future__ import print_function
import pytest
def test_200_success(petstore):
result = petstore.user.deleteUser(username='bozo').result()
assert result is None
@pytest.mark.xfail(reason="Can't get this to 404")
def test_404_user_not_found(petstore):
result = petstore.user.deleteUser(username='zzz... | true | true |
f75431893cfd55eb36bb1b9cab14f873ade87a28 | 2,737 | py | Python | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | null | null | null | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | 1 | 2021-06-10T23:05:41.000Z | 2021-06-10T23:05:41.000Z | myproject/blog/views.py | Kumarmanishio/demo-project | 0a5ac91f5c13af27e458dd9821231e501d8dda37 | [
"MIT"
] | null | null | null | from django.views import generic
from .forms import *
from django.shortcuts import render, redirect, get_object_or_404
from .forms import PostForm
from .models import Post, Blog
from django.views.generic import ListView, DetailView
from django.contrib.auth.models import User, auth
from django.contrib import messages
... | 32.583333 | 139 | 0.648155 | from django.views import generic
from .forms import *
from django.shortcuts import render, redirect, get_object_or_404
from .forms import PostForm
from .models import Post, Blog
from django.views.generic import ListView, DetailView
from django.contrib.auth.models import User, auth
from django.contrib import messages
... | true | true |
f754322029843ccce1a236b8896998fc2928fe55 | 87 | py | Python | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | python/dgl/_deprecate/runtime/ir/registry.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | """Module for ir registry."""
from __future__ import absolute_import
IR_REGISTRY = {}
| 17.4 | 38 | 0.747126 | from __future__ import absolute_import
IR_REGISTRY = {}
| true | true |
f754324c1ad4de556043a43003c294d293071ca0 | 2,027 | py | Python | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | skyoffset/diffplot.py | jonathansick/skyoffset | 369f54d8a237f48cd56f550e80bf1d39b355bfcd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Plot distributions of difference pixels.
"""
import os
import numpy as np
import astropy.io.fits
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib.gridspec as gridspec
def plot_diffs(mosaic_d... | 33.783333 | 78 | 0.651209 |
import os
import numpy as np
import astropy.io.fits
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib.gridspec as gridspec
def plot_diffs(mosaic_doc, plot_dir):
if not os.path.exists(plot_dir):
os.makedirs(plot_dir)
for... | true | true |
f75432550332a98e29bcf4a7e601c6121da20aec | 3,914 | py | Python | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | caffe2/python/lazy_dyndep_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | #!/usr/bin/env python3
from hypothesis import given, settings
import hypothesis.strategies as st
from multiprocessing import Process
import numpy as np
import tempfile
import shutil
import caffe2.python.hypothesis_test_util as hu
import unittest
op_engine = 'GLOO'
class TemporaryDirectory:
def __enter__(s... | 29.208955 | 96 | 0.637711 |
from hypothesis import given, settings
import hypothesis.strategies as st
from multiprocessing import Process
import numpy as np
import tempfile
import shutil
import caffe2.python.hypothesis_test_util as hu
import unittest
op_engine = 'GLOO'
class TemporaryDirectory:
def __enter__(self):
self.tmpd... | true | true |
f754350c584489b464236e67f0e6dd48bd3a0548 | 891 | py | Python | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 634 | 2015-10-30T00:55:40.000Z | 2022-03-31T02:59:00.000Z | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 145 | 2015-11-06T00:17:33.000Z | 2022-03-16T13:30:31.000Z | zentral/contrib/inventory/migrations/0038_auto_20180623_1214.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 103 | 2015-11-07T07:08:49.000Z | 2022-03-18T17:34:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-23 12:14
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0037_aut... | 31.821429 | 146 | 0.672278 | from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0037_auto_20180213_1407'),
]
operations = [
migrations.AddField(... | true | true |
f75436c8be361f63a0769f8fb3129023e51e583c | 2,067 | py | Python | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 6 | 2021-02-08T13:00:40.000Z | 2022-02-18T07:11:14.000Z | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | null | null | null | StructuralAnalysis/FrameElements/Element.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 1 | 2022-03-12T03:14:39.000Z | 2022-03-12T03:14:39.000Z | from StructuralAnalysis.Node import Node
from math import sqrt
import numpy as np
from abc import abstractmethod, ABC
from StructuralAnalysis.DegreeOfFreedom import DegreeOfFreedom
from StructuralAnalysis.Section import Section
from StructuralAnalysis.Material import Material
class Element(ABC):
"""
This clas... | 29.112676 | 95 | 0.665699 | from StructuralAnalysis.Node import Node
from math import sqrt
import numpy as np
from abc import abstractmethod, ABC
from StructuralAnalysis.DegreeOfFreedom import DegreeOfFreedom
from StructuralAnalysis.Section import Section
from StructuralAnalysis.Material import Material
class Element(ABC):
id = 1
def ... | true | true |
f75437c38ac5e74cab775c1cd634732632bf57e5 | 169 | py | Python | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | Exercicios_Livros_Algoritmos/b.py | carlosrjhoe/Python | 2df531b23ebbabc40539b09bb2bbdbe1ed1c2164 | [
"MIT"
] | null | null | null | def ceulcius(x):
return (x - 32)/1.8
x = int(input('Digite uma temperatura em (F°): '))
print(f'A temperatura digitada em {x}F°, é igual a {ceulcius(x):.1f}C°') | 33.8 | 72 | 0.615385 | def ceulcius(x):
return (x - 32)/1.8
x = int(input('Digite uma temperatura em (F°): '))
print(f'A temperatura digitada em {x}F°, é igual a {ceulcius(x):.1f}C°') | true | true |
f75438129a425e0d305507b9ef795966818ab6a6 | 147 | py | Python | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | maps_drawer/map_server/mapserverapp/urls.py | ShrirangPatil/My-Expense-Manager | 538c746026e6070410cf784de308e75b99f1b0c4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from mapserverapp import views
urlpatterns = [
path('', views.home,name="home"),
] | 18.375 | 34 | 0.755102 | from django.contrib import admin
from django.urls import path
from mapserverapp import views
urlpatterns = [
path('', views.home,name="home"),
] | true | true |
f75438953d671f90e67ce21d78b65807c6bfe855 | 3,764 | py | Python | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | mks/admin.py | navotsil/Open-Knesset | d6cc6457f87e67a3dbeaec9c1ccbc8d8b7c60c04 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | 30.601626 | 92 | 0.68916 | from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | true | true |
f75439cfa8c8fb1a705def97ed43fe068302fb48 | 255 | py | Python | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 19 | 2021-01-30T03:04:31.000Z | 2022-01-09T10:33:12.000Z | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 4 | 2021-04-15T02:10:53.000Z | 2021-06-24T12:17:29.000Z | luwu/core/models/classifier/kerastuner/__init__.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 5 | 2021-03-02T07:29:12.000Z | 2022-01-09T10:32:49.000Z | # -*- coding: utf-8 -*-
# @Date : 2021-01-07
# @Author : AaronJny
# @LastEditTime : 2021-01-28
# @FilePath : /app/luwu/core/models/classifier/kerastuner/__init__.py
# @Desc :
"""
这是还在规划中的功能,里面的代码目前都是无用的。
TODO:增加KerasTuner相关功能
""" | 25.5 | 73 | 0.615686 | true | true | |
f75439d669a4296738b8f56f0a7ba3491ed6a67a | 14,438 | py | Python | semi/RegexSemI_Laptops11.py | Dagu9/Reinforcement-learning-SGD | eb4a2546d6c99917b33e8cc4c210709e7d4cc15e | [
"Apache-2.0"
] | 2 | 2020-01-20T14:43:27.000Z | 2021-04-29T12:21:05.000Z | semi/RegexSemI_Laptops11.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | semi/RegexSemI_Laptops11.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | 50.482517 | 123 | 0.555756 |
import RegexSemI
import re,os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir)
from utils import ContextLogger
logger = ContextLogger.getLogger('')
class RegexSemI_Laptops11(RegexSemI.RegexSemI):
def __init__(self, repoIn=None):
RegexSemI.RegexSem... | true | true |
f7543a1213624a572b8145ef2cc90ac4735e37a5 | 1,041 | py | Python | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayUserElectronicidOutermerchantbarcodeCreateResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserElectronicidOutermerchantbarcodeCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayUserElectronicidOutermerchantbarcodeCreateResponse, self).__init__()... | 28.916667 | 129 | 0.701249 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserElectronicidOutermerchantbarcodeCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayUserElectronicidOutermerchantbarcodeCreateResponse, self).__init__()
self._barcode = None
self._im... | true | true |
f7543a3d4f27f9ebe1fdebe9b9d70c7e16b6f33f | 10,602 | py | Python | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/holdings_adjustment.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 38.274368 | 343 | 0.649972 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re import six
from lusid.configuration import Configuration
class HoldingsAdjustment(object):
openapi_types = {
'effective_at': 'datetime',
'version': 'Ve... | true | true |
f7543a7606ebd5f26a9916506ef04c6aaa98de0b | 778 | py | Python | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 1 | 2021-03-14T11:56:47.000Z | 2021-03-14T11:56:47.000Z | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 180 | 2019-09-15T19:52:46.000Z | 2021-11-06T23:48:01.000Z | scheduler/models/__init__.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | null | null | null | from .resource import Resource
from .resource_item import ResourceItem
from .location_item import LocationItem
from .location import Location
from .worker_item import WorkerItem
from .worker import Worker
from .schedulable import Schedulable
from .event_item import EventItem
from .event import Event
from .resource_allo... | 35.363636 | 51 | 0.863753 | from .resource import Resource
from .resource_item import ResourceItem
from .location_item import LocationItem
from .location import Location
from .worker_item import WorkerItem
from .worker import Worker
from .schedulable import Schedulable
from .event_item import EventItem
from .event import Event
from .resource_allo... | true | true |
f7543b8da82fe5222bda7e99249205fd9ef2e64e | 11,536 | py | Python | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2021-04-11T08:27:46.000Z | 2021-04-11T08:27:46.000Z | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2022-01-18T12:17:29.000Z | 2022-01-18T12:17:29.000Z | torch/nn/modules/lazy.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 2 | 2021-07-02T10:18:21.000Z | 2021-08-18T10:10:28.000Z | import itertools
from typing_extensions import Protocol
import warnings
import torch
from ..parameter import is_lazy
class _LazyProtocol(Protocol):
"""This is to avoid errors with mypy checks for
The attributes in a mixin:
https://mypy.readthedocs.io/en/latest/more_types.html#mixin-classes
"""
de... | 44.030534 | 116 | 0.635489 | import itertools
from typing_extensions import Protocol
import warnings
import torch
from ..parameter import is_lazy
class _LazyProtocol(Protocol):
def _register_load_state_dict_pre_hook(self, hook):
...
def register_forward_pre_hook(self, hook):
...
def _lazy_load_hook(
sel... | true | true |
f7543c68e14e24782ccdca17860c7773fb8c430f | 3,243 | py | Python | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | ckan_ttnmapper_updater/__init__.py | robputt796/ckan-ttnmapper-updater | 0fa3cee8ca779e8dbe1a69680439fd0a5935eaf0 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import requests
import sys
from requests_toolbelt.multipart.encoder import MultipartEncoder
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
stream=sys.stdout)
TTNMAPPER_URL = "https://www... | 32.108911 | 79 | 0.597903 | import json
import logging
import os
import requests
import sys
from requests_toolbelt.multipart.encoder import MultipartEncoder
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
stream=sys.stdout)
TTNMAPPER_URL = "https://www... | true | true |
f7543cb3e45f0975ed5967c2c4d175c04c685b2c | 5,352 | py | Python | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | 13 | 2021-04-12T02:03:48.000Z | 2022-03-28T02:08:46.000Z | kubernetes_asyncio/client/models/v1_secret_key_selector.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.16.14
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 29.733333 | 133 | 0.59006 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1SecretKeySelector(object):
openapi_types = {
'key': 'str',
'name': 'str',
'optional': 'bool'
}
attribute_map = {
'key': 'key',
'name': 'name',
... | true | true |
f7543e5ada3389bd09767736135e81c00254ec7b | 10,135 | py | Python | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | src/run_utils.py | Alenichel/CodiglioniNichelini_recsys-polimi-2019 | ca97e71da7612644833c20155a0d4d3a57850527 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
from enum import Enum
import numpy as np
import scipy.sparse as sps
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm, trange
from cython_modules.leave_one_out import train_test_loo_split as __train_test_loo_split_cython
from csv_utils import load_csv, export_csv
fro... | 35.437063 | 125 | 0.712087 |
import os
from enum import Enum
import numpy as np
import scipy.sparse as sps
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm, trange
from cython_modules.leave_one_out import train_test_loo_split as __train_test_loo_split_cython
from csv_utils import load_csv, export_csv
from multiprocessing impor... | true | true |
f7543ebffd38c3ba084e7437c65e86cec902cf32 | 4,301 | py | Python | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | estimagic/optimization/broadcast_arguments.py | yradeva93/estimagic | 77d840ba01748314b35be8117c99460a1944062f | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
def broadcast_arguments(**arguments):
"""Broadcast arguments.
All passed keyword arguments are broadcasted to the argument with the most elements.
If `n` is the maximum number of elements per keyword arguments, single elements are
duplicated `n`-times. Arguments with `n` ele... | 32.583333 | 88 | 0.615206 | from pathlib import Path
def broadcast_arguments(**arguments):
dict_args = [
"criterion_kwargs",
"algo_options",
"derivative_kwargs",
"criterion_and_derivative_kwargs",
"numdiff_options",
"log_options",
"error_penalty",
]
for arg in dict_args:
... | true | true |
f7543febde83455ecb1db1a1e090d6aa6df844d9 | 6,913 | py | Python | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | aiocoap/plumbingrequest.py | mguc/aiocoap | a130965a32301a49f77461729b325bc8ed9548bf | [
"MIT"
] | null | null | null | # This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>,
# 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompany... | 44.314103 | 182 | 0.691885 |
from collections import namedtuple
import functools
class PlumbingRequest:
Event = namedtuple("Event", ("message", "exception", "is_last"))
def __init__(self, request, log):
self.request = request
self.log = log
self._event_callbacks = []
def __repr__(self):
return... | true | true |
f7544084e7df1a9f63754b0c589788c012189b37 | 1,370 | py | Python | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/OpenBMI_dataset/Preprocessing/convert_gigamne_to_smt.py | PatternRecognition/OpenBMI | d9291ddb81f4319fb3764d7192e0363939a62ee9 | [
"MIT"
] | 217 | 2015-11-02T11:10:29.000Z | 2022-03-22T07:01:12.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/Preprocessing/convert_gigamne_to_smt.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 24 | 2015-11-02T11:10:45.000Z | 2021-09-08T11:10:33.000Z | PR_BCI_team/Team_StarLab/DKHan/examples/Deep_Learning_Models/Preprocessing/convert_gigamne_to_smt.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 112 | 2016-01-22T01:45:44.000Z | 2022-03-22T07:08:19.000Z | import scipy.io as sio
import numpy as np
import os
import mne
import gigadata
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import ShuffleSplit, cross_val_score
from pyriemann.estimation import Covariances
from mne import Epochs, p... | 24.035088 | 79 | 0.678832 | import scipy.io as sio
import numpy as np
import os
import mne
import gigadata
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import ShuffleSplit, cross_val_score
from pyriemann.estimation import Covariances
from mne import Epochs, p... | true | true |
f75440986efbe9ae69423db68a78c52c8e7604a4 | 1,249 | py | Python | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | 4 | 2020-06-05T20:21:46.000Z | 2021-09-08T00:57:42.000Z | tradgram/chatrooms/views.py | didils/tradgram | 4868ca082ab78a1b5b96f25ee9f958567bd1bb1e | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from django.db.models import Q
class ListAllChatRooms(APIView):
def get(self, request, format=None):
user = request.query_params.get('username', None) ... | 32.868421 | 107 | 0.633307 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from django.db.models import Q
class ListAllChatRooms(APIView):
def get(self, request, format=None):
user = request.query_params.get('username', None) ... | true | true |
f754415af398b7eb97710931c1ce5761e664f879 | 1,917 | py | Python | scripts/clang-tools/run-clang-tools.py | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | kernel/scripts/clang-tools/run-clang-tools.py | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | 1 | 2022-03-29T02:30:28.000Z | 2022-03-30T03:40:46.000Z | kernel/scripts/clang-tools/run-clang-tools.py | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) Google LLC, 2020
#
# Author: Nathan Huckleberry <nhuck@google.com>
#
"""A helper routine run clang-tidy and the clang static-analyzer on
compile_commands.json.
"""
import argparse
import json
import multiprocessing
import os
import subprocess
... | 25.56 | 78 | 0.6265 |
import argparse
import json
import multiprocessing
import os
import subprocess
import sys
def parse_arguments():
usage = """Run clang-tidy or the clang static-analyzer on a
compilation database."""
parser = argparse.ArgumentParser(description=usage)
type_help = "Type of analysis to be performed"... | true | true |
f754427de78981a6ffc574ee4a1f45b69e158aa9 | 3,812 | py | Python | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | cookbook/recipes/plugins/k8s_spark/pyspark_pi.py | pmahindrakar-oss/flytesnacks | 42fcf74f04d50f2527f6f13be72b36ef62e5b7f0 | [
"Apache-2.0"
] | null | null | null | """
.. _intermediate_using_spark_tasks:
Creating spark tasks as part of your workflow OR running spark jobs
------------------------------------------------------------------------
This example shows how flytekit simplifies usage of pyspark in a users code.
The task ``hello_spark`` runs a new spark cluster, which whe... | 38.505051 | 206 | 0.703305 | import datetime
import random
from operator import add
import flytekit
from flytekit import task, workflow
from flytekitplugins.spark import Spark
from recipes.plugins.k8s_spark.dataframe_passing import CONTAINER_TEMPLATE
@task(
task_config=Spark(
spark_conf={
"spark.driver.memory":... | true | true |
f754437b201a22d161c136e60dffe303b0a341a2 | 22,998 | py | Python | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | 3 | 2019-07-02T20:05:35.000Z | 2021-09-14T17:35:25.000Z | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | python/aswfdocker/tests/test_builder.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Tests for the build command
"""
import os
import unittest
import logging
import tempfile
from click.testing import CliRunner
from aswfdocker import builder, aswfinfo, index, constants, groupinfo
fr... | 41.512635 | 110 | 0.454953 |
import os
import unittest
import logging
import tempfile
from click.testing import CliRunner
from aswfdocker import builder, aswfinfo, index, constants, groupinfo
from aswfdocker.cli import aswfdocker
class TestBuilder(unittest.TestCase):
def setUp(self):
self.maxDiff = None
self.build_info = a... | true | true |
f75444b080584cd9c23f6e0a834fecd29d4067a0 | 1,315 | py | Python | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | tool/JwtAuth.py | bw98/webservice-1 | 29fdae2e5db3806bdb828869c86bba31a26615a9 | [
"MIT"
] | null | null | null | import jwt
import datetime
from jwt import exceptions
def createToken(payload, timeout=20) -> str:
"""
:param payload: 例如:{'user_id':1,'username':'whw'}用户信息
:param timeout: token的过期时间,默认20分钟
:return:
"""
headers = {
'typ': 'jwt',
'alg': 'HS256'
}
payload['exp'] = datet... | 25.784314 | 87 | 0.626616 | import jwt
import datetime
from jwt import exceptions
def createToken(payload, timeout=20) -> str:
headers = {
'typ': 'jwt',
'alg': 'HS256'
}
payload['exp'] = datetime.datetime.utcnow() + datetime.timedelta(minutes=timeout)
key = "laiweifeng233"
algorithm = "HS256"
result = jwt... | true | true |
f754452c021e5299f3b9cf525ae78ae28c82e635 | 36,855 | py | Python | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | 1 | 2021-12-04T18:52:04.000Z | 2021-12-04T18:52:04.000Z | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | null | null | null | scripts/gen_vimdoc.py | ThePrimeagen/neovim | 29fd20cd3ad390385f380e0eee003607aa13f6e1 | [
"Vim"
] | null | null | null | #!/usr/bin/env python3
"""Generates Nvim :help docs from C/Lua docstrings, using Doxygen.
Also generates *.mpack files. To inspect the *.mpack structure:
:new | put=v:lua.vim.inspect(msgpackparse(readfile('runtime/doc/api.mpack')))
Flow:
main
extract_from_xml
fmt_node_as_vimhelp \
... | 33.936464 | 87 | 0.540442 | import argparse
import os
import re
import sys
import shutil
import textwrap
import subprocess
import collections
import msgpack
from xml.dom import minidom
MIN_PYTHON_VERSION = (3, 5)
if sys.version_info < MIN_PYTHON_VERSION:
print("requires Python {}.{}+".format(*MIN_PYTHON_VERSION))
sys.exit(1)
DEBUG = (... | true | true |
f754465b816cc33e3e7434556687fbcdef6f0a0b | 125 | py | Python | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 2 | 2019-12-18T15:32:57.000Z | 2020-11-10T00:23:17.000Z | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 1 | 2020-05-02T16:40:59.000Z | 2020-05-02T16:40:59.000Z | dps/parallel/__init__.py | alcinos/dps | 5467db1216e9f9089376d2c71f524ced2382e4f6 | [
"Apache-2.0"
] | 3 | 2019-05-02T15:09:36.000Z | 2020-11-15T10:33:19.000Z | from .base import Operator, Job, ReadOnlyJob
from .object_store import ObjectFragment, FileSystemObjectStore, ZipObjectStore
| 41.666667 | 79 | 0.856 | from .base import Operator, Job, ReadOnlyJob
from .object_store import ObjectFragment, FileSystemObjectStore, ZipObjectStore
| true | true |
f75446ed0f9a5a02b6688b04b31609052fcd0736 | 785 | py | Python | froide/account/migrations/0010_auto_20171011_2152.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | null | null | null | froide/account/migrations/0010_auto_20171011_2152.py | manonthemat/froide | 698c49935eaf2e922f3c9f6a46af0fd545ccbbbb | [
"MIT"
] | 3 | 2017-12-08T21:32:01.000Z | 2017-12-09T20:31:53.000Z | froide/account/migrations/0010_auto_20171011_2152.py | ashmpace/question-mtl | 5ce1289cd6db0e629aa138d2dee235d9a4c4546b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-11 19:52
from __future__ import unicode_literals
from django.db import migrations
from ..hashers import PBKDF2WrappedSHA1PasswordHasher
def forwards_func(apps, schema_editor):
User = apps.get_model('account', 'User')
users = User.objects.filter... | 27.068966 | 64 | 0.698089 | from __future__ import unicode_literals
from django.db import migrations
from ..hashers import PBKDF2WrappedSHA1PasswordHasher
def forwards_func(apps, schema_editor):
User = apps.get_model('account', 'User')
users = User.objects.filter(password__startswith='sha1$')
hasher = PBKDF2WrappedSHA1PasswordHash... | true | true |
f754472c7ad3aaab1fc100dc6e3247a4d26aa105 | 649 | py | Python | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 74 | 2017-08-28T02:42:59.000Z | 2022-02-12T02:11:05.000Z | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 1 | 2018-02-09T08:50:00.000Z | 2018-02-09T08:50:00.000Z | camera-python/05-streaming/stream_pi.py | ReemDAlsh/camera-python-opencv | 6adb12b682907554645211217e970480685347b0 | [
"BSD-2-Clause"
] | 42 | 2017-08-17T10:25:07.000Z | 2021-07-16T11:07:13.000Z | #!/usr/bin/python
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w|
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# Copyright (c) 2014, raspberrypi.com.tw
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author : sosorr... | 29.5 | 90 | 0.560863 |
from time import time
class Camera(object):
def __init__(self):
self.frames = [open("static/" + f + '.jpg', 'rb').read() for f in ['1', '2', '3']]
def get_frame(self):
return self.frames[int(time()) % 3]
| true | true |
f754477ee8a1f28dcb55b28d1d929927030fdc4c | 538 | py | Python | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 49 | 2019-09-09T13:57:01.000Z | 2022-01-17T15:12:09.000Z | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 44 | 2019-09-11T19:10:05.000Z | 2021-12-21T14:33:35.000Z | test_zc.py | eavanvalkenburg/sia-ha | 9ec5e9329593307609a5f11290ade21c567a5556 | [
"MIT"
] | 12 | 2019-12-13T17:33:31.000Z | 2021-12-21T19:57:46.000Z | from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" %... | 26.9 | 66 | 0.685874 | from zeroconf import ServiceBrowser, Zeroconf
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" %... | true | true |
f75448560d7eff60c0664fe18b8095836fe7f33b | 2,475 | py | Python | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 86 | 2019-08-01T04:45:31.000Z | 2021-12-23T07:08:08.000Z | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 15 | 2019-08-01T00:14:53.000Z | 2020-11-20T16:53:02.000Z | pytorch_sound/data/eng_handler/__init__.py | AppleHolic/pytorch_sound | 2320516d21d70c406d1dee74927e238972c96106 | [
"BSD-2-Clause"
] | 9 | 2019-08-23T18:32:02.000Z | 2022-02-17T07:13:28.000Z | import re
from typing import List, Dict
from pytorch_sound.data.eng_handler import cleaners
from pytorch_sound.data.eng_handler.symbols import symbols
# Mappings from symbol to numeric ID and vice versa:
_symbol_to_id: Dict[str, int] = {s: i for i, s in enumerate(symbols)}
_id_to_symbol: Dict[int, str] = {i: s for i,... | 32.565789 | 96 | 0.654141 | import re
from typing import List, Dict
from pytorch_sound.data.eng_handler import cleaners
from pytorch_sound.data.eng_handler.symbols import symbols
_symbol_to_id: Dict[str, int] = {s: i for i, s in enumerate(symbols)}
_id_to_symbol: Dict[int, str] = {i: s for i, s in enumerate(symbols)}
_curly_re = re.compile(r'... | true | true |
f754495235a5672cda57cfa5a9fda0b07d68af99 | 8,153 | py | Python | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | 1 | 2020-08-02T21:43:39.000Z | 2020-08-02T21:43:39.000Z | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | null | null | null | pyfan/amto/array/geomspace.py | FanWangEcon/pyfan | 126e91c0c6d930f1c335a07396d1d2145b247cea | [
"MIT"
] | 1 | 2020-12-02T06:45:20.000Z | 2020-12-02T06:45:20.000Z | '''
Created on May 24, 2018
@author: fan
To have a better grid denser at the beginning
'''
import time as time
import numpy as np
from numba import jit
import logging
logger = logging.getLogger(__name__)
# @vectorize([float64(float64, float64, float64, float64, float64, float64, float64, float64)])
def grid_to_... | 27.921233 | 98 | 0.614988 |
import time as time
import numpy as np
from numba import jit
import logging
logger = logging.getLogger(__name__)
def grid_to_geom_short(choice_grid, choice_grid_max, choice_grid_min,
start, stop, num, geom_ratio, a):
scaler = (choice_grid_max - choice_grid_min) / (stop - start)
__, ... | true | true |
f7544953966445dc946abd83a98b9cae5d70464b | 1,740 | py | Python | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 237 | 2018-09-18T00:47:14.000Z | 2022-03-21T21:43:07.000Z | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 409 | 2018-09-18T01:02:29.000Z | 2022-01-24T20:51:58.000Z | quarkchain/evm/bloom.py | anshulkusa/pyquarkchain | af80b6fdd331c69ce1bc801caf7c2cdd1e82a435 | [
"MIT"
] | 125 | 2018-09-18T00:47:28.000Z | 2022-03-24T20:00:46.000Z | from quarkchain.utils import sha3_256
from quarkchain.evm import utils
"""
Blooms are the 3-point, 2048-bit (11-bits/point) Bloom filter of each
component (except data) of each log entry of each transaction.
We set the bits of a 2048-bit value whose indices are given by
the low order 11-bits
of the first three double... | 23.513514 | 88 | 0.674713 | from quarkchain.utils import sha3_256
from quarkchain.evm import utils
BUCKETS_PER_VAL = 3
def safe_ord(value):
if isinstance(value, int):
return value
else:
return ord(value)
def bloom(val: bytes):
return bloom_insert(0, val)
def bloom_insert(bloom: int, val: bytes):
h = sha3_25... | true | true |
f75449609b968da28999a1bba9040d3894757566 | 734 | py | Python | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 3,380 | 2018-09-11T05:03:31.000Z | 2022-03-31T20:04:57.000Z | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 3,142 | 2018-09-14T10:09:00.000Z | 2022-03-31T18:25:44.000Z | tensorflow_datasets/audio/gtzan_music_speech/__init__.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | 1,438 | 2018-09-16T13:58:22.000Z | 2022-03-31T11:19:54.000Z | # 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 38.631579 | 92 | 0.777929 |
from tensorflow_datasets.audio.gtzan_music_speech.gtzan_music_speech import GTZANMusicSpeech
| true | true |
f7544a4c0eeba3f6e085824492ebc6436e696eeb | 5,541 | py | Python | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | configs/rfcn/rfcn_r101_caffe_1x_voc0712.py | tf2cvtk/mmdetection | da6768e8543f06bbdda85425f6879d42594d48b0 | [
"Apache-2.0"
] | null | null | null | # model settings
norm_cfg = dict(type='BN', requires_grad=False)
model = dict(
type='RFCN',
pretrained='open-mmlab://resnet101_caffe',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(2, 3),
frozen_stages=1,
dilations=(1, 1, 1, 2),
s... | 29.31746 | 78 | 0.586176 | norm_cfg = dict(type='BN', requires_grad=False)
model = dict(
type='RFCN',
pretrained='open-mmlab://resnet101_caffe',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(2, 3),
frozen_stages=1,
dilations=(1, 1, 1, 2),
strides=(1, 2, 2, ... | true | true |
f7544cc06a806cf7902382bc081a48224a6c378f | 2,452 | py | Python | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/dupe/DupeIntRequestor.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for DupeIntRequestor ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class DupeIntRequestorConsts():
pass
class DupeIntRequestor(ManagedObject):
"""This ... | 49.04 | 249 | 0.664763 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class DupeIntRequestorConsts():
pass
class DupeIntRequestor(ManagedObject):
consts = DupeIntRequestorConsts()
naming_props = set([u'name'])
mo_meta = MoMeta("Dup... | true | true |
f7544dc3dea542a00f1bf792afe808d74e1ecc54 | 6,171 | py | Python | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | niftynet/layer/discrete_label_normalisation.py | amh28/NIF | 92a2f447738224fb10b83fa60c78a35e0c25ac34 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import os
import numpy as np
import tensorflow as tf
import niftynet.utilities.histogram_standardisation as hs
from niftynet.layer.base_layer import DataDependentLayer
from niftynet.layer.base_layer import Invertible
from niftyn... | 41.14 | 80 | 0.637822 | from __future__ import absolute_import, print_function, division
import os
import numpy as np
import tensorflow as tf
import niftynet.utilities.histogram_standardisation as hs
from niftynet.layer.base_layer import DataDependentLayer
from niftynet.layer.base_layer import Invertible
from niftynet.utilities.user_parame... | true | true |
f7544dd2d55339cc78d870af64e6a745bd580ede | 458 | py | Python | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | plataforma/migrations/0010_auto_20160916_1724.py | SurielRuano/Orientador-Legal | a3be31d6019bcf254c3dcbbb26b4ffbbc85a9871 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-16 17:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plataforma', '0009_auto_20160914_1632'),
]
operations = [
migrations.AlterFie... | 21.809524 | 51 | 0.624454 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plataforma', '0009_auto_20160914_1632'),
]
operations = [
migrations.AlterField(
model_name='articulo',
name='contenido',
... | true | true |
f7544e3d9bbfd77dfa96b0ca9630d8ea444d821a | 2,074 | py | Python | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | .travis.py | revenantkoi/Hacktoberfest-1 | de57b59c6fb0b6222ca7fa422e421d842fd4b0d4 | [
"MIT"
] | null | null | null | import json
import os
import re
import subprocess
# Get a diff between master and current.
try:
commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
except KeyError:
print("🔥 This should be run on Travis. Otherwise make sure... | 31.907692 | 123 | 0.66972 | import json
import os
import re
import subprocess
try:
commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
except KeyError:
print("🔥 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.")
exit(1)
cha... | true | true |
f7544eb4e823465424b741f328f137c045f6eefc | 228 | py | Python | pychron/hardware/kerr/tests/kerr_motor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/hardware/kerr/tests/kerr_motor.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/hardware/kerr/tests/kerr_motor.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | import unittest
class KerrMotorTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False)
def test_float_to_hexstr(self):
pass
if __name__ == '__main__':
unittest.main()
| 17.538462 | 43 | 0.692982 | import unittest
class KerrMotorTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False)
def test_float_to_hexstr(self):
pass
if __name__ == '__main__':
unittest.main()
| true | true |
f7544ec7da5c54a03efb3811e3ccc85087073912 | 270 | py | Python | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 42 | 2017-04-26T09:26:35.000Z | 2022-02-28T09:10:33.000Z | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 2 | 2017-12-21T03:54:08.000Z | 2021-01-07T11:20:16.000Z | src/imports/libmodules.py | coallaoh/GuidedLabelling | ff208cf2a06361ccd4f3cca2f092c49664c17be5 | [
"MIT"
] | 9 | 2017-11-22T15:27:38.000Z | 2021-01-05T06:42:38.000Z | __author__ = 'joon'
from pascaltools.process import get_pascal_classes, get_pascal_classes_bg
from pascaltools.io import get_pascal_indexlist, load_pascal_annotation, load_pascal_conf
from seedtools.heatmap import heatmap2segconf
from densecrftools.densecrf import CRF
| 38.571429 | 89 | 0.877778 | __author__ = 'joon'
from pascaltools.process import get_pascal_classes, get_pascal_classes_bg
from pascaltools.io import get_pascal_indexlist, load_pascal_annotation, load_pascal_conf
from seedtools.heatmap import heatmap2segconf
from densecrftools.densecrf import CRF
| true | true |
f7544f0c5f85a8bcc058a5c6cd72f1f35e3b7b30 | 4,551 | py | Python | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/paster.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | from pyramid.scripting import prepare
from pyramid.scripts.common import get_config_loader
def setup_logging(config_uri, global_conf=None):
"""
Set up Python logging with the filename specified via ``config_uri``
(a string in the form ``filename#sectionname``).
Extra defaults can optionally be specifi... | 40.633929 | 79 | 0.698528 | from pyramid.scripting import prepare
from pyramid.scripts.common import get_config_loader
def setup_logging(config_uri, global_conf=None):
loader = get_config_loader(config_uri)
loader.setup_logging(global_conf)
def get_app(config_uri, name=None, options=None):
loader = get_config_loader(config_uri)
... | true | true |
f7544fe1e35f0d42ae6be50aac482836c4abef11 | 1,021 | py | Python | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | tests/universal_functions_tests/true_divide_tests/broadcast.py | manopapad/legate.numpy | 896f4fd9b32db445da6cdabf7b78d523fca96936 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 26.179487 | 74 | 0.716944 |
import random
import numpy as np
import legate.numpy as lg
def test():
anp = np.random.randn(4, 5)
b = random.randint(1, 13)
a = lg.array(anp)
assert np.array_equal(lg.true_divide(a, b), np.true_divide(anp, b))
assert np.array_equal(lg.true_divide(b, a), np.true_divide(b, anp))
r... | true | true |
f7545139f8aa8a4049960100adf00482c131a711 | 3,832 | py | Python | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | Monty Hall/Monty Hall.py | 1218muskan/Python-mini-Projects | 726ac5604ced777d3bafa88fe03efb5fe113b599 | [
"MIT"
] | null | null | null | import random
import sys
# Ascii art - made of ascii characters
ALL_CLOSED = """
+------+ +------+ +------+
| | | | | |
| 1 | | 2 | | 3 |
| | | | | |
| | | | | |
| | | | | |
+------+ +------+ +------+"""
FIRST_GOAT = """
+------+ +-... | 24.253165 | 88 | 0.411795 | import random
import sys
ALL_CLOSED = """
+------+ +------+ +------+
| | | | | |
| 1 | | 2 | | 3 |
| | | | | |
| | | | | |
| | | | | |
+------+ +------+ +------+"""
FIRST_GOAT = """
+------+ +------+ +------+
| (( | | | | ... | true | true |
f75453004f1e13abfdb09cd70d0534e93749c122 | 18,871 | py | Python | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 2 | 2020-07-10T07:49:52.000Z | 2020-11-15T13:20:52.000Z | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 1 | 2020-04-20T20:37:48.000Z | 2020-04-20T20:37:48.000Z | psi/context/plugin.py | psiexperiment/psiexperiment | 2701558e1d0637b8a5d6762912dfb5c183f3be87 | [
"MIT"
] | 3 | 2020-04-17T15:03:36.000Z | 2022-01-14T23:19:29.000Z | import logging
log = logging.getLogger(__name__)
import pickle as pickle
from copy import deepcopy
import numpy as np
from atom.api import Typed, Bool, Str, observe, Property
from enaml.application import deferred_call
from enaml.layout.api import InsertItem, InsertTab
from enaml.workbench.plugin import P... | 38.27789 | 93 | 0.622066 | import logging
log = logging.getLogger(__name__)
import pickle as pickle
from copy import deepcopy
import numpy as np
from atom.api import Typed, Bool, Str, observe, Property
from enaml.application import deferred_call
from enaml.layout.api import InsertItem, InsertTab
from enaml.workbench.plugin import P... | true | true |
f7545305feb98c045b9bc3bf8843bb99bbd0317c | 15,803 | py | Python | svenzva_drivers/src/svenzva_drivers/joint_trajectory_action_controller.py | mwrightE38/svenzva_ros | c9c46b267b2ee5e0b95ce6a57f87a302ae289753 | [
"BSD-3-Clause"
] | null | null | null | svenzva_drivers/src/svenzva_drivers/joint_trajectory_action_controller.py | mwrightE38/svenzva_ros | c9c46b267b2ee5e0b95ce6a57f87a302ae289753 | [
"BSD-3-Clause"
] | null | null | null | svenzva_drivers/src/svenzva_drivers/joint_trajectory_action_controller.py | mwrightE38/svenzva_ros | c9c46b267b2ee5e0b95ce6a57f87a302ae289753 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2017 Svenzva Robotics, 2010-2011, Antons Rebguns.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... | 46.343109 | 203 | 0.644435 |
from __future__ import division
from threading import Thread
import rospy
import actionlib
from std_msgs.msg import Float64
from svenzva_msgs.msg import MotorState, MotorStateList
from trajectory_msgs.msg import JointTrajectory
from control_msgs.msg import FollowJointTrajectoryAction
from control_msgs.msg import Fol... | false | true |
f7545327792a3d76aca986324a1914e3c3f840b5 | 1,110 | py | Python | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | 2 | 2019-07-17T15:45:25.000Z | 2021-08-10T18:27:43.000Z | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | null | null | null | unplugged/services/admin/views/scheduler.py | fakegit/unplugged | 755227a5319ea443c3d8f1356380981430c80419 | [
"MIT"
] | 1 | 2019-11-23T08:30:40.000Z | 2019-11-23T08:30:40.000Z | from rest_framework import permissions, serializers, viewsets
from ....models import FailedToParseScheduleException, Schedule, parse_schedule_trigger
from .shared import ADMIN_RENDERER_CLASSES
class ScheduleSerializer(serializers.HyperlinkedModelSerializer):
plugin_id = serializers.IntegerField()
kwargs = se... | 30 | 87 | 0.723423 | from rest_framework import permissions, serializers, viewsets
from ....models import FailedToParseScheduleException, Schedule, parse_schedule_trigger
from .shared import ADMIN_RENDERER_CLASSES
class ScheduleSerializer(serializers.HyperlinkedModelSerializer):
plugin_id = serializers.IntegerField()
kwargs = se... | true | true |
f7545396270a77f42d1a95e8973344065f2ab681 | 55,275 | py | Python | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.606436 | 135 | 0.664731 | import functools
from copy import deepcopy
from typing import TYPE_CHECKING, Dict, Any, Union, cast, Mapping
from xml.etree.ElementTree import ElementTree
from azure.core.paging import ItemPaged
from azure.core.exceptions import ResourceNotFoundError
from azure.core.pipeline import Pipeline
from azure.core.pipeline.po... | true | true |
f75453a7f3b4a0223035ecc8e49c01041eeeb289 | 7,759 | py | Python | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 794 | 2020-06-23T12:37:36.000Z | 2021-07-09T15:58:11.000Z | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 46 | 2020-06-27T18:13:41.000Z | 2021-07-12T10:49:00.000Z | ggshield/utils.py | GitGuardian/gg-shield | f3c480ec9726151855498112427bad5565b9c2f6 | [
"MIT"
] | 42 | 2020-06-28T08:31:15.000Z | 2021-07-09T15:58:14.000Z | import os
import re
import traceback
from enum import Enum
from typing import Iterable, List, Optional
import click
import urllib3
from pygitguardian import GGClient
from pygitguardian.models import Match
from requests import Session
from .text_utils import Line, LineCategory
REGEX_PATCH_HEADER = re.compile(
r"... | 28.630996 | 99 | 0.601624 | import os
import re
import traceback
from enum import Enum
from typing import Iterable, List, Optional
import click
import urllib3
from pygitguardian import GGClient
from pygitguardian.models import Match
from requests import Session
from .text_utils import Line, LineCategory
REGEX_PATCH_HEADER = re.compile(
r"... | true | true |
f754550f95d57ccf52957450c8bf23ef74b5db3d | 11,089 | py | Python | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 2,209 | 2016-11-20T10:32:58.000Z | 2022-03-31T20:51:27.000Z | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,074 | 2016-12-07T05:02:48.000Z | 2022-03-22T02:09:11.000Z | dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_platform.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 147 | 2016-12-11T04:13:28.000Z | 2022-03-27T14:50:00.000Z | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): # issue3762
de... | 39.045775 | 113 | 0.518802 | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
def test_architecture_via_symlink(self): def get(python... | true | true |
f754555bc986b02847e530d99d54c978f834e444 | 117 | py | Python | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 10 | 2015-08-31T10:38:24.000Z | 2021-09-30T06:39:13.000Z | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | null | null | null | wafw00f/plugins/wallarm.py | wizard531/wafw00f | dce0d0616db0f970013432c520b51aeef62d387f | [
"BSD-3-Clause"
] | 17 | 2015-07-24T20:40:23.000Z | 2021-01-08T19:41:18.000Z | #!/usr/bin/env python
NAME = 'Wallarm'
def is_waf(self):
return self.matchheader(('server', "nginx-wallarm"))
| 14.625 | 56 | 0.666667 |
NAME = 'Wallarm'
def is_waf(self):
return self.matchheader(('server', "nginx-wallarm"))
| true | true |
f7545569a2a5def0e1b180e52ae8eb829ba7cd54 | 366 | py | Python | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | 2 | 2020-11-24T14:16:38.000Z | 2021-03-16T19:29:45.000Z | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | 2 | 2020-11-25T01:00:45.000Z | 2020-11-25T01:59:58.000Z | src/package_controller/library/utils/git/format_commit_description.py | alexseitsinger/package_controller | 0ee896986cfa17a96bf9fb6afff35dd97f0b1211 | [
"BSD-2-Clause"
] | null | null | null | import textwrap
import re
from .format_commit_text import format_commit_text
RE_DESCRIPTION_DELIMITER = r"(?![\w\d])\.\s+"
def format_commit_description(description):
text = " ".join([
format_commit_text(x)
for x in re.split(RE_DESCRIPTION_DELIMITER, description)
if len(x)
])
ret... | 21.529412 | 64 | 0.68306 | import textwrap
import re
from .format_commit_text import format_commit_text
RE_DESCRIPTION_DELIMITER = r"(?![\w\d])\.\s+"
def format_commit_description(description):
text = " ".join([
format_commit_text(x)
for x in re.split(RE_DESCRIPTION_DELIMITER, description)
if len(x)
])
ret... | true | true |
f754563318feceac7088b40b3a94be0125581cda | 11,248 | py | Python | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 1 | 2021-06-10T23:59:44.000Z | 2021-06-10T23:59:44.000Z | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/ops/dirichlet_multinomial.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 1 | 2021-12-16T05:34:55.000Z | 2021-12-16T05:34:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.520548 | 80 | 0.676831 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.distributions.python.ops import distribution
from tensorflow.contrib.distributions.python.ops import distribution_util
from tensorflow.python.framework import ops
from tensorflow.python... | true | true |
f754567f14c01a86e958e120364d0746992d6385 | 837 | py | Python | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | 1 | 2018-09-05T08:51:24.000Z | 2018-09-06T14:56:30.000Z | test/test_broadcast.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
RadioManager
RadioManager # noqa: E501
OpenAPI spec version: 2.0
Contact: support@pluxbox.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.models.b... | 20.414634 | 79 | 0.692951 |
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.models.broadcast import Broadcast from radiomanager_sdk.rest import ApiException
class TestBroadcast(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testBroa... | true | true |
f754571f9690bc4a3864af091aa06b05827178b6 | 1,524 | py | Python | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | app.py | Azmal16/Covid_Symptoms_Predict_with_Machine_Learning | d1e1fde73aa307bdbcfeac27088f49e4c1cb4555 | [
"MIT"
] | null | null | null | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['GET', 'POST'])
def predict():
'''
For renderin... | 41.189189 | 299 | 0.71063 | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['GET', 'POST'])
def predict():
int_features = [int(... | true | true |
f7545816d0f4e8c7cd324ed28315f1207c7259b7 | 2,965 | py | Python | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/coverage.py | frkl/BitSend | aa64f4bfbda7459393b972e4c48f22081db6e233 | [
"MIT"
] | 1 | 2018-09-27T14:30:20.000Z | 2018-09-27T14:30:20.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
This module contains utilities for doing coverage analysis on the RPC
interface.
It provides a way t... | 27.71028 | 79 | 0.660708 |
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper(object):
def __init__(self, auth_service_proxy_instance, coverage_logfile=None):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
def __getattr__(self, *a... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.