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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71ff5e2374591301bbf01a9ea272bd250502167 | 7,448 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | 33.102222 | 156 | 0.733217 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Instruction(Base):
_SDM_NAME = 'instruction'
def __init__(self, parent):
super(Instruction, self).__init__(parent)
@property
def Actions(self):
from ixnetwork_restpy.testplatform.se... | true | true |
f71ff7f5175b2552338f6b41f9f1520efde5ebe9 | 1,203 | py | Python | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | # from model.base.fcn import CustomFcn
# from model.best.fcn import DeepLabv3Fcn
# from model.better.fcn import Resnet101Fcn
# from model.sota.fcn import LightFcn
from model.alexnet.alexnet_model import AlexNet
from model.lenet5.lenet_5_model import LeNet5
from model.vggnet.vggnet16 import VGG16
from model.densenet.den... | 36.454545 | 86 | 0.758936 |
from model.alexnet.alexnet_model import AlexNet
from model.lenet5.lenet_5_model import LeNet5
from model.vggnet.vggnet16 import VGG16
from model.densenet.densenet_model import DenseNet121
from model.resnet.resnet34_model import resnet34
from model.resnet.resnet101_model import resnet101, resnet50
from model.cotnet.... | true | true |
f71ff8d04b827e68cb215f95a82095cadf50e4ca | 1,094 | py | Python | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=10
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(1) # number=2
pr... | 22.326531 | 64 | 0.608775 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(1)
prog += H(2)
prog += H(3)
prog += Y(3)
prog... | true | true |
f71ff98e011cc1d66aab1506e6db05f161b7b1cb | 150 | py | Python | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def home(request):
return render(request, 'blog/index.html', {'title': 'Home'})
| 16.666667 | 64 | 0.7 | from django.shortcuts import render
def home(request):
return render(request, 'blog/index.html', {'title': 'Home'})
| true | true |
f71ffa32ecb22bbfb515cf38fa8b15f86b7fb720 | 5,517 | py | Python | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | 4 | 2019-05-11T01:21:15.000Z | 2020-02-08T18:00:39.000Z | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | null | null | null | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | null | null | null | import click
import time
import platform
import os
from minifier import minify
from .board import Board, BoardException, DirectoryExistsError
from .board import PyboardError
_board = None
@click.group()
@click.option(
"--port",
"-p",
envvar="ATRON_PORT",
default="",
type=click.STRING,
help="N... | 25.780374 | 138 | 0.589813 | import click
import time
import platform
import os
from minifier import minify
from .board import Board, BoardException, DirectoryExistsError
from .board import PyboardError
_board = None
@click.group()
@click.option(
"--port",
"-p",
envvar="ATRON_PORT",
default="",
type=click.STRING,
help="N... | true | true |
f71ffa36ec9cfc1d58a5f56d219d392194ca7a79 | 331 | py | Python | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | f = open('surf.txt')
notas = []
nomes = []
for linha in f:
nome, pontos = linha.split()
notas.append(float(pontos))
nomes.append(nome)
f.close()
notas.sort(reverse=True)
nomes.sort(reverse=True)
print ('%s %4.2f' %(nomes[0], notas[0]))
print ('%s %4.2f' %(nomes[1], notas[1]))
print ('%s %4.2f' %(nomes[2], n... | 22.066667 | 40 | 0.601208 | f = open('surf.txt')
notas = []
nomes = []
for linha in f:
nome, pontos = linha.split()
notas.append(float(pontos))
nomes.append(nome)
f.close()
notas.sort(reverse=True)
nomes.sort(reverse=True)
print ('%s %4.2f' %(nomes[0], notas[0]))
print ('%s %4.2f' %(nomes[1], notas[1]))
print ('%s %4.2f' %(nomes[2], n... | true | true |
f71ffa96a121e4b599332fda00ecec1c3e395215 | 381 | py | Python | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
app = Flask('sayhello')
app.config.from_pyfile('settings.py')
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
db = SQLAlchemy(app)
bootstrap = Bootstrap(app)
moment... | 23.8125 | 44 | 0.808399 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
app = Flask('sayhello')
app.config.from_pyfile('settings.py')
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
db = SQLAlchemy(app)
bootstrap = Bootstrap(app)
moment... | true | true |
f71ffb327a8627122eb965383d8d9493e4611a68 | 23,768 | py | Python | examples/sentence_similarity/gensen_train.py | gohanlon/nlp | 7b07109a2066eb2152c370ef38600230668a9c8d | [
"MIT"
] | 4,407 | 2019-10-29T21:35:19.000Z | 2022-03-31T13:56:37.000Z | examples/sentence_similarity/gensen_train.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 134 | 2019-10-30T23:38:59.000Z | 2022-03-01T11:42:53.000Z | examples/sentence_similarity/gensen_train.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 726 | 2019-10-31T15:21:52.000Z | 2022-03-31T10:18:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
The GenSen training process follows the steps:
1. Create or load the dataset vocabulary
2. Train on the training dataset for each batch epoch (batch size = 48 updates)
3. Eval... | 36.849612 | 96 | 0.51847 |
import argparse
import json
import logging
import os
import time
import horovod.torch as hvd
import mlflow
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as f
import torch.optim as optim
from utils_nlp.models.gensen.multi_task_model import Mu... | true | true |
f71ffb8011fd1e0f44abc963af4799e254cbef2d | 6,006 | py | Python | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 13 | 2020-08-18T18:47:11.000Z | 2022-03-30T08:07:25.000Z | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 2 | 2021-05-07T03:56:11.000Z | 2021-08-10T04:18:21.000Z | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 5 | 2020-12-21T17:29:29.000Z | 2022-02-15T07:51:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
----------------------------------------------------------
@file: acoustic_docking.py
@date: Wed Jun 3, 2020
@author: Alejandro Gonzalez Garcia
@e-mail: alexglzg97@gmail.com
@brief: Motion planning. ROS node to follow an acoustic
signal for ... | 33.741573 | 145 | 0.604729 |
import math
import time
import os
import numpy as np
import rospy
from geometry_msgs.msg import Pose, Pose2D, PoseArray
from std_msgs.msg import Int32, Float32MultiArray, Float64, String
from visualization_msgs.msg import Marker, MarkerArray
class AcousticDocking:
def __init__(self):
self.ned_x = 0
... | true | true |
f71ffbe737f15846e14c72d6820690ac7cf93d67 | 4,873 | py | Python | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 15 | 2021-06-07T14:25:35.000Z | 2021-12-26T16:41:01.000Z | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 1 | 2022-03-11T01:03:12.000Z | 2022-03-11T01:03:12.000Z | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 2 | 2021-06-19T05:41:05.000Z | 2022-03-23T11:51:06.000Z | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
class MaskedLinear(nn.Module):
def __init__(self, base_layer, m_in, m_out):
"""
The standard nn.Linear layer, but with gradient masking to enforce the LULA construction.
"""
super(MaskedLinea... | 32.059211 | 141 | 0.60353 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
class MaskedLinear(nn.Module):
def __init__(self, base_layer, m_in, m_out):
super(MaskedLinear, self).__init__()
W_base = base_layer.weight.data.clone()
n_out, n_in = W_base.shape
... | true | true |
f71ffe7210fe58d0bbb802af2106a7f260b2e296 | 5,184 | py | Python | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | 4 | 2021-04-26T07:24:27.000Z | 2022-01-17T23:10:47.000Z | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | null | null | null | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Some useful POD-Variables
# The Program names:
PROGRAMS = [ "1A", "1B", "1C", "1D",
"2A", "2B", "2C", "2D",
"3A", "3B", "3C", "3D",
"4A", "4B", "4C", "4D",
"5A", "5B", "5C", "5D",
"6A", "6B", "6C", "6D",
"7A", "7B",... | 33.882353 | 103 | 0.470486 |
PROGRAMS = [ "1A", "1B", "1C", "1D",
"2A", "2B", "2C", "2D",
"3A", "3B", "3C", "3D",
"4A", "4B", "4C", "4D",
"5A", "5B", "5C", "5D",
"6A", "6B", "6C", "6D",
"7A", "7B", "7C", "7D",
"8A", "8B", "8C", "8D",
"9A", ... | true | true |
f71fff32cfd2c5d668696fc8401b13ffda826fad | 118 | py | Python | commands/enlist.py | SirChopwood/Arma-3-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | 1 | 2020-10-30T18:37:39.000Z | 2020-10-30T18:37:39.000Z | commands/enlist.py | SirChopwood/Requisitions-Officer-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | null | null | null | commands/enlist.py | SirChopwood/Requisitions-Officer-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | null | null | null | async def Main(self, message, command, arguments):
await self.run_file("section_slot_assign", message, arguments)
| 39.333333 | 66 | 0.771186 | async def Main(self, message, command, arguments):
await self.run_file("section_slot_assign", message, arguments)
| true | true |
f71fffe42a961cd5e75a8c0d5975af883c4d0f2f | 2,763 | py | Python | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 22 | 2016-04-05T14:56:11.000Z | 2022-02-03T02:52:23.000Z | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 2 | 2016-04-28T08:45:16.000Z | 2017-04-24T21:55:37.000Z | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 3 | 2017-04-23T16:47:33.000Z | 2020-08-05T16:14:49.000Z | """Highly unreliable way to register "preflight hooks", which are run every time you run a script (but not an editor action)."""
from __future__ import absolute_import, division, print_function
def run():
print(u"Installing preflight hooks...")
# There's no official way to add hooks that run before every... | 49.339286 | 587 | 0.631198 |
from __future__ import absolute_import, division, print_function
def run():
print(u"Installing preflight hooks...")
# However Pythonista's preflight code imports pythonista_startup once to check what names it contains.
try:
import builtins
except ImportError:
import... | true | true |
f7200016b3e4bb76f1473df3974edfb197cc475a | 2,321 | py | Python | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2015-09-25T16:03:32.000Z | 2015-09-25T16:03:32.000Z | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-17T12:26:45.000Z | 2020-07-17T12:26:45.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
from cryptography.exception... | 37.435484 | 79 | 0.734166 |
from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
from cryptography.exceptions import InternalError, _Reasons
from cryptography.hazmat.backends import _available_backends
from cryptography.hazmat.primitives.ciphers import Cipher, CipherAlgorithm
from cry... | true | true |
f720016578b11272f4a943f87114d1bf4673f739 | 15,319 | py | Python | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 42.671309 | 546 | 0.687447 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetRegisteredServerResult',
'AwaitableGetRegisteredServerResult',
'get_registered_server',
]
warnings.warn("""The 'latest' version is deprecat... | true | true |
f72001cd4e99d72b538406d817ae842ce6ada978 | 37,141 | py | Python | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import prod... | 61.593698 | 584 | 0.675991 |
from decimal import Decimal
from itertools import product
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
find_output,
)
import json
import os
MAX_BIP125_RBF_SEQUENCE =... | true | true |
f72001fbbd35b8a678f898e1db551767c3665048 | 30,425 | py | Python | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | 2 | 2017-01-20T15:26:25.000Z | 2017-08-03T04:38:08.000Z | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | # Generated by Django 1.11.18 on 2019-01-28 14:05
import re
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import django_fsm
import model_utils.fields
from django.db import migrations, models
import waldur_azure.validators
import waldur_core.core.fields
import waldur_core.... | 36.745169 | 199 | 0.396647 |
import re
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import django_fsm
import model_utils.fields
from django.db import migrations, models
import waldur_azure.validators
import waldur_core.core.fields
import waldur_core.core.models
import waldur_core.core.shims
import ... | true | true |
f7200243f3b4d289ac50951e7f5c03cf8e464b4c | 7,970 | py | Python | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 41 | 2016-12-01T08:46:06.000Z | 2021-06-24T21:14:33.000Z | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 42 | 2017-02-23T14:52:49.000Z | 2021-02-01T10:43:52.000Z | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 21 | 2016-08-25T15:02:12.000Z | 2021-05-27T04:09:40.000Z | #!/home/daniel/anaconda3/bin/python
# -*- coding: utf-8 -*-
"""
================================================
rewrite_monitoring
================================================
This program rewrites a monitoring time series files into the correct
time order
"""
# Author: fvj
# License: BSD 3 clause
import date... | 33.628692 | 77 | 0.408281 |
import datetime
import atexit
import numpy as np
import os
from pyrad.io import read_monitoring_ts, write_monitoring_ts
from pyrad.graph import plot_monitoring_ts
from pyrad.io import generate_field_name_str, get_fieldname_pyart
print(__doc__)
def main():
input_base = (
'/store/msrad/radar/pyra... | true | true |
f72002f8e1ad1752270b6c4051b237ce04dec27e | 13,299 | py | Python | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\jog_interaction.py
# Compiled at: 2020-07-22 05:56:20
# Size of source mod 2**32: 16676... | 50.759542 | 471 | 0.666892 |
from _math import Vector3
import itertools, random
from balloon.tunable_balloon import TunableBalloon
from element_utils import do_all
from event_testing.results import TestResult
from interactions import TargetType
from interactions.base.super_interaction import SuperInteraction
from interactions.constraints imp... | true | true |
f72003c0391c7dabf487c7375b1a310ce99ae57b | 2,718 | py | Python | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... | 34.405063 | 105 | 0.577999 |
import unittest
import itertools
import numpy as np
from parameterized import parameterized
from qiskit import QuantumCircuit, QuantumRegister
from qiskit import execute as q_execute
from qiskit.quantum_info import state_fidelity
from qiskit.aqua import get_aer_backend
from test.common import QiskitA... | true | true |
f72005233f11455f1e95662ff8e8514dc68a23af | 3,738 | py | Python | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | 1 | 2021-09-05T14:18:00.000Z | 2021-09-05T14:18:00.000Z | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | null | null | null | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | null | null | null | """Let's Encrypt user-supplied configuration."""
import os
import urlparse
import zope.interface
from acme import challenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
class NamespaceConfig(object):
"""Configuration wrapper around :class:`argparse.Namesp... | 32.789474 | 80 | 0.697164 | import os
import urlparse
import zope.interface
from acme import challenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
class NamespaceConfig(object):
zope.interface.implements(interfaces.IConfig)
def __init__(self, namespace):
self.namespace... | true | true |
f72005518b34101337fb593f9f38ae1ba0642602 | 8,708 | py | Python | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | null | null | null | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | 11 | 2020-07-31T05:48:51.000Z | 2022-01-16T08:03:28.000Z | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GUI import
import tkinter as tk
# Styling the GUI
from tkinter import ttk
# Database connection
from modules.create_db_components import create_connection
# Deletes the ticket from the database
from modules.removing_tickets import delete_ticket
"""This module is used to ... | 30.989324 | 87 | 0.598071 |
import tkinter as tk
from tkinter import ttk
from modules.create_db_components import create_connection
from modules.removing_tickets import delete_ticket
__author__ = "Datta Adithya"
__credits__ = ["Datta Adithya"]
__license__ = "MIT"
__maintainer__ = "Datta Adithya"
__email__ = "dat.adithya@gmail.com"
... | true | true |
f720055934c6413aad908cb155527edb52b40062 | 1,116 | py | Python | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from logging import DEBUG
from logging import INFO
from logging import Formatter
from logging import StreamHandler
from logging import getLogger
from sys import stderr
from sys import stdout
class LogLevelFilter:
def __init__(self, level):
self.__level = level
... | 25.953488 | 82 | 0.728495 |
from logging import DEBUG
from logging import INFO
from logging import Formatter
from logging import StreamHandler
from logging import getLogger
from sys import stderr
from sys import stdout
class LogLevelFilter:
def __init__(self, level):
self.__level = level
def filter(self, log_record):
... | true | true |
f720066904260a4d87d72e6f5790ddf77d44d217 | 101 | py | Python | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=1603 lang=python3
#
# [1603] running-sum-of-1d-array
#
None
# @lc code=end | 14.428571 | 42 | 0.673267 |
None
| true | true |
f72006ab8586955d57cb0232db8f0b952693aca0 | 1,522 | py | Python | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | 1 | 2019-12-27T17:50:59.000Z | 2019-12-27T17:50:59.000Z | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | null | null | null | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
try:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except IOError:
long_description = 'Python module to get stock data from ... | 30.44 | 83 | 0.61498 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
try:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except IOError:
long_description = 'Python module to get stock data from ... | true | true |
f72007805c2d3ca886d768516835db709c0dc08b | 1,117 | py | Python | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | import requests, csv, sys, os, time, json, codecs
server = "https://cloudrf.com"
# dir = "calculations/antennas_1W_2m"
# Open CSV file
import codecs
# csvfile = csv.reader(codecs.open('antennas.csv', 'rU', 'utf-16'))
uid = 'YOUR CLOUDRF UID HERE'
key = 'YOUR CLOUDRF KEY HERE'
def calc_area(dir,csv... | 27.243902 | 68 | 0.554163 | import requests, csv, sys, os, time, json, codecs
server = "https://cloudrf.com"
import codecs
uid = 'YOUR CLOUDRF UID HERE'
key = 'YOUR CLOUDRF KEY HERE'
def calc_area(dir,csvfile_loc):
n = 0
csvfile = csv.DictReader(open(csvfile_loc))
if not os.path.exists(dir):
os.makedi... | true | true |
f72008a164fc940a1cd12de39700a25410e41ad5 | 3,485 | py | Python | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null |
import smart_imports
smart_imports.all()
class Bill(django_models.Model):
CAPTION_MIN_LENGTH = 6
CAPTION_MAX_LENGTH = 256
created_at = django_models.DateTimeField(auto_now_add=True, null=False)
updated_at = django_models.DateTimeField(auto_now_add=True, null=False) # MUST setupped by hand
vot... | 42.5 | 145 | 0.766428 |
import smart_imports
smart_imports.all()
class Bill(django_models.Model):
CAPTION_MIN_LENGTH = 6
CAPTION_MAX_LENGTH = 256
created_at = django_models.DateTimeField(auto_now_add=True, null=False)
updated_at = django_models.DateTimeField(auto_now_add=True, null=False)
voting_end_at = django_mod... | true | true |
f72008f42f54ea078b631fc42689eec8279d667b | 486 | py | Python | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution:
def furthestBuilding(self, H, bricks, ladders):
jumps_pq = []
for i in range(len(H) - 1):
jump_height = H[i + 1] - H[i]
if jump_height <= 0: continue
heappush(jumps_pq, jump_height)
if len(jumps_pq) > ladders:
bricks -=... | 28.588235 | 57 | 0.522634 | class Solution:
def furthestBuilding(self, H, bricks, ladders):
jumps_pq = []
for i in range(len(H) - 1):
jump_height = H[i + 1] - H[i]
if jump_height <= 0: continue
heappush(jumps_pq, jump_height)
if len(jumps_pq) > ladders:
bricks -=... | true | true |
f72008f569b6e13c90d5063ad392e029122f1919 | 228 | py | Python | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | from itertools import product
listA = list(map(int, input().split()))
listB = list(map(int, input().split()))
productLists = list(product(listA, listB))
for i in range(len(productLists)):
print(productLists[i], end=" ")
| 20.727273 | 42 | 0.684211 | from itertools import product
listA = list(map(int, input().split()))
listB = list(map(int, input().split()))
productLists = list(product(listA, listB))
for i in range(len(productLists)):
print(productLists[i], end=" ")
| true | true |
f7200945eace3e7c67af32832e8436d62e73a7ee | 3,102 | py | Python | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | # Coyright 2017-2019 Nativepython Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 31.333333 | 83 | 0.640554 |
from nativepython.type_wrappers.wrapper import Wrapper
import nativepython.native_ast as native_ast
class RangeWrapper(Wrapper):
is_pod = True
is_empty = False
is_pass_by_ref = False
def __init__(self):
super().__init__((range, "type"))
def getNativeLayoutType(self):
... | true | true |
f72009f2a950749e199cacf800fa7cbce9a95e33 | 1,856 | py | Python | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 13,653 | 2017-09-19T15:56:02.000Z | 2022-03-31T18:55:07.000Z | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 3,623 | 2017-09-20T02:50:20.000Z | 2022-03-31T06:37:25.000Z | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 4,130 | 2017-09-19T17:36:34.000Z | 2022-03-31T12:54:55.000Z | from abc import abstractmethod
from typing import Any, Optional
from mlagents_envs.base_env import BaseEnv
class BaseRegistryEntry:
def __init__(
self,
identifier: str,
expected_reward: Optional[float],
description: Optional[str],
):
"""
BaseRegistryEntry allows... | 32.561404 | 87 | 0.649246 | from abc import abstractmethod
from typing import Any, Optional
from mlagents_envs.base_env import BaseEnv
class BaseRegistryEntry:
def __init__(
self,
identifier: str,
expected_reward: Optional[float],
description: Optional[str],
):
self._identifier = identifier
... | true | true |
f7200a2703afba3d344293f747d73f0e8c66c472 | 14,266 | py | Python | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 41.71345 | 517 | 0.683233 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetRegisteredServerResult',
'AwaitableGetRegisteredServerResult',
'get_registered_server',
]
@pulumi.output_type
class GetRegisteredServerResu... | true | true |
f7200af076a3e5be760cbc8be2e5197296b523de | 428 | py | Python | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | from .models import ExamVenue
from django.forms import ModelForm
class RestrictedResponseForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RestrictedResponseForm, self).__init__(*args,**kwargs)
try:
self.fields['assigned_venue'].queryset = ExamVenue.objects.filter(exam=self.i... | 35.666667 | 102 | 0.700935 | from .models import ExamVenue
from django.forms import ModelForm
class RestrictedResponseForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RestrictedResponseForm, self).__init__(*args,**kwargs)
try:
self.fields['assigned_venue'].queryset = ExamVenue.objects.filter(exam=self.i... | true | true |
f7200b2aa450884bed39014c6f0f6fc44dd2a5aa | 4,253 | py | Python | src/Infraestructura/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | 3 | 2017-09-03T22:01:35.000Z | 2019-01-10T05:40:44.000Z | src/web/CygnusCloud/modules/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | null | null | null | src/web/CygnusCloud/modules/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
'''
========================================================================
CygnusCloud
========================================================================
File: configuration.py
Version: 3.0
Description: Database configurator... | 36.350427 | 151 | 0.556078 |
import MySQLdb
import os.path
from ccutils.processes.childProcessManager import ChildProcessManager
class DBConfigurator(object):
def __init__(self, rootPassword):
self.__rootPassword = rootPassword
def addUser(self, user, password, databaseName, allPrivileges=True):
conn = MySQLdb.C... | true | true |
f7200b3bdc7b35e8600608ed9b126abac2ec17a1 | 557 | py | Python | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-11 01:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0023_auto_20200311_0137'),
]
operations =... | 25.318182 | 125 | 0.653501 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0023_auto_20200311_0137'),
]
operations = [
migrations.AlterField(
model_name='product',
... | true | true |
f7200b4756a033cb419019d6f292992490dafe65 | 28,992 | py | Python | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | 4 | 2020-01-27T15:37:19.000Z | 2020-12-06T02:51:03.000Z | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | 1 | 2021-05-07T22:01:41.000Z | 2021-05-07T22:01:41.000Z | import abc
import torch.nn
import itertools
from typing import Optional, Tuple, Union
__all__ = ["Manifold", "ScalingInfo"]
class ScalingInfo(object):
"""
Scaling info for each argument that requires rescaling.
.. code:: python
scaled_value = value * scaling ** power if power != 0 else value
... | 30.485804 | 117 | 0.559051 | import abc
import torch.nn
import itertools
from typing import Optional, Tuple, Union
__all__ = ["Manifold", "ScalingInfo"]
class ScalingInfo(object):
NotCompatible = object()
__slots__ = ["kwargs", "results"]
def __init__(self, *results: float, **kwargs: float):
self.results = results
... | true | true |
f7200b476d9f3051e09445e9614d3e89cf93fb90 | 256 | py | Python | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
app_name = 'recipe'
urlpatterns = [
path('', include(router.urls))
]
| 17.066667 | 48 | 0.734375 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
app_name = 'recipe'
urlpatterns = [
path('', include(router.urls))
]
| true | true |
f7200bcd5453259f229956e2f1faa902e06be465 | 6,058 | py | Python | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 1 | 2021-06-10T18:00:03.000Z | 2021-06-10T18:00:03.000Z | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 1 | 2021-05-29T00:57:16.000Z | 2021-05-29T00:57:16.000Z | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 2 | 2021-11-16T01:49:54.000Z | 2022-01-14T04:03:23.000Z | #!/usr/bin/env python3
import math
import numpy as np
from common.numpy_fast import interp
from common.cached_params import CachedParams
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.co... | 40.657718 | 108 | 0.73176 |
import math
import numpy as np
from common.numpy_fast import interp
from common.cached_params import CachedParams
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.longcontrol... | true | true |
f7200bced83e516dd159f591c79e95855c52a38f | 23,009 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 may ... | 53.509302 | 241 | 0.690556 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f7200c78df71a4b408145caba6e03ce542b4d9df | 3,753 | py | Python | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from openslides_backend.permissions.permissions import Permissions
from tests.system.action.base import BaseActionTestCase
class MotionCommentSectionSortActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.permission_test_model = {
"motion_comment_section/31": ... | 34.75 | 75 | 0.501998 | from openslides_backend.permissions.permissions import Permissions
from tests.system.action.base import BaseActionTestCase
class MotionCommentSectionSortActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.permission_test_model = {
"motion_comment_section/31": ... | true | true |
f7200c97efca195813bca2dc2b1dffe77ce84bea | 4,104 | py | Python | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | 8 | 2020-06-05T16:30:36.000Z | 2021-09-28T08:39:52.000Z | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | 8 | 2020-04-04T11:24:26.000Z | 2021-05-09T18:53:53.000Z | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests the includeconf argument
Verify that:
1. adding includeconf to the configuration file causes the inc... | 49.445783 | 231 | 0.694932 |
import os
from test_framework.test_framework import BitcoinTestFramework
class IncludeConfTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
def setup_chain(self):
super().setup_chain()
with open(os.pa... | true | true |
f72010304316b8649123167ea9d4b94f50b6f1f1 | 25,588 | py | Python | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/public-utilities | 663e94f2657a02a4249177945e0880bb968c3439 | [
"Apache-2.0"
] | null | null | null | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/public-utilities | 663e94f2657a02a4249177945e0880bb968c3439 | [
"Apache-2.0"
] | 48 | 2020-10-30T10:15:39.000Z | 2022-03-25T17:23:57.000Z | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/plaid-utilities | 1031cb87580bbe110f56455925e483a0ae177fe1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import filecmp
import os
import unittest
from unittest import TestCase
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from p... | 40.745223 | 126 | 0.523409 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import filecmp
import os
import unittest
from unittest import TestCase
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from plaidcloud.utilities.connect import ... | true | true |
f7201125ce532819474be57b6c62cb7fcba4cd59 | 33,749 | py | Python | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2019-07-27T11:54:33.000Z | 2021-06-06T11:53:36.000Z | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 12 | 2019-04-15T15:27:23.000Z | 2019-07-01T18:13:10.000Z | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-06-03T19:54:48.000Z | 2021-06-03T19:54:48.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 us... | 44.406579 | 83 | 0.518919 |
import sys
import unittest
import pandas as pd
from apache_beam.dataframe import doctests
from apache_beam.dataframe.pandas_top_level_functions import _is_top_level_function
@unittest.skipIf(sys.platform == 'win32', '[BEAM-10626]')
class DoctestTest(unittest.TestCase):
def test_ndframe_tests(self)... | true | true |
f720120c884a1396999a7662659cbb6bb8cb01bb | 811 | py | Python | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validate_json.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 35.26087 | 77 | 0.644883 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validate_json.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportErr... | true | true |
f72012960cef127dbd4634d4f311534488584e40 | 27,649 | py | Python | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 1 | 2015-10-05T22:03:10.000Z | 2015-10-05T22:03:10.000Z | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
Module to manage filesystem snapshots with snapper
.. versionadded:: 2016.11.0
:codeauthor: Duncan Mac-Vicar P. <dmacvicar@suse.de>
:codeauthor: Pablo Suárez Hernández <psuarezhernandez@suse.de>
:depends: ``dbus`` Python module.
:depends: ``snapper`` http://snapper.io, a... | 30.823857 | 126 | 0.619733 |
from __future__ import absolute_import, unicode_literals, print_function
import logging
import os
import time
import difflib
try:
from pwd import getpwuid
HAS_PWD = True
except ImportError:
HAS_PWD = False
from salt.exceptions import CommandExecutionError
import salt.utils.files
from salt.ext import s... | true | true |
f72013a2dc273fdddd592328a01ea75807d6c262 | 1,098 | py | Python | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2019 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 30.5 | 74 | 0.762295 |
from __future__ import absolute_import, division, print_function
from unittest import TestCase
import pytest
from polyaxon_sdk import V1Run
from polyaxon.managers.run import RunManager
@pytest.mark.managers_mark
class TestRunManager(TestCase):
def test_default_props(self):
assert RunM... | true | true |
f720140e054f1279701550bef9197a63ff8e51bf | 88,490 | py | Python | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | '''
Created on Oct 20, 2020
@author: chb69
'''
import sys
import os
import types
import mysql.connector
from mysql.connector import errorcode
import csv
import argparse
"""
this list includes the prefixes for several informatics resources found in the PheKnowLator mapping data.
This might be useful ... | 44.691919 | 234 | 0.609108 |
import sys
import os
import types
import mysql.connector
from mysql.connector import errorcode
import csv
import argparse
config = {}
def load_config(root_path, filename):
filename = os.path.join(root_path, filename)
d = types.ModuleType("config")
d.__file__ = filename
return_dict = {}
try:
... | true | true |
f7201460d7fc455a3f1d476f67b45706ae5482ed | 4,736 | py | Python | baselines/Termination_DEOC/run_atari_miniworld.py | anandkamat05/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 5 | 2020-11-10T21:38:04.000Z | 2021-08-11T01:34:50.000Z | baselines/Termination_DEOC/run_atari_miniworld.py | LARS12llt/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 8 | 2020-09-26T01:31:02.000Z | 2022-02-10T02:19:53.000Z | baselines/Termination_DEOC/run_atari_miniworld.py | LARS12llt/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 1 | 2020-11-18T03:20:26.000Z | 2020-11-18T03:20:26.000Z | # !/usr/bin/env python
from baselines.common import set_global_seeds, tf_util as U
from baselines import bench
import os.path as osp
import gym, logging
from mpi4py import MPI
import pdb
from gym_extensions.continuous import mujoco
import gym_miniworld
from baselines import logger
import sys
def train(env_id, num_tim... | 47.36 | 174 | 0.655617 |
from baselines.common import set_global_seeds, tf_util as U
from baselines import bench
import os.path as osp
import gym, logging
from mpi4py import MPI
import pdb
from gym_extensions.continuous import mujoco
import gym_miniworld
from baselines import logger
import sys
def train(env_id, num_timesteps, seed, num_opti... | true | true |
f72014b925bc545ca989597e22d048c3a184e38f | 1,430 | py | Python | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | import os, sys, time, Transposition.transpositionEncrypt as ENC, \
Transposition.transpositionDecrypt as DEC
def main():
f_key = 10
# f_mode = 'encrypt'
f_mode = 'decrypt'
if f_mode == 'decrypt':
input_filename = 'frankenstein.encrypt.txt'
else:
input_filename = 'frankenstein.t... | 28.039216 | 88 | 0.636364 | import os, sys, time, Transposition.transpositionEncrypt as ENC, \
Transposition.transpositionDecrypt as DEC
def main():
f_key = 10
f_mode = 'decrypt'
if f_mode == 'decrypt':
input_filename = 'frankenstein.encrypt.txt'
else:
input_filename = 'frankenstein.txt'
output_file... | true | true |
f720154bd7ce3ed32ed597d87d874fe71e148ab1 | 7,664 | py | Python | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 1 | 2022-03-02T00:28:04.000Z | 2022-03-02T00:28:04.000Z | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 1 | 2022-03-01T06:10:50.000Z | 2022-03-01T06:10:50.000Z | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | null | null | null | # Owner(s): ["oncall: jit"]
from typing import Any, Dict, List, Optional, Tuple
from torch.testing._internal.jit_utils import JitTestCase, make_global
from torch.testing import FileCheck
from torch import jit
from jit.test_module_interface import TestModuleInterface # noqa: F401
import os
import sys
import torch
imp... | 33.762115 | 106 | 0.584551 |
from typing import Any, Dict, List, Optional, Tuple
from torch.testing._internal.jit_utils import JitTestCase, make_global
from torch.testing import FileCheck
from torch import jit
from jit.test_module_interface import TestModuleInterface
import os
import sys
import torch
import torch.testing._internal.jit_utils
i... | true | true |
f72015bb9160c0942bb83fe1f3d4aa6377a9797d | 5,563 | py | Python | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | import json
from config import Config
import elasticsearch
import time
from datetime import datetime
import logging
from opencensus.trace import execution_context
from opencensus.trace import span as span_module
import semver
class ElasticClient:
es = None
lastReconnectAttempt = None
mapping = {}
natlasIndices = ... | 35.660256 | 145 | 0.732339 | import json
from config import Config
import elasticsearch
import time
from datetime import datetime
import logging
from opencensus.trace import execution_context
from opencensus.trace import span as span_module
import semver
class ElasticClient:
es = None
lastReconnectAttempt = None
mapping = {}
natlasIndices = ... | true | true |
f7201983075ff6e117cd811c5af6d092bb3c77bd | 79,711 | py | Python | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-06-12T00:09:40.000Z | 2020-06-12T00:09:40.000Z | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import json
import logging
import mimetypes
import os
import re
from datetime import datetime, time, timedelta
from decimal import Decimal, DecimalException
from urllib.parse import urlencode
import vat_moss.id
from django.conf import settings
from django.contrib import messages
from django.core.files import File
from... | 42.264581 | 154 | 0.575303 | import json
import logging
import mimetypes
import os
import re
from datetime import datetime, time, timedelta
from decimal import Decimal, DecimalException
from urllib.parse import urlencode
import vat_moss.id
from django.conf import settings
from django.contrib import messages
from django.core.files import File
from... | true | true |
f7201a7642abbd76d0bee748789b15d308c71b10 | 9,682 | py | Python | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 19 | 2016-03-07T12:34:22.000Z | 2020-06-11T11:09:02.000Z | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 40 | 2016-06-13T15:36:54.000Z | 2020-11-10T18:14:43.000Z | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 15 | 2016-06-10T22:06:01.000Z | 2020-12-15T18:37:42.000Z | #!/usr/bin/env python
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
... | 68.666667 | 232 | 0.727639 |
import argparse
import sys
sys.path.append("../")
class _HelpAction(argparse._HelpAction):
def __call__(self, parser, namespace, values, option_string=None):
parser.print_help()
subparsers_actions = [
action for action in parser._actions
if isi... | true | true |
f7201ae4d61deb09277603a9c4d12dfb5b5dd40b | 1,565 | py | Python | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 830 | 2016-11-07T21:46:27.000Z | 2022-03-23T08:01:03.000Z | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 26 | 2016-11-07T22:06:31.000Z | 2022-02-16T00:18:29.000Z | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 168 | 2016-11-07T21:48:55.000Z | 2022-03-19T02:47:14.000Z | """A python client interface for ProofAssistantService."""
from __future__ import absolute_import
from __future__ import division
# Import Type Annotations
from __future__ import print_function
import grpc
import tensorflow as tf
from deepmath.proof_assistant import proof_assistant_pb2
from deepmath.proof_assistant im... | 36.395349 | 80 | 0.771885 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import grpc
import tensorflow as tf
from deepmath.proof_assistant import proof_assistant_pb2
from deepmath.proof_assistant import proof_assistant_pb2_grpc
tf.flags.DEFINE_string(
'proof_assistant_server_a... | true | true |
f7201bd62f21c953c3e3878bc9213acf8336f68d | 1,120 | py | Python | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | from PIL import Image
from torch.utils.data import Dataset
from src.data_utils.utils import load_data
class ImageDataset(Dataset):
def __init__(self, samples: list, transform, preload: bool = False, num_workers=None):
self.transform = transform
self.samples = samples
self.targets = [label... | 31.111111 | 101 | 0.63125 | from PIL import Image
from torch.utils.data import Dataset
from src.data_utils.utils import load_data
class ImageDataset(Dataset):
def __init__(self, samples: list, transform, preload: bool = False, num_workers=None):
self.transform = transform
self.samples = samples
self.targets = [label... | true | true |
f7201d90ee64fded6d4df4a84c0dcb782c4684f0 | 20,761 | py | Python | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 7 | 2020-02-12T03:06:52.000Z | 2021-06-10T19:33:14.000Z | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | # commit.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from gitdb import IStream
from git.util import (
hex_to_bin,
Actor,
Iterable,
Stats,
... | 38.878277 | 119 | 0.607822 |
from gitdb import IStream
from git.util import (
hex_to_bin,
Actor,
Iterable,
Stats,
finalize_process
)
from git.diff import Diffable
from .tree import Tree
from . import base
from .util import (
Traversable,
Serializable,
parse_date,
altz_to_utctz_str,
parse_actor_and_dat... | true | true |
f7201e595590259f3f2e768dbecb2c84ac98021f | 14,932 | py | Python | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | # %matplotlib notebook
import os, re, sys, urllib, requests, base64, IPython, io, pickle, glob
sys.path.append("/home/monoid/Development/fresh_atomizer_checks/atomizer/SBMLparser/test/manual")
import itertools as itt
import numpy as np
import subprocess as sb
import pandas as pd
import matplotlib.pyplot as plt
import m... | 47.858974 | 141 | 0.575676 |
import os, re, sys, urllib, requests, base64, IPython, io, pickle, glob
sys.path.append("/home/monoid/Development/fresh_atomizer_checks/atomizer/SBMLparser/test/manual")
import itertools as itt
import numpy as np
import subprocess as sb
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpi... | true | true |
f7201f03fb11fc26e5295dea810629ac3fa330da | 5,030 | py | Python | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | from os.path import join
from email.mime.image import MIMEImage
from django.conf import settings
from django.forms import ModelForm, ValidationError, ChoiceField
from django.forms.models import BaseInlineFormSet
from django.forms.models import inlineformset_factory
from django.contrib.auth.forms import ReadOnlyPasswor... | 43.362069 | 110 | 0.663022 | from os.path import join
from email.mime.image import MIMEImage
from django.conf import settings
from django.forms import ModelForm, ValidationError, ChoiceField
from django.forms.models import BaseInlineFormSet
from django.forms.models import inlineformset_factory
from django.contrib.auth.forms import ReadOnlyPasswor... | true | true |
f7201f3e709cd60912d88e118c8edfe5cfcff4bb | 136 | py | Python | dora/tests/test_share.py | kingjr/dora | f70fab1620c6cad6fc094be15ab22994bd08dd01 | [
"MIT"
] | null | null | null | dora/tests/test_share.py | kingjr/dora | f70fab1620c6cad6fc094be15ab22994bd08dd01 | [
"MIT"
] | null | null | null | dora/tests/test_share.py | kingjr/dora | f70fab1620c6cad6fc094be15ab22994bd08dd01 | [
"MIT"
] | null | null | null | from dora.share import dump, load
def test_dump_load():
x = [1, 2, 4, {'youpi': 'test', 'b': 56.3}]
assert load(dump(x)) == x
| 19.428571 | 47 | 0.566176 | from dora.share import dump, load
def test_dump_load():
x = [1, 2, 4, {'youpi': 'test', 'b': 56.3}]
assert load(dump(x)) == x
| true | true |
f7201f51ef7235aa37e52cd053e5a1d6d1e724eb | 4,346 | py | Python | kale/utils/download.py | SheffieldAI/pykale | be7670941fb06835883c80477b26702d407017db | [
"MIT"
] | 324 | 2020-11-05T19:07:11.000Z | 2022-03-16T21:31:39.000Z | kale/utils/download.py | SheffieldAI/pykale | be7670941fb06835883c80477b26702d407017db | [
"MIT"
] | 212 | 2020-10-31T15:18:59.000Z | 2022-03-25T14:13:09.000Z | kale/utils/download.py | sz144/pykale | 1f5cce57a50f7772520a482e8135a391eb0517f5 | [
"MIT"
] | 52 | 2020-10-28T15:43:48.000Z | 2022-02-24T02:29:52.000Z | # ===============================================================================
# Author: Xianyuan Liu, xianyuan.liu@outlook.com
# Raivo Koot, rekoot1@sheffield.ac.uk
# Haiping Lu, h.lu@sheffield.ac.uk or hplu@ieee.org
# ===============================================================================
... | 46.731183 | 135 | 0.654395 |
import logging
import os
from pathlib import Path
from torch.hub import download_url_to_file
from torchvision.datasets.utils import download_and_extract_archive, download_file_from_google_drive, extract_archive
def download_file_by_url(url, output_directory, output_file_name, file_format=None):
output_di... | true | true |
f7202019c7b0f25327f421ee4dd02e608acbb151 | 581 | py | Python | snooker/models/snooker_org/player.py | mgorsk1/snooker | 97a3868bd47c3aa3f134d34ee65e8dab21b98227 | [
"Apache-2.0"
] | 1 | 2021-04-11T17:48:28.000Z | 2021-04-11T17:48:28.000Z | snooker/models/snooker_org/player.py | mgorsk1/snooker | 97a3868bd47c3aa3f134d34ee65e8dab21b98227 | [
"Apache-2.0"
] | 4 | 2021-04-11T17:26:23.000Z | 2021-04-12T06:46:24.000Z | snooker/models/snooker_org/player.py | mgorsk1/snooker | 97a3868bd47c3aa3f134d34ee65e8dab21b98227 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from dataclasses_json import dataclass_json
from snooker.models import JsonModel
@dataclass_json
@dataclass
class Player(JsonModel):
ID: int
Type: int
FirstName: str
MiddleName: str
LastName: str
TeamName: str
TeamNumber: int
TeamSeason: int
Shor... | 17.088235 | 43 | 0.678141 | from dataclasses import dataclass
from dataclasses_json import dataclass_json
from snooker.models import JsonModel
@dataclass_json
@dataclass
class Player(JsonModel):
ID: int
Type: int
FirstName: str
MiddleName: str
LastName: str
TeamName: str
TeamNumber: int
TeamSeason: int
Shor... | true | true |
f7202096a51dcc8e270109c64d1240dfd04ce0a3 | 2,783 | py | Python | jr/plot/meg.py | kingjr/jr-tools | 8a4c9c42a9e36e224279566945e798869904c4c8 | [
"BSD-2-Clause"
] | 11 | 2016-01-21T22:41:28.000Z | 2018-10-07T12:55:18.000Z | jr/plot/meg.py | kingjr/jr-tools | 8a4c9c42a9e36e224279566945e798869904c4c8 | [
"BSD-2-Clause"
] | 2 | 2016-12-12T14:25:47.000Z | 2018-05-07T18:57:42.000Z | jr/plot/meg.py | kingjr/jr-tools | 8a4c9c42a9e36e224279566945e798869904c4c8 | [
"BSD-2-Clause"
] | 17 | 2016-03-15T17:34:04.000Z | 2020-03-15T00:31:14.000Z | import matplotlib.pyplot as plt
import numpy as np
from . import pretty_plot
def plot_butterfly(evoked, ax=None, sig=None, color=None, ch_type=None):
from mne import pick_types
if ch_type is not None:
picks = pick_types(evoked.info, ch_type)
evoked = evoked.copy()
evoked = evoked.pick_... | 40.333333 | 75 | 0.565936 | import matplotlib.pyplot as plt
import numpy as np
from . import pretty_plot
def plot_butterfly(evoked, ax=None, sig=None, color=None, ch_type=None):
from mne import pick_types
if ch_type is not None:
picks = pick_types(evoked.info, ch_type)
evoked = evoked.copy()
evoked = evoked.pick_... | true | true |
f72020bbaf98f9d38b10dfa1e51aa9ccf67bf9f2 | 7,055 | py | Python | phdhelper/suMMSary/suMMSary.py | jmsplank/phdhelper | c06dd06669b42dbe4c9e1a6eeec3d0ad3885d2eb | [
"MIT"
] | null | null | null | phdhelper/suMMSary/suMMSary.py | jmsplank/phdhelper | c06dd06669b42dbe4c9e1a6eeec3d0ad3885d2eb | [
"MIT"
] | null | null | null | phdhelper/suMMSary/suMMSary.py | jmsplank/phdhelper | c06dd06669b42dbe4c9e1a6eeec3d0ad3885d2eb | [
"MIT"
] | null | null | null | import numpy as np
import pyspedas
from phdhelper.helpers import title_print
from phdhelper.helpers.CONSTANTS import c, k_B, m_e, m_i, mu_0, q
from pytplot import data_quants
import matplotlib.pyplot as plt
from datetime import datetime as dt
from cached_property import cached_property
class EventHandler:
FPI = N... | 30.021277 | 86 | 0.569667 | import numpy as np
import pyspedas
from phdhelper.helpers import title_print
from phdhelper.helpers.CONSTANTS import c, k_B, m_e, m_i, mu_0, q
from pytplot import data_quants
import matplotlib.pyplot as plt
from datetime import datetime as dt
from cached_property import cached_property
class EventHandler:
FPI = N... | true | true |
f7202111926ff8fda7156a7c3de15389c446a8d2 | 1,643 | py | Python | models.py | Joshua-Barawa/MyHome | 99b5a96f2d7f442afcccfbf042b10a94e0684ee3 | [
"PostgreSQL",
"Unlicense"
] | null | null | null | models.py | Joshua-Barawa/MyHome | 99b5a96f2d7f442afcccfbf042b10a94e0684ee3 | [
"PostgreSQL",
"Unlicense"
] | null | null | null | models.py | Joshua-Barawa/MyHome | 99b5a96f2d7f442afcccfbf042b10a94e0684ee3 | [
"PostgreSQL",
"Unlicense"
] | null | null | null | from run import db
from flask_login import UserMixin
class Post(db.Model):
__tablename__ = "posts"
id = db.Column(db.Integer, primary_key=True)
image = db.Column(db.Text)
location = db.Column(db.String(255))
title = db.Column(db.String(255))
description = db.Column(db.String)
price = db.Co... | 31.596154 | 81 | 0.664029 | from run import db
from flask_login import UserMixin
class Post(db.Model):
__tablename__ = "posts"
id = db.Column(db.Integer, primary_key=True)
image = db.Column(db.Text)
location = db.Column(db.String(255))
title = db.Column(db.String(255))
description = db.Column(db.String)
price = db.Co... | true | true |
f720216f491ba23be45a34478f494e95df19d04f | 1,046 | py | Python | perceptron/perceptron.py | coderatwork7/AI-algorithms | 63850ae051956d8ed363fa28e5dc51ad26e86198 | [
"Apache-2.0"
] | 10 | 2020-06-26T13:19:46.000Z | 2021-02-05T09:26:49.000Z | perceptron/perceptron.py | somiljain7/AI-algorithms- | 11e9c012cc2f5fb4493bc1ec6b14ddc9cf0fc2d4 | [
"Apache-2.0"
] | 4 | 2020-07-17T11:03:38.000Z | 2020-10-17T05:23:17.000Z | perceptron/perceptron.py | somiljain7/AI-algorithms- | 11e9c012cc2f5fb4493bc1ec6b14ddc9cf0fc2d4 | [
"Apache-2.0"
] | 9 | 2020-06-26T13:19:49.000Z | 2021-01-02T18:59:30.000Z | import pandas as pd
# TODO: Set weight1, weight2, and bias
weight1 = 1.5
weight2 = 1.5
bias = -2.0
# DON'T CHANGE ANYTHING BELOW
# Inputs and outputs
test_inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]
correct_outputs = [False, False, False, True]
outputs = []
# Generate and check output
for test_input, correct_output i... | 36.068966 | 133 | 0.698853 | import pandas as pd
weight1 = 1.5
weight2 = 1.5
bias = -2.0
# Inputs and outputs
test_inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]
correct_outputs = [False, False, False, True]
outputs = []
# Generate and check output
for test_input, correct_output in zip(test_inputs, correct_outputs):
linear_combination = weigh... | true | true |
f72021be8eed22953bf2936035e521ed13862e22 | 4,547 | py | Python | tests/runnable/proxy/proxy_simple_test_case.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | null | null | null | tests/runnable/proxy/proxy_simple_test_case.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | 13 | 2020-05-04T14:14:58.000Z | 2020-07-29T16:37:03.000Z | tests/runnable/proxy/proxy_simple_test_case.py | gift-surg/puma | 58beae3459a0c8d96adfe9af323e26868428df4d | [
"Apache-2.0"
] | null | null | null | from typing import List
from unittest import TestCase
from puma.attribute import copied
from puma.buffer import Publishable
from puma.runnable import CommandDrivenRunnable
from puma.runnable.decorator.run_in_child_scope import run_in_child_scope
from puma.scope_id import get_current_scope_id
from tests.runnable.proxy.... | 44.578431 | 143 | 0.744667 | from typing import List
from unittest import TestCase
from puma.attribute import copied
from puma.buffer import Publishable
from puma.runnable import CommandDrivenRunnable
from puma.runnable.decorator.run_in_child_scope import run_in_child_scope
from puma.scope_id import get_current_scope_id
from tests.runnable.proxy.... | true | true |
f72021c2f7bb1ce0bb2f560b50785e5b281d956f | 1,492 | py | Python | rdkit/VLib/Supply.py | docking-org/rdk | 6eb710254f027b348a8e3089e6a92c3d40de0949 | [
"PostgreSQL"
] | 1 | 2019-01-23T06:02:24.000Z | 2019-01-23T06:02:24.000Z | rdkit/VLib/Supply.py | Mike575/rdkit | 373a89021e478f878c6011a201e3fb8f4a122093 | [
"PostgreSQL"
] | null | null | null | rdkit/VLib/Supply.py | Mike575/rdkit | 373a89021e478f878c6011a201e3fb8f4a122093 | [
"PostgreSQL"
] | 1 | 2022-03-30T03:22:10.000Z | 2022-03-30T03:22:10.000Z | # $Id$
#
# Copyright (C) 2003 Rational Discovery LLC
# All Rights Reserved
#
from rdkit import six
from rdkit.VLib.Node import VLibNode
class SupplyNode(VLibNode):
""" base class for nodes which supply things
Assumptions:
1) no parents
Usage Example:
>>> supplier = SupplyNode(contents=[1,2,3])
... | 19.128205 | 76 | 0.618633 |
from rdkit import six
from rdkit.VLib.Node import VLibNode
class SupplyNode(VLibNode):
def __init__(self, contents=None, **kwargs):
VLibNode.__init__(self, **kwargs)
if contents is not None:
self._contents = contents
else:
self._contents = []
self._pos = 0
def reset(self):
V... | true | true |
f720232e9180d661ee8772c24e32166039323b47 | 1,192 | py | Python | src/web/modules/entrance/migrations/0081_enrolledusersgroup.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 5 | 2018-03-08T17:22:27.000Z | 2018-03-11T14:20:53.000Z | src/web/modules/entrance/migrations/0081_enrolledusersgroup.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 263 | 2018-03-08T18:05:12.000Z | 2022-03-11T23:26:20.000Z | src/web/modules/entrance/migrations/0081_enrolledusersgroup.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 6 | 2018-03-12T19:48:19.000Z | 2022-01-14T04:58:52.000Z | # Generated by Django 2.0.3 on 2018-05-20 18:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('groups', '0004_auto_20180312_2139'),
('schools', '0018_auto_20180407_1742'),
('entrance', '0080_auto_2018052... | 39.733333 | 204 | 0.628356 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('groups', '0004_auto_20180312_2139'),
('schools', '0018_auto_20180407_1742'),
('entrance', '0080_auto_20180520_2114'),
]
operations = [
mig... | true | true |
f7202400abc5ff8124f922b02029da0f1f0056b4 | 5,477 | py | Python | tests/endtoend/test_linux_consumption.py | Amithmh/azure-functions-python-worker | 291a85279f92c88a5a05cddaaf70b2def81a45f2 | [
"MIT"
] | 277 | 2018-01-25T23:13:03.000Z | 2022-02-22T06:12:04.000Z | tests/endtoend/test_linux_consumption.py | Amithmh/azure-functions-python-worker | 291a85279f92c88a5a05cddaaf70b2def81a45f2 | [
"MIT"
] | 731 | 2018-01-18T18:54:38.000Z | 2022-03-29T00:01:46.000Z | tests/endtoend/test_linux_consumption.py | YunchuWang/azure-functions-python-worker | 1f23e038a506c6412e4efbf07eb471a6afab0c2a | [
"MIT"
] | 109 | 2018-01-18T02:22:57.000Z | 2022-02-15T18:59:54.000Z | from unittest import TestCase, skip
import os
import sys
from requests import Request
from azure_functions_worker.testutils_lc import (
LinuxConsumptionWebHostController
)
@skip('Flaky test and needs stabilization')
class TestLinuxConsumption(TestCase):
"""Test worker behaviors on specific scenarios.
S... | 38.570423 | 104 | 0.628994 | from unittest import TestCase, skip
import os
import sys
from requests import Request
from azure_functions_worker.testutils_lc import (
LinuxConsumptionWebHostController
)
@skip('Flaky test and needs stabilization')
class TestLinuxConsumption(TestCase):
@classmethod
def setUpClass(cls):
cls._py... | true | true |
f7202503138d6110cfc58387559f90552ccc359f | 3,224 | py | Python | testflows/_core/contrib/pygments/lexers/special.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 3 | 2020-06-25T19:23:19.000Z | 2021-10-20T19:29:56.000Z | testflows/_core/contrib/pygments/lexers/special.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | null | null | null | testflows/_core/contrib/pygments/lexers/special.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 1 | 2020-02-24T12:31:45.000Z | 2020-02-24T12:31:45.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.special
~~~~~~~~~~~~~~~~~~~~~~~
Special lexers.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from testflows._core.contrib.pygments.lexer import Lexer
from testflows._core.contr... | 30.704762 | 84 | 0.563275 |
import re
from testflows._core.contrib.pygments.lexer import Lexer
from testflows._core.contrib.pygments.token import Token, Error, Text
from testflows._core.contrib.pygments.util import get_choice_opt, text_type, BytesIO
__all__ = ['TextLexer', 'RawTokenLexer']
class TextLexer(Lexer):
name = 'Text only'
... | true | true |
f720257844a4e01f8b77214cce15f42a5d7c3254 | 2,958 | py | Python | chemicals/exceptions.py | daar/chemicals | df3be046055055b99ae762e7a4b852a63134fc82 | [
"MIT"
] | 76 | 2020-08-29T07:47:11.000Z | 2022-03-27T03:16:46.000Z | chemicals/exceptions.py | edafricano/chemicals | 0e827ad43283d74a37cd002dc638f2a07c33bc1b | [
"MIT"
] | 20 | 2020-08-31T04:44:53.000Z | 2022-03-25T05:40:07.000Z | chemicals/exceptions.py | edafricano/chemicals | 0e827ad43283d74a37cd002dc638f2a07c33bc1b | [
"MIT"
] | 13 | 2020-09-01T04:57:01.000Z | 2022-02-23T03:36:58.000Z | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
... | 41.083333 | 81 | 0.742732 |
__all__ = ['TrivialSolutionError',
'PhaseCountReducedError',
'PhaseExistenceImpossible',
'UnderspecifiedError',
'OverspeficiedError']
class UnderspecifiedError(Exception):
class OverspeficiedError(Exception):
class TrivialSolutionError(Exception):
def __init__(self, ... | true | true |
f72026e5abe659fb49e585df6c351997a8a096ba | 4,714 | py | Python | kernel/graph_sage.py | muhanzhang/NestedGNN | a5adccf62d397ad7f83bc73be34eba3765df73fa | [
"MIT"
] | 21 | 2021-11-05T00:42:30.000Z | 2022-03-29T13:38:31.000Z | kernel/graph_sage.py | Ender-li/NestedGNN | a5adccf62d397ad7f83bc73be34eba3765df73fa | [
"MIT"
] | null | null | null | kernel/graph_sage.py | Ender-li/NestedGNN | a5adccf62d397ad7f83bc73be34eba3765df73fa | [
"MIT"
] | 5 | 2021-11-05T00:42:32.000Z | 2022-03-25T08:28:17.000Z | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import SAGEConv, global_mean_pool
class NestedGraphSAGE(torch.nn.Module):
def __init__(self, dataset, num_layers, hidden, use_z=False, use_rd=False):
super(NestedGraphSAGE, self).__init__()
self.use_rd... | 34.661765 | 79 | 0.604158 | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import SAGEConv, global_mean_pool
class NestedGraphSAGE(torch.nn.Module):
def __init__(self, dataset, num_layers, hidden, use_z=False, use_rd=False):
super(NestedGraphSAGE, self).__init__()
self.use_rd... | true | true |
f72028feee490e4956e5e24af2343761f0b5aef8 | 485 | py | Python | tests/numpy/asarray.py | Fryguy/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 124 | 2017-08-19T05:37:16.000Z | 2022-03-08T18:24:18.000Z | tests/numpy/asarray.py | JeMaMokuma/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 15 | 2017-12-16T05:59:31.000Z | 2022-02-08T02:51:17.000Z | tests/numpy/asarray.py | JeMaMokuma/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 18 | 2017-09-25T11:57:04.000Z | 2022-02-19T17:33:48.000Z | import numpy as np
def print_matrix(data):
data_i = []
for i in list(data):
data_j = []
for j in i:
data_j.append(int("%d" % j))
data_i.append(data_j)
print(data_i)
def print_array(data):
datas = []
for i in data:
datas.append(float("%.3f" % i))
prin... | 16.724138 | 40 | 0.536082 | import numpy as np
def print_matrix(data):
data_i = []
for i in list(data):
data_j = []
for j in i:
data_j.append(int("%d" % j))
data_i.append(data_j)
print(data_i)
def print_array(data):
datas = []
for i in data:
datas.append(float("%.3f" % i))
prin... | true | true |
f7202aa5da9abcf694e4ba95a5903c7130725bcc | 604 | py | Python | src/msequence.py | piraaa/VideoDigitalWatermarking | 6439881dc88fb7257a3dd9856b185e5c667b89b4 | [
"MIT"
] | 38 | 2017-11-06T08:59:23.000Z | 2022-02-21T01:42:50.000Z | src/msequence.py | qiuqiu888888/VideoDigitalWatermarking | 6439881dc88fb7257a3dd9856b185e5c667b89b4 | [
"MIT"
] | 2 | 2018-10-01T15:56:37.000Z | 2018-10-01T15:59:19.000Z | src/msequence.py | qiuqiu888888/VideoDigitalWatermarking | 6439881dc88fb7257a3dd9856b185e5c667b89b4 | [
"MIT"
] | 9 | 2017-09-09T02:39:44.000Z | 2021-10-19T08:56:57.000Z | #
# msequence.py
# Created by pira on 2017/07/28.
#
#coding: utf-8
u"""For M-Sequence."""
import numpy as np
def generateM(N):
u"""Create M-Sequence.
@param N : length 2**N-1
@return m : M-Sequence
"""
p = pow(2, N)
m = [0] * (p-1)
for i in np.arange(1,p,2):
f = p^i
a = p
#i = int()
for j in np.... | 14.731707 | 41 | 0.490066 |
import numpy as np
def generateM(N):
p = pow(2, N)
m = [0] * (p-1)
for i in np.arange(1,p,2):
f = p^i
a = p
for j in np.arange(N, p):
if (a&p) == p:
a ^= f
if a == 1:
break
a <<= 1
if j == p-1:
init = 1
lfsr = init & (p-1)
f >>= 1
for k in np.arange(0, p-1):
lfs... | true | true |
f7202be0208820f01bdac492ac81ef39a38c8248 | 1,426 | py | Python | manganelo/chapterdownload.py | nixonjoshua98/manganelo | 4450d05a3cf0ef500565c4e263e06edf42f580b6 | [
"MIT"
] | 22 | 2020-03-17T16:01:27.000Z | 2022-03-06T18:04:41.000Z | manganelo/chapterdownload.py | nixonjoshua98/manganelo | 4450d05a3cf0ef500565c4e263e06edf42f580b6 | [
"MIT"
] | 9 | 2020-05-13T03:19:45.000Z | 2022-03-13T23:05:32.000Z | manganelo/chapterdownload.py | nixonjoshua98/manganelo | 4450d05a3cf0ef500565c4e263e06edf42f580b6 | [
"MIT"
] | 8 | 2021-02-10T17:21:34.000Z | 2022-02-15T10:22:38.000Z | import os
import tempfile
from bs4 import BeautifulSoup
from PIL import Image
from reportlab.pdfgen import canvas
from manganelo import utils, siterequests
def download_chapter(url, path):
path = utils.validate_path(path)
r = siterequests.get(url)
soup = BeautifulSoup(r.content, "html.parser")
urls = _get_... | 19.534247 | 88 | 0.706171 | import os
import tempfile
from bs4 import BeautifulSoup
from PIL import Image
from reportlab.pdfgen import canvas
from manganelo import utils, siterequests
def download_chapter(url, path):
path = utils.validate_path(path)
r = siterequests.get(url)
soup = BeautifulSoup(r.content, "html.parser")
urls = _get_... | true | true |
f7202cd5480a280b65ca98c820e6e6468a9b083f | 71 | py | Python | trial/config/test_cfg.py | ygtxr1997/mmsegmentation | 9cd8c61ba1cd27fe743edc5f546d2710a3c81110 | [
"Apache-2.0"
] | null | null | null | trial/config/test_cfg.py | ygtxr1997/mmsegmentation | 9cd8c61ba1cd27fe743edc5f546d2710a3c81110 | [
"Apache-2.0"
] | null | null | null | trial/config/test_cfg.py | ygtxr1997/mmsegmentation | 9cd8c61ba1cd27fe743edc5f546d2710a3c81110 | [
"Apache-2.0"
] | null | null | null | a = 1
b = dict(b1=[0, 1, 2],
b2=None,)
c = (1, 2)
d = 'string' | 14.2 | 22 | 0.394366 | a = 1
b = dict(b1=[0, 1, 2],
b2=None,)
c = (1, 2)
d = 'string' | true | true |
f7202dae123914878302027d30e8bb56a37777a3 | 2,484 | py | Python | docs/source/conf.py | deeghuge/ibm-spectrum-scale-csi | 572a94a263aa9a850e8377eacfe3d25be8df12c8 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | deeghuge/ibm-spectrum-scale-csi | 572a94a263aa9a850e8377eacfe3d25be8df12c8 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | deeghuge/ibm-spectrum-scale-csi | 572a94a263aa9a850e8377eacfe3d25be8df12c8 | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 30.666667 | 79 | 0.669485 |
project = 'IBM Spectrum Scale CSI'
copyright = '2019, IBM'
author = 'John Dunham'
master_doc = 'index'
release = '1.0.1'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
import os
on_rtd = os.environ.get('READTHEDOCS', Non... | true | true |
f7202e4624fb1dd921db04fe9bd81a4baf484a71 | 4,378 | py | Python | contrib/seeds/generate-seeds.py | vas191/LONGNETWORK-0.7d | 4ed2d9ba26744c1404a7aeef3f75e0c19310aea2 | [
"MIT"
] | 6 | 2020-09-24T00:20:50.000Z | 2021-08-05T06:48:51.000Z | contrib/seeds/generate-seeds.py | vas191/LONGNETWORK-0.7d | 4ed2d9ba26744c1404a7aeef3f75e0c19310aea2 | [
"MIT"
] | 4 | 2020-07-17T17:05:25.000Z | 2021-05-08T10:47:05.000Z | contrib/seeds/generate-seeds.py | vas191/LONGNETWORK-0.7d | 4ed2d9ba26744c1404a7aeef3f75e0c19310aea2 | [
"MIT"
] | 4 | 2020-05-10T21:34:04.000Z | 2021-06-04T06:51:01.000Z | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... | 31.496403 | 98 | 0.582458 |
from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith... | true | true |
f7202e6fbf154aac2f8ed227635669a6c0396ba0 | 1,622 | py | Python | 2020-08-month-long-challenge/day02.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | 2020-08-month-long-challenge/day02.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | 2020-08-month-long-challenge/day02.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# Day 2: Design HashSet
#
# Design a HashSet without using any built-in hash table libraries.
#
# To be specific, your design should include these functions:
# - add(value): Insert a value into the HashSet.
# - contains(value) : Return whether the value exists in the HashSet or not.
# - remove(... | 30.037037 | 77 | 0.645499 |
class MyHashSet:
def __init__(self, memory=16):
self.values = [[] for _ in range(2**memory)]
self.memory = memory
def add(self, key: int) -> None:
hashed = self.hash(key)
if key not in self.values[hashed]:
self.values[hashed].append(key)
def rem... | true | true |
f7202f4a73d2cb0fec38c026a6674123334607c1 | 1,014 | py | Python | macropolo/environments/sheer_env.py | cfpb/macro-polo | 7caf519b623df00a3f16a6119504db09c8983b7b | [
"CC0-1.0"
] | 1 | 2015-07-11T17:52:24.000Z | 2015-07-11T17:52:24.000Z | macropolo/environments/sheer_env.py | cfpb/macro-polo | 7caf519b623df00a3f16a6119504db09c8983b7b | [
"CC0-1.0"
] | 11 | 2015-03-10T15:40:42.000Z | 2016-05-05T22:54:37.000Z | macropolo/environments/sheer_env.py | cfpb/macro-polo | 7caf519b623df00a3f16a6119504db09c8983b7b | [
"CC0-1.0"
] | 6 | 2015-03-09T13:39:12.000Z | 2021-02-21T10:34:15.000Z | # -*- coding: utf-8 -*-
import markdown
from sheer.templates import date_formatter
from .jinja2_env import Jinja2Environment
class SheerEnvironment(Jinja2Environment):
def setup_environment(self):
"""
Set up a Jinja2 environment that like the one created by Sheer.
"""
# Setup t... | 34.965517 | 74 | 0.66568 |
import markdown
from sheer.templates import date_formatter
from .jinja2_env import Jinja2Environment
class SheerEnvironment(Jinja2Environment):
def setup_environment(self):
super(SheerEnvironment, self).setup_environment()
self.f... | true | true |
f7202fba7f46a7622a91a03218bcc2c4f060a7c1 | 1,559 | py | Python | samples/generated_samples/dialogflow_generated_dialogflow_v2_knowledge_bases_list_knowledge_bases_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 171 | 2018-09-19T21:16:18.000Z | 2020-12-07T17:41:10.000Z | samples/generated_samples/dialogflow_generated_dialogflow_v2_knowledge_bases_list_knowledge_bases_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 150 | 2018-09-25T14:04:28.000Z | 2020-12-09T21:45:43.000Z | samples/generated_samples/dialogflow_generated_dialogflow_v2_knowledge_bases_list_knowledge_bases_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 75 | 2018-09-22T14:12:18.000Z | 2020-12-08T07:12:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.170213 | 85 | 0.7678 |
from google.cloud import dialogflow_v2
def sample_list_knowledge_bases():
client = dialogflow_v2.KnowledgeBasesClient()
request = dialogflow_v2.ListKnowledgeBasesRequest(
parent="parent_value",
)
page_result = client.list_knowledge_bases(request=reque... | true | true |
f7203043a8bcf8301e573ee5c313e973c2484f62 | 5,458 | py | Python | scripts/rewritepass.py | CEisenhofer/alive2 | e7cfe7d8dcd8cfaafa1b0f7549e4e2dabee60b87 | [
"MIT"
] | 1 | 2022-02-09T22:10:09.000Z | 2022-02-09T22:10:09.000Z | scripts/rewritepass.py | CEisenhofer/alive2 | e7cfe7d8dcd8cfaafa1b0f7549e4e2dabee60b87 | [
"MIT"
] | null | null | null | scripts/rewritepass.py | CEisenhofer/alive2 | e7cfe7d8dcd8cfaafa1b0f7549e4e2dabee60b87 | [
"MIT"
] | 1 | 2022-02-23T18:33:44.000Z | 2022-02-23T18:33:44.000Z | #!/usr/bin/python
import os
import re
import sys
if len(sys.argv) != 3 and len(sys.argv) != 4:
print("Use: %s <PassRegistry.def path> <passes> [run-tests]" % sys.argv[0])
exit(1)
passregpath = sys.argv[1]
def skip_first_pass(s):
count = 0
for i in range(len(s)):
c = s[i]
if c == '(':
count += 1... | 32.295858 | 133 | 0.593441 |
import os
import re
import sys
if len(sys.argv) != 3 and len(sys.argv) != 4:
print("Use: %s <PassRegistry.def path> <passes> [run-tests]" % sys.argv[0])
exit(1)
passregpath = sys.argv[1]
def skip_first_pass(s):
count = 0
for i in range(len(s)):
c = s[i]
if c == '(':
count += 1
elif c == ')... | true | true |
f72031a89a64427da851b239767808dec0087b18 | 8,293 | py | Python | ProgramsToRead/ExercisesLists/List004.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | ProgramsToRead/ExercisesLists/List004.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | ProgramsToRead/ExercisesLists/List004.py | ItanuRomero/PythonStudyPrograms | 2b784b2af068b34e65ddf817ca8d99c1ca3a710e | [
"MIT"
] | null | null | null | # Lista 04 - Itanu Romero - 2o. semestre
def questao01():
"""
Elabore um programa que efetue a leitura de duas strings e informe o seu conteúdo,
seguido de seu compri- mento. Indique também se as
duas strings possuem o mesmo comprimento e se são iguais ou diferentes no conteúdo.
"""
dicionario ... | 32.778656 | 115 | 0.615459 |
def questao01():
dicionario = {}
for i in range(2):
palavra = input('Digite uma palavra: ')
dicionario[i] = [palavra, len(palavra)]
print(dicionario)
if dicionario[0][0] == dicionario[1][0]:
print('Conteúdo iguais')
if dicionario[0][1] == dicionario[1][1]:
print('Co... | true | true |
f72031f79a1842bf727ed4d56e27279ae150037a | 99 | py | Python | config.py | cballam/flask-nanoblog | b8e3034a8e647c90645ffdeb489e944c6d8042cd | [
"MIT"
] | null | null | null | config.py | cballam/flask-nanoblog | b8e3034a8e647c90645ffdeb489e944c6d8042cd | [
"MIT"
] | null | null | null | config.py | cballam/flask-nanoblog | b8e3034a8e647c90645ffdeb489e944c6d8042cd | [
"MIT"
] | null | null | null | import os
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.getcwd() + '/blog.db'
SECRET_KEY = 'secret'
| 19.8 | 65 | 0.676768 | import os
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.getcwd() + '/blog.db'
SECRET_KEY = 'secret'
| true | true |
f720323103b02c71f2a9840e6439b99bbd9ea402 | 42,611 | py | Python | nidmresults/objects/inference.py | mih/nidmresults | 438f7cce6abc4a4379b629bd76f4d427891e033f | [
"MIT"
] | 1 | 2018-12-04T16:53:45.000Z | 2018-12-04T16:53:45.000Z | nidmresults/objects/inference.py | mih/nidmresults | 438f7cce6abc4a4379b629bd76f4d427891e033f | [
"MIT"
] | 2 | 2018-04-11T14:01:38.000Z | 2019-05-29T15:14:49.000Z | nidmresults/objects/inference.py | cmaumet/nidmresults | 438f7cce6abc4a4379b629bd76f4d427891e033f | [
"MIT"
] | null | null | null | """
Objects describing the Inference activity, its inputs and outputs as specified
in NIDM-Results.
Specification: http://nidm.nidash.org/specs/nidm-results.html
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
"""
from nidmresults.objects.constants import *
from nidmre... | 34.308374 | 109 | 0.594518 | from nidmresults.objects.constants import *
from nidmresults.objects.generic import *
import uuid
from math import erf, sqrt
import rdflib
from prov.model import Literal
from prov.constants import XSD_FLOAT
from prov.model import Identifier
class Inference(object):
def __init__(
self, inference, hei... | true | true |
f72032afeb7c34403fb72e1e874710a4279d0978 | 1,500 | py | Python | saleor/api/payment/serializers.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/api/payment/serializers.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/api/payment/serializers.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | # Payment rest api serializers
from rest_framework import serializers
from rest_framework.serializers import (
SerializerMethodField,
IntegerField
)
from ...sale.models import PaymentOption
from ...payment.models import MpesaPayment
class MpesaPaymentUpdateSeri... | 27.272727 | 71 | 0.557333 |
from rest_framework import serializers
from rest_framework.serializers import (
SerializerMethodField,
IntegerField
)
from ...sale.models import PaymentOption
from ...payment.models import MpesaPayment
class MpesaPaymentUpdateSerializer(serializers.ModelSerial... | true | true |
f720333a7186cc4c3d83e8f61e9842d040ac10f8 | 18,296 | py | Python | sdk/python/pulumi_azure_native/storagepool/v20210801/iscsi_target.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagepool/v20210801/iscsi_target.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagepool/v20210801/iscsi_target.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.086747 | 555 | 0.648885 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['IscsiTargetArgs', 'IscsiTarget']
@pulumi.input_type
class IscsiTargetArgs:
def __in... | true | true |
f72033a5af1e9762b3334c21931344ddd76417f7 | 23,367 | py | Python | perf/benchmark/runner/runner.py | clarketm/tools | 90477465af903c71aa9c6ae97dadb77a8ca7b92a | [
"Apache-2.0"
] | 1 | 2020-07-26T17:56:44.000Z | 2020-07-26T17:56:44.000Z | perf/benchmark/runner/runner.py | clarketm/tools | 90477465af903c71aa9c6ae97dadb77a8ca7b92a | [
"Apache-2.0"
] | 7 | 2021-03-19T13:20:19.000Z | 2022-03-31T13:57:13.000Z | perf/benchmark/runner/runner.py | clarketm/tools | 90477465af903c71aa9c6ae97dadb77a8ca7b92a | [
"Apache-2.0"
] | null | null | null | # Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 37.567524 | 203 | 0.61711 |
from __future__ import print_function
import collections
import os
import json
import socket
import argparse
import subprocess
import shlex
import uuid
import sys
import tempfile
import time
from subprocess import getoutput
from urllib.parse import urlparse
import yaml
from fortio import METRICS_START_SK... | true | true |
f72033c97746dc5228df50bb0ed00d7fbc48f4af | 253 | py | Python | testcase/test_sensor/__init__.py | yucheng6039/WebAuto | 13fa954dd58407ee23e89be89f73cb97f5c11108 | [
"Apache-2.0"
] | null | null | null | testcase/test_sensor/__init__.py | yucheng6039/WebAuto | 13fa954dd58407ee23e89be89f73cb97f5c11108 | [
"Apache-2.0"
] | null | null | null | testcase/test_sensor/__init__.py | yucheng6039/WebAuto | 13fa954dd58407ee23e89be89f73cb97f5c11108 | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------------
# Name: __init__.py
# Description:
# Author: slm
# Date: 2020/5/15
#-------------------------------------------------------------------------------
| 36.142857 | 80 | 0.177866 | true | true | |
f72033fbb720adef0e08eca47c98eececd5d767e | 917 | py | Python | app/user/views.py | dulvinw/recipe-api | f132345987a5962134755e5425e88dde4c56d5fe | [
"Apache-2.0"
] | 1 | 2021-07-08T05:15:38.000Z | 2021-07-08T05:15:38.000Z | app/user/views.py | TMEU/recipe-api | f132345987a5962134755e5425e88dde4c56d5fe | [
"Apache-2.0"
] | null | null | null | app/user/views.py | TMEU/recipe-api | f132345987a5962134755e5425e88dde4c56d5fe | [
"Apache-2.0"
] | 1 | 2021-07-08T05:15:42.000Z | 2021-07-08T05:15:42.000Z | from rest_framework import generics, permissions, authentication
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
"""Create a new user in the s... | 32.75 | 67 | 0.78626 | from rest_framework import generics, permissions, authentication
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
serializer_class = UserSerial... | true | true |
f7203487179fb4f3e1634194e8c33312c4ba431f | 918 | py | Python | ffeatools/FFEA_initialise/FFEA_mapping_tools/__init__.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | null | null | null | ffeatools/FFEA_initialise/FFEA_mapping_tools/__init__.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | null | null | null | ffeatools/FFEA_initialise/FFEA_mapping_tools/__init__.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | 1 | 2021-04-03T16:08:21.000Z | 2021-04-03T16:08:21.000Z | #
# This file is part of the FFEA simulation package
#
# Copyright (c) by the Theory and Development FFEA teams,
# as they appear in the README.md file.
#
# FFEA 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 ... | 36.72 | 71 | 0.736383 |
import node_pdb_align
| true | true |
f7203581c7df8fcaaa578fd90ca2ab1f4f1e4fbd | 636 | py | Python | src/user_polls_2_app/migrations/0010_alter_pollsassignedtouser_user.py | JackCX777/user_polls_2 | fa8fe9ad4c1fa36b4ea5bb402b3d485852a98d3b | [
"BSD-3-Clause"
] | null | null | null | src/user_polls_2_app/migrations/0010_alter_pollsassignedtouser_user.py | JackCX777/user_polls_2 | fa8fe9ad4c1fa36b4ea5bb402b3d485852a98d3b | [
"BSD-3-Clause"
] | null | null | null | src/user_polls_2_app/migrations/0010_alter_pollsassignedtouser_user.py | JackCX777/user_polls_2 | fa8fe9ad4c1fa36b4ea5bb402b3d485852a98d3b | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.7 on 2021-10-25 19:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('user_polls_2_app', '0009... | 28.909091 | 147 | 0.691824 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('user_polls_2_app', '0009_auto_20211025_1754'),
]
operations = ... | true | true |
f72035a00b6e5a656103279e71459c9e9bf51ad5 | 5,434 | py | Python | PythonAPI/docs/bp_doc_gen.py | hecspc/carla | 714f8c4cbfbb46fa9ed163a27c94ede613948767 | [
"MIT"
] | 8 | 2019-11-27T18:43:09.000Z | 2022-01-16T06:08:36.000Z | PythonAPI/docs/bp_doc_gen.py | tcwangjiawei/carla | 714f8c4cbfbb46fa9ed163a27c94ede613948767 | [
"MIT"
] | null | null | null | PythonAPI/docs/bp_doc_gen.py | tcwangjiawei/carla | 714f8c4cbfbb46fa9ed163a27c94ede613948767 | [
"MIT"
] | 5 | 2020-05-12T20:03:10.000Z | 2022-02-25T14:40:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import glob
import os
import sys
try:
sys.path.a... | 30.52809 | 115 | 0.572322 |
import glob
import os
import sys
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
import carla
COLOR_LIST = '#498efc'
def j... | true | true |
f7203750725cdfec5d228e1de7f7be516116fab2 | 1,038 | py | Python | api/users/models/profiles.py | julianarchila/twitter-clone-api | 9c2d77c9144dcb70cf982d9987c70bc7113b7f3e | [
"MIT"
] | null | null | null | api/users/models/profiles.py | julianarchila/twitter-clone-api | 9c2d77c9144dcb70cf982d9987c70bc7113b7f3e | [
"MIT"
] | null | null | null | api/users/models/profiles.py | julianarchila/twitter-clone-api | 9c2d77c9144dcb70cf982d9987c70bc7113b7f3e | [
"MIT"
] | null | null | null | """Profile models. """
# Django
from django.db import models
# Utils
from api.utils.models import TwModel
class Profile(TwModel):
"""Profile model."""
user = models.OneToOneField("users.User", on_delete=models.CASCADE)
picture = models.ImageField(
"Profile picture",
upload_to="users/pic... | 27.315789 | 75 | 0.655106 |
from django.db import models
from api.utils.models import TwModel
class Profile(TwModel):
user = models.OneToOneField("users.User", on_delete=models.CASCADE)
picture = models.ImageField(
"Profile picture",
upload_to="users/pictures/",
default="users/pictures/default.png",
... | true | true |
f7203796bb012b3a172887a59a4d57229630ce4f | 8,515 | py | Python | hwtLib/avalon/mm.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | null | null | null | hwtLib/avalon/mm.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | null | null | null | hwtLib/avalon/mm.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | null | null | null | from hwt.hdl.constants import DIRECTION, READ, WRITE, NOP, READ_WRITE
from hwt.interfaces.agents.handshaked import HandshakedAgent
from hwt.interfaces.std import VectSignal, Signal
from hwt.simulator.agentBase import SyncAgentBase
from hwt.synthesizer.interface import Interface
from hwt.synthesizer.param import Param
f... | 28.864407 | 104 | 0.603053 | from hwt.hdl.constants import DIRECTION, READ, WRITE, NOP, READ_WRITE
from hwt.interfaces.agents.handshaked import HandshakedAgent
from hwt.interfaces.std import VectSignal, Signal
from hwt.simulator.agentBase import SyncAgentBase
from hwt.synthesizer.interface import Interface
from hwt.synthesizer.param import Param
f... | true | true |
f7203965a2d54250a5e143f35c9a2614727c589c | 4,095 | py | Python | encoder/i3d/i3d_encoder.py | gnes-ai/hub | 94cff9011ff6447ce1af51c5307813ab6fbbb156 | [
"Apache-2.0"
] | 36 | 2019-08-17T00:23:02.000Z | 2021-08-18T12:12:59.000Z | encoder/i3d/i3d_encoder.py | gnes-ai/hub | 94cff9011ff6447ce1af51c5307813ab6fbbb156 | [
"Apache-2.0"
] | 1 | 2019-10-24T05:09:45.000Z | 2019-10-24T05:09:45.000Z | encoder/i3d/i3d_encoder.py | gnes-ai/hub | 94cff9011ff6447ce1af51c5307813ab6fbbb156 | [
"Apache-2.0"
] | 11 | 2019-10-22T05:15:14.000Z | 2020-04-25T16:04:01.000Z | # Tencent is pleased to support the open source community by making GNES available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. 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... | 41.785714 | 105 | 0.572894 |
from typing import List
import numpy as np
from gnes.encoder.base import BaseVideoEncoder
from gnes.helper import batching, get_first_available_gpu
class I3dEncoder(BaseVideoEncoder):
batch_size = 1
def __init__(self, model_dir: str,
output_layer: str,
num_c... | true | true |
f7203ab4da825176e6d88094bad4c4f581a86fe3 | 95 | py | Python | jungle/__init__.py | felixhorns/jungle | da50104dcdd2427fcaa5ed190f0bd7f2097e2e79 | [
"MIT"
] | 1 | 2022-03-01T14:50:14.000Z | 2022-03-01T14:50:14.000Z | jungle/__init__.py | felixhorns/jungle | da50104dcdd2427fcaa5ed190f0bd7f2097e2e79 | [
"MIT"
] | 1 | 2020-03-27T00:19:23.000Z | 2020-03-27T00:19:23.000Z | jungle/__init__.py | felixhorns/jungle | da50104dcdd2427fcaa5ed190f0bd7f2097e2e79 | [
"MIT"
] | null | null | null | from .tree import *
from .forest import *
from .sfs import *
from .size_matched_model import *
| 19 | 33 | 0.747368 | from .tree import *
from .forest import *
from .sfs import *
from .size_matched_model import *
| true | true |
f7203b87bf0c1b3f2aca6d05147b1c60aebb4053 | 5,005 | py | Python | examples/mechanics/DirectProjection/n_cubes_directproj.py | vacary/siconos-tutorials | 93c0158321077a313692ed52fed69ff3c256ae32 | [
"Apache-2.0"
] | 6 | 2017-01-12T23:09:28.000Z | 2021-03-20T17:03:58.000Z | examples/mechanics/DirectProjection/n_cubes_directproj.py | vacary/siconos-tutorials | 93c0158321077a313692ed52fed69ff3c256ae32 | [
"Apache-2.0"
] | 3 | 2019-01-14T13:44:51.000Z | 2021-05-17T13:57:27.000Z | examples/mechanics/DirectProjection/n_cubes_directproj.py | vacary/siconos-tutorials | 93c0158321077a313692ed52fed69ff3c256ae32 | [
"Apache-2.0"
] | 2 | 2019-10-22T13:30:39.000Z | 2020-10-06T10:19:57.000Z | #!/usr/bin/env python
#
# Example of two cubes, one with a convex shape, one with a primitive
# shape.
#
from siconos.mechanics.collision.tools import Contactor
from siconos.io.mechanics_run import MechanicsHdf5Runner
import siconos.numerics as sn
import siconos.kernel as sk
import random
import siconos
bullet_opt... | 36.268116 | 79 | 0.564236 |
from siconos.mechanics.collision.tools import Contactor
from siconos.io.mechanics_run import MechanicsHdf5Runner
import siconos.numerics as sn
import siconos.kernel as sk
import random
import siconos
bullet_options = siconos.mechanics.collision.bullet.SiconosBulletOptions()
bullet_options.worldScale = 1.0
bul... | true | true |
f7203b8e88485ca582d2256b589f018535db2c31 | 223 | py | Python | terminusdb_client/__init__.py | LogicalDash/terminusdb-client-python | 7f13f77e60f891b1e6bd214ebf73ff7f75fcaff8 | [
"Apache-2.0"
] | 43 | 2020-06-12T23:44:17.000Z | 2022-03-12T15:18:55.000Z | terminusdb_client/__init__.py | LogicalDash/terminusdb-client-python | 7f13f77e60f891b1e6bd214ebf73ff7f75fcaff8 | [
"Apache-2.0"
] | 151 | 2020-06-12T20:23:05.000Z | 2022-03-29T20:38:35.000Z | terminusdb_client/__init__.py | LogicalDash/terminusdb-client-python | 7f13f77e60f891b1e6bd214ebf73ff7f75fcaff8 | [
"Apache-2.0"
] | 46 | 2020-06-16T20:51:21.000Z | 2022-03-17T18:11:46.000Z | from .woqlclient import WOQLClient # noqa
from .woqldataframe import woqlDataframe as WOQLDataFrame # noqa
from .woqlquery import WOQLQuery # noqa
from .woqlschema import * # noqa
from .woqlview import WOQLView # noqa
| 37.166667 | 65 | 0.784753 | from .woqlclient import WOQLClient
from .woqldataframe import woqlDataframe as WOQLDataFrame
from .woqlquery import WOQLQuery
from .woqlschema import *
from .woqlview import WOQLView
| true | true |
f7203bb1984344d6b1e7a819172c514ab77e38b9 | 44,751 | py | Python | models/ deeplabv3_plus_xception.py | Mohammedaabdu/pytorch-segmentation | 9fdf927d345146247f039042ee37612157e26582 | [
"MIT"
] | 2 | 2019-07-18T16:01:56.000Z | 2019-07-27T18:57:44.000Z | models/ deeplabv3_plus_xception.py | Mohammedaabdu/pytorch-segmentation | 9fdf927d345146247f039042ee37612157e26582 | [
"MIT"
] | null | null | null | models/ deeplabv3_plus_xception.py | Mohammedaabdu/pytorch-segmentation | 9fdf927d345146247f039042ee37612157e26582 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 21 15:16:18 2021
@author: Administrator
"""
from base import BaseModel
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
import torch.utils.model_zoo as model_zoo
from utils.helpers import initiali... | 42.701336 | 157 | 0.542714 |
from base import BaseModel
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
import torch.utils.model_zoo as model_zoo
from utils.helpers import initialize_weights,set_trainable
from itertools import chain
class ResNet(nn.Module):
def __... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.