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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f729a81a37da84730d76d2a4dea5568aaaf90938 | 17,919 | py | Python | src/support.py | M2rsho/PyBot-v5 | 450acff1ecf331ef53e56c916f8336b92509ea7e | [
"MIT"
] | null | null | null | src/support.py | M2rsho/PyBot-v5 | 450acff1ecf331ef53e56c916f8336b92509ea7e | [
"MIT"
] | null | null | null | src/support.py | M2rsho/PyBot-v5 | 450acff1ecf331ef53e56c916f8336b92509ea7e | [
"MIT"
] | 2 | 2022-03-29T12:10:59.000Z | 2022-03-30T02:11:09.000Z | """
Discord Pybot Support
~~~~~~~~~~~~~~~~~
Support File with stuff
:copyright: (c) 2021-2021 M2rsho
:license: MIT, see LICENSE for more details.
"""
if __name__ == "__main__":
print("Huh?")
exit
from datetime import datetime
from colorama import *
import yaml
from random import choice
f... | 39.908686 | 304 | 0.581841 |
if __name__ == "__main__":
print("Huh?")
exit
from datetime import datetime
from colorama import *
import yaml
from random import choice
from PIL import Image, ImageFont, ImageDraw
from gtts import gTTS
from datetime import datetime
import requests
from io import BytesIO
import os
from pathlib ... | true | true |
f729abae5fa086287f5c38105ba1a0a9774ec6b7 | 19,369 | py | Python | python_modules/dagster/dagster/core/execution/plan/plan.py | nikie/dagster | 90ece239149bf255138ba2aaa8a3b4ce6f7d57ec | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/plan/plan.py | nikie/dagster | 90ece239149bf255138ba2aaa8a3b4ce6f7d57ec | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/plan/plan.py | nikie/dagster | 90ece239149bf255138ba2aaa8a3b4ce6f7d57ec | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict, namedtuple
from dagster import check
from dagster.core.definitions import (
CompositeSolidDefinition,
InputDefinition,
PipelineDefinition,
Solid,
SolidDefinition,
SolidHandle,
SolidOutputHandle,
solids_in_topological_order,
)
from dagster.core.defini... | 37.105364 | 101 | 0.637978 | from collections import OrderedDict, namedtuple
from dagster import check
from dagster.core.definitions import (
CompositeSolidDefinition,
InputDefinition,
PipelineDefinition,
Solid,
SolidDefinition,
SolidHandle,
SolidOutputHandle,
solids_in_topological_order,
)
from dagster.core.defini... | true | true |
f729abb2c37355f319be5ae669bdd8b7a80e4d4d | 319 | py | Python | abc/abc071/abc071c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc071/abc071c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc071/abc071c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | N = int(input())
A = list(map(int, input().split()))
d = {}
for a in A:
if a in d:
d[a] += 1
else:
d[a] = 1
l = [k for k in d if d[k] >= 2]
l.sort(reverse=True)
if len(l) == 0:
print(0)
elif d[l[0]] >= 4:
print(l[0] * l[0])
elif len(l) == 1:
print(0)
else:
print(l[0] * l[1])
| 14.5 | 35 | 0.445141 | N = int(input())
A = list(map(int, input().split()))
d = {}
for a in A:
if a in d:
d[a] += 1
else:
d[a] = 1
l = [k for k in d if d[k] >= 2]
l.sort(reverse=True)
if len(l) == 0:
print(0)
elif d[l[0]] >= 4:
print(l[0] * l[0])
elif len(l) == 1:
print(0)
else:
print(l[0] * l[1])
| true | true |
f729ac1de2fc1a7a1e1b398358b94fb1a3d086d6 | 426 | py | Python | connection.py | TheSecEng/sublime-plugin | 8e43a175c7a282eb280e25ce73ddf2350a9adce7 | [
"MIT"
] | null | null | null | connection.py | TheSecEng/sublime-plugin | 8e43a175c7a282eb280e25ce73ddf2350a9adce7 | [
"MIT"
] | null | null | null | connection.py | TheSecEng/sublime-plugin | 8e43a175c7a282eb280e25ce73ddf2350a9adce7 | [
"MIT"
] | null | null | null | import socket
def is_connected_to_internet(host="8.8.8.8", port=53, timeout=3):
"""
Host: 8.8.8.8 (google-public-dns-a.google.com)
OpenPort: 53/tcp
Service: domain (DNS/TCP)
"""
try:
socket.setdefaulttimeout(timeout)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
... | 25.058824 | 68 | 0.615023 | import socket
def is_connected_to_internet(host="8.8.8.8", port=53, timeout=3):
try:
socket.setdefaulttimeout(timeout)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((host, port))
return True
except socket.error:
return False
| true | true |
f729ac421d7edd47d6be3e8d0273f0f1e4a9da15 | 2,514 | py | Python | setup.py | e-kwsm/pycparser | 6a7edee64c13d06e02b5eef554d9d6d10dcb71c0 | [
"BSD-3-Clause"
] | 1 | 2021-12-17T18:09:48.000Z | 2021-12-17T18:09:48.000Z | setup.py | e-kwsm/pycparser | 6a7edee64c13d06e02b5eef554d9d6d10dcb71c0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | e-kwsm/pycparser | 6a7edee64c13d06e02b5eef554d9d6d10dcb71c0 | [
"BSD-3-Clause"
] | null | null | null | import os, sys
try:
from setuptools import setup
from setuptools.command.install import install as _install
from setuptools.command.sdist import sdist as _sdist
except ImportError:
from distutils.core import setup
from distutils.command.install import install as _install
from distutils.command.s... | 35.408451 | 79 | 0.63564 | import os, sys
try:
from setuptools import setup
from setuptools.command.install import install as _install
from setuptools.command.sdist import sdist as _sdist
except ImportError:
from distutils.core import setup
from distutils.command.install import install as _install
from distutils.command.s... | true | true |
f729ad89a37e5cbad0f081cfbdab0db516548f03 | 2,116 | py | Python | app/demo-loop/simple-driver.py | amandalund/celeritas | c631594b00c040d5eb4418fa2129f88c01e29316 | [
"Apache-2.0",
"MIT"
] | null | null | null | app/demo-loop/simple-driver.py | amandalund/celeritas | c631594b00c040d5eb4418fa2129f88c01e29316 | [
"Apache-2.0",
"MIT"
] | null | null | null | app/demo-loop/simple-driver.py | amandalund/celeritas | c631594b00c040d5eb4418fa2129f88c01e29316 | [
"Apache-2.0",
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 UT-Battelle, LLC and other Celeritas Developers.
# See the top-level COPYRIGHT file for details.
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
"""
import json
import subprocess
from os import environ, path
from sys import exit, argv
try:
geometry... | 28.986301 | 79 | 0.6569 |
import json
import subprocess
from os import environ, path
from sys import exit, argv
try:
geometry_filename = argv[1]
hepmc3_filename = argv[2]
except (IndexError, TypeError):
print("usage: {} inp.gdml inp.hepmc3".format(argv[0]))
exit(2)
geant_exp_exe = environ.get('CELERITAS_GEANT_EXPORTER_EXE... | true | true |
f729ada05669b3054ed1527cbed4b6ad46e8f79c | 2,233 | py | Python | pysnark/zkinterface/Witness.py | gxavier38/pysnark | 8a2a571bef430783adf8fe28cb8bb0b0bf8a7c94 | [
"Cube"
] | 94 | 2019-05-21T09:36:58.000Z | 2022-03-25T12:27:54.000Z | pysnark/zkinterface/Witness.py | gxavier38/pysnark | 8a2a571bef430783adf8fe28cb8bb0b0bf8a7c94 | [
"Cube"
] | 32 | 2019-11-12T09:59:46.000Z | 2021-12-04T17:53:14.000Z | pysnark/zkinterface/Witness.py | gxavier38/pysnark | 8a2a571bef430783adf8fe28cb8bb0b0bf8a7c94 | [
"Cube"
] | 13 | 2020-01-02T11:01:17.000Z | 2021-10-02T11:07:11.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: zkinterface
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
# Witness represents an assignment of values to variables.
#
# - Does not include variables already given in `CircuitHeader.instance_variabl... | 38.5 | 162 | 0.712942 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Witness(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Witness()
x.Init(buf, n + ... | true | true |
f729addb6dfc9ae31296930efdcf62790ae8656f | 9,337 | py | Python | demos/smartlab_demo/python/segmentor.py | AlexKoff88/open_model_zoo | 8944a46653427cfa53db10fa91d677826adf31e1 | [
"Apache-2.0"
] | null | null | null | demos/smartlab_demo/python/segmentor.py | AlexKoff88/open_model_zoo | 8944a46653427cfa53db10fa91d677826adf31e1 | [
"Apache-2.0"
] | null | null | null | demos/smartlab_demo/python/segmentor.py | AlexKoff88/open_model_zoo | 8944a46653427cfa53db10fa91d677826adf31e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2021-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 44.674641 | 115 | 0.601264 |
import cv2
import numpy as np
import logging as log
from pathlib import Path
from scipy.special import softmax
from openvino.runtime import PartialShape
class SegmentorMstcn:
def __init__(self, ie, device, i3d_path, mstcn_path):
self.ActionTerms = [
"background",
"noise_action",
... | true | true |
f729addec90d3392c1ecdd2278fb87d1a7dffa03 | 7,460 | py | Python | CichyWanderers/dataloader.py | eduardojdiniz/CompNeuro | 20269e66540dc4e802273735c97323020ee37406 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | CichyWanderers/dataloader.py | eduardojdiniz/CompNeuro | 20269e66540dc4e802273735c97323020ee37406 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | CichyWanderers/dataloader.py | eduardojdiniz/CompNeuro | 20269e66540dc4e802273735c97323020ee37406 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Imports
import h5py
import scipy.io as sio
import os
import requests
import zipfile
import numpy as np
import glob
import shutil
import pickle
def loadmat(matfile):
"""Function to load .mat files.
Parameters
----------
matfile : str
path to `matfile` contai... | 30.44898 | 93 | 0.65429 |
import h5py
import scipy.io as sio
import os
import requests
import zipfile
import numpy as np
import glob
import shutil
import pickle
def loadmat(matfile):
try:
f = h5py.File(matfile)
except (IOError, OSError):
return sio.loadmat(matfile)
else:
return {name: np.transpose(f.get... | true | true |
f729adff411c08326f2854fc947ba36427d1bbb2 | 2,940 | py | Python | nipy/testing/decorators.py | yarikoptic/nipy | 749302c7ffa8ea714cc32d405f0df521102bbc6f | [
"BSD-3-Clause"
] | null | null | null | nipy/testing/decorators.py | yarikoptic/nipy | 749302c7ffa8ea714cc32d405f0df521102bbc6f | [
"BSD-3-Clause"
] | 1 | 2015-09-09T07:49:57.000Z | 2015-09-25T01:50:40.000Z | nipy/testing/decorators.py | matthew-brett/nipy | 5a3f080f2504f8b2c326677ea2e3101344b3f579 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Extend numpy's decorators to use nipy's gui and data labels.
"""
from numpy.testing.decorators import *
from nipy.utils import templates, example_data, DataError
def make_label_dec(label, ds=None):
... | 25.128205 | 80 | 0.636735 |
from numpy.testing.decorators import *
from nipy.utils import templates, example_data, DataError
def make_label_dec(label, ds=None):
if isinstance(label,basestring):
labels = [label]
else:
labels = label
tmp = lambda : None
for label in labels:
setattr(tmp,label,T... | true | true |
f729af50f3a41d400e5f6a7b289255fe107c35b4 | 8,282 | py | Python | topic/contrib/kcv_x1.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | topic/contrib/kcv_x1.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | topic/contrib/kcv_x1.py | mobarski/sandbox | 64ac79143750d5dcbd4d0f3abdab6efeb9bdf50c | [
"MIT"
] | null | null | null | # encoding: UTF-8
# Wide Column Store (Key-Column-Value database) built on top of SQLite
# (c) 2017 by mobarski (at) gmail (dot) com
# licence: MIT
# version: x1m3 (x-experimental, p-preview, r-release, m-modification)
# x1m6 - better test coverage
# x1m5 - tests, limit_str, some comments, set_items<-store, scan_item... | 34.65272 | 166 | 0.637286 |
from __future__ import print_function
import sqlite3
from itertools import groupby
class KCV:
def __init__(self, path=':memory:', tab='main'):
self.path = path
self.tab = tab
self.conn = sqlite3.connect(path)
self.create()
def create(self,index=True):
self.conn.execute('create table if n... | true | true |
f729af98b0a5790aff0129b503e5e9432c4eabaf | 501 | py | Python | setup.py | Maharacha/cat_chaser | c92e2f66aa8d774a57939692a0747597e8362d6f | [
"BSD-2-Clause"
] | null | null | null | setup.py | Maharacha/cat_chaser | c92e2f66aa8d774a57939692a0747597e8362d6f | [
"BSD-2-Clause"
] | null | null | null | setup.py | Maharacha/cat_chaser | c92e2f66aa8d774a57939692a0747597e8362d6f | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='Cat chaser',
version='0.1.0',
description='Code for the cat chaser.',
long_description=readme,
author='Joakim N... | 20.04 | 53 | 0.650699 |
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='Cat chaser',
version='0.1.0',
description='Code for the cat chaser.',
long_description=readme,
author='Joakim Nyman',
author_email... | true | true |
f729b14ec3cb4268bb54ac293ffc4e486ecea87b | 54,648 | py | Python | scripts/retrain.py | gengkunling/tensorflow_poet | 5ef36da08ee0f50cdaa2d08753393c549c2e75b3 | [
"Apache-2.0"
] | null | null | null | scripts/retrain.py | gengkunling/tensorflow_poet | 5ef36da08ee0f50cdaa2d08753393c549c2e75b3 | [
"Apache-2.0"
] | null | null | null | scripts/retrain.py | gengkunling/tensorflow_poet | 5ef36da08ee0f50cdaa2d08753393c549c2e75b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.150602 | 117 | 0.695414 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from datetime import datetime
import hashlib
import os.path
import random
import re
import sys
import tarfile
import numpy as np
from six.moves import urllib
import tensorflow as ... | true | true |
f729b16d943dfdb4f2468565aeed0996583d5e50 | 8,458 | py | Python | test/test_petstore.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 563 | 2019-08-26T05:22:12.000Z | 2020-09-02T11:54:17.000Z | test/test_petstore.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 651 | 2019-08-23T09:16:35.000Z | 2020-09-02T08:30:10.000Z | test/test_petstore.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 43 | 2019-09-10T09:25:17.000Z | 2020-07-06T10:00:38.000Z | import pytest
from hypothesis import settings
@pytest.fixture(params=["petstore_v2.yaml", "petstore_v3.yaml"])
def testdir(request, testdir):
def make_petstore_test(*args, **kwargs):
kwargs["schema_name"] = request.param
testdir.make_test(*args, **kwargs)
testdir.make_petstore_test = make_pet... | 27.822368 | 115 | 0.712107 | import pytest
from hypothesis import settings
@pytest.fixture(params=["petstore_v2.yaml", "petstore_v3.yaml"])
def testdir(request, testdir):
def make_petstore_test(*args, **kwargs):
kwargs["schema_name"] = request.param
testdir.make_test(*args, **kwargs)
testdir.make_petstore_test = make_pet... | true | true |
f729b1b311c9f11041cb2ea4a3e55a3ec73a5e4b | 244 | py | Python | server/schema/types.py | kfields/django-arcade | 24df3d43dde2d69df333529d8790507fb1f5fcf1 | [
"MIT"
] | 1 | 2021-10-03T05:44:32.000Z | 2021-10-03T05:44:32.000Z | server/schema/types.py | kfields/django-arcade | 24df3d43dde2d69df333529d8790507fb1f5fcf1 | [
"MIT"
] | null | null | null | server/schema/types.py | kfields/django-arcade | 24df3d43dde2d69df333529d8790507fb1f5fcf1 | [
"MIT"
] | null | null | null | from ariadne import ObjectType
user = ObjectType("User")
game = ObjectType("Game")
#game_event = ObjectType("GameEvent")
#join_game_event = ObjectType("JoinEvent")
object_types = [
user,
game,
#game_event,
#join_game_event,
]
| 17.428571 | 42 | 0.70082 | from ariadne import ObjectType
user = ObjectType("User")
game = ObjectType("Game")
object_types = [
user,
game,
]
| true | true |
f729b27bfcd1b92623618c962f8fb8b8a2d0626a | 9,496 | py | Python | models/Deeplab.py | iriszero/DepthAwareCNNplus | 5dcc0a9279d53a2826d76631f097959d52982f8b | [
"MIT"
] | 4 | 2019-08-22T14:34:23.000Z | 2020-09-28T10:14:09.000Z | models/Deeplab.py | jshuhnow/DepthAwareCNNplus | 5dcc0a9279d53a2826d76631f097959d52982f8b | [
"MIT"
] | 2 | 2019-03-29T02:34:44.000Z | 2020-11-14T01:56:07.000Z | models/Deeplab.py | jshuhnow/DepthAwareCNNplus | 5dcc0a9279d53a2826d76631f097959d52982f8b | [
"MIT"
] | 5 | 2019-03-13T02:30:16.000Z | 2020-04-01T02:41:28.000Z | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
from .base_model import BaseModel
import numpy as np
from . import losses
import shutil
from utils.util import *
from torch.autograd import Variable
from collections import OrderedDict
from tensorboardX import SummaryWriter
import ... | 49.458333 | 144 | 0.600253 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
from .base_model import BaseModel
import numpy as np
from . import losses
import shutil
from utils.util import *
from torch.autograd import Variable
from collections import OrderedDict
from tensorboardX import SummaryWriter
import ... | true | true |
f729b2a189248b2a268f31e57ac04212b4b32678 | 2,051 | py | Python | aydin/it/demo/n2s/cb/3D_royer_hcr_transform.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/it/demo/n2s/cb/3D_royer_hcr_transform.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/it/demo/n2s/cb/3D_royer_hcr_transform.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | # flake8: noqa
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import examples_single
from aydin.it.fgr import ImageTranslatorFGR
from aydin.it.transforms.attenuation import AttenuationTransform
from aydin.regression.cb import CBRegressor
from aydin.util.log.log import Log
... | 32.555556 | 108 | 0.714286 |
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import examples_single
from aydin.it.fgr import ImageTranslatorFGR
from aydin.it.transforms.attenuation import AttenuationTransform
from aydin.regression.cb import CBRegressor
from aydin.util.log.log import Log
def demo(ima... | true | true |
f729b38b81f333c6d871fc2e21c1cea988d78437 | 3,426 | py | Python | python/paddle/incubate/hapi/tests/test_loss.py | laipaang/Paddle | d7f35434b761707a8479b75636546a624399369a | [
"Apache-2.0"
] | 1 | 2020-06-24T14:53:24.000Z | 2020-06-24T14:53:24.000Z | python/paddle/incubate/hapi/tests/test_loss.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | null | null | null | python/paddle/incubate/hapi/tests/test_loss.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | 4 | 2020-07-27T13:24:03.000Z | 2020-08-06T08:20:32.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.589286 | 79 | 0.650321 |
from __future__ import division
from __future__ import print_function
import unittest
import os
import six
import numpy as np
import shutil
import copy
import paddle
from paddle import fluid
from paddle.incubate.hapi.model import Model, Input
from paddle.incubate.hapi.loss import CrossEntropy, SoftmaxW... | true | true |
f729b3ca19cae7056f3d95bc664a6a3571f625ef | 219 | py | Python | caesar_code/rot13.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | caesar_code/rot13.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | caesar_code/rot13.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
def rot13(message):
import codecs
return codecs.encode(message, 'rot13')
assert rot13("test") == "grfg"
assert rot13("Test") == "Grfg"
| 15.642857 | 42 | 0.634703 |
__author__ = 'ipetrash'
def rot13(message):
import codecs
return codecs.encode(message, 'rot13')
assert rot13("test") == "grfg"
assert rot13("Test") == "Grfg"
| true | true |
f729b49bfd8cbe1cbbefb9437d4d85fd35f3612f | 12,491 | py | Python | models/embedding.py | YexuZhou/TimeSeriesClassification_Transformer | c20e00cfac4cfdb849e57e14c184f7d424257409 | [
"MIT"
] | 1 | 2022-02-26T02:45:45.000Z | 2022-02-26T02:45:45.000Z | models/embedding.py | YexuZhou/TimeSeriesClassification_Transformer | c20e00cfac4cfdb849e57e14c184f7d424257409 | [
"MIT"
] | 1 | 2021-09-04T06:41:51.000Z | 2021-09-04T06:41:51.000Z | models/embedding.py | YexuZhou/TimeSeriesClassification_Transformer | c20e00cfac4cfdb849e57e14c184f7d424257409 | [
"MIT"
] | 1 | 2022-03-18T16:57:43.000Z | 2022-03-18T16:57:43.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import seaborn as sns
import matplotlib.pylab as plt
import numpy as np
# TODO 所有循环结构应该呈现灵活性,每一层都不能一样!
activation_dict = {"relu" : nn.ReLU,
"leakyrelu" : nn.LeakyReLU,
"prelu" : nn.PRe... | 39.403785 | 114 | 0.429029 | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import seaborn as sns
import matplotlib.pylab as plt
import numpy as np
activation_dict = {"relu" : nn.ReLU,
"leakyrelu" : nn.LeakyReLU,
"prelu" : nn.PReLU,
"rrelu"... | true | true |
f729b4c88db7c35c8b6b27dfe5dd6b5a077f57b8 | 10,000 | py | Python | python/ray/workers/setup_runtime_env.py | tmct/ray | 53206dd4401665ec599118241c236ac9e6f4852a | [
"Apache-2.0"
] | 5 | 2019-12-23T07:48:13.000Z | 2020-01-03T12:42:38.000Z | python/ray/workers/setup_runtime_env.py | tmct/ray | 53206dd4401665ec599118241c236ac9e6f4852a | [
"Apache-2.0"
] | 70 | 2019-03-13T05:25:48.000Z | 2022-03-26T07:05:19.000Z | python/ray/workers/setup_runtime_env.py | tmct/ray | 53206dd4401665ec599118241c236ac9e6f4852a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import argparse
import json
import logging
import yaml
import hashlib
from filelock import FileLock
from typing import Optional, List, Dict, Any
from pathlib import Path
import ray
from ray._private.conda import (get_conda_activate_commands,
get_or_create_conda_env... | 40.160643 | 79 | 0.6393 | import os
import sys
import argparse
import json
import logging
import yaml
import hashlib
from filelock import FileLock
from typing import Optional, List, Dict, Any
from pathlib import Path
import ray
from ray._private.conda import (get_conda_activate_commands,
get_or_create_conda_env... | true | true |
f729b552fffba49814a0370ecbde17b2c80a1622 | 72,305 | py | Python | openstackclient/tests/unit/network/v2/test_port.py | tanmayks1999/python-openstackclient | 6a40910c3a4c0e00c3dcd0a9223772b6f03c4002 | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/unit/network/v2/test_port.py | tanmayks1999/python-openstackclient | 6a40910c3a4c0e00c3dcd0a9223772b6f03c4002 | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/unit/network/v2/test_port.py | tanmayks1999/python-openstackclient | 6a40910c3a4c0e00c3dcd0a9223772b6f03c4002 | [
"Apache-2.0"
] | null | null | null | # 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, software
# distrib... | 35.219191 | 79 | 0.575963 |
import argparse
from unittest import mock
from unittest.mock import call
from osc_lib.cli import format_columns
from osc_lib import exceptions
from osc_lib import utils
from openstackclient.network.v2 import port
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
from openstackclien... | true | true |
f729b6b0ac12628966abd0799969cfe496c9a34c | 78,317 | py | Python | tests/core/full_node/test_full_node.py | grayfallstown/taco-blockchain | 6196d73af7a982301a0a1ad5c1bed836b2f95a8d | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_full_node.py | grayfallstown/taco-blockchain | 6196d73af7a982301a0a1ad5c1bed836b2f95a8d | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_full_node.py | grayfallstown/taco-blockchain | 6196d73af7a982301a0a1ad5c1bed836b2f95a8d | [
"Apache-2.0"
] | null | null | null | # flake8: noqa: F811, F401
import asyncio
import dataclasses
import logging
import random
import time
from secrets import token_bytes
from typing import Dict, Optional, List
import pytest
from taco.consensus.pot_iterations import is_overflow_block
from taco.full_node.bundle_tools import detect_potential_template_gene... | 44.829422 | 120 | 0.667582 |
import asyncio
import dataclasses
import logging
import random
import time
from secrets import token_bytes
from typing import Dict, Optional, List
import pytest
from taco.consensus.pot_iterations import is_overflow_block
from taco.full_node.bundle_tools import detect_potential_template_generator
from taco.full_node.... | true | true |
f729b71c9375ae910c971e5666346597293a4808 | 1,009 | py | Python | setup.py | 9b/pynetinfo | 06889a803b783d3e6480b535bdb9488158d17f2e | [
"MIT"
] | 3 | 2019-02-15T12:58:19.000Z | 2020-04-19T11:11:15.000Z | setup.py | 9b/pynetinfo | 06889a803b783d3e6480b535bdb9488158d17f2e | [
"MIT"
] | 3 | 2020-03-24T16:40:44.000Z | 2021-06-01T23:25:45.000Z | setup.py | 9b/pynetinfo | 06889a803b783d3e6480b535bdb9488158d17f2e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='netinfo',
version='0.0.2',
description='Client to interact with Netinfo services.',
author="Brandon Dixon",
author_email... | 28.027778 | 78 | 0.626363 |
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='netinfo',
version='0.0.2',
description='Client to interact with Netinfo services.',
author="Brandon Dixon",
author_email="brandon@backscatter... | true | true |
f729b75b3711477caa260018d62c0c6df569bbd7 | 123 | py | Python | distint-languaje/index.py | abelcq/FP-2021-G3-UpeU | 5d2596044414a8d295d4fda040abe281fbd5dbae | [
"Apache-2.0"
] | 1 | 2021-05-11T19:46:58.000Z | 2021-05-11T19:46:58.000Z | distint-languaje/index.py | abelcq/FP-2021-G3-UpeU | 5d2596044414a8d295d4fda040abe281fbd5dbae | [
"Apache-2.0"
] | null | null | null | distint-languaje/index.py | abelcq/FP-2021-G3-UpeU | 5d2596044414a8d295d4fda040abe281fbd5dbae | [
"Apache-2.0"
] | null | null | null | print("Hola Mundooo")
a=20
b=10
print("Suma:",a+b)
print("Resta:",a-b)
print("Division:",a/b)
print("Multiplicacion:",a*b)
| 15.375 | 28 | 0.658537 | print("Hola Mundooo")
a=20
b=10
print("Suma:",a+b)
print("Resta:",a-b)
print("Division:",a/b)
print("Multiplicacion:",a*b)
| true | true |
f729b7bba4aa0803df14326f38b9ee5b1d94ee72 | 287 | py | Python | dev/ideas/cython/conversion.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | dev/ideas/cython/conversion.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | dev/ideas/cython/conversion.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | null | null | null | from brian2.codegen.runtime.cython_rt.extension_manager import cython_extension_manager
code = '''
def f(ns):
#cdef int n = <int> ns['n']
cdef int n = ns['n']
print n
'''
ns = {
'n':3,
}
mod = cython_extension_manager.create_extension(code)
mod.f(ns) | 19.133333 | 88 | 0.620209 | from brian2.codegen.runtime.cython_rt.extension_manager import cython_extension_manager
code = '''
def f(ns):
#cdef int n = <int> ns['n']
cdef int n = ns['n']
print n
'''
ns = {
'n':3,
}
mod = cython_extension_manager.create_extension(code)
mod.f(ns) | true | true |
f729b90bebf9d7bbb43017a0e27c50b10745b70e | 931 | py | Python | analyzer/darwin/lib/dtrace/common.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 41 | 2018-03-23T07:51:17.000Z | 2021-04-07T08:26:25.000Z | data/analyzer/darwin/lib/dtrace/common.py | iswenhao/Panda-Sandbox | a04069d404cb4326ff459e703f14625dc45759ed | [
"MIT"
] | 7 | 2018-04-09T13:38:11.000Z | 2020-10-17T08:04:59.000Z | data/analyzer/darwin/lib/dtrace/common.py | iswenhao/Panda-Sandbox | a04069d404cb4326ff459e703f14625dc45759ed | [
"MIT"
] | 8 | 2018-03-22T20:07:33.000Z | 2020-07-27T08:49:11.000Z | #!/usr/bin/env python
# Copyright (C) 2015 Dmitry Rodionov
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
from os import path
from time import sleep
def sanitize_path(raw_path):
""" Replace spaces with backslashes+spaces """
return raw_p... | 28.212121 | 64 | 0.665951 |
from os import path
from time import sleep
def sanitize_path(raw_path):
return raw_path.replace(" ", "\\ ")
def path_for_script(script):
return path.join(current_directory(), script)
def current_directory():
return path.dirname(path.abspath(__file__))
def filelines(source_file):
source_fil... | true | true |
f729b912a6705b22a13bbd97b19a0dfa9d68295a | 711 | py | Python | com.zdl.blog/www/testGgtrans.py | zdlgithub/DougScraper | 452b4567aec3acd1a77e8c4157c9597fdadebe81 | [
"Apache-2.0"
] | null | null | null | com.zdl.blog/www/testGgtrans.py | zdlgithub/DougScraper | 452b4567aec3acd1a77e8c4157c9597fdadebe81 | [
"Apache-2.0"
] | null | null | null | com.zdl.blog/www/testGgtrans.py | zdlgithub/DougScraper | 452b4567aec3acd1a77e8c4157c9597fdadebe81 | [
"Apache-2.0"
] | null | null | null | from urllib import request
from bs4 import BeautifulSoup
from selenium import webdriver
import os
import time
def get_trans_text():
url = 'https://translate.google.cn/#view=home&op=translate&sl=zh-CN&tl=en&text=%3Cdiv%20class%3D%22dpl-box-title%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%E8%B4%A7%E5%93%81%E7%B1%BB%E... | 33.857143 | 234 | 0.751055 | from urllib import request
from bs4 import BeautifulSoup
from selenium import webdriver
import os
import time
def get_trans_text():
url = 'https://translate.google.cn/#view=home&op=translate&sl=zh-CN&tl=en&text=%3Cdiv%20class%3D%22dpl-box-title%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%E8%B4%A7%E5%93%81%E7%B1%BB%E... | true | true |
f729b92f95afdd8c53b9704c211571d744eaddf8 | 630 | py | Python | website/plugins/neighbors/neighbors.py | brandonjflannery/data-analysis-template | 178a088c15956331b59b16b4b05b9b3ba58d41b5 | [
"MIT"
] | 1 | 2020-08-14T16:13:47.000Z | 2020-08-14T16:13:47.000Z | website/plugins/neighbors/neighbors.py | johnjdailey/data-analysis-template | 178a088c15956331b59b16b4b05b9b3ba58d41b5 | [
"MIT"
] | null | null | null | website/plugins/neighbors/neighbors.py | johnjdailey/data-analysis-template | 178a088c15956331b59b16b4b05b9b3ba58d41b5 | [
"MIT"
] | 1 | 2020-07-23T05:09:07.000Z | 2020-07-23T05:09:07.000Z | # -*- coding: utf-8 -*-
"""
Neighbor Articles Plugin for Pelican
====================================
This plugin adds ``next_article`` (newer) and ``prev_article`` (older)
variables to the article's context
"""
from pelican import signals
def iter3(seq):
it = iter(seq)
nxt = None
cur = next(it)
for... | 22.5 | 71 | 0.614286 |
from pelican import signals
def iter3(seq):
it = iter(seq)
nxt = None
cur = next(it)
for prv in it:
yield nxt, cur, prv
nxt, cur = cur, prv
yield nxt, cur, None
def neighbors(generator):
for nxt, cur, prv in iter3(generator.articles):
cur.next_article = nxt
cu... | true | true |
f729bb4f6cb1a63385d76911829228c2bbf80511 | 1,176 | py | Python | profiles_unused/profile_calibration.py | s-light/reflow_controller | 34caa1a37c57751189042c6e720517b059deb56e | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | profiles_unused/profile_calibration.py | s-light/reflow_controller | 34caa1a37c57751189042c6e720517b059deb56e | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | profiles_unused/profile_calibration.py | s-light/reflow_controller | 34caa1a37c57751189042c6e720517b059deb56e | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | import profiles
"""Calibration Profile"""
class ProfileCalibration(profiles.Profile):
"""Calibration Profile"""
def config(self):
# __name__ msut be the same as the class name
self.__name__ = "ProfileCalibration"
self.title = "Calibration Profile"
self.title_short... | 26.727273 | 54 | 0.37585 | import profiles
class ProfileCalibration(profiles.Profile):
def config(self):
self.__name__ = "ProfileCalibration"
self.title = "Calibration Profile"
self.title_short = "Calibration Profile"
self.alloy = "-"
self.melting_point = 220
self.refer... | true | true |
f729bb8a9a77c5cf0f374dfaefd296525d2e86f5 | 10,260 | py | Python | pyswagger/tests/v2_0/test_prim.py | adborden/pyswagger | 65e3401d2dd1b24e345c4f51ea402a1f7419afcd | [
"MIT"
] | null | null | null | pyswagger/tests/v2_0/test_prim.py | adborden/pyswagger | 65e3401d2dd1b24e345c4f51ea402a1f7419afcd | [
"MIT"
] | null | null | null | pyswagger/tests/v2_0/test_prim.py | adborden/pyswagger | 65e3401d2dd1b24e345c4f51ea402a1f7419afcd | [
"MIT"
] | 1 | 2020-03-04T00:22:24.000Z | 2020-03-04T00:22:24.000Z | from pyswagger import SwaggerApp, primitives, errs
from ..utils import get_test_data_folder
from pyswagger.spec.v2_0 import objects
from pyswagger.utils import jp_compose
import os
import unittest
import datetime
import six
class SchemaTestCase(unittest.TestCase):
""" test for Schema object """
@classmethod
... | 32.884615 | 128 | 0.566569 | from pyswagger import SwaggerApp, primitives, errs
from ..utils import get_test_data_folder
from pyswagger.spec.v2_0 import objects
from pyswagger.utils import jp_compose
import os
import unittest
import datetime
import six
class SchemaTestCase(unittest.TestCase):
@classmethod
def setUpClass(kls):
kl... | true | true |
f729bc1e4c85a8d55d4ed9f745c3184f07432d23 | 3,296 | py | Python | onlinepayments/sdk/domain/create_hosted_tokenization_request.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | onlinepayments/sdk/domain/create_hosted_tokenization_request.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | onlinepayments/sdk/domain/create_hosted_tokenization_request.py | wl-online-payments-direct/sdk-python3 | 99fca127334520cde4ffa3a34cbea3b3a0d3fbff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated.
#
from onlinepayments.sdk.data_object import DataObject
class CreateHostedTokenizationRequest(DataObject):
__ask_consumer_consent = None
__locale = None
__tokens = None
__variant = None
@property
def ask_consumer_consent(self) -> bool... | 36.622222 | 398 | 0.670813 |
from onlinepayments.sdk.data_object import DataObject
class CreateHostedTokenizationRequest(DataObject):
__ask_consumer_consent = None
__locale = None
__tokens = None
__variant = None
@property
def ask_consumer_consent(self) -> bool:
return self.__ask_consumer_consent
@ask_co... | true | true |
f729bc993bebdfdb8e44c949199670aad4e16244 | 2,714 | py | Python | test/kernels/test_rbf_kernel_grad.py | techshot25/gpytorch | b4aee6f81a3428172d4914e7e0fef0e71cd1f519 | [
"MIT"
] | 1 | 2019-11-08T11:25:56.000Z | 2019-11-08T11:25:56.000Z | test/kernels/test_rbf_kernel_grad.py | VonRosenchild/gpytorch | 092d523027a844939ba85d7ea8c8c7b7511843d5 | [
"MIT"
] | null | null | null | test/kernels/test_rbf_kernel_grad.py | VonRosenchild/gpytorch | 092d523027a844939ba85d7ea8c8c7b7511843d5 | [
"MIT"
] | 1 | 2021-07-02T19:40:07.000Z | 2021-07-02T19:40:07.000Z | #!/usr/bin/env python3
import torch
import unittest
from gpytorch.kernels import RBFKernelGrad
from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
class TestRBFKernelGrad(unittest.TestCase, BaseKernelTestCase):
def create_kernel_no_ard(self, **kwargs):
return RBFKernelGrad(**kwargs)
d... | 35.246753 | 94 | 0.58143 |
import torch
import unittest
from gpytorch.kernels import RBFKernelGrad
from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
class TestRBFKernelGrad(unittest.TestCase, BaseKernelTestCase):
def create_kernel_no_ard(self, **kwargs):
return RBFKernelGrad(**kwargs)
def create_kernel_ard(s... | true | true |
f729bd00900c30a0ff62eef900fa67fb11dea09b | 22,514 | py | Python | aldryn_newsblog/models.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/models.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/models.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.validators
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_categories.fields import CategoryManyToManyField
from aldryn_categories.models import Category
from aldryn_newsblog.utils.utilities import get_valid_la... | 39.777385 | 117 | 0.647908 |
from __future__ import unicode_literals
import django.core.validators
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_categories.fields import CategoryManyToManyField
from aldryn_categories.models import Category
from aldryn_newsblog.utils.utilities import get_valid_languages_from_request
fr... | true | true |
f729bdf98d041be17618159f1292cff87ad80dce | 23,247 | py | Python | Application/ryu-lagopus-ext-lagopus-general-tunnel-ext/ryu/ofproto/nx_actions.py | okinawaopenlabs/SD-WAN | 5d8ed92620f07907b89f373f2d93f41e1a265268 | [
"Apache-2.0"
] | 9 | 2019-12-12T06:57:51.000Z | 2022-01-10T04:01:49.000Z | Application/ryu-lagopus-ext-lagopus-general-tunnel-ext/ryu/ofproto/nx_actions.py | okinawaopenlabs/SD-WAN | 5d8ed92620f07907b89f373f2d93f41e1a265268 | [
"Apache-2.0"
] | null | null | null | Application/ryu-lagopus-ext-lagopus-general-tunnel-ext/ryu/ofproto/nx_actions.py | okinawaopenlabs/SD-WAN | 5d8ed92620f07907b89f373f2d93f41e1a265268 | [
"Apache-2.0"
] | 1 | 2020-03-26T17:58:28.000Z | 2020-03-26T17:58:28.000Z | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | 37.616505 | 79 | 0.534392 |
import struct
from ryu import utils
from ryu.lib import type_desc
from ryu.ofproto import nicira_ext
from ryu.ofproto import ofproto_common
from ryu.lib.pack_utils import msg_pack_into
from ryu.ofproto.ofproto_parser import StringifyMixin
def generate(ofp_name, ofpp_name):
import sys
import s... | true | true |
f729be0517618aa568e3a9d14afc7493ca0dffac | 669 | py | Python | socialviz.py | pgimalac/socialviz | 51555b2c18751c6a3f678ef78a1bbfb9c462a438 | [
"MIT"
] | null | null | null | socialviz.py | pgimalac/socialviz | 51555b2c18751c6a3f678ef78a1bbfb9c462a438 | [
"MIT"
] | null | null | null | socialviz.py | pgimalac/socialviz | 51555b2c18751c6a3f678ef78a1bbfb9c462a438 | [
"MIT"
] | null | null | null | import argparse
from readers import generics, facebook, telegram, discord
from visualization import visualization as viz
parser = argparse.ArgumentParser(
description='Reads messages from various social medias and generates plots.'
)
# Add command line parameters
generics.init(parser)
facebook.init(parser)
telegr... | 20.272727 | 80 | 0.778774 | import argparse
from readers import generics, facebook, telegram, discord
from visualization import visualization as viz
parser = argparse.ArgumentParser(
description='Reads messages from various social medias and generates plots.'
)
generics.init(parser)
facebook.init(parser)
telegram.init(parser)
discord.init(... | true | true |
f729bf9dd75a0bd3e39cba554a42ce2e0be1da96 | 6,616 | py | Python | python/comparatist/utils/gsl.py | tkf/comparatist | 44f30077857fc96cb77539f3fe0a7e8112f86c82 | [
"MIT"
] | null | null | null | python/comparatist/utils/gsl.py | tkf/comparatist | 44f30077857fc96cb77539f3fe0a7e8112f86c82 | [
"MIT"
] | null | null | null | python/comparatist/utils/gsl.py | tkf/comparatist | 44f30077857fc96cb77539f3fe0a7e8112f86c82 | [
"MIT"
] | null | null | null | import ctypes
from ctypes import (POINTER, c_char_p, c_size_t, c_int, c_long, c_ulong,
c_double, c_void_p)
from ctypes.util import find_library
class _c_gsl_rng_type(ctypes.Structure):
_fields_ = [('name', c_char_p),
('max', c_long),
('min', c_size_t),
... | 30.62963 | 77 | 0.603083 | import ctypes
from ctypes import (POINTER, c_char_p, c_size_t, c_int, c_long, c_ulong,
c_double, c_void_p)
from ctypes.util import find_library
class _c_gsl_rng_type(ctypes.Structure):
_fields_ = [('name', c_char_p),
('max', c_long),
('min', c_size_t),
... | true | true |
f729c050da4de0e6ccf5e72bd5c5b29a4dc7c52f | 1,194 | py | Python | backend/__init__.py | fdgogogo/fangs | bfad4423893f0f1d9793ff6402d63c65e1d88d66 | [
"MIT"
] | 1 | 2015-09-05T10:16:48.000Z | 2015-09-05T10:16:48.000Z | backend/__init__.py | fdgogogo/fangs | bfad4423893f0f1d9793ff6402d63c65e1d88d66 | [
"MIT"
] | null | null | null | backend/__init__.py | fdgogogo/fangs | bfad4423893f0f1d9793ff6402d63c65e1d88d66 | [
"MIT"
] | null | null | null | from flask.ext.restless import APIManager
from flask.ext.security import SQLAlchemyUserDatastore, Security
from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
from flask.ext.cors import CORS
app = Flask(__name__)
app.config.from_pyfile('config.py')
CORS(app)
db = SQLAlchemy(app)
api_manager = APIMan... | 24.367347 | 64 | 0.752931 | from flask.ext.restless import APIManager
from flask.ext.security import SQLAlchemyUserDatastore, Security
from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
from flask.ext.cors import CORS
app = Flask(__name__)
app.config.from_pyfile('config.py')
CORS(app)
db = SQLAlchemy(app)
api_manager = APIMan... | true | true |
f729c187761bac06850de8bf92eac1e4f1ab8bca | 236 | py | Python | Numeric Patterns/numericpattern13.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 8 | 2021-03-20T11:26:35.000Z | 2022-01-05T02:39:15.000Z | Numeric Patterns/numericpattern13.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 851 | 2021-04-02T09:08:15.000Z | 2022-01-12T11:26:57.000Z | Numeric Patterns/numericpattern13.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 15 | 2021-04-13T06:10:17.000Z | 2022-01-08T05:07:21.000Z | # Numeric Pattern 12
"""
Desired Output:
5 10 15 20 25
4 9 14 19 24
3 8 13 18 23
2 7 12 17 22
1 6 11 16 21
"""
x = 5
for i in range(5, 0, -1):
j = i
for _ in range(5):
print(j, end=" ")
j += x
print()
| 11.8 | 25 | 0.491525 |
x = 5
for i in range(5, 0, -1):
j = i
for _ in range(5):
print(j, end=" ")
j += x
print()
| true | true |
f729c2f5bc2a95ac241b9a3afada133a82467079 | 306 | py | Python | files_manager/urls.py | alias454/saltshaker | d32cdd0aa13098bdc77bb3abd4a92c10fa517dd1 | [
"Apache-2.0"
] | 343 | 2015-12-31T06:33:03.000Z | 2022-02-18T17:56:30.000Z | files_manager/urls.py | whistle-china/OneOps-zgd | 2c06eed517dc05d2cc530064e744a92f04c7d063 | [
"Apache-2.0"
] | 35 | 2015-12-08T02:51:19.000Z | 2020-06-08T08:56:52.000Z | files_manager/urls.py | whistle-china/OneOps-zgd | 2c06eed517dc05d2cc530064e744a92f04c7d063 | [
"Apache-2.0"
] | 175 | 2016-01-20T10:06:37.000Z | 2022-01-07T03:27:17.000Z | # -*- coding:utf-8 -*-
#!/bin/env python
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^manage_file', views.manage_file,name='manage_file'),
url(r'^del_file', views.del_file,name='del_file'),
url(r'^upload_file', views.upload_file,name='upload_file'),
]
| 25.5 | 63 | 0.689542 |
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^manage_file', views.manage_file,name='manage_file'),
url(r'^del_file', views.del_file,name='del_file'),
url(r'^upload_file', views.upload_file,name='upload_file'),
]
| true | true |
f729c3450b30a9dead4c1eeb84b8ddfbdc2de0ab | 3,216 | py | Python | cloudify_azure/resources/network/networksecurityrule.py | ahmadiesa-abu/cloudify-azure-plugin | b2ac5a246335ff45ce0cdd332ea9c8e74e7c8552 | [
"Apache-2.0"
] | null | null | null | cloudify_azure/resources/network/networksecurityrule.py | ahmadiesa-abu/cloudify-azure-plugin | b2ac5a246335ff45ce0cdd332ea9c8e74e7c8552 | [
"Apache-2.0"
] | null | null | null | cloudify_azure/resources/network/networksecurityrule.py | ahmadiesa-abu/cloudify-azure-plugin | b2ac5a246335ff45ce0cdd332ea9c8e74e7c8552 | [
"Apache-2.0"
] | null | null | null | # #######
# Copyright (c) 2016-2020 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 35.733333 | 75 | 0.660759 | y import ctx
from cloudify_azure.resources.base import Resource
from cloudify.decorators import operation
from cloudify_azure import (constants, utils)
class NetworkSecurityRule(Resource):
def __init__(self,
resource_group=None,
network_security_group=None,
ap... | true | true |
f729c44ac1640031f9fa2ae3fc807ed6e7f45f6a | 2,565 | py | Python | lib/wyw2s_lib/make_facebank_tools/make_facebank.py | JamesFengi/handPose_Eric | 3e329181930ebc7ef0fed2abb9a9d092a8541f9c | [
"Apache-2.0"
] | null | null | null | lib/wyw2s_lib/make_facebank_tools/make_facebank.py | JamesFengi/handPose_Eric | 3e329181930ebc7ef0fed2abb9a9d092a8541f9c | [
"Apache-2.0"
] | null | null | null | lib/wyw2s_lib/make_facebank_tools/make_facebank.py | JamesFengi/handPose_Eric | 3e329181930ebc7ef0fed2abb9a9d092a8541f9c | [
"Apache-2.0"
] | null | null | null | # make facebank
import warnings
warnings.filterwarnings("ignore")
import os
import torch
from model import Backbone
import argparse
from pathlib import Path
from torchvision import transforms as trans
from PIL import Image
import numpy as np
def prepare_facebank(path_images,facebank_path, model, mtcnn, device , tta = T... | 33.311688 | 115 | 0.535283 |
import warnings
warnings.filterwarnings("ignore")
import os
import torch
from model import Backbone
import argparse
from pathlib import Path
from torchvision import transforms as trans
from PIL import Image
import numpy as np
def prepare_facebank(path_images,facebank_path, model, mtcnn, device , tta = True):
... | true | true |
f729c48d7065946b20b2e2dc9ba72d301fe58164 | 8,819 | py | Python | petibmpy/createxdmf.py | mesnardo/petibmpy | 3ab67cba8d170dcffb4ac7b6b35abd04145dbaf9 | [
"BSD-3-Clause"
] | 1 | 2020-08-08T13:37:28.000Z | 2020-08-08T13:37:28.000Z | petibmpy/createxdmf.py | mesnardo/petibmpy | 3ab67cba8d170dcffb4ac7b6b35abd04145dbaf9 | [
"BSD-3-Clause"
] | null | null | null | petibmpy/createxdmf.py | mesnardo/petibmpy | 3ab67cba8d170dcffb4ac7b6b35abd04145dbaf9 | [
"BSD-3-Clause"
] | null | null | null | """Module to create a XDMF file for a PetIBM field variable."""
import sys
import pathlib
from lxml import etree
from .grid import read_grid_hdf5
def write_xdmf(outpath, datadir, gridpath, name,
nstart=None, nt=None, nsave=None,
states=None, times=None):
"""Write a XDMF file to rea... | 44.540404 | 78 | 0.52591 |
import sys
import pathlib
from lxml import etree
from .grid import read_grid_hdf5
def write_xdmf(outpath, datadir, gridpath, name,
nstart=None, nt=None, nsave=None,
states=None, times=None):
xdmf = etree.Element('Xdmf', Version='2.2')
info = etree.SubElement(xdmf, 'Informa... | true | true |
f729c49e405ab727bdd961f7cad9ea1e6de7bd96 | 11,663 | py | Python | universal/algo.py | firmai/universal-portfolios | b1d99d6dbcf553582d399cf3851ac4ba35a93d3e | [
"MIT"
] | 6 | 2019-08-06T06:18:40.000Z | 2020-12-02T12:49:16.000Z | universal/algo.py | firmai/universal-portfolios | b1d99d6dbcf553582d399cf3851ac4ba35a93d3e | [
"MIT"
] | null | null | null | universal/algo.py | firmai/universal-portfolios | b1d99d6dbcf553582d399cf3851ac4ba35a93d3e | [
"MIT"
] | 6 | 2019-07-18T22:42:20.000Z | 2021-12-20T22:51:01.000Z | import sys
import numpy as np
import pandas as pd
import itertools
import logging
import inspect
import copy
from .result import AlgoResult, ListResult
from scipy.misc import comb
from . import tools
class Algo(object):
""" Base class for algorithm calculating weights for online portfolio.
You have to subclas... | 36.446875 | 110 | 0.592729 | import sys
import numpy as np
import pandas as pd
import itertools
import logging
import inspect
import copy
from .result import AlgoResult, ListResult
from scipy.misc import comb
from . import tools
class Algo(object):
REPLACE_MISSING = False
PRICE_TYPE = 'ratio'
def __init__(... | true | true |
f729c4fab9f3476a5ae49483670be2f99da1ac97 | 9,712 | py | Python | userbot/modules/ping.py | zerosquad13/Zero-Ubot | 94f8d6d4c715a3d28c9c1e9481d42e3fe8252cab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2021-07-03T20:02:14.000Z | 2021-09-26T13:47:12.000Z | userbot/modules/ping.py | zYxDevs/Man-Userbot | 109cc5ccf11ca22bec289892a853db90cca679ff | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/ping.py | zYxDevs/Man-Userbot | 109cc5ccf11ca22bec289892a853db90cca679ff | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2022-03-02T09:51:22.000Z | 2022-03-02T09:59:25.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# ReCode by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/L... | 35.061372 | 322 | 0.464271 |
import random
import time
from datetime import datetime
from speedtest import Speedtest
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP, StartTime, bot
from userbot.events import man_cmd, register
from userbot.utils import humanbytes
absen = [
"**Hadir bang** 😁",
"**Hadir kak** ... | true | true |
f729c51ebf79c20390fd5bd358e6ac05649eef6e | 3,582 | py | Python | trainCode/Source/reid/models/resmap.py | Pandinosaurus/RandPerson | 7dd503cc1d063d95b8cf6b43d40bb93452192d6d | [
"Apache-2.0"
] | 83 | 2020-06-24T11:25:46.000Z | 2022-02-17T16:07:25.000Z | trainCode/Source/reid/models/resmap.py | XrosLiang/RandPerson | 1c6e935d64d8210ee4cddbf803da054016090675 | [
"Apache-2.0"
] | 7 | 2020-06-28T05:00:58.000Z | 2021-09-22T06:57:26.000Z | trainCode/Source/reid/models/resmap.py | XrosLiang/RandPerson | 1c6e935d64d8210ee4cddbf803da054016090675 | [
"Apache-2.0"
] | 16 | 2020-06-28T00:38:42.000Z | 2022-02-05T06:01:41.000Z | from __future__ import absolute_import
from torch import nn
import torchvision
fea_dims_small = {'layer2': 128, 'layer3': 256, 'layer4': 512}
fea_dims = {'layer2': 512, 'layer3': 1024, 'layer4': 2048}
class ResNet(nn.Module):
__factory = {
18: torchvision.models.resnet18,
34: torchvision.models.... | 28.656 | 94 | 0.630374 | from __future__ import absolute_import
from torch import nn
import torchvision
fea_dims_small = {'layer2': 128, 'layer3': 256, 'layer4': 512}
fea_dims = {'layer2': 512, 'layer3': 1024, 'layer4': 2048}
class ResNet(nn.Module):
__factory = {
18: torchvision.models.resnet18,
34: torchvision.models.... | true | true |
f729c51fa2b001db60af7a3c0837c3d149678ad5 | 2,474 | py | Python | neurosynth/analysis/reduce.py | wanirepo/Neurosynth | 5b770ec31c5095c16e27ebe664fa5d515c662298 | [
"MIT"
] | 2 | 2016-12-26T15:29:18.000Z | 2017-04-22T20:10:37.000Z | neurosynth/analysis/reduce.py | wanirepo/Neurosynth | 5b770ec31c5095c16e27ebe664fa5d515c662298 | [
"MIT"
] | null | null | null | neurosynth/analysis/reduce.py | wanirepo/Neurosynth | 5b770ec31c5095c16e27ebe664fa5d515c662298 | [
"MIT"
] | null | null | null | import numpy as np
""" Dimensional/data reduction methods. """
def average_within_regions(dataset, img, threshold=None, remove_zero=True):
""" Averages over all voxels within each ROI in the input image.
Takes a Dataset and a Nifti image that defines distinct regions, and
returns a numpy matrix of ROIs x map... | 41.932203 | 86 | 0.7308 | import numpy as np
def average_within_regions(dataset, img, threshold=None, remove_zero=True):
regions = dataset.volume.mask(img)
labels = np.unique(regions)
if remove_zero: labels = labels[np.nonzero(labels)]
n_regions = labels.size
m = np.zeros((regions.size, n_regions))
for i in range(n_regions):
m... | true | true |
f729c6a3bf40c4409e5dca6df0ff3fc814bfd2ee | 590 | py | Python | tests/test_processor.py | Tmw/edward | 0a58022d0bbf1f80abecb880f7565acaa5cebfde | [
"MIT"
] | 20 | 2019-01-07T08:36:57.000Z | 2021-06-15T09:21:37.000Z | tests/test_processor.py | Tmw/edward | 0a58022d0bbf1f80abecb880f7565acaa5cebfde | [
"MIT"
] | 1 | 2019-01-17T12:34:29.000Z | 2019-01-17T12:34:29.000Z | tests/test_processor.py | Tmw/edward | 0a58022d0bbf1f80abecb880f7565acaa5cebfde | [
"MIT"
] | 2 | 2020-01-14T07:30:01.000Z | 2020-03-03T17:13:16.000Z | import unittest
from unittest.mock import patch
from PIL import Image
import processor
class ProcessorTest(unittest.TestCase):
def test_normalize_input(self):
img = Image.new("RGB", (400, 400), "#ff0000")
normalized = processor.normalize_input(img)
assert normalized.shape == (224, 224, 3... | 28.095238 | 67 | 0.691525 | import unittest
from unittest.mock import patch
from PIL import Image
import processor
class ProcessorTest(unittest.TestCase):
def test_normalize_input(self):
img = Image.new("RGB", (400, 400), "#ff0000")
normalized = processor.normalize_input(img)
assert normalized.shape == (224, 224, 3... | true | true |
f729c7b895ae69fca2de4c915ddd8a78950b4f94 | 4,705 | py | Python | Review_2/main.py | ant-6112/Image_Encryption_Using_Steganography_And_AES | c3bc6a220561037ed6d3b66d4519075ec4d37170 | [
"MIT"
] | null | null | null | Review_2/main.py | ant-6112/Image_Encryption_Using_Steganography_And_AES | c3bc6a220561037ed6d3b66d4519075ec4d37170 | [
"MIT"
] | null | null | null | Review_2/main.py | ant-6112/Image_Encryption_Using_Steganography_And_AES | c3bc6a220561037ed6d3b66d4519075ec4d37170 | [
"MIT"
] | null | null | null | from AES import AES
from AES import unpad
from EncodeDecode import encode
from EncodeDecode import decode
from ImageInsideImage import *
from PIL import Image
if __name__ == '__main__':
print("Enter 1 to Ecrypt a Message Using AES Encryption\nEnter 2 to Decrypt a Message\nEnter 3 to Encrypt a Message and Hide... | 39.537815 | 323 | 0.596174 | from AES import AES
from AES import unpad
from EncodeDecode import encode
from EncodeDecode import decode
from ImageInsideImage import *
from PIL import Image
if __name__ == '__main__':
print("Enter 1 to Ecrypt a Message Using AES Encryption\nEnter 2 to Decrypt a Message\nEnter 3 to Encrypt a Message and Hide... | true | true |
f729c7e980aec839545c12cbfe4598a07623ad46 | 721 | py | Python | tests/locust.py | geru-br/keyloop | b3147984ef2517d5d53518f969ad9637e1b54a00 | [
"MIT"
] | 1 | 2022-01-18T08:04:18.000Z | 2022-01-18T08:04:18.000Z | tests/locust.py | geru-br/keyloop | b3147984ef2517d5d53518f969ad9637e1b54a00 | [
"MIT"
] | 1 | 2020-03-16T20:35:07.000Z | 2020-03-16T20:35:07.000Z | tests/locust.py | geru-br/keyloop | b3147984ef2517d5d53518f969ad9637e1b54a00 | [
"MIT"
] | null | null | null | from locust import HttpLocust, TaskSet, between
import json
def login(l):
headers = {'content-type': 'application/vnd.api+json'}
l.client.post(
"/api/v1/realms/PLAYGROUND/auth-session",
data=json.dumps({
"data": {
"type":"auth-session",
"attributes"... | 20.6 | 58 | 0.522885 | from locust import HttpLocust, TaskSet, between
import json
def login(l):
headers = {'content-type': 'application/vnd.api+json'}
l.client.post(
"/api/v1/realms/PLAYGROUND/auth-session",
data=json.dumps({
"data": {
"type":"auth-session",
"attributes"... | true | true |
f729c9a3f69ec5fcd9aca062440ddcccfde15089 | 14,997 | py | Python | replaying/test.py | jdey4/progressive-learning | 410b3525ab63e1f7c32e9838460b2c9af7b9d256 | [
"Apache-2.0"
] | 1 | 2022-01-03T12:36:28.000Z | 2022-01-03T12:36:28.000Z | replaying/test.py | jdey4/progressive-learning | 410b3525ab63e1f7c32e9838460b2c9af7b9d256 | [
"Apache-2.0"
] | null | null | null | replaying/test.py | jdey4/progressive-learning | 410b3525ab63e1f7c32e9838460b2c9af7b9d256 | [
"Apache-2.0"
] | null | null | null | #%%
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as keras
import seaborn as sns
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from math import log2, ceil
import sys
#sys.path.append("../src/")
sys.path.append("../src_sampling/"... | 34.161731 | 131 | 0.609122 |
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as keras
import seaborn as sns
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from math import log2, ceil
import sys
sys.path.append("../src_sampling/")
from lifelong_dnn import Lif... | true | true |
f729c9de35d9d43e20ad9af19e86a468191ed2af | 374 | py | Python | os_hek/handler.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | os_hek/handler.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | os_hek/handler.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | import os
from reclaimer.hek.handler import HaloHandler
from reclaimer.os_hek.defs import __all__ as all_def_names
from supyr_struct.defs.constants import PATHDIV
class OsHaloHandler(HaloHandler):
frozen_imp_paths = all_def_names
default_defs_path = "reclaimer.os_hek.defs"
tagsdir = "%s%stags... | 28.769231 | 76 | 0.759358 | import os
from reclaimer.hek.handler import HaloHandler
from reclaimer.os_hek.defs import __all__ as all_def_names
from supyr_struct.defs.constants import PATHDIV
class OsHaloHandler(HaloHandler):
frozen_imp_paths = all_def_names
default_defs_path = "reclaimer.os_hek.defs"
tagsdir = "%s%stags... | true | true |
f729ca133af8f808a4bd13c6fcf77aa56d146c25 | 4,687 | py | Python | google/appengine/tools/devappserver2/admin/blobstore_viewer.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/tools/devappserver2/admin/blobstore_viewer.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/tools/devappserver2/admin/blobstore_viewer.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.333333 | 77 | 0.704288 |
from builtins import str
from google.appengine.ext import blobstore
from google.appengine.tools.devappserver2.admin import admin_request_handler
def _get_blobs(start, limit):
q = blobstore.BlobInfo.all().order('-creation')
return q.fetch(limit, offset=start)
class BlobstoreRequestHandler(admi... | true | true |
f729cab4dd26ab9cc864f67022e320fa974f4e5b | 2,323 | py | Python | src/programy/parser/template/nodes/oob.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/oob.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/oob.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | 1 | 2020-02-21T17:58:05.000Z | 2020-02-21T17:58:05.000Z | """
Copyright (c) 2016-17 Keith Sterling http://www.keithsterling.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 in the Software without restriction, including without limitation
the rights to use, copy, mod... | 39.372881 | 120 | 0.712441 |
import logging
from programy.parser.template.nodes.base import TemplateNode
class TemplateOOBNode(TemplateNode):
def __init__(self):
TemplateNode.__init__(self)
def resolve_to_string(self, bot, clientid):
resolved = self.resolve_children_to_string(bot, clientid)
if logging.getLogger... | true | true |
f729ccd1764351f7fd3a6bde73c400cfff35b597 | 282 | py | Python | create-target-array-in-the-given-order/create-target-array-in-the-given-order.py | ARBII-xD/Solving-Leetcode-Problems | 4631d66e46fce204afbe6d72e89aeedaf2192229 | [
"MIT"
] | null | null | null | create-target-array-in-the-given-order/create-target-array-in-the-given-order.py | ARBII-xD/Solving-Leetcode-Problems | 4631d66e46fce204afbe6d72e89aeedaf2192229 | [
"MIT"
] | null | null | null | create-target-array-in-the-given-order/create-target-array-in-the-given-order.py | ARBII-xD/Solving-Leetcode-Problems | 4631d66e46fce204afbe6d72e89aeedaf2192229 | [
"MIT"
] | null | null | null | class Solution:
def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]:
targetList = []
targetList.append(nums[0])
for i in range(1,len(nums)):
targetList.insert(index[i] , nums[i])
return targetList
| 31.333333 | 80 | 0.567376 | class Solution:
def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]:
targetList = []
targetList.append(nums[0])
for i in range(1,len(nums)):
targetList.insert(index[i] , nums[i])
return targetList
| true | true |
f729cddf796bde2b9780b2c4dc762d657897d4d6 | 7,157 | py | Python | tests/websockets/test_disk.py | tobiasbp/py-freenas | 09909b1e792f671c474587347ed659bde478d74a | [
"MIT"
] | null | null | null | tests/websockets/test_disk.py | tobiasbp/py-freenas | 09909b1e792f671c474587347ed659bde478d74a | [
"MIT"
] | null | null | null | tests/websockets/test_disk.py | tobiasbp/py-freenas | 09909b1e792f671c474587347ed659bde478d74a | [
"MIT"
] | null | null | null | import unittest
from unittest import IsolatedAsyncioTestCase
from unittest.mock import Mock
from pyfreenas.disk import DiskType
from pyfreenas.websockets.disk import CachingDisk
from pyfreenas.websockets.machine import CachingMachine
from tests.fakes.fakeserver import (
FreeNASServer,
TDiskQueryResult,
TDi... | 31.390351 | 75 | 0.53556 | import unittest
from unittest import IsolatedAsyncioTestCase
from unittest.mock import Mock
from pyfreenas.disk import DiskType
from pyfreenas.websockets.disk import CachingDisk
from pyfreenas.websockets.machine import CachingMachine
from tests.fakes.fakeserver import (
FreeNASServer,
TDiskQueryResult,
TDi... | true | true |
f729d0a78065b4d1b211459c315a5f665132ceef | 790 | py | Python | tests/test_kernFeatureWriter.py | adobe-type-tools/python-modules | ce67101f5c3ab8476729dcc231dcc574b8a338df | [
"MIT"
] | 19 | 2015-03-24T10:48:04.000Z | 2021-05-30T10:11:39.000Z | tests/test_kernFeatureWriter.py | adobe-type-tools/python-modules | ce67101f5c3ab8476729dcc231dcc574b8a338df | [
"MIT"
] | 11 | 2015-03-24T22:31:35.000Z | 2020-08-26T12:46:21.000Z | tests/test_kernFeatureWriter.py | adobe-type-tools/python-modules | ce67101f5c3ab8476729dcc231dcc574b8a338df | [
"MIT"
] | 15 | 2015-03-23T20:03:23.000Z | 2019-12-06T16:22:54.000Z | import defcon
import sys
sys.path.append("..")
from kernFeatureWriter import *
def read_file(path):
'''
Read a file, split lines into a list, close the file.
'''
with open(path, 'r', encoding='utf-8') as f:
data = f.read().splitlines()
return data
def test_WhichApp():
assert WhichA... | 23.939394 | 75 | 0.653165 | import defcon
import sys
sys.path.append("..")
from kernFeatureWriter import *
def read_file(path):
with open(path, 'r', encoding='utf-8') as f:
data = f.read().splitlines()
return data
def test_WhichApp():
assert WhichApp().appName == 'Defcon'
def test_full_run():
args = Defau... | true | true |
f729d0e86e178752226f22bdfde144a5fbfac047 | 1,019 | py | Python | main.py | cdlavila/Confidencial-Intervals-with-Python | 0b347fb577928c6cf74179e148be2de423d5e4f2 | [
"MIT"
] | 1 | 2021-10-09T15:16:43.000Z | 2021-10-09T15:16:43.000Z | main.py | cdlavila/Confidencial-Intervals-with-Python | 0b347fb577928c6cf74179e148be2de423d5e4f2 | [
"MIT"
] | null | null | null | main.py | cdlavila/Confidencial-Intervals-with-Python | 0b347fb577928c6cf74179e148be2de423d5e4f2 | [
"MIT"
] | null | null | null | from UI import interface
from Model import confidenceInterval as ci
interface.heading()
answer = interface.menu()
if answer == '1':
mean, deviation, confidence = interface.readDataNormalDistribution()
x1, x2, significancePoint = ci.confidenceIntervalForNormalDistribution(mean, deviation, confidence)
prin... | 48.52381 | 113 | 0.707556 | from UI import interface
from Model import confidenceInterval as ci
interface.heading()
answer = interface.menu()
if answer == '1':
mean, deviation, confidence = interface.readDataNormalDistribution()
x1, x2, significancePoint = ci.confidenceIntervalForNormalDistribution(mean, deviation, confidence)
prin... | true | true |
f729d170de44410c1c2eb53540fcb6e23b0e8756 | 6,960 | py | Python | automobile/register/register_model.py | manojmanivannan/MLOps | b082b628f0f85d3f36557ac9d90a091f612268b3 | [
"MIT"
] | null | null | null | automobile/register/register_model.py | manojmanivannan/MLOps | b082b628f0f85d3f36557ac9d90a091f612268b3 | [
"MIT"
] | null | null | null | automobile/register/register_model.py | manojmanivannan/MLOps | b082b628f0f85d3f36557ac9d90a091f612268b3 | [
"MIT"
] | null | null | null | """
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... | 32.372093 | 79 | 0.620259 | import json
import os
import sys
import argparse
import traceback
import joblib
from azureml.core import Run, Experiment, Workspace, Dataset
from azureml.core.model import Model as AMLModel
def main():
run = Run.get_context()
if (run.id.startswith('OfflineRun')):
from dotenv import load_dotenv
... | true | true |
f729d2808f18b0becf83816b2015872b5ef39b72 | 7,865 | py | Python | qiskit/optimization/applications/ising/knapsack.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 504 | 2018-12-15T16:34:03.000Z | 2022-03-26T11:24:53.000Z | qiskit/optimization/applications/ising/knapsack.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 746 | 2018-12-16T16:44:42.000Z | 2021-07-10T16:59:43.000Z | qiskit/optimization/applications/ising/knapsack.py | stefan-woerner/aqua | 12e1b867e254977d9c5992612a7919d8fe016cb4 | [
"Apache-2.0"
] | 421 | 2018-12-22T14:49:00.000Z | 2022-03-04T09:47:07.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.111607 | 96 | 0.640432 |
import logging
import math
import numpy as np
from qiskit.quantum_info import Pauli
from qiskit.aqua.operators import WeightedPauliOperator
logger = logging.getLogger(__name__)
def get_operator(values, weights, max_weight):
if len(values) != len(weights):
raise ValueError("The values and w... | true | true |
f729d296f00b2dff7ad5da52ce4e82f23526c441 | 93 | py | Python | Hybrid/PlanB/2DFLIPFLUDS/flipsolver.py | clatterrr/NumericalComputationProjectsCollection | 95caf3121dc71a91b8e73c1ccc5909f4ab2551ea | [
"MIT"
] | 1 | 2022-01-19T08:55:55.000Z | 2022-01-19T08:55:55.000Z | Hybrid/PlanB/2DFLIPFLUDS/flipsolver.py | clatterrr/NumericalComputationProjectsCollection | 95caf3121dc71a91b8e73c1ccc5909f4ab2551ea | [
"MIT"
] | null | null | null | Hybrid/PlanB/2DFLIPFLUDS/flipsolver.py | clatterrr/NumericalComputationProjectsCollection | 95caf3121dc71a91b8e73c1ccc5909f4ab2551ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 4 10:20:35 2021
@author: Administrator
"""
| 11.625 | 35 | 0.591398 | true | true | |
f729d4c3e9afa190abe599e6bd025572088ac04b | 3,173 | py | Python | asab/api/log.py | TeskaLabs/asab | f28894b62bad192d8d30df01a8ad1b842ee2a2fb | [
"BSD-3-Clause"
] | 23 | 2018-03-07T18:58:13.000Z | 2022-03-29T17:11:47.000Z | asab/api/log.py | TeskaLabs/asab | f28894b62bad192d8d30df01a8ad1b842ee2a2fb | [
"BSD-3-Clause"
] | 87 | 2018-04-04T19:44:13.000Z | 2022-03-31T11:18:00.000Z | asab/api/log.py | TeskaLabs/asab | f28894b62bad192d8d30df01a8ad1b842ee2a2fb | [
"BSD-3-Clause"
] | 10 | 2018-04-30T16:40:25.000Z | 2022-03-09T10:55:24.000Z | import asyncio
import logging
import datetime
import aiohttp
from ..web.rest.json import json_response
from ..log import LOG_NOTICE
##
L = logging.getLogger(__name__)
##
class WebApiLoggingHandler(logging.Handler):
def __init__(self, app, level=logging.NOTSET, buffer_size: int = 10):
super().__init__(level... | 21.153333 | 77 | 0.653955 | import asyncio
import logging
import datetime
import aiohttp
from ..web.rest.json import json_response
from ..log import LOG_NOTICE
L = logging.getLogger(__name__)
class WebApiLoggingHandler(logging.Handler):
def __init__(self, app, level=logging.NOTSET, buffer_size: int = 10):
super().__init__(level=level... | true | true |
f729d4d549ac895aa0f6359d18f77b199943c295 | 31 | py | Python | server/models/resnet/__init__.py | Mobile-and-Ubiquitous-Computing-2020-1/team1 | a3a5b4916a012ee0cd98cb186046a1957872b550 | [
"MIT"
] | 3 | 2020-03-23T10:32:43.000Z | 2020-06-25T03:36:06.000Z | server/models/resnet/__init__.py | Mobile-and-Ubiquitous-Computing-2020-1/team1 | a3a5b4916a012ee0cd98cb186046a1957872b550 | [
"MIT"
] | 4 | 2020-05-11T13:50:00.000Z | 2022-02-10T01:58:08.000Z | server/models/resnet/__init__.py | Mobile-and-Ubiquitous-Computing-2020-1/team1 | a3a5b4916a012ee0cd98cb186046a1957872b550 | [
"MIT"
] | 1 | 2020-08-13T00:01:01.000Z | 2020-08-13T00:01:01.000Z | from .resnet50 import resnet50
| 15.5 | 30 | 0.83871 | from .resnet50 import resnet50
| true | true |
f729d54c1d234bcf6e6e6ed381790c259c322a42 | 12,597 | py | Python | docs/make_docs.py | devshank3/Open3D | 91611eb562680a41be8a52497bb45d278f2c9377 | [
"MIT"
] | 15 | 2020-05-09T07:31:48.000Z | 2021-08-15T07:32:14.000Z | docs/make_docs.py | devshank3/Open3D | 91611eb562680a41be8a52497bb45d278f2c9377 | [
"MIT"
] | null | null | null | docs/make_docs.py | devshank3/Open3D | 91611eb562680a41be8a52497bb45d278f2c9377 | [
"MIT"
] | 5 | 2020-06-27T06:10:50.000Z | 2021-12-27T03:21:24.000Z | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018 www.open3d.org
#
# Permission is her... | 38.522936 | 87 | 0.578471 |
from __future__ import print_function
import argparse
import subprocess
import sys
import multiprocessing
import importlib
import os
from inspect import getmembers, isbuiltin, isclass, ismodule
import shutil
import warnings
import weakref
from tempfile import mkdtemp
def _create_or_clea... | true | true |
f729d64044238fb6790234583b78269b0caced37 | 1,169 | py | Python | cuda_operator.py | theHamsta/PYRO-NN-Layers | c776c3d7315f483937a7cebf667c6d491ecd57e6 | [
"Apache-2.0"
] | 1 | 2021-05-25T07:19:54.000Z | 2021-05-25T07:19:54.000Z | cuda_operator.py | theHamsta/PYRO-NN-Layers | c776c3d7315f483937a7cebf667c6d491ecd57e6 | [
"Apache-2.0"
] | null | null | null | cuda_operator.py | theHamsta/PYRO-NN-Layers | c776c3d7315f483937a7cebf667c6d491ecd57e6 | [
"Apache-2.0"
] | null | null | null | # Copyright [2019] [Christopher Syben]
#
# 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... | 38.966667 | 95 | 0.765612 |
import os.path
import tensorflow as tf
import pyronn_layers
if tf.test.is_built_with_cuda():
_pyronn_layers_module = tf.load_op_library(os.path.dirname(__file__)+'/pyronn_layers.so')
for obj in dir(_pyronn_layers_module):
setattr(pyronn_layers, obj, getattr(_pyronn_layers_module, obj)... | true | true |
f729d7b5ba2bd12ce28285702d61c739f04b20d5 | 3,714 | py | Python | torch/utils/model_zoo.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | torch/utils/model_zoo.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | torch/utils/model_zoo.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | import torch
import hashlib
import os
import re
import shutil
import sys
import tempfile
if sys.version_info[0] == 2:
from urlparse import urlparse
from urllib2 import urlopen
else:
from urllib.request import urlopen
from urllib.parse import urlparse
try:
from tqdm import tqdm
except ImportError:
... | 33.459459 | 120 | 0.633549 | import torch
import hashlib
import os
import re
import shutil
import sys
import tempfile
if sys.version_info[0] == 2:
from urlparse import urlparse
from urllib2 import urlopen
else:
from urllib.request import urlopen
from urllib.parse import urlparse
try:
from tqdm import tqdm
except ImportError:
... | true | true |
f729d8de4b4616f12bb0b43879ea1877d4df9d37 | 3,934 | py | Python | m2data/reader.py | Mindful/m2data | c1f6f978ed44d622bdcce30d6098131919d60a99 | [
"MIT"
] | null | null | null | m2data/reader.py | Mindful/m2data | c1f6f978ed44d622bdcce30d6098131919d60a99 | [
"MIT"
] | null | null | null | m2data/reader.py | Mindful/m2data | c1f6f978ed44d622bdcce30d6098131919d60a99 | [
"MIT"
] | null | null | null | from itertools import takewhile, repeat
from typing import Iterable, Union
from collections.abc import Sized
from m2data.example import Example
# this is sometimes off by an example or two for very large files, but that probably doesn't matter much
def fast_example_count(filename) -> int:
f = open(filename, 'rb'... | 43.230769 | 119 | 0.612608 | from itertools import takewhile, repeat
from typing import Iterable, Union
from collections.abc import Sized
from m2data.example import Example
def fast_example_count(filename) -> int:
f = open(filename, 'rb')
bufgen = takewhile(lambda x: x, (f.raw.read(1024*1024) for _ in repeat(None)))
return sum(buf.... | true | true |
f729d97500dfd4fb73eeb1671698feb9746b119b | 1,255 | py | Python | xclib/classifier/_svm.py | iksteen/pyxclib | 2948162dd780f8230a785abfd2ee57e8ab5cc156 | [
"MIT"
] | 1 | 2021-04-20T13:52:55.000Z | 2021-04-20T13:52:55.000Z | xclib/classifier/_svm.py | iksteen/pyxclib | 2948162dd780f8230a785abfd2ee57e8ab5cc156 | [
"MIT"
] | null | null | null | xclib/classifier/_svm.py | iksteen/pyxclib | 2948162dd780f8230a785abfd2ee57e8ab5cc156 | [
"MIT"
] | null | null | null | from sklearn.svm import LinearSVC
import numpy as np
def apply_threshold(data, threshold):
data[np.where(np.abs(data) < threshold)] = 0
def train_one(data, loss, C, verbose, max_iter, threshold, dual, tol):
def _get_features(obj):
# Index samples iff they are required
# Helful in reducing mem... | 33.026316 | 77 | 0.540239 | from sklearn.svm import LinearSVC
import numpy as np
def apply_threshold(data, threshold):
data[np.where(np.abs(data) < threshold)] = 0
def train_one(data, loss, C, verbose, max_iter, threshold, dual, tol):
def _get_features(obj):
if obj['ind'] is None:
return obj['data'... | true | true |
f729d9783b20ae9d667475c45fc4085bc6c626f7 | 3,846 | py | Python | adam/learner/semantics_utils.py | isi-vista/adam | 43542c4486af7533938e77e7191eae630541a891 | [
"MIT"
] | 8 | 2019-07-02T20:29:31.000Z | 2022-01-03T18:20:41.000Z | adam/learner/semantics_utils.py | Tubbz-alt/adam | 91f392f2529a98cd50c095a18769ae4b55ce4292 | [
"MIT"
] | 1,011 | 2019-07-02T18:00:48.000Z | 2022-03-25T14:56:32.000Z | adam/learner/semantics_utils.py | Tubbz-alt/adam | 91f392f2529a98cd50c095a18769ae4b55ce4292 | [
"MIT"
] | 4 | 2020-08-05T15:36:55.000Z | 2022-01-12T17:16:28.000Z | from typing import Optional, Any, Dict
import numpy as np
import pandas as pd
from more_itertools import first
from networkx import Graph, to_numpy_matrix
import matplotlib.pyplot as plt
import seaborn as sb
from adam.semantics import Concept, KindConcept, ObjectConcept, ActionConcept
class SemanticsManager:
de... | 40.914894 | 109 | 0.671867 | from typing import Optional, Any, Dict
import numpy as np
import pandas as pd
from more_itertools import first
from networkx import Graph, to_numpy_matrix
import matplotlib.pyplot as plt
import seaborn as sb
from adam.semantics import Concept, KindConcept, ObjectConcept, ActionConcept
class SemanticsManager:
de... | true | true |
f729dbddfe2f0e5d66654ec570374536e6b98d9d | 3,353 | py | Python | pano_libs/P0.py | ManuLado/Enviar-comandos-a-marlin | f7f474ad0459602176114c62e7c97874cb69191b | [
"MIT"
] | 2 | 2021-10-02T20:20:45.000Z | 2021-10-02T20:20:53.000Z | pano_libs/P0.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | pano_libs/P0.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | from random import randrange
import matplotlib.pyplot as plt
import numpy as np
import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo", help="echo the string you use here")
parser.add_argument("nombre1", help="echo the string you use here")
parser.add_argument("nombre2", help="... | 35.670213 | 117 | 0.680286 | from random import randrange
import matplotlib.pyplot as plt
import numpy as np
import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo", help="echo the string you use here")
parser.add_argument("nombre1", help="echo the string you use here")
parser.add_argument("nombre2", help="... | true | true |
f729ddddacb585feb09b885d15890a8fa0bd1b87 | 816 | py | Python | photos/migrations/0007_monumenttype.py | kingsdigitallab/mmee-django | 43a8fcf02138f4b114507fa8894717e1363df4f1 | [
"MIT"
] | null | null | null | photos/migrations/0007_monumenttype.py | kingsdigitallab/mmee-django | 43a8fcf02138f4b114507fa8894717e1363df4f1 | [
"MIT"
] | 9 | 2020-02-11T23:19:52.000Z | 2021-06-09T17:39:45.000Z | photos/migrations/0007_monumenttype.py | kingsdigitallab/mmee-django | 43a8fcf02138f4b114507fa8894717e1363df4f1 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-07-03 14:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photos', '0006_alter_photo_and_photographer'),
]
operations = [
migrations.CreateModel(
name='MonumentType',
fields=... | 28.137931 | 114 | 0.560049 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photos', '0006_alter_photo_and_photographer'),
]
operations = [
migrations.CreateModel(
name='MonumentType',
fields=[
('id', models.AutoField(auto_... | true | true |
f729dff0aa4f50ce943e0d25677e59524116d660 | 1,175 | py | Python | tamcolors/tam/tam_loop_receiver.py | cmcmarrow/tamcolors | 65a5f2455bbe35a739b98d14af158c3df7feb786 | [
"Apache-2.0"
] | 29 | 2020-07-17T23:46:17.000Z | 2022-02-06T05:36:44.000Z | tamcolors/tam/tam_loop_receiver.py | sudo-nikhil/tamcolors | 65a5f2455bbe35a739b98d14af158c3df7feb786 | [
"Apache-2.0"
] | 42 | 2020-07-25T19:39:52.000Z | 2021-02-24T01:19:58.000Z | tamcolors/tam/tam_loop_receiver.py | sudo-nikhil/tamcolors | 65a5f2455bbe35a739b98d14af158c3df7feb786 | [
"Apache-2.0"
] | 8 | 2020-07-18T23:02:48.000Z | 2020-12-30T04:07:35.000Z | # built in library
from abc import ABC
class TAMLoopReceiver(ABC):
def __init__(self, name):
self._name = name
self._running = True
self._receiver_settings = {}
def get_name(self):
"""
info: Will get the receiver name
:return: str
"""
return sel... | 22.169811 | 47 | 0.55234 |
from abc import ABC
class TAMLoopReceiver(ABC):
def __init__(self, name):
self._name = name
self._running = True
self._receiver_settings = {}
def get_name(self):
return self._name
def get_handler(self):
raise NotImplementedError()
def done(self):
sel... | true | true |
f729e20d205ec7356a21b63479b3865efad3c249 | 1,306 | py | Python | models/warnings_models.py | ichbineinNerd/Referee | 07683b2883cb1302b414157681e2d2ae8346d69e | [
"MIT"
] | 5 | 2019-04-11T17:55:59.000Z | 2021-02-04T01:38:35.000Z | models/warnings_models.py | ichbineinNerd/Referee | 07683b2883cb1302b414157681e2d2ae8346d69e | [
"MIT"
] | 6 | 2020-05-23T20:49:33.000Z | 2021-09-10T13:30:35.000Z | models/warnings_models.py | ichbineinNerd/Referee | 07683b2883cb1302b414157681e2d2ae8346d69e | [
"MIT"
] | 2 | 2020-05-24T08:32:43.000Z | 2020-05-27T14:21:45.000Z | from __future__ import annotations
from datetime import datetime
class RefWarning:
NEVER = datetime(9999, 1, 1)
def __init__(self, user_id: int, timestamp: datetime, mod_name: str, reason: str = "",
expiration_time: datetime = NEVER):
self.user_id = user_id
self.timestamp = t... | 27.208333 | 90 | 0.63706 | from __future__ import annotations
from datetime import datetime
class RefWarning:
NEVER = datetime(9999, 1, 1)
def __init__(self, user_id: int, timestamp: datetime, mod_name: str, reason: str = "",
expiration_time: datetime = NEVER):
self.user_id = user_id
self.timestamp = t... | true | true |
f729e2cc39bb8e37c1cd7b90d8c111a53df54359 | 41,062 | py | Python | theano/gpuarray/tests/test_dnn.py | alexlee-gk/Theano | e4e08782d3a10d010d3a99bc87fd0fc3b0465405 | [
"BSD-3-Clause"
] | null | null | null | theano/gpuarray/tests/test_dnn.py | alexlee-gk/Theano | e4e08782d3a10d010d3a99bc87fd0fc3b0465405 | [
"BSD-3-Clause"
] | null | null | null | theano/gpuarray/tests/test_dnn.py | alexlee-gk/Theano | e4e08782d3a10d010d3a99bc87fd0fc3b0465405 | [
"BSD-3-Clause"
] | 1 | 2020-07-30T16:55:30.000Z | 2020-07-30T16:55:30.000Z | from __future__ import absolute_import, print_function, division
import logging
from nose.plugins.skip import SkipTest
from nose_parameterized import parameterized
import numpy
from itertools import product, chain
import theano
from six import StringIO
import theano.tensor as T
import theano.tests.unittest_tools as u... | 37.775529 | 104 | 0.528518 | from __future__ import absolute_import, print_function, division
import logging
from nose.plugins.skip import SkipTest
from nose_parameterized import parameterized
import numpy
from itertools import product, chain
import theano
from six import StringIO
import theano.tensor as T
import theano.tests.unittest_tools as u... | true | true |
f729e2ffc0cb2138fcb6b489613b38cef01a97b2 | 1,606 | py | Python | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DeleteRenderingDevicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DeleteRenderingDevicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DeleteRenderingDevicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.5 | 74 | 0.767746 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvs.endpoint import endpoint_data
class DeleteRenderingDevicesRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'vs', '2018-12-12', 'DeleteRenderingDevices')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
f729e46d8267cb5b0c01e06ebe931a33e4c63d20 | 6,479 | py | Python | add_filter_relations.py | Babelscape/crocodile | 424ae33c68fdf22eb305e75b2f498831526d87f8 | [
"MIT"
] | 14 | 2021-09-06T14:19:48.000Z | 2022-03-30T15:30:10.000Z | add_filter_relations.py | Babelscape/crocodile | 424ae33c68fdf22eb305e75b2f498831526d87f8 | [
"MIT"
] | 5 | 2022-01-24T16:10:27.000Z | 2022-03-29T09:33:29.000Z | add_filter_relations.py | Babelscape/crocodile | 424ae33c68fdf22eb305e75b2f498831526d87f8 | [
"MIT"
] | 4 | 2021-12-10T08:56:46.000Z | 2022-03-28T12:24:10.000Z | import jsonlines
import re
import transformers
import torch
from tqdm import trange, tqdm
import argparse
import os, sys
def get_case_insensitive_key_value(input_dict, key):
return next((value for dict_key, value in input_dict.items() if dict_key.lower() == key.lower()), None)
def filter_triples(model, tokenizer,... | 58.9 | 200 | 0.590832 | import jsonlines
import re
import transformers
import torch
from tqdm import trange, tqdm
import argparse
import os, sys
def get_case_insensitive_key_value(input_dict, key):
return next((value for dict_key, value in input_dict.items() if dict_key.lower() == key.lower()), None)
def filter_triples(model, tokenizer,... | true | true |
f729e4a18c914ce149affd3f8a81920b280d3c55 | 2,271 | py | Python | venv/Lib/site-packages/sqlalchemy/dialects/mysql/cymysql.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 5,383 | 2018-11-27T07:34:03.000Z | 2022-03-31T19:40:59.000Z | venv/Lib/site-packages/sqlalchemy/dialects/mysql/cymysql.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 2,719 | 2018-11-27T07:55:01.000Z | 2022-03-31T22:09:44.000Z | venv/Lib/site-packages/sqlalchemy/dialects/mysql/cymysql.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,056 | 2015-01-03T00:30:17.000Z | 2022-03-15T12:56:24.000Z | # mysql/cymysql.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: mysql+cymysql
:name: CyMySQL
:dbapi: cymysql
:connec... | 27.361446 | 85 | 0.638485 |
from .base import BIT
from .base import MySQLDialect
from .mysqldb import MySQLDialect_mysqldb
from ... import util
class _cymysqlBIT(BIT):
def result_processor(self, dialect, coltype):
def process(value):
if value is not None:
v = 0
for i in util.iterby... | true | true |
f729e4e182ac3a20e7743ca6dc182dca213a44ad | 1,340 | py | Python | src/sentry/testutils/skips.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | src/sentry/testutils/skips.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/testutils/skips.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.conf import settings
from six.moves.urllib.parse import urlparse
import os
import socket
import pytest
_service_status = {}
def cassandra_is_available():
if "cassandra" in _service_status:
return _service_status["cassandra"]
try:
socket.cre... | 25.283019 | 99 | 0.700746 | from __future__ import absolute_import
from django.conf import settings
from six.moves.urllib.parse import urlparse
import os
import socket
import pytest
_service_status = {}
def cassandra_is_available():
if "cassandra" in _service_status:
return _service_status["cassandra"]
try:
socket.cre... | true | true |
f729e502185aa58d4b4f06cb88e475a162fc589b | 333 | py | Python | examples/community/custom_user/forms.py | junhoyeo/fastdj | 73284946270d1f7ae13f077931b360f70e5a0143 | [
"MIT"
] | 7 | 2020-02-04T05:08:19.000Z | 2022-01-01T15:49:38.000Z | backend/custom_user/forms.py | code-yeongyu/sunrin-club-applying-system-backend | 217bba7165b75234147ab9230ff084cadfd4cf15 | [
"MIT"
] | null | null | null | backend/custom_user/forms.py | code-yeongyu/sunrin-club-applying-system-backend | 217bba7165b75234147ab9230ff084cadfd4cf15 | [
"MIT"
] | 5 | 2020-02-04T05:09:21.000Z | 2021-11-26T00:46:41.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegisterForm(UserCreationForm):
email = forms.EmailField(max_length=200, help_text='Required')
class Meta:
model = User
fields = ('username', 'email', 'password1',... | 30.272727 | 66 | 0.732733 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegisterForm(UserCreationForm):
email = forms.EmailField(max_length=200, help_text='Required')
class Meta:
model = User
fields = ('username', 'email', 'password1',... | true | true |
f729e5919eadd4d9d935506d38e1e21deec0e140 | 31,381 | py | Python | paasta_tools/cli/cmds/status.py | yuanxu-li/paasta | 5b04f45659293f873c65111a9d1d0909aeed4019 | [
"Apache-2.0"
] | null | null | null | paasta_tools/cli/cmds/status.py | yuanxu-li/paasta | 5b04f45659293f873c65111a9d1d0909aeed4019 | [
"Apache-2.0"
] | null | null | null | paasta_tools/cli/cmds/status.py | yuanxu-li/paasta | 5b04f45659293f873c65111a9d1d0909aeed4019 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 36.532014 | 120 | 0.653835 |
import concurrent.futures
import difflib
import os
import sys
from collections import defaultdict
from datetime import datetime
from distutils.util import strtobool
from itertools import groupby
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import Iterable
... | true | true |
f729e706d2484f595cf802f9d8bf9fbac86d4c32 | 5,134 | py | Python | scripts/extract_toolbox_sections.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | scripts/extract_toolbox_sections.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | scripts/extract_toolbox_sections.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | import os
from collections import defaultdict
from xml.etree import ElementTree as ET
# Todo: ""
# execute from galaxy root dir
tooldict = defaultdict(list)
def main():
doc = ET.parse("tool_conf.xml")
root = doc.getroot()
# index range 1-1000, current sections/tools divided between 250-750
sectioni... | 37.75 | 105 | 0.603428 | import os
from collections import defaultdict
from xml.etree import ElementTree as ET
tooldict = defaultdict(list)
def main():
doc = ET.parse("tool_conf.xml")
root = doc.getroot()
sectionindex = 250
sectionfactor = int(500 / len(root))
for rootchild in root:
currentsectionlabel ... | true | true |
f729e714918038b9f396ec89a8394119a0377539 | 460 | py | Python | tests/dsfs/test_neural_networks.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | tests/dsfs/test_neural_networks.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | tests/dsfs/test_neural_networks.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | import dsfs.neural_networks as under_test
def test_xor_network():
xor_network = [[[20.0, 20, -30], [20.0, 20, -10]], [[-60.0, 60, -30]]]
assert 0.000 < under_test.feed_forward(xor_network, [0, 0])[-1][0] < 0.001
assert 0.999 < under_test.feed_forward(xor_network, [1, 0])[-1][0] < 1.000
assert 0.999 <... | 41.818182 | 78 | 0.634783 | import dsfs.neural_networks as under_test
def test_xor_network():
xor_network = [[[20.0, 20, -30], [20.0, 20, -10]], [[-60.0, 60, -30]]]
assert 0.000 < under_test.feed_forward(xor_network, [0, 0])[-1][0] < 0.001
assert 0.999 < under_test.feed_forward(xor_network, [1, 0])[-1][0] < 1.000
assert 0.999 <... | true | true |
f729e94618f3fc85023f8d1fd03c604f683d234c | 409 | py | Python | sort/insert_sort.py | GetDarren/leetcode-vanilla | d00b307a85a9f1cf329739c1f660b7357667cd58 | [
"MIT"
] | null | null | null | sort/insert_sort.py | GetDarren/leetcode-vanilla | d00b307a85a9f1cf329739c1f660b7357667cd58 | [
"MIT"
] | null | null | null | sort/insert_sort.py | GetDarren/leetcode-vanilla | d00b307a85a9f1cf329739c1f660b7357667cd58 | [
"MIT"
] | null | null | null | """
循环不变式 就是 : A[0, j-1]
"""
from random_array import random
def insert_sort(arr):
if len(arr) < 2:
raise Exception("array is too short to sort")
for j in range(1, len(arr)):
pivot = arr[j]
i = j - 1
while i >= 0 and arr[i] > pivot:
arr[i+1] = arr[i]
i -= 1
arr[i+1] = pivot
return... | 18.590909 | 49 | 0.555012 | from random_array import random
def insert_sort(arr):
if len(arr) < 2:
raise Exception("array is too short to sort")
for j in range(1, len(arr)):
pivot = arr[j]
i = j - 1
while i >= 0 and arr[i] > pivot:
arr[i+1] = arr[i]
i -= 1
arr[i+1] = pivot
return arr
if __name__ == '__main_... | true | true |
f729e94fef7fdd7139406d699760c860a32fcf34 | 20,680 | py | Python | third_party/blink/tools/blinkpy/common/pretty_diff.py | Yannic/chromium | ab32e8aacb08c9fce0dc4bf09eec456ba46e3710 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 76 | 2020-09-02T03:05:41.000Z | 2022-03-30T04:40:55.000Z | third_party/blink/tools/blinkpy/common/pretty_diff.py | blueboxd/chromium-legacy | 07223bc94bd97499909c9ed3c3f5769d718fe2e0 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 45 | 2020-09-02T03:21:37.000Z | 2022-03-31T22:19:45.000Z | third_party/blink/tools/blinkpy/common/pretty_diff.py | Yannic/chromium | ab32e8aacb08c9fce0dc4bf09eec456ba46e3710 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2020-07-22T18:49:18.000Z | 2022-02-08T10:27:16.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prettifies 'git diff' output.
prettify_diff() takes a diff string, and returns an HTML string decorating the
diff.
This code doesn't support other diff c... | 37.944954 | 105 | 0.562234 |
import base64
import difflib
import mimetypes
import re
import six
import zlib
if six.PY2:
import cgi
else:
import html as cgi
from blinkpy.common.base85 import decode_base85
_LEADING_HTML = """<!DOCTYPE html>
<meta charset="UTF-8">
<style>
body {
background: white;
font-family: "Roboto Mono", Menlo... | true | true |
f729eae915a3f96d01c2d8dbee3cd29b73654f13 | 7,571 | py | Python | fhirclient/models/composition_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 418 | 2015-07-01T08:23:16.000Z | 2022-03-31T14:02:30.000Z | fhirclient/models/composition_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | fhirclient/models/composition_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 185 | 2015-03-30T20:23:16.000Z | 2022-03-30T14:39:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import composition
from .fhirdate import FHIRDate
class CompositionTests(unittest.TestCase):
def instantiate_from(self, filename... | 59.614173 | 129 | 0.683133 |
import os
import io
import unittest
import json
from . import composition
from .fhirdate import FHIRDate
class CompositionTests(unittest.TestCase):
def instantiate_from(self, filename):
datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or ''
with io.open(os.path.join(datadir, filename), 'r'... | true | true |
f729eaee359cb5f980f37f19c2c502894bfeb4e4 | 16,157 | py | Python | tests/quick_test.py | panchiittp/pyross | d5a455ae36a61e2fba29b30f1da774f1b284f1e2 | [
"MIT"
] | null | null | null | tests/quick_test.py | panchiittp/pyross | d5a455ae36a61e2fba29b30f1da774f1b284f1e2 | [
"MIT"
] | null | null | null | tests/quick_test.py | panchiittp/pyross | d5a455ae36a61e2fba29b30f1da774f1b284f1e2 | [
"MIT"
] | null | null | null | #!python
"""Unittesting for the pyross module. Run as python -m unittest pyross.test."""
import sys
#remove pwd from path that tries to import .pyx files
for i in sys.path:
if 'pyross' in i or i == '':
sys.path.remove(i)
# print(sys.path)
import pyross
import unittest
import inspect
import numpy as np
impor... | 43.432796 | 108 | 0.518351 |
import sys
for i in sys.path:
if 'pyross' in i or i == '':
sys.path.remove(i)
import pyross
import unittest
import inspect
import numpy as np
import scipy as sp
class DeterministicTest(unittest.TestCase):
N = np.asarray([10000], dtype=np.float64)
M = 1
alpha = 0
beta = 0.0071
gIa = ... | true | true |
f729ebdbc441f606cce6d4823d02a249f2b77337 | 1,260 | py | Python | test/metrics/android_startup_powrails.py | nicomazz/perfetto | fb875c61cf00ded88a3f46cb562ab943129cb7af | [
"Apache-2.0"
] | 3 | 2021-03-07T19:52:29.000Z | 2021-11-25T01:57:25.000Z | test/metrics/android_startup_powrails.py | nicomazz/perfetto | fb875c61cf00ded88a3f46cb562ab943129cb7af | [
"Apache-2.0"
] | 9 | 2019-12-30T02:56:16.000Z | 2020-12-22T07:05:04.000Z | test/metrics/android_startup_powrails.py | nicomazz/perfetto | fb875c61cf00ded88a3f46cb562ab943129cb7af | [
"Apache-2.0"
] | 15 | 2018-09-17T18:30:47.000Z | 2021-11-25T01:57:19.000Z | #!/usr/bin/python
# Copyright (C) 2018 The Android Open Source Project
#
# 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 ... | 31.5 | 74 | 0.761905 |
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import synth_common
trace = synth_common.create_trace()
trace.add_packet()
trace.add_power_rails_desc(1, 'PR_1')
trace.add_power_rails_desc(2, 'PR_2')
trace.add_power_rails_desc(3, 'PR_3')
trace.add_power_r... | true | true |
f729ed17f785ba9a429071f6f20dbd6ca0f95643 | 3,316 | py | Python | test6.py | rscinto/WeatherStation | df11d550f54e0a2a3964915f13482f76379f0c24 | [
"MIT"
] | null | null | null | test6.py | rscinto/WeatherStation | df11d550f54e0a2a3964915f13482f76379f0c24 | [
"MIT"
] | null | null | null | test6.py | rscinto/WeatherStation | df11d550f54e0a2a3964915f13482f76379f0c24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
#
import RPi.GPIO as GPIO
from signal import pause
#import dht11
import math
#
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
#import subprocess
#
#import sys
import board
imp... | 25.312977 | 103 | 0.646261 |
import time
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
import RPi.GPIO as GPIO
from signal import pause
import math
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import board
import pigpio
import DHT
import time
import datetime
RST = None
... | true | true |
f729ed6fd28f976514f79ff059bea5c9cde24f99 | 956 | py | Python | tests/test.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | tests/test.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | tests/test.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import functools
import typing
class Accumulate:
@staticmethod
def __call__(
func: typing.Callable,
identity: int,
):
def fn(
a: typing.Iterable[int],
) -> int:
return functools.reduce(
func,
a,
ident... | 18.384615 | 50 | 0.520921 | import functools
import typing
class Accumulate:
@staticmethod
def __call__(
func: typing.Callable,
identity: int,
):
def fn(
a: typing.Iterable[int],
) -> int:
return functools.reduce(
func,
a,
ident... | true | true |
f729ee85fe98cf94b4dbc20ab1851bdb837e4c73 | 1,083 | py | Python | Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | Configuration/Generator/python/PhotonJet_Pt_10_14TeV_TuneCUETP8M1_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
pythiaHepMCVerbosity = cms.untracked.bool(False),
... | 45.125 | 74 | 0.54386 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
pythiaHepMCVerbosity = cms.untracked.bool(False),
... | true | true |
f729ef58649691ca9cf4d55e3e30024b565a869a | 1,897 | py | Python | dummy_2d_features.py | jhong93/vpd | 1ed3e8631c46e078ecb9a7756dba1f1c14aead5b | [
"BSD-3-Clause"
] | 7 | 2021-11-26T01:15:23.000Z | 2022-03-15T10:51:47.000Z | dummy_2d_features.py | jhong93/vpd | 1ed3e8631c46e078ecb9a7756dba1f1c14aead5b | [
"BSD-3-Clause"
] | 4 | 2022-01-15T09:46:00.000Z | 2022-02-05T07:10:18.000Z | dummy_2d_features.py | jhong93/vpd | 1ed3e8631c46e078ecb9a7756dba1f1c14aead5b | [
"BSD-3-Clause"
] | 1 | 2021-09-18T16:50:14.000Z | 2021-09-18T16:50:14.000Z | #!/usr/bin/env python3
"""
Convert COCO17 2D poses to dummy embeddings for 2D-VPD.
"""
import os
import argparse
import numpy as np
from tqdm import tqdm
from util.io import store_pickle, load_gz_json
from vipe_dataset.dataset_base import normalize_2d_skeleton
def get_args():
parser = argparse.ArgumentParser()... | 32.706897 | 83 | 0.614128 |
import os
import argparse
import numpy as np
from tqdm import tqdm
from util.io import store_pickle, load_gz_json
from vipe_dataset.dataset_base import normalize_2d_skeleton
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('pose_dir', type=str)
parser.add_argument('-o', '--out_di... | true | true |
f729ef5be0ca6d131bb95c8b19e87d2238010156 | 3,299 | py | Python | dump-roasts.py | jglogan/roastime-data | cfd7bc7b85435225e9316d0aa00bf490b2f4b66f | [
"MIT"
] | 1 | 2021-12-14T21:24:47.000Z | 2021-12-14T21:24:47.000Z | dump-roasts.py | jglogan/roastime-data | cfd7bc7b85435225e9316d0aa00bf490b2f4b66f | [
"MIT"
] | null | null | null | dump-roasts.py | jglogan/roastime-data | cfd7bc7b85435225e9316d0aa00bf490b2f4b66f | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import argparse
import csv
import datetime
import json
import os
import sys
roast_fields = [
'dateTime',
'uid',
'roastNumber',
'roastName',
'beanId',
'rating',
'serialNumber',
'firmware',
'hardware',
{'fields': ['ambient', 'ambientTemp'], 'mapped_field... | 33.323232 | 121 | 0.658381 |
import argparse
import csv
import datetime
import json
import os
import sys
roast_fields = [
'dateTime',
'uid',
'roastNumber',
'roastName',
'beanId',
'rating',
'serialNumber',
'firmware',
'hardware',
{'fields': ['ambient', 'ambientTemp'], 'mapped_field': 'ambient', 'type': f... | true | true |
f729ef60b68c40e555be435faed97dbc1fd4116d | 12,824 | py | Python | owtf/plugin/plugin_params.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugin/plugin_params.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugin/plugin_params.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | """
owtf.plugin.plugin_params.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Manage parameters to the plugins
"""
import logging
from collections import defaultdict
from owtf.config import config_handler
from owtf.db.database import get_scoped_session
from owtf.managers.error import add_error
from owtf.utils.error import abort_fram... | 37.497076 | 122 | 0.592171 | import logging
from collections import defaultdict
from owtf.config import config_handler
from owtf.db.database import get_scoped_session
from owtf.managers.error import add_error
from owtf.utils.error import abort_framework
from owtf.utils.logger import logger
from owtf.utils.strings import merge_dicts
class Plugin... | true | true |
f729ef684ba87ce3a349558d7e959d1f2d28e025 | 9,264 | py | Python | stonesoup/simulator/simple.py | JPompeus/Stone-Soup | 030c60aaf5ff92d7bb53f06e350c0bf58c9af037 | [
"MIT"
] | null | null | null | stonesoup/simulator/simple.py | JPompeus/Stone-Soup | 030c60aaf5ff92d7bb53f06e350c0bf58c9af037 | [
"MIT"
] | 4 | 2020-03-10T13:51:00.000Z | 2020-03-23T12:38:24.000Z | stonesoup/simulator/simple.py | JPompeus/Stone-Soup | 030c60aaf5ff92d7bb53f06e350c0bf58c9af037 | [
"MIT"
] | 1 | 2019-12-09T14:33:09.000Z | 2019-12-09T14:33:09.000Z | # -*- coding: utf-8 -*-
import datetime
import numpy as np
from ..base import Property
from ..models.measurement import MeasurementModel
from ..models.transition import TransitionModel
from ..reader import GroundTruthReader
from ..types.detection import TrueDetection, Clutter
from ..types.groundtruth import GroundTru... | 40.454148 | 78 | 0.655117 |
import datetime
import numpy as np
from ..base import Property
from ..models.measurement import MeasurementModel
from ..models.transition import TransitionModel
from ..reader import GroundTruthReader
from ..types.detection import TrueDetection, Clutter
from ..types.groundtruth import GroundTruthPath, GroundTruthStat... | true | true |
f729f12176ee792d4c983261f3ac3717876984d3 | 1,212 | py | Python | eta/t/test_parser.py | lewismj/eta | a07a9c078f8e2c9e166febea0ee61351c25caaa8 | [
"BSD-2-Clause"
] | null | null | null | eta/t/test_parser.py | lewismj/eta | a07a9c078f8e2c9e166febea0ee61351c25caaa8 | [
"BSD-2-Clause"
] | null | null | null | eta/t/test_parser.py | lewismj/eta | a07a9c078f8e2c9e166febea0ee61351c25caaa8 | [
"BSD-2-Clause"
] | null | null | null | """
Basic unit tests for the parser class.
"""
import unittest
from eta.parser import parser
from eta.types import Symbol
from lark.visitors import VisitError
class ParserTest(unittest.TestCase):
def test_basic_expressions(self):
try:
parser.parse("(defun (foo x y) (+ x y))")
pars... | 27.545455 | 59 | 0.584158 | import unittest
from eta.parser import parser
from eta.types import Symbol
from lark.visitors import VisitError
class ParserTest(unittest.TestCase):
def test_basic_expressions(self):
try:
parser.parse("(defun (foo x y) (+ x y))")
parser.parse("(+ 21 35 12 7)")
parser.... | true | true |
f729f1284ac97c73e57672805869326a3657d65a | 2,949 | py | Python | bc/search/tests/test_synonyms.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | 1 | 2021-02-27T07:27:17.000Z | 2021-02-27T07:27:17.000Z | bc/search/tests/test_synonyms.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | null | null | null | bc/search/tests/test_synonyms.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | 1 | 2021-06-09T15:56:54.000Z | 2021-06-09T15:56:54.000Z | from unittest.mock import patch
from django.test import TestCase
from bc.search.tests.fixtures import TermFactory
from bc.search.utils import SYNONYMS_CACHE_KEY, cache, get_synonyms
class SynonymTest(TestCase):
def test_basic(self):
TermFactory(canonical_term="foo", synonyms=["soup", "potatoes"])
... | 39.32 | 88 | 0.656833 | from unittest.mock import patch
from django.test import TestCase
from bc.search.tests.fixtures import TermFactory
from bc.search.utils import SYNONYMS_CACHE_KEY, cache, get_synonyms
class SynonymTest(TestCase):
def test_basic(self):
TermFactory(canonical_term="foo", synonyms=["soup", "potatoes"])
... | true | true |
f729f150a9457bcfb66b694ad7626c679afc605a | 3,103 | py | Python | ucsmsdk/mometa/bios/BiosSettingRef.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/bios/BiosSettingRef.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/bios/BiosSettingRef.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for BiosSettingRef ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class BiosSettingRefConsts():
IS_DEFAULT_NO = "no"
IS_DEFAULT_YES = "yes"
... | 51.716667 | 248 | 0.636481 | import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class BiosSettingRefConsts():
IS_DEFAULT_NO = "no"
IS_DEFAULT_YES = "yes"
IS_SUPPORTED_NO = "no"
IS_SUPPORTED_YES = "yes"
class BiosSettingRef(ManagedOb... | true | true |
f729f26ea4e35c38ddbe2c84c2bc600c4af7bd30 | 1,110 | py | Python | body/test/test_dxl_comms.py | hello-ag/stretch_body | 4d9a1f10617b8f7155b8498c5333821818ce24ab | [
"RSA-MD"
] | null | null | null | body/test/test_dxl_comms.py | hello-ag/stretch_body | 4d9a1f10617b8f7155b8498c5333821818ce24ab | [
"RSA-MD"
] | 1 | 2021-08-29T21:42:17.000Z | 2021-08-30T05:58:15.000Z | body/test/test_dxl_comms.py | hello-ag/stretch_body | 4d9a1f10617b8f7155b8498c5333821818ce24ab | [
"RSA-MD"
] | 3 | 2021-08-20T22:51:57.000Z | 2021-09-02T17:05:25.000Z | # Logging level must be set before importing any stretch_body class
import stretch_body.robot_params
#stretch_body.robot_params.RobotParams.set_logging_level("DEBUG")
import unittest
import stretch_body.device
import stretch_body.robot as robot
import numpy as np
class TestTimingStats(unittest.TestCase):
def test... | 39.642857 | 81 | 0.692793 |
import stretch_body.robot_params
import unittest
import stretch_body.device
import stretch_body.robot as robot
import numpy as np
class TestTimingStats(unittest.TestCase):
def test_thread_starvation_group_sync_read(self):
robot = stretch_body.robot.Robot()
robot.end_of_arm.params['use_group_sync... | true | true |
f729f2fd022c7e13fb4bc572acfc2350bc58e2f3 | 403 | py | Python | app/emails.py | JoyWambui/write-a-way | 2b535406f5c62722d478db8c186562009cf50e65 | [
"MIT"
] | null | null | null | app/emails.py | JoyWambui/write-a-way | 2b535406f5c62722d478db8c186562009cf50e65 | [
"MIT"
] | null | null | null | app/emails.py | JoyWambui/write-a-way | 2b535406f5c62722d478db8c186562009cf50e65 | [
"MIT"
] | null | null | null | import os
from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email =os.environ.get("MAIL_USERNAME")
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)... | 33.583333 | 66 | 0.741935 | import os
from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email =os.environ.get("MAIL_USERNAME")
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)... | true | true |
f729f311d8ca65272c4d0f7490c02839068e71a4 | 833 | py | Python | examples/trio_example.py | leanprover-community/lean-client-python | efeb257b7e672d02c1005a6624251ad6dd392451 | [
"Apache-2.0"
] | 13 | 2020-05-03T21:32:14.000Z | 2021-06-01T10:32:11.000Z | examples/trio_example.py | leanprover-community/lean-client-python | efeb257b7e672d02c1005a6624251ad6dd392451 | [
"Apache-2.0"
] | 22 | 2020-04-25T12:18:12.000Z | 2021-07-22T19:39:19.000Z | examples/trio_example.py | leanprover-community/lean-client-python | efeb257b7e672d02c1005a6624251ad6dd392451 | [
"Apache-2.0"
] | 2 | 2020-05-06T07:58:33.000Z | 2020-11-03T22:11:54.000Z | #!/usr/bin/env python
from pathlib import Path
import trio # type: ignore
from lean_client.trio_server import TrioLeanServer
async def main():
lines = Path('test.lean').read_text().split('\n')
async with trio.open_nursery() as nursery:
server = TrioLeanServer(nursery, debug=False)
await serv... | 28.724138 | 67 | 0.59904 |
from pathlib import Path
import trio
from lean_client.trio_server import TrioLeanServer
async def main():
lines = Path('test.lean').read_text().split('\n')
async with trio.open_nursery() as nursery:
server = TrioLeanServer(nursery, debug=False)
await server.start()
await server.ful... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.