hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f1770a43d08d25842268916901c334c97a0cd5 | 931 | py | Python | nibss/bvn.py | Smyja/innovation-sandbox-python | 3d44792e5f9dc1858a0b44704164ecd16f5e04d4 | [
"MIT"
] | 1 | 2020-03-16T13:47:37.000Z | 2020-03-16T13:47:37.000Z | nibss/bvn.py | Devcyclops/innovation-sandbox-python | cdf3d3782be9de643c7191e73d92294de3a20373 | [
"MIT"
] | null | null | null | nibss/bvn.py | Devcyclops/innovation-sandbox-python | cdf3d3782be9de643c7191e73d92294de3a20373 | [
"MIT"
] | null | null | null | from nibss.utils.calls import encrypted_request
from nibss.Nibss import Nibss
from urllib.parse import urljoin
from url import url as BASE_URL
class Bvn(Nibss):
def verify_single(self, data):
URL = urljoin(BASE_URL(self.url), "/nibss/bvnr/VerifySingleBVN")
headers = self.headers
body = dat... | 37.24 | 85 | 0.670247 | from nibss.utils.calls import encrypted_request
from nibss.Nibss import Nibss
from urllib.parse import urljoin
from url import url as BASE_URL
class Bvn(Nibss):
def verify_single(self, data):
URL = urljoin(BASE_URL(self.url), "/nibss/bvnr/VerifySingleBVN")
headers = self.headers
body = dat... | true | true |
08f17745dfa0b2cd6005fc29fd2c2bec7c627dc6 | 3,908 | py | Python | python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_expanding.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 9 | 2019-11-20T09:44:22.000Z | 2021-04-27T09:45:59.000Z | python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_expanding.py | nyingping/spark | ca7200b0008dc6101a252020e6c34ef7b72d81d6 | [
"Apache-2.0"
] | 39 | 2018-09-25T21:57:04.000Z | 2022-03-27T17:34:43.000Z | python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_expanding.py | nyingping/spark | ca7200b0008dc6101a252020e6c34ef7b72d81d6 | [
"Apache-2.0"
] | 10 | 2016-10-12T09:04:47.000Z | 2021-04-29T19:07:20.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 36.185185 | 94 | 0.667349 |
from distutils.version import LooseVersion
import pandas as pd
from pyspark import pandas as ps
from pyspark.pandas.config import set_option, reset_option
from pyspark.testing.pandasutils import PandasOnSparkTestCase, TestUtils
class OpsOnDiffFramesGroupByExpandingTest(PandasOnSparkTestCase, TestUtils):
@class... | true | true |
08f1785b230fa1396d5335fb2d3aea3722620bd1 | 4,956 | py | Python | homeassistant/components/schluter/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2022-02-21T05:50:41.000Z | 2022-02-21T05:50:41.000Z | homeassistant/components/schluter/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | homeassistant/components/schluter/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """Support for Schluter thermostats."""
from __future__ import annotations
import logging
from requests import RequestException
import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA,
SCAN_INTERVAL,
TEMP_CELSIUS,
ClimateEntity,
ClimateEntityFeature,
)
from homeass... | 30.782609 | 88 | 0.692897 | from __future__ import annotations
import logging
from requests import RequestException
import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA,
SCAN_INTERVAL,
TEMP_CELSIUS,
ClimateEntity,
ClimateEntityFeature,
)
from homeassistant.components.climate.const import (... | true | true |
08f1786affbc23ecdb3a6d9c1e1eccf472c40ed6 | 27,275 | py | Python | python/ccxt/cobinhood.py | GZY5409/ccxt | 7f78ca80d6ddf6ff4353eb44e45aeef99cd87a20 | [
"MIT"
] | null | null | null | python/ccxt/cobinhood.py | GZY5409/ccxt | 7f78ca80d6ddf6ff4353eb44e45aeef99cd87a20 | [
"MIT"
] | null | null | null | python/ccxt/cobinhood.py | GZY5409/ccxt | 7f78ca80d6ddf6ff4353eb44e45aeef99cd87a20 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import PermissionDenie... | 38.415493 | 126 | 0.498772 |
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import InvalidNonce
class cobinhood (Exchange):
def describ... | true | true |
08f179308ad8d2b4e0da208313c59ce5eb5b9a9c | 1,418 | py | Python | graphgallery/nn/models/pytorch/gat.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 1 | 2020-07-29T08:00:32.000Z | 2020-07-29T08:00:32.000Z | graphgallery/nn/models/pytorch/gat.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | graphgallery/nn/models/pytorch/gat.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | import torch.nn as nn
from graphgallery.nn.layers.pytorch import (GATConv, SparseGATConv,
Sequential, activations)
class GAT(nn.Module):
def __init__(self,
in_features,
out_features,
hids=[8],
... | 32.976744 | 69 | 0.413963 | import torch.nn as nn
from graphgallery.nn.layers.pytorch import (GATConv, SparseGATConv,
Sequential, activations)
class GAT(nn.Module):
def __init__(self,
in_features,
out_features,
hids=[8],
... | true | true |
08f1798a4be86a145a550badc694568ae7fe0dbe | 745 | py | Python | ansible/roles/db/molecule/default/tests/test_default.py | Otus-DevOps-2021-06/vasilij-m_infra | 911bf927717f77f9a324b0d768147f9813cdb5c8 | [
"MIT"
] | null | null | null | ansible/roles/db/molecule/default/tests/test_default.py | Otus-DevOps-2021-06/vasilij-m_infra | 911bf927717f77f9a324b0d768147f9813cdb5c8 | [
"MIT"
] | 1 | 2021-06-18T09:47:28.000Z | 2021-06-18T09:48:52.000Z | ansible/roles/db/molecule/default/tests/test_default.py | Otus-DevOps-2021-06/vasilij-m_infra | 911bf927717f77f9a324b0d768147f9813cdb5c8 | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
# check if MongoDB is enabled and running
def test_mongo_running_and_enabled(host):
mongo = host.service("mongod")
assert mongo.is_runn... | 28.653846 | 63 | 0.765101 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_mongo_running_and_enabled(host):
mongo = host.service("mongod")
assert mongo.is_running
assert mongo.is_enabled
def test_... | true | true |
08f17a4586dc448bf409c9865438ddb45e460d3c | 1,218 | py | Python | src/mender/scripts/devicetype.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | null | null | null | src/mender/scripts/devicetype.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | 71 | 2020-12-21T05:08:13.000Z | 2022-01-31T02:04:26.000Z | src/mender/scripts/devicetype.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | 11 | 2020-12-02T14:46:58.000Z | 2021-12-02T06:43:25.000Z | # Copyright 2021 Northern.tech AS
#
# 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 ag... | 35.823529 | 93 | 0.698686 | import logging
from typing import Optional
from mender.scripts.aggregator.aggregator import ScriptKeyValueAggregator
log = logging.getLogger(__name__)
def get(path: str) -> Optional[dict]:
try:
device_type = ScriptKeyValueAggregator(path).collect(unique_keys=True)
if len(device_type.keys()) > 1:... | true | true |
08f17aae499b2d5bc2570507dd9b879ab04ad22b | 115,626 | py | Python | env/lib/python3.7/site-packages/numpy/core/fromnumeric.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 99 | 2019-10-09T16:14:46.000Z | 2022-03-17T02:23:47.000Z | env/lib/python3.7/site-packages/numpy/core/fromnumeric.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 26 | 2020-03-24T18:07:06.000Z | 2022-03-12T00:12:27.000Z | env/lib/python3.7/site-packages/numpy/core/fromnumeric.py | MarcoMancha/BreastCancerDetector | be0dfdcebd1ae66da6d0cf48e2525c24942ae877 | [
"Apache-2.0"
] | 98 | 2019-10-17T14:48:28.000Z | 2022-01-21T03:33:38.000Z | """Module containing non-deprecated functions borrowed from Numeric.
"""
from __future__ import division, absolute_import, print_function
import functools
import types
import warnings
import numpy as np
from .. import VisibleDeprecationWarning
from . import multiarray as mu
from . import overrides
from . import umat... | 32.127258 | 103 | 0.609828 | from __future__ import division, absolute_import, print_function
import functools
import types
import warnings
import numpy as np
from .. import VisibleDeprecationWarning
from . import multiarray as mu
from . import overrides
from . import umath as um
from . import numerictypes as nt
from ._asarray import asarray, ar... | true | true |
08f17af668aaa5ac36971641e66adc6aad077a31 | 38,867 | py | Python | unittest/test_log1p.py | m1griffin/arrayfunc | df57097699c25d3e949e1ade307ed61eaa5728c2 | [
"Apache-2.0"
] | 2 | 2017-08-28T08:41:16.000Z | 2018-05-29T03:49:36.000Z | unittest/test_log1p.py | m1griffin/arrayfunc | df57097699c25d3e949e1ade307ed61eaa5728c2 | [
"Apache-2.0"
] | null | null | null | unittest/test_log1p.py | m1griffin/arrayfunc | df57097699c25d3e949e1ade307ed61eaa5728c2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
##############################################################################
# Project: arrayfunc
# Module: test_log1p.py
# Purpose: arrayfunc unit test.
# Language: Python 3.4
# Date: 09-Dec-2017.
# Ver: 06-Mar-2020.
#
##############################################################... | 34.487134 | 118 | 0.604163 |
import sys
import array
import itertools
import math
import operator
import platform
import copy
import unittest
import arrayfunc
class log1p_general_even_arraysize_without_simd_f(unittest.TestCase):
def FloatassertEqual(self, expecteditem, dataoutitem, msg=None):
if math.isnan(dataoutitem) and math.... | true | true |
08f17b9dbefcee431b641fcc6262d86f0dbabed8 | 585 | py | Python | nipype/pipeline/plugins/__init__.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/pipeline/plugins/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/pipeline/plugins/__init__.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from .debug import DebugPlugin
from .linear import LinearPlugin
from .ipythonx import IPythonXPlugin
from .pbs import PBSPlugin
from .sge import SGEPlugin
from .condor import CondorPlugin
from .dagman impo... | 32.5 | 73 | 0.806838 |
from .debug import DebugPlugin
from .linear import LinearPlugin
from .ipythonx import IPythonXPlugin
from .pbs import PBSPlugin
from .sge import SGEPlugin
from .condor import CondorPlugin
from .dagman import CondorDAGManPlugin
from .multiproc import MultiProcPlugin
from .ipython import IPythonPlugin
from .somaflow imp... | true | true |
08f17c5b8f51adc394edb367c9d6d91fa66fcb24 | 3,636 | py | Python | run_exp/exp_4_12_prob_task_vanilla_inst.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | null | null | null | run_exp/exp_4_12_prob_task_vanilla_inst.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | null | null | null | run_exp/exp_4_12_prob_task_vanilla_inst.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | null | null | null | """
Author: Tong
Time: --2021
"""
def generate_cmd():
cmd_list = []
info_list = []
for model in ["vanilla_nlp"]:
# for dataset in ["seq-clinc150", "seq-maven", "seq-webred"]:
for dataset in ["seq-webred"]:
# for dataset in ["seq-clinc150", "online-maven", "online-webred"... | 61.627119 | 121 | 0.263201 |
def generate_cmd():
cmd_list = []
info_list = []
for model in ["vanilla_nlp"]:
for dataset in ["seq-webred"]:
for seed in range(1):
seed = seed * 100
for ptm in ["bert"]:
for filter_rate in [1]:
... | true | true |
08f17d351d57b83f77772c983bfd865efeca774b | 935 | py | Python | data/sent140/preprocess/combine_data.py | weimingwill/FedProx | d2a4501f319f1594b732d88315c5ca1a72855f50 | [
"MIT"
] | 371 | 2019-01-26T01:15:53.000Z | 2022-03-29T17:41:41.000Z | data/sent140/preprocess/combine_data.py | weimingwill/FedProx | d2a4501f319f1594b732d88315c5ca1a72855f50 | [
"MIT"
] | 24 | 2019-04-19T12:22:05.000Z | 2022-02-09T23:29:38.000Z | data/sent140/preprocess/combine_data.py | weimingwill/FedProx | d2a4501f319f1594b732d88315c5ca1a72855f50 | [
"MIT"
] | 115 | 2019-07-02T04:11:14.000Z | 2022-03-19T16:57:00.000Z | '''
each row of created .csv file is of the form:
polarity, id, date, query, user, comment, test_or_training
'''
import csv
import os
parent_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
train_file_name = os.path.join(parent_path, 'data', 'raw_data', 'training.csv')
training = []
with open(tra... | 25.27027 | 81 | 0.669519 |
import csv
import os
parent_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
train_file_name = os.path.join(parent_path, 'data', 'raw_data', 'training.csv')
training = []
with open(train_file_name, 'rt', encoding='ISO-8859-1') as f:
reader = csv.reader(f)
training = list(reader)
test_fil... | true | true |
08f17da3bb467e9bd80df9041c1861b276d064af | 1,089 | py | Python | {{cookiecutter.project_slug_dashed}}/{{cookiecutter.project_slug}}/tests/settings.py | andersinno/cookiecutter-pypackage-ai | 81dabafff9b020149782a59f98e96cada5976cfe | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug_dashed}}/{{cookiecutter.project_slug}}/tests/settings.py | andersinno/cookiecutter-pypackage-ai | 81dabafff9b020149782a59f98e96cada5976cfe | [
"MIT"
] | 3 | 2018-03-23T11:41:38.000Z | 2018-04-04T10:54:52.000Z | {{cookiecutter.project_slug_dashed}}/{{cookiecutter.project_slug}}/tests/settings.py | andersinno/cookiecutter-pypackage-ai | 81dabafff9b020149782a59f98e96cada5976cfe | [
"MIT"
] | 1 | 2018-03-23T13:22:34.000Z | 2018-03-23T13:22:34.000Z | DEBUG = False
SECRET_KEY = 'xxx'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.... | 24.75 | 70 | 0.609734 | DEBUG = False
SECRET_KEY = 'xxx'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.... | true | true |
08f17e51fea77fd27c99fac2e548b46368244c6f | 3,496 | py | Python | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriGenerateSurfaceNormalsOperation.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 82 | 2016-02-04T18:38:25.000Z | 2022-03-29T03:01:49.000Z | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriGenerateSurfaceNormalsOperation.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 206 | 2015-11-20T01:57:47.000Z | 2022-03-31T21:12:04.000Z | packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriGenerateSurfaceNormalsOperation.py | jschueller/seacas | 14c34ae08b757cba43a3a03ec0f129c8a168a9d3 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"NetCDF",
"BSL-1.0",
"X11",
"BSD-3-Clause"
] | 68 | 2016-01-13T22:46:51.000Z | 2022-03-31T06:25:05.000Z | # Copyright(C) 1999-2020 National Technology & Engineering Solutions
# of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
# NTESS, the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provide... | 43.160494 | 90 | 0.765732 |
from phactori import *
from paraview.simple import *
class PhactoriGenerateSurfaceNormalsOperation(PhactoriOperationSpecifics):
def __init__(self):
PhactoriOperationSpecifics.__init__(self)
self.ComputeCellNormals = True
def ParseParametersFromJson(self, inJson):
if "compute cell normals" in inJson:
... | true | true |
08f17e772161350fc59a96486cf5171639270379 | 14,547 | py | Python | tools/testrunner/standard_runner.py | EXHades/v8 | 5fe0aa3bc79c0a9d3ad546b79211f07105f09585 | [
"BSD-3-Clause"
] | 20,995 | 2015-01-01T05:12:40.000Z | 2022-03-31T21:39:18.000Z | tools/testrunner/standard_runner.py | EXHades/v8 | 5fe0aa3bc79c0a9d3ad546b79211f07105f09585 | [
"BSD-3-Clause"
] | 43 | 2015-01-21T11:54:36.000Z | 2022-03-11T07:48:51.000Z | tools/testrunner/standard_runner.py | EXHades/v8 | 5fe0aa3bc79c0a9d3ad546b79211f07105f09585 | [
"BSD-3-Clause"
] | 4,523 | 2015-01-01T15:12:34.000Z | 2022-03-28T06:23:41.000Z | #!/usr/bin/env python
#
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import absolute_import
from __future__ import print_function
from functools import redu... | 36.458647 | 79 | 0.655668 |
from __future__ import absolute_import
from __future__ import print_function
from functools import reduce
import datetime
import json
import os
import sys
import tempfile
import testrunner.base_runner as base_runner
from testrunner.local import utils
from testrunner.local.variants import ALL_VARIANTS
from testrunne... | true | true |
08f17eba9ca6be54e40e496e5a8fe1833b9e078b | 14,312 | py | Python | reportengine/base.py | cuker/django-reportengine | f9de8f9ea0b580b087df8c416fc328deedcdbb1c | [
"BSD-3-Clause"
] | 9 | 2015-02-17T17:27:12.000Z | 2018-12-03T13:42:38.000Z | reportengine/base.py | cuker/django-reportengine | f9de8f9ea0b580b087df8c416fc328deedcdbb1c | [
"BSD-3-Clause"
] | 1 | 2015-09-01T15:44:48.000Z | 2015-09-01T15:44:48.000Z | reportengine/base.py | cuker/django-reportengine | f9de8f9ea0b580b087df8c416fc328deedcdbb1c | [
"BSD-3-Clause"
] | 2 | 2015-09-01T10:48:40.000Z | 2019-10-02T07:23:33.000Z | """
Reports base classes. This reports module tries to provide an ORM agnostic reports engine that will allow nice reports
to be generated and exportable in a variety of formats. It seeks to be easy to use with query sets, raw SQL, or pure
python. An additional goal is to have the reports be managed by model instances ... | 40.659091 | 124 | 0.656652 | from django import forms
from django.db.models.fields.related import RelatedField
from filtercontrols import *
from outputformats import *
import datetime
def get_model_field(model, name):
return model._meta.get_field(name)
# Based on vitalik's Django-reporting
def get_lookup_field(model, original, lookup):
p... | true | true |
08f17fd13de19fe763bbaf81fca71059accedbbc | 11,684 | py | Python | sdk/peering/azure-mgmt-peering/azure/mgmt/peering/aio/operations/_peering_service_prefixes_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/peering/azure-mgmt-peering/azure/mgmt/peering/aio/operations/_peering_service_prefixes_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/peering/azure-mgmt-peering/azure/mgmt/peering/aio/operations/_peering_service_prefixes_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.683333 | 212 | 0.681787 | from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Asyn... | true | true |
08f1803286098641b59109daab87d40b4de52013 | 502 | py | Python | github_code/mmdetection3d/mmdet3d/ops/pvconv/se.py | Fawkes7/mmdetection3d | 7d5a339c699a73b3c8d65de5e48c7407f8640b23 | [
"Apache-2.0"
] | 1 | 2020-11-20T23:10:34.000Z | 2020-11-20T23:10:34.000Z | github_code/mmdetection3d/mmdet3d/ops/pvconv/se.py | Fawkes7/mmdetection3d | 7d5a339c699a73b3c8d65de5e48c7407f8640b23 | [
"Apache-2.0"
] | null | null | null | github_code/mmdetection3d/mmdet3d/ops/pvconv/se.py | Fawkes7/mmdetection3d | 7d5a339c699a73b3c8d65de5e48c7407f8640b23 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
class SE3d(nn.Module):
def __init__(self, channel, reduction=8):
super().__init__()
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inplace=True),
nn.Linear(channel // reduction, channel, bias=False),
... | 31.375 | 114 | 0.583665 | import torch.nn as nn
class SE3d(nn.Module):
def __init__(self, channel, reduction=8):
super().__init__()
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inplace=True),
nn.Linear(channel // reduction, channel, bias=False),
... | true | true |
08f18091c205bbe8fc404bef00fc8ad988cdf6ab | 697 | py | Python | export_photos_web.py | jbruggem/nautilus-scripts | 95d8f1dfdb89b519d72cc9aca8e78f16791b45f4 | [
"Apache-2.0"
] | null | null | null | export_photos_web.py | jbruggem/nautilus-scripts | 95d8f1dfdb89b519d72cc9aca8e78f16791b45f4 | [
"Apache-2.0"
] | null | null | null | export_photos_web.py | jbruggem/nautilus-scripts | 95d8f1dfdb89b519d72cc9aca8e78f16791b45f4 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
exportFolder = os.environ.get('EXPORT_PHOTOS_WEB_TARGET_FOLDER')
import os, os.path, errno
from subprocess import call
files = os.environ.get('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS')
if(files):
files = files.split('\n')
for f in files:
if not f:
continue
fold = os.p... | 24.892857 | 98 | 0.675753 |
exportFolder = os.environ.get('EXPORT_PHOTOS_WEB_TARGET_FOLDER')
import os, os.path, errno
from subprocess import call
files = os.environ.get('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS')
if(files):
files = files.split('\n')
for f in files:
if not f:
continue
fold = os.path.join(exportFolder,os.path.basename(os.p... | false | true |
08f180ff0117fbbfff8f90c2ab7e291849ae1b65 | 4,944 | py | Python | PythonPrograms/Programs/PythonCode/KleinGordon1Dimp.py | bcloutier/PSNM | 1cd03f87f93ca6cb1a3cfbe73e8bc6106f497ddf | [
"CC-BY-3.0",
"BSD-2-Clause"
] | 40 | 2015-01-05T14:22:59.000Z | 2022-02-18T23:51:25.000Z | PythonPrograms/Programs/PythonCode/KleinGordon1Dimp.py | bcloutier/PSNM | 1cd03f87f93ca6cb1a3cfbe73e8bc6106f497ddf | [
"CC-BY-3.0",
"BSD-2-Clause"
] | 1 | 2020-12-29T12:35:42.000Z | 2021-01-01T07:31:32.000Z | PythonPrograms/Programs/PythonCode/KleinGordon1Dimp.py | bcloutier/PSNM | 1cd03f87f93ca6cb1a3cfbe73e8bc6106f497ddf | [
"CC-BY-3.0",
"BSD-2-Clause"
] | 34 | 2015-01-05T14:23:02.000Z | 2021-10-09T06:55:01.000Z | """
A program to solve the 1D Klein Gordon equation using a
second order semi-explicit method. The numerical solution is
compared to an exact solution
More information on visualization can be found on the Mayavi
website, in particular:
http://github.enthought.com/mayavi/mayavi/mlab.html
which was last checked on 6 Ap... | 30.331288 | 76 | 0.659587 |
import math
import numpy
import matplotlib.pyplot as plt
import time
plt.ion()
Lx=64.0 Nx=4096 Nt=500 tmax=5.0 c=0.5 dt=tmax/Nt plotgap=10 Es= 1.0 numplots=Nt/plotgap tol=0.1**12
x = [i*2.0*math.pi*(Lx/Nx) for i in xrange(-Nx/2,1+Nx/2)]
k_x = (1.0/Lx)*numpy.array([complex(0,1)*n for n in ... | true | true |
08f18220b0c47996c24346891b3ecfb531379505 | 1,181 | py | Python | setup.py | uw-it-aca/django-oidc | 1e48d55912dfc05a6bd02ade3d497181f7d18caa | [
"Apache-2.0"
] | null | null | null | setup.py | uw-it-aca/django-oidc | 1e48d55912dfc05a6bd02ade3d497181f7d18caa | [
"Apache-2.0"
] | null | null | null | setup.py | uw-it-aca/django-oidc | 1e48d55912dfc05a6bd02ade3d497181f7d18caa | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup
README = """
See the README on `GitHub <https://github.com/uw-it-aca/uw-django-oidc>`_.
"""
version_path = 'uw_oidc/VERSION'
VERSION = open(os.path.join(os.path.dirname(__file__), version_path)).read()
VERSION = VERSION.replace("\n", "")
# allow setup.py to be run from any path... | 28.804878 | 78 | 0.645216 | import os
from setuptools import setup
README = """
See the README on `GitHub <https://github.com/uw-it-aca/uw-django-oidc>`_.
"""
version_path = 'uw_oidc/VERSION'
VERSION = open(os.path.join(os.path.dirname(__file__), version_path)).read()
VERSION = VERSION.replace("\n", "")
os.chdir(os.path.normpath(os.path.join(o... | true | true |
08f182add432ba4d2df0c97e344dbdd98836e17d | 5,692 | py | Python | gbpservice/neutron/extensions/driver_proxy_group.py | mr-smart/group-based-policy | e3fac66aa2d1eb3afd713ff763259e85f0e461af | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/extensions/driver_proxy_group.py | mr-smart/group-based-policy | e3fac66aa2d1eb3afd713ff763259e85f0e461af | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/extensions/driver_proxy_group.py | mr-smart/group-based-policy | e3fac66aa2d1eb3afd713ff763259e85f0e461af | [
"Apache-2.0"
] | 1 | 2019-12-03T15:28:24.000Z | 2019-12-03T15:28:24.000Z | # 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
# d... | 38.986301 | 79 | 0.641427 |
from neutron_lib.api import converters as conv
from neutron_lib.api import extensions
from neutron_lib import constants as nlib_const
from neutron_lib import exceptions as nexc
from oslo_config import cfg
from gbpservice.neutron.extensions import group_policy as gp
from gbpservice.neutron.services.grouppolicy.common ... | true | true |
08f182f06731ba42d27987acd61d8261155ce1d7 | 954 | py | Python | visualize_lr_scheduler.py | LulinPollux/lr-scheduler-visualization | 44fe47c89b70384f2c70f9842f845985810562f8 | [
"MIT"
] | 1 | 2021-01-28T16:39:31.000Z | 2021-01-28T16:39:31.000Z | visualize_lr_scheduler.py | LulinPollux/lr-scheduler-visualization | 44fe47c89b70384f2c70f9842f845985810562f8 | [
"MIT"
] | null | null | null | visualize_lr_scheduler.py | LulinPollux/lr-scheduler-visualization | 44fe47c89b70384f2c70f9842f845985810562f8 | [
"MIT"
] | null | null | null | import torch
import matplotlib.pyplot as plt
class Model(torch.nn.Module):
def __init__(self):
super(Model, self).__init__()
self.linear = torch.nn.Linear(3, 1)
def forward(self, x):
return self.linear(x)
model = Model()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
# ... | 27.257143 | 78 | 0.704403 | import torch
import matplotlib.pyplot as plt
class Model(torch.nn.Module):
def __init__(self):
super(Model, self).__init__()
self.linear = torch.nn.Linear(3, 1)
def forward(self, x):
return self.linear(x)
model = Model()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
sc... | true | true |
08f182fb1d6efc3873dbf0e157db16863f1cbe98 | 4,089 | py | Python | pyOCD/target/target_lpc800.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | 1 | 2018-10-30T12:47:34.000Z | 2018-10-30T12:47:34.000Z | pyOCD/target/target_lpc800.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | null | null | null | pyOCD/target/target_lpc800.py | orenc17/pyOCD | b5c9bc62b68323129aa258e128a8fc68aaa2527f | [
"Apache-2.0"
] | 1 | 2021-02-04T10:05:57.000Z | 2021-02-04T10:05:57.000Z | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | 53.103896 | 128 | 0.630961 |
from ..flash.flash import Flash
from ..core.coresight_target import (SVDFile, CoreSightTarget)
from ..core.memory_map import (FlashRegion, RamRegion, MemoryMap)
flash_algo = { 'load_address' : 0x10000000,
'instructions' : [
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040... | true | true |
08f183847184d692888ed081296d193ef788c6eb | 476 | py | Python | azclishell/_dump_help.py | oakeyc/azure-cli-shell | 472df3eab6ab03243242864d3130aecbbb4eca5d | [
"MIT"
] | 25 | 2017-04-03T22:56:31.000Z | 2021-05-22T13:35:41.000Z | azclishell/_dump_help.py | AzureMentor/azure-cli-shell | b0c376c1dd712c54548185eb3e07ad1aefd615dc | [
"MIT"
] | 104 | 2017-04-03T23:45:44.000Z | 2019-06-26T09:42:36.000Z | azclishell/_dump_help.py | AzureMentor/azure-cli-shell | b0c376c1dd712c54548185eb3e07ad1aefd615dc | [
"MIT"
] | 12 | 2017-04-03T23:39:10.000Z | 2021-01-12T09:13:37.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 52.888889 | 94 | 0.487395 |
from azclishell._dump_commands import dump_command_table
dump_command_table() | true | true |
08f183ac9413c4962dc9b11ca88d204dc5e717f4 | 39,312 | py | Python | Configuration/Geometry/python/dict2023Geometry.py | Szturmowiec/cmssw | 302e0680616cb2e9ccbe62d05987f1508b073995 | [
"Apache-2.0"
] | null | null | null | Configuration/Geometry/python/dict2023Geometry.py | Szturmowiec/cmssw | 302e0680616cb2e9ccbe62d05987f1508b073995 | [
"Apache-2.0"
] | null | null | null | Configuration/Geometry/python/dict2023Geometry.py | Szturmowiec/cmssw | 302e0680616cb2e9ccbe62d05987f1508b073995 | [
"Apache-2.0"
] | null | null | null | maxsections = 5
commonDict = {
"abbrev" : "O",
"name" : "common",
"default" : 2,
"O2" : {
1 : [
'Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml',
'Geome... | 54.074278 | 297 | 0.639856 | maxsections = 5
commonDict = {
"abbrev" : "O",
"name" : "common",
"default" : 2,
"O2" : {
1 : [
'Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml',
'Geome... | true | true |
08f18414247a473b023e1c921984a096fe8fa2af | 18 | py | Python | projects/peppercorn/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/peppercorn/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/peppercorn/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import peppercorn
| 9 | 17 | 0.888889 | import peppercorn
| true | true |
08f184de187faff104ead5555937fbed89b3e2b9 | 4,752 | py | Python | ui/DirTreeWidget.py | Kylskap/PloPo | 2c4171f9fd8b91f9d2dcd87e5d68c6cb02a74893 | [
"Apache-2.0"
] | null | null | null | ui/DirTreeWidget.py | Kylskap/PloPo | 2c4171f9fd8b91f9d2dcd87e5d68c6cb02a74893 | [
"Apache-2.0"
] | null | null | null | ui/DirTreeWidget.py | Kylskap/PloPo | 2c4171f9fd8b91f9d2dcd87e5d68c6cb02a74893 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 18:30:32 2017
@author: ZechT
"""
import os, sys
import numpy as np
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import configparser
import handler.DataItem as data
import ui.AskHandler as AskHandler
class DirTreeWidget(QTreeW... | 28.285714 | 100 | 0.54798 |
import os, sys
import numpy as np
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import configparser
import handler.DataItem as data
import ui.AskHandler as AskHandler
class DirTreeWidget(QTreeWidget):
def __init__(self,root,directory=None):
QTreeWidget.__init_... | true | true |
08f188d93586bb4035e463843005c36bf4c40374 | 421 | py | Python | test/expected/python/package_prefix/constants.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | test/expected/python/package_prefix/constants.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | test/expected/python/package_prefix/constants.py | dustyholmes-wf/frugal | 915ccfc58fcc9baabc4549c522e3acd2975a2e0b | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Frugal Compiler (3.4.7)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from .ttypes import *
import generic_package_prefix.actual_base.python.ttypes
import generic_package_prefix.actual_base.p... | 30.071429 | 83 | 0.831354 |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from .ttypes import *
import generic_package_prefix.actual_base.python.ttypes
import generic_package_prefix.actual_base.python.constants
const_int = generic_package_prefix.actual_base.python.constants.const_i32_from_base
| true | true |
08f189814feacb880d70c428177e0e82ab85b296 | 4,913 | py | Python | benchmark/startQiskit_QC1868.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1868.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1868.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=63
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 33.650685 | 165 | 0.620802 | import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
impo... | true | true |
08f18a7b9dbe80fcf39ac677775f00809209453c | 126,360 | py | Python | third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
# Copyright (C) 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | 45.617329 | 119 | 0.608903 |
import json
import os
import re
import StringIO
import sys
import unittest
from blinkpy.common import exit_codes
from blinkpy.common import path_finder
from blinkpy.common.host import Host
from blinkpy.common.host_mock import MockHost
from blinkpy.common.path_finder import WEB_TESTS_LAST_COMPONENT
from blinkpy.common... | true | true |
08f18a83635f4038f5693d3a5e3f80016894e190 | 6,273 | py | Python | error_analysis/operators.py | finnschwall/ErrorAnalysis | b85546b9422ec8f9e1b5d45cba92c9459ac085d2 | [
"Apache-2.0"
] | null | null | null | error_analysis/operators.py | finnschwall/ErrorAnalysis | b85546b9422ec8f9e1b5d45cba92c9459ac085d2 | [
"Apache-2.0"
] | 9 | 2020-12-01T22:58:15.000Z | 2020-12-06T14:24:55.000Z | error_analysis/operators.py | finnschwall/error_analysis | b85546b9422ec8f9e1b5d45cba92c9459ac085d2 | [
"Apache-2.0"
] | null | null | null | """
Contains often used operators.
Notes
----------
a stands for arc.
asin=arcsin
"""
# TODO check for values i.e is somebody trying to calculate log(-10) or something
from error_analysis.evar import *
from error_analysis import tools
op_var = sympy.symbols("op_var", real=True)
op_var_e = sympy.symbols("op_var... | 27.634361 | 134 | 0.645943 | from error_analysis.evar import *
from error_analysis import tools
op_var = sympy.symbols("op_var", real=True)
op_var_e = sympy.symbols("op_var_e", real=True)
def single_operator(expr, x):
RET_VAR = evar(name="INT_OP")
RET_VAR._evar__dependencies = x._evar__dependencies
RET_VAR._evar__expr = expr(x._eva... | true | true |
08f18bd5f9ece2d36118c92e5735dc3104a1dffc | 21,486 | py | Python | src/jig/tests/test_runner.py | Lightslayer/jig | 7287f594f63f8bc8cc1f42dcafec292dd75c89f2 | [
"BSD-2-Clause"
] | null | null | null | src/jig/tests/test_runner.py | Lightslayer/jig | 7287f594f63f8bc8cc1f42dcafec292dd75c89f2 | [
"BSD-2-Clause"
] | null | null | null | src/jig/tests/test_runner.py | Lightslayer/jig | 7287f594f63f8bc8cc1f42dcafec292dd75c89f2 | [
"BSD-2-Clause"
] | null | null | null | from shutil import rmtree
from os.path import join
from contextlib import nested
from datetime import datetime, timedelta
from mock import patch
from jig.tests.testcase import (
RunnerTestCase, PluginTestCase, result_with_hint)
from jig.conf import PLUGIN_CHECK_FOR_UPDATES
from jig.commands.hints import GIT_REPO_... | 30.519886 | 82 | 0.584613 | from shutil import rmtree
from os.path import join
from contextlib import nested
from datetime import datetime, timedelta
from mock import patch
from jig.tests.testcase import (
RunnerTestCase, PluginTestCase, result_with_hint)
from jig.conf import PLUGIN_CHECK_FOR_UPDATES
from jig.commands.hints import GIT_REPO_... | true | true |
08f18be506915529411378fa1c639595ac398bce | 232 | py | Python | test_app/migrations/0005_merge.py | PatatesSpa/django-smart-selects | fcfc8c0d5c18548ff24552bf2bb4a993a81683bf | [
"BSD-3-Clause"
] | 490 | 2015-01-21T23:22:00.000Z | 2019-11-10T20:49:31.000Z | test_app/migrations/0005_merge.py | PatatesSpa/django-smart-selects | fcfc8c0d5c18548ff24552bf2bb4a993a81683bf | [
"BSD-3-Clause"
] | 254 | 2015-01-07T15:24:11.000Z | 2019-07-23T18:01:34.000Z | test_app/migrations/0005_merge.py | PatatesSpa/django-smart-selects | fcfc8c0d5c18548ff24552bf2bb4a993a81683bf | [
"BSD-3-Clause"
] | 229 | 2015-01-07T19:21:10.000Z | 2019-11-19T03:03:40.000Z | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("test_app", "0004_client_domain_website"),
("test_app", "0004_auto_20170309_0016"),
]
operations = []
| 19.333333 | 51 | 0.663793 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("test_app", "0004_client_domain_website"),
("test_app", "0004_auto_20170309_0016"),
]
operations = []
| true | true |
08f18e244a6c66e84693ab1f8528e967f33c09f2 | 20,487 | py | Python | openstack_dashboard/dashboards/project/vpn/workflows.py | Tehsmash/horizon | 8ffade099a3a437509dcdcf25d5b054e5c188b61 | [
"Apache-2.0"
] | 60 | 2015-03-09T14:31:46.000Z | 2021-12-12T19:22:31.000Z | openstack_dashboard/dashboards/project/vpn/workflows.py | 2733284198/avos | becf7dd313fb8569581f985118c8367921c731ab | [
"Apache-2.0"
] | 7 | 2015-04-13T13:21:10.000Z | 2016-02-24T18:38:28.000Z | openstack_dashboard/dashboards/project/vpn/workflows.py | 2733284198/avos | becf7dd313fb8569581f985118c8367921c731ab | [
"Apache-2.0"
] | 13 | 2015-03-09T17:26:26.000Z | 2020-02-22T19:19:14.000Z | # Copyright 2013, Mirantis Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 41.895706 | 79 | 0.604188 |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import workflows
from openstack_dashboard import api
class AddVPNServiceAction(workflows.Action):
name = forms.CharField(max_length=80, label=_("Name"))
description = forms.CharFiel... | true | true |
08f18fda3af65c2db0f8828eff48b05cb37bf84e | 23,827 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_firewall_policies_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_firewall_policies_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_firewall_policies_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.639583 | 200 | 0.668401 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
08f1907ab15036626c4bdd9c4138384cbe2e5e25 | 4,788 | py | Python | hypha/apply/users/tests/factories.py | OpenTechFund/opentech.fund | 701b17f36ea27f891cd7e8a6743007302a52f34d | [
"BSD-3-Clause"
] | 14 | 2018-10-05T14:34:21.000Z | 2020-01-17T17:45:44.000Z | hypha/apply/users/tests/factories.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 1,098 | 2017-12-15T11:23:03.000Z | 2020-01-24T07:58:07.000Z | hypha/apply/users/tests/factories.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 7 | 2018-01-09T10:13:06.000Z | 2019-08-12T16:38:59.000Z | import uuid
import factory
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils.text import slugify
from ..groups import (
APPLICANT_GROUP_NAME,
APPROVER_GROUP_NAME,
COMMUNITY_REVIEWER_GROUP_NAME,
FINANCE_GROUP_NAME,
PARTNER_GROU... | 29.374233 | 105 | 0.694444 | import uuid
import factory
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils.text import slugify
from ..groups import (
APPLICANT_GROUP_NAME,
APPROVER_GROUP_NAME,
COMMUNITY_REVIEWER_GROUP_NAME,
FINANCE_GROUP_NAME,
PARTNER_GROU... | true | true |
08f1947f3d77696b5101ec809d5b924637340d11 | 49,253 | py | Python | ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 5 | 2017-07-20T11:15:10.000Z | 2020-04-16T15:42:55.000Z | ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 8 | 2020-06-18T17:31:19.000Z | 2022-03-02T08:32:03.000Z | ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 12 | 2017-05-17T09:48:01.000Z | 2021-08-05T19:01:25.000Z | #!/usr/bin/env ambari-python-wrap
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the... | 61.032218 | 213 | 0.720139 | from resource_management.core.logger import Logger
import json
import math
import re
from resource_management.libraries.functions import format
from resource_management.libraries.functions.version import compare_versions
class HDP26StackAdvisor(HDP25StackAdvisor):
def __init__(self):
super(HDP26StackAdvisor, ... | true | true |
08f19498ed77c5d3459031b8f5d6742631269873 | 162 | py | Python | run.py | antichess-only-bot/Lishogi-Bot | de2bc658209382838e22b40ddad76811737a35d9 | [
"MIT"
] | null | null | null | run.py | antichess-only-bot/Lishogi-Bot | de2bc658209382838e22b40ddad76811737a35d9 | [
"MIT"
] | null | null | null | run.py | antichess-only-bot/Lishogi-Bot | de2bc658209382838e22b40ddad76811737a35d9 | [
"MIT"
] | null | null | null | import os
def lichess():
program = "python3"
arguments = ["lishogi-bot.py","-u"]
print(os.execvp(program, (program,) + tuple(arguments)))
lichess()
| 20.25 | 61 | 0.62963 | import os
def lichess():
program = "python3"
arguments = ["lishogi-bot.py","-u"]
print(os.execvp(program, (program,) + tuple(arguments)))
lichess()
| true | true |
08f1950714df27fd0bfbc9ce6dd011f9f2c79164 | 18,147 | py | Python | test/test_equationSolver.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 21 | 2016-11-03T12:30:50.000Z | 2022-03-24T06:54:14.000Z | test/test_equationSolver.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 1 | 2019-04-02T02:01:27.000Z | 2019-04-07T21:07:10.000Z | test/test_equationSolver.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 12 | 2016-11-03T12:30:57.000Z | 2021-09-14T23:08:23.000Z | from unittest import TestCase
import warnings
import math
import sys
from sfc_models.equation_solver import EquationSolver, ConvergenceError, NoEquilibriumError
from sfc_models import Parameters as Parameters
import sfc_models.utils
is_python_3 = sys.version_info[0] >= 3
class TestEquationSolver(TestCase):
def t... | 33.054645 | 102 | 0.573042 | from unittest import TestCase
import warnings
import math
import sys
from sfc_models.equation_solver import EquationSolver, ConvergenceError, NoEquilibriumError
from sfc_models import Parameters as Parameters
import sfc_models.utils
is_python_3 = sys.version_info[0] >= 3
class TestEquationSolver(TestCase):
def t... | true | true |
08f195c2e17c200aa25ab041372d19064bd1b237 | 1,261 | py | Python | 2.传感器实验/2.温湿度传感器DHT11/DTH11.py | 01studio-lab/RaspberryPi_Examples | e0cd206477d57d3e583a49ba6e61e53ffc787929 | [
"MIT"
] | 7 | 2020-04-28T15:09:04.000Z | 2021-11-07T01:32:56.000Z | 2.传感器实验/2.温湿度传感器DHT11/DTH11.py | 01studio-lab/RaspberryPi_Examples | e0cd206477d57d3e583a49ba6e61e53ffc787929 | [
"MIT"
] | null | null | null | 2.传感器实验/2.温湿度传感器DHT11/DTH11.py | 01studio-lab/RaspberryPi_Examples | e0cd206477d57d3e583a49ba6e61e53ffc787929 | [
"MIT"
] | 4 | 2021-04-03T08:51:01.000Z | 2021-12-30T02:46:51.000Z | '''
实验名称:温湿度传感器DHT11
版本:v1.0
日期:2020.3
作者:01Studio
说明:通过编程采集温度数据,并在OLED显示。
社区:www.01studio.org
'''
import Adafruit_DHT,time
#导入luma相关库,oled lib
from luma.core.render import canvas
from luma.oled.device import ssd1306
#初始化oled,I2C接口1,oled地址是0x3c
device = ssd1306(port=1, address=0x3C)
#设置传感器类型: 支持DHT11,DHT22和AM2302
s... | 25.734694 | 95 | 0.61935 |
import Adafruit_DHT,time
from luma.core.render import canvas
from luma.oled.device import ssd1306
device = ssd1306(port=1, address=0x3C)
sensor=Adafruit_DHT.DHT11
gpio=19
while True:
humidity, temperature = Adafruit_DHT.read_retry(sensor, gpio)
if humidity is not None and temperature i... | true | true |
08f195de36fc2c8c90c421ac5ba167db725c56e9 | 17,072 | py | Python | models/criterions/SNAP.py | johnrachwan123/SNIP-it | a578a0693318f261492331298b6602de225fe21f | [
"MIT"
] | null | null | null | models/criterions/SNAP.py | johnrachwan123/SNIP-it | a578a0693318f261492331298b6602de225fe21f | [
"MIT"
] | null | null | null | models/criterions/SNAP.py | johnrachwan123/SNIP-it | a578a0693318f261492331298b6602de225fe21f | [
"MIT"
] | null | null | null | import copy
import os
import types
from collections import OrderedDict
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from models.criterions.General import General
from models.networks.assisting_layers.GateDecoratorLayers import GatedBatchNorm
from utils.constants import SNIP_BAT... | 42.894472 | 122 | 0.523196 | import copy
import os
import types
from collections import OrderedDict
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from models.criterions.General import General
from models.networks.assisting_layers.GateDecoratorLayers import GatedBatchNorm
from utils.constants import SNIP_BAT... | true | true |
08f1960accbc8e5d3a9fb2725f64c8c7069695ea | 1,699 | py | Python | draw fractal/Fingerprint/Fingerprint__PIL.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | draw fractal/Fingerprint/Fingerprint__PIL.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | draw fractal/Fingerprint/Fingerprint__PIL.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
"""
Отпечаток пальца / Fingerprint
"""
# Оригинал: http://www.cyberforum.ru/pascalabc/thread994987.html
# uses GraphABC;
#
# const
# n=255;
# max=10;
#
# var
# x,y,x1,y1,cx,cy: real;
# i,ix,iy: integer;
# // z=z^2+c
# begin
# Set... | 19.988235 | 64 | 0.47734 |
__author__ = 'ipetrash'
def draw_fingerprint(draw_by_image, width, height):
n = 255
max = 10
cx = 0.1
cy = 0.17
for ix in range(width - 1):
for iy in range(height - 1):
x = 0.005 * (ix - 200)
y = 0.005 * (iy - 150)
for i in range(n):
... | true | true |
08f19615d4773a3210d44a8ba2be32719a53401f | 140,439 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.751598 | 901 | 0.669266 |
import msrest.serialization
class AdditionalUnattendContent(msrest.serialization.Model):
_validation = {
'pass_name': {'constant': True},
'component_name': {'constant': True},
}
_attribute_map = {
'pass_name': {'key': 'passName', 'type': 'str'},
'component_name': {'key':... | true | true |
08f1962a83e0e0f8f29d038e0d075ab78fc2d692 | 693 | py | Python | migrations/versions/380_add_supplierframework_records_for_g5_g6_.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 25 | 2015-01-14T10:45:13.000Z | 2021-05-26T17:21:41.000Z | migrations/versions/380_add_supplierframework_records_for_g5_g6_.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 641 | 2015-01-15T11:10:50.000Z | 2021-06-15T22:18:42.000Z | migrations/versions/380_add_supplierframework_records_for_g5_g6_.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 22 | 2015-06-13T15:37:45.000Z | 2021-08-19T23:40:49.000Z | """Add SupplierFramework records for G5, G6 suppliers
Revision ID: 380
Revises: 370_use_sqlalchemy_validator
Create Date: 2015-11-02 16:27:01.538066
"""
# revision identifiers, used by Alembic.
revision = '380_add_supplierframework'
down_revision = '370_use_sqlalchemy_validator'
from alembic import op
import sqlalc... | 22.354839 | 68 | 0.689755 |
revision = '380_add_supplierframework'
down_revision = '370_use_sqlalchemy_validator'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("""
INSERT INTO supplier_frameworks
(supplier_id, framework_id)
SELECT DISTINCT supplier_id, framework_id
FROM se... | true | true |
08f1965fe3f4a19ea65a295ac8d9d189bde77cb0 | 494 | py | Python | ch05/buy_apple.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | null | null | null | ch05/buy_apple.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | null | null | null | ch05/buy_apple.py | fastso/deep-learning-from-scratch | efc8a0069697e76399e896ac4d593af86e57ad1e | [
"MIT"
] | null | null | null | from ch05.layer_naive import *
apple = 100
apple_num = 2
tax = 1.1
mul_apple_layer = MulLayer()
mul_tax_layer = MulLayer()
# 順伝播
apple_price = mul_apple_layer.forward(apple, apple_num)
price = mul_tax_layer.forward(apple_price, tax)
# 逆伝播(各変数に関する微分を求める)
dprice = 1
dapple_price, dtax = mul_tax_layer.backward(dprice)... | 21.478261 | 59 | 0.757085 | from ch05.layer_naive import *
apple = 100
apple_num = 2
tax = 1.1
mul_apple_layer = MulLayer()
mul_tax_layer = MulLayer()
apple_price = mul_apple_layer.forward(apple, apple_num)
price = mul_tax_layer.forward(apple_price, tax)
dprice = 1
dapple_price, dtax = mul_tax_layer.backward(dprice)
dapple, dapple_num = mul_a... | true | true |
08f19acbca54ba5a94349fe759162e6d6c088ce9 | 9,530 | py | Python | knowledge_embed/babi5/generate_delexicalization_babi5.py | HLTCHKUST/ke-dialogue | cb73237889860adedcfd381b28813feb267cef81 | [
"MIT"
] | 41 | 2020-10-05T05:57:08.000Z | 2021-12-20T12:07:42.000Z | knowledge_embed/babi5/generate_delexicalization_babi5.py | HLTCHKUST/ke-dialogue | cb73237889860adedcfd381b28813feb267cef81 | [
"MIT"
] | 5 | 2021-03-15T09:34:39.000Z | 2022-02-10T16:02:23.000Z | knowledge_embed/babi5/generate_delexicalization_babi5.py | HLTCHKUST/ke-dialogue | cb73237889860adedcfd381b28813feb267cef81 | [
"MIT"
] | 4 | 2020-10-19T08:10:43.000Z | 2021-11-09T13:06:24.000Z | import json
import networkx as nx
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import collections
from copy import deepcopy
def get_type_dict(kb_path, dstc2=False):
"""
Specifically, we augment the vocabulary with some special words, one for each of the KB entity types
For each t... | 39.380165 | 141 | 0.543022 | import json
import networkx as nx
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import collections
from copy import deepcopy
def get_type_dict(kb_path, dstc2=False):
type_dict = {'R_restaurant':[]}
kb_path_temp = kb_path
fd = open(kb_path_temp,'r')
for line in fd:
if... | true | true |
08f19ae68426955c43e38191c1caa82b69fafbe5 | 166 | py | Python | design_patterns/oop/alien_game/finished.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | design_patterns/oop/alien_game/finished.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | design_patterns/oop/alien_game/finished.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | from ObjectOriented.AlienGame import Scene
class Finished(Scene):
@staticmethod
def enter():
print("You won! Good job.")
return 'finished'
| 16.6 | 42 | 0.650602 | from ObjectOriented.AlienGame import Scene
class Finished(Scene):
@staticmethod
def enter():
print("You won! Good job.")
return 'finished'
| true | true |
08f19bb3ffeb8d779b1bee38f1c6b01f12810144 | 6,111 | py | Python | bot/utilities/api/helpers/classes.py | AiratK/kaishnik-bot | c42351611a40a04d78c8ae481b97339adbd321e5 | [
"MIT"
] | 15 | 2019-04-30T14:37:15.000Z | 2022-02-09T06:43:00.000Z | bot/utilities/api/helpers/classes.py | AiratK/kaishnik-bot | c42351611a40a04d78c8ae481b97339adbd321e5 | [
"MIT"
] | 4 | 2019-03-18T06:09:38.000Z | 2021-12-10T06:12:26.000Z | bot/utilities/api/helpers/classes.py | AiratK/kaishnik-bot | c42351611a40a04d78c8ae481b97339adbd321e5 | [
"MIT"
] | 2 | 2020-04-12T10:31:52.000Z | 2021-06-07T20:18:08.000Z | from datetime import datetime
from datetime import timedelta
from typing import Dict
from typing import List
from bot.utilities.api.constants import FULL_CLASS_ENTITIES
from bot.utilities.api.constants import COMPACT_CLASS_ENTITIES
from bot.utilities.api.constants import LECTURER_ENTITY
from bot.utilities.api.constan... | 44.605839 | 146 | 0.696285 | from datetime import datetime
from datetime import timedelta
from typing import Dict
from typing import List
from bot.utilities.api.constants import FULL_CLASS_ENTITIES
from bot.utilities.api.constants import COMPACT_CLASS_ENTITIES
from bot.utilities.api.constants import LECTURER_ENTITY
from bot.utilities.api.constan... | true | true |
08f19c688cf79815d72d910a332f37931ffdeb2a | 1,826 | py | Python | data_batcher.py | Tommy-Johannessen/MovementRecognition | be84d7d014a272987dd20d03194336a9244eb900 | [
"MIT"
] | null | null | null | data_batcher.py | Tommy-Johannessen/MovementRecognition | be84d7d014a272987dd20d03194336a9244eb900 | [
"MIT"
] | null | null | null | data_batcher.py | Tommy-Johannessen/MovementRecognition | be84d7d014a272987dd20d03194336a9244eb900 | [
"MIT"
] | 1 | 2019-02-13T12:42:39.000Z | 2019-02-13T12:42:39.000Z | import pickle
import numpy as np
from sklearn.model_selection import train_test_split
class DataBatcher:
def __init__(self, path, split_size=.5, do_shuffle=True):
with open(path, 'rb') as bf:
features, labels = pickle.load(bf)
self.x_train, self.x_test, self.y_train, self.y_test = tr... | 27.666667 | 80 | 0.605696 | import pickle
import numpy as np
from sklearn.model_selection import train_test_split
class DataBatcher:
def __init__(self, path, split_size=.5, do_shuffle=True):
with open(path, 'rb') as bf:
features, labels = pickle.load(bf)
self.x_train, self.x_test, self.y_train, self.y_test = tr... | true | true |
08f19e444351c614538acac185696342a390748d | 3,676 | py | Python | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | 1 | 2021-03-20T00:32:17.000Z | 2021-03-20T00:32:17.000Z | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | """submission table
Revision ID: 143f81c3bba3
Revises:
Create Date: 2019-02-25 21:25:17.891423
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
... | 81.688889 | 929 | 0.726333 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('submission',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(leng... | true | true |
08f19eda039a7715c586c3b7bbabe63a6b0ee32a | 3,059 | py | Python | tasa/store.py | denzuko-forked/tasa | 67d4cf3276bde1a28d6e56f374e916f9053e492d | [
"BSD-2-Clause"
] | null | null | null | tasa/store.py | denzuko-forked/tasa | 67d4cf3276bde1a28d6e56f374e916f9053e492d | [
"BSD-2-Clause"
] | null | null | null | tasa/store.py | denzuko-forked/tasa | 67d4cf3276bde1a28d6e56f374e916f9053e492d | [
"BSD-2-Clause"
] | null | null | null | import itertools
import json
import os
import redis
# LPOP RPush
class LazyRedis(object):
def __getattr__(self, name):
# ugh, fixme this is not a good way to do this
redis_address = os.environ.get('REDIS_ADDRESS')
if redis_address:
obj = redis.StrictRedis.from_url(redis_addre... | 27.558559 | 72 | 0.616868 | import itertools
import json
import os
import redis
class LazyRedis(object):
def __getattr__(self, name):
redis_address = os.environ.get('REDIS_ADDRESS')
if redis_address:
obj = redis.StrictRedis.from_url(redis_address)
else:
obj = redis.StrictRedis()
... | true | true |
08f19f33338d2dbdeeb0cedef522548d5f46a447 | 1,305 | py | Python | lrt_predict/Fetch/ensembl_species.py | MorrellLAB/BAD_Mutations | 17891b1f240f34b81995258413f613347c5568d1 | [
"MIT"
] | 12 | 2018-01-18T01:15:00.000Z | 2021-02-21T13:15:12.000Z | lrt_predict/Fetch/ensembl_species.py | MorrellLAB/BAD_Mutations | 17891b1f240f34b81995258413f613347c5568d1 | [
"MIT"
] | 33 | 2015-12-24T21:41:35.000Z | 2021-04-12T06:42:28.000Z | lrt_predict/Fetch/ensembl_species.py | MorrellLAB/BAD_Mutations | 17891b1f240f34b81995258413f613347c5568d1 | [
"MIT"
] | 5 | 2019-07-19T17:56:17.000Z | 2022-03-30T12:40:56.000Z | # This is just a list of species to download from Ensembl.
# It is a list of strings corresponding to directory names (species) to fetch
# We build this list by using species that are not in Phytozome.
# It would be better to programmatically generate this, probably...
ensembl_fetch = [
'aegilops_tauschii',... | 29 | 79 | 0.659004 | ensembl_fetch = [
'aegilops_tauschii',
'brassica_oleracea',
'hordeum_vulgare',
'leersia_perrieri',
'musa_acuminata',
'triticum_aestivum',
'triticum_urartu',
]
| true | true |
08f19fe47dbf1f102e2924e4787a5c62996f8734 | 925 | py | Python | certificator/meetup/models.py | lamenezes/certificator | fdb3d6f31499da8705de5453b8f55c0d313761bd | [
"MIT"
] | 19 | 2017-09-26T14:03:33.000Z | 2021-09-11T18:18:53.000Z | certificator/meetup/models.py | lamenezes/certificator | fdb3d6f31499da8705de5453b8f55c0d313761bd | [
"MIT"
] | 12 | 2017-10-01T20:10:51.000Z | 2019-05-22T01:39:48.000Z | certificator/meetup/models.py | lamenezes/certificator | fdb3d6f31499da8705de5453b8f55c0d313761bd | [
"MIT"
] | 5 | 2017-10-24T22:14:26.000Z | 2021-09-11T18:18:55.000Z | from datetime import datetime as dt
from simple_model import Model
class Event(Model):
fields = (
'venue',
'group',
'duration',
'time',
'name',
)
MONTHS = (
'janeiro',
'fevereiro',
'março',
'abril',
'maio',
'junho',
... | 19.680851 | 61 | 0.513514 | from datetime import datetime as dt
from simple_model import Model
class Event(Model):
fields = (
'venue',
'group',
'duration',
'time',
'name',
)
MONTHS = (
'janeiro',
'fevereiro',
'março',
'abril',
'maio',
'junho',
... | true | true |
08f1a117a4f0d6252ddcf6a5ace534c915b82250 | 1,511 | py | Python | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/operations/__init__.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.441176 | 94 | 0.753144 |
from ._operation_operations import OperationOperations
from ._workspace_operations import WorkspaceOperations
from ._application_group_assignment_operations import ApplicationGroupAssignmentOperations
from ._application_group_operations import ApplicationGroupOperations
from ._start_menu_item_operations import StartMe... | true | true |
08f1a2577cae466690902c9debb2a176ef7d74a6 | 459 | py | Python | Fizzbuzz.py | afl0w/python-intro. | b94b620a9bd0b3746120da1f98adfd8e551e70c7 | [
"MIT"
] | null | null | null | Fizzbuzz.py | afl0w/python-intro. | b94b620a9bd0b3746120da1f98adfd8e551e70c7 | [
"MIT"
] | null | null | null | Fizzbuzz.py | afl0w/python-intro. | b94b620a9bd0b3746120da1f98adfd8e551e70c7 | [
"MIT"
] | null | null | null | #print numbers 0 to 100
#for numbers are evenly divisible by 3, print Fizz instead of printing the number
#for numbers are evenly divisible by 5, print Fizz instead of printing the number
counter = 0
while counter <= 100:
if counter % 3 == 0 and counter % 5 == 0:
print('FizzBuzz')
elif counter %... | 28.6875 | 82 | 0.603486 | counter = 0
while counter <= 100:
if counter % 3 == 0 and counter % 5 == 0:
print('FizzBuzz')
elif counter % 3 == 0:
print('Fizz')
elif counter % 5 == 0:
print("Buzz")
else:
print(counter)
counter += 1 | true | true |
08f1a28cb6e29a3d47bb58cc69269d8dbd0716ee | 409 | py | Python | libStash/books/migrations/0027_auto_20210411_1238.py | Dev-Rem/libStash | a364e9997c1c91b09f5db8a004deb4df305fa8cf | [
"MIT"
] | null | null | null | libStash/books/migrations/0027_auto_20210411_1238.py | Dev-Rem/libStash | a364e9997c1c91b09f5db8a004deb4df305fa8cf | [
"MIT"
] | null | null | null | libStash/books/migrations/0027_auto_20210411_1238.py | Dev-Rem/libStash | a364e9997c1c91b09f5db8a004deb4df305fa8cf | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2021-04-11 12:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0026_auto_20210409_1656'),
]
operations = [
migrations.AlterField(
model_name='cart',
name='is_active',
... | 21.526316 | 74 | 0.608802 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0026_auto_20210409_1656'),
]
operations = [
migrations.AlterField(
model_name='cart',
name='is_active',
field=models.BooleanField(default=True,... | true | true |
08f1a35bc1cf052373e866dc9357103cec4bbd7a | 29,102 | py | Python | src/hangar/backends/hdf5_00.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | src/hangar/backends/hdf5_00.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | src/hangar/backends/hdf5_00.py | KarenImmanuel/hangar-py | 2a5caff259ad699db56676f14a70cb94e75d8a5b | [
"Apache-2.0"
] | null | null | null | """Local HDF5 Backend Implementation, Identifier: ``HDF5_00``
Backend Identifiers
===================
* Backend: ``0``
* Version: ``0``
* Format Code: ``00``
* Canonical Name: ``HDF5_00``
Storage Method
==============
* Data is written to specific subarray indexes inside an HDF5 "dataset" in a
single HDF5 F... | 38.802667 | 104 | 0.596901 | import math
import os
import re
import time
import logging
from collections import ChainMap
from os.path import join as pjoin
from os.path import splitext as psplitext
from functools import partial
from typing import (
MutableMapping, NamedTuple, Tuple, Optional, Union, Callable, Pattern)
import numpy as np
import... | true | true |
08f1a3cbb561b61132f33fac76dd33afd11544d6 | 18,385 | py | Python | georinex/obs2.py | fmeynadier/georinex | c54b59f9967e2f2b7bf31e0057adbc9d9e57e423 | [
"MIT"
] | null | null | null | georinex/obs2.py | fmeynadier/georinex | c54b59f9967e2f2b7bf31e0057adbc9d9e57e423 | [
"MIT"
] | null | null | null | georinex/obs2.py | fmeynadier/georinex | c54b59f9967e2f2b7bf31e0057adbc9d9e57e423 | [
"MIT"
] | null | null | null | from pathlib import Path
import numpy as np
import logging
import io
from math import ceil
from datetime import datetime, timedelta
import xarray
from typing import List, Union, Any, Dict, Tuple, Sequence, Optional
from typing.io import TextIO
try:
from pymap3d import ecef2geodetic
except ImportError:
ecef2geod... | 30.188834 | 125 | 0.519336 | from pathlib import Path
import numpy as np
import logging
import io
from math import ceil
from datetime import datetime, timedelta
import xarray
from typing import List, Union, Any, Dict, Tuple, Sequence, Optional
from typing.io import TextIO
try:
from pymap3d import ecef2geodetic
except ImportError:
ecef2geod... | true | true |
08f1a61cde8e66c3a7c8fbb9680fdf95b42f15b7 | 9,217 | py | Python | lrs/managers/StatementManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | lrs/managers/StatementManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | lrs/managers/StatementManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | from django.core.files.base import ContentFile
import uuid
from django.core.cache import caches
from .ActivityManager import ActivityManager
from ..models import Verb, Statement, StatementAttachment, SubStatement, Agent
from ..utils import convert_to_datetime_object
att_cache = caches['attachment_cache']
class Stat... | 49.026596 | 141 | 0.62938 | from django.core.files.base import ContentFile
import uuid
from django.core.cache import caches
from .ActivityManager import ActivityManager
from ..models import Verb, Statement, StatementAttachment, SubStatement, Agent
from ..utils import convert_to_datetime_object
att_cache = caches['attachment_cache']
class Stat... | false | true |
08f1a61dfc873f17fa53756554a22dd55741d28a | 23 | py | Python | sanic/__version__.py | viniciusd/sanic | 37378aabeaf47dc3d5df7d59b426d6fd34358b86 | [
"MIT"
] | 1 | 2020-09-02T02:09:11.000Z | 2020-09-02T02:09:11.000Z | sanic/__version__.py | viniciusd/sanic | 37378aabeaf47dc3d5df7d59b426d6fd34358b86 | [
"MIT"
] | null | null | null | sanic/__version__.py | viniciusd/sanic | 37378aabeaf47dc3d5df7d59b426d6fd34358b86 | [
"MIT"
] | null | null | null | __version__ = "19.9.0"
| 11.5 | 22 | 0.652174 | __version__ = "19.9.0"
| true | true |
08f1a7466a629b969ab93a22c6cdd70aa69cef84 | 1,384 | py | Python | scripts/models/model_init.py | daniele21/DL_soccer_prediction_v2 | 97bafe911fd8883d6679cf55fd0fff34db67ef06 | [
"MIT"
] | null | null | null | scripts/models/model_init.py | daniele21/DL_soccer_prediction_v2 | 97bafe911fd8883d6679cf55fd0fff34db67ef06 | [
"MIT"
] | null | null | null | scripts/models/model_init.py | daniele21/DL_soccer_prediction_v2 | 97bafe911fd8883d6679cf55fd0fff34db67ef06 | [
"MIT"
] | null | null | null | import os
from core.str2bool import str2bool
from scripts.constants.configs import BASE_DATASET, WINDOWED_DATASET
from scripts.constants.paths import PRODUCTION_DIR
from scripts.models.base import Base_Model
from scripts.models.k_fold_model import K_fold_model
from scripts.utils.date_utils import get_timestamp_string
... | 32.952381 | 83 | 0.749277 | import os
from core.str2bool import str2bool
from scripts.constants.configs import BASE_DATASET, WINDOWED_DATASET
from scripts.constants.paths import PRODUCTION_DIR
from scripts.models.base import Base_Model
from scripts.models.k_fold_model import K_fold_model
from scripts.utils.date_utils import get_timestamp_string
... | true | true |
08f1a7f994adb29e9bbddd2c96571e0351599a53 | 5,479 | py | Python | projects/PointRend_track/point_rend/datasets/coco.py | acc-L/detectron2 | 5a4936a61fbfd795b86938c2de3df8606bb64b35 | [
"Apache-2.0"
] | null | null | null | projects/PointRend_track/point_rend/datasets/coco.py | acc-L/detectron2 | 5a4936a61fbfd795b86938c2de3df8606bb64b35 | [
"Apache-2.0"
] | null | null | null | projects/PointRend_track/point_rend/datasets/coco.py | acc-L/detectron2 | 5a4936a61fbfd795b86938c2de3df8606bb64b35 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os.path as osp
import random
import cv2
from .custom import CustomDataset
from .extra_aug import ExtraAugmentation
from .transforms import (ImageTransform, BboxTransform, MaskTransform,
Numpy2Tensor)
from pycocotools2.coco import COCO
#from mmcv.parallel import DataCon... | 36.526667 | 95 | 0.584778 | import numpy as np
import os.path as osp
import random
import cv2
from .custom import CustomDataset
from .extra_aug import ExtraAugmentation
from .transforms import (ImageTransform, BboxTransform, MaskTransform,
Numpy2Tensor)
from pycocotools2.coco import COCO
from .utils import to_tensor, rand... | true | true |
08f1a9457957ef63527ebce8d55868813cdf4780 | 1,289 | py | Python | matplotlib-3.4.3/matplotlib-3.4.3/examples/shapes_and_collections/path_patch.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | 1 | 2021-11-13T17:21:44.000Z | 2021-11-13T17:21:44.000Z | matplotlib-3.4.3/matplotlib-3.4.3/examples/shapes_and_collections/path_patch.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | matplotlib-3.4.3/matplotlib-3.4.3/examples/shapes_and_collections/path_patch.py | JohnLauFoo/clc_packages_Yu | 259f01d9b5c02154ce258734d519ae8995cd0991 | [
"MIT"
] | null | null | null | r"""
================
PathPatch object
================
This example shows how to create `~.path.Path` and `~.patches.PathPatch`
objects through Matplotlib's API.
"""
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
Path = mpath.Path
path... | 24.320755 | 78 | 0.582622 |
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
Path = mpath.Path
path_data = [
(Path.MOVETO, (1.58, -2.57)),
(Path.CURVE4, (0.35, -1.1)),
(Path.CURVE4, (-1.75, 2.0)),
(Path.CURVE4, (0.375, 2.0)),
(Path.LINETO, (0.85, ... | true | true |
08f1a9f2c9dfa658ed25ab5b6449e0cfe413b252 | 626 | py | Python | extraPackages/matplotlib-3.0.3/examples/axisartist/simple_axisartist1.py | dolboBobo/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 130 | 2018-02-03T10:25:54.000Z | 2022-03-25T22:27:22.000Z | extraPackages/matplotlib-3.0.2/examples/axisartist/simple_axisartist1.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | extraPackages/matplotlib-3.0.2/examples/axisartist/simple_axisartist1.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | """
==================
Simple Axisartist1
==================
"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as AA
fig = plt.figure(1)
fig.subplots_adjust(right=0.85)
ax = AA.Subplot(fig, 1, 1, 1)
fig.add_subplot(ax)
# make some axis invisible
ax.axis["bottom", "top", "right"].set_visible(False)
... | 22.357143 | 64 | 0.619808 | import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as AA
fig = plt.figure(1)
fig.subplots_adjust(right=0.85)
ax = AA.Subplot(fig, 1, 1, 1)
fig.add_subplot(ax)
ax.axis["bottom", "top", "right"].set_visible(False)
ax.axis["y=0"] = ax.new_floating_axis(nth_coord=0, value=0,
... | true | true |
08f1ab6506c20a505dd28a407202f9c5e1238bf9 | 12,807 | py | Python | 3d_cnn/src/networks/utils.py | mrmattuschka/DeePiCt | ef3e81ea25705076f340175d97ccff98f8d11799 | [
"Apache-2.0"
] | null | null | null | 3d_cnn/src/networks/utils.py | mrmattuschka/DeePiCt | ef3e81ea25705076f340175d97ccff98f8d11799 | [
"Apache-2.0"
] | 2 | 2022-03-08T09:22:23.000Z | 2022-03-20T21:13:07.000Z | 3d_cnn/src/networks/utils.py | ZauggGroup/DeePiCt | 0bdf1cd845cc306e66e30face1010c12ca3a38d0 | [
"Apache-2.0"
] | null | null | null | import os
from os.path import join
import h5py
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as du
from constants import h5_internal_paths
from constants.config import Config, CV_DATA_FILE
from constants.statistics import ModelDescriptor
f... | 44.010309 | 119 | 0.635043 | import os
from os.path import join
import h5py
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as du
from constants import h5_internal_paths
from constants.config import Config, CV_DATA_FILE
from constants.statistics import ModelDescriptor
f... | true | true |
08f1abbb0d264889456fc6ac8783000e105828bc | 3,349 | py | Python | fireworks/sphere_firework.py | gaybro8777/discord-fireworks | 1c03e8a8b45e3d9e2ecbebee9033422594e90fa3 | [
"MIT"
] | 1 | 2021-06-21T08:55:26.000Z | 2021-06-21T08:55:26.000Z | fireworks/sphere_firework.py | gaybro8777/discord-fireworks | 1c03e8a8b45e3d9e2ecbebee9033422594e90fa3 | [
"MIT"
] | 1 | 2020-12-29T13:44:09.000Z | 2020-12-29T13:44:09.000Z | fireworks/sphere_firework.py | gaybro8777/discord-fireworks | 1c03e8a8b45e3d9e2ecbebee9033422594e90fa3 | [
"MIT"
] | 3 | 2020-12-28T16:05:15.000Z | 2021-06-21T08:55:33.000Z | import os
from random import expovariate, uniform, gauss
from lepton import Particle, ParticleGroup, default_system, domain
from lepton.controller import Lifetime, Movement, Fader, ColorBlender
from lepton.emitter import StaticEmitter, PerParticleEmitter
from lepton.renderer import PointRenderer
from lepton.texturizer ... | 39.4 | 118 | 0.602867 | import os
from random import expovariate, uniform, gauss
from lepton import Particle, ParticleGroup, default_system, domain
from lepton.controller import Lifetime, Movement, Fader, ColorBlender
from lepton.emitter import StaticEmitter, PerParticleEmitter
from lepton.renderer import PointRenderer
from lepton.texturizer ... | true | true |
08f1abd9ff12d3e9638be7b4010f509b4e532af7 | 9,756 | py | Python | homeassistant/components/device_tracker/__init__.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | 1 | 2017-03-01T10:57:20.000Z | 2017-03-01T10:57:20.000Z | homeassistant/components/device_tracker/__init__.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | null | null | null | homeassistant/components/device_tracker/__init__.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | null | null | null | """
homeassistant.components.tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to keep track of devices.
"""
import logging
import threading
import os
import csv
from datetime import datetime, timedelta
import homeassistant as ha
from homeassistant.loader import get_component
import homeassistant.util a... | 32.41196 | 79 | 0.572981 | import logging
import threading
import os
import csv
from datetime import datetime, timedelta
import homeassistant as ha
from homeassistant.loader import get_component
import homeassistant.util as util
from homeassistant.components import (
group, STATE_HOME, STATE_NOT_HOME, ATTR_ENTITY_PICTURE, ATTR_FRIENDLY_NAM... | true | true |
08f1ac08c86b9f0675237aa9fee2cf6e36e46abd | 7,627 | bzl | Python | build/workspace.bzl | my1990/kubernetes | c3816157f97cc068600b0dbebdbe80733ee5c3eb | [
"Apache-2.0"
] | 18 | 2020-08-06T17:11:30.000Z | 2020-11-16T04:02:33.000Z | build/workspace.bzl | kpharasi/kubernetes | 854ef3012fc8c1d8c336f966afb36bf249f1affd | [
"Apache-2.0"
] | 1 | 2020-07-07T13:48:12.000Z | 2020-07-09T03:01:38.000Z | build/workspace.bzl | kpharasi/kubernetes | 854ef3012fc8c1d8c336f966afb36bf249f1affd | [
"Apache-2.0"
] | 24 | 2020-08-11T21:44:30.000Z | 2020-08-12T22:14:48.000Z | # Copyright 2018 The Kubernetes 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 ... | 47.080247 | 169 | 0.731611 |
load("//build:platforms.bzl", "SERVER_PLATFORMS")
load("//build:workspace_mirror.bzl", "mirror")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
CNI_VERSION = "0.8.6"
_CNI_TARBALL_ARCH_SHA256 = {
"amd64": "... | true | true |
08f1ae1473c46eb0a43c68e4b7ac515c81e874d6 | 1,981 | py | Python | atp_description/src/description/enviroment_setup.py | Leontes/PFG | 5f041be9a24eef7c1b27f52158ccfa020a36814d | [
"Apache-2.0"
] | 3 | 2017-10-04T11:04:16.000Z | 2020-03-28T01:49:45.000Z | atp_description/src/description/enviroment_setup.py | Leontes/PFG | 5f041be9a24eef7c1b27f52158ccfa020a36814d | [
"Apache-2.0"
] | 1 | 2016-02-17T09:03:25.000Z | 2016-04-03T10:04:10.000Z | atp_description/src/description/enviroment_setup.py | Leontes/PFG | 5f041be9a24eef7c1b27f52158ccfa020a36814d | [
"Apache-2.0"
] | 1 | 2018-01-05T12:08:23.000Z | 2018-01-05T12:08:23.000Z | import rospy
from visualization_msgs.msg import Marker
from tasks import global_vars
def init_environment():
# Initialize the marker points list.
waypoint_list = Marker()
waypoint_list.ns = 'WaypointsNS'
waypoint_list.id = 0
waypoint_list.type = Marker.CUBE_LIST
waypoint_list.action = Mar... | 24.45679 | 78 | 0.624432 | import rospy
from visualization_msgs.msg import Marker
from tasks import global_vars
def init_environment():
waypoint_list = Marker()
waypoint_list.ns = 'WaypointsNS'
waypoint_list.id = 0
waypoint_list.type = Marker.CUBE_LIST
waypoint_list.action = Marker.ADD
waypoint_list.lifetime =... | true | true |
08f1aeed3943887b5810e3d3a8424c051e34ff35 | 1,674 | py | Python | tools/fileinfo/bugs/macho-segfault/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | tools/fileinfo/bugs/macho-segfault/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | tools/fileinfo/bugs/macho-segfault/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | from regression_tests import *
class Test0(Test):
settings=TestSettings(
tool='fileinfo',
args='--json --verbose',
input='cc4a24a56a545db9f5741e7372247386'
)
def test_symbol_table(self):
assert self.fileinfo.succeeded
self.assertEqual(len(self.fileinfo.output['symbo... | 29.892857 | 87 | 0.651135 | from regression_tests import *
class Test0(Test):
settings=TestSettings(
tool='fileinfo',
args='--json --verbose',
input='cc4a24a56a545db9f5741e7372247386'
)
def test_symbol_table(self):
assert self.fileinfo.succeeded
self.assertEqual(len(self.fileinfo.output['symbo... | true | true |
08f1af000cab464286f92fd72ac318efaf5a3295 | 4,114 | py | Python | app.py | dineshh912/TwitterSentimet-analysis | af6cea57108267da8e68440fd3d3380c4bbb5947 | [
"MIT"
] | null | null | null | app.py | dineshh912/TwitterSentimet-analysis | af6cea57108267da8e68440fd3d3380c4bbb5947 | [
"MIT"
] | null | null | null | app.py | dineshh912/TwitterSentimet-analysis | af6cea57108267da8e68440fd3d3380c4bbb5947 | [
"MIT"
] | null | null | null | import dash
from dash.dependencies import Output, Event, Input, State
import dash_core_components as dcc
import dash_html_components as html
import plotly
import random
import plotly.graph_objs as go
from collections import deque
import sqlite3
import pandas as pd
import time
app = dash.Dash(__name__)
app.layout = ht... | 32.650794 | 141 | 0.510209 | import dash
from dash.dependencies import Output, Event, Input, State
import dash_core_components as dcc
import dash_html_components as html
import plotly
import random
import plotly.graph_objs as go
from collections import deque
import sqlite3
import pandas as pd
import time
app = dash.Dash(__name__)
app.layout = ht... | true | true |
08f1af40d1b3bde7d18185337d9bdeedfa49588b | 205 | py | Python | file_process.py | adhi1234/Vulna-Hub | c594395de8eced4126916d66acec783cba448e06 | [
"MIT"
] | null | null | null | file_process.py | adhi1234/Vulna-Hub | c594395de8eced4126916d66acec783cba448e06 | [
"MIT"
] | 5 | 2021-02-08T20:30:49.000Z | 2022-03-11T23:45:00.000Z | file_process.py | adhi1234/Vulna-Hub | c594395de8eced4126916d66acec783cba448e06 | [
"MIT"
] | null | null | null | import json
# read file
with open('parsed_file.json', 'r') as myfile:
data=myfile.read()
# parse file
obj = json.loads(data)
# show values
print("data: " +str(obj['cve']['CVE_data_meta']['ID']))
| 13.666667 | 55 | 0.643902 | import json
with open('parsed_file.json', 'r') as myfile:
data=myfile.read()
obj = json.loads(data)
print("data: " +str(obj['cve']['CVE_data_meta']['ID']))
| true | true |
08f1aff48317a237ea90f1674a995474681dfa37 | 7,628 | pyw | Python | Antigo/sigaa5.pyw | luisrguerra/calculadorahorariossigaaunb | e99a271683812310fe6289dbe128232657253faf | [
"BSD-3-Clause"
] | 1 | 2021-01-21T02:42:17.000Z | 2021-01-21T02:42:17.000Z | Antigo/sigaa5.pyw | luisrguerra/calculadorahorariossigaaunb | e99a271683812310fe6289dbe128232657253faf | [
"BSD-3-Clause"
] | null | null | null | Antigo/sigaa5.pyw | luisrguerra/calculadorahorariossigaaunb | e99a271683812310fe6289dbe128232657253faf | [
"BSD-3-Clause"
] | null | null | null | from tkinter import *
from tkinter import ttk
import os
def fechar():
os._exit(0)
while True:
cor_fundo = 'white'
fonte_texto = "Arial"
tamanho_texto = 12
tamanho_titulo = 16
codigo = ""
def solicitar_codigo(titulo,texto):
janela_codigo = Tk()
#... | 32.459574 | 122 | 0.474174 | from tkinter import *
from tkinter import ttk
import os
def fechar():
os._exit(0)
while True:
cor_fundo = 'white'
fonte_texto = "Arial"
tamanho_texto = 12
tamanho_titulo = 16
codigo = ""
def solicitar_codigo(titulo,texto):
janela_codigo = Tk()
... | true | true |
08f1b0de4c5727aaef2ec57360968d164810b4a9 | 1,303 | py | Python | app/core/tests/test_models.py | lagaous/recipe-app-api | f985c03fb5c41b82f49be544238fd4963d5cbaa7 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | lagaous/recipe-app-api | f985c03fb5c41b82f49be544238fd4963d5cbaa7 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | lagaous/recipe-app-api | f985c03fb5c41b82f49be544238fd4963d5cbaa7 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
class ModelTest(TestCase):
def test_create_user_with_email_successful(self):
"""Test creating a new user with an email is successful"""
email = 'test@londonappdev.com'
password = 'Testpass123'
user = g... | 32.575 | 69 | 0.656178 | from django.contrib.auth import get_user_model
from django.test import TestCase
class ModelTest(TestCase):
def test_create_user_with_email_successful(self):
email = 'test@londonappdev.com'
password = 'Testpass123'
user = get_user_model().objects.create_user(
email=email,
... | true | true |
08f1b120f75282a7a039b8defc4e726f66ceda55 | 2,888 | py | Python | test/manual_test/manual_test_text_item.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 17 | 2019-03-01T12:09:37.000Z | 2020-04-09T14:14:59.000Z | test/manual_test/manual_test_text_item.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 7 | 2019-04-28T15:20:27.000Z | 2020-04-07T19:14:47.000Z | test/manual_test/manual_test_text_item.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 3 | 2020-02-28T14:27:11.000Z | 2020-04-01T16:12:40.000Z | """"""
# Import third-party modules
import pytest
# Import local modules
from photoshop import Session
from photoshop.api.enumerations import TextType
class TestTextItem:
"""Test the solidColor."""
# pylint: disable=attribute-defined-outside-init
@pytest.fixture(autouse=True)
def setup(self, psd_fil... | 29.469388 | 94 | 0.684903 | import pytest
from photoshop import Session
from photoshop.api.enumerations import TextType
class TestTextItem:
@pytest.fixture(autouse=True)
def setup(self, psd_file):
self.session = Session(file_path=psd_file("textitem"), action="open", auto_close=True)
self.session.run_action()
... | true | true |
08f1b1517f532fc7dec2a801224fbb448c6642cd | 3,409 | py | Python | openverse_catalog/dags/util/etl/operators.py | MuhammadFaizanHaidar/openverse-catalog | ea31d8109ead3799567aecea328ec6529756e7d4 | [
"MIT"
] | null | null | null | openverse_catalog/dags/util/etl/operators.py | MuhammadFaizanHaidar/openverse-catalog | ea31d8109ead3799567aecea328ec6529756e7d4 | [
"MIT"
] | null | null | null | openverse_catalog/dags/util/etl/operators.py | MuhammadFaizanHaidar/openverse-catalog | ea31d8109ead3799567aecea328ec6529756e7d4 | [
"MIT"
] | null | null | null | from airflow.operators.python import PythonOperator
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.amazon.aws.operators.emr_create_job_flow import (
EmrCreateJobFlowOperator,
)
from airflow.providers.amazon.aws.operators.emr_terminate_job_flow import (
EmrTerminateJobFlowOperato... | 32.160377 | 78 | 0.728953 | from airflow.operators.python import PythonOperator
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.amazon.aws.operators.emr_create_job_flow import (
EmrCreateJobFlowOperator,
)
from airflow.providers.amazon.aws.operators.emr_terminate_job_flow import (
EmrTerminateJobFlowOperato... | true | true |
08f1b19893a47e1171617ab1620b6492aa47e1c1 | 34,758 | py | Python | pili/ctrl/views.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 2 | 2019-12-22T13:05:08.000Z | 2020-02-02T13:05:31.000Z | pili/ctrl/views.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 71 | 2016-10-31T15:41:10.000Z | 2022-03-21T14:26:22.000Z | pili/ctrl/views.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from flask import (
abort,
current_app,
flash,
jsonify,
redirect,
render_template,
request,
send_from_directory,
url_for,
)
from flask_login import current_user, login_required
from flask_sqlalchemy import get_debug_queries
from werkzeug.utils... | 32.333023 | 88 | 0.601185 | import os
from datetime import datetime
from flask import (
abort,
current_app,
flash,
jsonify,
redirect,
render_template,
request,
send_from_directory,
url_for,
)
from flask_login import current_user, login_required
from flask_sqlalchemy import get_debug_queries
from werkzeug.utils... | true | true |
08f1b4943ed9339c50a6be019fc8ac9b6d3f460c | 4,625 | py | Python | figure-DNF-A.py | rougier/spatial-computation | 3167beec07cf4e704f3cb8e6cea3ab17c52b3995 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 16 | 2017-10-14T17:13:48.000Z | 2022-01-11T22:19:45.000Z | figure-DNF-A.py | a4aleem/spatial-computation | 393da8a6127d50c4b456d39a4fa6ec2febff311a | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | figure-DNF-A.py | a4aleem/spatial-computation | 393da8a6127d50c4b456d39a4fa6ec2febff311a | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2019-12-31T23:07:29.000Z | 2021-03-08T02:05:38.000Z | # Dynamic Neural Field simulation
# Copyright (c) 2017 Nicolas P. Rougier
'''
Dynamic neural field
====================
This script implements the numerical integration of dynamic neural field of the
form:
∂U(x,t) ⌠+∞
τ ------- = -U(x,t) + ⎮ w(|x-y|).f(U(y,t)).dy + I(x,t) + h
∂t ... | 31.462585 | 79 | 0.510919 | import numpy as np
import scipy.linalg
from scipy.ndimage.filters import convolve
def gaussian(n=40, center=(0,0), sigma=0.1):
xmin, xmax = -1, +1
ymin, ymax = -1, +1
x0, y0 = center
X, Y = np.meshgrid(np.linspace(xmin-x0, xmax-x0, n, endpoint=True),
np.linspace(ymin-y0, ymax-y0... | true | true |
08f1b5b8e4b662fe3b63ccd686e614bdd8d8366d | 6,703 | py | Python | examples/module_examples/M1_RP/demo_random_projection.py | rbeauchemin/SUOD | 3a88f967a505a1f82a090c8f81b33e27594525d6 | [
"BSD-2-Clause"
] | 336 | 2019-11-20T01:04:59.000Z | 2022-03-18T14:10:36.000Z | examples/module_examples/M1_RP/demo_random_projection.py | AdalinXMU/SUOD | 560b49a2aff4dea0443895c69e2bc6064ba4aed0 | [
"BSD-2-Clause"
] | 8 | 2020-03-17T08:01:31.000Z | 2022-01-06T18:35:26.000Z | examples/module_examples/M1_RP/demo_random_projection.py | AdalinXMU/SUOD | 560b49a2aff4dea0443895c69e2bc6064ba4aed0 | [
"BSD-2-Clause"
] | 42 | 2020-01-06T12:17:59.000Z | 2022-03-18T14:10:07.000Z | # %%
import os
import sys
# temporary solution for relative imports in case combo is not installed
# if combo is installed, no need to use the following line
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname("__file__"), '..')))
import time
import numpy as np
import scipy as sp
from sklearn.preproces... | 33.348259 | 78 | 0.636133 | import os
import sys
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname("__file__"), '..')))
import time
import numpy as np
import scipy as sp
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA as PCA_sklearn
from pyod.models.iforest import IForest
from pyod.models... | true | true |
08f1b6a84b6ee95b72ea04c2a452e4909a5b2676 | 770 | py | Python | event_manager/urls.py | ksu-svt/svt-event-web-app | 10d6d7ab0829edf45e4d8d503ac57f5b20fecbae | [
"MIT"
] | null | null | null | event_manager/urls.py | ksu-svt/svt-event-web-app | 10d6d7ab0829edf45e4d8d503ac57f5b20fecbae | [
"MIT"
] | 15 | 2017-08-29T03:26:08.000Z | 2018-01-20T21:05:01.000Z | event_manager/urls.py | ksu-svt/svt-event-web-app | 10d6d7ab0829edf45e4d8d503ac57f5b20fecbae | [
"MIT"
] | 1 | 2017-09-24T04:56:00.000Z | 2017-09-24T04:56:00.000Z | from django.conf.urls import url, include
from django.contrib import admin
from event_manager.views import EventListView, MemberListView, EventDetailView, MemberDetailView
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^home/$', views.index, name='home'),
url(r'^login/$',... | 45.294118 | 96 | 0.671429 | from django.conf.urls import url, include
from django.contrib import admin
from event_manager.views import EventListView, MemberListView, EventDetailView, MemberDetailView
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^home/$', views.index, name='home'),
url(r'^login/$',... | true | true |
08f1b71b624a5ad7b48f81307f603ea1cfa55170 | 1,158 | py | Python | tools/skp/page_sets/skia_slashdot_mobile.py | mohad12211/skia | 042a53aa094715e031ebad4da072524ace316744 | [
"BSD-3-Clause"
] | 6,304 | 2015-01-05T23:45:12.000Z | 2022-03-31T09:48:13.000Z | tools/skp/page_sets/skia_slashdot_mobile.py | mohad12211/skia | 042a53aa094715e031ebad4da072524ace316744 | [
"BSD-3-Clause"
] | 67 | 2016-04-18T13:30:02.000Z | 2022-03-31T23:06:55.000Z | tools/skp/page_sets/skia_slashdot_mobile.py | mohad12211/skia | 042a53aa094715e031ebad4da072524ace316744 | [
"BSD-3-Clause"
] | 1,231 | 2015-01-05T03:17:39.000Z | 2022-03-31T22:54:58.000Z | # Copyright 2019 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.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | 28.95 | 74 | 0.736615 |
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
class SkiaMobilePage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaMobilePage, self).__init__(
url=url,
name=url,
page_set=page_set,
shared... | true | true |
08f1b78e7ae78786555f16ff9e1287191eb8bbbb | 66,541 | py | Python | src/sage/rings/polynomial/groebner_fan.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 2 | 2021-08-20T00:30:35.000Z | 2021-11-17T10:54:00.000Z | src/sage/rings/polynomial/groebner_fan.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/rings/polynomial/groebner_fan.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | r"""
Groebner Fans
Sage provides much of the functionality of gfan, which is a
software package whose main function is to enumerate all reduced
Groebner bases of a polynomial ideal. The reduced Groebner bases
yield the maximal cones in the Groebner fan of the ideal. Several
subcomputations can be issued and additional... | 34.966369 | 443 | 0.524834 | r"""
Groebner Fans
Sage provides much of the functionality of gfan, which is a
software package whose main function is to enumerate all reduced
Groebner bases of a polynomial ideal. The reduced Groebner bases
yield the maximal cones in the Groebner fan of the ideal. Several
subcomputations can be issued and additional... | false | true |
08f1b833bda08e8874532f60f3a72b4962c4e55b | 5,272 | py | Python | tasks.py | cbernt/reqif | f8b7117f0267c38e91fb21049d082df15fcc3fd9 | [
"Apache-2.0"
] | 4 | 2022-01-07T16:48:54.000Z | 2022-01-11T13:58:05.000Z | tasks.py | cbernt/reqif | f8b7117f0267c38e91fb21049d082df15fcc3fd9 | [
"Apache-2.0"
] | 11 | 2021-12-26T12:43:01.000Z | 2022-01-22T20:31:47.000Z | tasks.py | cbernt/reqif | f8b7117f0267c38e91fb21049d082df15fcc3fd9 | [
"Apache-2.0"
] | 4 | 2022-01-27T15:37:29.000Z | 2022-03-25T02:50:13.000Z | import os
import re
import invoke
from invoke import task
def one_line_command(string):
return re.sub("\\s+", " ", string).strip()
def run_invoke_cmd(context, cmd) -> invoke.runners.Result:
return context.run(
cmd, env=None, hide=False, warn=False, pty=False, echo=True
)
@task
def clean(conte... | 20.59375 | 79 | 0.541161 | import os
import re
import invoke
from invoke import task
def one_line_command(string):
return re.sub("\\s+", " ", string).strip()
def run_invoke_cmd(context, cmd) -> invoke.runners.Result:
return context.run(
cmd, env=None, hide=False, warn=False, pty=False, echo=True
)
@task
def clean(conte... | true | true |
08f1b881f46d0124976e25ec2e7d8fc576dcee9c | 218 | py | Python | gssetting/__init__.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | gssetting/__init__.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | gssetting/__init__.py | deresmos/gssetting | 6c6a30bc048194930337b3253b14aba65144e06a | [
"MIT"
] | null | null | null | from .gssetting import GoogleSpreadSheetSetting
from .model.gssetting import GSSetting
from .model.value_render_option import ValueRenderOption
__all__ = ["GoogleSpreadSheetSetting", "GSSetting", "ValueRenderOption"]
| 36.333333 | 72 | 0.844037 | from .gssetting import GoogleSpreadSheetSetting
from .model.gssetting import GSSetting
from .model.value_render_option import ValueRenderOption
__all__ = ["GoogleSpreadSheetSetting", "GSSetting", "ValueRenderOption"]
| true | true |
08f1b8ff380fb0bd128265ee797883de951bad29 | 1,428 | py | Python | grokking-the-coding-interview/modified-binary-search/Search-Bitonic-Array-(medium).py | huandrew99/LeetCode | aa36b48d06100ce5f0bc64c789a906ec29409440 | [
"MIT"
] | 36 | 2021-12-23T15:44:41.000Z | 2022-03-31T04:26:26.000Z | grokking-the-coding-interview/modified-binary-search/Search-Bitonic-Array-(medium).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | null | null | null | grokking-the-coding-interview/modified-binary-search/Search-Bitonic-Array-(medium).py | wzy0766/LeetCode-1 | 3070e672c519e8af74966811b8058a9baef8c0bc | [
"MIT"
] | 11 | 2022-02-26T22:41:26.000Z | 2022-03-02T07:18:41.000Z | """
LC 1095
Search Bitonic Array (medium)
Given a Bitonic array, find if a given ‘key’ is present in it.
An array is considered bitonic if it is monotonically increasing and then monotonically decreasing.
Monotonically increasing or decreasing means that for any index i in the array arr[i] != arr[i+1].
Write a function... | 20.695652 | 99 | 0.572129 | def search_bitonic_array(arr, key):
l, r = 0, len(arr) - 1
while l < r:
m = l + (r - l >> 1)
if arr[m] < arr[m + 1]:
l = m + 1
else:
r = m
idx = find_val(arr, key, 0, l)
if idx == -1:
idx = find_val(arr, key, l, len(arr) - 1)
return idx
def find_val(arr, key, l, r):
ascend =... | true | true |
08f1b9a3d6d36bb43c610d6095e0d6ff2a552725 | 875 | py | Python | oas3/objects/tag.py | pinntech/oas3 | 8125c853a56c10afbc841093f24e4ead61ef5b65 | [
"MIT"
] | null | null | null | oas3/objects/tag.py | pinntech/oas3 | 8125c853a56c10afbc841093f24e4ead61ef5b65 | [
"MIT"
] | null | null | null | oas3/objects/tag.py | pinntech/oas3 | 8125c853a56c10afbc841093f24e4ead61ef5b65 | [
"MIT"
] | null | null | null | """
oas3.objects.tag
~~~~~~~~~~~~~~~~
"""
from marshmallow import fields
from oas3.base import BaseObject, BaseSchema
from .external_docs import ExternalDocs
class Tag(BaseObject):
"""
Adds metadata to a single tag that is used by the Operation Object.
It is not mandatory to have a Tag Object per tag def... | 26.515152 | 92 | 0.670857 |
from marshmallow import fields
from oas3.base import BaseObject, BaseSchema
from .external_docs import ExternalDocs
class Tag(BaseObject):
class Schema(BaseSchema):
name = fields.Str(required=True)
description = fields.Str()
external_docs = fields.Nested(ExternalDocs.Schema)
def... | true | true |
08f1ba2fe3ac891452e6c2d29b190402a3187fd3 | 1,231 | py | Python | webias/tests/rnsb_score_replication_w2v.py | webis-de/IJCAI-21 | 1f9fccb07d0d6d1b73da787a1bce499b641c3a5e | [
"MIT"
] | 1 | 2022-03-26T22:30:30.000Z | 2022-03-26T22:30:30.000Z | webias/tests/rnsb_score_replication_w2v.py | webis-de/IJCAI-21 | 1f9fccb07d0d6d1b73da787a1bce499b641c3a5e | [
"MIT"
] | 1 | 2021-09-08T08:26:38.000Z | 2021-09-08T08:26:38.000Z | webias/tests/rnsb_score_replication_w2v.py | webis-de/IJCAI-21 | 1f9fccb07d0d6d1b73da787a1bce499b641c3a5e | [
"MIT"
] | null | null | null | import json
import unittest
from os import path
from ..constants import RNSB_TEST_TOLERANCE
from ..word_vectors import WordVectors
from ..rnsb import RNSB
class TestRnsbWord2Vec(unittest.TestCase):
# Load test data from file
rnsb_tests = path.join(path.dirname(path.dirname(__file__)), "data", "rnsb_tests.js... | 30.775 | 91 | 0.647441 | import json
import unittest
from os import path
from ..constants import RNSB_TEST_TOLERANCE
from ..word_vectors import WordVectors
from ..rnsb import RNSB
class TestRnsbWord2Vec(unittest.TestCase):
rnsb_tests = path.join(path.dirname(path.dirname(__file__)), "data", "rnsb_tests.json")
with open(rnsb_tes... | true | true |
08f1ba95b611a3b41dd589be3228b04ee91de911 | 872 | py | Python | src/catnlp/ner/train.py | catnlp/catnlp | df86a56b4446ac915dda977c71ddf46b34edae55 | [
"MIT"
] | null | null | null | src/catnlp/ner/train.py | catnlp/catnlp | df86a56b4446ac915dda977c71ddf46b34edae55 | [
"MIT"
] | null | null | null | src/catnlp/ner/train.py | catnlp/catnlp | df86a56b4446ac915dda977c71ddf46b34edae55 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import logging
import random
import numpy as np
import torch
from .train_plm import PlmTrain
from .train_lstm import LstmTrain
from .train_plm_cmeee import PlmTrainCmeee
class NerTrain:
def __init__(self, config):
logging.info(config)
self.setup_seed(seed=config.get("seed... | 24.914286 | 51 | 0.62156 |
import logging
import random
import numpy as np
import torch
from .train_plm import PlmTrain
from .train_lstm import LstmTrain
from .train_plm_cmeee import PlmTrainCmeee
class NerTrain:
def __init__(self, config):
logging.info(config)
self.setup_seed(seed=config.get("seed"))
model_type ... | true | true |
08f1bbafcf39111fe75f02884fdbac83bc973285 | 2,773 | py | Python | face_detector_ssd/model_lightweight/model9.py | keiji/face_detector_with_tensorflow | 36a440b177c2decaa34ec8cd0311a8283969d932 | [
"Apache-2.0"
] | 1 | 2018-11-16T13:09:06.000Z | 2018-11-16T13:09:06.000Z | face_detector_ssd/model_lightweight/model9.py | keiji/face_detector_with_tensorflow | 36a440b177c2decaa34ec8cd0311a8283969d932 | [
"Apache-2.0"
] | null | null | null | face_detector_ssd/model_lightweight/model9.py | keiji/face_detector_with_tensorflow | 36a440b177c2decaa34ec8cd0311a8283969d932 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
NAME = 'model9_lw'
IMAGE_SIZE = 128
CHANNELS = 3
CLASSES = 1
OFFSET = 4
def base_layers(image, is_train=True):
with tf.variable_scope(NAME):
conv = tf.layers.conv2d(image, 64, [3, 3], [1, 1],
padding='SAME',
activation=tf.nn.relu... | 34.6625 | 94 | 0.47097 | import tensorflow as tf
NAME = 'model9_lw'
IMAGE_SIZE = 128
CHANNELS = 3
CLASSES = 1
OFFSET = 4
def base_layers(image, is_train=True):
with tf.variable_scope(NAME):
conv = tf.layers.conv2d(image, 64, [3, 3], [1, 1],
padding='SAME',
activation=tf.nn.relu... | true | true |
08f1bca7ae08f3d3f8aecd676d294f397a706ea9 | 22,177 | py | Python | nemo/collections/asr/models/label_models.py | entn-at/NeMo | 5ed583ce5a26667bd154e8fb13f324274476d261 | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/models/label_models.py | entn-at/NeMo | 5ed583ce5a26667bd154e8fb13f324274476d261 | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/models/label_models.py | entn-at/NeMo | 5ed583ce5a26667bd154e8fb13f324274476d261 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 44.442886 | 163 | 0.666817 |
import copy
import itertools
from math import ceil
from typing import Dict, List, Optional, Union
import librosa
import numpy as np
import torch
from omegaconf import DictConfig
from omegaconf.omegaconf import open_dict
from pytorch_lightning import Trainer
from tqdm import tqdm
from nemo.collections.asr.data.audio_... | true | true |
08f1bd06f914e1c30fb6baa3485fc59008a736b0 | 317 | py | Python | Dataset/Leetcode/test/55/493.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/55/493.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/55/493.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, nums: List[int]) -> bool:
last = 0
n = len(nums)
i = 0
while i <= last:
if i + nums[i] >= last:
last = i + nums[i]
if last >= n - 1:
return True
i += 1
return False
| 22.642857 | 43 | 0.365931 | class Solution:
def XXX(self, nums: List[int]) -> bool:
last = 0
n = len(nums)
i = 0
while i <= last:
if i + nums[i] >= last:
last = i + nums[i]
if last >= n - 1:
return True
i += 1
return False
| false | true |
08f1bd9b3d4d50464e9d03800e576a87be2576db | 1,639 | py | Python | sympy/matrices/expressions/__init__.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/expressions/__init__.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/matrices/expressions/__init__.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | """ A module which handles Matrix Expressions """
from .slice import MatrixSlice
from .blockmatrix import BlockMatrix, BlockDiagMatrix, block_collapse, blockcut
from .funcmatrix import FunctionMatrix
from .inverse import Inverse
from .matadd import MatAdd
from .matexpr import (
Identity,
MatrixExpr,
Matrix... | 24.462687 | 86 | 0.71263 |
from .slice import MatrixSlice
from .blockmatrix import BlockMatrix, BlockDiagMatrix, block_collapse, blockcut
from .funcmatrix import FunctionMatrix
from .inverse import Inverse
from .matadd import MatAdd
from .matexpr import (
Identity,
MatrixExpr,
MatrixSymbol,
ZeroMatrix,
OneMatrix,
matrix_... | true | true |
08f1be316f53b44fc26b43882bdacbb157459758 | 136 | py | Python | toolkit/__init__.py | bmorris3/zeitsprung | 346db1173df58458a9428e84e74d5b22c8768eb5 | [
"MIT"
] | 1 | 2021-09-03T15:31:07.000Z | 2021-09-03T15:31:07.000Z | toolkit/__init__.py | bmorris3/zeitsprung | 346db1173df58458a9428e84e74d5b22c8768eb5 | [
"MIT"
] | null | null | null | toolkit/__init__.py | bmorris3/zeitsprung | 346db1173df58458a9428e84e74d5b22c8768eb5 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .lightcurve import *
| 27.2 | 66 | 0.683824 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .lightcurve import *
| true | true |
08f1be4ddbd19fe2d9c9b7e8a619d3f7cca635d5 | 512 | py | Python | examples/plot_demo_pcolor.py | tkf/adaptiveheatmap | 27a58a647d7db20d5325a9640dd37049bd916b6e | [
"BSD-2-Clause"
] | null | null | null | examples/plot_demo_pcolor.py | tkf/adaptiveheatmap | 27a58a647d7db20d5325a9640dd37049bd916b6e | [
"BSD-2-Clause"
] | null | null | null | examples/plot_demo_pcolor.py | tkf/adaptiveheatmap | 27a58a647d7db20d5325a9640dd37049bd916b6e | [
"BSD-2-Clause"
] | null | null | null | """
`pcolor <.core.pcolor>` demo
----------------------------
`pcolor <.core.pcolor>` can be used like
`matplotlib.pyplot.pcolor`.
"""
from matplotlib import pyplot
from adaptiveheatmap.demos import data_hump_and_spike
import adaptiveheatmap
pyplot.style.use("fivethirtyeight")
X, Y, Z = data_hump_and_spike()
ah = ... | 20.48 | 53 | 0.691406 |
from matplotlib import pyplot
from adaptiveheatmap.demos import data_hump_and_spike
import adaptiveheatmap
pyplot.style.use("fivethirtyeight")
X, Y, Z = data_hump_and_spike()
ah = adaptiveheatmap.pcolor(X, Y, Z, cmap='inferno')
ah.set_xlabel('X')
ah.set_ylabel('Y')
ah.set_zlabel('Z')
ah.figure.suptitle('pcolor')
p... | true | true |
08f1beab8b8e2634b68a4406a1d3bda7f1336bc6 | 5,446 | py | Python | dataphile/io/compression.py | glentner/DataPhile | 1593b0f6a6bbca82fb9f76947d88d47aa077f8c9 | [
"Apache-2.0"
] | 5 | 2020-09-12T17:38:22.000Z | 2021-11-23T14:57:34.000Z | dataphile/io/compression.py | glentner/DataPhile | 1593b0f6a6bbca82fb9f76947d88d47aa077f8c9 | [
"Apache-2.0"
] | 5 | 2020-02-21T17:42:33.000Z | 2021-02-02T22:33:48.000Z | dataphile/io/compression.py | glentner/DataPhile | 1593b0f6a6bbca82fb9f76947d88d47aa077f8c9 | [
"Apache-2.0"
] | 2 | 2020-07-14T13:43:30.000Z | 2020-08-14T14:43:52.000Z | # This file is part of the Dataphile package.
#
# This program is free software: you can redistribute it and/or modify it under the
# terms of the Apache License (v2.0) as published by the Apache Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without... | 31.298851 | 94 | 0.611825 |
import zlib
import lzma
import bz2
from typing import Iterable, Generator, Union, Dict, Any
COMPRESSORS = {
'gzip': {
'init': zlib.compressobj,
'args': [],
'kwargs': {'method': zlib.DEFLATED, 'wbits': zlib.MAX_WBITS | 16, },
'translation': {}},
'lzma': {
'init': lzma.... | true | true |
08f1befcd912dd3720cf38228c87ac86176e4784 | 201 | py | Python | vtr/vtr_flow/tools/reRoute/ble.py | haojunliu/OpenFPGA | b0c4f27077f698aae59bbcbd3ca002f22ba2a5a1 | [
"BSD-2-Clause"
] | 31 | 2016-02-15T02:57:28.000Z | 2021-06-02T10:40:25.000Z | vtr/vtr_flow/tools/reRoute/ble.py | haojunliu/OpenFPGA | b0c4f27077f698aae59bbcbd3ca002f22ba2a5a1 | [
"BSD-2-Clause"
] | null | null | null | vtr/vtr_flow/tools/reRoute/ble.py | haojunliu/OpenFPGA | b0c4f27077f698aae59bbcbd3ca002f22ba2a5a1 | [
"BSD-2-Clause"
] | 6 | 2017-02-08T21:51:51.000Z | 2021-06-02T10:40:40.000Z | import sys
import shlex
import math
class ble (object):
def __init__ (self, p_name):
self.name = p_name
self.ble_input = []
self.ble_old_loc = []
self.ff = 'OPEN'
| 16.75 | 32 | 0.58209 | import sys
import shlex
import math
class ble (object):
def __init__ (self, p_name):
self.name = p_name
self.ble_input = []
self.ble_old_loc = []
self.ff = 'OPEN'
| true | true |
08f1c1587f068611d85acc9c4783c6d60608e1a6 | 7,984 | py | Python | kwmobile/decoder.py | swipswaps/sdr | 35af246c08d9153938bcd562003c0adf0965cd41 | [
"MIT"
] | 23 | 2018-10-27T18:12:39.000Z | 2022-03-30T20:08:21.000Z | kwmobile/decoder.py | swipswaps/sdr | 35af246c08d9153938bcd562003c0adf0965cd41 | [
"MIT"
] | 2 | 2019-12-10T10:47:12.000Z | 2021-08-30T09:20:37.000Z | kwmobile/decoder.py | swipswaps/sdr | 35af246c08d9153938bcd562003c0adf0965cd41 | [
"MIT"
] | 5 | 2020-04-03T15:41:17.000Z | 2021-11-03T22:46:27.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from time import sleep, time
from datetime import datetime
import pigpio as gpio
import numpy as np
from lib.rfm69 import Rfm69
import psycopg2 as pg
import paho.mqtt.client as mqtt
SILENT = 0
ERROR = 1
INFO = 2
TRACE = 3
class Decoder(object):
"""Deco... | 34.266094 | 210 | 0.579284 |
import os
from time import sleep, time
from datetime import datetime
import pigpio as gpio
import numpy as np
from lib.rfm69 import Rfm69
import psycopg2 as pg
import paho.mqtt.client as mqtt
SILENT = 0
ERROR = 1
INFO = 2
TRACE = 3
class Decoder(object):
def __init__(self, host="localhost", port=8888, data_p... | true | true |
08f1c2a131a01c95fc3722278cbf0d4af0e9c1db | 4,364 | py | Python | Binomial/distributions/Gaussiandistribution.py | EliasPapachristos/AWS_ML_Foundations_Course-Udacity | 7e99c33908ca5ac60b220dd989cb44d88d013af4 | [
"Apache-2.0"
] | null | null | null | Binomial/distributions/Gaussiandistribution.py | EliasPapachristos/AWS_ML_Foundations_Course-Udacity | 7e99c33908ca5ac60b220dd989cb44d88d013af4 | [
"Apache-2.0"
] | null | null | null | Binomial/distributions/Gaussiandistribution.py | EliasPapachristos/AWS_ML_Foundations_Course-Udacity | 7e99c33908ca5ac60b220dd989cb44d88d013af4 | [
"Apache-2.0"
] | null | null | null | import math
import matplotlib.pyplot as plt
from .Generaldistribution import Distribution
class Gaussian(Distribution):
""" Gaussian distribution class for calculating and
visualizing a Gaussian distribution.
Attributes:
mean (float) representing the mean value of the distribution
... | 25.225434 | 116 | 0.55385 | import math
import matplotlib.pyplot as plt
from .Generaldistribution import Distribution
class Gaussian(Distribution):
def __init__(self, mu=0, sigma=1):
Distribution.__init__(self, mu, sigma)
def calculate_mean(self):
avg = 1.0 * sum(self.data) / len(self.data)
... | true | true |
08f1c31898535b05fe6267c24fe3fc0affb49a4c | 4,116 | py | Python | Templates/GeneralFIRE_1.0_1.0.py | peterdodds-fb/SOFASonix | 6c7156ccc91a6e925599dc590c12b3bc99bd1243 | [
"BSD-3-Clause"
] | 17 | 2019-07-23T04:42:04.000Z | 2021-09-23T20:43:51.000Z | Templates/GeneralFIRE_1.0_1.0.py | peterdodds-fb/SOFASonix | 6c7156ccc91a6e925599dc590c12b3bc99bd1243 | [
"BSD-3-Clause"
] | 2 | 2019-12-13T15:26:08.000Z | 2020-11-22T14:30:11.000Z | Templates/GeneralFIRE_1.0_1.0.py | peterdodds-fb/SOFASonix | 6c7156ccc91a6e925599dc590c12b3bc99bd1243 | [
"BSD-3-Clause"
] | 3 | 2020-03-13T05:38:32.000Z | 2021-05-26T02:10:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, I.Laghidze
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above co... | 32.15625 | 79 | 0.65379 |
from SOFASonix import SOFAFile
import numpy as np
sofa = SOFAFile("GeneralFIRE", sofaConventionsVersion=1.0, version=1.0)
sofa._M = 100
sofa._N = 1024
sofa._R = 2
sofa._E = 4
sofa.view()
sofa.GLOBAL_AuthorContact = ""
sofa.GLOBAL_Comment = ""
sofa.GLOBAL_License = "No license provided, ask the author for permis... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.