hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72a41c562cc666e7693a5618222e1ff98c66a18 | 1,240 | py | Python | Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Generator/python/QCD_Pt_3000_3500_14TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaHepMCVerbosity = cms.untracked.bool(False),
... | 45.925926 | 89 | 0.549194 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaHepMCVerbosity = cms.untracked.bool(False),
... | true | true |
f72a42c2e1e5a77f302472332be6e9a10fe5c67c | 15,891 | py | Python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/custom_image_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | null | null | null | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/custom_image_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | null | null | null | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/operations/custom_image_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.388268 | 149 | 0.646655 |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class CustomImageOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._clie... | true | true |
f72a42f0de9fa77c288318b1b5d013ccfb8f3bf4 | 771 | py | Python | setup.py | littleq0903/django-gcloud-storage | 52e4a4a6773a5e79cf3fec19dcc1290e65942a70 | [
"MIT"
] | 3 | 2015-01-08T09:13:12.000Z | 2020-11-27T16:23:09.000Z | setup.py | littleq0903/django-gcloud-storage | 52e4a4a6773a5e79cf3fec19dcc1290e65942a70 | [
"MIT"
] | 1 | 2015-02-25T05:03:02.000Z | 2019-02-08T07:00:35.000Z | setup.py | littleq0903/django-gcloud-storage | 52e4a4a6773a5e79cf3fec19dcc1290e65942a70 | [
"MIT"
] | 1 | 2015-02-25T03:55:54.000Z | 2015-02-25T03:55:54.000Z | from setuptools import setup, find_packages
import django_gcs
setup_options = {
'name': 'django-gcloud-storage',
'version': django_gcs.__version__,
'packages': find_packages(),
'author': 'Colin Su',
'author_email': 'littleq0903@gmail.com',
'license': 'MIT',
'de... | 28.555556 | 70 | 0.574578 | from setuptools import setup, find_packages
import django_gcs
setup_options = {
'name': 'django-gcloud-storage',
'version': django_gcs.__version__,
'packages': find_packages(),
'author': 'Colin Su',
'author_email': 'littleq0903@gmail.com',
'license': 'MIT',
'de... | true | true |
f72a43f375f75914487974a4a07a4ec77f462c62 | 1,509 | py | Python | src/word_processing.py | bsbhaskar/product_review_sentiments | 46de372f4d410f44e487c92b9279cf13c33d4cd1 | [
"MIT"
] | 2 | 2018-06-07T21:55:33.000Z | 2018-09-15T08:33:53.000Z | src/word_processing.py | bsbhaskar/product_review_sentiments | 46de372f4d410f44e487c92b9279cf13c33d4cd1 | [
"MIT"
] | null | null | null | src/word_processing.py | bsbhaskar/product_review_sentiments | 46de372f4d410f44e487c92b9279cf13c33d4cd1 | [
"MIT"
] | null | null | null | import string
import spacy
import pickle
from nltk.stem.wordnet import WordNetLemmatizer
from gensim.models import Phrases, Word2Vec
from nltk.corpus import stopwords
import warnings
warnings.filterwarnings("ignore")
class WordProcessor():
'''
This is a utility class that loads data related to processing words... | 41.916667 | 361 | 0.640822 | import string
import spacy
import pickle
from nltk.stem.wordnet import WordNetLemmatizer
from gensim.models import Phrases, Word2Vec
from nltk.corpus import stopwords
import warnings
warnings.filterwarnings("ignore")
class WordProcessor():
def __init__(self):
self.nlp = spacy.load("en")
self.stop... | true | true |
f72a44144e09def7c3fe812e31e7c8bfecf516d8 | 1,536 | py | Python | auth0login/auth0backend.py | chop-dbhi/biorepo-portal | 7db13c40b2b9d62af43a28e4af08c2472b98fc96 | [
"BSD-2-Clause"
] | 6 | 2016-10-26T19:51:11.000Z | 2021-03-18T16:05:55.000Z | auth0login/auth0backend.py | chop-dbhi/biorepo-portal | 7db13c40b2b9d62af43a28e4af08c2472b98fc96 | [
"BSD-2-Clause"
] | 207 | 2015-09-24T17:41:37.000Z | 2021-05-18T18:14:08.000Z | auth0login/auth0backend.py | chop-dbhi/biorepo-portal | 7db13c40b2b9d62af43a28e4af08c2472b98fc96 | [
"BSD-2-Clause"
] | 8 | 2016-04-27T19:04:50.000Z | 2020-08-24T02:33:05.000Z | # auth0login/auth0backend.py
from urllib import request
from jose import jwt
from social_core.backends.oauth import BaseOAuth2
from accounts.models import UserProfile
class Auth0(BaseOAuth2):
"""Auth0 OAuth authentication backend"""
name = 'auth0'
SCOPE_SEPARATOR = ' '
ACCESS_TOKEN_METHOD = 'POST'
... | 34.133333 | 107 | 0.609375 |
from urllib import request
from jose import jwt
from social_core.backends.oauth import BaseOAuth2
from accounts.models import UserProfile
class Auth0(BaseOAuth2):
name = 'auth0'
SCOPE_SEPARATOR = ' '
ACCESS_TOKEN_METHOD = 'POST'
REDIRECT_STATE = False
EXTRA_DATA = [
('picture', 'picture'... | true | true |
f72a4476249a5b91384f4535c7234e7f722e0b67 | 19,874 | py | Python | tests/test_cognitoidp/test_cognitoidp.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | null | null | null | tests/test_cognitoidp/test_cognitoidp.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 5 | 2018-04-25T21:04:20.000Z | 2018-11-02T19:59:27.000Z | tests/test_cognitoidp/test_cognitoidp.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import boto3
import json
import os
import uuid
from jose import jws
from moto import mock_cognitoidp
import sure # noqa
@mock_cognitoidp
def test_create_user_pool():
conn = boto3.client("cognito-idp", "us-west-2")
name = str(uuid.uuid4())
value = str(uuid.uuid4... | 33.013289 | 93 | 0.690601 | from __future__ import unicode_literals
import boto3
import json
import os
import uuid
from jose import jws
from moto import mock_cognitoidp
import sure
@mock_cognitoidp
def test_create_user_pool():
conn = boto3.client("cognito-idp", "us-west-2")
name = str(uuid.uuid4())
value = str(uuid.uuid4())
... | true | true |
f72a47612f3599e9c27c19fedb85a488b08046a6 | 1,760 | py | Python | tests/test_buildsets.py | MichalMilewicz/tungsten-ci-dashboard | 67ca8e39855009ab7b4d603b691ea910ee6efbbc | [
"Apache-2.0"
] | null | null | null | tests/test_buildsets.py | MichalMilewicz/tungsten-ci-dashboard | 67ca8e39855009ab7b4d603b691ea910ee6efbbc | [
"Apache-2.0"
] | null | null | null | tests/test_buildsets.py | MichalMilewicz/tungsten-ci-dashboard | 67ca8e39855009ab7b4d603b691ea910ee6efbbc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from unittest.mock import MagicMock, patch
from dashboard.exceptions import PageOutOfRange
from dashboard.history import BuildSetsPaginated
class TestBuildSets(unittest.TestCase):
@patch('dashboard.model.ZuulBuildSet.get_for_pipeline')
def test_create_buildsets_history... | 34.509804 | 76 | 0.715909 | import unittest
from unittest.mock import MagicMock, patch
from dashboard.exceptions import PageOutOfRange
from dashboard.history import BuildSetsPaginated
class TestBuildSets(unittest.TestCase):
@patch('dashboard.model.ZuulBuildSet.get_for_pipeline')
def test_create_buildsets_history_object(self, get_for_pi... | true | true |
f72a484fe9c2c76a51236db7ad5259bebcb0d8f6 | 4,602 | py | Python | dataservice/api/outcome/resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 6 | 2018-01-25T13:49:24.000Z | 2020-03-07T16:25:09.000Z | dataservice/api/outcome/resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 369 | 2018-01-17T15:22:18.000Z | 2022-03-10T19:14:56.000Z | dataservice/api/outcome/resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 3 | 2018-04-11T14:18:37.000Z | 2018-10-31T19:09:48.000Z | from flask import abort, request
from marshmallow import ValidationError
from webargs.flaskparser import use_args
from dataservice.extensions import db
from dataservice.api.common.pagination import paginated, Pagination
from dataservice.api.outcome.models import Outcome
from dataservice.api.outcome.schemas import Outc... | 27.556886 | 73 | 0.548457 | from flask import abort, request
from marshmallow import ValidationError
from webargs.flaskparser import use_args
from dataservice.extensions import db
from dataservice.api.common.pagination import paginated, Pagination
from dataservice.api.outcome.models import Outcome
from dataservice.api.outcome.schemas import Outc... | true | true |
f72a48ddc595ceca85ebaf70bdc5761b2632240d | 630 | py | Python | level.py | FernandoCamousseigt/testapp | d7466584f5eb5c96463178c21ede571d6ea33510 | [
"MIT"
] | null | null | null | level.py | FernandoCamousseigt/testapp | d7466584f5eb5c96463178c21ede571d6ea33510 | [
"MIT"
] | null | null | null | level.py | FernandoCamousseigt/testapp | d7466584f5eb5c96463178c21ede571d6ea33510 | [
"MIT"
] | null | null | null | def choose_level(n_pregunta, p_level):
# Construir lógica para escoger el nivel
##################################################
#pass
if n_pregunta <= int(p_level):
level = "basicas"
elif n_pregunta <= 2 * p_level:
level = "intermedias"
else:
level = "avanzadas"
... | 27.391304 | 54 | 0.509524 | def choose_level(n_pregunta, p_level):
if n_pregunta <= int(p_level):
level = "basicas"
elif n_pregunta <= 2 * p_level:
level = "intermedias"
else:
level = "avanzadas"
return level
if __name__ == '__main__':
print(choose_level(2, 2)) ... | true | true |
f72a4969cc9a1aedd1ca60e296ba23ac682ec15b | 3,433 | py | Python | verde/tests/test_scipy.py | djhoese/verde | ad14acf94717ee5c6672559f40576f65989753a5 | [
"BSD-3-Clause"
] | null | null | null | verde/tests/test_scipy.py | djhoese/verde | ad14acf94717ee5c6672559f40576f65989753a5 | [
"BSD-3-Clause"
] | null | null | null | verde/tests/test_scipy.py | djhoese/verde | ad14acf94717ee5c6672559f40576f65989753a5 | [
"BSD-3-Clause"
] | null | null | null | """
Test the scipy based interpolator.
"""
import warnings
import pytest
import pandas as pd
import numpy as np
import numpy.testing as npt
from ..scipygridder import ScipyGridder
from ..coordinates import grid_coordinates
from ..datasets.synthetic import CheckerBoard
def test_scipy_gridder_same_points():
"See ... | 36.136842 | 77 | 0.696767 | import warnings
import pytest
import pandas as pd
import numpy as np
import numpy.testing as npt
from ..scipygridder import ScipyGridder
from ..coordinates import grid_coordinates
from ..datasets.synthetic import CheckerBoard
def test_scipy_gridder_same_points():
region = (1000, 5000, -8000, -7000)
synth = ... | true | true |
f72a4a1445d38081650f42268e4ec5cd183fd71f | 776 | py | Python | test/azure/Expected/AcceptanceTests/Lro/lro/__init__.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/Lro/lro/__init__.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/Lro/lro/__init__.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 38.8 | 99 | 0.641753 |
from ._auto_rest_long_running_operation_test_service import AutoRestLongRunningOperationTestService
from ._version import VERSION
__version__ = VERSION
__all__ = ['AutoRestLongRunningOperationTestService']
try:
from ._patch import patch_sdk patch_sdk()
except ImportError:
pass
| true | true |
f72a4bc72168d2050ab7b6bbeddb4ba77db329b8 | 5,324 | py | Python | python_modules/libraries/dagster-mssql/dagster_mssql/utils.py | nc-sika/dagster | ee56ee6ee26eb25cb03dd229716ed9af2cad0538 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-mssql/dagster_mssql/utils.py | nc-sika/dagster | ee56ee6ee26eb25cb03dd229716ed9af2cad0538 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-mssql/dagster_mssql/utils.py | nc-sika/dagster | ee56ee6ee26eb25cb03dd229716ed9af2cad0538 | [
"Apache-2.0"
] | null | null | null | import logging
import time
import urllib
from contextlib import contextmanager
import pyodbc
import sqlalchemy as db
from dagster import Field, IntSource, StringSource, check
from dagster.core.storage.sql import get_alembic_config, handle_schema_errors
from sqlalchemy.ext.compiler import compiles
MSSQL_POOL_RECYCLE... | 32.072289 | 114 | 0.628475 | import logging
import time
import urllib
from contextlib import contextmanager
import pyodbc
import sqlalchemy as db
from dagster import Field, IntSource, StringSource, check
from dagster.core.storage.sql import get_alembic_config, handle_schema_errors
from sqlalchemy.ext.compiler import compiles
MSSQL_POOL_RECYCLE... | true | true |
f72a4bffa2fd94ea50df6697d9321a5dbb611f66 | 5,120 | py | Python | instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py | willarmiros/opentelemetry-python-contrib | 0d34ef26b75f9a3bc275bf828b5a806d39ba1a40 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py | willarmiros/opentelemetry-python-contrib | 0d34ef26b75f9a3bc275bf828b5a806d39ba1a40 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py | willarmiros/opentelemetry-python-contrib | 0d34ef26b75f9a3bc275bf828b5a806d39ba1a40 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.820513 | 106 | 0.659766 |
from logging import getLogger
from os import environ
from typing import Collection
import elasticsearch
import elasticsearch.exceptions
from wrapt import wrap_function_wrapper as _wrap
from opentelemetry.instrumentation.elasticsearch.package import _instruments
from opentelemetry.instrumentation.elasticsearch.versi... | true | true |
f72a4c06bbd80f8c7dad227a0878c7eb28b2829d | 7,421 | py | Python | examples/ex_binding_textures.py | SebastianRodriguezR/grafica | c87d6d1906a4cf49520ef213f1e4ba6e1ead8c4e | [
"MIT"
] | 12 | 2021-08-17T12:57:39.000Z | 2022-03-28T02:52:30.000Z | examples/ex_binding_textures.py | SebastianRodriguezR/grafica | c87d6d1906a4cf49520ef213f1e4ba6e1ead8c4e | [
"MIT"
] | null | null | null | examples/ex_binding_textures.py | SebastianRodriguezR/grafica | c87d6d1906a4cf49520ef213f1e4ba6e1ead8c4e | [
"MIT"
] | 13 | 2021-08-17T03:23:21.000Z | 2022-03-20T21:40:16.000Z | # coding=utf-8
"""Using 2 different textures in the same Fragment Shader"""
import glfw
from OpenGL.GL import *
import OpenGL.GL.shaders
import numpy as np
import sys
import os.path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import grafica.transformations as tr
import grafica.basic_sh... | 30.413934 | 106 | 0.650721 |
import glfw
from OpenGL.GL import *
import OpenGL.GL.shaders
import numpy as np
import sys
import os.path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import grafica.transformations as tr
import grafica.basic_shapes as bs
import grafica.easy_shaders as es
from grafica.assets_path import... | true | true |
f72a4c25bda8e56afb5812475a76671822928e38 | 4,267 | py | Python | src/run_evaluation.py | liushulinle/CRACSpell | faff01521b08032c4efa89bbb2dc942a6327bc53 | [
"MIT"
] | 2 | 2022-03-23T07:17:02.000Z | 2022-03-24T07:09:04.000Z | src/run_evaluation.py | liushulinle/CRASpell | e0b495ed8424be7fdbd7fc3ef8c2919ab195b0e4 | [
"MIT"
] | null | null | null | src/run_evaluation.py | liushulinle/CRASpell | e0b495ed8424be7fdbd7fc3ef8c2919ab195b0e4 | [
"MIT"
] | null | null | null | import sys, os
import numpy as np
import tensorflow as tf
from bert_tagging import DataProcessor, BertTagging
import modeling
import optimization
import time
from tagging_eval import score_f
tf.logging.set_verbosity(tf.logging.ERROR)
DEBUG = False
def evaluate(FLAGS, label_list=None):
gpuid = FLAGS.gpuid
max_s... | 38.098214 | 206 | 0.668854 | import sys, os
import numpy as np
import tensorflow as tf
from bert_tagging import DataProcessor, BertTagging
import modeling
import optimization
import time
from tagging_eval import score_f
tf.logging.set_verbosity(tf.logging.ERROR)
DEBUG = False
def evaluate(FLAGS, label_list=None):
gpuid = FLAGS.gpuid
max_s... | true | true |
f72a4c3a75bd42077f335838511586ea852c2671 | 3,899 | py | Python | run.py | ntraut/example | 5b7501ee7c8ad4e7c61b3ff8e9b1d3c0380c33de | [
"Apache-2.0"
] | 13 | 2017-04-03T12:09:35.000Z | 2021-06-07T09:40:31.000Z | run.py | ntraut/example | 5b7501ee7c8ad4e7c61b3ff8e9b1d3c0380c33de | [
"Apache-2.0"
] | 13 | 2016-08-02T18:56:13.000Z | 2020-05-15T10:39:19.000Z | run.py | ntraut/example | 5b7501ee7c8ad4e7c61b3ff8e9b1d3c0380c33de | [
"Apache-2.0"
] | 31 | 2016-07-28T22:32:58.000Z | 2022-01-05T09:13:03.000Z | #!/usr/bin/env python3
import argparse
import os
import subprocess
import nibabel
import numpy
from glob import glob
__version__ = open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'version')).read()
def run(command, env={}):
merged_env = os.environ
merged_env.upda... | 44.816092 | 152 | 0.633496 | import argparse
import os
import subprocess
import nibabel
import numpy
from glob import glob
__version__ = open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'version')).read()
def run(command, env={}):
merged_env = os.environ
merged_env.update(env)
process = s... | true | true |
f72a4c44918d4818263c7f5a892eaf25465b4fda | 4,108 | py | Python | homeassistant/components/azure_devops/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | homeassistant/components/azure_devops/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/azure_devops/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for Azure DevOps."""
import logging
from typing import Any, Dict
from aioazuredevops.client import DevOpsClient
import aiohttp
from homeassistant.components.azure_devops.const import (
CONF_ORG,
CONF_PAT,
CONF_PROJECT,
DATA_AZURE_DEVOPS_CLIENT,
DOMAIN,
)
from homeassistant.config_entrie... | 31.358779 | 94 | 0.619523 | import logging
from typing import Any, Dict
from aioazuredevops.client import DevOpsClient
import aiohttp
from homeassistant.components.azure_devops.const import (
CONF_ORG,
CONF_PAT,
CONF_PROJECT,
DATA_AZURE_DEVOPS_CLIENT,
DOMAIN,
)
from homeassistant.config_entries import ConfigEntry
from homeas... | true | true |
f72a4c55620436228ce86fa539585fab1397d008 | 2,698 | py | Python | dprs/get_contents_file_list.py | kaan-keskin/debian-package-repository-statistics | ef70f4a9914b8baa4799a36217832a5cbdc8b7d3 | [
"MIT"
] | 1 | 2022-03-21T19:08:43.000Z | 2022-03-21T19:08:43.000Z | dprs/get_contents_file_list.py | kaan-keskin/debian-package-repository-statistics | ef70f4a9914b8baa4799a36217832a5cbdc8b7d3 | [
"MIT"
] | null | null | null | dprs/get_contents_file_list.py | kaan-keskin/debian-package-repository-statistics | ef70f4a9914b8baa4799a36217832a5cbdc8b7d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Extensible library for opening URLs
# https://docs.python.org/3/library/urllib.request.html
import urllib.request
from urllib.error import URLError
from dprs.default_variables import DEFAULT_MIRROR_URL
from dprs.exceptions import MirrorURLNotAccessible
def get_contents_file_list(mirror_url:... | 38.542857 | 103 | 0.627502 |
import urllib.request
from urllib.error import URLError
from dprs.default_variables import DEFAULT_MIRROR_URL
from dprs.exceptions import MirrorURLNotAccessible
def get_contents_file_list(mirror_url: str = DEFAULT_MIRROR_URL) -> list:
try:
with urllib.request.urlopen(mirror_url) as url_opener_response:
... | true | true |
f72a4c7097a99eefb13c041d6192064e857a4dfb | 1,277 | py | Python | tests/conftest.py | benbenti/fuzzyclustering | f67224105528d82f6d950ec7692a50d927ca0621 | [
"MIT"
] | null | null | null | tests/conftest.py | benbenti/fuzzyclustering | f67224105528d82f6d950ec7692a50d927ca0621 | [
"MIT"
] | 3 | 2021-04-22T15:20:32.000Z | 2021-04-22T15:21:41.000Z | tests/conftest.py | benbenti/fuzzyclustering | f67224105528d82f6d950ec7692a50d927ca0621 | [
"MIT"
] | null | null | null | import pytest
import random
import numpy as np
from numpy.random import rand
import lib.algorithms as al
@pytest.fixture(scope="session")
def unif_1D():
"""
Test case: one dimension, samples evenly distributed.
"""
data = np.array([[0], [1], [2], [3], [4], [5], [6],
[7], [8], [9], ... | 24.557692 | 62 | 0.617071 | import pytest
import random
import numpy as np
from numpy.random import rand
import lib.algorithms as al
@pytest.fixture(scope="session")
def unif_1D():
data = np.array([[0], [1], [2], [3], [4], [5], [6],
[7], [8], [9], [10], [11], [12]
]
)
return d... | true | true |
f72a4c86c1a569849d3b8f3e318a9e9d83312722 | 3,322 | py | Python | 2 semester/PP/10_2/Code/3.py | kurpenok/Labs | 069c92b7964a1445d093313b38ebdc56318d2a73 | [
"MIT"
] | null | null | null | 2 semester/PP/10_2/Code/3.py | kurpenok/Labs | 069c92b7964a1445d093313b38ebdc56318d2a73 | [
"MIT"
] | null | null | null | 2 semester/PP/10_2/Code/3.py | kurpenok/Labs | 069c92b7964a1445d093313b38ebdc56318d2a73 | [
"MIT"
] | null | null | null | from math import sqrt, sin, pi
class Liked:
def __init__(self, *args) -> None:
self.data = []
for arg in args:
for line in arg:
self.data.append(line)
def likes(self) -> dict:
self.emojis = [":)", ";)", ")", ":(", ";(", "("]
output = dict()
... | 24.248175 | 72 | 0.494883 | from math import sqrt, sin, pi
class Liked:
def __init__(self, *args) -> None:
self.data = []
for arg in args:
for line in arg:
self.data.append(line)
def likes(self) -> dict:
self.emojis = [":)", ";)", ")", ":(", ";(", "("]
output = dict()
... | true | true |
f72a4cbccdd5ee4e79941efbf501b57e0fc9d10f | 6,514 | py | Python | test.py | jssprz/video_captioning_with_visual_syntactic_embedding | 0687772b22c56f448dabbe46932422363964abd4 | [
"MIT"
] | 23 | 2021-01-04T07:09:40.000Z | 2022-01-12T22:54:33.000Z | test.py | jssprz/video_captioning_with_visual_syntactic_embedding | 0687772b22c56f448dabbe46932422363964abd4 | [
"MIT"
] | 7 | 2021-01-14T07:48:22.000Z | 2022-02-01T04:30:05.000Z | test.py | jssprz/video_captioning_with_visual_syntactic_embedding | 0687772b22c56f448dabbe46932422363964abd4 | [
"MIT"
] | 7 | 2021-03-20T15:03:53.000Z | 2022-03-09T09:18:10.000Z | import os
import argparse
import pickle
from utils import decode_from_tokens
from vocabulary import Vocabulary
from configuration_file import ConfigurationFile
from model.encoder import SCNEncoder
from model.decoder import SemSynANDecoder
import h5py
import torch
import numpy as np
if __name__ == '__main__':
pars... | 44.312925 | 129 | 0.646147 | import os
import argparse
import pickle
from utils import decode_from_tokens
from vocabulary import Vocabulary
from configuration_file import ConfigurationFile
from model.encoder import SCNEncoder
from model.decoder import SemSynANDecoder
import h5py
import torch
import numpy as np
if __name__ == '__main__':
pars... | true | true |
f72a4d13a6ccfb3a394f61f2c8c520771408032b | 3,484 | py | Python | app/routers/images.py | vncsna/mirror | 0de84de6fa4f8a4569beed0bf2e313901d95a17d | [
"MIT"
] | null | null | null | app/routers/images.py | vncsna/mirror | 0de84de6fa4f8a4569beed0bf2e313901d95a17d | [
"MIT"
] | null | null | null | app/routers/images.py | vncsna/mirror | 0de84de6fa4f8a4569beed0bf2e313901d95a17d | [
"MIT"
] | null | null | null | # TODO: Add exception checking
# TODO: Use wrong uuids as input
import os
import cv2
import shutil
import numpy as np
from enum import Enum
from uuid import uuid4
from pathlib import Path
from dotenv import load_dotenv
from fastapi import APIRouter, File, UploadFile
from fastapi.responses import FileResponse
load_dot... | 28.325203 | 65 | 0.642078 |
import os
import cv2
import shutil
import numpy as np
from enum import Enum
from uuid import uuid4
from pathlib import Path
from dotenv import load_dotenv
from fastapi import APIRouter, File, UploadFile
from fastapi.responses import FileResponse
load_dotenv()
DATABASE_IMGE = os.environ['DATABASE_IMGE']
DATABASE_TEXT ... | true | true |
f72a4dac3ecef7e475c42ce8919f2ec459aa9f6e | 1,352 | py | Python | Chapter05_Serial-IO/serialOrgan/scaleGenerator.py | ONEV2/AVR-Programming | 31ac43d0ea353a6878079e15c1e1bda6a31da4c0 | [
"MIT"
] | 608 | 2015-01-01T23:22:28.000Z | 2022-03-25T23:40:47.000Z | Chapter05_Serial-IO/serialOrgan/scaleGenerator.py | Omsingh24/AVR-Programming | 8a9ad403ccf2f6cceef955e3813e476da3df7f62 | [
"MIT"
] | 41 | 2015-01-14T05:49:48.000Z | 2022-01-22T07:07:24.000Z | Chapter05_Serial-IO/serialOrgan/scaleGenerator.py | Omsingh24/AVR-Programming | 8a9ad403ccf2f6cceef955e3813e476da3df7f62 | [
"MIT"
] | 340 | 2015-01-06T18:32:28.000Z | 2022-03-31T18:20:44.000Z | # scaleGenerator.py
# Scales are in terms of times per cycle (period) rather
# than pitch.
#
import math
SCALE = ['C', 'Cx', 'D', 'Dx', 'E', 'F', 'Fx', 'G', 'Gx', 'A', 'Ax', 'B']
def calculateOctave(baseLength):
periods = [baseLength / math.exp(x*math.log(2)/12) for x in range(0, 12)]
periods = [int(rou... | 28.765957 | 77 | 0.607988 |
import math
SCALE = ['C', 'Cx', 'D', 'Dx', 'E', 'F', 'Fx', 'G', 'Gx', 'A', 'Ax', 'B']
def calculateOctave(baseLength):
periods = [baseLength / math.exp(x*math.log(2)/12) for x in range(0, 12)]
periods = [int(round(x)) for x in periods]
return( zip(SCALE, periods) )
def makePitches(basePitch, numOctaves)... | true | true |
f72a4dfe4c34ef1aa9ab86723b47cf9341cad810 | 3,823 | py | Python | scripts/o3de/tests/unit_test_project_properties.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-08-04T00:43:18.000Z | 2021-08-04T00:43:18.000Z | scripts/o3de/tests/unit_test_project_properties.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | null | null | null | scripts/o3de/tests/unit_test_project_properties.py | sandeel31/o3de | db88812d61eef77c6f4451b7f8c7605d6db07412 | [
"Apache-2.0",
"MIT"
] | null | null | null | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import pytest
import pathlib
from unittest.mock import patch
from o3de import project_properties
TEST_DE... | 46.621951 | 126 | 0.637719 |
import pytest
import pathlib
from unittest.mock import patch
from o3de import project_properties
TEST_DEFAULT_PROJECT_DATA = {
"template_name": "DefaultProject",
"restricted_name": "o3de",
"restricted_platform_relative_path": "Templates",
"origin": "The primary repo for DefaultProject goes here: i.e.... | true | true |
f72a4e0d8cbc89c9de5ee0df61f78d7d32bde73e | 73,927 | py | Python | tensorflow/contrib/lite/testing/generate_examples.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 5 | 2018-09-22T20:16:46.000Z | 2022-02-28T10:35:19.000Z | tensorflow/contrib/lite/testing/generate_examples.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/lite/testing/generate_examples.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 2 | 2019-08-14T09:04:37.000Z | 2022-02-02T20:08:02.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.904322 | 82 | 0.625063 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import itertools
import os
import re
import sys
import tempfile
import traceback
import zipfile
import numpy as np
from six import StringIO
from six.moves import xrange
os.environ["CUDA_VISIBL... | true | true |
f72a4e3b9390c65a9d4226e4e2bfa029a474c9d9 | 10,627 | py | Python | work_dirs/bsnet_fcos_test/bsnet_fcos_test.py | zzx0226/mmocr | 50354895244339a392b4f1af5a35963883923cca | [
"Apache-2.0"
] | null | null | null | work_dirs/bsnet_fcos_test/bsnet_fcos_test.py | zzx0226/mmocr | 50354895244339a392b4f1af5a35963883923cca | [
"Apache-2.0"
] | null | null | null | work_dirs/bsnet_fcos_test/bsnet_fcos_test.py | zzx0226/mmocr | 50354895244339a392b4f1af5a35963883923cca | [
"Apache-2.0"
] | null | null | null | checkpoint_config = dict(interval=10)
log_config = dict(
interval=5,
hooks=[dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook')])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
optimizer = dict(type='SGD', lr=0.001, mome... | 35.423333 | 99 | 0.555472 | checkpoint_config = dict(interval=10)
log_config = dict(
interval=5,
hooks=[dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook')])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
optimizer = dict(type='SGD', lr=0.001, mome... | true | true |
f72a4e46e33271ff312daf81e2aa725c8a324bb1 | 584 | py | Python | code/heap.py | philipmassouh/RoA | ed57d9da44cd04496dfc4c43f11b3ead99d58608 | [
"Apache-2.0"
] | null | null | null | code/heap.py | philipmassouh/RoA | ed57d9da44cd04496dfc4c43f11b3ead99d58608 | [
"Apache-2.0"
] | null | null | null | code/heap.py | philipmassouh/RoA | ed57d9da44cd04496dfc4c43f11b3ead99d58608 | [
"Apache-2.0"
] | null | null | null | def heapify(heap, root):
newRoot = root
leftChild = 2*root+1
rightChild = 2*root+2
if leftChild < len(heap) and heap[leftChild] > heap[newRoot]:
newRoot = leftChild
if rightChild < len(heap) and heap[rightChild] > heap[newRoot]:
newRoot = rightChild
if root!=newRoot:
heap[root],heap[newRoot]=heap[newRoot],h... | 25.391304 | 64 | 0.679795 | def heapify(heap, root):
newRoot = root
leftChild = 2*root+1
rightChild = 2*root+2
if leftChild < len(heap) and heap[leftChild] > heap[newRoot]:
newRoot = leftChild
if rightChild < len(heap) and heap[rightChild] > heap[newRoot]:
newRoot = rightChild
if root!=newRoot:
heap[root],heap[newRoot]=heap[newRoot],h... | true | true |
f72a4e980f110ebf4b26838dad3e5987b3b5af11 | 8,123 | py | Python | shalstm/qa/model.py | alisafaya/shalstm | 3d85f29c82451b393975ba587d53e0db0e43fff9 | [
"MIT"
] | null | null | null | shalstm/qa/model.py | alisafaya/shalstm | 3d85f29c82451b393975ba587d53e0db0e43fff9 | [
"MIT"
] | null | null | null | shalstm/qa/model.py | alisafaya/shalstm | 3d85f29c82451b393975ba587d53e0db0e43fff9 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
from shalstm import SHALSTM
from shalstm.utils import top_k_top_p_filtering
class SHALSTMforQuestionAnswering(SHALSTM):
def forward(self, input, attention_mask=None, type_ids=None, hidden=None, mems=None, return_loss=False, lm_loss=False):
"""
all arguments have... | 38.866029 | 164 | 0.612582 | import torch.nn as nn
import torch
from shalstm import SHALSTM
from shalstm.utils import top_k_top_p_filtering
class SHALSTMforQuestionAnswering(SHALSTM):
def forward(self, input, attention_mask=None, type_ids=None, hidden=None, mems=None, return_loss=False, lm_loss=False):
x = input[:-1].to(self.device)... | true | true |
f72a4f4af0ffe7527231500fcb530dd4fab8692b | 14,981 | py | Python | patrole_tempest_plugin/tests/unit/test_rbac_utils.py | openstack/patrole | fa0ee135121a5e86301ad5ee1854b3a0bd70b69b | [
"Apache-2.0"
] | 14 | 2017-01-03T15:07:18.000Z | 2020-09-17T18:07:39.000Z | patrole_tempest_plugin/tests/unit/test_rbac_utils.py | openstack/patrole | fa0ee135121a5e86301ad5ee1854b3a0bd70b69b | [
"Apache-2.0"
] | null | null | null | patrole_tempest_plugin/tests/unit/test_rbac_utils.py | openstack/patrole | fa0ee135121a5e86301ad5ee1854b3a0bd70b69b | [
"Apache-2.0"
] | 12 | 2017-02-28T20:08:48.000Z | 2020-12-30T09:31:51.000Z | # Copyright 2017 AT&T 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 require... | 43.048851 | 79 | 0.653227 |
import testtools
from unittest import mock
from tempest.lib import exceptions as lib_exc
from patrole_tempest_plugin import rbac_exceptions
from patrole_tempest_plugin import rbac_utils
from patrole_tempest_plugin.tests.unit import base
from patrole_tempest_plugin.tests.unit import fixtures as patrole_fixtures
cla... | true | true |
f72a4f6721d4ff9bda92ac47662c4d9dcaa83260 | 2,333 | py | Python | var/spack/repos/builtin/packages/r-gsodr/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/r-gsodr/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/r-gsodr/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 *
class RGsodr(RPackage):
"""A Global Surface Summary of the Day (GSOD) Weather Data Client for R
... | 53.022727 | 95 | 0.724389 |
from spack import *
class RGsodr(RPackage):
homepage = "https://docs.ropensci.org/GSODR/"
url = "https://cloud.r-project.org/src/contrib/GSODR_2.1.1.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/GSODR"
version('2.1.2', sha256='4fc1d084b6c21055d8cc17a6a6dc412261aa0d4ef4079... | true | true |
f72a51b526015df516689e7669b54b9e20831540 | 639 | py | Python | tests/clims/api/serializers/models/test_work_batch.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | null | null | null | tests/clims/api/serializers/models/test_work_batch.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | null | null | null | tests/clims/api/serializers/models/test_work_batch.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import TestCase
from clims.api.serializers.models.workbatch import WorkBatchSerializer
from clims.models.work_batch import WorkBatch
class WorkBatchSerializerTest(TestCase):
def test_can_serialize_task(self):
model = WorkBatch(id=1, name="Test... | 35.5 | 87 | 0.713615 | from __future__ import absolute_import
from sentry.testutils import TestCase
from clims.api.serializers.models.workbatch import WorkBatchSerializer
from clims.models.work_batch import WorkBatch
class WorkBatchSerializerTest(TestCase):
def test_can_serialize_task(self):
model = WorkBatch(id=1, name="Test... | true | true |
f72a51ff116cdacd733759b6eb96d4b97659306d | 609 | py | Python | djasana/migrations/0008_auto_20180906_1407.py | zaptim/django-asana | ab6d7166f28945292d5632ef766fc13cc2ea4cf3 | [
"MIT"
] | null | null | null | djasana/migrations/0008_auto_20180906_1407.py | zaptim/django-asana | ab6d7166f28945292d5632ef766fc13cc2ea4cf3 | [
"MIT"
] | null | null | null | djasana/migrations/0008_auto_20180906_1407.py | zaptim/django-asana | ab6d7166f28945292d5632ef766fc13cc2ea4cf3 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2018-09-06 14:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djasana', '0007_auto_20180819_1518'),
]
operations = [
migrations.AlterField(
model_name='customfield',
name='descrip... | 24.36 | 75 | 0.602627 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djasana', '0007_auto_20180819_1518'),
]
operations = [
migrations.AlterField(
model_name='customfield',
name='description',
field=models.CharField(blan... | true | true |
f72a5265e0f02fda5da08d5bce4bd2145df5c0eb | 582 | py | Python | examples/2021_12_31/py_files/plotters/Paraview/timeAverage.py | jagarciap/SCSI | 0972548adf17a27b78ef2865a837bf20aadca3e9 | [
"MIT"
] | null | null | null | examples/2021_12_31/py_files/plotters/Paraview/timeAverage.py | jagarciap/SCSI | 0972548adf17a27b78ef2865a837bf20aadca3e9 | [
"MIT"
] | null | null | null | examples/2021_12_31/py_files/plotters/Paraview/timeAverage.py | jagarciap/SCSI | 0972548adf17a27b78ef2865a837bf20aadca3e9 | [
"MIT"
] | 1 | 2022-01-18T10:24:39.000Z | 2022-01-18T10:24:39.000Z | from paraview.simple import *
firststep = 50
#names = ['0_ts*', '0-0_ts*', '0-0-0_ts*']
names = ['0_ts*', '0-0_ts*']
for name in names:
acs = FindSource(name)
SetActiveSource(acs)
laststep = int(acs.TimestepValues[-1])
extractTimeSteps = ExtractTimeSteps(Input=acs)
extractTimeSteps.TimeStepIndices... | 34.235294 | 80 | 0.725086 | from paraview.simple import *
firststep = 50
names = ['0_ts*', '0-0_ts*']
for name in names:
acs = FindSource(name)
SetActiveSource(acs)
laststep = int(acs.TimestepValues[-1])
extractTimeSteps = ExtractTimeSteps(Input=acs)
extractTimeSteps.TimeStepIndices = [i for i in range(firststep, laststep+1)... | true | true |
f72a52a097ae8acfd4297be79489feb161d30056 | 6,350 | py | Python | tools/cFS-GroundSystem/GroundSystem.py | ammarrm/cFS_MSTAR | f7d59eec4a445bb8572d01a580c043ec7a33df44 | [
"Apache-2.0"
] | null | null | null | tools/cFS-GroundSystem/GroundSystem.py | ammarrm/cFS_MSTAR | f7d59eec4a445bb8572d01a580c043ec7a33df44 | [
"Apache-2.0"
] | null | null | null | tools/cFS-GroundSystem/GroundSystem.py | ammarrm/cFS_MSTAR | f7d59eec4a445bb8572d01a580c043ec7a33df44 | [
"Apache-2.0"
] | 1 | 2021-04-23T04:26:08.000Z | 2021-04-23T04:26:08.000Z | #
# GSC-18128-1, "Core Flight Executive Version 6.7"
#
# Copyright (c) 2006-2019 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | 32.397959 | 94 | 0.671811 | import shlex
import subprocess
import sys
from pathlib import Path
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox
from RoutingService import RoutingService
from Ui_MainWindow import Ui_MainWindow
from _version import __version__ as _version
from _version import _version_string
__version__ = _ver... | true | true |
f72a530516b9a3b382487caa11390d79ac8dedb8 | 1,185 | py | Python | pyprof/alembic/versions/2021_03_12_15_41_50.py | kooichirooooo/pyprof | a2cce7ef335d02b0566a169b46f3cf976e7d9662 | [
"MIT"
] | null | null | null | pyprof/alembic/versions/2021_03_12_15_41_50.py | kooichirooooo/pyprof | a2cce7ef335d02b0566a169b46f3cf976e7d9662 | [
"MIT"
] | null | null | null | pyprof/alembic/versions/2021_03_12_15_41_50.py | kooichirooooo/pyprof | a2cce7ef335d02b0566a169b46f3cf976e7d9662 | [
"MIT"
] | null | null | null | """create frame and block table
Revision ID: 1fc165a90d68
Revises:
Create Date: 2021-03-12 15:41:50.150507
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "1fc165a90d68"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### comma... | 26.333333 | 74 | 0.625316 | import sqlalchemy as sa
from alembic import op
revision = "1fc165a90d68"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"frames",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("name", sa.String(length=32), nul... | true | true |
f72a5319acea927f969baaeedae8a60444d73815 | 168 | py | Python | ftruck/urls.py | sunlightlabs/foodtrucks | f6531a3e47c3d5975d5230e946e636d082dbc24a | [
"BSD-3-Clause"
] | null | null | null | ftruck/urls.py | sunlightlabs/foodtrucks | f6531a3e47c3d5975d5230e946e636d082dbc24a | [
"BSD-3-Clause"
] | null | null | null | ftruck/urls.py | sunlightlabs/foodtrucks | f6531a3e47c3d5975d5230e946e636d082dbc24a | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls.defaults import *
urlpatterns = patterns('ftruck.views',
url(r'^$', 'mainmap', name='map'),
url(r'^tweets/$', 'tweets', name='tweets')
)
| 24 | 46 | 0.630952 | from django.conf.urls.defaults import *
urlpatterns = patterns('ftruck.views',
url(r'^$', 'mainmap', name='map'),
url(r'^tweets/$', 'tweets', name='tweets')
)
| true | true |
f72a5350a454b362d7b0b72c74c7c361977c73b5 | 2,289 | py | Python | data/cirq_new/cirq_program/startCirq_noisy553.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy553.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy553.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=19
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... | 33.173913 | 77 | 0.68851 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0])) c.append(cirq.H.on(input_qubit[1])) c.append(cirq.H.on(input_qubit[1])) c.append(ci... | true | true |
f72a536ed7d7645ecead0368a4011e2dfa79644e | 20 | py | Python | ckan/lib/navl/__init__.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 12 | 2015-08-28T16:59:07.000Z | 2020-03-08T01:39:30.000Z | ckan/lib/navl/__init__.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 13 | 2019-05-02T21:01:28.000Z | 2020-10-20T23:34:48.000Z | ckan/lib/navl/__init__.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 10 | 2015-05-08T04:33:20.000Z | 2020-03-03T15:17:58.000Z | __license__ = 'MIT'
| 10 | 19 | 0.7 | __license__ = 'MIT'
| true | true |
f72a5415b9a53ec576425cc8bb6d98e89c6da886 | 700 | py | Python | pytreex/block/util/setglobal.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 11 | 2015-06-24T08:41:44.000Z | 2021-09-02T21:12:10.000Z | pytreex/block/util/setglobal.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 4 | 2016-01-12T19:21:22.000Z | 2019-05-10T14:46:44.000Z | pytreex/block/util/setglobal.py | ufal/pytreex | 9633c1420e6b4adecd73baaf761d26fa49708a61 | [
"Apache-2.0"
] | 3 | 2016-01-22T11:54:11.000Z | 2019-04-30T17:09:55.000Z | #!/usr/bin/env python
# coding=utf-8
#
# Block for making tree copies
#
from __future__ import unicode_literals
from pytreex.core.block import Block
__author__ = "Ondřej Dušek"
__date__ = "2012"
class SetGlobal(Block):
def __init__(self, scenario, args):
"""\
Constructor, sets the arguments giv... | 23.333333 | 70 | 0.642857 | from __future__ import unicode_literals
from pytreex.core.block import Block
__author__ = "Ondřej Dušek"
__date__ = "2012"
class SetGlobal(Block):
def __init__(self, scenario, args):
Block.__init__(self, scenario, args)
for arg, value in args.items():
scenario.global_args[arg] = val... | true | true |
f72a54c5a6aefc1b68cf97340534140cea211c6d | 39,428 | py | Python | modin/pandas/test/utils.py | itsliya/modin | d4ce5390816ae7eb8717bf271e1feabd3d5fabee | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-05-19T04:01:17.000Z | 2021-05-19T04:01:17.000Z | modin/pandas/test/utils.py | itsliya/modin | d4ce5390816ae7eb8717bf271e1feabd3d5fabee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/pandas/test/utils.py | itsliya/modin | d4ce5390816ae7eb8717bf271e1feabd3d5fabee | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-01-29T12:12:42.000Z | 2022-01-29T12:12:42.000Z | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 31.848142 | 117 | 0.582124 |
import pytest
import numpy as np
import math
import pandas
from pandas.testing import (
assert_series_equal,
assert_frame_equal,
assert_index_equal,
assert_extension_array_equal,
)
import modin.pandas as pd
from modin.utils import to_pandas
from modin.config import TestDatasetSize, TrackFileLeaks
from ... | true | true |
f72a54e9a3329047951044887f34ffc35ca51dd9 | 310 | py | Python | jukebox/urls.py | bharadhwaj/jukebox | 7223e6c686ac2868c6284270564db6d557b17fc5 | [
"MIT"
] | 1 | 2018-06-12T10:51:15.000Z | 2018-06-12T10:51:15.000Z | jukebox/urls.py | bharadhwaj/jukebox | 7223e6c686ac2868c6284270564db6d557b17fc5 | [
"MIT"
] | 3 | 2020-06-05T18:26:16.000Z | 2021-06-10T20:30:23.000Z | jukebox/urls.py | bharadhwaj/jukebox | 7223e6c686ac2868c6284270564db6d557b17fc5 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'links'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('vote/', views.VoteView.as_view(), name='vote'),
path('votes/', views.vote, name='votes'),
path('result/', views.ResultView.as_view(), name='result'),
] | 28.181818 | 63 | 0.651613 | from django.urls import path
from . import views
app_name = 'links'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('vote/', views.VoteView.as_view(), name='vote'),
path('votes/', views.vote, name='votes'),
path('result/', views.ResultView.as_view(), name='result'),
] | true | true |
f72a55db61c854785fc42c069c7252d364540690 | 23,064 | py | Python | main.py | mpast/earth-engine-app | 496fc6cfe95403a42374e439a4027c09760af964 | [
"Apache-2.0"
] | 2 | 2018-06-19T20:33:32.000Z | 2018-07-13T16:03:30.000Z | main.py | mpast/earth-engine-app | 496fc6cfe95403a42374e439a4027c09760af964 | [
"Apache-2.0"
] | 1 | 2020-11-15T17:56:09.000Z | 2020-11-15T17:56:09.000Z | main.py | mpast/earth-engine-app | 496fc6cfe95403a42374e439a4027c09760af964 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template, request
import config
import os
import json
import ee
import time
import calendar
import datetime
import threading
import logging, logging.config, yaml
from pymemcache.client.hash import Client
#from google.appengine.api import memcache as mc
###############################... | 32.995708 | 110 | 0.614161 | from flask import Flask, render_template, request
import config
import os
import json
import ee
import time
import calendar
import datetime
import threading
import logging, logging.config, yaml
from pymemcache.client.hash import Client
EE_CREDENTIALS = ee.ServiceAccountCredentials(config.EE_ACCOUNT, config.EE_PRIV... | true | true |
f72a5625c654c8cd33973153b20dd9ad97e848d4 | 17,876 | py | Python | pyeccodes/defs/grib2/tables/25/4_0_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/grib2/tables/24/4_0_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/grib2/tables/24/4_0_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | def load(h):
return ({'abbr': 0,
'code': 0,
'title': 'Analysis or forecast at a horizontal level or in a horizontal '
'layer at a point in time'},
{'abbr': 1,
'code': 1,
'title': 'Individual ensemble forecast, control and perturbe... | 55.688474 | 91 | 0.519579 | def load(h):
return ({'abbr': 0,
'code': 0,
'title': 'Analysis or forecast at a horizontal level or in a horizontal '
'layer at a point in time'},
{'abbr': 1,
'code': 1,
'title': 'Individual ensemble forecast, control and perturbe... | true | true |
f72a562854148934a239bcf74e1945d7133782f2 | 3,310 | py | Python | Chapter05/Chapter_5/Chapter_5_5.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 33 | 2018-12-29T15:39:20.000Z | 2022-03-18T14:36:11.000Z | Chapter05/Chapter_5/Chapter_5_5.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 4 | 2019-05-01T08:30:47.000Z | 2020-08-14T21:13:53.000Z | Chapter05/Chapter_5/Chapter_5_5.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 14 | 2019-01-13T15:52:08.000Z | 2021-10-10T06:14:39.000Z | # -*- coding: utf-8 -*-
# source from https://github.com/keon/deep-q-learning/blob/master/dqn.py
import random
import gym
import numpy as np
from collections import deque
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
EPISODES = 1000
class DQNAgent:
def __init... | 35.978261 | 74 | 0.600302 | import random
import gym
import numpy as np
from collections import deque
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
EPISODES = 1000
class DQNAgent:
def __init__(self, state_size, action_size):
self.state_size = state_size
self.action_size ... | true | true |
f72a56bc327beb68eaff0e6ebaf52a3e7b6095e4 | 1,956 | py | Python | fastseq/ops/ngram_repeat_block.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 346 | 2020-11-28T14:25:21.000Z | 2022-03-25T14:50:22.000Z | fastseq/ops/ngram_repeat_block.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 22 | 2020-12-03T18:52:04.000Z | 2022-02-26T05:19:14.000Z | fastseq/ops/ngram_repeat_block.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 35 | 2020-11-30T21:37:45.000Z | 2022-03-23T01:54:51.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
""" Wrapper for ngram_repeat_block cuda extension """
from torch import nn
from torch.autograd import Function
import ngram_repeat_block_cuda
class NGramRepeatBlockFunction(Function):
"""
forward inputs to ngram_repeat_block cuda extensi... | 32.6 | 71 | 0.657975 |
from torch import nn
from torch.autograd import Function
import ngram_repeat_block_cuda
class NGramRepeatBlockFunction(Function):
def forward(self, tokens, lprobs, bsz,
step, beam_size, no_repeat_ngram_size):
outputs = ngram_repeat_block_cuda.forward(tokens,
lprobs, bsz, step, beam_size, n... | true | true |
f72a57059f2c092dba9f5b18eb5c0724c3267d04 | 3,464 | py | Python | app/cito_engine/views/tools.py | twatchy/cito_engine | a62dce3c76567dd36b7efcaa70e03728b335f44e | [
"Apache-2.0"
] | null | null | null | app/cito_engine/views/tools.py | twatchy/cito_engine | a62dce3c76567dd36b7efcaa70e03728b335f44e | [
"Apache-2.0"
] | null | null | null | app/cito_engine/views/tools.py | twatchy/cito_engine | a62dce3c76567dd36b7efcaa70e03728b335f44e | [
"Apache-2.0"
] | null | null | null | """Copyright 2014 Cyrus Dasadia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | 44.987013 | 112 | 0.618938 |
from django.shortcuts import redirect, render_to_response
from django.forms.formsets import formset_factory
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from cito_engine.forms import tools_form, events
@login_required(login_url='/login/')
def bulk_upload_events... | true | true |
f72a587cdb19c1c9ab6d907b4c8b9dbcba84d995 | 3,925 | py | Python | ros/src/twist_controller/dbw_test.py | kenji-miyake/udacity-CarND-term2-Capstone | e50e826c9700a2bc549e809e2548b1a6d686012c | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_test.py | kenji-miyake/udacity-CarND-term2-Capstone | e50e826c9700a2bc549e809e2548b1a6d686012c | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_test.py | kenji-miyake/udacity-CarND-term2-Capstone | e50e826c9700a2bc549e809e2548b1a6d686012c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import csv
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
'''
You can use this file to test your DBW code against a bag recorded with a reference implementation.
The bag can be found at https://s3-us-west-1.a... | 34.734513 | 114 | 0.644076 |
import os
import csv
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
class DBWTestNode(object):
def __init__(self):
rospy.init_node('dbw_test_node')
rospy.Subscriber('/vehicle/steering_cmd', SteeringCmd, self.steer_cb)... | true | true |
f72a59ba76c94957d9f4a188c1bbef848032ed01 | 20,211 | py | Python | xalpha/cons.py | Razorro/xalpha | bcecd53dc9d081deb1b8235437a4f6b74951c23d | [
"MIT"
] | null | null | null | xalpha/cons.py | Razorro/xalpha | bcecd53dc9d081deb1b8235437a4f6b74951c23d | [
"MIT"
] | null | null | null | xalpha/cons.py | Razorro/xalpha | bcecd53dc9d081deb1b8235437a4f6b74951c23d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
basic constants and utility functions
"""
import datetime as dt
import os
import time
import logging
import inspect
from decimal import Decimal
import requests
from functools import wraps
from simplejson.errors import JSONDecodeError
import pandas as pd
from pyecharts.options import (
... | 25.978149 | 112 | 0.502647 |
import datetime as dt
import os
import time
import logging
import inspect
from decimal import Decimal
import requests
from functools import wraps
from simplejson.errors import JSONDecodeError
import pandas as pd
from pyecharts.options import (
AxisOpts,
DataZoomOpts,
LegendOpts,
TooltipOpts,
Visua... | true | true |
f72a5a03842d93e765331b1fe8130fe4969fd3ea | 3,462 | py | Python | temperature.py | balena-io-playground/balena-edison-monitoring-artik | d02ba51cda8edcbc0decc80d0dab7f724dc46014 | [
"Apache-2.0"
] | 2 | 2020-04-25T08:46:41.000Z | 2021-02-11T17:36:27.000Z | temperature.py | balena-io-playground/balena-edison-monitoring-artik | d02ba51cda8edcbc0decc80d0dab7f724dc46014 | [
"Apache-2.0"
] | null | null | null | temperature.py | balena-io-playground/balena-edison-monitoring-artik | d02ba51cda8edcbc0decc80d0dab7f724dc46014 | [
"Apache-2.0"
] | null | null | null | """
Temperature monitoring with Intel Edison and Samsung ARTIK Cloud
"""
import sys
import os
import time
from math import log
import statistics
from collections import deque
import artikcloud
from artikcloud.rest import ApiException
import pyupm_grove as grove
import mraa
import requests
# Setting credentials from t... | 29.589744 | 121 | 0.644136 | import sys
import os
import time
from math import log
import statistics
from collections import deque
import artikcloud
from artikcloud.rest import ApiException
import pyupm_grove as grove
import mraa
import requests
DEVICE_ID = os.getenv('ARTIKCLOUD_DEVICE_ID')
DEVICE_TOKEN = os.getenv('ARTIKCLOUD_DEVICE_TOKEN')
try... | true | true |
f72a5a2e708a8aa2bbfc8ad3b14c6e6ce0a4298f | 701 | py | Python | P2/dsa_shuffling_queue.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | P2/dsa_shuffling_queue.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | P2/dsa_shuffling_queue.py | MC-DeltaT/DSA-Practicals | 5c77cac1cfee5d756b84722e563813c153486770 | [
"MIT"
] | null | null | null | from dsa_queue import DSAQueue
class DSAShufflingQueue(DSAQueue):
def enqueue(self, obj: object) -> None:
if self.is_full():
raise ValueError("Queue is full.")
self._array[self._size] = obj
self._size += 1
def dequeue(self) -> object:
tmp = self.peek()
for ... | 26.961538 | 50 | 0.574893 | from dsa_queue import DSAQueue
class DSAShufflingQueue(DSAQueue):
def enqueue(self, obj: object) -> None:
if self.is_full():
raise ValueError("Queue is full.")
self._array[self._size] = obj
self._size += 1
def dequeue(self) -> object:
tmp = self.peek()
for ... | true | true |
f72a5b5dc1100cba5f9f50fe40bb4f01308226b6 | 294 | py | Python | nn/optim/optimizer.py | dimaischenko/nn | a7f5887ec816e6b3bbfc57e6864ab3ae320161a6 | [
"Apache-2.0"
] | null | null | null | nn/optim/optimizer.py | dimaischenko/nn | a7f5887ec816e6b3bbfc57e6864ab3ae320161a6 | [
"Apache-2.0"
] | null | null | null | nn/optim/optimizer.py | dimaischenko/nn | a7f5887ec816e6b3bbfc57e6864ab3ae320161a6 | [
"Apache-2.0"
] | null | null | null | class Optimizer(object):
"""Base abstract class for all optimizers
Get network parameters and its gradients and
create steps
"""
def __init__(self, params, grad_params):
self.params = params
self.grad_params = grad_params
def step(self):
pass
| 21 | 48 | 0.64966 | class Optimizer(object):
def __init__(self, params, grad_params):
self.params = params
self.grad_params = grad_params
def step(self):
pass
| true | true |
f72a5c44fcb11c06bc86b2be7515980898efe20d | 2,349 | py | Python | tests/conftest.py | madkote/rasa-nlu-contrib | 38804da8a1debb172a3ad06a9b867a0ae8ee9b59 | [
"Apache-2.0"
] | 18 | 2019-05-07T10:28:32.000Z | 2022-01-22T02:30:30.000Z | tests/conftest.py | madkote/rasa-nlu-contrib | 38804da8a1debb172a3ad06a9b867a0ae8ee9b59 | [
"Apache-2.0"
] | 2 | 2019-06-14T17:57:27.000Z | 2020-11-30T02:39:39.000Z | tests/conftest.py | madkote/rasa-nlu-contrib | 38804da8a1debb172a3ad06a9b867a0ae8ee9b59 | [
"Apache-2.0"
] | 15 | 2019-03-18T02:21:13.000Z | 2022-01-22T02:32:19.000Z | import logging
import os
import pytest
from rasa_nlu import data_router, config
from rasa_nlu.components import ComponentBuilder
from rasa_nlu.model import Trainer
from rasa_nlu.utils import zip_folder
from rasa_nlu import training_data
logging.basicConfig(level="DEBUG")
CONFIG_DEFAULTS_PATH = "sample_configs/config... | 28.646341 | 79 | 0.707961 | import logging
import os
import pytest
from rasa_nlu import data_router, config
from rasa_nlu.components import ComponentBuilder
from rasa_nlu.model import Trainer
from rasa_nlu.utils import zip_folder
from rasa_nlu import training_data
logging.basicConfig(level="DEBUG")
CONFIG_DEFAULTS_PATH = "sample_configs/config... | true | true |
f72a5c88f96eb156e3a5960ef301b4efb90b71f7 | 7,657 | py | Python | models/resnet_imagenet.py | huawei-noah/Disout | dd4a131ee27043fd3da638056808216944722336 | [
"BSD-3-Clause"
] | 222 | 2020-05-19T04:41:44.000Z | 2022-03-25T20:31:01.000Z | models/resnet_imagenet.py | huawei-noah/Disout | dd4a131ee27043fd3da638056808216944722336 | [
"BSD-3-Clause"
] | 13 | 2020-05-19T09:01:40.000Z | 2020-12-02T06:15:29.000Z | models/resnet_imagenet.py | huawei-noah/Disout | dd4a131ee27043fd3da638056808216944722336 | [
"BSD-3-Clause"
] | 40 | 2020-05-19T07:08:55.000Z | 2022-03-14T00:21:03.000Z | #Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... | 39.673575 | 227 | 0.614079 |
import torch.nn as nn
import math
import sys
sys.path.append("..")
from disout import Disout,LinearScheduler
dploc = [73, 77, 81, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 173,177, 181, 188, 192, 196, 200, 204, 208, 212]
convloc =[75, 79, 90, 90, 94, ... | true | true |
f72a5cd00105d9d13c7915d5db1087ad43337300 | 237 | py | Python | src/fecc_object/ConstantObject.py | castor91/fecc | bc46059c0d7a428d15b95050b70dec374b4bea28 | [
"MIT"
] | 1 | 2018-02-04T14:48:15.000Z | 2018-02-04T14:48:15.000Z | src/fecc_object/ConstantObject.py | castor91/fecc | bc46059c0d7a428d15b95050b70dec374b4bea28 | [
"MIT"
] | null | null | null | src/fecc_object/ConstantObject.py | castor91/fecc | bc46059c0d7a428d15b95050b70dec374b4bea28 | [
"MIT"
] | null | null | null | from AbstractObject import *
class ConstantObject(AbstractObject):
def __init__(self, value):
super(ConstantObject, self).__init__(value._value)
def generate(self, out_code):
out_code.append(PUSH(self._value))
| 23.7 | 58 | 0.7173 | from AbstractObject import *
class ConstantObject(AbstractObject):
def __init__(self, value):
super(ConstantObject, self).__init__(value._value)
def generate(self, out_code):
out_code.append(PUSH(self._value))
| true | true |
f72a5d57fc6b542d719802c50c2de09ed475adb4 | 265 | py | Python | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_pattern_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_pattern_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/g_month_day/schema_instance/nistschema_sv_iv_atomic_g_month_day_pattern_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.g_month_day.schema_instance.nistschema_sv_iv_atomic_g_month_day_pattern_2_xsd.nistschema_sv_iv_atomic_g_month_day_pattern_2 import NistschemaSvIvAtomicGMonthDayPattern2
__all__ = [
"NistschemaSvIvAtomicGMonthDayPattern2",
]
| 44.166667 | 204 | 0.898113 | from output.models.nist_data.atomic.g_month_day.schema_instance.nistschema_sv_iv_atomic_g_month_day_pattern_2_xsd.nistschema_sv_iv_atomic_g_month_day_pattern_2 import NistschemaSvIvAtomicGMonthDayPattern2
__all__ = [
"NistschemaSvIvAtomicGMonthDayPattern2",
]
| true | true |
f72a5db6ab6073da6de701cf534352393ace0f69 | 3,681 | py | Python | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/logistic_regression_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | 1 | 2021-09-23T12:23:02.000Z | 2021-09-23T12:23:02.000Z | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/logistic_regression_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | ml_source/src/blocktorch/blocktorch/pipelines/components/estimators/classifiers/logistic_regression_classifier.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | """Logistic Regression Classifier."""
import numpy as np
from sklearn.linear_model import LogisticRegression as SKLogisticRegression
from skopt.space import Real
from blocktorch.model_family import ModelFamily
from blocktorch.pipelines.components.estimators import Estimator
from blocktorch.problem_types import Problem... | 40.01087 | 166 | 0.640315 | import numpy as np
from sklearn.linear_model import LogisticRegression as SKLogisticRegression
from skopt.space import Real
from blocktorch.model_family import ModelFamily
from blocktorch.pipelines.components.estimators import Estimator
from blocktorch.problem_types import ProblemTypes
class LogisticRegressionClassi... | true | true |
f72a5eb729d896a5a7b9e4172a18b461bd416d06 | 953 | py | Python | app/programs/original/rain.py | mike-wendt/unicorn-remote | e649c069482446f08b0baf579de05f065ad7ab89 | [
"MIT"
] | 37 | 2017-07-30T16:43:22.000Z | 2021-12-12T09:40:11.000Z | app/programs/original/rain.py | kfechter/unicorn-remote | 39466cad9e7420b51ffa11fa7554756a934f2d24 | [
"MIT"
] | 7 | 2017-11-18T19:22:18.000Z | 2021-09-08T15:59:00.000Z | app/programs/original/rain.py | kfechter/unicorn-remote | 39466cad9e7420b51ffa11fa7554756a934f2d24 | [
"MIT"
] | 8 | 2018-04-21T05:31:40.000Z | 2020-12-09T19:43:32.000Z | import unicornhat as unicorn
import time, colorsys
import random
def run(params):
m = [[0 for i in range(8)] for i in range(8)]
while True:
if 1 in m[-1]:
top = [0.5 * i for i in m[-1]]
elif 0.5 in m[-1]:
top = [0] * 8
else:
top = [random.randint(0,... | 28.878788 | 73 | 0.408185 | import unicornhat as unicorn
import time, colorsys
import random
def run(params):
m = [[0 for i in range(8)] for i in range(8)]
while True:
if 1 in m[-1]:
top = [0.5 * i for i in m[-1]]
elif 0.5 in m[-1]:
top = [0] * 8
else:
top = [random.randint(0,... | true | true |
f72a5f267601807387faccbf297e7207c244bae9 | 7,613 | py | Python | GPyOpt/util/general.py | komorihi/GPyOpt | 5c8424f92ffaa745d3daebca3f38de2569500d6d | [
"BSD-3-Clause"
] | null | null | null | GPyOpt/util/general.py | komorihi/GPyOpt | 5c8424f92ffaa745d3daebca3f38de2569500d6d | [
"BSD-3-Clause"
] | null | null | null | GPyOpt/util/general.py | komorihi/GPyOpt | 5c8424f92ffaa745d3daebca3f38de2569500d6d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy.special import erfc
import time
from ..core.errors import InvalidConfigError
def compute_integrated_acquisition(acquisition,x):
'''
Used to compute the acquisition function when s... | 29.507752 | 141 | 0.652305 |
import numpy as np
from scipy.special import erfc
import time
from ..core.errors import InvalidConfigError
def compute_integrated_acquisition(acquisition,x):
acqu_x = 0
for i in range(acquisition.model.num_hmc_samples):
acquisition.model.model.kern[:] = acquisition.model.hmc_samples[i,:]
acq... | true | true |
f72a6096610e02f8d2fd5a97a6ffa630d71313b8 | 167 | py | Python | usuario/admin.py | UNIZAR-30226-2021-05/Lector--Backend | 8cc285216972f7485781ece51a88d5f02dc85013 | [
"MIT"
] | null | null | null | usuario/admin.py | UNIZAR-30226-2021-05/Lector--Backend | 8cc285216972f7485781ece51a88d5f02dc85013 | [
"MIT"
] | null | null | null | usuario/admin.py | UNIZAR-30226-2021-05/Lector--Backend | 8cc285216972f7485781ece51a88d5f02dc85013 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Usuario, Preferencias
admin.site.register(Usuario)
admin.site.register(Preferencias) | 27.833333 | 41 | 0.826347 | from django.contrib import admin
from .models import Usuario, Preferencias
admin.site.register(Usuario)
admin.site.register(Preferencias) | true | true |
f72a6262313ce7497db5b2c9b1f07193731722d5 | 56,933 | gyp | Python | node_modules/nodegit/vendor/libgit2.gyp | nodeframe/dite | bfe7d02af159b39b42a2c88fde4ce369db021c85 | [
"MIT"
] | 12 | 2016-08-19T23:21:41.000Z | 2022-02-17T13:40:25.000Z | vendor/libgit2.gyp | Acidburn0zzz/nodegit | b4e85cd641ebf537edfe2f41f4687057bc517c02 | [
"MIT"
] | null | null | null | vendor/libgit2.gyp | Acidburn0zzz/nodegit | b4e85cd641ebf537edfe2f41f4687057bc517c02 | [
"MIT"
] | 8 | 2015-10-24T11:57:55.000Z | 2022-02-15T15:05:11.000Z | {
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"variables": {
"target_arch%": "x86",
"library%": "static_library",
"openssl_enable_asm%": 0, # only supported with the Visual Studi... | 40.753758 | 112 | 0.572216 | {
"variables": {
"target_arch%": "x86",
"library%": "static_library",
"openssl_enable_asm%": 0, "gcc_version%": 0,
"is_clang%": 0,
},
"targets": [
{
"target_name": "libgit2",
"type": "static_library",
"defines": [
"GIT_THREADS",
"GIT_SSH",
... | true | true |
f72a63ada453874531a4aa783d0ef1b05af45aff | 21,710 | py | Python | tests/engine/cloud/test_cloud_flows.py | tedmiston/prefect | a2cb40c28c942b1d170db42a55bab99598a4dcd6 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-10T14:32:32.000Z | 2020-05-10T14:32:32.000Z | tests/engine/cloud/test_cloud_flows.py | tedmiston/prefect | a2cb40c28c942b1d170db42a55bab99598a4dcd6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/engine/cloud/test_cloud_flows.py | tedmiston/prefect | a2cb40c28c942b1d170db42a55bab99598a4dcd6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import datetime
import sys
import uuid
from collections import Counter, namedtuple
from unittest.mock import MagicMock
import pendulum
import pytest
import prefect
from prefect.client.client import Client, FlowRunInfoResult, TaskRunInfoResult
from prefect.engine.cloud import CloudFlowRunner, CloudTaskRunner
from pref... | 33.094512 | 89 | 0.643574 | import datetime
import sys
import uuid
from collections import Counter, namedtuple
from unittest.mock import MagicMock
import pendulum
import pytest
import prefect
from prefect.client.client import Client, FlowRunInfoResult, TaskRunInfoResult
from prefect.engine.cloud import CloudFlowRunner, CloudTaskRunner
from pref... | true | true |
f72a6472f11d4bd876bdf957708a3a20931e06da | 10,074 | py | Python | scripts/fishnet_generator.py | dgketchum/gsflow-arcpy | 966e8f48e0fee1ba534fc6a64987f67594b144f2 | [
"Apache-2.0"
] | 13 | 2018-09-12T17:42:48.000Z | 2022-03-18T20:14:45.000Z | scripts/fishnet_generator.py | dgketchum/gsflow-arcpy | 966e8f48e0fee1ba534fc6a64987f67594b144f2 | [
"Apache-2.0"
] | 35 | 2018-03-08T16:20:07.000Z | 2020-11-05T11:59:05.000Z | scripts/fishnet_generator.py | dgketchum/gsflow-arcpy | 966e8f48e0fee1ba534fc6a64987f67594b144f2 | [
"Apache-2.0"
] | 12 | 2018-08-18T20:54:56.000Z | 2022-03-26T00:04:45.000Z | #--------------------------------
# Name: fishnet_generator.py
# Purpose: GSFLOW fishnet generator
# Notes: ArcGIS 10.2+ Version
# Python: 2.7
#--------------------------------
import argparse
import ConfigParser
import datetime as dt
from decimal import Decimal
import logging
imp... | 37.730337 | 83 | 0.629839 |
import argparse
import ConfigParser
import datetime as dt
from decimal import Decimal
import logging
import os
import sys
import arcpy
from arcpy import env
import support_functions as support
def fishnet_func(config_path, overwrite_flag=False):
hru = support.HRUParameters(config_path)
... | true | true |
f72a6574f160f049bb1e251b53b255e19fcb01c4 | 2,448 | py | Python | test/functional/p2p_addrv2_relay.py | PivxLiteDev/PivxLite | 648d4a193b61b1996b41e9f6c6c468875c757cdd | [
"MIT"
] | null | null | null | test/functional/p2p_addrv2_relay.py | PivxLiteDev/PivxLite | 648d4a193b61b1996b41e9f6c6c468875c757cdd | [
"MIT"
] | 3 | 2020-02-06T10:15:07.000Z | 2022-01-13T00:08:49.000Z | test/functional/p2p_addrv2_relay.py | PivxLiteDev/PivxLite | 648d4a193b61b1996b41e9f6c6c468875c757cdd | [
"MIT"
] | 9 | 2020-03-10T14:14:25.000Z | 2022-03-05T13:43:35.000Z | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test addrv2 relay
"""
import time
from test_framework.messages import (
CAddress,
msg_addrv2,
... | 30.987342 | 90 | 0.664216 |
import time
from test_framework.messages import (
CAddress,
msg_addrv2,
NODE_NETWORK
)
from test_framework.mininode import P2PInterface
from test_framework.test_framework import PivxlTestFramework
from test_framework.util import assert_equal
ADDRS = []
for i in range(10):
addr = CAddress()
addr.t... | true | true |
f72a65ddec02cb6954334890b87a93ad0a175bef | 257 | py | Python | Akeso/Exploits/ExploitFrame.py | tamuctf/Akeso | 05e6c284b45e1d1ec2d744a8508c9b03e3b5718e | [
"MIT"
] | 19 | 2018-02-26T00:19:17.000Z | 2019-12-18T04:26:45.000Z | Akeso/Exploits/ExploitFrame.py | tamuctf/Akeso | 05e6c284b45e1d1ec2d744a8508c9b03e3b5718e | [
"MIT"
] | 11 | 2018-05-07T15:11:30.000Z | 2018-11-13T16:40:41.000Z | DefenseLab/Exploits/ExploitFrame.py | ameserole/Defense-Lab | 05d89eecd52e76c00f6aa3ab0eaaff85fad88dbb | [
"MIT"
] | 2 | 2019-12-11T07:28:48.000Z | 2021-05-30T07:41:57.000Z |
class ExploitFrame(object):
"""Exploit object"""
def __init__(self, serviceInfo):
self.serviceInfo = serviceInfo
def exploit(self):
raise NotImplementedError()
def exploitSuccess(self):
raise NotImplementedError()
| 21.416667 | 38 | 0.66537 |
class ExploitFrame(object):
def __init__(self, serviceInfo):
self.serviceInfo = serviceInfo
def exploit(self):
raise NotImplementedError()
def exploitSuccess(self):
raise NotImplementedError()
| true | true |
f72a66542ace53e924c25a5a10a82214486982d6 | 3,365 | py | Python | SQSConnection.py | jmartipu/CrearSolicitudDispatcher | 3b9c46f5f4a07fe96c98846c7f48d802203e8cee | [
"Apache-2.0"
] | null | null | null | SQSConnection.py | jmartipu/CrearSolicitudDispatcher | 3b9c46f5f4a07fe96c98846c7f48d802203e8cee | [
"Apache-2.0"
] | null | null | null | SQSConnection.py | jmartipu/CrearSolicitudDispatcher | 3b9c46f5f4a07fe96c98846c7f48d802203e8cee | [
"Apache-2.0"
] | null | null | null | import boto3
import botocore
import Settings
class SQSConnection:
session = boto3.Session(
aws_access_key_id=Settings.AWS_ACCESS_KEY_ID_SQS,
aws_secret_access_key=Settings.AWS_SECRET_ACCESS_KEY_SQS,
)
sqs = session.client('sqs', region_name=Settings.AWS_REGION_SQS)
... | 31.157407 | 86 | 0.556612 | import boto3
import botocore
import Settings
class SQSConnection:
session = boto3.Session(
aws_access_key_id=Settings.AWS_ACCESS_KEY_ID_SQS,
aws_secret_access_key=Settings.AWS_SECRET_ACCESS_KEY_SQS,
)
sqs = session.client('sqs', region_name=Settings.AWS_REGION_SQS)
... | true | true |
f72a674b8b8017122951cbd31901aa9c70d1de59 | 10,984 | py | Python | insights/parsers/systemd/unitfiles.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/systemd/unitfiles.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/systemd/unitfiles.py | haithcockce/insights-core | b2e197c6bfc25bcbe2926f07c35a80f2cf8232f5 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | """
Units Manged By Systemctl (services)
====================================
Parsers included in this module are:
ListUnits - command ``/bin/systemctl list-units``
-------------------------------------------------
UnitFiles - command ``/bin/systemctl list-unit-files``
-----------------------------------------------... | 37.745704 | 157 | 0.584578 | from .. import get_active_lines
from ... import Parser, parser
from insights.specs import Specs
from insights.parsers import SkipException
@parser(Specs.systemctl_list_unit_files)
class UnitFiles(Parser):
def __init__(self, *args, **kwargs):
self.services = {}
self.service_list = []
self.... | true | true |
f72a681dedfbe58c031e09445ad13611853eefec | 5,987 | py | Python | tests/test_public_client.py | shanefontaine/ethfinex-python | a883eb8e72d1c87156db62adbc5f95bb82fa5371 | [
"MIT"
] | 7 | 2018-12-25T09:55:40.000Z | 2021-05-14T04:23:44.000Z | tests/test_public_client.py | shanefontaine/ethfinex-python | a883eb8e72d1c87156db62adbc5f95bb82fa5371 | [
"MIT"
] | 4 | 2019-03-08T09:37:35.000Z | 2021-06-01T23:12:31.000Z | tests/test_public_client.py | shanefontaine/ethfinex-python | a883eb8e72d1c87156db62adbc5f95bb82fa5371 | [
"MIT"
] | 1 | 2021-04-24T01:11:01.000Z | 2021-04-24T01:11:01.000Z | import pytest
import time
from ethfinex.public_client import PublicClient
@pytest.fixture(scope='module')
def client():
return PublicClient()
@pytest.mark.usefixtures('client')
class TestPublicClient(object):
@staticmethod
def teardown_method():
time.sleep(.5) # Avoid rate limit
def test... | 36.730061 | 86 | 0.525639 | import pytest
import time
from ethfinex.public_client import PublicClient
@pytest.fixture(scope='module')
def client():
return PublicClient()
@pytest.mark.usefixtures('client')
class TestPublicClient(object):
@staticmethod
def teardown_method():
time.sleep(.5)
def test_get_platform_statu... | true | true |
f72a687a337167c96e7903a7bdd07f5ced99b8a8 | 3,743 | py | Python | src/federatedid/federated.py | dawidkski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 1 | 2021-12-23T14:00:36.000Z | 2021-12-23T14:00:36.000Z | src/federatedid/federated.py | dawidkski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 6 | 2021-01-12T13:40:31.000Z | 2022-03-12T00:31:27.000Z | src/federatedid/federated.py | d-kicinski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 1 | 2020-05-12T03:11:07.000Z | 2020-05-12T03:11:07.000Z | import copy
from dataclasses import dataclass
from typing import List, Optional
import torch
from torch.nn import CrossEntropyLoss, Module
from torch.utils.data import DataLoader
def federated_averaging(models: List[Module]) -> Module:
global_model = copy.deepcopy(models[0])
global_weights = global_model.sta... | 29.944 | 87 | 0.627304 | import copy
from dataclasses import dataclass
from typing import List, Optional
import torch
from torch.nn import CrossEntropyLoss, Module
from torch.utils.data import DataLoader
def federated_averaging(models: List[Module]) -> Module:
global_model = copy.deepcopy(models[0])
global_weights = global_model.sta... | true | true |
f72a688feda53838c2dd09e2907fbb42d5bc0c1c | 1,667 | py | Python | tests/bugs/core_3474_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3474_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3474_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_3474
# title: Regression in joins on procedures
# decription:
# tracker_id: CORE-3474
# min_versions: ['2.5.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 3.0
# resources: None
substituti... | 24.514706 | 71 | 0.617277 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = [('-At line.*', '')]
init_script_1 = """"""
db_1 = db_factory(from_backup='employee-ods12.fbk', init=init_script_1)
test_script_1 = """
set list on;
select e.emp_no emp_1, e.last_name name_1, p.proj_name proj_1
from e... | true | true |
f72a6990f0aad8249f5dc016a2590edf77f57c03 | 4,224 | py | Python | mainapp/controllers/forms.py | fabiocostapro/fiberappz | da73569fa03e0b731b5ec2c96a0ee668f8b10ef6 | [
"MIT"
] | null | null | null | mainapp/controllers/forms.py | fabiocostapro/fiberappz | da73569fa03e0b731b5ec2c96a0ee668f8b10ef6 | [
"MIT"
] | null | null | null | mainapp/controllers/forms.py | fabiocostapro/fiberappz | da73569fa03e0b731b5ec2c96a0ee668f8b10ef6 | [
"MIT"
] | null | null | null | from wtforms import Form
from wtforms import StringField, PasswordField
from wtforms.fields.html5 import EmailField
from wtforms import validators
from mainapp.models.tables import User
class UserCreateForm(Form):
username = StringField("Usuário",
[
valida... | 45.419355 | 114 | 0.482244 | from wtforms import Form
from wtforms import StringField, PasswordField
from wtforms.fields.html5 import EmailField
from wtforms import validators
from mainapp.models.tables import User
class UserCreateForm(Form):
username = StringField("Usuário",
[
valida... | true | true |
f72a6add468392d9b7eca586307a71cb8213bc22 | 10,197 | py | Python | api/team/tests/test_update.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | api/team/tests/test_update.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T17:31:08.000Z | 2022-03-11T23:16:12.000Z | api/team/tests/test_update.py | BerniWittmann/beachanmeldung | 9014dea5c31ea9e26f18d753d8d836741865c38e | [
"Unlicense",
"MIT"
] | null | null | null | import json
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone
from django.utils.translation import activate
from rest_framework.test import APIClient
from rest_framework_jwt.settings import api_settings
from api.accounts.models import MyUser
from api.team.... | 44.142857 | 83 | 0.531529 | import json
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone
from django.utils.translation import activate
from rest_framework.test import APIClient
from rest_framework_jwt.settings import api_settings
from api.accounts.models import MyUser
from api.team.... | true | true |
f72a6bc23ff8f5945f5bfef16d9ffa3a49b4878d | 2,563 | py | Python | setup.py | ianhuang0630/CSQ | 5f1fe99a8d9da73692643b3911d675dce269a03d | [
"MIT"
] | 98 | 2019-04-05T08:22:38.000Z | 2022-03-29T06:22:17.000Z | setup.py | ianhuang0630/CSQ | 5f1fe99a8d9da73692643b3911d675dce269a03d | [
"MIT"
] | 19 | 2019-06-28T20:26:01.000Z | 2022-03-03T16:26:57.000Z | setup.py | ianhuang0630/CSQ | 5f1fe99a8d9da73692643b3911d675dce269a03d | [
"MIT"
] | 26 | 2019-04-15T00:54:06.000Z | 2022-02-22T23:17:24.000Z | """Setup learnable_primitives"""
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
from itertools import dropwhile
import numpy as np
from os import path
def collect_docstring(lines):
"""Return document docstring if it exists"""
lines = dropwhile(l... | 26.42268 | 70 | 0.55833 |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
from itertools import dropwhile
import numpy as np
from os import path
def collect_docstring(lines):
lines = dropwhile(lambda x: not x.startswith('"""'), lines)
doc = ""
for line in lines:
... | true | true |
f72a6c18f2dd71bf7e6d4454aa80d63e9fbe8e63 | 522 | py | Python | Season 06 - Files in Python/Episode 12 - Imports Error & running as Python Scripts/Episode 12 - Imports Error & running as Python Scripts.py | Pythobit/Python-tutorial | b0743eaa9c237c3578131ead1b3f2c295f11b7ee | [
"MIT"
] | 3 | 2021-02-19T18:33:00.000Z | 2021-08-03T14:56:50.000Z | Season 06 - Files in Python/Episode 12 - Imports Error & running as Python Scripts/Episode 12 - Imports Error & running as Python Scripts.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-07-10T14:37:57.000Z | 2021-07-20T09:51:39.000Z | Season 06 - Files in Python/Episode 12 - Imports Error & running as Python Scripts/Episode 12 - Imports Error & running as Python Scripts.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-08-02T05:39:38.000Z | 2021-08-02T05:39:38.000Z | # Imports Error & running as Python Scripts.
"""
IMPORT ERROR
if your module is already imported, you can import it the same way, but if you want to access something inside in it,
python will look into the module & give you an error because it's going to be back n forth,
called `circular import` [bad thing]
"""
"""
... | 26.1 | 117 | 0.701149 | true | true | |
f72a6cb5cc483a8ad619bf7be7299edfe87310a0 | 592 | py | Python | testing/test_is_infected.py | GalBenZvi/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | 1 | 2020-07-15T07:11:55.000Z | 2020-07-15T07:11:55.000Z | testing/test_is_infected.py | Hershkovitz-hub/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | 2 | 2021-06-08T22:07:26.000Z | 2021-09-08T02:22:40.000Z | testing/test_is_infected.py | GalBenZvi/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | null | null | null | from epidemic_simulation.simulation import SimulationManager
import pytest
@pytest.fixture
def test_data():
test_calc=SimulationManager([],{'infection_r':100,'infection_p':0.99,'sickness_duration':6})
return test_calc
def test_infection_prob_between_0_1(test_data):
"""
infection_prob must be between 0... | 26.909091 | 96 | 0.682432 | from epidemic_simulation.simulation import SimulationManager
import pytest
@pytest.fixture
def test_data():
test_calc=SimulationManager([],{'infection_r':100,'infection_p':0.99,'sickness_duration':6})
return test_calc
def test_infection_prob_between_0_1(test_data):
try:
test_data.infection_prob=-0... | true | true |
f72a6dcb2a0ebf8ec3765416a9db9ad3c3e0ae5e | 1,253 | py | Python | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 3 | 2021-04-23T05:06:23.000Z | 2021-09-03T21:10:25.000Z | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 1 | 2021-12-14T15:21:16.000Z | 2021-12-14T15:21:16.000Z | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 1 | 2022-03-29T08:03:25.000Z | 2022-03-29T08:03:25.000Z | from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
"""Compute recall at the masked position
"""
mask = pred.label_ids != -100
# filter everything except the masked position and flatten tensor... | 31.325 | 99 | 0.581006 | from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
mask = pred.label_ids != -100
labels = pred.label_ids[mask].flatten()
preds = pred.predictions[mask].flatten()
_, recall, _, _ = precisi... | true | true |
f72a6ec3d3794ebec344131fa4c80510f1e78360 | 2,375 | py | Python | VORDInstance.py | Daviddddl/i3d_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | 3 | 2019-03-15T14:28:57.000Z | 2020-06-18T04:00:46.000Z | VORDInstance.py | Daviddddl/i3d_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | 1 | 2020-04-01T22:24:07.000Z | 2020-04-01T22:24:07.000Z | VORDInstance.py | Daviddddl/I3D_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | null | null | null |
class VORDInstance:
def __init__(self, video_id, video_path, frame_count, fps, width, height,
subject_objects, trajectories, relation_instances):
self.video_id = video_id
self.video_path = video_path
self.frame_count = frame_count
self.fps = fps
self.height... | 36.538462 | 77 | 0.586105 |
class VORDInstance:
def __init__(self, video_id, video_path, frame_count, fps, width, height,
subject_objects, trajectories, relation_instances):
self.video_id = video_id
self.video_path = video_path
self.frame_count = frame_count
self.fps = fps
self.height... | true | true |
f72a6f1a0b1f6bc7143103cd94ad22fb05c13141 | 334 | py | Python | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | 3 | 2015-03-12T15:50:58.000Z | 2015-05-04T12:55:19.000Z | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | 2 | 2015-05-01T18:24:04.000Z | 2015-05-15T15:58:47.000Z | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# init all the extensions instances
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask_debugtoolbar import DebugToolbarExtension
toolbar = DebugToolb... | 18.555556 | 52 | 0.778443 | from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask_debugtoolbar import DebugToolbarExtension
toolbar = DebugToolbarExtension()
| true | true |
f72a7184ee9e741944510976bfd4ac5d2d98ed14 | 9,090 | py | Python | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 17 | 2017-06-29T16:48:56.000Z | 2021-10-03T18:31:41.000Z | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 4 | 2018-05-29T08:21:13.000Z | 2021-04-01T01:28:50.000Z | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 8 | 2019-06-10T22:19:40.000Z | 2022-01-12T20:55:37.000Z | from math import factorial
import scipy.special
import numpy as np
def sloppy_spherical(y):
r = np.linalg.norm(y)
costheta = y[2] / r
theta = np.arccos(costheta)
phi = np.arccos(y[0] / r / np.sin(theta))
return r, theta, phi
def Rdirect(n_max, y):
r, theta, phi = sloppy_spherical(y)
real =... | 34.431818 | 103 | 0.394719 | from math import factorial
import scipy.special
import numpy as np
def sloppy_spherical(y):
r = np.linalg.norm(y)
costheta = y[2] / r
theta = np.arccos(costheta)
phi = np.arccos(y[0] / r / np.sin(theta))
return r, theta, phi
def Rdirect(n_max, y):
r, theta, phi = sloppy_spherical(y)
real =... | true | true |
f72a71fdb4445df86e6a963308c53723cb7372ed | 43 | py | Python | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | # import pandas as pd
# import numpy as np
| 14.333333 | 21 | 0.72093 | true | true | |
f72a72d605a3a44af713856c6084a9b2d5e7bef2 | 6,046 | py | Python | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | import torch
class Attack(object):
r"""
Base class for all attacks.
.. note::
It automatically set device to the device where given model is.
It temporarily changes the original model's training mode to `test`
by `.eval()` only during an attack process.
"""
def __init__(s... | 28.654028 | 87 | 0.531757 | import torch
class Attack(object):
def __init__(self, name, model):
self.attack = name
self.model = model
self.model_name = str(model).split("(")[0]
self.training = model.training
self.device = next(model.parameters()).device
self._targeted = 1
self._att... | true | true |
f72a72f956c5cffe74f5d5fac3101a4868adb5bf | 28,213 | py | Python | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | 4 | 2017-11-28T08:12:58.000Z | 2020-10-28T04:15:52.000Z | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2004-Present VMware, Inc. or its affiliates.
This program and the accompanying materials are made available under
the terms of the 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://ww... | 41.007267 | 193 | 0.543296 |
import pg
import os
import subprocess
import re
import multiprocessing
import tempfile
import time
import sys
import socket
from optparse import OptionParser
import traceback
def is_digit(n):
try:
int(n)
return True
except ValueError:
return False
def null_notice_receiver(notice):
... | true | true |
f72a7465c1ba7ec4989c9a8c22e6229787aa0733 | 18,818 | py | Python | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.349515 | 710 | 0.806515 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', '... | true | true |
f72a759aa3a375cf215b4b215a8f91d36710c4d8 | 316 | py | Python | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from checkv.modules import (
download_database,
update_database,
contamination,
completeness,
complete_genomes,
quality_summary,
end_to_end,
)
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
__version__ = metadata.version("checkv")
| 18.588235 | 41 | 0.740506 | from checkv.modules import (
download_database,
update_database,
contamination,
completeness,
complete_genomes,
quality_summary,
end_to_end,
)
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
__version__ = metadata.version("checkv")
| true | true |
f72a75e5797e4be5ac376e8272c48fbbb2970c1a | 126 | py | Python | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | from .getColor import *
from .getDecile import *
from .getPercentile import *
from .getStateName import *
from .path import *
| 21 | 28 | 0.761905 | from .getColor import *
from .getDecile import *
from .getPercentile import *
from .getStateName import *
from .path import *
| true | true |
f72a7713a14d8330970b9d00cd1d55249c858748 | 2,944 | py | Python | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | 1 | 2020-01-15T03:57:25.000Z | 2020-01-15T03:57:25.000Z | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | 3 | 2019-11-26T00:23:21.000Z | 2019-11-29T19:07:56.000Z | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | null | null | null | NAME = "complicated-wires"
import curses
from defusekit import wards
from defusekit.kittypes import Window
def get_instruction(red: bool, blue: bool, star: bool, led: bool) -> str:
binstr = "".join(["1" if b else "0" for b in (red, blue, star, led)])
wirestate = int(binstr, 2)
C = "Cut the wire"
D =... | 29.737374 | 73 | 0.53159 | NAME = "complicated-wires"
import curses
from defusekit import wards
from defusekit.kittypes import Window
def get_instruction(red: bool, blue: bool, star: bool, led: bool) -> str:
binstr = "".join(["1" if b else "0" for b in (red, blue, star, led)])
wirestate = int(binstr, 2)
C = "Cut the wire"
D =... | true | true |
f72a784ed40b4a7d44700220e01f993eed20a5e0 | 1,277 | py | Python | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | # Problem 4: Largest palindrome product
# A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
# Find the largest palindrome made from the product of two 3-digit numbers.
num = 999 # Numbers start from 999
num2 = 999
palindrome = [] # Sto... | 55.521739 | 135 | 0.696163 |
num = 999 num2 = 999
palindrome = [] while num != 99: while num2 != 99: result = num*num2 orignal = result result = str(result) result= list(result)
result.reverse() result = ''.join(result) result = int(result) if result == orignal: pali... | true | true |
f72a78f9746119f4da8555bf50e0ea8d48a5abbe | 13,660 | py | Python | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | """
HiddenLayer
Implementation of the Graph class. A framework independent directed graph to
represent a neural network.
Written by Waleed Abdulla. Additions by Phil Ferriere.
Licensed under the MIT License
"""
from __future__ import absolute_import, division, print_function
import os
import re
from random import get... | 37.01897 | 119 | 0.553075 | from __future__ import absolute_import, division, print_function
import os
import re
from random import getrandbits
import inspect
import numpy as np
THEMES = {
"basic": {
"background_color": "#FFFFFF",
"fill_color": "#E8E8E8",
"outline_color": "#000000",
"font_color": "#000000",
... | true | true |
f72a79a9ba5f4c1690d21261e6cc829e1ab1cdfe | 17,260 | py | Python | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | 1 | 2022-03-05T14:50:48.000Z | 2022-03-05T14:50:48.000Z | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | null | null | null | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | null | null | null | # greaseweazle/usb.py
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct
import itertools as it
from greaseweazle import version
from greaseweazle ... | 32.081784 | 79 | 0.554693 |
import struct
import itertools as it
from greaseweazle import version
from greaseweazle import error
from greaseweazle.flux import Flux
class ControlCmd:
ClearComms = 10000
Normal = 9600
class Cmd:
GetInfo = 0
Update = 1
Seek = 2
Side ... | true | true |
f72a79d3d2c56e71938e0ba2cdbc1fa44b6c0c29 | 3,576 | py | Python | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z |
import ops.cmd
import util.ip
DATA_TYPES = ['all', 'browser', 'cache', 'expensive', 'icmp', 'ip', 'jobobject', 'jobobjectdetails', 'logicaldisk', 'memory', 'networkinterface', 'objects', 'pagingfile', 'physicaldisk', 'process', 'processor', 'system', 'tcp', 'telephony', 'terminalservices', 'thread', 'udp']
class... | 44.148148 | 278 | 0.635906 |
import ops.cmd
import util.ip
DATA_TYPES = ['all', 'browser', 'cache', 'expensive', 'icmp', 'ip', 'jobobject', 'jobobjectdetails', 'logicaldisk', 'memory', 'networkinterface', 'objects', 'pagingfile', 'physicaldisk', 'process', 'processor', 'system', 'tcp', 'telephony', 'terminalservices', 'thread', 'udp']
class... | true | true |
f72a79de3ba6052a6dc1da390b52adbd516b2242 | 19,851 | py | Python | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... | 37.596591 | 137 | 0.622236 | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... | true | true |
f72a7bae230cca8397b711afd302b87ab9ee0214 | 995 | py | Python | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | """
Co-citation Network / Degree Plot
===============================================================================
>>> from techminer2 import *
>>> directory = "/workspaces/techminer2/data/"
>>> file_name = "/workspaces/techminer2/sphinx/images/co_citation_network_degree_plot.png"
>>> co_citation_network_degree_pl... | 22.613636 | 90 | 0.650251 |
from .co_citation_matrix import co_citation_matrix
from .network import network
from .network_degree_plot import network_degree_plot
def co_citation_network_degree_plot(
top_n=50,
clustering_method="louvain",
figsize=(8, 8),
directory="./",
):
matrix = co_citation_matrix(
top_n=top_n,
... | true | true |
f72a7ebb2f409e0799fadb3a1f5eb1b4ad602fb0 | 7,089 | py | Python | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class QueryCompareResultReq:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ... | 28.700405 | 147 | 0.616871 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class QueryCompareResultReq:
sensitive_list = []
openapi_types = {
'job_id': 'str',
'object_level_compare_id': 'str',
'line_compare_id': 'str',
'content_compare_id': 'str',
... | true | true |
f72a7fa08a350d2bd0ecab68ced86f7e2f4dcc7d | 1,205 | py | Python | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | 1 | 2021-07-26T18:40:15.000Z | 2021-07-26T18:40:15.000Z | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | 24 | 2021-07-10T15:31:05.000Z | 2022-03-17T06:43:36.000Z | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | null | null | null | #cas
def get_infos():
import ti_graphics, ti_system
fnop = lambda : None
screen_w, screen_h, screen_y0, font_w, font_h, poly_set_pixel, poly_fill_rect, poly_draw_ellipse, poly_fill_circle, poly_get_key, poly_draw_string = 320, 210, 30, 10, 15, fnop, fnop, fnop, fnop, ti_system.wait_key, fnop
def poly_fill_... | 41.551724 | 222 | 0.66556 | def get_infos():
import ti_graphics, ti_system
fnop = lambda : None
screen_w, screen_h, screen_y0, font_w, font_h, poly_set_pixel, poly_fill_rect, poly_draw_ellipse, poly_fill_circle, poly_get_key, poly_draw_string = 320, 210, 30, 10, 15, fnop, fnop, fnop, fnop, ti_system.wait_key, fnop
def poly_fill_rect(x... | true | true |
f72a7fd3a97aca945537b27072920ef5265cb56e | 6,666 | py | Python | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | 14 | 2018-10-19T12:32:39.000Z | 2022-01-07T05:06:06.000Z | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | null | null | null | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | 6 | 2019-02-26T13:32:58.000Z | 2021-06-01T15:11:27.000Z | from QUBEKit.ligand import Ligand
import os
import sys
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView
import qdarkstyle
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, molecule=None, parent=None):
super(Ma... | 34.360825 | 118 | 0.659466 | from QUBEKit.ligand import Ligand
import os
import sys
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView
import qdarkstyle
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, molecule=None, parent=None):
super(Ma... | true | true |
f72a8051d6d4870f84f6443fa5863030117e9922 | 12,663 | py | Python | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 38.372727 | 107 | 0.60657 |
from io import BytesIO
import struct
import random
import time
import rmrb_play_ctrl.core.dns.exception
import rmrb_play_ctrl.core.dns.tsig
from ._compat import long
QUESTION = 0
ANSWER = 1
AUTHORITY = 2
ADDITIONAL = 3
class Renderer(object):
def __init__(self, id=None, flags=0, max_size=65535, origin=None... | true | true |
f72a80ec4e6d319a9bd40ffec2bbee1e64fbb6c7 | 16,207 | py | Python | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | import fnmatch, warnings, json, os
import numpy as np
from six import string_types
from tinydb.storages import MemoryStorage
from tinydb import where
from espei.utils import PickleableTinyDB
from espei.core_utils import recursive_map
class DatasetError(Exception):
"""Exception raised when datasets are invalid.""... | 45.144847 | 244 | 0.649596 | import fnmatch, warnings, json, os
import numpy as np
from six import string_types
from tinydb.storages import MemoryStorage
from tinydb import where
from espei.utils import PickleableTinyDB
from espei.core_utils import recursive_map
class DatasetError(Exception):
pass
def check_dataset(dataset):
is_activi... | true | true |
f72a8175c066c50bcc168821cbcb8091f9cd439a | 6,618 | py | Python | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: ipa_service
author: Cédri... | 31.665072 | 110 | 0.636144 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: ipa_service
author: Cédric Parent (@cprh)
short_description: Manage FreeIPA service
description:
- Add and delete an IPA service using IPA API.
options:
krbcanonicalname:
description:
- Pri... | true | true |
f72a82afacbfe8c4a9d386c3c67b25d21ca8d4cb | 3,193 | py | Python | var/spack/repos/builtin/packages/meson/package.py | jjellio/spack | 1fa16c1b9b08119be429821fbd2f3251458d5063 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | var/spack/repos/builtin/packages/meson/package.py | jjellio/spack | 1fa16c1b9b08119be429821fbd2f3251458d5063 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-02-15T01:32:22.000Z | 2022-03-31T06:06:05.000Z | var/spack/repos/builtin/packages/meson/package.py | karcaw/spack | 2b3ca6c3e39f486c9cf277f2ca8fef12d54300c2 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 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 *
class Meson(PythonPackage):
"""Meson is a portable open source build system meant to be both
... | 53.216667 | 96 | 0.757282 |
from spack import *
class Meson(PythonPackage):
homepage = "http://mesonbuild.com/"
url = "https://github.com/mesonbuild/meson/archive/0.49.0.tar.gz"
maintainers = ['michaelkuhn']
version('0.57.1', sha256='0c043c9b5350e9087cd4f6becf6c0d10b1d618ca3f919e0dcca2cdf342360d5d')
version('0.57.0... | true | true |
f72a82e3656b23a98910f3bc1d1712b42ddd274d | 30,279 | py | Python | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 46.726852 | 79 | 0.597114 |
import sys
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import dhcp_rpc
from neutron.api.rpc.handlers import l3_rpc
from neutro... | true | true |
f72a83c49b78622f2d47b7d505eed6ddffe2fe8d | 6,547 | py | Python | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 20 | 2018-04-05T22:06:10.000Z | 2021-09-18T10:43:44.000Z | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | null | null | null | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 5 | 2018-08-06T15:06:04.000Z | 2021-07-16T01:58:43.000Z | from monero_glue.xmr import crypto
from monero_glue.xmr.sub.keccak_hasher import HashWrapper
from monero_serialize import xmrserialize
class PreMlsagHasher(object):
"""
Iterative construction of the pre_mlsag_hash
"""
def __init__(self, state=None):
from monero_glue.xmr.sub.keccak_hasher impo... | 30.882075 | 86 | 0.590805 | from monero_glue.xmr import crypto
from monero_glue.xmr.sub.keccak_hasher import HashWrapper
from monero_serialize import xmrserialize
class PreMlsagHasher(object):
def __init__(self, state=None):
from monero_glue.xmr.sub.keccak_hasher import HashWrapper, KeccakXmrArchive
self.is_simple = state[... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.