hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7170eb31ebfcf1d90bae6e7d44135dc95875c7b | 2,701 | py | Python | examples/do_full_save_example.py | cclauss/hyperparameter_hunter | 12fcbbd4ed71447f80e41f3538be824126b3e209 | [
"MIT"
] | null | null | null | examples/do_full_save_example.py | cclauss/hyperparameter_hunter | 12fcbbd4ed71447f80e41f3538be824126b3e209 | [
"MIT"
] | null | null | null | examples/do_full_save_example.py | cclauss/hyperparameter_hunter | 12fcbbd4ed71447f80e41f3538be824126b3e209 | [
"MIT"
] | null | null | null | from hyperparameter_hunter import Environment, CrossValidationExperiment
from hyperparameter_hunter.utils.learning_utils import get_toy_classification_data
from sklearn.model_selection import RepeatedStratifiedKFold
from xgboost import XGBClassifier
def do_full_save(experiment_result):
"""This is a simple check t... | 60.022222 | 129 | 0.775268 | from hyperparameter_hunter import Environment, CrossValidationExperiment
from hyperparameter_hunter.utils.learning_utils import get_toy_classification_data
from sklearn.model_selection import RepeatedStratifiedKFold
from xgboost import XGBClassifier
def do_full_save(experiment_result):
return experiment_result['f... | true | true |
f71710eb7646ca089fb4cdca00db365acd3cf522 | 1,978 | py | Python | ucsmsdk/mometa/macpool/MacpoolUniverse.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/macpool/MacpoolUniverse.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/macpool/MacpoolUniverse.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for MacpoolUniverse ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class MacpoolUniverseConsts():
pass
class MacpoolUniverse(ManagedObject):
... | 43.955556 | 248 | 0.651668 | import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class MacpoolUniverseConsts():
pass
class MacpoolUniverse(ManagedObject):
consts = MacpoolUniverseConsts()
naming_props = set([])
mo_meta = MoMeta("Ma... | true | true |
f7171159415e7019d10d3a184eb5d2bb629cc8f6 | 7,052 | py | Python | image_classification/MLP-Mixer/load_pytorch_weights.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | image_classification/MLP-Mixer/load_pytorch_weights.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | image_classification/MLP-Mixer/load_pytorch_weights.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 33.421801 | 86 | 0.591605 | import os
import numpy as np
import paddle
import torch
import timm
from mlp_mixer import build_mlp_mixer as build_model
from config import get_config
def print_model_named_params(model):
print('----------------------------------')
for name, param in model.named_parameters():
print(name, param.shape)
... | true | true |
f717117743a109d891ba595119728a6bb26c4c8a | 2,424 | py | Python | code/3D_plot/plot3d.py | iszhaoxin/Presentation | 70cebcae6717d39df5041dbfeefe2ebba6a752fa | [
"MIT"
] | null | null | null | code/3D_plot/plot3d.py | iszhaoxin/Presentation | 70cebcae6717d39df5041dbfeefe2ebba6a752fa | [
"MIT"
] | null | null | null | code/3D_plot/plot3d.py | iszhaoxin/Presentation | 70cebcae6717d39df5041dbfeefe2ebba6a752fa | [
"MIT"
] | null | null | null | import igraph
import json
data = []
f = open("./miserables.json", 'r')
f = open("./mygraph.json", 'r')
data = json.loads(f.read())
print(data.keys())
N=len(data['nodes'])
L=len(data['links'])
Edges=[(data['links'][k]['source'], data['links'][k]['target']) for k in range(L)]
G=igraph.Graph(Edges, directed=False)
... | 24.734694 | 119 | 0.558581 | import igraph
import json
data = []
f = open("./miserables.json", 'r')
f = open("./mygraph.json", 'r')
data = json.loads(f.read())
print(data.keys())
N=len(data['nodes'])
L=len(data['links'])
Edges=[(data['links'][k]['source'], data['links'][k]['target']) for k in range(L)]
G=igraph.Graph(Edges, directed=False)
... | true | true |
f71711cd4743336100f7a85eeb3ee827d1e992c5 | 5,321 | py | Python | spotify/views.py | Caleb-Shepard/Silent-Disco | 80f2cf04278d178c149999d643507aa26bee8654 | [
"MIT"
] | null | null | null | spotify/views.py | Caleb-Shepard/Silent-Disco | 80f2cf04278d178c149999d643507aa26bee8654 | [
"MIT"
] | null | null | null | spotify/views.py | Caleb-Shepard/Silent-Disco | 80f2cf04278d178c149999d643507aa26bee8654 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from .credentials import REDIRECT_URI, CLIENT_SECRET, CLIENT_ID
from rest_framework.views import APIView
from requests import Request, post
from rest_framework import status
from rest_framework.response import Response
from .util import *
from api.models import Room
from .m... | 34.551948 | 98 | 0.640857 | from django.shortcuts import render, redirect
from .credentials import REDIRECT_URI, CLIENT_SECRET, CLIENT_ID
from rest_framework.views import APIView
from requests import Request, post
from rest_framework import status
from rest_framework.response import Response
from .util import *
from api.models import Room
from .m... | true | true |
f717123331164f33e20c5a56f3a0048c5419d173 | 9,110 | py | Python | tests/test_keydb.py | meskio/tuf | 09c3ceb993d40f7339bbbaf4eae617f95b972708 | [
"MIT"
] | 1 | 2015-02-16T22:53:00.000Z | 2015-02-16T22:53:00.000Z | tests/test_keydb.py | meskio/tuf | 09c3ceb993d40f7339bbbaf4eae617f95b972708 | [
"MIT"
] | null | null | null | tests/test_keydb.py | meskio/tuf | 09c3ceb993d40f7339bbbaf4eae617f95b972708 | [
"MIT"
] | 1 | 2019-09-12T02:32:54.000Z | 2019-09-12T02:32:54.000Z | #!/usr/bin/env python
"""
<Program Name>
test_keydb.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
October 2012.
<Copyright>
See LICENSE for licensing information.
<Purpose>
Unit test for 'keydb.py'.
"""
# Help with Python 3 compatibility, where the print statement is a function, an
# i... | 35.866142 | 84 | 0.681668 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import unittest
import logging
import tuf
import tuf.formats
import tuf.keys
import tuf.keydb
import tuf.log
logger = logging.getLogger('tuf.test_keydb')
KEYS = []
... | true | true |
f71712333b3dfe5f51734a3e9dc773e435f4a887 | 264 | py | Python | python/setup.py | Mattis3403/lucy_password | e0d6db6f3fc5bebadf9e184d3972f09cf58ac1e5 | [
"MIT"
] | null | null | null | python/setup.py | Mattis3403/lucy_password | e0d6db6f3fc5bebadf9e184d3972f09cf58ac1e5 | [
"MIT"
] | null | null | null | python/setup.py | Mattis3403/lucy_password | e0d6db6f3fc5bebadf9e184d3972f09cf58ac1e5 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='lucy_password',
version='0.1',
url='https://github.com/Mattis3403/lucy_password',
license='MIT',
author='Lucy',
author_email='m.seebeck@campus.tu-berlin.de',
description='A Password Manager'
)
| 22 | 54 | 0.67803 | from setuptools import setup
setup(
name='lucy_password',
version='0.1',
url='https://github.com/Mattis3403/lucy_password',
license='MIT',
author='Lucy',
author_email='m.seebeck@campus.tu-berlin.de',
description='A Password Manager'
)
| true | true |
f7171260e741432d5843b14ddc6f794a0f0ae620 | 21,489 | py | Python | layers/poky/meta/lib/oeqa/oetest.py | dtischler/px30-test | 55dce0b7aff1c4a7dea3ac94f94cc9c67fba7c9f | [
"Apache-2.0"
] | 53 | 2018-02-28T08:51:32.000Z | 2022-02-28T06:49:23.000Z | meta/lib/oeqa/oetest.py | nareshgbhat/luv-yocto | 48976c54238dda0791e274927371265d259c0e5a | [
"MIT"
] | 27 | 2018-01-25T00:26:53.000Z | 2020-08-09T05:20:04.000Z | meta/lib/oeqa/oetest.py | nareshgbhat/luv-yocto | 48976c54238dda0791e274927371265d259c0e5a | [
"MIT"
] | 51 | 2018-02-21T04:46:08.000Z | 2022-03-02T04:20:41.000Z | # Copyright (C) 2013 Intel Corporation
#
# Released under the MIT license (see COPYING.MIT)
# Main unittest module used by testimage.bbclass
# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
# It also has some helper functions and it's responsible for actually star... | 34.828201 | 171 | 0.589557 |
import os, re, mmap, sys
import unittest
import inspect
import subprocess
import signal
import shutil
import functools
try:
import bb
except ImportError:
pass
import logging
import oeqa.runtime
# Exported test doesn't require sdkext
try:
import oeqa.sdkext
except ImportError:
pass
from oeqa.utils.de... | true | true |
f71712d716cabab7ce71af1445f2108a94cac93f | 2,041 | py | Python | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/RegularExpressions.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 31 | 2018-11-21T01:49:06.000Z | 2022-03-30T03:41:43.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/RegularExpressions.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 123 | 2019-03-12T22:27:29.000Z | 2022-03-29T17:00:04.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/RegularExpressions.py | sundials-codes/PelePhysics | 5624f83a04f43aa95288be9d8a7bb372a4adefe6 | [
"BSD-3-Clause-LBNL"
] | 32 | 2018-11-05T11:51:59.000Z | 2022-03-29T13:09:32.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~... | 18.898148 | 87 | 0.468398 |
eol = r"$"
whitespace = r"\s+"
whitespaceOpt = r"\s*"
element = r"[A-Za-z][\w+-]?"
namedElement = r"(?P<%s>" + element + r")"
species = r"[A-Za-z(][\w()=*,-]{0,15}[+]*"
coeff = r"\d+[.]?\d*"
coeffOpt = r"\d+[.]?\d*"
number = r"[+-]?(\d+[.]\d*|[.]\d+|\d+)([eE][-+]?\d{1,3})?"
numberOpt = r"(" + number + r")*"
namedNu... | true | true |
f7171371220cb2defcde3ccbb021f461672d109a | 258 | py | Python | 6 kyu/PI approximation.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 6 kyu/PI approximation.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 6 kyu/PI approximation.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | import math
def iter_pi(epsilon):
down=1
res=0
count=0
while abs(res*4-math.pi)>epsilon:
if count%2==0:
res+=1/down
else:
res-=1/down
count+=1
down+=2
return [count, round(res*4,10)] | 19.846154 | 37 | 0.5 | import math
def iter_pi(epsilon):
down=1
res=0
count=0
while abs(res*4-math.pi)>epsilon:
if count%2==0:
res+=1/down
else:
res-=1/down
count+=1
down+=2
return [count, round(res*4,10)] | true | true |
f71713810aaf3fe2f07db20e361f46b522b96650 | 1,562 | py | Python | newsletter/src/newsletter.py | emilybache/BeeFriendly | 7582d8f7140f2d0088404d9cb1d47b6231606c49 | [
"MIT"
] | 4 | 2020-06-14T13:42:39.000Z | 2022-01-29T14:36:53.000Z | newsletter/src/newsletter.py | emilybache/BeeFriendly | 7582d8f7140f2d0088404d9cb1d47b6231606c49 | [
"MIT"
] | 2 | 2022-02-13T15:19:44.000Z | 2022-02-25T12:32:16.000Z | newsletter/src/newsletter.py | emilybache/BeeFriendly | 7582d8f7140f2d0088404d9cb1d47b6231606c49 | [
"MIT"
] | 4 | 2020-06-11T09:31:45.000Z | 2021-08-17T14:00:41.000Z | import sys
import json
import requests
from flask import Flask
from flask import request
from tracing import init_tracer, flask_to_scope
import opentracing
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import install_all_patches
from flask_opentracing import FlaskTracer
from flask_cors ... | 25.193548 | 72 | 0.68758 | import sys
import json
import requests
from flask import Flask
from flask import request
from tracing import init_tracer, flask_to_scope
import opentracing
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import install_all_patches
from flask_opentracing import FlaskTracer
from flask_cors ... | true | true |
f71713d9bb5d058485271de369582288349ed788 | 5,787 | py | Python | monkelabs.py | SolanaNFTCollector/Solana-Mining-Bot | 026fa825ba92b0f6d52678cd425d08f63f9e523d | [
"MIT"
] | 26 | 2022-02-13T23:31:49.000Z | 2022-03-31T21:36:28.000Z | monkelabs.py | SolanaNFTCollector/Solana-Mining-Bot | 026fa825ba92b0f6d52678cd425d08f63f9e523d | [
"MIT"
] | 7 | 2022-02-13T23:33:01.000Z | 2022-03-13T20:49:40.000Z | monkelabs.py | SolanaNFTCollector/Solana-Mining-Bot | 026fa825ba92b0f6d52678cd425d08f63f9e523d | [
"MIT"
] | 9 | 2022-02-13T23:31:51.000Z | 2022-03-30T08:50:10.000Z | import requests
import base64
import time
import os
import pathlib
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
fr... | 40.753521 | 106 | 0.655953 | import requests
import base64
import time
import os
import pathlib
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
fr... | true | true |
f71713f48e400918eea9548ed6280ac938049c7b | 8,414 | py | Python | nmt/onmt/translate/Translator.py | Priyansh2/csnli | de31f3f5ae0a956496b76a4643fa9ce7f3736d29 | [
"MIT"
] | 21 | 2018-08-29T13:56:35.000Z | 2021-07-12T23:25:14.000Z | nmt/onmt/translate/Translator.py | Priyansh2/csnli | de31f3f5ae0a956496b76a4643fa9ce7f3736d29 | [
"MIT"
] | 4 | 2018-12-08T17:33:31.000Z | 2021-05-16T08:41:16.000Z | nmt/onmt/translate/Translator.py | Priyansh2/csnli | de31f3f5ae0a956496b76a4643fa9ce7f3736d29 | [
"MIT"
] | 10 | 2018-09-17T05:27:09.000Z | 2021-11-01T08:18:30.000Z | import torch
from torch.autograd import Variable
import onmt.translate.Beam
import onmt.io
class Translator(object):
"""
Uses a model to translate a batch of sentences.
Args:
model (:obj:`onmt.modules.NMTModel`):
NMT model to use for translation
fields (dict of Fields): data fie... | 37.730942 | 79 | 0.537794 | import torch
from torch.autograd import Variable
import onmt.translate.Beam
import onmt.io
class Translator(object):
def __init__(self, model, fields,
beam_size, n_best=1,
max_length=100,
global_scorer=None,
copy_attn=False,
cud... | true | true |
f71713fdfa11b82fe9b89f6419ce8da3b95a2129 | 389 | py | Python | nov q3.py | Manthanc007/APS-2o2o | a84337c4e658a93b6c67515fa3ef59b09f2e5e94 | [
"MIT"
] | null | null | null | nov q3.py | Manthanc007/APS-2o2o | a84337c4e658a93b6c67515fa3ef59b09f2e5e94 | [
"MIT"
] | null | null | null | nov q3.py | Manthanc007/APS-2o2o | a84337c4e658a93b6c67515fa3ef59b09f2e5e94 | [
"MIT"
] | null | null | null | l=list(map(int,input().split()))
output=[]
l1=[ 2**i for i in range(2,26)]
a=1
l2=[]
for i in range(len(l1)):
a=l1[i]-a
l2.append(a)
l2.insert(0,1)
l2.insert(0,1)
l1.insert(0,2)
l1.insert(0,0)
l2.insert(0,0)
for i in range(1,len(l)):
a1=l[i]
output.append(l2[a1])
output.append(... | 18.52381 | 33 | 0.55527 | l=list(map(int,input().split()))
output=[]
l1=[ 2**i for i in range(2,26)]
a=1
l2=[]
for i in range(len(l1)):
a=l1[i]-a
l2.append(a)
l2.insert(0,1)
l2.insert(0,1)
l1.insert(0,2)
l1.insert(0,0)
l2.insert(0,0)
for i in range(1,len(l)):
a1=l[i]
output.append(l2[a1])
output.append(... | true | true |
f71715f08d40ed8ad31bcc3c4ff219a7c0938071 | 615 | py | Python | test/test_form_mutation.py | smalllark/mechanize | a514b8474ca1d65514f6c569f7b10a40906fb014 | [
"BSD-3-Clause"
] | 3 | 2015-10-07T05:27:44.000Z | 2017-07-01T05:18:01.000Z | test/test_form_mutation.py | smalllark/mechanize | a514b8474ca1d65514f6c569f7b10a40906fb014 | [
"BSD-3-Clause"
] | null | null | null | test/test_form_mutation.py | smalllark/mechanize | a514b8474ca1d65514f6c569f7b10a40906fb014 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from unittest import TestCase
import mechanize
def first_form(text, base_uri="http://example.com/"):
return mechanize.ParseString(text, base_uri)[0]
class MutationTests(TestCase):
def test_add_textfield(self):
form = first_form('<input type="text" name="foo" value="bar" />')
... | 25.625 | 75 | 0.673171 | import unittest
from unittest import TestCase
import mechanize
def first_form(text, base_uri="http://example.com/"):
return mechanize.ParseString(text, base_uri)[0]
class MutationTests(TestCase):
def test_add_textfield(self):
form = first_form('<input type="text" name="foo" value="bar" />')
... | true | true |
f71716f48a697e06f2c811b63ac0163ef6dae9d4 | 12,993 | py | Python | OXTR_pathway.py | rribeiro-sci/OXTR | 521f60be922e731757b74d90d9b00c4130c99575 | [
"Apache-2.0"
] | null | null | null | OXTR_pathway.py | rribeiro-sci/OXTR | 521f60be922e731757b74d90d9b00c4130c99575 | [
"Apache-2.0"
] | null | null | null | OXTR_pathway.py | rribeiro-sci/OXTR | 521f60be922e731757b74d90d9b00c4130c99575 | [
"Apache-2.0"
] | null | null | null | '''
THE OXYTOCIN RECEPTOR METABOLIC PATHWAY
VERSION 1.0
G alpha q11 coupled receptor
last modification 4 October 2020
References:
1. Chang, Chiung-wen, Ethan Poteet, John A. Schetz, Zeynep H. Gümüş,
and Harel Weinst... | 47.076087 | 308 | 0.682444 |
import os
import sys
import math
import numpy as np
import sympy
from sympy import Piecewise
from pysb import *
from pysb.macros import *
from pysb.integrate import Solver
from pysb.simulator import ScipyOdeSimulator
from pysb.macros import create_t_obs, drug_binding
__author__ = "Rui Ribeiro"
__organizarion__ = "U... | true | true |
f717181beb4c4046a045a44b6d0f4db857d85911 | 4,211 | py | Python | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 2 | 2021-01-01T12:07:27.000Z | 2021-09-10T03:57:18.000Z | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 35.091667 | 74 | 0.566611 | import logging
from typing import List, Any, Dict
import stanza
from forte.common.configuration import Config
from forte.common.resources import Resources
from forte.data.data_pack import DataPack
from forte.processors.base import PackProcessor
from ft.onto.base_ontology import Token, Sentence, Dependency
__all__ = [... | true | true |
f71718fb9e53b3bcc9413c4c7771e00095fa68d9 | 6,615 | py | Python | tests/test_coverage_max_reduce.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 5 | 2015-04-17T11:27:00.000Z | 2017-11-29T11:31:51.000Z | tests/test_coverage_max_reduce.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 2 | 2020-06-25T19:02:43.000Z | 2020-06-30T19:33:27.000Z | tests/test_coverage_max_reduce.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 3 | 2016-07-04T18:22:56.000Z | 2017-03-03T22:50:19.000Z | #Is it possible to use numpy.ufunc.reduce over an iterator of ndarrays?
#I have a generator function that yields ndarrays (all of the same shape and dtype) and I would like to find the maximum value at each index.
#Currently I have code that looks like this:
def main():
import numpy as np
import cv2
sh... | 58.539823 | 177 | 0.579138 |
def main():
import numpy as np
import cv2
shape = (250, 300)
dsize = shape[::-1]
affmat_list = np.array([
[[ 1.57351554e+00, 0.00000000e+00, 1.09061039e+02],
[ -3.61827926e-01, 7.46059970e-01, 2.50669551e+01]],
[[ 3.05754491e+00, 0.00000000e+00, 8.2802492... | true | true |
f7171a791e39a7775c3b4fa6f439304244a17891 | 698 | py | Python | contracts_api_test/unit/test_base.py | codeforamerica/contracts-api | cc86380d36c6c5ad3028f557c342ab7d1fbb2ddc | [
"BSD-3-Clause"
] | null | null | null | contracts_api_test/unit/test_base.py | codeforamerica/contracts-api | cc86380d36c6c5ad3028f557c342ab7d1fbb2ddc | [
"BSD-3-Clause"
] | null | null | null | contracts_api_test/unit/test_base.py | codeforamerica/contracts-api | cc86380d36c6c5ad3028f557c342ab7d1fbb2ddc | [
"BSD-3-Clause"
] | 2 | 2020-01-09T03:37:56.000Z | 2021-04-16T10:49:40.000Z | from flask.ext.testing import TestCase
from contracts_api.settings import TestConfig
from contracts_api.app import create_app as _create_app
from contracts_api.database import db
from contracts_api.api.models import Stage, Contract, StageProperty, ContractAudit, Flow
class BaseTestCase(TestCase):
'''
A base t... | 30.347826 | 90 | 0.719198 | from flask.ext.testing import TestCase
from contracts_api.settings import TestConfig
from contracts_api.app import create_app as _create_app
from contracts_api.database import db
from contracts_api.api.models import Stage, Contract, StageProperty, ContractAudit, Flow
class BaseTestCase(TestCase):
def create_app(s... | true | true |
f7171ae01ae8fce11b09972bff09e3872d739860 | 395 | py | Python | sayit/wsgi.py | SarahJaine/say-it | 83ea1493a8f2934d7a82fbdd02113e338adff99f | [
"MIT"
] | null | null | null | sayit/wsgi.py | SarahJaine/say-it | 83ea1493a8f2934d7a82fbdd02113e338adff99f | [
"MIT"
] | 3 | 2017-02-26T23:58:56.000Z | 2017-05-08T00:09:15.000Z | sayit/wsgi.py | SarahJaine/say-it | 83ea1493a8f2934d7a82fbdd02113e338adff99f | [
"MIT"
] | null | null | null | import os
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "sayit.settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
public_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'public')
application = get_wsgi_application()
application = Dj... | 28.214286 | 57 | 0.797468 | import os
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "sayit.settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
public_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'public')
application = get_wsgi_application()
application = Dj... | true | true |
f7171afc41a48d20fb0a9e5cbef0798bf315d360 | 5,238 | py | Python | src/cc_catalog_airflow/dags/provider_api_scripts/test_raw_pixel.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/provider_api_scripts/test_raw_pixel.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/provider_api_scripts/test_raw_pixel.py | sarayourfriend/openverse-catalog | b12ba815de782032f72ffa4f5620cfc8de8c84bd | [
"MIT"
] | null | null | null | import json
import logging
import os
from unittest.mock import patch
from common import LicenseInfo, MockImageStore
import raw_pixel as rwp
_license_info = (
'cc0',
'1.0',
'https://creativecommons.org/publicdomain/zero/1.0/',
None
)
license_info = LicenseInfo(*_license_info)
rwp.image_store = MockIma... | 35.876712 | 87 | 0.657312 | import json
import logging
import os
from unittest.mock import patch
from common import LicenseInfo, MockImageStore
import raw_pixel as rwp
_license_info = (
'cc0',
'1.0',
'https://creativecommons.org/publicdomain/zero/1.0/',
None
)
license_info = LicenseInfo(*_license_info)
rwp.image_store = MockIma... | true | true |
f7171bff1d3cb168e55e72b45b4b3d0194d1ce5e | 65,057 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | null | null | null | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | null | null | null | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | 38.201409 | 156 | 0.627957 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: ec2
short_description: create, terminate, start or stop an instance in ec2
description:
- Creates or terminates ec2 instances.
version_adde... | true | true |
f7171c2df3dccec4804c1204824186fb4e3f7e3c | 11,988 | py | Python | azurelinuxagent/common/utils/textutil.py | ezeeyahoo/WALinuxAgent | 7bb93ee0d75b91c6e9bc6d69003b4fdce9697ec2 | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/common/utils/textutil.py | ezeeyahoo/WALinuxAgent | 7bb93ee0d75b91c6e9bc6d69003b4fdce9697ec2 | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/common/utils/textutil.py | ezeeyahoo/WALinuxAgent | 7bb93ee0d75b91c6e9bc6d69003b4fdce9697ec2 | [
"Apache-2.0"
] | 1 | 2020-08-18T20:15:17.000Z | 2020-08-18T20:15:17.000Z | # Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... | 27.75 | 120 | 0.593427 |
import base64
import crypt
import hashlib
import random
import re
import string
import struct
import sys
import zlib
import xml.dom.minidom as minidom
from azurelinuxagent.common.future import ustr
def parse_doc(xml_text):
xml_text = xml_text.encode('utf-8')
return minidom.parseString(xml_text)
de... | true | true |
f7171c608104cc14fe26b6320a24c63490559aab | 1,848 | py | Python | var/spack/repos/builtin/packages/mathematica/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-06-25T15:25:29.000Z | 2020-06-25T15:25:29.000Z | var/spack/repos/builtin/packages/mathematica/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-07-06T19:11:46.000Z | 2018-07-06T19:12:28.000Z | var/spack/repos/builtin/packages/mathematica/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Mathematica(Package):
"""Mathematica: high-powered computation with thousands of... | 40.173913 | 112 | 0.66829 |
from spack import *
import os
class Mathematica(Package):
homepage = "https://www.wolfram.com/mathematica/"
url = 'file://{0}/Mathematica_12.0.0_LINUX.sh'.format(os.getcwd())
version('12.0.0',
sha256='b9fb71e1afcc1d72c200196ffa434512d208fa2920e207878433f504e58ae9d7',
expand=Fals... | true | true |
f7171cb105ed3aeddea51ce5ca8c8235d6316ea6 | 2,672 | py | Python | utils/normalizer.py | bibofeng/DeepRL-1 | 7b14d9720a8ea1e08b05a2889d699a70174caf8f | [
"Apache-2.0"
] | null | null | null | utils/normalizer.py | bibofeng/DeepRL-1 | 7b14d9720a8ea1e08b05a2889d699a70174caf8f | [
"Apache-2.0"
] | null | null | null | utils/normalizer.py | bibofeng/DeepRL-1 | 7b14d9720a8ea1e08b05a2889d699a70174caf8f | [
"Apache-2.0"
] | 1 | 2021-08-11T19:37:04.000Z | 2021-08-11T19:37:04.000Z | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 30.022472 | 83 | 0.483533 | import torch
import numpy as np
class Normalizer:
def __init__(self, o_size):
self.stats = SharedStats(o_size)
def __call__(self, o_):
o = torch.FloatTensor(o_)
self.stats.feed(o)
std = (self.stats.v + 1e-6) ** .5
o = (o - self.stats.m) / std
return o.numpy().re... | true | true |
f7171ccc27659928b6ad50c94240b8057bf13f57 | 6,779 | py | Python | t5_closed_book_qa/t5_cbqa/preprocessors.py | DagonDD/google-research | ccd5d36e7a8ee1d672c93a801634bfd8f2e0c3eb | [
"Apache-2.0"
] | 1 | 2020-09-23T11:38:28.000Z | 2020-09-23T11:38:28.000Z | t5_closed_book_qa/t5_cbqa/preprocessors.py | DagonDD/google-research | ccd5d36e7a8ee1d672c93a801634bfd8f2e0c3eb | [
"Apache-2.0"
] | null | null | null | t5_closed_book_qa/t5_cbqa/preprocessors.py | DagonDD/google-research | ccd5d36e7a8ee1d672c93a801634bfd8f2e0c3eb | [
"Apache-2.0"
] | 1 | 2020-09-23T11:38:32.000Z | 2020-09-23T11:38:32.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.384259 | 80 | 0.682107 |
import tensorflow.compat.v1 as tf
def natural_questions_nocontext(
dataset,
prefix='nq question: ',
drop_yes_no=False,
max_tokens=None,
max_answers=None,
):
def nq_map(ex):
inputs = prefix + ex['question']['text']
annotations = ex['annotations']
yes_no_labels = annotations['ye... | true | true |
f7171d5731043db4e13be2098f930ef1ab4b964b | 2,388 | py | Python | matchms/Fragments.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/Fragments.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | matchms/Fragments.py | maximskorik/matchms | 922f5afaef123a793194bdd74391027477cbb844 | [
"Apache-2.0"
] | null | null | null | import numpy
class Fragments:
"""
Stores arrays of intensities and M/z values, with some checks on their internal consistency.
For example
.. testcode::
import numpy as np
from matchms import Fragments
mz = np.array([10, 20, 30], dtype="float")
intensities = np.arra... | 29.481481 | 112 | 0.624372 | import numpy
class Fragments:
def __init__(self, mz=None, intensities=None):
assert isinstance(mz, numpy.ndarray), "Input argument 'mz' should be a numpy.array."
assert isinstance(intensities, numpy.ndarray), "Input argument 'intensities' should be a numpy.array."
assert mz.shape == intens... | true | true |
f7171db882ba4b1df49ab8686fc4f9a29d574d7c | 7,255 | py | Python | expenses/views/category.py | PrzemyslawSarnacki/django-expenses | 9e07d57e3e2292a318df7c7d8cc4571bb75309d3 | [
"BSD-3-Clause"
] | 6 | 2018-09-29T23:58:50.000Z | 2022-03-10T03:40:38.000Z | expenses/views/category.py | PrzemyslawSarnacki/django-expenses | 9e07d57e3e2292a318df7c7d8cc4571bb75309d3 | [
"BSD-3-Clause"
] | 2 | 2021-02-15T10:20:23.000Z | 2022-03-09T22:32:37.000Z | expenses/views/category.py | PrzemyslawSarnacki/django-expenses | 9e07d57e3e2292a318df7c7d8cc4571bb75309d3 | [
"BSD-3-Clause"
] | 4 | 2020-08-06T12:44:09.000Z | 2021-04-04T13:45:34.000Z | # Django-Expenses
# Copyright © 2018-2021, Chris Warrick.
# All rights reserved.
# See /LICENSE for licensing information.
"""Category management."""
from collections import defaultdict
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from ... | 32.533632 | 117 | 0.596141 |
from collections import defaultdict
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django... | true | true |
f7171df7f02b23aa472799d2c6f707b2a0a863d3 | 2,471 | py | Python | src/scaling/scaling_exec.py | benh/twesos | 194e1976d474005d807f37e7204ea08766e4b42a | [
"BSD-3-Clause"
] | 1 | 2019-02-17T15:56:26.000Z | 2019-02-17T15:56:26.000Z | src/scaling/scaling_exec.py | benh/twesos | 194e1976d474005d807f37e7204ea08766e4b42a | [
"BSD-3-Clause"
] | null | null | null | src/scaling/scaling_exec.py | benh/twesos | 194e1976d474005d807f37e7204ea08766e4b42a | [
"BSD-3-Clause"
] | 3 | 2017-07-10T07:28:30.000Z | 2020-07-25T19:48:07.000Z | #!/usr/bin/env python
import mesos
import os
import pickle
import sys
CPUS = 1
MEM = 50*1024*1024
class NestedScheduler(mesos.Scheduler):
def __init__(self, todo, duration, executor):
mesos.Scheduler.__init__(self)
self.tid = 0
self.todo = todo
self.finished = 0
self.duration = duration
self... | 29.771084 | 79 | 0.647511 | import mesos
import os
import pickle
import sys
CPUS = 1
MEM = 50*1024*1024
class NestedScheduler(mesos.Scheduler):
def __init__(self, todo, duration, executor):
mesos.Scheduler.__init__(self)
self.tid = 0
self.todo = todo
self.finished = 0
self.duration = duration
self.executor = executor
... | false | true |
f7171e3b6b8107097e5ca08c85f785efd7b32b6f | 1,904 | py | Python | st_nodeserver.py | Einstein42/st-nodeserver | 5309bb8bb4d076f981feed752e39e67db3cb9d00 | [
"MIT"
] | 1 | 2017-04-09T01:49:11.000Z | 2017-04-09T01:49:11.000Z | st_nodeserver.py | Einstein42/st-nodeserver | 5309bb8bb4d076f981feed752e39e67db3cb9d00 | [
"MIT"
] | null | null | null | st_nodeserver.py | Einstein42/st-nodeserver | 5309bb8bb4d076f981feed752e39e67db3cb9d00 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
ST Micro Node Server for Polyglot
by Einstein.42(James Milne)
milne.james@gmail.com
'''
import sys
from polyglot.nodeserver_api import SimpleNodeServer, PolyglotConnector
from st_types import STControl
VERSION = "0.0.1"
class STNodeServer(SimpleNodeServer):
''' ST Micro Node Server '... | 31.733333 | 98 | 0.628676 |
import sys
from polyglot.nodeserver_api import SimpleNodeServer, PolyglotConnector
from st_types import STControl
VERSION = "0.0.1"
class STNodeServer(SimpleNodeServer):
sensors = []
def setup(self):
self.logger = self.poly.logger
self.logger.info('Config File param: %s', self.poly... | true | true |
f7171ff457f47582df7834c6b68e24319c65475a | 5,475 | py | Python | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | willwill1101/ambari | 3bed8e0abd0b6f60f15ffd4fa0035b5a57cf81e1 | [
"Apache-2.0",
"MIT"
] | 3 | 2016-12-01T15:55:11.000Z | 2016-12-01T15:56:38.000Z | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | willwill1101/ambari | 3bed8e0abd0b6f60f15ffd4fa0035b5a57cf81e1 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py | willwill1101/ambari | 3bed8e0abd0b6f60f15ffd4fa0035b5a57cf81e1 | [
"Apache-2.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
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")... | 42.773438 | 122 | 0.641461 |
'''
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 use this... | false | true |
f7172061b131608ed83712b9290ea4258e0d92ab | 4,829 | py | Python | examples/validate_secure_metadata.py | ninchat/ninchat-api | 44d57210c760798ac403fa367ee2f2f280bb5dd6 | [
"BSD-2-Clause"
] | 2 | 2017-07-23T12:51:45.000Z | 2018-12-10T01:12:14.000Z | examples/validate_secure_metadata.py | ninchat/ninchat-api | 44d57210c760798ac403fa367ee2f2f280bb5dd6 | [
"BSD-2-Clause"
] | 1 | 2019-03-25T10:04:25.000Z | 2019-03-25T10:04:25.000Z | examples/validate_secure_metadata.py | ninchat/ninchat-api | 44d57210c760798ac403fa367ee2f2f280bb5dd6 | [
"BSD-2-Clause"
] | 6 | 2016-06-23T07:24:04.000Z | 2021-02-02T13:41:06.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2020, Somia Reality Oy
# All rights reserved.
# Installing dependencies:
#
# - Ubuntu/Debian: apt install python3-cryptography python3-jwcrypto
# - Using pip: pip3 install cryptography jwcrypto
from argparse import ArgumentParser
from base64 import b64decode, urlsafe_b64de... | 34.007042 | 136 | 0.720646 |
from argparse import ArgumentParser
from base64 import b64decode, urlsafe_b64decode, urlsafe_b64encode
from calendar import timegm
from datetime import datetime
from hashlib import sha512
from hmac import compare_digest
from json import dumps, loads
from time import time
from cryptography.hazmat.backends import defa... | true | true |
f71720a0eccf6342d22032de87fb4c3251492c1b | 836 | py | Python | plotly/validators/cone/_stream.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/cone/_stream.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | null | null | null | plotly/validators/cone/_stream.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class StreamValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='stream', parent_name='cone', **kwargs):
super(StreamValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | 34.833333 | 75 | 0.586124 | import _plotly_utils.basevalidators
class StreamValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='stream', parent_name='cone', **kwargs):
super(StreamValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | true | true |
f71720bf1e6e85436ed4df37a21e70f073d0583e | 29,705 | py | Python | openaset/distamben/admin.py | muntaza/Open-Aset | f5eb6770a9f7184e3860a18cd655b35b248a9dd5 | [
"BSD-2-Clause"
] | null | null | null | openaset/distamben/admin.py | muntaza/Open-Aset | f5eb6770a9f7184e3860a18cd655b35b248a9dd5 | [
"BSD-2-Clause"
] | null | null | null | openaset/distamben/admin.py | muntaza/Open-Aset | f5eb6770a9f7184e3860a18cd655b35b248a9dd5 | [
"BSD-2-Clause"
] | 2 | 2019-02-18T05:25:23.000Z | 2021-02-01T16:45:23.000Z | ### $Id: admin.py,v 1.29 2017/12/18 09:12:51 muntaza Exp $
from django.contrib import admin
from umum.models import Provinsi, Kabupaten, LokasiBidang, SKPD, SUBSKPD, KodeBarang, HakTanah, SatuanBarang, KeadaanBarang, SKPenghapusan, MutasiBerkurang, JenisPemanfaatan, AsalUsul, Tahun, GolonganBarang, Tanah, KontrakTanah... | 42.254623 | 357 | 0.809291 |
from django.contrib import admin
from umum.models import Provinsi, Kabupaten, LokasiBidang, SKPD, SUBSKPD, KodeBarang, HakTanah, SatuanBarang, KeadaanBarang, SKPenghapusan, MutasiBerkurang, JenisPemanfaatan, AsalUsul, Tahun, GolonganBarang, Tanah, KontrakTanah, PenghapusanTanah, TanahPenghapusan, PemanfaatanTanah, Tan... | true | true |
f71720ecd6a39740e6edfa1bbf6de6885bb541e1 | 1,132 | py | Python | skpr/examples/coded_diffraction.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | null | null | null | skpr/examples/coded_diffraction.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | null | null | null | skpr/examples/coded_diffraction.py | PhilippPelz/scikit-pr-open | 50833b13160b6afe0a743d63d560bddeee2c18b5 | [
"MIT"
] | 1 | 2020-11-11T06:51:46.000Z | 2020-11-11T06:51:46.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 11 10:11:21 2017
@author: philipp
"""
from skpr.core.engines import CodedMeasurementEngine
from skpr.core.models import FarfieldCodedMeasurementNet
from skpr.core.parameters import *
from skpr.inout.h5rw import h5read
from skpr.nn import modules as... | 22.196078 | 63 | 0.770318 |
from skpr.core.engines import CodedMeasurementEngine
from skpr.core.models import FarfieldCodedMeasurementNet
from skpr.core.parameters import *
from skpr.inout.h5rw import h5read
from skpr.nn import modules as M
from skpr.util import *
p = get_default_parameters()
f = h5read('/home/pelzphil/projects/cd_sim.h5')
p.... | true | true |
f71720f87d0474311aa36f05f3fea5fd99145fd6 | 861 | py | Python | src/solutions/template.py | etillison3350/advent-of-code-2020 | 01fcb1ad79ccfc29dbdd0ef9839e7cf5ea28c156 | [
"MIT"
] | null | null | null | src/solutions/template.py | etillison3350/advent-of-code-2020 | 01fcb1ad79ccfc29dbdd0ef9839e7cf5ea28c156 | [
"MIT"
] | null | null | null | src/solutions/template.py | etillison3350/advent-of-code-2020 | 01fcb1ad79ccfc29dbdd0ef9839e7cf5ea28c156 | [
"MIT"
] | null | null | null | from helpers.executor import Executor
from helpers.util import *
import itertools
from itertools import *
import re
from re import *
import numpy as np
from typing import Any, Callable, Generator, Sequence
day, year = None, None # TODO: Update day and year for current day
split_seq = '\n'
class Solution(Executor)... | 26.090909 | 96 | 0.674797 | from helpers.executor import Executor
from helpers.util import *
import itertools
from itertools import *
import re
from re import *
import numpy as np
from typing import Any, Callable, Generator, Sequence
day, year = None, None split_seq = '\n'
class Solution(Executor):
def solve(self, r: Sequence[str], prin... | true | true |
f7172172e00faa7405c4c67e0bc74c55f26a1ecc | 1,684 | py | Python | pythonlibs/mantis/fanbei/smarthome/constants.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 22 | 2019-10-28T07:28:12.000Z | 2022-03-19T15:36:41.000Z | pythonlibs/mantis/fanbei/smarthome/constants.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 1 | 2019-11-07T04:54:14.000Z | 2019-11-07T07:12:48.000Z | pythonlibs/mantis/fanbei/smarthome/constants.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 13 | 2019-10-28T07:29:07.000Z | 2021-11-03T06:53:12.000Z | #coding:utf-8
# DeviceActiveListKeyHash = 'blue_earth.device.active.list' # 存放所有上线设备id {a:Time,b:Time}
#
DeviceCommandQueue = 'smartbox.device.command.queue.{device_type}.{device_id}'
#
# DeviceSequence = 'blue_earth.device.sequence'
DeviceChannelPub = 'smartbox.device.channel.pub.{device_id}' # 设备所有原始数据读取之后分发的通道
D... | 43.179487 | 121 | 0.785629 |
DeviceCommandQueue = 'smartbox.device.command.queue.{device_type}.{device_id}'
DeviceChannelPub = 'smartbox.device.channel.pub.{device_id}'
DeviceAppChannelPub = 'smartbox.device.app.channel.pub.{device_id}'
DeviceChannelPubIoT = '{device_id}'
DeviceChannelPubTraverseDown = 'smartbox.down.pub.{device_id}' Devic... | true | true |
f7172286b14ddc62ce23b4339aa80a3cd495b4ef | 27,950 | py | Python | example_scripts/basic_project_stats.py | vrooje/Data-digging | ae4ee1de0df0d2686115510ac35f5960d5cfaf08 | [
"MIT"
] | 40 | 2016-05-17T10:53:28.000Z | 2022-02-08T05:02:21.000Z | example_scripts/basic_project_stats.py | vrooje/Data-digging | ae4ee1de0df0d2686115510ac35f5960d5cfaf08 | [
"MIT"
] | 29 | 2016-03-17T03:17:03.000Z | 2020-10-01T17:27:59.000Z | example_scripts/basic_project_stats.py | vrooje/Data-digging | ae4ee1de0df0d2686115510ac35f5960d5cfaf08 | [
"MIT"
] | 34 | 2015-12-04T15:18:12.000Z | 2021-08-13T13:35:49.000Z | #Python 2.7.9 (default, Apr 5 2015, 22:21:35)
# the full environment I used to test this is in basic_project_stats.yml
import sys
# file with raw classifications (csv)
# put this way up here so if there are no inputs we exit quickly before even trying to load everything else
try:
classfile_in = sys.argv[1]
except... | 46.505824 | 377 | 0.712916 | import sys
try:
classfile_in = sys.argv[1]
except:
print("\nUsage: %s classifications_infile" % sys.argv[0])
print(" classifications_infile is a Zooniverse (Panoptes) classifications data export CSV.\n")
print(" Optional inputs:")
print(" workflow_id=N")
print(" specify the progr... | true | true |
f71722c909f61d25a111b3cedd33fb84627eb888 | 29,871 | py | Python | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | import requests
import json
import sys
import re
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, threads, reactor
from twisted.protocols.basic import LineReceiver
from twisted.python import log
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol, Http... | 35.773653 | 132 | 0.614174 | import requests
import json
import sys
import re
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, threads, reactor
from twisted.protocols.basic import LineReceiver
from twisted.python import log
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol, Http... | true | true |
f71723d3940a1fbf9bf3aa6a991155af7fdbb8a9 | 1,520 | py | Python | solfasol/publications/migrations/0011_auto_20201008_1533.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | solfasol/publications/migrations/0011_auto_20201008_1533.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | 1 | 2020-06-18T13:08:47.000Z | 2020-06-18T13:08:47.000Z | solfasol/publications/migrations/0011_auto_20201008_1533.py | Solfasol/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-08 12:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publications', '0010_auto_20201007_2250'),
]
operations = [
migrations.AddField(
model_name='publication',
name='ema... | 31.020408 | 91 | 0.571711 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publications', '0010_auto_20201007_2250'),
]
operations = [
migrations.AddField(
model_name='publication',
name='email',
field=models.CharField(blank=Tr... | true | true |
f71723fdc10ac4d26d6a68387acb900d9d2c358c | 674 | py | Python | pipeline/python/ion/reports/parseBeadfind.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 125 | 2015-01-22T05:43:23.000Z | 2022-03-22T17:15:59.000Z | pipeline/python/ion/reports/parseBeadfind.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 59 | 2015-02-10T09:13:06.000Z | 2021-11-11T02:32:38.000Z | pipeline/python/ion/reports/parseBeadfind.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 98 | 2015-01-17T01:25:10.000Z | 2022-03-18T17:29:42.000Z | # Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved
import sys
def parseLog(logText):
metrics = {}
# Get Headings for beadfind
for line in logText:
if "=" in line:
name = line.strip().split("=")
key = name[0].strip()
value = name[1].strip()
... | 21.0625 | 66 | 0.581602 |
import sys
def parseLog(logText):
metrics = {}
for line in logText:
if "=" in line:
name = line.strip().split("=")
key = name[0].strip()
value = name[1].strip()
metrics[key] = value
return metrics
def generateMetrics(beadPath):
f = open(be... | true | true |
f71724f0b63a8c3aadbf9ee4f9fbfb6ac8561c54 | 4,900 | py | Python | temboo/core/Library/NPR/StoryFinder/GetListByID.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/NPR/StoryFinder/GetListByID.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/NPR/StoryFinder/GetListByID.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# GetListByID
# Retrieves a list of NPR categories from a specified list type ID.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"... | 43.362832 | 258 | 0.686939 |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetListByID(Choreography):
def __init__(self, temboo_session):
super(GetListByID, s... | true | true |
f71725ad870be675205ea0d7cbcda78635c972b3 | 3,720 | py | Python | CodonSubstitution/build/biopython/Tests/test_SCOP_Raf.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 1 | 2015-10-07T20:34:29.000Z | 2015-10-07T20:34:29.000Z | CodonSubstitution/build/biopython/Tests/test_SCOP_Raf.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | null | null | null | CodonSubstitution/build/biopython/Tests/test_SCOP_Raf.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | null | null | null |
"""Unit test for Raf"""
import unittest
from Bio.SCOP import Raf
class RafTests(unittest.TestCase):
rafLine = "101m_ 0.01 38 010301 111011 0 153 0 mm 1 vv 2 ll 3 ss 4 ee 5 gg 6 ee 7 ww 8 qq 9 ll 10 vv 11 ll 12 hh 13 vv 14 ww 15 aa 16 kk 17 vv 18 ee 19 aa 20 dd 21 vv 22 a... | 39.157895 | 1,132 | 0.583871 |
import unittest
from Bio.SCOP import Raf
class RafTests(unittest.TestCase):
rafLine = "101m_ 0.01 38 010301 111011 0 153 0 mm 1 vv 2 ll 3 ss 4 ee 5 gg 6 ee 7 ww 8 qq 9 ll 10 vv 11 ll 12 hh 13 vv 14 ww 15 aa 16 kk 17 vv 18 ee 19 aa 20 dd 21 vv 22 aa 23 gg 24 hh 25 gg ... | true | true |
f71726d73754bd88715d19bd42c1ca917206a9ec | 526 | py | Python | human_services/phone_at_location/migrations/0004_auto_20191230_2338.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 12 | 2017-08-30T18:21:00.000Z | 2021-12-09T04:04:17.000Z | human_services/phone_at_location/migrations/0004_auto_20191230_2338.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 424 | 2017-08-08T18:32:14.000Z | 2022-03-30T21:42:51.000Z | human_services/phone_at_location/migrations/0004_auto_20191230_2338.py | pg-irc/pathways-backend | 05a8c4e750523d2d081b030a248c5444d1ed7992 | [
"BSD-3-Clause"
] | 7 | 2017-09-29T21:14:37.000Z | 2019-12-30T21:07:37.000Z | # Generated by Django 2.2.4 on 2019-12-30 23:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('phone_at_location', '0003_auto_20180910_1743'),
]
operations = [
migrations.AlterField(
model_n... | 26.3 | 136 | 0.6673 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('phone_at_location', '0003_auto_20180910_1743'),
]
operations = [
migrations.AlterField(
model_name='phoneatlocation',
name='locatio... | true | true |
f717275ca2c8359dcf62adea379cace6a5b31975 | 29,190 | py | Python | zipline/pipeline/term.py | welly87/zipline | dbdfa8ed86417f954e95bd7468e144589f2cd482 | [
"Apache-2.0"
] | 2 | 2019-05-23T17:19:42.000Z | 2019-06-19T21:49:21.000Z | zipline/pipeline/term.py | welly87/zipline | dbdfa8ed86417f954e95bd7468e144589f2cd482 | [
"Apache-2.0"
] | 1 | 2021-03-25T23:28:04.000Z | 2021-03-25T23:28:04.000Z | zipline/pipeline/term.py | welly87/zipline | dbdfa8ed86417f954e95bd7468e144589f2cd482 | [
"Apache-2.0"
] | 2 | 2020-03-17T23:23:05.000Z | 2020-05-01T20:26:44.000Z | """
Base class for Filters, Factors and Classifiers
"""
from abc import ABCMeta, abstractproperty
from bisect import insort
from collections import Mapping
from weakref import WeakValueDictionary
from numpy import (
array,
dtype as dtype_class,
ndarray,
searchsorted,
)
from six import with_metaclass
f... | 32.289823 | 79 | 0.598664 | from abc import ABCMeta, abstractproperty
from bisect import insort
from collections import Mapping
from weakref import WeakValueDictionary
from numpy import (
array,
dtype as dtype_class,
ndarray,
searchsorted,
)
from six import with_metaclass
from zipline.assets import Asset
from zipline.errors impo... | true | true |
f71727c1dc39153ee0b3faeb26aa5bded60a358e | 1,706 | py | Python | sources/models/components/resistor_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | 1 | 2021-06-23T20:19:45.000Z | 2021-06-23T20:19:45.000Z | sources/models/components/resistor_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | sources/models/components/resistor_model.py | pablintino/Altium-DBlib-source | 65e85572f84048a7e7c5a116b429e09ac9a33e82 | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2020 Pablo Rodriguez Nava, @pablintino
#
# 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
# t... | 37.911111 | 81 | 0.751465 |
from sqlalchemy import Column, String, ForeignKey
from models.components.component_model import ComponentModel
class ResistorModel(ComponentModel):
__tablename__ = 'resistor'
__id_prefix__ = 'RFIX'
id = Column(ForeignKey("component.id"), primary_key=True)
power_max = Column(String(30))
... | true | true |
f717282762e91799ab097381b849786ec18cef78 | 213 | py | Python | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copytright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
"""Dataloader of the SegTrack2 dataset."""
from .loader import SegTrack2
__all__ = ["SegTrack2"]
| 17.75 | 54 | 0.732394 |
from .loader import SegTrack2
__all__ = ["SegTrack2"]
| true | true |
f7172919cb32b1bce840769389a548df78d2e786 | 3,420 | py | Python | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 39.767442 | 78 | 0.635965 |
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest import config
from tempest import test
CONF = config.CONF
class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
@classmethod
def resource_setup(cls):
super(FixedIPsNegativeTestJson, cls).resource... | true | true |
f717292cec5c724f5760c7a638af9b8247d18a07 | 21,662 | py | Python | phi/tf/tf_backend.py | PhylomatX/PhiFlow | 2b7a73c1f595e288d26945cd53cc482952bb1db9 | [
"MIT"
] | null | null | null | phi/tf/tf_backend.py | PhylomatX/PhiFlow | 2b7a73c1f595e288d26945cd53cc482952bb1db9 | [
"MIT"
] | null | null | null | phi/tf/tf_backend.py | PhylomatX/PhiFlow | 2b7a73c1f595e288d26945cd53cc482952bb1db9 | [
"MIT"
] | 1 | 2021-05-04T16:31:41.000Z | 2021-05-04T16:31:41.000Z | import numbers
import uuid
import warnings
from packaging import version
import six
import numpy as np
import six
import tensorflow as tf
from packaging import version
from phi.backend.backend_helper import split_multi_mode_pad, PadSettings, general_grid_sample_nd, equalize_shapes, circular_pad, replicate_pad
from ph... | 39.030631 | 186 | 0.634383 | import numbers
import uuid
import warnings
from packaging import version
import six
import numpy as np
import six
import tensorflow as tf
from packaging import version
from phi.backend.backend_helper import split_multi_mode_pad, PadSettings, general_grid_sample_nd, equalize_shapes, circular_pad, replicate_pad
from ph... | true | true |
f7172942f9d5947ca0af46c7c7e888e04cf6623f | 6,675 | py | Python | bindings/python/ensmallen_graph/datasets/string/flavobacteriumhydatis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/flavobacteriumhydatis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/flavobacteriumhydatis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Flavobacterium hydatis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... | 35.31746 | 223 | 0.703221 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def FlavobacteriumHydatis(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
r... | true | true |
f7172b0b8c3ea7766ba1803624338fcfaab912a0 | 1,473 | py | Python | Python/Algorithms/232.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | 2 | 2021-01-15T17:22:54.000Z | 2021-05-16T19:58:02.000Z | Python/Algorithms/232.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | Python/Algorithms/232.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | class MyQueue:
def __init__(self):
""" Uses two stacks to implement a Queue. Storage holds elements
pushed right before the first pop.
"""
self.storage, self.tmp = [], []
def push(self, x: int) -> None:
""" Unconditionally add to storage. Equivalent to stack.push."""
... | 30.6875 | 79 | 0.551935 | class MyQueue:
def __init__(self):
self.storage, self.tmp = [], []
def push(self, x: int) -> None:
self.storage.append(x)
def pop(self) -> int:
tmp = self.tmp
if not tmp:
storage = self.storage
while storage:
tmp.append... | true | true |
f7172cfeb48041bf769a78d5a1e56314062ba794 | 5,141 | py | Python | library/f5bigip_net_route_domain.py | GabrielFortin/ansible-module-f5bigip | 8d1323e912388e20eafd63a73ec015dd6d8a012c | [
"Apache-2.0"
] | 6 | 2017-01-11T01:28:00.000Z | 2019-02-19T16:11:09.000Z | library/f5bigip_net_route_domain.py | GabrielFortin/ansible-module-f5bigip | 8d1323e912388e20eafd63a73ec015dd6d8a012c | [
"Apache-2.0"
] | 48 | 2017-05-29T17:50:59.000Z | 2020-02-09T15:24:27.000Z | library/f5bigip_net_route_domain.py | GabrielFortin/ansible-module-f5bigip | 8d1323e912388e20eafd63a73ec015dd6d8a012c | [
"Apache-2.0"
] | 5 | 2017-05-05T18:30:51.000Z | 2017-12-19T23:13:05.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 32.333333 | 115 | 0.665435 |
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: f5bigip_net_route_domain
short_description: BIG-IP net route-domain module
description:
- Configures route-domains for traffic management.
version_added: "2.4"
author:
... | true | true |
f7172d0eeab28f547639ac4e3e76bcd936be54db | 1,149 | py | Python | tensorlayer/layers/__init__.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | 1 | 2019-02-24T22:23:59.000Z | 2019-02-24T22:23:59.000Z | tensorlayer/layers/__init__.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | null | null | null | tensorlayer/layers/__init__.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
TensorLayer provides rich layer implementations trailed for
various benchmarks and domain-specific problems. In addition, we also
support transparent access to native TensorFlow parameters.
For example, we provide not only layers for local response normalization, but also
... | 31.054054 | 115 | 0.767624 |
from .binary import *
from .convolution import *
from .core import *
from .dense import *
from .dropout import *
from .extend import *
from .flow_control import *
from .image_resize import *
from .importer import *
from .inputs import *
from .merge import *
from .noise import *
from .normalization import *
from .objec... | true | true |
f7172d3dba51a3291b1ccf91d79c1b90f924a771 | 473 | py | Python | app/ch13-validation/starter/pypi_org/views/cms_views.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 496 | 2019-07-03T05:13:24.000Z | 2022-03-27T01:15:10.000Z | app/ch13-validation/starter/pypi_org/views/cms_views.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 28 | 2021-03-10T08:24:07.000Z | 2022-03-02T07:26:39.000Z | app/ch13-validation/starter/pypi_org/views/cms_views.py | tbensonwest/data-driven-web-apps-with-flask | be025c1c0190419019924f7516f49b3b8452cdf8 | [
"MIT"
] | 562 | 2019-07-03T14:35:21.000Z | 2022-03-31T06:23:58.000Z | import flask
from pypi_org.infrastructure.view_modifiers import response
import pypi_org.services.cms_service as cms_service
blueprint = flask.Blueprint('cms', __name__, template_folder='templates')
@blueprint.route('/<path:full_url>')
@response(template_file='cms/page.html')
def cms_page(full_url: str):
print(... | 24.894737 | 73 | 0.748414 | import flask
from pypi_org.infrastructure.view_modifiers import response
import pypi_org.services.cms_service as cms_service
blueprint = flask.Blueprint('cms', __name__, template_folder='templates')
@blueprint.route('/<path:full_url>')
@response(template_file='cms/page.html')
def cms_page(full_url: str):
print(... | true | true |
f7172eb93f55fa05275985968c5cd0ba4d4c38c0 | 966 | py | Python | robosuite/models/arenas/hole_arena.py | junjungoal/robosuite | 14a9a8672bb14145dd4586a0c0080e1d0d3ff74e | [
"MIT"
] | null | null | null | robosuite/models/arenas/hole_arena.py | junjungoal/robosuite | 14a9a8672bb14145dd4586a0c0080e1d0d3ff74e | [
"MIT"
] | null | null | null | robosuite/models/arenas/hole_arena.py | junjungoal/robosuite | 14a9a8672bb14145dd4586a0c0080e1d0d3ff74e | [
"MIT"
] | null | null | null | from robosuite.models.arenas import TableArena
class HoleArena(TableArena):
"""
Workspace that contains a tabletop with two fixed pegs.
Args:
table_full_size (3-tuple): (L,W,H) full dimensions of the table
table_friction (3-tuple): (sliding, torsional, rolling) friction parameters of the ... | 32.2 | 96 | 0.624224 | from robosuite.models.arenas import TableArena
class HoleArena(TableArena):
def __init__(
self,
table_full_size=(0.45, 0.69, 0.05),
table_friction=(1, 0.005, 0.0001),
table_offset=(0, 0, 0),
):
super().__init__(
table_full_size=table_full_size,
... | true | true |
f7172fbd187e9bb300b57d617d3830a727c1ba69 | 3,748 | py | Python | usaspending_api/idvs/v2/views/funding_rollup.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | 1 | 2020-06-15T19:59:52.000Z | 2020-06-15T19:59:52.000Z | usaspending_api/idvs/v2/views/funding_rollup.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/idvs/v2/views/funding_rollup.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | from collections import OrderedDict
from psycopg2.sql import Identifier, Literal, SQL
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.views import APIView
from usaspending_api.common.cache_decorator import cache_response
from usaspending_api.common.helpers.s... | 44.094118 | 107 | 0.702241 | from collections import OrderedDict
from psycopg2.sql import Identifier, Literal, SQL
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.views import APIView
from usaspending_api.common.cache_decorator import cache_response
from usaspending_api.common.helpers.s... | true | true |
f7173014b1cb6f863746c4e0773f7adabde24751 | 1,474 | py | Python | test/test_runner_change.py | akxlr/bf-stream-py | f2d5fb1afbfcae61713f2414da3e40d326960e58 | [
"Apache-2.0"
] | null | null | null | test/test_runner_change.py | akxlr/bf-stream-py | f2d5fb1afbfcae61713f2414da3e40d326960e58 | [
"Apache-2.0"
] | null | null | null | test/test_runner_change.py | akxlr/bf-stream-py | f2d5fb1afbfcae61713f2414da3e40d326960e58 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Betfair: Exchange Streaming API
API to receive streamed updates. This is an ssl socket connection of CRLF delimited json messages (see RequestMessage & ResponseMessage)
OpenAPI spec version: 1.0.1423
Contact: bdp@betfair.com
Generated by: https://github.com/swagger-api/swagger... | 27.811321 | 140 | 0.718453 |
from __future__ import absolute_import
import os
import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.runner_change import RunnerChange
class TestRunnerChange(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | true | true |
f717303bc1bbfdb991baae18496729085b8816f6 | 1,283 | py | Python | jupyterlab/PrettifyPage.py | Larz60p/MakerProjectApril2019 | 2fd4d68aa66c1f4ad3b01f6a9589a078319280d7 | [
"MIT"
] | 1 | 2019-04-25T22:53:52.000Z | 2019-04-25T22:53:52.000Z | jupyterlab/PrettifyPage.py | Larz60p/MakerProjectApril2019 | 2fd4d68aa66c1f4ad3b01f6a9589a078319280d7 | [
"MIT"
] | null | null | null | jupyterlab/PrettifyPage.py | Larz60p/MakerProjectApril2019 | 2fd4d68aa66c1f4ad3b01f6a9589a078319280d7 | [
"MIT"
] | null | null | null | # PrettifyPage.py
from bs4 import BeautifulSoup
import requests
import BusinessPaths
import pathlib
class PrettifyPage:
def __init__(self):
self.bpath = BusinessPaths.BusinessPaths()
def prettify(self, soup, indent):
pretty_soup = str()
previous_indent = 0
for line in soup.pr... | 31.292683 | 76 | 0.632112 |
from bs4 import BeautifulSoup
import requests
import BusinessPaths
import pathlib
class PrettifyPage:
def __init__(self):
self.bpath = BusinessPaths.BusinessPaths()
def prettify(self, soup, indent):
pretty_soup = str()
previous_indent = 0
for line in soup.prettify().split("\n... | true | true |
f71730a095f88ee9dd10f077cd9170c324f0f4c1 | 755 | py | Python | src/metadata/ruby/parse_author_package.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | 1 | 2022-01-29T16:13:06.000Z | 2022-01-29T16:13:06.000Z | src/metadata/ruby/parse_author_package.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | null | null | null | src/metadata/ruby/parse_author_package.py | Yanivmd/maloss | af85ac202668da88d0b4a885386a1e56703e37c8 | [
"MIT"
] | 1 | 2022-01-29T16:13:07.000Z | 2022-01-29T16:13:07.000Z | import json
name_site = {}
with open('rubygems_metadata.txt') as json_file:
data = json.load(json_file)
for p1 in data['ruby_package']:
dep = p1['dependencies']
if dep:
for val in dep:
print val
else:
print "list is empty..."
if p1['author'] in name_site:
con... | 27.962963 | 73 | 0.54702 | import json
name_site = {}
with open('rubygems_metadata.txt') as json_file:
data = json.load(json_file)
for p1 in data['ruby_package']:
dep = p1['dependencies']
if dep:
for val in dep:
print val
else:
print "list is empty..."
if p1['author'] in name_site:
con... | false | true |
f71730b686a7fb863fdc989a73270099f5159e60 | 2,381 | py | Python | Python 3 Codes/bert_embed.py | Nitinram23/text-to-image | f819bed3dffbccd8e20b03741e3f67178729812b | [
"MIT"
] | null | null | null | Python 3 Codes/bert_embed.py | Nitinram23/text-to-image | f819bed3dffbccd8e20b03741e3f67178729812b | [
"MIT"
] | null | null | null | Python 3 Codes/bert_embed.py | Nitinram23/text-to-image | f819bed3dffbccd8e20b03741e3f67178729812b | [
"MIT"
] | null | null | null | from bert_embedding import BertEmbedding
import numpy as np
import pickle
import argparse
import json
import os
from os.path import join, isfile
import re
import h5py
def save_caption_vectors_flowers(data_dir):
import time
img_dir = join(data_dir, 'flowers/jpg')
image_files = [f for f in os.listdir(img_dir) if 'j... | 30.139241 | 77 | 0.692986 | from bert_embedding import BertEmbedding
import numpy as np
import pickle
import argparse
import json
import os
from os.path import join, isfile
import re
import h5py
def save_caption_vectors_flowers(data_dir):
import time
img_dir = join(data_dir, 'flowers/jpg')
image_files = [f for f in os.listdir(img_dir) if 'j... | true | true |
f71730dab83cd1a03f3141bd046a4fc4403b2874 | 1,886 | py | Python | libs/play_db.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | null | null | null | libs/play_db.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | null | null | null | libs/play_db.py | fangMint/django_web | cf50df6c1a2358996620ac83ffa99b31472d3c07 | [
"AFL-3.0"
] | 1 | 2021-11-22T10:15:50.000Z | 2021-11-22T10:15:50.000Z | # ==================================
# Author : fang
# Time : 2020/4/8 pm 8:55
# Email : zhen.fang@qdreamer.com
# File : play_db.py
# Software : PyCharm
# ==================================
import datetime
DB = {}
class PlayDB:
def __init__(self, inherited=False):
if inherited:
s... | 27.333333 | 83 | 0.534995 | import datetime
DB = {}
class PlayDB:
def __init__(self, inherited=False):
if inherited:
self.__store = DB else:
self.__store = {}
@staticmethod
def __timestamp():
time_stamp = datetime.datetime.now().timestamp()
time_stamp = int(round(time_stamp ... | true | true |
f71730fb4a31346934ff7ec9a4083bfc3b7a99ee | 16,084 | py | Python | pandas/tests/reshape/test_cut.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2019-05-04T03:42:25.000Z | 2019-05-04T03:42:25.000Z | pandas/tests/reshape/test_cut.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/reshape/test_cut.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2020-01-02T14:28:17.000Z | 2020-01-02T14:28:17.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex,
Series, TimedeltaIndex, Timestamp, cut, date_range, isna, qcut,
timedelta_range, to_datetime)
from pandas.api.types import CategoricalDtype as CDT
import pandas.c... | 32.959016 | 79 | 0.624347 | import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex,
Series, TimedeltaIndex, Timestamp, cut, date_range, isna, qcut,
timedelta_range, to_datetime)
from pandas.api.types import CategoricalDtype as CDT
import pandas.c... | true | true |
f71733ffb9bbff488b8f191f8cc9d6dc64459192 | 2,702 | py | Python | Solutions/Trend Micro Vision One/Data Connectors/AzureFunctionTrendMicroXDR/shared_code/configurations.py | sxchuba/Azure-Sentinel | 0f5f543981901dbd9d9654f8f2d0010f8af1e9a6 | [
"MIT"
] | 11 | 2019-02-04T13:37:14.000Z | 2019-02-22T20:47:06.000Z | Solutions/Trend Micro Vision One/Data Connectors/AzureFunctionTrendMicroXDR/shared_code/configurations.py | sxchuba/Azure-Sentinel | 0f5f543981901dbd9d9654f8f2d0010f8af1e9a6 | [
"MIT"
] | 6 | 2019-02-03T13:58:50.000Z | 2019-02-25T02:01:16.000Z | Solutions/Trend Micro Vision One/Data Connectors/AzureFunctionTrendMicroXDR/shared_code/configurations.py | sxchuba/Azure-Sentinel | 0f5f543981901dbd9d9654f8f2d0010f8af1e9a6 | [
"MIT"
] | 4 | 2019-02-03T09:20:27.000Z | 2019-02-12T15:43:35.000Z | import os
VERSION = '1.0.1'
SIEM_NAME = 'SentinelAddon'
XDR_HOSTS = {
'us': 'https://api.xdr.trendmicro.com',
'eu': 'https://api.eu.xdr.trendmicro.com',
'in': 'https://api.in.xdr.trendmicro.com',
'jp': 'https://api.xdr.trendmicro.co.jp',
'sg': 'https://api.sg.xdr.trendmicro.com',
'au': 'https:... | 24.563636 | 88 | 0.707994 | import os
VERSION = '1.0.1'
SIEM_NAME = 'SentinelAddon'
XDR_HOSTS = {
'us': 'https://api.xdr.trendmicro.com',
'eu': 'https://api.eu.xdr.trendmicro.com',
'in': 'https://api.in.xdr.trendmicro.com',
'jp': 'https://api.xdr.trendmicro.co.jp',
'sg': 'https://api.sg.xdr.trendmicro.com',
'au': 'https:... | true | true |
f7173583513fd2e9bcaf8f9083a5b3c6349ba684 | 8,045 | py | Python | env/EnvMultipleStock_train.py | rlaplaza/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020 | 5fe6b8554587320bc6044164270635166c93616d | [
"MIT"
] | null | null | null | env/EnvMultipleStock_train.py | rlaplaza/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020 | 5fe6b8554587320bc6044164270635166c93616d | [
"MIT"
] | null | null | null | env/EnvMultipleStock_train.py | rlaplaza/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020 | 5fe6b8554587320bc6044164270635166c93616d | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# shares normalization factor
# 100 shares per trade
HMAX_NORMALIZE = 100
# initial amount of money we have in our account
INITIAL_ACCOUNT_BALA... | 35.915179 | 168 | 0.549037 | import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
HMAX_NORMALIZE = 100
INITIAL_ACCOUNT_BALANCE = 1000000
STOCK_DIM = 30
TRANSACTION_FEE_PERCENT = 0.001
REWARD_SCALING = 1e-4
class StockEnvTra... | true | true |
f71735a115665e8722defa42706030357a5b5f70 | 13,762 | py | Python | src/asldro/validators/test_user_parameter_input.py | gold-standard-phantoms/asldro | 6ae82ed69d66fed64e1e54e5394cc3b5d8dbe1bd | [
"MIT"
] | 3 | 2021-03-09T15:51:32.000Z | 2021-05-19T13:05:18.000Z | src/asldro/validators/test_user_parameter_input.py | gold-standard-phantoms/asldro | 6ae82ed69d66fed64e1e54e5394cc3b5d8dbe1bd | [
"MIT"
] | null | null | null | src/asldro/validators/test_user_parameter_input.py | gold-standard-phantoms/asldro | 6ae82ed69d66fed64e1e54e5394cc3b5d8dbe1bd | [
"MIT"
] | null | null | null | """ Tests some user inputs to the model to make sure the validation is performed correctly """
# pylint: disable=redefined-outer-name
from copy import deepcopy
import pytest
from asldro.data.filepaths import GROUND_TRUTH_DATA
from asldro.validators.parameters import ValidationError
from asldro.validators.user_parameter... | 34.840506 | 96 | 0.540256 | from copy import deepcopy
import pytest
from asldro.data.filepaths import GROUND_TRUTH_DATA
from asldro.validators.parameters import ValidationError
from asldro.validators.user_parameter_input import (
IMAGE_TYPE_VALIDATOR,
ASL,
GROUND_TRUTH,
STRUCTURAL,
validate_input_params,
get_example_input_... | true | true |
f71736471faae4b0d81905d43eaa8efbc4764f0e | 3,424 | py | Python | superbench/benchmarks/micro_benchmarks/cuda_memory_bw_performance.py | yangpanMS/superbenchmark | 4d85630abba0fe45b8cd3a51e79c15e6ac87a1e6 | [
"MIT"
] | 59 | 2021-04-12T09:44:23.000Z | 2022-03-27T14:33:46.000Z | superbench/benchmarks/micro_benchmarks/cuda_memory_bw_performance.py | yangpanMS/superbenchmark | 4d85630abba0fe45b8cd3a51e79c15e6ac87a1e6 | [
"MIT"
] | 275 | 2021-03-29T06:40:34.000Z | 2022-03-30T07:35:49.000Z | superbench/benchmarks/micro_benchmarks/cuda_memory_bw_performance.py | yangpanMS/superbenchmark | 4d85630abba0fe45b8cd3a51e79c15e6ac87a1e6 | [
"MIT"
] | 24 | 2021-04-09T12:42:27.000Z | 2022-03-16T08:26:34.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""Module of the Cuda memory performance benchmarks."""
import os
import re
from superbench.common.utils import logger
from superbench.benchmarks import BenchmarkRegistry, Platform
from superbench.benchmarks.micro_benchmarks import MemBwBenchma... | 33.242718 | 106 | 0.591414 |
import os
import re
from superbench.common.utils import logger
from superbench.benchmarks import BenchmarkRegistry, Platform
from superbench.benchmarks.micro_benchmarks import MemBwBenchmark
class CudaMemBwBenchmark(MemBwBenchmark):
def __init__(self, name, parameters=''):
super().__init__(name, parame... | true | true |
f717365a8e51a89fa39fe965f60ce80a0e94df41 | 2,243 | py | Python | apps/project/views.py | fsantand/bugtracker | c3d3ec4f6962dcedb2d569177bf5e53c48165da0 | [
"MIT"
] | null | null | null | apps/project/views.py | fsantand/bugtracker | c3d3ec4f6962dcedb2d569177bf5e53c48165da0 | [
"MIT"
] | 3 | 2021-03-30T13:43:20.000Z | 2021-06-10T19:39:51.000Z | apps/project/views.py | fsantand/bugtracker | c3d3ec4f6962dcedb2d569177bf5e53c48165da0 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views.generic import DetailView, CreateView, TemplateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Project
from apps.bug.models import Bug, Comment
# Create your views here.
class ProjectDetail(DetailView):
model = Proj... | 31.591549 | 107 | 0.633081 | from django.shortcuts import render, redirect
from django.views.generic import DetailView, CreateView, TemplateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Project
from apps.bug.models import Bug, Comment
class ProjectDetail(DetailView):
model = Project
class ProjectCreate(L... | true | true |
f717376b324600cdb7a435b02cd031e066e6ac60 | 13,985 | py | Python | src/openprocurement/framework/core/utils.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/framework/core/utils.py | quintagroup/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/framework/core/utils.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | from functools import partial, wraps
from logging import getLogger
from time import sleep
from cornice.resource import resource
from couchdb import ResourceConflict
from dateorro import calc_datetime
from jsonpointer import resolve_pointer
from pyramid.compat import decode_path_info
from pyramid.exceptions import URLD... | 35.050125 | 113 | 0.687093 | from functools import partial, wraps
from logging import getLogger
from time import sleep
from cornice.resource import resource
from couchdb import ResourceConflict
from dateorro import calc_datetime
from jsonpointer import resolve_pointer
from pyramid.compat import decode_path_info
from pyramid.exceptions import URLD... | true | true |
f71738e4c80d2271b070b3350e92aeee9a9e5ae3 | 3,954 | py | Python | stcloud/models/update_plan_response_dto.py | sematext/sematext-api-client-python | 16e025cd3d32aa58deb70fc5930ae4165afebe97 | [
"Apache-2.0"
] | 1 | 2020-05-01T12:15:52.000Z | 2020-05-01T12:15:52.000Z | stcloud/models/update_plan_response_dto.py | sematext/sematext-api-client-python | 16e025cd3d32aa58deb70fc5930ae4165afebe97 | [
"Apache-2.0"
] | null | null | null | stcloud/models/update_plan_response_dto.py | sematext/sematext-api-client-python | 16e025cd3d32aa58deb70fc5930ae4165afebe97 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Sematext Cloud API
API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. # noqa: E501
OpenAPI spec version: v3
... | 28.861314 | 236 | 0.574608 |
import pprint
import re
import six
class UpdatePlanResponseDto(object):
swagger_types = {
'events': 'list[EventDto]',
'plan_id': 'int'
}
attribute_map = {
'events': 'events',
'plan_id': 'planId'
}
def __init__(self, events=None, plan_id=None): self._ev... | true | true |
f7173966ea1c7e65d2e1a2dd36186f075d2562fc | 5,614 | py | Python | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # database.py creates a .db file for performing umls searches.
import atexit
import os
import sqlite3
import sys
from read_config import enabled_modules
features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if features_dir not in sys.path:
sys.path.append(features_dir)
# find where umls tabl... | 27.385366 | 79 | 0.612576 | import atexit
import os
import sqlite3
import sys
from read_config import enabled_modules
features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if features_dir not in sys.path:
sys.path.append(features_dir)
enabled = enabled_modules()
umls_tables = enabled['UMLS']
success = False
db_path =... | true | true |
f7173a7583eedd9e7c316806a5cfde0de9f793f5 | 1,516 | py | Python | rohans2dtlkit/simonsays.py | rohan-patra/2DGameDevToolkit | 337b86066b306e6654cd520dd9cf60b224dc7c0d | [
"MIT"
] | 1 | 2020-03-25T02:39:11.000Z | 2020-03-25T02:39:11.000Z | rohans2dtlkit/simonsays.py | rohan-patra/2DGameDevToolkit | 337b86066b306e6654cd520dd9cf60b224dc7c0d | [
"MIT"
] | null | null | null | rohans2dtlkit/simonsays.py | rohan-patra/2DGameDevToolkit | 337b86066b306e6654cd520dd9cf60b224dc7c0d | [
"MIT"
] | null | null | null | """Simon Says
Exercises
1. Speed up tile flash rate.
2. Add more tiles.
"""
from random import choice
from time import sleep
from turtle import *
from rohans2dtlkit import floor, square, vector
pattern = []
guesses = []
tiles = {
vector(0, 0): ('red', 'dark red'),
vector(0, -200): ('blue', 'dark blue'),
... | 18.26506 | 47 | 0.58905 |
from random import choice
from time import sleep
from turtle import *
from rohans2dtlkit import floor, square, vector
pattern = []
guesses = []
tiles = {
vector(0, 0): ('red', 'dark red'),
vector(0, -200): ('blue', 'dark blue'),
vector(-200, 0): ('green', 'dark green'),
vector(-200, -200): ('yellow', ... | true | true |
f7173b7401256a6e7120034785ae4d0cbd732b2d | 3,478 | py | Python | Game/finger.py | Ravnit202/PYJAC | 65987f8afd2e54e1b308b09f45f291e374e79bd2 | [
"MIT"
] | 1 | 2022-02-27T21:39:46.000Z | 2022-02-27T21:39:46.000Z | Game/finger.py | Ravnit202/PYJAC | 65987f8afd2e54e1b308b09f45f291e374e79bd2 | [
"MIT"
] | null | null | null | Game/finger.py | Ravnit202/PYJAC | 65987f8afd2e54e1b308b09f45f291e374e79bd2 | [
"MIT"
] | 1 | 2022-01-23T17:56:16.000Z | 2022-01-23T17:56:16.000Z | import cv2
import mediapipe
import numpy
import pydirectinput
class FingerDetector:
wScr, hScr = pydirectinput.size() #Get the current screen resolution
pX, pY = 0, 0
cX, cY = 0, 0
def __init__(self):
"""
Initialize all objects
"""
#Load the mediapipe libraries/solut... | 37.397849 | 138 | 0.572168 | import cv2
import mediapipe
import numpy
import pydirectinput
class FingerDetector:
wScr, hScr = pydirectinput.size() pX, pY = 0, 0
cX, cY = 0, 0
def __init__(self):
self.initHand = mediapipe.solutions.hands
self.mainHand = self.initHand.Hands(min_detection_confidence=0.7, m... | true | true |
f7173b8750ccd8758d98ec5020d4c31e69bddff1 | 3,395 | py | Python | myproject/settings.py | sabariask/final-cloud-app-with-database | b95769cf8dfe77d597dff30666b82bd5478cdc1a | [
"Apache-2.0"
] | null | null | null | myproject/settings.py | sabariask/final-cloud-app-with-database | b95769cf8dfe77d597dff30666b82bd5478cdc1a | [
"Apache-2.0"
] | null | null | null | myproject/settings.py | sabariask/final-cloud-app-with-database | b95769cf8dfe77d597dff30666b82bd5478cdc1a | [
"Apache-2.0"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 26.523438 | 91 | 0.699558 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'aay0j_9b&ky3a7(8m8il+-1ud(scw12@w5!+5-=gsk6ynzi0ls'
DEBUG = True
# <HINT> add your cloud host here
ALLOWED_HOSTS = ['onlinecourseapp.eu-gb.cf.appdomain.cloud']
# Application definition
INSTALLED_APPS = [
'online... | true | true |
f7173c865c6e1cbc6ede078b6fa126c1cac8a519 | 1,332 | py | Python | test/selenium/src/lib/meta.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | test/selenium/src/lib/meta.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | test/selenium/src/lib/meta.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""Metaclasses module"""
from lib import decorator, exception, constants
c... | 32.487805 | 78 | 0.707958 |
from lib import decorator, exception, constants
class DecoratePublicMethods(type):
def __new__(mcs, name, bases, dct):
for attr_name, value in dct.items():
if all(
[method_name in attr_name for method_name in [
constants.test_runner.TEST_METHOD_PREFIX,
constants... | true | true |
f7173cd9ebdb7121ecd49307a8e79a80894f89a2 | 47 | py | Python | components/__init__.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 6 | 2021-06-15T10:37:34.000Z | 2022-01-26T14:41:44.000Z | components/__init__.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 3 | 2021-08-25T15:17:22.000Z | 2021-11-12T13:52:14.000Z | components/__init__.py | nuric/pix2rule | 0f0f654e488a1839455786ccc4ad023c0aa0c2e8 | [
"MIT"
] | 1 | 2021-11-08T17:36:52.000Z | 2021-11-08T17:36:52.000Z | """Reusable components used in the project."""
| 23.5 | 46 | 0.723404 | true | true | |
f7173ce767b2f0ec4ef68dd6e5eb6e37168beeea | 3,958 | py | Python | python/oneflow/test/modules/test_ne.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_ne.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_ne.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.82906 | 77 | 0.689237 |
import unittest
from collections import OrderedDict
import numpy as np
from test_util import GenArgList
import oneflow as flow
import oneflow.unittest
from oneflow.test_utils.automated_test_util import *
def _test_ne(test_case, shape, device):
arr1 = np.random.randn(*shape)
arr2 = np.random.randn(*shape)
... | true | true |
f7173cf25e08228c30ad2d6b241f0a7a9258b6b2 | 2,213 | py | Python | game/sdl/nacl/generate_nmf.py | spiffcode/hostile-takeover | 363c8f7f02c25f90255b28a5e2eaea784b2a502f | [
"BSD-2-Clause-FreeBSD"
] | 113 | 2015-01-07T00:37:37.000Z | 2022-03-08T17:58:24.000Z | game/sdl/nacl/generate_nmf.py | ptitSeb/hostile-takeover | db70254a966ca3223178e669594f3b704b5471a2 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-04-13T16:16:00.000Z | 2021-06-08T04:49:09.000Z | game/sdl/nacl/generate_nmf.py | spiffcode/hostile-takeover | 363c8f7f02c25f90255b28a5e2eaea784b2a502f | [
"BSD-2-Clause-FreeBSD"
] | 49 | 2015-01-08T04:27:35.000Z | 2022-03-08T04:55:08.000Z | #!/usr/bin/python
#
# Copyright (c) 2011, The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import optparse
# This script generates a JSON .nmf file, which provides the mapping to indicate
# which .nexe fil... | 36.278689 | 80 | 0.690917 |
import sys
import optparse
def main(argv):
parser = optparse.OptionParser()
parser.add_option('--nmf', dest='nmf_file', help='nmf file to generate')
parser.add_option('--x86-64', dest='x86_64', help='x86_64 nexe')
parser.add_option('--x86-32', dest='x86_32', help='x86_32 nexe')
parser.add_option('--arm', d... | true | true |
f7173e027264e39bd5de097156f1fe290ba68ed4 | 11,074 | py | Python | utils/utils.py | Ray0089/PSGMN | 0363d558add24034e035d26121e2e1b61d97c198 | [
"Apache-2.0"
] | 18 | 2021-02-05T05:30:15.000Z | 2022-03-13T03:40:25.000Z | utils/utils.py | Ray0089/PSGMN | 0363d558add24034e035d26121e2e1b61d97c198 | [
"Apache-2.0"
] | 2 | 2021-04-17T02:20:42.000Z | 2021-09-11T07:05:13.000Z | utils/utils.py | Ray0089/PSGMN | 0363d558add24034e035d26121e2e1b61d97c198 | [
"Apache-2.0"
] | 5 | 2021-04-19T00:21:20.000Z | 2022-01-17T07:30:27.000Z | # import PIL
import matplotlib.pyplot as plt
import numpy as np
import math
import cv2
import torch
from torch_geometric.data import Data
def load_ply(path):
"""
Loads a 3D mesh model from a PLY file.
:param path: Path to a PLY file.
:return: The loaded model given by a dictionary with items:
'pt... | 30.506887 | 86 | 0.536753 | import matplotlib.pyplot as plt
import numpy as np
import math
import cv2
import torch
from torch_geometric.data import Data
def load_ply(path):
f = open(path, 'r')
n_pts = 0
n_faces = 0
face_n_corners = 3 pt_props = []
face_props = []
is_binary = False
header_vertex_section = False
... | true | true |
f7173e64baaaa455cc2055a042fb58a2903aa785 | 2,500 | py | Python | cic/drivers/singleton.py | Chia-Network/internal-custody | 672cf33bb63cad960f5576f84a6606ce471e05cb | [
"Apache-2.0"
] | null | null | null | cic/drivers/singleton.py | Chia-Network/internal-custody | 672cf33bb63cad960f5576f84a6606ce471e05cb | [
"Apache-2.0"
] | null | null | null | cic/drivers/singleton.py | Chia-Network/internal-custody | 672cf33bb63cad960f5576f84a6606ce471e05cb | [
"Apache-2.0"
] | 1 | 2022-02-22T22:35:24.000Z | 2022-02-22T22:35:24.000Z | from typing import List, Tuple
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_spend import CoinSpend
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.has... | 30.487805 | 103 | 0.7288 | from typing import List, Tuple
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_spend import CoinSpend
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.has... | true | true |
f7173f406336288e5f91314047a20cea6d7099ba | 29,908 | py | Python | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 2,772 | 2020-05-04T21:03:40.000Z | 2022-03-30T11:00:03.000Z | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 486 | 2020-05-05T00:45:44.000Z | 2022-03-15T01:02:31.000Z | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 232 | 2019-11-02T22:06:38.000Z | 2022-03-25T07:36:17.000Z | import unittest
import numpy as np
from sklearn import datasets
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris, load_diabetes
from sklearn.svm import LinearSVC, LinearSVR
from sklearn.datasets import make_regression
from sklearn.decomposition import PCA
from sklearn.linear_model i... | 40.307278 | 127 | 0.630032 | import unittest
import numpy as np
from sklearn import datasets
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris, load_diabetes
from sklearn.svm import LinearSVC, LinearSVR
from sklearn.datasets import make_regression
from sklearn.decomposition import PCA
from sklearn.linear_model i... | true | true |
f7173f7ed9d0c8bc4d136449f83ae47f59a3b4aa | 161 | py | Python | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
row = int(input("Enter the number of rows: "))
n = row
while n >= 0:
x = "*" * n
y = " " * (row - n)
print(y + x)
n -= 1
| 17.888889 | 46 | 0.459627 | row = int(input("Enter the number of rows: "))
n = row
while n >= 0:
x = "*" * n
y = " " * (row - n)
print(y + x)
n -= 1
| true | true |
f7173fb688f43ba2ac42d7b1dfdd0e7fc7e3dcf5 | 3,784 | py | Python | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 1 | 2019-12-22T23:37:28.000Z | 2019-12-22T23:37:28.000Z | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 10 | 2020-06-05T21:41:01.000Z | 2022-02-10T07:33:38.000Z | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 3 | 2020-08-07T16:16:54.000Z | 2020-10-12T18:06:35.000Z | # -*- coding: utf-8 -*-
import unicodedata
import binascii
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(... | 34.4 | 123 | 0.624736 | import unicodedata
import binascii
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(object):
message = _... | true | true |
f71740b8d42b1368ce90e20d97da178845afeb85 | 2,344 | py | Python | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 6 | 2020-07-15T21:00:49.000Z | 2021-05-12T07:16:38.000Z | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 2 | 2020-08-14T16:16:21.000Z | 2020-11-12T07:43:22.000Z | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 2 | 2020-08-16T15:53:14.000Z | 2021-05-12T07:16:41.000Z | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class rgbd_t(object):
__slots__ = ["utime", "width", "height", "rgblen", "depthlen", "rgb", "depth"]
__typ... | 32.555556 | 111 | 0.638652 |
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class rgbd_t(object):
__slots__ = ["utime", "width", "height", "rgblen", "depthlen", "rgb", "depth"]
__typenames__ = ["int64_t", "int32_t", "int32_t", "int32_t", "int32_t", "byte", "byte"]
__dimens... | true | true |
f717410eba8874ad5c80c1bd9eb7064162476ab8 | 967 | py | Python | Trakttv.bundle/Contents/Tests/plex_mock/models.py | disrupted/Trakttv.bundle | 24712216c71f3b22fd58cb5dd89dad5bb798ed60 | [
"RSA-MD"
] | 1,346 | 2015-01-01T14:52:24.000Z | 2022-03-28T12:50:48.000Z | Trakttv.bundle/Contents/Tests/plex_mock/models.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 474 | 2015-01-01T10:27:46.000Z | 2022-03-21T12:26:16.000Z | Trakttv.bundle/Contents/Tests/plex_mock/models.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 191 | 2015-01-02T18:27:22.000Z | 2022-03-29T10:49:48.000Z | class LibraryMetadata(object):
def __init__(self, section=None):
self.section = section
class LibrarySection(object):
def __init__(self, title=None):
self.title = title
class Session(object):
def __init__(self, **kwargs):
self.rating_key = None
self.state = None
... | 21.977273 | 68 | 0.553257 | class LibraryMetadata(object):
def __init__(self, section=None):
self.section = section
class LibrarySection(object):
def __init__(self, title=None):
self.title = title
class Session(object):
def __init__(self, **kwargs):
self.rating_key = None
self.state = None
... | true | true |
f717418e6536d845980ad96232de54991a5746ec | 12,804 | py | Python | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | 1 | 2019-01-21T07:35:14.000Z | 2019-01-21T07:35:14.000Z | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | null | null | null | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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 or agreed to in writing, ... | 33.873016 | 80 | 0.637848 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import curses
import curses.ascii
import app.config
import app.curses_util
import app.log
class Controller:
def __init__(self, view, name):
if app.config.strict_debug:
assert issub... | true | true |
f717419b82396fef65c67279f9002be3e2b4df00 | 4,704 | py | Python | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 8 | 2015-02-25T20:13:54.000Z | 2019-09-12T06:12:07.000Z | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 67 | 2015-01-12T09:58:36.000Z | 2021-05-12T14:23:26.000Z | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 15 | 2015-04-28T13:18:28.000Z | 2021-01-19T16:16:33.000Z | # Copyright 2016 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
from __future__ import absolute_import, division, print_function
import random
import signal
import time
import tornado
from katcp import AsyncReply, DeviceServer, ProtocolFlags, Sensor
... | 32 | 89 | 0.639881 |
from __future__ import absolute_import, division, print_function
import random
import signal
import time
import tornado
from katcp import AsyncReply, DeviceServer, ProtocolFlags, Sensor
from katcp.kattypes import (Discrete, Float, Str, Timestamp, request,
return_reply)
server_host = ""
... | true | true |
f71741bac27bc1f5ba082d55bf8dd41a6deacf3b | 2,588 | py | Python | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | null | null | null | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | null | null | null | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | 1 | 2021-08-18T15:21:23.000Z | 2021-08-18T15:21:23.000Z | """
Codificar un algoritmo en Python que permita registrar la clave (Por el momento,
no esn ecesario validar si la clave es unica), el nombre y correo electrónico
de múltiples personas, hasta que el usuario indique que ha concluído con la captura
correspondiente (proponga usted el mecanismo para esto).
Una vez con... | 47.925926 | 111 | 0.651468 |
SEPARADOR = ("*" * 20)
from collections import namedtuple
Personas = namedtuple("Personas",["clave","nombre","correoElectronico"]) ListaPersonas=[]
while True: print("\n-- Bienvenido(a) al Menu")
print("1) Agregar una persona")
print("2) Búsqueda específica")
print("3) Ver listado completo")... | true | true |
f717423cc3d548d9864cbc9e2e9fcc26f024bacd | 1,833 | py | Python | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 6 | 2022-03-09T23:10:28.000Z | 2022-03-21T05:32:40.000Z | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 5 | 2022-03-11T09:39:47.000Z | 2022-03-30T16:48:09.000Z | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 4 | 2022-03-04T15:36:19.000Z | 2022-03-28T23:45:44.000Z | #!../../../env/bin/python
"""
Script to scan through archive of mbox files and produce a spam report.
"""
# Standalone broilerplate -------------------------------------------------------------
from django_setup import do_setup
do_setup()
# -------------------------------------------------------------------------------... | 27.772727 | 87 | 0.585379 | from django_setup import do_setup
do_setup()
import argparse
import email
import logging
import os
import shutil
import subprocess
import sys
from django.conf import settings
from mlarchive.bin.scan_utils import get_messages
progname = sys.argv[0]
from django.utils.log import getLogger
import logging.config
logging... | true | true |
f717427fe7f805450f84f4ef7ba5df39674ef6cb | 348 | py | Python | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | from datadog import initialize, api
# Intialize request parameters including API/APP key
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
# Set Embed ID (token)
embed_id = "5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c"
# Call Embed API function... | 21.75 | 77 | 0.761494 | from datadog import initialize, api
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
embed_id = "5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c"
api.Embed.enable(embed_id)
| true | true |
f71742b2238dd40bc0984373a331e975450b3324 | 2,827 | py | Python | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | null | null | null | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | null | null | null | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | 1 | 2020-01-06T16:18:22.000Z | 2020-01-06T16:18:22.000Z | # -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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 ... | 41.573529 | 114 | 0.710294 |
import logging
import json
from aminator.config import Config
from aminator.plugins.provisioner.apt_chef import AptChefProvisionerPlugin
log = logging.getLogger(__name__)
console = logging.StreamHandler()
logging.getLogger('').addHandler(console)
class TestAptChefProvisionerPlugin(object):
def setup_method(... | true | true |
f71742c671520b22e56777c333e9e3fd20648561 | 2,331 | py | Python | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 32 | 2019-09-05T05:16:56.000Z | 2022-03-22T09:50:38.000Z | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 35 | 2019-09-07T18:58:54.000Z | 2022-03-24T19:29:36.000Z | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 18 | 2019-09-09T11:07:21.000Z | 2022-03-25T08:49:59.000Z | # -*- coding: utf-8 -*-
"""Cisco DNA Center Get Site Count data model.
Copyright (c) 2019-2021 Cisco Systems.
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 withou... | 32.830986 | 78 | 0.639211 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from dnacentersdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidatorD9BdB9034Df99Dba(object):
def __init__(self):
super(JSONSchemaV... | true | true |
f71744883794a583ccf9436508cd8c98a384800a | 1,579 | py | Python | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | 3 | 2020-09-24T16:19:28.000Z | 2022-02-09T21:10:11.000Z | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | null | null | null | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created by magus0219[magus0219@gmail.com] on 2020/3/30
import datetime
from artascope.src.lib.user_status_manager import usm
class TestUserStatusManager:
def test_add_user(self):
usm.add_user(username="username")
us = usm.get_user(username="usern... | 28.709091 | 67 | 0.636479 | import datetime
from artascope.src.lib.user_status_manager import usm
class TestUserStatusManager:
def test_add_user(self):
usm.add_user(username="username")
us = usm.get_user(username="username")
assert (
us.username == "username"
and type(us.created_ts) == int
... | true | true |
f7174560bad50e0fdbb28b5776553cba721ab30f | 2,919 | py | Python | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
TGS API
A production scale tool for BYOND server management # noqa: E501
OpenAPI spec version: 9.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.models.administration_rights impor... | 32.076923 | 95 | 0.59815 |
import pprint
import re
import six
from swagger_client.models.administration_rights import AdministrationRights
class AllOfPermissionSetAdministrationRights(AdministrationRights):
swagger_types = {
}
if hasattr(AdministrationRights, "swagger_types"):
swagger_types.update(AdministrationRights.s... | true | true |
f71747aaed07f08c55da22df67f2dc5bc6ae9a92 | 742 | py | Python | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | null | null | null | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | null | null | null | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | 1 | 2019-02-07T19:56:33.000Z | 2019-02-07T19:56:33.000Z | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
def show_image(image):
plt.imshow(-image, cmap='Greys')
plt.show()
def show_two(image1, image2):
plt.subplot(121)
plt.imshow(-image1, cmap='Greys')
plt.subplot(122)
plt.imshow(-image2, cmap='Greys')
plt.show()
def plot_hist(img)... | 18.55 | 62 | 0.610512 | import matplotlib.pyplot as plt
def show_image(image):
plt.imshow(-image, cmap='Greys')
plt.show()
def show_two(image1, image2):
plt.subplot(121)
plt.imshow(-image1, cmap='Greys')
plt.subplot(122)
plt.imshow(-image2, cmap='Greys')
plt.show()
def plot_hist(img):
plt.hist(img.ravel... | true | true |
f7174853e5691cb8f3c8388d4ff3c6a48d541046 | 21,576 | py | Python | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | 4 | 2017-11-28T08:12:58.000Z | 2020-10-28T04:15:52.000Z | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
"""
base.py
common base for the commands execution framework. Units of work are defined as Operations
as found in other modules like unix.py. These units of work are then packaged up and executed
within a GpCommand. A GpCommand is j... | 33.451163 | 116 | 0.612023 |
from queue import Queue, Empty
from threading import Thread
import os
import signal
import subprocess
import sys
import time
from gppylib import gplog
from gppylib import gpsubprocess
from pg import DB
logger = gplog.get_default_logger()
GPHOME = os.environ.get('GPHOME')
SSH_MAX_RETRY = 10
SSH_RETRY_DELAY = .5
... | true | true |
f71748e77f76da11ab56b956f1c6463063b71ea1 | 1,609 | py | Python | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 1 | 2020-06-10T10:34:05.000Z | 2020-06-10T10:34:05.000Z | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 6 | 2018-01-26T10:04:02.000Z | 2020-09-07T17:09:07.000Z | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 5 | 2018-03-24T09:35:38.000Z | 2020-11-02T03:42:09.000Z | from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultIte... | 34.234043 | 85 | 0.712244 | from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultIte... | true | true |
f7174a07455b8d2615386130e8a5a7f7b941d1ab | 1,222 | py | Python | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | 15 | 2021-02-11T16:29:28.000Z | 2021-09-11T14:17:19.000Z | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | 2 | 2021-02-26T17:38:32.000Z | 2021-05-19T17:58:34.000Z | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
VERSION = 0.4
with open("README.md") as f:
README = f.read()
setup(
name = "pyscreenrec",
version = VERSION,
description = "A small and cross-platform python library for recording screen.",
long_description_content_type = "text/markdown",
long_descri... | 37.030303 | 84 | 0.626023 | from setuptools import find_packages, setup
VERSION = 0.4
with open("README.md") as f:
README = f.read()
setup(
name = "pyscreenrec",
version = VERSION,
description = "A small and cross-platform python library for recording screen.",
long_description_content_type = "text/markdown",
long_descri... | true | true |
f7174a5077e5e6d8533019e51bf2c5b67b88f10b | 984 | py | Python | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 58 | 2015-01-13T16:24:31.000Z | 2016-11-21T16:00:58.000Z | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 51 | 2015-03-11T20:42:21.000Z | 2017-01-18T02:49:10.000Z | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 15 | 2016-02-01T00:37:21.000Z | 2016-12-09T07:03:36.000Z | # Android Device Testing Framework ("dtf")
# Copyright 2013-2016 Jake Valletta (@jake_valletta)
#
# 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
... | 29.818182 | 74 | 0.748984 |
from __future__ import absolute_import
import dtf.testutils as testutils
def test_no_args():
testutils.deploy_config(testutils.get_default_config())
rtn = testutils.dtf("prop dump")
testutils.undeploy()
assert(rtn.return_code == 0)
| true | true |
f7174c3b69586ad7a0dd822a81cded6f137b0e87 | 1,204 | py | Python | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 15,577 | 2019-09-23T11:57:53.000Z | 2022-03-31T18:21:48.000Z | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 16,476 | 2019-09-23T11:47:00.000Z | 2022-03-31T23:06:01.000Z | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3,633 | 2019-09-23T12:18:28.000Z | 2022-03-31T15:55:48.000Z | # pylint: disable=unused-argument
# pylint: disable=redefined-outer-name
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
main_configs=["configs/config.d/storage_configuration.xml"],
... | 32.540541 | 99 | 0.69186 |
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
main_configs=["configs/config.d/storage_configuration.xml"],
tmpfs=['/disk1:size=100M', '/disk2:size=100M'])
@pytest.fixture... | true | true |
f7174ca5b3715337bd66e103f422e337ca016408 | 492 | py | Python | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-05 20:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0005_auto_20201005_2107'),
]
operations = [
migrations.AlterField(
model_name='contact',
name=... | 25.894737 | 140 | 0.571138 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0005_auto_20201005_2107'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='meeting',
field=models.CharField(bl... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.