hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c48ba21837c94aee68af6465f3d992eba966cf7 | 10,513 | py | Python | static_precompiler/compilers/base.py | BarnabasSzabolcs/django-static-precompiler | 5fb7390896d725825a688afd3caa54bb642a08b0 | [
"MIT"
] | null | null | null | static_precompiler/compilers/base.py | BarnabasSzabolcs/django-static-precompiler | 5fb7390896d725825a688afd3caa54bb642a08b0 | [
"MIT"
] | null | null | null | static_precompiler/compilers/base.py | BarnabasSzabolcs/django-static-precompiler | 5fb7390896d725825a688afd3caa54bb642a08b0 | [
"MIT"
] | null | null | null | import logging
import os
import posixpath
import django.core.exceptions
from django.contrib.staticfiles import finders
from django.utils import encoding, functional
try:
from django.utils import six
uses_six = True
except ImportError:
uses_six = False
from .. import models, mtime, settings, utils
logger... | 33.912903 | 113 | 0.642348 | import logging
import os
import posixpath
import django.core.exceptions
from django.contrib.staticfiles import finders
from django.utils import encoding, functional
try:
from django.utils import six
uses_six = True
except ImportError:
uses_six = False
from .. import models, mtime, settings, utils
logger... | true | true |
1c48ba419e9dc47c3799b86acf638abebcbe5ba2 | 10,227 | py | Python | dolo/algos/value_iteration.py | gkbharathy/econ_model_02 | d91ddf148b009bf79852d9aec70f3a1877e0f79a | [
"BSD-2-Clause"
] | null | null | null | dolo/algos/value_iteration.py | gkbharathy/econ_model_02 | d91ddf148b009bf79852d9aec70f3a1877e0f79a | [
"BSD-2-Clause"
] | null | null | null | dolo/algos/value_iteration.py | gkbharathy/econ_model_02 | d91ddf148b009bf79852d9aec70f3a1877e0f79a | [
"BSD-2-Clause"
] | null | null | null | import time
import numpy as np
import numpy
import scipy.optimize
from dolo.numeric.processes import DiscretizedIIDProcess
# from dolo.numeric.decision_rules_markov import MarkovDecisionRule, IIDDecisionRule
from dolo.numeric.decision_rule import DecisionRule, ConstantDecisionRule
from dolo.numeric.grids import Grid, C... | 27.34492 | 86 | 0.553633 | import time
import numpy as np
import numpy
import scipy.optimize
from dolo.numeric.processes import DiscretizedIIDProcess
from dolo.numeric.decision_rule import DecisionRule, ConstantDecisionRule
from dolo.numeric.grids import Grid, CartesianGrid, SmolyakGrid, UnstructuredGrid
from dolo.misc.itprinter import Iteration... | true | true |
1c48baaa5f215b10e5b5cd0d792c038d273b33da | 1,441 | py | Python | gallery/tests.py | Kips-alih/my-gallery | f48c0dd71e84102560d095fef4da223d11d7c606 | [
"MIT"
] | null | null | null | gallery/tests.py | Kips-alih/my-gallery | f48c0dd71e84102560d095fef4da223d11d7c606 | [
"MIT"
] | null | null | null | gallery/tests.py | Kips-alih/my-gallery | f48c0dd71e84102560d095fef4da223d11d7c606 | [
"MIT"
] | null | null | null | from django.test import TestCase
from .models import Image, Location,category
# Create your tests here.
# Testing Save Method
class ImageTestClass(TestCase):
# Set up method
def setUp(self):
self.image=Image( title= 'Nature', description ='Our work to conserve biodiversity focuses on Key Biodiversity ... | 31.326087 | 259 | 0.684247 | from django.test import TestCase
from .models import Image, Location,category
class ImageTestClass(TestCase):
def setUp(self):
self.image=Image( title= 'Nature', description ='Our work to conserve biodiversity focuses on Key Biodiversity Areas.', image ='http://image.com/image.jpg',category=category.o... | true | true |
1c48bb3e561f10b44690e00435e248a10f1ad318 | 2,592 | py | Python | tests/test_priceranges.py | ahrenberg/marketxtradermodel | 0907191dfe444da5e407cc9723c3485d278d2952 | [
"Apache-2.0"
] | null | null | null | tests/test_priceranges.py | ahrenberg/marketxtradermodel | 0907191dfe444da5e407cc9723c3485d278d2952 | [
"Apache-2.0"
] | 1 | 2017-12-14T10:18:52.000Z | 2017-12-22T09:33:22.000Z | tests/test_priceranges.py | ahrenberg/marketxtradermodel | 0907191dfe444da5e407cc9723c3485d278d2952 | [
"Apache-2.0"
] | null | null | null | """
Test functions for priceranges.
"""
# Copyright 2017 Lukas Ahrenberg <lukas@ahrenberg.se>
#
# 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-... | 29.454545 | 74 | 0.657407 | import pytest
import networkx as nx
import marketxtradermodel as mxtm
from marketxtradermodel.priceranges import *
import numpy as np
import math
def test_creation():
pr = PriceRanges()
with pytest.raises(Exception):
pr.compute_price()
def test_insert_one():
pr = PriceRanges()
pr.i... | true | true |
1c48bb7cfd46f213761e5949e5e1a8bdda9040fe | 2,441 | py | Python | spec/unit/database_spec.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | 9 | 2015-06-02T23:31:20.000Z | 2021-05-17T17:26:32.000Z | spec/unit/database_spec.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | null | null | null | spec/unit/database_spec.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | 3 | 2015-10-07T21:51:38.000Z | 2021-01-23T12:22:58.000Z | #-*- coding: utf-8 -*-
from spec.unit.fixtures import Internal, patch_gpod_module
gpod = patch_gpod_module()
from ipodio.track import Track
from ipodio.database import Database
from expects import expect
from mamba import describe, context, before
with describe(Database) as _:
with context('when fabricated'... | 32.986486 | 87 | 0.645637 |
from spec.unit.fixtures import Internal, patch_gpod_module
gpod = patch_gpod_module()
from ipodio.track import Track
from ipodio.database import Database
from expects import expect
from mamba import describe, context, before
with describe(Database) as _:
with context('when fabricated'):
def should_h... | true | true |
1c48bb95496680dbac66b2e5ec105326dc33b0f6 | 380 | py | Python | srcipts/requests/friends_check_get.py | GerasimovRM/Where-I-Am | 58f6f0d1533421890f199dacabe523a447486b9f | [
"MIT"
] | null | null | null | srcipts/requests/friends_check_get.py | GerasimovRM/Where-I-Am | 58f6f0d1533421890f199dacabe523a447486b9f | [
"MIT"
] | null | null | null | srcipts/requests/friends_check_get.py | GerasimovRM/Where-I-Am | 58f6f0d1533421890f199dacabe523a447486b9f | [
"MIT"
] | null | null | null | from requests import get, post
from pprint import pprint
from srcipts.requests.common import URL
tokens = post(f'{URL}/signin', json={'nickname': 'Roman',
'unhashed_password': 'сильныйпароль'}).json()
pprint(tokens)
headers = {'Authorization': f'Bearer {tokens["access_token"]}'}
... | 31.666667 | 82 | 0.665789 | from requests import get, post
from pprint import pprint
from srcipts.requests.common import URL
tokens = post(f'{URL}/signin', json={'nickname': 'Roman',
'unhashed_password': 'сильныйпароль'}).json()
pprint(tokens)
headers = {'Authorization': f'Bearer {tokens["access_token"]}'}
... | true | true |
1c48bca115e0da7844c6b39dde5af63e4b379173 | 140 | py | Python | mamba/mamba/__init__.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 2,262 | 2020-09-08T07:46:35.000Z | 2022-03-31T21:11:35.000Z | mamba/mamba/__init__.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 841 | 2020-09-07T15:22:43.000Z | 2022-03-31T18:18:43.000Z | mamba/mamba/__init__.py | wulmer/mamba | 5961d76afdd8b0f070bf0f2da396ef25289c965c | [
"BSD-3-Clause"
] | 132 | 2020-09-10T03:05:45.000Z | 2022-03-29T12:32:47.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from ._version import __version__, version_info # noqa
| 35 | 82 | 0.842857 | from __future__ import absolute_import, division, print_function, unicode_literals
from ._version import __version__, version_info | true | true |
1c48bdf5afb88f7044b760c3718f3f56ec6148ee | 3,807 | py | Python | aiida/orm/convert.py | borellim/aiida_core | eebef392c81e8b130834a92e1d7abf5e2e30b3ce | [
"BSD-2-Clause"
] | 1 | 2019-03-15T10:37:53.000Z | 2019-03-15T10:37:53.000Z | aiida/orm/convert.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | aiida/orm/convert.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 31.725 | 115 | 0.695298 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import Mapping
try: from functools import singledispatch
except ImportError: from singledispatch import singledispatch
try:
from collections.abc import Iterator, Sized except I... | true | true |
1c48bfcb4049b286061ece2031b4d355497489ab | 2,534 | py | Python | src/DeePyMoD_SBL/deepymod_torch/network.py | GJBoth/DeePyMoD_torch | b4b90080f4f9fea8fdf4426e0708e807b193242f | [
"MIT"
] | 1 | 2021-11-06T18:02:18.000Z | 2021-11-06T18:02:18.000Z | src/DeePyMoD_SBL/deepymod_torch/network.py | GJBoth/DeePyMoD_torch | b4b90080f4f9fea8fdf4426e0708e807b193242f | [
"MIT"
] | null | null | null | src/DeePyMoD_SBL/deepymod_torch/network.py | GJBoth/DeePyMoD_torch | b4b90080f4f9fea8fdf4426e0708e807b193242f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class Library(nn.Module):
def __init__(self, library_func, library_args={}):
super().__init__()
self.library_func = library_func
self.library_args = library_args
def forward(self, input):
time_deriv_list, theta = self.library_func(input, **se... | 39.59375 | 168 | 0.662589 | import torch
import torch.nn as nn
class Library(nn.Module):
def __init__(self, library_func, library_args={}):
super().__init__()
self.library_func = library_func
self.library_args = library_args
def forward(self, input):
time_deriv_list, theta = self.library_func(input, **se... | true | true |
1c48c02f74550a04bdeb6ad17a47a68d67a957c7 | 259 | py | Python | whitehats/urls.py | stephanpoetschner/demo-whitehats | 0bd8ccd75f37129ac3ad82949a6899aa7b706b90 | [
"MIT"
] | null | null | null | whitehats/urls.py | stephanpoetschner/demo-whitehats | 0bd8ccd75f37129ac3ad82949a6899aa7b706b90 | [
"MIT"
] | null | null | null | whitehats/urls.py | stephanpoetschner/demo-whitehats | 0bd8ccd75f37129ac3ad82949a6899aa7b706b90 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.conf.urls import include, url
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('landingpage.urls')),
url(r'^', include('signups.urls')),
url(r'^api/', include('api.urls')),
]
| 19.923077 | 43 | 0.633205 | from django.contrib import admin
from django.conf.urls import include, url
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('landingpage.urls')),
url(r'^', include('signups.urls')),
url(r'^api/', include('api.urls')),
]
| true | true |
1c48c033d3e9037fadefc39f479136487a3dd057 | 575 | py | Python | tbonlineproject/faq/urls.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | null | null | null | tbonlineproject/faq/urls.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | 3 | 2021-06-08T23:57:13.000Z | 2022-01-13T03:42:01.000Z | tbonlineproject/faq/urls.py | nathangeffen/tbonline-2 | 0d5869197e66a0057fa07cb99f21dde7f5b47c30 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
from django.views.generic import ListView, DetailView
from faq.models import QuestionCategory, QuestionAndAnswer
urlpatterns = patterns('faq.views',
url(r'^$', ListView.as_view(model=QuestionCategory,
context_object_name="questioncategory_list",)... | 41.071429 | 77 | 0.627826 | from django.conf.urls.defaults import *
from django.views.generic import ListView, DetailView
from faq.models import QuestionCategory, QuestionAndAnswer
urlpatterns = patterns('faq.views',
url(r'^$', ListView.as_view(model=QuestionCategory,
context_object_name="questioncategory_list",)... | true | true |
1c48c096ccbd2a7376ec2748329779a91cf42457 | 1,250 | py | Python | myapp/models/query.py | miguelgrinberg/circular-dependencies-webcast | 741754b956787c88de8bba99d9257a58212b41e7 | [
"MIT"
] | 19 | 2018-05-26T07:25:56.000Z | 2021-06-05T07:45:22.000Z | myapp/models/query.py | miguelgrinberg/circular-dependencies-webcast | 741754b956787c88de8bba99d9257a58212b41e7 | [
"MIT"
] | null | null | null | myapp/models/query.py | miguelgrinberg/circular-dependencies-webcast | 741754b956787c88de8bba99d9257a58212b41e7 | [
"MIT"
] | 2 | 2020-03-12T11:31:15.000Z | 2020-08-10T16:07:58.000Z | from flask_sqlalchemy import BaseQuery
from myapp import db
class QueryWithSoftDelete(BaseQuery):
_with_deleted = False
def __new__(cls, *args, **kwargs):
obj = super(QueryWithSoftDelete, cls).__new__(cls)
obj._with_deleted = kwargs.pop('_with_deleted', False)
if len(args) > 0:
... | 36.764706 | 76 | 0.64 | from flask_sqlalchemy import BaseQuery
from myapp import db
class QueryWithSoftDelete(BaseQuery):
_with_deleted = False
def __new__(cls, *args, **kwargs):
obj = super(QueryWithSoftDelete, cls).__new__(cls)
obj._with_deleted = kwargs.pop('_with_deleted', False)
if len(args) > 0:
... | true | true |
1c48c0b17c2b24240920a52e3fd57992cd6b0a17 | 10,952 | py | Python | src/hyde/driver/configuration/nwp/gfs/drv_configuration_time_gfs.py | c-hydro/hyde | 3a3ff92d442077ce353b071d5afe726fc5465201 | [
"MIT"
] | null | null | null | src/hyde/driver/configuration/nwp/gfs/drv_configuration_time_gfs.py | c-hydro/hyde | 3a3ff92d442077ce353b071d5afe726fc5465201 | [
"MIT"
] | 18 | 2020-04-07T16:34:59.000Z | 2021-07-02T07:32:39.000Z | src/hyde/driver/configuration/nwp/gfs/drv_configuration_time_gfs.py | c-hydro/fp-hyde | b0728397522aceebec3e7ff115aff160a10efede | [
"MIT"
] | null | null | null | """
Class Features
Name: drv_configuration_time_gfs
Author(s): Fabio Delogu (fabio.delogu@cimafoundation.org)
Date: '20200228'
Version: '1.0.0'
"""
#######################################################################################
# Library
import logging
import time
import pandas as ... | 41.172932 | 120 | 0.442111 |
import logging
import time
import pandas as pd
from src.hyde.algorithm.settings.nwp.gfs.lib_gfs_args import logger_name, time_format
log_stream = logging.getLogger(logger_name)
class DataObject(dict):
pass
class DataTime:
time_now = None
time_settings = None
time_run = None
time_fro... | true | true |
1c48c0fb0a50d5dc326448a85db2b46c3fbabf2a | 439 | py | Python | test/jsontesturls.py | JohnJorgensen19/json-rpc | ab96aa8654e4ddcc968cfefa1a27fd10459045dc | [
"MIT"
] | 165 | 2015-01-04T15:00:45.000Z | 2022-03-12T11:36:41.000Z | test/jsontesturls.py | JohnJorgensen19/json-rpc | ab96aa8654e4ddcc968cfefa1a27fd10459045dc | [
"MIT"
] | 30 | 2015-03-02T21:49:56.000Z | 2021-07-15T11:56:23.000Z | test/jsontesturls.py | JohnJorgensen19/json-rpc | ab96aa8654e4ddcc968cfefa1a27fd10459045dc | [
"MIT"
] | 47 | 2015-01-24T17:50:57.000Z | 2022-03-30T09:40:22.000Z | try:
from django.conf.urls import patterns, url
except ImportError:
# Compatibility with Django <= 1.3
from django.conf.urls.defaults import patterns, url
from jsonrpc.site import jsonrpc_site
urlpatterns = patterns('',
url(r'^json/browse/$', 'jsonrpc.views.browse', name='jsonrpc_browser'),
url(r'^json/$', ... | 31.357143 | 73 | 0.71754 | try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
from jsonrpc.site import jsonrpc_site
urlpatterns = patterns('',
url(r'^json/browse/$', 'jsonrpc.views.browse', name='jsonrpc_browser'),
url(r'^json/$', jsonrpc_site.dispatch, name='jsonrp... | true | true |
1c48c26137216ab70c99b8c6f1171a552774911f | 2,661 | py | Python | tests/components/recorder/test_migrate.py | atemon/home-assistant | dbd0763f83d0857fceb00e2c973a4ec91663ddcf | [
"Apache-2.0"
] | 1 | 2018-08-25T06:08:21.000Z | 2018-08-25T06:08:21.000Z | tests/components/recorder/test_migrate.py | atemon/home-assistant | dbd0763f83d0857fceb00e2c973a4ec91663ddcf | [
"Apache-2.0"
] | 2 | 2018-08-25T06:13:22.000Z | 2018-08-25T07:00:54.000Z | tests/components/recorder/test_migrate.py | sara0871/desktop | e1b2e00cf67452828c021e3d73c76e00b72bd3ad | [
"Apache-2.0"
] | null | null | null | """The tests for the Recorder component."""
# pylint: disable=protected-access
import asyncio
from unittest.mock import patch, call
import pytest
from sqlalchemy import create_engine
from sqlalchemy.pool import StaticPool
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.recorder... | 32.060241 | 79 | 0.687336 | import asyncio
from unittest.mock import patch, call
import pytest
from sqlalchemy import create_engine
from sqlalchemy.pool import StaticPool
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.recorder import (
wait_connection_ready, migration, const, models)
from tests.compo... | true | true |
1c48c281c263bc634f99ad847437ff2fe1b8daa5 | 31,849 | py | Python | mne/decoding/transformer.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/decoding/transformer.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/decoding/transformer.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T12:45:31.000Z | 2021-04-12T12:45:31.000Z | # -*- coding: utf-8 -*-
# Authors: Mainak Jas <mainak@neuro.hut.fi>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <trachelr@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from .mixin import TransformerMixin
from .base import BaseEstimator
from .. import ... | 37.033721 | 97 | 0.586392 |
import numpy as np
from .mixin import TransformerMixin
from .base import BaseEstimator
from .. import pick_types
from ..filter import filter_data, _triage_filter_params
from ..time_frequency.psd import psd_array_multitaper
from ..externals.six import string_types
from ..utils import _check_type_picks, check_version
... | true | true |
1c48c2b07f578561a5bd3b8cc4d3319e4282e76e | 2,291 | py | Python | steampipe_alchemy/models/aws_codebuild_project.py | RyanJarv/steampipe_alchemy | c8a31303252c1bd8d83d0f9c429d7d0ef7e1690f | [
"BSD-3-Clause"
] | 9 | 2021-04-21T04:21:01.000Z | 2021-06-19T19:33:36.000Z | steampipe_alchemy/models/aws_codebuild_project.py | RyanJarv/steampipe_alchemy | c8a31303252c1bd8d83d0f9c429d7d0ef7e1690f | [
"BSD-3-Clause"
] | null | null | null | steampipe_alchemy/models/aws_codebuild_project.py | RyanJarv/steampipe_alchemy | c8a31303252c1bd8d83d0f9c429d7d0ef7e1690f | [
"BSD-3-Clause"
] | 1 | 2021-04-26T21:08:20.000Z | 2021-04-26T21:08:20.000Z | from sqlalchemy import Column
from sqlalchemy.types import JSON, Text, Boolean, TIMESTAMP, BigInteger
from sqlalchemy.dialects import postgresql as psql
from steampipe_alchemy.mixins import FormatMixins
from steampipe_alchemy import Base
class AwsCodebuildProject(Base, FormatMixins):
__tablename__ = 'aws_codebuil... | 57.275 | 94 | 0.746399 | from sqlalchemy import Column
from sqlalchemy.types import JSON, Text, Boolean, TIMESTAMP, BigInteger
from sqlalchemy.dialects import postgresql as psql
from steampipe_alchemy.mixins import FormatMixins
from steampipe_alchemy import Base
class AwsCodebuildProject(Base, FormatMixins):
__tablename__ = 'aws_codebuil... | true | true |
1c48c3c2ebc8d2ba708e1b653f7bc8c9eea2bfcb | 36,395 | py | Python | deutschland/polizei_brandenburg/api_client.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/polizei_brandenburg/api_client.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/polizei_brandenburg/api_client.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Polizei Brandenburg: App
Polizei Brandenburg Nachrichten, Hochwasser-, Verkehrs- und Waldbrandwarnungen # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import json
import atexit
import mimetypes
from multiprocessing.pool import ThreadPool... | 38.189927 | 98 | 0.572908 |
import json
import atexit
import mimetypes
from multiprocessing.pool import ThreadPool
import io
import os
import re
import typing
from urllib.parse import quote
from urllib3.fields import RequestField
from deutschland.polizei_brandenburg import rest
from deutschland.polizei_brandenburg.configuration import Configu... | true | true |
1c48c4ba54570e45f887298ee9e4673315687b4d | 17,349 | py | Python | tools/nocompile_driver.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | tools/nocompile_driver.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | tools/nocompile_driver.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Implements a simple "negative compile" test for C++ on linux.
Sometimes a C++ API needs to ensure that various usages cannot co... | 35.62423 | 80 | 0.683152 |
import StringIO
import ast
import locale
import os
import re
import select
import shlex
import subprocess
import sys
import time
NCTEST_CONFIG_RE = re.compile(r'^#(?:el)?if.*\s+(\S*NCTEST\S*)\s*(//.*)?')
STRIP_DEFINED_RE = re.compile(r'defined\((.*)\)')
#
# The extracted substring should be a python array of re... | true | true |
1c48c5eaecd04f40d264f244194b5aa2a851e574 | 180 | py | Python | tests/unit/output/test_s3.py | gyliu513/dvc | d932405ee148767c5dbbbc394d6cd414270bf8f0 | [
"Apache-2.0"
] | 2 | 2019-06-23T14:24:48.000Z | 2019-07-08T12:22:53.000Z | tests/unit/output/test_s3.py | dnabanita7/dvc | 638aaa254ea475947545edd046116befe82040f1 | [
"Apache-2.0"
] | null | null | null | tests/unit/output/test_s3.py | dnabanita7/dvc | 638aaa254ea475947545edd046116befe82040f1 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:29:40.000Z | 2019-09-02T00:29:40.000Z | from dvc.output.s3 import OutputS3
from tests.unit.output.test_local import TestOutputLOCAL
class TestOutputS3(TestOutputLOCAL):
def _get_cls(self):
return OutputS3
| 20 | 56 | 0.777778 | from dvc.output.s3 import OutputS3
from tests.unit.output.test_local import TestOutputLOCAL
class TestOutputS3(TestOutputLOCAL):
def _get_cls(self):
return OutputS3
| true | true |
1c48c5ee2edd81fc4846841b50a8f02464e6c22c | 205 | py | Python | GUITKinter/Label and Entry.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | GUITKinter/Label and Entry.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | GUITKinter/Label and Entry.py | zysundar/Python_programming | 51384ecd2dfdb2cfe94b67605ca49bbd7edf49b6 | [
"bzip2-1.0.6"
] | null | null | null | from Tkinter import*
t=Tk()
l=Label(t,text="user name")
m=Label(t,text="password")
l.pack(side=LEFT)
m.pack(side=CENTER)
e=Entry(t,bd=5)
f=Entry(t,bd=6)
e.pack(side=RIGHT)
f.pack()
t.mainloop()
| 17.083333 | 28 | 0.653659 | from Tkinter import*
t=Tk()
l=Label(t,text="user name")
m=Label(t,text="password")
l.pack(side=LEFT)
m.pack(side=CENTER)
e=Entry(t,bd=5)
f=Entry(t,bd=6)
e.pack(side=RIGHT)
f.pack()
t.mainloop()
| true | true |
1c48c659be69a411c3a89d94e86e6ed9d0376790 | 19,843 | py | Python | packit/local_project.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | packit/local_project.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | packit/local_project.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 37.510397 | 95 | 0.600615 |
import logging
import shutil
from contextlib import contextmanager
from pathlib import Path
from typing import Optional, Union, Iterable, Iterator
import git
from ogr import GitlabService
from ogr.abstract import GitProject, GitService
from ogr.parsing import parse_git_repo
from packit.exceptions import PackitExcep... | true | true |
1c48c6886726c1cb9b76872b441d3af09b2da743 | 682 | py | Python | string/substring_search/brute_force.py | ImadDabbura/data-structures-and-algorithms | d8eaf545ddcd443a1b36483337c778587bf52366 | [
"Apache-2.0"
] | null | null | null | string/substring_search/brute_force.py | ImadDabbura/data-structures-and-algorithms | d8eaf545ddcd443a1b36483337c778587bf52366 | [
"Apache-2.0"
] | null | null | null | string/substring_search/brute_force.py | ImadDabbura/data-structures-and-algorithms | d8eaf545ddcd443a1b36483337c778587bf52366 | [
"Apache-2.0"
] | null | null | null | """Implementation of Brute-Force algorithm of substring search."""
def find_brute_force(T, P):
"""Return the index of first occurance of P; otherwise, returns -1."""
n, m = len(T), len(P)
if m == 0:
return 0
for i in range(n - m + 1):
j = 0
while j < m and T[i + j] == P[j]:
... | 20.666667 | 74 | 0.428152 |
def find_brute_force(T, P):
n, m = len(T), len(P)
if m == 0:
return 0
for i in range(n - m + 1):
j = 0
while j < m and T[i + j] == P[j]:
j += 1
if j == m:
return i
return -1
def find_brute_force_v1(T, P):
n, m = len(T), len(P)
if m == 0... | true | true |
1c48c79e0c90a3d612b502860b62b83d4205477d | 11,545 | py | Python | drl_negotiation/core.py | YueNing/tn_source_code | 515713c9349a2444021fdc9b02fd483f5ffd3e56 | [
"MIT"
] | null | null | null | drl_negotiation/core.py | YueNing/tn_source_code | 515713c9349a2444021fdc9b02fd483f5ffd3e56 | [
"MIT"
] | null | null | null | drl_negotiation/core.py | YueNing/tn_source_code | 515713c9349a2444021fdc9b02fd483f5ffd3e56 | [
"MIT"
] | null | null | null | '''
Core class, functions
Author: naodongbanana
E-Mail: n1085633848@outlook.com
'''
import os, sys
import numpy as np
from scml.scml2020 import SCML2020World, SCML2020Agent, is_system_agent
from typing import Optional
from drl_negotiation.hyperparameters import *
import yaml
import copy
import pickle
clas... | 32.158774 | 122 | 0.569684 | import os, sys
import numpy as np
from scml.scml2020 import SCML2020World, SCML2020Agent, is_system_agent
from typing import Optional
from drl_negotiation.hyperparameters import *
import yaml
import copy
import pickle
class AgentState:
def __init__(self):
self.p_pos = (0, 0)
self.o... | true | true |
1c48c84f8ee59e6804807e245e7a717305b54ca8 | 20,452 | py | Python | course/analytics.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 284 | 2015-01-09T12:02:28.000Z | 2022-03-27T14:30:46.000Z | course/analytics.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 799 | 2015-02-26T08:49:46.000Z | 2022-03-31T16:09:26.000Z | course/analytics.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 120 | 2015-01-30T18:00:56.000Z | 2022-03-28T06:24:43.000Z | __copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | 34.547297 | 85 | 0.583953 | __copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | true | true |
1c48ca72aee02d8e1582caaa2ffbd93fd9a5f68a | 35,864 | py | Python | angr/analyses/reaching_definitions/engine_ail.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | 1 | 2021-05-21T02:41:28.000Z | 2021-05-21T02:41:28.000Z | angr/analyses/reaching_definitions/engine_ail.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/reaching_definitions/engine_ail.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | null | null | null | from itertools import chain
from typing import Iterable, Optional
import logging
import archinfo
import claripy
import ailment
from ...engines.light import SimEngineLight, SimEngineLightAILMixin, SpOffset
from ...errors import SimEngineError, SimMemoryMissingError
from ...calling_conventions import DEFAULT_CC, SimReg... | 42.644471 | 136 | 0.615687 | from itertools import chain
from typing import Iterable, Optional
import logging
import archinfo
import claripy
import ailment
from ...engines.light import SimEngineLight, SimEngineLightAILMixin, SpOffset
from ...errors import SimEngineError, SimMemoryMissingError
from ...calling_conventions import DEFAULT_CC, SimReg... | true | true |
1c48ca8060baf98f40b83661b0b59646600fa52c | 2,589 | py | Python | toolcraft/tools/__base__.py | SpikingNeurons/toolcraft | 7290fa70a5d2680ebacf1bc421efaf09545f7c7e | [
"BSD-3-Clause"
] | 6 | 2021-04-06T09:27:48.000Z | 2021-12-17T02:13:11.000Z | toolcraft/tools/__base__.py | SpikingNeurons/toolcraft | 7290fa70a5d2680ebacf1bc421efaf09545f7c7e | [
"BSD-3-Clause"
] | 57 | 2021-03-19T07:33:13.000Z | 2022-03-30T18:59:29.000Z | toolcraft/tools/__base__.py | SpikingNeurons/toolcraft | 7290fa70a5d2680ebacf1bc421efaf09545f7c7e | [
"BSD-3-Clause"
] | 2 | 2021-04-08T18:24:36.000Z | 2021-04-08T22:40:50.000Z | """
Get inspirations from
https://github.com/python-poetry/poetry/tree/master/poetry/console/commands
"""
import abc
import inspect
import typer
import typing as t
from .. import error as e
from .. import logger
APP = typer.Typer(name="toolcraft")
_LOGGER = logger.get_logger()
class Tool(abc.ABC):
AVAILABLE_... | 31.192771 | 80 | 0.445732 |
import abc
import inspect
import typer
import typing as t
from .. import error as e
from .. import logger
APP = typer.Typer(name="toolcraft")
_LOGGER = logger.get_logger()
class Tool(abc.ABC):
AVAILABLE_TOOL_CLASSES = {}
def __init_subclass__(cls, **kwargs):
global APP
... | true | true |
1c48cbc22c51d021fa49f06c4e01f0e308d3c262 | 264 | py | Python | configs/unet/deeplabv3_unet_s5-d16_ce-1.0-dice-3.0_128x128_40k_chase-db1.py | heytanay/mmsegmentation | 7ddd2fe2ecff9c95999bd00ec05cc37eafb558f8 | [
"Apache-2.0"
] | 11 | 2022-02-04T01:09:45.000Z | 2022-03-08T05:49:16.000Z | configs/unet/deeplabv3_unet_s5-d16_ce-1.0-dice-3.0_128x128_40k_chase-db1.py | heytanay/mmsegmentation | 7ddd2fe2ecff9c95999bd00ec05cc37eafb558f8 | [
"Apache-2.0"
] | 2 | 2022-02-25T03:07:23.000Z | 2022-03-08T12:54:05.000Z | configs/unet/deeplabv3_unet_s5-d16_ce-1.0-dice-3.0_128x128_40k_chase-db1.py | heytanay/mmsegmentation | 7ddd2fe2ecff9c95999bd00ec05cc37eafb558f8 | [
"Apache-2.0"
] | 1 | 2022-01-25T05:13:37.000Z | 2022-01-25T05:13:37.000Z | _base_ = './deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py'
model = dict(
decode_head=dict(loss_decode=[
dict(type='CrossEntropyLoss', loss_name='loss_ce', loss_weight=1.0),
dict(type='DiceLoss', loss_name='loss_dice', loss_weight=3.0)
]))
| 37.714286 | 76 | 0.700758 | _base_ = './deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py'
model = dict(
decode_head=dict(loss_decode=[
dict(type='CrossEntropyLoss', loss_name='loss_ce', loss_weight=1.0),
dict(type='DiceLoss', loss_name='loss_dice', loss_weight=3.0)
]))
| true | true |
1c48cc2f520b1dcd46156055cdb4f50c8d087a8d | 2,035 | py | Python | actions/lib/actions.py | xod442/stackstorm-hpe-arubacx | d790c7dfd75a61131d5c89204e59ee6362db1563 | [
"Apache-2.0"
] | null | null | null | actions/lib/actions.py | xod442/stackstorm-hpe-arubacx | d790c7dfd75a61131d5c89204e59ee6362db1563 | [
"Apache-2.0"
] | null | null | null | actions/lib/actions.py | xod442/stackstorm-hpe-arubacx | d790c7dfd75a61131d5c89204e59ee6362db1563 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# 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
# (C) Copyright 2019-2020 Hewlett Packard Enterprise Development LP.
# http://www.apache.org/licenses/LICENSE-2.0
# Unl... | 41.530612 | 124 | 0.710565 |
import requests
from st2common.runners.base_action import Action
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import logging
logging.basicConfig(level=logging.INFO)
from pyaoscx import session
class ArubaCxBaseAction(Act... | true | true |
1c48cc5812f28abb373c572416f41aba50d03e9c | 25,683 | py | Python | Lib/site-packages/ginga/AstroImage.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | Lib/site-packages/ginga/AstroImage.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/ginga/AstroImage.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | #
# AstroImage.py -- Abstraction of an astronomical data image.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import math
import traceback
import numpy
from ginga.util import wcsmod, io_fits
from ginga.util import wcs, iqcalc
from ginga.Base... | 36.021038 | 79 | 0.539501 | import sys
import math
import traceback
import numpy
from ginga.util import wcsmod, io_fits
from ginga.util import wcs, iqcalc
from ginga.BaseImage import BaseImage, ImageError, Header
from ginga.misc import Bunch
from ginga import trcalc
import ginga.util.six as six
from ginga.util.six.moves import map
class Astro... | true | true |
1c48cd2d9e1d346720ef488aece053fcba1c3248 | 1,098 | py | Python | datasets.py | beiyan1911/conditional_aia_generation | 0ace640d6e8dae41b63f26809a494b88cc3718e2 | [
"Apache-2.0"
] | 1 | 2020-12-22T07:20:41.000Z | 2020-12-22T07:20:41.000Z | datasets.py | beiyan1911/conditional_aia_generation | 0ace640d6e8dae41b63f26809a494b88cc3718e2 | [
"Apache-2.0"
] | null | null | null | datasets.py | beiyan1911/conditional_aia_generation | 0ace640d6e8dae41b63f26809a494b88cc3718e2 | [
"Apache-2.0"
] | null | null | null | import os.path
import torch
from glob2 import glob
from torch.utils.data.dataset import Dataset
from utils.him import fitsread
import numpy as np
class AIADataset(Dataset):
def __init__(self, dataroot):
self.paths = sorted(glob(os.path.join(dataroot, '*.fits')))
# ['0211', '0094', '0335', '0193'... | 27.45 | 72 | 0.634791 | import os.path
import torch
from glob2 import glob
from torch.utils.data.dataset import Dataset
from utils.him import fitsread
import numpy as np
class AIADataset(Dataset):
def __init__(self, dataroot):
self.paths = sorted(glob(os.path.join(dataroot, '*.fits')))
def __getitem__(self, index)... | true | true |
1c48cdbe52c0570a8ac0c75a70c17a69f2868711 | 1,458 | py | Python | frontends/pytorch/test/torchscript_e2e_test/non_tensor_values.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/test/torchscript_e2e_test/non_tensor_values.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | frontends/pytorch/test/torchscript_e2e_test/non_tensor_values.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See frontends/pytorch/LICENSE for license information.
# RUN: %PYTHON %s | FileCheck %s
from typing import List, Tuple, Dict
import torch
from torch_mlir_torchscript.e2e_test.framework import run_tests, TestUtils
from torch_mlir_torchscript.e2... | 26.509091 | 93 | 0.719479 |
from typing import List, Tuple, Dict
import torch
from torch_mlir_torchscript.e2e_test.framework import run_tests, TestUtils
from torch_mlir_torchscript.e2e_test.reporting import report_results
from torch_mlir_torchscript.e2e_test.registry import register_test_case, GLOBAL_TEST_REGISTRY
from torch_mlir_torchscript_... | true | true |
1c48ce53b36f7084a676a404e3f19be8f4b536a5 | 3,668 | py | Python | player.py | skyleewu/snakepit-game | f53a1e90a77160fda917037a81287a2a8534a4c9 | [
"Unlicense"
] | null | null | null | player.py | skyleewu/snakepit-game | f53a1e90a77160fda917037a81287a2a8534a4c9 | [
"Unlicense"
] | null | null | null | player.py | skyleewu/snakepit-game | f53a1e90a77160fda917037a81287a2a8534a4c9 | [
"Unlicense"
] | null | null | null | from collections import deque
from random import randint
import settings
from datatypes import Vector, Position, Draw
class Player:
HEAD_CHAR = "@"
BODY_CHAR = "*"
TAIL_CHAR = "+"
DEAD_HEAD_CHAR = "x"
DEAD_BODY_CHAR = "*"
DEAD_TAIL_CHAR = "+"
UP = Vector(0, -1)
DOWN = Vector(0, 1)
... | 31.084746 | 73 | 0.541985 | from collections import deque
from random import randint
import settings
from datatypes import Vector, Position, Draw
class Player:
HEAD_CHAR = "@"
BODY_CHAR = "*"
TAIL_CHAR = "+"
DEAD_HEAD_CHAR = "x"
DEAD_BODY_CHAR = "*"
DEAD_TAIL_CHAR = "+"
UP = Vector(0, -1)
DOWN = Vector(0, 1)
... | true | true |
1c48ce63cd1200fddbaf276b7685924b6e07921f | 706 | py | Python | ipm_library/ipm_library/exceptions.py | ijnek/ipm | dee4f2ac99f5d24bd0d2a8c9ff7c748b74727a2f | [
"Apache-2.0"
] | 3 | 2022-03-04T15:06:16.000Z | 2022-03-15T04:00:18.000Z | ipm_library/ipm_library/exceptions.py | ijnek/ipm | dee4f2ac99f5d24bd0d2a8c9ff7c748b74727a2f | [
"Apache-2.0"
] | 4 | 2022-03-04T13:52:57.000Z | 2022-03-27T00:59:08.000Z | ipm_library/ipm_library/exceptions.py | ijnek/ipm | dee4f2ac99f5d24bd0d2a8c9ff7c748b74727a2f | [
"Apache-2.0"
] | 2 | 2022-03-04T10:19:35.000Z | 2022-03-15T01:05:00.000Z | # Copyright (c) 2022 Hamburg Bit-Bots
#
# 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 ... | 35.3 | 74 | 0.749292 |
class NoIntersectionError(Exception):
pass
| true | true |
1c48ced8318bfbf20b62fbc295652a0d570fd2fd | 4,262 | py | Python | examples/cifar_generator_cnn.py | vishalbelsare/hyperas | add2baeaa67a90cb456934395c3bb81ee431a08d | [
"MIT"
] | 2,289 | 2016-02-19T18:27:31.000Z | 2022-03-31T07:25:09.000Z | examples/cifar_generator_cnn.py | vishalbelsare/hyperas | add2baeaa67a90cb456934395c3bb81ee431a08d | [
"MIT"
] | 278 | 2016-02-21T12:53:47.000Z | 2022-03-19T17:37:41.000Z | examples/cifar_generator_cnn.py | vishalbelsare/hyperas | add2baeaa67a90cb456934395c3bb81ee431a08d | [
"MIT"
] | 375 | 2016-02-19T22:38:36.000Z | 2022-02-14T15:48:49.000Z | from __future__ import print_function
from hyperopt import Trials, STATUS_OK, tpe
from hyperas import optim
from hyperas.distributions import uniform
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
f... | 37.385965 | 94 | 0.658611 | from __future__ import print_function
from hyperopt import Trials, STATUS_OK, tpe
from hyperas import optim
from hyperas.distributions import uniform
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
f... | true | true |
1c48cf233b933b90261ca7a69c9a0870d84e1bbe | 1,369 | py | Python | launch/coverage.launch.py | slaghuis/coverage_planner | 4598f2d4aa5baa1ce8aa0078d105fd3d46003e1d | [
"Apache-2.0"
] | null | null | null | launch/coverage.launch.py | slaghuis/coverage_planner | 4598f2d4aa5baa1ce8aa0078d105fd3d46003e1d | [
"Apache-2.0"
] | null | null | null | launch/coverage.launch.py | slaghuis/coverage_planner | 4598f2d4aa5baa1ce8aa0078d105fd3d46003e1d | [
"Apache-2.0"
] | null | null | null | import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
camera_model_node=Node(
package = 'coverage_planner',
name = 'camera_model_node'... | 27.38 | 67 | 0.592403 | import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
camera_model_node=Node(
package = 'coverage_planner',
name = 'camera_model_node'... | true | true |
1c48d153497615a5075c13da9738840fefede36e | 400 | py | Python | spacy/tests/regression/test_issue781.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | 1 | 2017-11-18T08:53:26.000Z | 2017-11-18T08:53:26.000Z | spacy/tests/regression/test_issue781.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | null | null | null | spacy/tests/regression/test_issue781.py | yuukos/spaCy | e4125383ed7221910ea955eae9b623c02bda64d8 | [
"MIT"
] | 1 | 2018-08-25T03:09:50.000Z | 2018-08-25T03:09:50.000Z | # coding: utf-8
from __future__ import unicode_literals
import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocalize", "colocaliz"])])
def test_issue781(lemmatizer, word, lemmas):
... | 36.363636 | 149 | 0.71 | from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocalize", "colocaliz"])])
def test_issue781(lemmatizer, word, lemmas):
assert lemmatizer(word, 'noun', morphology={'number': 'plur'}) =... | true | true |
1c48d3841e5d7930b22a82350f5553fce4cc1d03 | 7,109 | py | Python | pysnmp-with-texts/WWP-VOIP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/WWP-VOIP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/WWP-VOIP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module WWP-VOIP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WWP-VOIP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:38:53 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | 109.369231 | 790 | 0.775496 | OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion = mibBuilder.impo... | true | true |
1c48d3f7cece91094b32bb88862cd9d132609db8 | 2,541 | py | Python | tests/template_tests/test_nodelist.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 2 | 2015-01-21T15:45:07.000Z | 2015-02-21T02:38:13.000Z | tests/template_tests/test_nodelist.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | null | null | null | tests/template_tests/test_nodelist.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T08:23:34.000Z | 2020-10-01T08:23:34.000Z | from unittest import TestCase
from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
from django.test import override_settings
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_te... | 41.655738 | 132 | 0.599764 | from unittest import TestCase
from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
from django.test import override_settings
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_te... | true | true |
1c48d500ecd549e2db64c6c379a7463a7076eef5 | 22,662 | py | Python | tests/one_to_one/tests.py | downstreamimpact/django | 6686238cdc5c826ca5aab39d771798ff98e90ae8 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 9 | 2020-09-30T16:32:05.000Z | 2020-10-12T13:52:07.000Z | tests/one_to_one/tests.py | downstreamimpact/django | 6686238cdc5c826ca5aab39d771798ff98e90ae8 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 3 | 2016-05-15T22:05:14.000Z | 2019-11-02T15:58:14.000Z | tests/one_to_one/tests.py | downstreamimpact/django | 6686238cdc5c826ca5aab39d771798ff98e90ae8 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 4 | 2019-11-07T01:22:16.000Z | 2020-09-16T22:02:16.000Z | from django.db import IntegrityError, connection, transaction
from django.test import TestCase
from .models import (
Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel,
Place, Pointer, RelatedModel, Restaurant, School, Target, ToFieldPointer,
UndergroundBar, Waiter,
)
class OneToOneTes... | 41.278689 | 101 | 0.654532 | from django.db import IntegrityError, connection, transaction
from django.test import TestCase
from .models import (
Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel,
Place, Pointer, RelatedModel, Restaurant, School, Target, ToFieldPointer,
UndergroundBar, Waiter,
)
class OneToOneTes... | true | true |
1c48d5ad03091b3ee673df43f7d507922eb3e256 | 1,060 | py | Python | kubernetes/test/test_extensions_v1beta1_ingress_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/test/test_extensions_v1beta1_ingress_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_extensions_v1beta1_ingress_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 23.555556 | 105 | 0.735849 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.extensions_v1beta1_ingress_list import ExtensionsV1beta1IngressList
class TestExtensionsV1beta1IngressList(unittest.TestCase):
de... | true | true |
1c48d5f9f9521e09c32013b687664465b262cec1 | 2,552 | py | Python | csgomenumaker/command/navstate/vertfolder.py | citrusCS/csgo-menu-maker | 60e055b4b6f61c7081fc231da47be51eb6e1d47f | [
"MIT"
] | 152 | 2019-03-11T23:05:34.000Z | 2022-03-11T08:09:21.000Z | csgomenumaker/command/navstate/vertfolder.py | citrusCS/csgo-menu-maker | 60e055b4b6f61c7081fc231da47be51eb6e1d47f | [
"MIT"
] | 6 | 2019-03-12T11:22:09.000Z | 2020-06-23T05:53:45.000Z | csgomenumaker/command/navstate/vertfolder.py | citrusCS/csgo-menu-maker | 60e055b4b6f61c7081fc231da47be51eb6e1d47f | [
"MIT"
] | 15 | 2019-03-12T06:52:29.000Z | 2021-08-30T18:26:34.000Z | from ..compound import Compound
from ..placeholder import Placeholder
from ..primitive import Primitive
from .navstate import NavState
from .horz import Horz
class VertFolder(NavState):
"""
A vertical state transitioner, that also holds recursive children.
VertFolder instances are toggled between by pre... | 32.717949 | 79 | 0.59953 | from ..compound import Compound
from ..placeholder import Placeholder
from ..primitive import Primitive
from .navstate import NavState
from .horz import Horz
class VertFolder(NavState):
def __init__(self, parent):
NavState.__init__(self, parent)
self.cls = "nav-vert-folder"
... | true | true |
1c48d60e2e51be10bc73f9a18624f1051be55abb | 2,225 | py | Python | test_gym.py | Ferch42/PyDSRL | bd9ea3e739c837db0db5052f7db23476fa21c472 | [
"MIT"
] | null | null | null | test_gym.py | Ferch42/PyDSRL | bd9ea3e739c837db0db5052f7db23476fa21c472 | [
"MIT"
] | null | null | null | test_gym.py | Ferch42/PyDSRL | bd9ea3e739c837db0db5052f7db23476fa21c472 | [
"MIT"
] | null | null | null | '''Random-action tester for gym environments'''
import argparse
import pprint
import gym
from gym_recording.wrappers import TraceRecordingWrapper
import os
import cross_circle_gym # Required, registers the environments.
class RandomAgent(object):
"""The world's simplest agent!"""
def __init__(se... | 29.276316 | 89 | 0.622022 | import argparse
import pprint
import gym
from gym_recording.wrappers import TraceRecordingWrapper
import os
import cross_circle_gym
class RandomAgent(object):
def __init__(self, action_space, switch_action_every=1):
self.action_space = action_space
self.switch_action_every = switch_ac... | true | true |
1c48d64f5158e5505be85364f278ac2439138204 | 46 | py | Python | imagepy/tools/Measure/angle2_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/angle2_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/angle2_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | from sciapp.action import SlopeTool as Plugin
| 23 | 45 | 0.847826 | from sciapp.action import SlopeTool as Plugin
| true | true |
1c48d7fa080b1b6f933ed8da341f10f785b48c3d | 15,598 | py | Python | main.py | dinhhungGM/Telegram-Bot | f7250a505138c1a1957f5dd92da63e36e4bd70c4 | [
"MIT"
] | null | null | null | main.py | dinhhungGM/Telegram-Bot | f7250a505138c1a1957f5dd92da63e36e4bd70c4 | [
"MIT"
] | null | null | null | main.py | dinhhungGM/Telegram-Bot | f7250a505138c1a1957f5dd92da63e36e4bd70c4 | [
"MIT"
] | null | null | null | # --------------------------------------------- #
# Plugin Name : TelegramAirdropBot #
# Author Name : fabston #
# File Name : main.py #
# --------------------------------------------- #
import re
import ssl
from io import BytesIO
from time import gmtime, ... | 35.369615 | 170 | 0.57174 |
import re
import ssl
from io import BytesIO
from time import gmtime, strftime
import pymysql
import telebot
from aiohttp import web
from telebot import types
from telebot.types import InlineKeyboardButton, InlineKeyboardMarkup
import config
WEBHOOK_HOST = config.host
WEBHOOK_PORT = 8443 WEBHOOK_LISTEN = "0.0.0.0" ... | true | true |
1c48d8e95699fa6a9ffe7920b5539dd0a6b34075 | 1,433 | py | Python | nanome/_internal/_structure/_workspace.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | nanome/_internal/_structure/_workspace.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | nanome/_internal/_structure/_workspace.py | rramji/nanome-lib | 2806598af31cfb4bb6e16366f0b300d2ddcc9c13 | [
"MIT"
] | null | null | null | from nanome.util import Vector3, Quaternion, Logs
from . import _Base
class _Workspace(_Base):
@classmethod
def _create(cls):
return cls()
def __init__(self):
self._position = Vector3()
self._rotation = Quaternion()
self._scale = Vector3(0.02,0.02,0.02)
self._compl... | 27.557692 | 68 | 0.563852 | from nanome.util import Vector3, Quaternion, Logs
from . import _Base
class _Workspace(_Base):
@classmethod
def _create(cls):
return cls()
def __init__(self):
self._position = Vector3()
self._rotation = Quaternion()
self._scale = Vector3(0.02,0.02,0.02)
self._compl... | true | true |
1c48d9151eed8e1af38217f84b6e4a7624f59829 | 49,261 | py | Python | tensorflow/python/ops/variables.py | ml-resources/tensorflow | 4ecd72b68cd70c3930551aebbf0c80badc301d28 | [
"Apache-2.0"
] | 1 | 2019-06-19T08:43:26.000Z | 2019-06-19T08:43:26.000Z | tensorflow/python/ops/variables.py | liudgit/tensorflow | 4ecd72b68cd70c3930551aebbf0c80badc301d28 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/variables.py | liudgit/tensorflow | 4ecd72b68cd70c3930551aebbf0c80badc301d28 | [
"Apache-2.0"
] | 1 | 2019-06-19T08:43:23.000Z | 2019-06-19T08:43:23.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.010518 | 104 | 0.692982 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import variable_pb2
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow... | true | true |
1c48d95179ea72c37d482d0eb02137ad50a8ff23 | 8,888 | py | Python | mysqloperator/controller/group_monitor.py | sjmudd/mysql-operator | 415dd8eae02a8909c2b85c4653b34525c74e388a | [
"Apache-2.0"
] | 206 | 2021-05-28T16:45:10.000Z | 2022-03-31T03:08:15.000Z | mysqloperator/controller/group_monitor.py | sjmudd/mysql-operator | 415dd8eae02a8909c2b85c4653b34525c74e388a | [
"Apache-2.0"
] | 6 | 2021-06-20T05:52:28.000Z | 2022-03-14T14:08:41.000Z | mysqloperator/controller/group_monitor.py | sjmudd/mysql-operator | 415dd8eae02a8909c2b85c4653b34525c74e388a | [
"Apache-2.0"
] | 37 | 2021-06-12T11:36:43.000Z | 2022-03-26T07:32:16.000Z | # Copyright (c) 2020, 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
#
from logging import Logger
from typing import Callable, Optional, TYPE_CHECKING, Tuple
from mysqloperator.controller.innodbcluster.cluster_api import I... | 37.344538 | 140 | 0.57212 |
from logging import Logger
from typing import Callable, Optional, TYPE_CHECKING, Tuple
from mysqloperator.controller.innodbcluster.cluster_api import InnoDBCluster
from mysqloperator.controller.shellutils import RetryLoop
from . import shellutils
import threading
import time
import select
import mysqlsh
mysql = mys... | true | true |
1c48da8dfc2b9932134f31843ace90d77afe7978 | 1,684 | py | Python | main02_ceres_data.py | timothyfisherphd/CRISPR_Cancer_Chromatin_State_Activity | 91cbd8519baaeccab404574d61e21dbf0ea1f26f | [
"MIT"
] | null | null | null | main02_ceres_data.py | timothyfisherphd/CRISPR_Cancer_Chromatin_State_Activity | 91cbd8519baaeccab404574d61e21dbf0ea1f26f | [
"MIT"
] | null | null | null | main02_ceres_data.py | timothyfisherphd/CRISPR_Cancer_Chromatin_State_Activity | 91cbd8519baaeccab404574d61e21dbf0ea1f26f | [
"MIT"
] | null | null | null | ## Generating Ceres Data
from collections import defaultdict
import pandas as pd
mainDicticionary=defaultdict(list)
stateDictionary=defaultdict(list)
countScoreDictionary=defaultdict(int)
sumScoreDictionary=defaultdict(int)
meanScoreDictionary=defaultdict(int)
n = 0
with open('/Users/timothyfisher/Desktop/Ernst_Lab/U... | 37.422222 | 129 | 0.723278 | from collections import defaultdict
import pandas as pd
mainDicticionary=defaultdict(list)
stateDictionary=defaultdict(list)
countScoreDictionary=defaultdict(int)
sumScoreDictionary=defaultdict(int)
meanScoreDictionary=defaultdict(int)
n = 0
with open('/Users/timothyfisher/Desktop/Ernst_Lab/UNIX/Updated_Dataset/ceres... | true | true |
1c48db3dfcc306004b247938a6279a060b4dde3d | 9,875 | py | Python | eslearn/GUI/easylearn_main_run.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | null | null | null | eslearn/GUI/easylearn_main_run.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | null | null | null | eslearn/GUI/easylearn_main_run.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 1 | 2021-01-11T08:21:35.000Z | 2021-01-11T08:21:35.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Main GUI of the easylearn
# Author: Chao Li <lichao19870617@gmail.com>
# License: MIT
"""
import sys
import os
import json
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QFileDialog
from PyQt5.QtGui import QIcon, QPixmap
from eslearn.stylesheets.Py... | 41.317992 | 180 | 0.650937 |
import sys
import os
import json
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QFileDialog
from PyQt5.QtGui import QIcon, QPixmap
from eslearn.stylesheets.PyQt5_stylesheets import PyQt5_stylesheets
from easylearn_main_gui import Ui_MainWindow
from easylearn_data_loading_run import EasylearnData... | true | true |
1c48dbbbe0ab9bd7f9a2531556bee427f7b0a2e4 | 40,781 | py | Python | uamqp/message.py | 123Jun321/azure-uamqp-python | b67e4fcaf2e8a337636947523570239c10a58ae2 | [
"MIT"
] | 1 | 2021-07-07T06:30:36.000Z | 2021-07-07T06:30:36.000Z | uamqp/message.py | 123Jun321/azure-uamqp-python | b67e4fcaf2e8a337636947523570239c10a58ae2 | [
"MIT"
] | null | null | null | uamqp/message.py | 123Jun321/azure-uamqp-python | b67e4fcaf2e8a337636947523570239c10a58ae2 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylint: d... | 40.457341 | 113 | 0.650205 |
import logging
import six
from uamqp import c_uamqp, constants, errors, utils
_logger = logging.getLogger(__name__)
class Message(object):
def __init__(self,
body=None,
properties=None,
application_properties=None,
annotations=None,
... | true | true |
1c48dc019533b7b44efebbf56b81cc34c04251cd | 3,950 | py | Python | shortcuts/actions/scripting.py | alexander-akhmetov/python-shortcuts | 6d7b45fcf4e34d92e84370e147397422f096ba64 | [
"MIT"
] | 588 | 2018-09-23T20:39:15.000Z | 2022-03-27T13:02:48.000Z | shortcuts/actions/scripting.py | alexander-akhmetov/python-shortcuts | 6d7b45fcf4e34d92e84370e147397422f096ba64 | [
"MIT"
] | 63 | 2018-09-27T20:13:56.000Z | 2022-03-29T03:22:32.000Z | shortcuts/actions/scripting.py | alexander-akhmetov/python-shortcuts | 6d7b45fcf4e34d92e84370e147397422f096ba64 | [
"MIT"
] | 35 | 2018-09-24T03:37:49.000Z | 2021-07-05T07:32:04.000Z | from shortcuts.actions.base import (
BaseAction,
BooleanField,
ChoiceField,
Field,
FloatField,
GroupIDField,
IntegerField,
)
class NothingAction(BaseAction):
'''Nothing'''
itype = 'is.workflow.actions.nothing'
keyword = 'nothing'
class SetItemNameAction(BaseAction):
'''S... | 21.351351 | 88 | 0.672911 | from shortcuts.actions.base import (
BaseAction,
BooleanField,
ChoiceField,
Field,
FloatField,
GroupIDField,
IntegerField,
)
class NothingAction(BaseAction):
itype = 'is.workflow.actions.nothing'
keyword = 'nothing'
class SetItemNameAction(BaseAction):
... | true | true |
1c48dc75724e3f6c2006bc3255a52eac0f0e12c2 | 825 | py | Python | instaloader_test.py | sam5epi0l/bottuber | 098d3c74bd610f39c6e53c663bcd8e395cb3ecb4 | [
"MIT"
] | 91 | 2022-01-14T12:18:08.000Z | 2022-03-16T11:56:13.000Z | instaloader_test.py | pradeepjhuriya/bottuber | 098d3c74bd610f39c6e53c663bcd8e395cb3ecb4 | [
"MIT"
] | 6 | 2022-01-21T09:05:57.000Z | 2022-03-17T08:31:44.000Z | instaloader_test.py | pradeepjhuriya/bottuber | 098d3c74bd610f39c6e53c663bcd8e395cb3ecb4 | [
"MIT"
] | 15 | 2022-01-17T15:27:00.000Z | 2022-03-28T16:43:05.000Z | from datetime import datetime
import instaloader
# Do not change
# instaloader downloads some posts under the hashtag urbanphotography
L = instaloader.Instaloader()
posts = instaloader.Hashtag.from_name(L.context, "urbanphotography").get_posts()
SINCE = datetime(2020, 5, 10) # further from today, inclusive
UNTIL =... | 25 | 80 | 0.637576 | from datetime import datetime
import instaloader
L = instaloader.Instaloader()
posts = instaloader.Hashtag.from_name(L.context, "urbanphotography").get_posts()
SINCE = datetime(2020, 5, 10) UNTIL = datetime(2020, 5, 11)
k = 0
for post in posts:
postdate = post.date
if postdate > UNTIL:
continu... | true | true |
1c48dcb2a20ec13231ae451adf850eda0f856561 | 2,084 | py | Python | PyBank/main.py | KristianSHamilton/python-challenge | 5fc9c62028fa5c792a48c3f7e758fac713b5bf4f | [
"MIT"
] | null | null | null | PyBank/main.py | KristianSHamilton/python-challenge | 5fc9c62028fa5c792a48c3f7e758fac713b5bf4f | [
"MIT"
] | null | null | null | PyBank/main.py | KristianSHamilton/python-challenge | 5fc9c62028fa5c792a48c3f7e758fac713b5bf4f | [
"MIT"
] | null | null | null | import os
import csv
monthsTotal = 0
profitTotal = 0
profitDelta = 0
profitPrior = 0
profitDeltaTotal = 0
profitDeltaGreatest = 0
profitDeltaLeast = 0
csvPath = os.path.join( ".","Resources","budget_data.csv")
Financial_Analysis_Export = os.path.join(".", "Analysis","Financial_Analysis.txt")
#Read CSV from path
with... | 33.079365 | 114 | 0.693378 | import os
import csv
monthsTotal = 0
profitTotal = 0
profitDelta = 0
profitPrior = 0
profitDeltaTotal = 0
profitDeltaGreatest = 0
profitDeltaLeast = 0
csvPath = os.path.join( ".","Resources","budget_data.csv")
Financial_Analysis_Export = os.path.join(".", "Analysis","Financial_Analysis.txt")
with open(csvPath) as cs... | true | true |
1c48de3928d99316fdc7080094a41cbcec3a248f | 5,721 | py | Python | ceilometer/tests/functional/api/v2/test_list_samples_scenarios.py | maestro-hybrid-cloud/ceilometer | 939cb080a193e14af8ceb44df3b631f5c2f6bf6d | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/functional/api/v2/test_list_samples_scenarios.py | maestro-hybrid-cloud/ceilometer | 939cb080a193e14af8ceb44df3b631f5c2f6bf6d | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/functional/api/v2/test_list_samples_scenarios.py | maestro-hybrid-cloud/ceilometer | 939cb080a193e14af8ceb44df3b631f5c2f6bf6d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 35.981132 | 78 | 0.500612 |
import datetime
import mock
from oslo_utils import timeutils
import six
from ceilometer.publisher import utils
from ceilometer import sample
from ceilometer.tests import db as tests_db
from ceilometer.tests.functional.api import v2
class TestListSamples(v2.FunctionalTest,
tests_db.MixinTestsW... | true | true |
1c48df74469efb5d2a9361dfd6676c5ce25809d5 | 1,722 | py | Python | scripts/kbcontrol.py | zkytony/thortils | 07ddfa6f6d09662094ba39343f89ba124c250e03 | [
"MIT"
] | null | null | null | scripts/kbcontrol.py | zkytony/thortils | 07ddfa6f6d09662094ba39343f89ba124c250e03 | [
"MIT"
] | null | null | null | scripts/kbcontrol.py | zkytony/thortils | 07ddfa6f6d09662094ba39343f89ba124c250e03 | [
"MIT"
] | null | null | null | # Keyboard control of Ai2Thor
import thortils
import thortils.constants as constants
from thortils.utils import getch
import argparse
import time
def print_controls(controls):
reverse = {controls[k]:k for k in controls}
ss =f"""
{reverse['MoveAhead']}
(MoveAhead)
{reverse['RotateLeft'... | 24.956522 | 103 | 0.573751 |
import thortils
import thortils.constants as constants
from thortils.utils import getch
import argparse
import time
def print_controls(controls):
reverse = {controls[k]:k for k in controls}
ss =f"""
{reverse['MoveAhead']}
(MoveAhead)
{reverse['RotateLeft']} {reverse['R... | true | true |
1c48dfb24d4b32da11dc3b82cac98790cf672df3 | 10,254 | py | Python | pyxform/tests_v1/test_randomize_itemsets.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | 1 | 2020-10-19T15:37:36.000Z | 2020-10-19T15:37:36.000Z | pyxform/tests_v1/test_randomize_itemsets.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | 1 | 2022-03-16T13:48:25.000Z | 2022-03-17T07:33:15.000Z | pyxform/tests_v1/test_randomize_itemsets.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Test randomize itemsets.
"""
from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class RandomizeItemsetsTest(PyxformTestCase):
def test_randomized_select_one(self):
self.assertPyxformXform(
name="data",
md="""
| survey | ... | 50.019512 | 125 | 0.302906 | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class RandomizeItemsetsTest(PyxformTestCase):
def test_randomized_select_one(self):
self.assertPyxformXform(
name="data",
md="""
| survey | | | | |
... | true | true |
1c48e0dea15ab95cf58d0a4ccc4269251a9520c7 | 12,741 | py | Python | dogepartylib/lib/messages/issuance.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 2 | 2016-01-31T18:13:11.000Z | 2020-05-08T23:54:55.000Z | dogepartylib/lib/messages/issuance.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 1 | 2015-11-07T10:17:05.000Z | 2015-11-07T10:17:05.000Z | dogepartylib/lib/messages/issuance.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 2 | 2015-11-03T19:12:02.000Z | 2021-12-18T04:48:52.000Z | #! /usr/bin/python3
"""
Allow simultaneous lock and transfer.
"""
import struct
import decimal
D = decimal.Decimal
from dogepartylib.lib import (config, util, exceptions, util)
FORMAT_1 = '>QQ?'
LENGTH_1 = 8 + 8 + 1
FORMAT_2 = '>QQ??If'
LENGTH_2 = 8 + 8 + 1 + 1 + 4 + 4
ID = 20
# NOTE: Pascal strings are used for st... | 42.188742 | 234 | 0.599874 |
import struct
import decimal
D = decimal.Decimal
from dogepartylib.lib import (config, util, exceptions, util)
FORMAT_1 = '>QQ?'
LENGTH_1 = 8 + 8 + 1
FORMAT_2 = '>QQ??If'
LENGTH_2 = 8 + 8 + 1 + 1 + 4 + 4
ID = 20
def initialise(db):
cursor = db.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS issuances... | true | true |
1c48e156aedf36e3dbe9148bea6fd63d46a9b547 | 160 | py | Python | example/__init__.py | roberto-prevato-test-org/GitHubActionsLab | d74029bb6c3b09735f6ef55784cc7d3c5b94e58e | [
"MIT"
] | 1 | 2020-01-31T05:04:45.000Z | 2020-01-31T05:04:45.000Z | example/__init__.py | roberto-prevato-test-org/GitHubActionsLab | d74029bb6c3b09735f6ef55784cc7d3c5b94e58e | [
"MIT"
] | 6 | 2020-02-05T07:10:44.000Z | 2020-06-06T20:00:09.000Z | example/__init__.py | RobertoPrevato/GitHubActionsLab | d74029bb6c3b09735f6ef55784cc7d3c5b94e58e | [
"MIT"
] | null | null | null |
class Foo:
def __init__(self):
...
def not_tested(self) -> Ellipsis:
return ...
def __str__(self) -> str:
return 'foo'
| 12.307692 | 37 | 0.5 |
class Foo:
def __init__(self):
...
def not_tested(self) -> Ellipsis:
return ...
def __str__(self) -> str:
return 'foo'
| true | true |
1c48e2dfb424d480b636e141144ad4ac767afbd8 | 52,008 | py | Python | rllib/agents/trainer.py | AnesBenmerzoug/ray | 5921e87ecd4e359fad60dab55f45855456d591e5 | [
"Apache-2.0"
] | null | null | null | rllib/agents/trainer.py | AnesBenmerzoug/ray | 5921e87ecd4e359fad60dab55f45855456d591e5 | [
"Apache-2.0"
] | null | null | null | rllib/agents/trainer.py | AnesBenmerzoug/ray | 5921e87ecd4e359fad60dab55f45855456d591e5 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import numpy as np
import copy
import logging
import math
import os
import pickle
import time
import tempfile
from typing import Callable, Dict, List, Optional, Type, Union
import ray
from ray.exceptions import RayError
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rlli... | 44.149406 | 79 | 0.633037 | from datetime import datetime
import numpy as np
import copy
import logging
import math
import os
import pickle
import time
import tempfile
from typing import Callable, Dict, List, Optional, Type, Union
import ray
from ray.exceptions import RayError
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rlli... | true | true |
1c48e3476ce49df86e7e1dd858698bb7a98a9695 | 6,028 | py | Python | EWR/ab6_v2/ab6.py | Koopakiller/Edu | 575c43dae24a4432e8c8fb2eda96e948cc33ec32 | [
"MIT"
] | null | null | null | EWR/ab6_v2/ab6.py | Koopakiller/Edu | 575c43dae24a4432e8c8fb2eda96e948cc33ec32 | [
"MIT"
] | null | null | null | EWR/ab6_v2/ab6.py | Koopakiller/Edu | 575c43dae24a4432e8c8fb2eda96e948cc33ec32 | [
"MIT"
] | null | null | null | # coding=utf-8
# Author: Tom Lambert
# Content: Hauptprogramm für EWR/ab6 (Sortieralgorithmen)
from __future__ import print_function
from Sort import *
import os.path
import time
import os.path
def print_line():
"""Gibt eine Trennlinie in der Konsole aus."""
print("------------------------------------------... | 38.641026 | 117 | 0.619277 |
from __future__ import print_function
from Sort import *
import os.path
import time
import os.path
def print_line():
print("-------------------------------------------------------------------------------------")
def print_list(lst):
print("[ '{0}' ]".format("', '".join(lst)))
def input_file_name(msg... | true | true |
1c48e366c9660d0f0f4689b1ce94304822ae6b30 | 2,813 | py | Python | resources/recipe.py | guilhermegouw/smilecook | a91937b329e5d0f9bd6d9700c97547bcda9a2564 | [
"MIT"
] | null | null | null | resources/recipe.py | guilhermegouw/smilecook | a91937b329e5d0f9bd6d9700c97547bcda9a2564 | [
"MIT"
] | null | null | null | resources/recipe.py | guilhermegouw/smilecook | a91937b329e5d0f9bd6d9700c97547bcda9a2564 | [
"MIT"
] | null | null | null | import http
from flask import request
from flask_restful import Resource
from http import HTTPStatus
from models.recipe import Recipe, recipe_list
class RecipeListResource(Resource):
def get(self):
data = []
for recipe in recipe_list:
if recipe in recipe_list:
if rec... | 26.046296 | 78 | 0.589051 | import http
from flask import request
from flask_restful import Resource
from http import HTTPStatus
from models.recipe import Recipe, recipe_list
class RecipeListResource(Resource):
def get(self):
data = []
for recipe in recipe_list:
if recipe in recipe_list:
if rec... | true | true |
1c48e39c58ac9d644b19ec2f1635415e7f59c198 | 5,445 | py | Python | AppServer/_php_runtime.py | Honcharov12/appscale | be1cf90fcd24f1a5a88848f7eb73331b6e4e66d9 | [
"Apache-2.0"
] | null | null | null | AppServer/_php_runtime.py | Honcharov12/appscale | be1cf90fcd24f1a5a88848f7eb73331b6e4e66d9 | [
"Apache-2.0"
] | null | null | null | AppServer/_php_runtime.py | Honcharov12/appscale | be1cf90fcd24f1a5a88848f7eb73331b6e4e66d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 29.432432 | 79 | 0.69146 |
import os
import sys
if not hasattr(sys, 'version_info'):
sys.stderr.write('Very old versions of Python are not supported. Please '
'use version 2.7.\n')
sys.exit(1)
version_tuple = tuple(sys.version_info[:2])
if version_tuple < (2, 7):
sys.stderr.write('Error: Python %d.%d is not supported... | true | true |
1c48e444517f9faa08b4651a0a1ec63b8eea2012 | 2,323 | py | Python | events/auth.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | events/auth.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | events/auth.py | hamk-uas/TavastiaEventsOld | b808a1418ee89ba1e774c814364e5b55ea4f9a2c | [
"MIT"
] | null | null | null | from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis.db import models
from django.contrib.auth import get_user_model
from .permissions import UserModelPermissionMixin
class ... | 35.19697 | 81 | 0.708567 | from rest_framework import authentication
from rest_framework import exceptions
from events.models import DataSource
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis.db import models
from django.contrib.auth import get_user_model
from .permissions import UserModelPermissionMixin
class ... | true | true |
1c48e4a551fe56da4659b2751e18321b2bd23989 | 884 | py | Python | torchnmf/metrics.py | akashpalrecha/pytorch-NMF | 21f6589bf25e2ec3e90edf7d3f7eec538ce04fa0 | [
"MIT"
] | null | null | null | torchnmf/metrics.py | akashpalrecha/pytorch-NMF | 21f6589bf25e2ec3e90edf7d3f7eec538ce04fa0 | [
"MIT"
] | null | null | null | torchnmf/metrics.py | akashpalrecha/pytorch-NMF | 21f6589bf25e2ec3e90edf7d3f7eec538ce04fa0 | [
"MIT"
] | null | null | null | import torch
from operator import mul
from functools import reduce
from torch.nn import functional as F
def KL_divergence(predict, target):
return (target * (target / predict).log()).sum() - target.sum() + predict.sum()
def Euclidean(predict, target):
return F.mse_loss(predict, target, reduction='sum') / 2
... | 28.516129 | 84 | 0.644796 | import torch
from operator import mul
from functools import reduce
from torch.nn import functional as F
def KL_divergence(predict, target):
return (target * (target / predict).log()).sum() - target.sum() + predict.sum()
def Euclidean(predict, target):
return F.mse_loss(predict, target, reduction='sum') / 2
... | true | true |
1c48e4b6f11915b14be23ef1c55ce7a160489247 | 2,701 | py | Python | backend/tests/__init__.py | Nuqlear/voila | 05ada753425ee62e1edd06f945e58e29e808409b | [
"MIT"
] | 2 | 2017-12-12T14:28:43.000Z | 2018-01-24T10:58:27.000Z | backend/tests/__init__.py | Nuqlear/voila | 05ada753425ee62e1edd06f945e58e29e808409b | [
"MIT"
] | 21 | 2020-03-05T18:58:11.000Z | 2022-02-02T20:00:34.000Z | backend/tests/__init__.py | Nuqlear/voila | 05ada753425ee62e1edd06f945e58e29e808409b | [
"MIT"
] | 2 | 2017-12-13T22:43:56.000Z | 2018-01-24T17:14:29.000Z | import asyncio
import json
import psycopg2
import tornado.ioloop
import tornado.platform.asyncio
from sqlalchemy.schema import CreateTable, DropTable
from sqlalchemy.ext.compiler import compiles
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import AsyncHTTPTestCase
from vobla.app import TornadoA... | 32.939024 | 75 | 0.632358 | import asyncio
import json
import psycopg2
import tornado.ioloop
import tornado.platform.asyncio
from sqlalchemy.schema import CreateTable, DropTable
from sqlalchemy.ext.compiler import compiles
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import AsyncHTTPTestCase
from vobla.app import TornadoA... | true | true |
1c48e57d0a928db30d85d6b55d28985d7463fada | 5,564 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/interface/get.py | rohit04saluja/genielibs | e3a89932b807075f45a611cb46ca41a4fa6fe240 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/interface/get.py | rohit04saluja/genielibs | e3a89932b807075f45a611cb46ca41a4fa6fe240 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxr/interface/get.py | rohit04saluja/genielibs | e3a89932b807075f45a611cb46ca41a4fa6fe240 | [
"Apache-2.0"
] | null | null | null | """Common get info functions for interface"""
# Python
import re
import logging
# unicon
from unicon.core.errors import SubCommandFailure
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.libs.parser.utils.common import Common
log = logging.getLogger(__name__)
def get_interfac... | 31.794286 | 95 | 0.550683 |
import re
import logging
from unicon.core.errors import SubCommandFailure
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.libs.parser.utils.common import Common
log = logging.getLogger(__name__)
def get_interface_ip_address(device, interface):
log.info("Getting interface address... | true | true |
1c48e6ef9f0740fa89cde36c128c69f2475f34f2 | 6,480 | py | Python | pcdet/models/detectors/self_voxel_scconv.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | pcdet/models/detectors/self_voxel_scconv.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | pcdet/models/detectors/self_voxel_scconv.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from .detector3d_template import Detector3DTemplate
from ..model_utils.meter_utils import AverageMeter
from .. import roi_heads
class Voxel_SCCONV(Detector3DTemplate):
def __init__(self, model_cfg, num_class, dataset):
super().__init__(mod... | 47.29927 | 144 | 0.655093 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .detector3d_template import Detector3DTemplate
from ..model_utils.meter_utils import AverageMeter
from .. import roi_heads
class Voxel_SCCONV(Detector3DTemplate):
def __init__(self, model_cfg, num_class, dataset):
super().__init__(mod... | true | true |
1c48e9b3730119f4ed2b80f93c177cfdbda69294 | 6,949 | py | Python | build_site.py | tjweisman/math_website | d51d8d9437769117d0f9ad80c372b5f8a1575e96 | [
"MIT"
] | null | null | null | build_site.py | tjweisman/math_website | d51d8d9437769117d0f9ad80c372b5f8a1575e96 | [
"MIT"
] | null | null | null | build_site.py | tjweisman/math_website | d51d8d9437769117d0f9ad80c372b5f8a1575e96 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import re
import shutil
from argparse import ArgumentParser
import markdown
from markdown_include.include import MarkdownInclude
from mako.template import Template
from mako.lookup import TemplateLookup
from ruamel.yaml import YAML
SCRIPT_DIR = "/home/teddy/math/web/perso... | 30.884444 | 89 | 0.60095 |
import sys
import os
import re
import shutil
from argparse import ArgumentParser
import markdown
from markdown_include.include import MarkdownInclude
from mako.template import Template
from mako.lookup import TemplateLookup
from ruamel.yaml import YAML
SCRIPT_DIR = "/home/teddy/math/web/personal"
SITES_LIST = "sit... | true | true |
1c48ea3bf83a5985c69cad2d01b99bc77a90d0d2 | 20,679 | py | Python | helper_tf_util.py | Archer-pro666/BAAF-Net | 87238df296aa4a78b619affc8fb5e0197c49176d | [
"MIT"
] | 323 | 2020-09-07T19:06:10.000Z | 2022-03-29T20:34:08.000Z | helper_tf_util.py | whuhxb/BAAF-Net | 663d1681d4d05ad3caaacd98e6dedfdc9caa4930 | [
"MIT"
] | 38 | 2020-09-09T02:56:46.000Z | 2022-03-28T08:15:10.000Z | helper_tf_util.py | whuhxb/BAAF-Net | 663d1681d4d05ad3caaacd98e6dedfdc9caa4930 | [
"MIT"
] | 39 | 2020-09-08T02:25:57.000Z | 2022-03-24T06:15:00.000Z | """ Wrapper functions for TensorFlow layers.
Author: Charles R. Qi
Date: November 2016
"""
import numpy as np
import tensorflow as tf
def _variable_on_cpu(name, shape, initializer, use_fp16=False):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list ... | 35.963478 | 111 | 0.561487 |
import numpy as np
import tensorflow as tf
def _variable_on_cpu(name, shape, initializer, use_fp16=False):
with tf.device('/cpu:0'):
dtype = tf.float16 if use_fp16 else tf.float32
var = tf.get_variable(name, shape, initializer=initializer, dtype=dtype)
return var
def _variable_with_weight_d... | true | true |
1c48ea441ce4fb5bf52edefac9ce32cb7c79897a | 663 | bzl | Python | modules/benchmarks/benchmark_test.bzl | duluca/angular | b7385a77ad5300f0add3643a479426b834d49fc5 | [
"MIT"
] | 3 | 2019-11-19T11:07:22.000Z | 2020-03-31T06:38:01.000Z | modules/benchmarks/benchmark_test.bzl | duluca/angular | b7385a77ad5300f0add3643a479426b834d49fc5 | [
"MIT"
] | 23 | 2022-02-15T06:06:27.000Z | 2022-03-02T13:04:37.000Z | modules/benchmarks/benchmark_test.bzl | duluca/angular | b7385a77ad5300f0add3643a479426b834d49fc5 | [
"MIT"
] | 1 | 2018-10-12T14:09:39.000Z | 2018-10-12T14:09:39.000Z | load("//tools:defaults.bzl", "protractor_web_test_suite")
"""
Macro that can be used to define a benchmark test. This differentiates from
a normal Protractor test suite because we specify a custom "perf" configuration
that sets up "@angular/benchpress".
"""
def benchmark_test(name, server, deps, tags = []):
... | 28.826087 | 81 | 0.60181 | load("//tools:defaults.bzl", "protractor_web_test_suite")
def benchmark_test(name, server, deps, tags = []):
protractor_web_test_suite(
name = name,
configuration = "//:protractor-perf.conf.js",
data = [
"//packages/benchpress",
],
on_prepare = "//modules/benchm... | true | true |
1c48ea56d006f86fc353cba1ce9805d7a2268459 | 19,936 | py | Python | tensorflow/python/data/util/nest_test.py | AdrienCorenflos/tensorflow | 1b5220e89fecca70375b372a5bddc7f961c6a736 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/util/nest_test.py | AdrienCorenflos/tensorflow | 1b5220e89fecca70375b372a5bddc7f961c6a736 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/util/nest_test.py | AdrienCorenflos/tensorflow | 1b5220e89fecca70375b372a5bddc7f961c6a736 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 43.058315 | 80 | 0.649579 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import attr
import numpy as np
from tensorflow.python.data.util import nest
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import sparse_tensor
from t... | true | true |
1c48ea802ae5ab745387f8732bb696001ad3948d | 12,626 | py | Python | Image Classification/CGIAR Wheat Growth Stage Challenge/neurofitting/zindi_cgiar_wheat_growth_stage_challenge/src_wd/trainer.py | ZindiAfrica/Computer-Vision | bf4c00a0633506270dc6d07df938a100a10ee799 | [
"MIT"
] | null | null | null | Image Classification/CGIAR Wheat Growth Stage Challenge/neurofitting/zindi_cgiar_wheat_growth_stage_challenge/src_wd/trainer.py | ZindiAfrica/Computer-Vision | bf4c00a0633506270dc6d07df938a100a10ee799 | [
"MIT"
] | null | null | null | Image Classification/CGIAR Wheat Growth Stage Challenge/neurofitting/zindi_cgiar_wheat_growth_stage_challenge/src_wd/trainer.py | ZindiAfrica/Computer-Vision | bf4c00a0633506270dc6d07df938a100a10ee799 | [
"MIT"
] | null | null | null | import os
import numba
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from optimizer import *
from trainer_callbacks import *
from utils import *
#%% #################################### Model Trainer Class ####################################
class ModelTrainer(... | 55.621145 | 166 | 0.475923 | import os
import numba
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from optimizer import *
from trainer_callbacks import *
from utils import *
class ModelTrainer():
def __init__(self,
model=None,
Loaders=[None,[]],
... | true | true |
1c48eab421d71fb3dd130c7dbe6529475759591f | 16,694 | py | Python | metalibm_functions/ml_atan.py | metalibm/metalibm | e3133bb95e13f797bb902ef7cd1d2f8f352c4454 | [
"MIT"
] | 12 | 2019-10-29T21:30:58.000Z | 2022-02-05T16:28:01.000Z | metalibm_functions/ml_atan.py | metalibm/metalibm | e3133bb95e13f797bb902ef7cd1d2f8f352c4454 | [
"MIT"
] | 20 | 2021-03-11T19:46:48.000Z | 2022-02-05T16:03:29.000Z | metalibm_functions/ml_atan.py | metalibm/metalibm | e3133bb95e13f797bb902ef7cd1d2f8f352c4454 | [
"MIT"
] | 4 | 2021-03-10T15:06:58.000Z | 2021-07-14T17:39:53.000Z | # -*- coding: utf-8 -*-
""" meta-implementation of arc-tangent (atan) function """
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT L... | 43.701571 | 164 | 0.593567 |
import sollya
from sollya import Interval
from metalibm_core.core.ml_function import DefaultArgTemplate
from metalibm_core.core.simple_scalar_function import (
ScalarBinaryFunction, ScalarUnaryFunction)
from metalibm_core.core.ml_operations import (
Abs, Constant,
Select, Statement, Return,
Logical... | true | true |
1c48ebe9d69317233718bd0fbd0507d9693df525 | 161 | py | Python | bin/sticks/one-sided-tetrasticks-x-2.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/sticks/one-sided-tetrasticks-x-2.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | null | null | null | bin/sticks/one-sided-tetrasticks-x-2.py | tiwo/puzzler | 7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e | [
"Intel"
] | 1 | 2022-01-02T16:54:14.000Z | 2022-01-02T16:54:14.000Z | #!/usr/bin/env python
# $Id$
""" solutions"""
import puzzler
from puzzler.puzzles.tetrasticks import OneSidedTetrasticksX2
puzzler.run(OneSidedTetrasticksX2)
| 16.1 | 61 | 0.782609 |
import puzzler
from puzzler.puzzles.tetrasticks import OneSidedTetrasticksX2
puzzler.run(OneSidedTetrasticksX2)
| true | true |
1c48ed47667b08b16198666d4c1fe028765fde70 | 4,334 | py | Python | python/ray/tests/aws/utils/stubs.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 5 | 2019-12-23T07:48:13.000Z | 2020-01-03T12:42:38.000Z | python/ray/tests/aws/utils/stubs.py | tjcommV2X/ray | 3965310f939cfbb0d700174529ee5bc7d4871de8 | [
"Apache-2.0"
] | 70 | 2021-07-10T07:05:24.000Z | 2022-03-26T07:05:20.000Z | python/ray/tests/aws/utils/stubs.py | majacQ/ray | bc08c6cdcc7ddf4da751ca2a972defd3db509061 | [
"Apache-2.0"
] | 1 | 2021-05-20T22:00:15.000Z | 2021-05-20T22:00:15.000Z | import ray
from ray.tests.aws.utils.mocks import mock_path_exists_key_pair
from ray.tests.aws.utils.constants import DEFAULT_INSTANCE_PROFILE, \
DEFAULT_KEY_PAIR, DEFAULT_SUBNET, A_THOUSAND_SUBNETS_IN_DIFFERENT_VPCS
from unittest import mock
from botocore.stub import ANY
def configure_iam_role_default(iam_clien... | 31.867647 | 77 | 0.67928 | import ray
from ray.tests.aws.utils.mocks import mock_path_exists_key_pair
from ray.tests.aws.utils.constants import DEFAULT_INSTANCE_PROFILE, \
DEFAULT_KEY_PAIR, DEFAULT_SUBNET, A_THOUSAND_SUBNETS_IN_DIFFERENT_VPCS
from unittest import mock
from botocore.stub import ANY
def configure_iam_role_default(iam_clien... | true | true |
1c48ee010c125b192f89896803c81d8882bb00a2 | 2,744 | py | Python | mysqls/connect_database.py | marxlee/py-tools | 4c3699b2a5dd5cb4477a4e339b8f91161cbe3bef | [
"Apache-2.0"
] | null | null | null | mysqls/connect_database.py | marxlee/py-tools | 4c3699b2a5dd5cb4477a4e339b8f91161cbe3bef | [
"Apache-2.0"
] | null | null | null | mysqls/connect_database.py | marxlee/py-tools | 4c3699b2a5dd5cb4477a4e339b8f91161cbe3bef | [
"Apache-2.0"
] | null | null | null | import pymysql, re
def connect():
db = pymysql.connect(host="212.64.15.***", port=3306, user="hadoop",password="hadoop", database="py_tech", charset="utf8" )
return db
def show_database(db):
with db.cursor() as cursor:
cursor.execute('show databases;')
data = cursor.fetchall()
pr... | 27.717172 | 127 | 0.525875 | import pymysql, re
def connect():
db = pymysql.connect(host="212.64.15.***", port=3306, user="hadoop",password="hadoop", database="py_tech", charset="utf8" )
return db
def show_database(db):
with db.cursor() as cursor:
cursor.execute('show databases;')
data = cursor.fetchall()
pr... | true | true |
1c48ef48c6102362cb796f1f3e20287c41044d04 | 3,398 | py | Python | setup.py | lfdelphino/WebWhatsapp-Wrapper | 377edb35d8143de9de4939883d64933e0909173b | [
"MIT"
] | 7 | 2019-03-10T17:37:07.000Z | 2021-05-14T13:28:13.000Z | setup.py | lfdelphino/WebWhatsapp-Wrapper | 377edb35d8143de9de4939883d64933e0909173b | [
"MIT"
] | 2 | 2019-05-22T14:54:36.000Z | 2019-05-30T23:59:45.000Z | setup.py | lfdelphino/WebWhatsapp-Wrapper | 377edb35d8143de9de4939883d64933e0909173b | [
"MIT"
] | 3 | 2019-11-23T20:51:07.000Z | 2021-09-28T09:22:59.000Z | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
import ast
# To use a consistent encoding
from codecs import open
import os
# Always prefer setuptools over distutils
from setuptools import setup
PACKAGE_NAME = 'webwhatsapi'
... | 30.612613 | 91 | 0.622131 |
import ast
from codecs import open
import os
from setuptools import setup
PACKAGE_NAME = 'webwhatsapi'
path = os.path.join(os.path.dirname(__file__), PACKAGE_NAME, '__init__.py')
with open(path, 'r') as file:
t = compile(file.read(), path, 'exec', ast.PyCF_ONLY_AST)
for node in (n for n in t.body if isinst... | true | true |
1c48ef5e1eed7b7caa4331f9bd566bd9f41446c2 | 606 | py | Python | superlists/lists/tests.py | williamHuang5468/LearningDjango | 309b89c7072a3ef713164e6832f733e9f26938e4 | [
"MIT"
] | null | null | null | superlists/lists/tests.py | williamHuang5468/LearningDjango | 309b89c7072a3ef713164e6832f733e9f26938e4 | [
"MIT"
] | null | null | null | superlists/lists/tests.py | williamHuang5468/LearningDjango | 309b89c7072a3ef713164e6832f733e9f26938e4 | [
"MIT"
] | null | null | null | from django.core.urlresolvers import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
def test_home_page(self):
home = resolve('/')
self.assertEqual(home.func, home_page)
def test_home_page_returns_co... | 31.894737 | 70 | 0.714521 | from django.core.urlresolvers import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
def test_home_page(self):
home = resolve('/')
self.assertEqual(home.func, home_page)
def test_home_page_returns_co... | true | true |
1c48f1159d084538f075e76f7042b9f900261016 | 7,267 | py | Python | tests/integration/test_unreal.py | rhcarvalho/relay | 6f1e81115f1dd82aaf63d242d4e4db754c393a5e | [
"BSL-1.0"
] | null | null | null | tests/integration/test_unreal.py | rhcarvalho/relay | 6f1e81115f1dd82aaf63d242d4e4db754c393a5e | [
"BSL-1.0"
] | null | null | null | tests/integration/test_unreal.py | rhcarvalho/relay | 6f1e81115f1dd82aaf63d242d4e4db754c393a5e | [
"BSL-1.0"
] | null | null | null | import os
import pytest
import json
def _load_dump_file(base_file_name: str):
dmp_path = os.path.join(
os.path.dirname(__file__), "fixtures", "native", base_file_name
)
with open(dmp_path, "rb") as f:
dmp_file = f.read()
return dmp_file
@pytest.mark.parametrize("dump_file_name", ["... | 31.323276 | 83 | 0.670841 | import os
import pytest
import json
def _load_dump_file(base_file_name: str):
dmp_path = os.path.join(
os.path.dirname(__file__), "fixtures", "native", base_file_name
)
with open(dmp_path, "rb") as f:
dmp_file = f.read()
return dmp_file
@pytest.mark.parametrize("dump_file_name", ["... | true | true |
1c48f173f4cc5a21b4683a68476f35fc62018189 | 935 | py | Python | Chapter01/03 Saving image using lossy and lossless compression.py | PCJimmmy/OpenCV-3-Computer-Vision-with-Python-Cookbook | 08be606384e3439183599c147291901d80fc8310 | [
"MIT"
] | 1 | 2019-08-18T03:53:01.000Z | 2019-08-18T03:53:01.000Z | Chapter01/03 Saving image using lossy and lossless compression.py | PCJimmmy/OpenCV-3-Computer-Vision-with-Python-Cookbook | 08be606384e3439183599c147291901d80fc8310 | [
"MIT"
] | 1 | 2020-06-29T06:25:37.000Z | 2020-06-29T06:25:37.000Z | Chapter01/03 Saving image using lossy and lossless compression.py | eventia/opencv_vision_train | 3d0bedd02cd73ca40595f483bf468913dbc54f2d | [
"MIT"
] | 2 | 2019-08-12T01:02:07.000Z | 2021-02-18T15:02:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('--path', default='../data/Lena.png', help='Image path.')
parser.add_argument('--out_png', default='../data/Lena_compressed.png',
help='Output image path for lossless re... | 37.4 | 77 | 0.715508 |
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('--path', default='../data/Lena.png', help='Image path.')
parser.add_argument('--out_png', default='../data/Lena_compressed.png',
help='Output image path for lossless result.')
parser.add_argument('--out_jpg', defaul... | true | true |
1c48f194eb2ad2ca307fb349d3027401b1f40d3e | 164 | py | Python | setup.py | BarryLiu97/kwyk | 638edd85bfffe154180e0b861c0dc5c7ad5754fc | [
"Apache-2.0"
] | 16 | 2019-08-14T14:19:42.000Z | 2021-11-21T15:21:50.000Z | setup.py | BarryLiu97/kwyk | 638edd85bfffe154180e0b861c0dc5c7ad5754fc | [
"Apache-2.0"
] | 24 | 2019-08-14T19:13:21.000Z | 2022-03-29T13:46:49.000Z | setup.py | BarryLiu97/kwyk | 638edd85bfffe154180e0b861c0dc5c7ad5754fc | [
"Apache-2.0"
] | 10 | 2019-08-22T17:13:21.000Z | 2021-11-21T15:21:51.000Z | from setuptools import setup
import versioneer
version = versioneer.get_version()
cmdclass = versioneer.get_cmdclass()
setup(version=version, cmdclass=cmdclass)
| 18.222222 | 41 | 0.817073 | from setuptools import setup
import versioneer
version = versioneer.get_version()
cmdclass = versioneer.get_cmdclass()
setup(version=version, cmdclass=cmdclass)
| true | true |
1c48f1df284a6c58dfa75de1b7d15e3cb9fdfb70 | 388 | py | Python | client/bt.py | AmarMaksumic/BlueComms | fe7020d0b025c61c7a5ea918b7c79cd64f98653c | [
"MIT"
] | null | null | null | client/bt.py | AmarMaksumic/BlueComms | fe7020d0b025c61c7a5ea918b7c79cd64f98653c | [
"MIT"
] | null | null | null | client/bt.py | AmarMaksumic/BlueComms | fe7020d0b025c61c7a5ea918b7c79cd64f98653c | [
"MIT"
] | null | null | null | import socket
server_mac = server_port = s = None
def init(mac, port):
global server_mac
global server_port
server_mac = mac
server_port = port
def connect():
global s
s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
s.connect((server_mac, server_port))
def send(messag... | 19.4 | 83 | 0.726804 | import socket
server_mac = server_port = s = None
def init(mac, port):
global server_mac
global server_port
server_mac = mac
server_port = port
def connect():
global s
s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
s.connect((server_mac, server_port))
def send(messag... | true | true |
1c48f2344814242295953255855c079b009af965 | 7,241 | py | Python | subnetting.py | patelnisheet/subnet | bff2abb0a9f7cfc00931f7c95ed8f2f426f3e0c3 | [
"MIT"
] | 4 | 2021-06-18T12:51:23.000Z | 2021-06-19T16:55:44.000Z | subnetting.py | patelnisheet/subnet | bff2abb0a9f7cfc00931f7c95ed8f2f426f3e0c3 | [
"MIT"
] | null | null | null | subnetting.py | patelnisheet/subnet | bff2abb0a9f7cfc00931f7c95ed8f2f426f3e0c3 | [
"MIT"
] | null | null | null | from math import ceil, log
#1 ip address
ipAddress = input("Enter ip Address: ")
#2 separated in 4 parts => string and binary
firstPart, secondPart, thirdPart, fourthPart = ipAddress.split(".")
ipAddressFourParts = [int(firstPart), int(secondPart), int(thirdPart), int(fourthPart)]
binaryipAddressFourParts = l... | 49.937931 | 190 | 0.729319 | from math import ceil, log
ipAddress = input("Enter ip Address: ")
firstPart, secondPart, thirdPart, fourthPart = ipAddress.split(".")
ipAddressFourParts = [int(firstPart), int(secondPart), int(thirdPart), int(fourthPart)]
binaryipAddressFourParts = list(map(lambda x: format(int(x),"08b") , ipAddressFourParts))... | true | true |
1c48f23a0607eb4431e38e6fa76c6a0f127f7dba | 11,326 | py | Python | learning/MLP_base.py | tblondelle/TransferLearningProject | 1c6a9bba2480919e22dd08756f328a47a321eafa | [
"Apache-2.0"
] | 2 | 2018-01-12T16:54:52.000Z | 2018-03-01T09:35:06.000Z | learning/MLP_base.py | tblondelle/TransferLearningProject | 1c6a9bba2480919e22dd08756f328a47a321eafa | [
"Apache-2.0"
] | null | null | null | learning/MLP_base.py | tblondelle/TransferLearningProject | 1c6a9bba2480919e22dd08756f328a47a321eafa | [
"Apache-2.0"
] | 1 | 2018-06-26T12:46:33.000Z | 2018-06-26T12:46:33.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
from io import open
import unicodedata
import string
import re
import random
import os
import time
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_ex... | 32.734104 | 130 | 0.620607 | from __future__ import unicode_literals, print_function, division
from io import open
import unicodedata
import string
import re
import random
import os
import time
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import Tfi... | true | true |
1c48f24ae3c32c49052dd25f913598d1564702d8 | 154 | py | Python | moztrap/view/users/context_processors.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | moztrap/view/users/context_processors.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | moztrap/view/users/context_processors.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | """
Auth-related context processors.
"""
from django.conf import settings
def browserid(request):
return {"USE_BROWSERID": settings.USE_BROWSERID}
| 15.4 | 52 | 0.746753 | from django.conf import settings
def browserid(request):
return {"USE_BROWSERID": settings.USE_BROWSERID}
| true | true |
1c48f29a5bdce0893bb04d299aa247d12d029e89 | 5,525 | py | Python | python/pyspark/sql/observation.py | kyoty/spark | 4a4f207f4215d56f126c2474fd7a94f427937a2f | [
"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"
] | 4 | 2020-07-30T02:37:20.000Z | 2021-03-20T11:36:46.000Z | python/pyspark/sql/observation.py | kyoty/spark | 4a4f207f4215d56f126c2474fd7a94f427937a2f | [
"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"
] | 10 | 2021-04-14T10:54:00.000Z | 2021-04-18T04:53:54.000Z | python/pyspark/sql/observation.py | kyoty/spark | 4a4f207f4215d56f126c2474fd7a94f427937a2f | [
"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"
] | 4 | 2015-09-11T13:27:02.000Z | 2021-03-29T11:14:32.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.833333 | 96 | 0.655928 | from typing import Any, Dict, Optional
from py4j.java_gateway import JavaObject, JVMView
from pyspark.sql import column
from pyspark.sql.column import Column
from pyspark.sql.dataframe import DataFrame
__all__ = ["Observation"]
class Observation:
def __init__(self, name: Optional[str] = None) -> None:
... | true | true |
1c48f372132c29c942954184e87f8fc352bba0c7 | 158 | py | Python | contrib/wallettools/walletunlock.py | safrica/bit | ae9533aeb09965b324191357a6afd90f627b7c2f | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | safrica/bit | ae9533aeb09965b324191357a6afd90f627b7c2f | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | safrica/bit | ae9533aeb09965b324191357a6afd90f627b7c2f | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8432")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| 31.6 | 46 | 0.765823 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8432")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| true | true |
1c48f568c63b011a7af4c9af7b69df0947e61549 | 3,139 | py | Python | lib/dataset/dataset_factory.py | chencq1234/ssds.pytorch | 340aeac3e5f15ffeee6750f40bfbd64343926fc9 | [
"MIT"
] | null | null | null | lib/dataset/dataset_factory.py | chencq1234/ssds.pytorch | 340aeac3e5f15ffeee6750f40bfbd64343926fc9 | [
"MIT"
] | null | null | null | lib/dataset/dataset_factory.py | chencq1234/ssds.pytorch | 340aeac3e5f15ffeee6750f40bfbd64343926fc9 | [
"MIT"
] | null | null | null | from lib.dataset import voc
from lib.dataset import coco
dataset_map = {
'voc': voc.VOCDetection,
'coco': coco.COCODetection,
}
def gen_dataset_fn(name):
"""Returns a dataset func.
Args:
name: The name of the dataset.
Returns:
func: dataset_fn
Rai... | 39.734177 | 120 | 0.631093 | from lib.dataset import voc
from lib.dataset import coco
dataset_map = {
'voc': voc.VOCDetection,
'coco': coco.COCODetection,
}
def gen_dataset_fn(name):
if name not in dataset_map:
raise ValueError('The dataset unknown %s' % name)
func = dataset_map[name]
... | true | true |
1c48f62675be1d81c467bb0ed31ff04385d1fb8a | 322 | py | Python | move/config.py | ninamiolane/move | 83ab147ad1ebab6972591357f02fa29e186116f0 | [
"MIT"
] | null | null | null | move/config.py | ninamiolane/move | 83ab147ad1ebab6972591357f02fa29e186116f0 | [
"MIT"
] | null | null | null | move/config.py | ninamiolane/move | 83ab147ad1ebab6972591357f02fa29e186116f0 | [
"MIT"
] | null | null | null | import logging
import torch
#Set the configuration of the model
logging.info('Confirgure the run')
batch_size = 8
learning_rate= 3e-4
epochs = 10
seq_len=128
negative_slope = 0 #LeakyRelu
logging.info('Setup device')
if torch.cuda.is_available():
device = torch.device('cuda')
else:
device = torch.device('cpu... | 20.125 | 36 | 0.742236 | import logging
import torch
logging.info('Confirgure the run')
batch_size = 8
learning_rate= 3e-4
epochs = 10
seq_len=128
negative_slope = 0
logging.info('Setup device')
if torch.cuda.is_available():
device = torch.device('cuda')
else:
device = torch.device('cpu') | true | true |
1c48f691945537de6b233fd87e0288531b17339d | 944 | py | Python | latent_experiments/discrete/Exp_hiv_test.py | ferjorosa/test-glfm | b219c650d0429ea71b953743730ae53cc122a61b | [
"MIT"
] | null | null | null | latent_experiments/discrete/Exp_hiv_test.py | ferjorosa/test-glfm | b219c650d0429ea71b953743730ae53cc122a61b | [
"MIT"
] | null | null | null | latent_experiments/discrete/Exp_hiv_test.py | ferjorosa/test-glfm | b219c650d0429ea71b953743730ae53cc122a61b | [
"MIT"
] | null | null | null | import DiscreteExperiment
class Exp_hiv_test(DiscreteExperiment.DiscreteExperiment):
def __init__(self, _data_name):
DiscreteExperiment.DiscreteExperiment.__init__(self, _data_name)
def run(self, run, n_folds, fold_log):
print("\n--------------------------------------------------------------... | 31.466667 | 85 | 0.426907 | import DiscreteExperiment
class Exp_hiv_test(DiscreteExperiment.DiscreteExperiment):
def __init__(self, _data_name):
DiscreteExperiment.DiscreteExperiment.__init__(self, _data_name)
def run(self, run, n_folds, fold_log):
print("\n--------------------------------------------------------------... | true | true |
1c48f7aabc4f2ca2adbb00c146a938965e06adb9 | 953 | py | Python | tests/manage/rgw/conftest.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | tests/manage/rgw/conftest.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | tests/manage/rgw/conftest.py | MeridianExplorer/ocs-ci | a33d5116128b88f176f5eff68a3ef805125cdba1 | [
"MIT"
] | null | null | null | import logging
from ocs_ci.framework import config
from ocs_ci.ocs.constants import ON_PREM_PLATFORMS
from ocs_ci.utility import version
log = logging.getLogger(__name__)
def pytest_collection_modifyitems(items):
"""
A pytest hook to filter out RGW tests
when running on cloud platforms
Args:
... | 31.766667 | 99 | 0.628541 | import logging
from ocs_ci.framework import config
from ocs_ci.ocs.constants import ON_PREM_PLATFORMS
from ocs_ci.utility import version
log = logging.getLogger(__name__)
def pytest_collection_modifyitems(items):
if (
config.ENV_DATA["platform"].lower() not in ON_PREM_PLATFORMS
or version.get_sem... | true | true |
1c48f7b36d79d6b90662b5de7aad42529d400ca3 | 2,465 | py | Python | plugins/currencies/src/function.py | mariacarlinahernandez/code-examples | ebfa40c301bedfea1c9c41644a6fcd534a0dcd0f | [
"MIT"
] | 4 | 2020-08-16T15:05:49.000Z | 2021-03-04T10:57:25.000Z | plugins/currencies/src/function.py | mariacarlinahernandez/code-examples | ebfa40c301bedfea1c9c41644a6fcd534a0dcd0f | [
"MIT"
] | 2 | 2019-04-30T13:50:48.000Z | 2020-01-17T23:33:56.000Z | plugins/currencies/src/function.py | mariacarlinahernandez/code-examples | ebfa40c301bedfea1c9c41644a6fcd534a0dcd0f | [
"MIT"
] | 19 | 2019-01-08T15:42:28.000Z | 2022-03-30T20:03:33.000Z | import requests
import time
def main(kwargs):
print("[INFO] Info recieved: {}".format(kwargs))
if len(kwargs) < 4:
print("[ERROR] One or more parameters are missing")
return {"result": "error"}
result = get_currency(**kwargs)
if result.get("result") == "ok":
args = result.g... | 29.345238 | 91 | 0.599594 | import requests
import time
def main(kwargs):
print("[INFO] Info recieved: {}".format(kwargs))
if len(kwargs) < 4:
print("[ERROR] One or more parameters are missing")
return {"result": "error"}
result = get_currency(**kwargs)
if result.get("result") == "ok":
args = result.g... | true | true |
1c48f7bd6ff7ccc1fa63ca67184ef1af3ace64ce | 4,029 | py | Python | pymatgen/util/serialization.py | anjlip/pymatgen | 62ecae1c7382a41861e3a5d9b9c8dd1207472409 | [
"MIT"
] | 2 | 2017-10-02T03:11:47.000Z | 2018-12-02T12:56:12.000Z | pymatgen/util/serialization.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 3 | 2017-07-18T01:13:41.000Z | 2019-04-29T18:17:30.000Z | pymatgen/util/serialization.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 2 | 2016-06-15T00:12:59.000Z | 2018-12-02T12:56:47.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import json
import functools
import pickle
from pymatgen.core.periodic_table import Element
"""
Most features of this module has been moved to monty. Please refer to
monty.json and monty.serialization docume... | 28.373239 | 79 | 0.63167 |
import json
import functools
import pickle
from pymatgen.core.periodic_table import Element
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Apr 30, 2012"
def pmg_serialize(method... | true | true |
1c48f96d65f6ea07d262df3ba991c8effd958e17 | 5,364 | py | Python | ghost/core/shell.py | Bcoderx6/Ghost | 2d518b838315d257bfdd5655eaf688c3796267c5 | [
"MIT"
] | 2 | 2022-01-21T11:34:03.000Z | 2022-03-11T22:08:25.000Z | ghost/core/shell.py | Bcoderx6/Ghost | 2d518b838315d257bfdd5655eaf688c3796267c5 | [
"MIT"
] | null | null | null | ghost/core/shell.py | Bcoderx6/Ghost | 2d518b838315d257bfdd5655eaf688c3796267c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020 EntySec
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | 45.846154 | 114 | 0.525168 |
from os import system, chdir
from subprocess import CalledProcessError, check_output
from ghost.core.badges import Badges
from ghost.core.helper import Helper
from ghost.core.loader import Loader
class Shell:
def __init__(self, ghost):
self.ghost = ghost
self.badges = Badges()
self.help... | true | true |
1c48f976fec8b1acb5931b64a52c232b58b01820 | 726 | py | Python | Python/seven_kyu/greet.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | 1 | 2019-12-20T04:09:56.000Z | 2019-12-20T04:09:56.000Z | Python/seven_kyu/greet.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | Python/seven_kyu/greet.py | Brokenshire/codewars-projects | db9cd09618b8a7085b0d53ad76f73f9e249b9396 | [
"Apache-2.0"
] | null | null | null | # Python solution for 'Greet Me' codewars question.
# Level: 7 kyu
# Tags: FUNDAMENTALS and STRINGS.
# Author: Jack Brokenshire
# Date: 20/05/2020
import unittest
def greet(name):
"""
Greets a person with their name capitalized.
:param name: a string.
:return: greets that name, capitalized and ends w... | 24.2 | 78 | 0.658402 |
import unittest
def greet(name):
return "Hello " + name.capitalize() + "!"
class TestGreet(unittest.TestCase):
def test_greet(self):
self.assertEqual(greet('riley'), 'Hello Riley!')
self.assertEqual(greet('molly'), "Hello Molly!")
self.assertEqual(greet('BILLY'), "Hello Billy!")
... | true | true |
1c48f9b4512865b19372db903249405f3f8c7a76 | 9,521 | py | Python | graph_objs/carpet/baxis/_tickformatstop.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/carpet/baxis/_tickformatstop.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/carpet/baxis/_tickformatstop.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "carpet.baxis"
_path_str = "carpet.baxis.tickformatstop"
_valid_props = {"dtickrange"... | 33.524648 | 82 | 0.569688 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
_parent_path_str = "carpet.baxis"
_path_str = "carpet.baxis.tickformatstop"
_valid_props = {"dtickrange", "enabled", "name", "templateitemname", "... | true | true |
1c48fa436ae520503532022d81b249752c5f81ce | 1,222 | py | Python | Searchlll.py | sangeetasingh17/python | 02fe83d5188a643a1d95b1a2b5592ae6444e260f | [
"MIT"
] | 1 | 2020-11-11T14:42:48.000Z | 2020-11-11T14:42:48.000Z | Searchlll.py | sangeetasingh17/python | 02fe83d5188a643a1d95b1a2b5592ae6444e260f | [
"MIT"
] | null | null | null | Searchlll.py | sangeetasingh17/python | 02fe83d5188a643a1d95b1a2b5592ae6444e260f | [
"MIT"
] | 3 | 2021-08-04T20:26:06.000Z | 2021-10-18T10:24:43.000Z | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
self.last_node = None
def append(self, data):
if self.last_node is None:
self.head = Node(data)
self.last_node = se... | 24.44 | 65 | 0.5491 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
self.last_node = None
def append(self, data):
if self.last_node is None:
self.head = Node(data)
self.last_node = se... | true | true |
1c48fb37aaf58efdadc2f66c9ca291f61705d507 | 1,133 | py | Python | examples/sample_puma.py | Gigahawk/dh2vrml | 65a610332fe5f3f1b0ba14ca9ba57193139e18bf | [
"MIT"
] | null | null | null | examples/sample_puma.py | Gigahawk/dh2vrml | 65a610332fe5f3f1b0ba14ca9ba57193139e18bf | [
"MIT"
] | 3 | 2022-02-09T12:07:41.000Z | 2022-03-08T07:52:14.000Z | examples/sample_puma.py | Gigahawk/dh2vrml | 65a610332fe5f3f1b0ba14ca9ba57193139e18bf | [
"MIT"
] | null | null | null | from math import pi
params = [
{
"type": "revolute",
"theta": 0,
"d": 0,
"r": 0,
"alpha": -pi/2,
"offset": (0, 0, -300),
"color": (1, 0, 0),
"scale": 50,
},
{
"type": "revolute",
"theta": 0,
"d": 0,
"r": 430,
... | 18.883333 | 31 | 0.295675 | from math import pi
params = [
{
"type": "revolute",
"theta": 0,
"d": 0,
"r": 0,
"alpha": -pi/2,
"offset": (0, 0, -300),
"color": (1, 0, 0),
"scale": 50,
},
{
"type": "revolute",
"theta": 0,
"d": 0,
"r": 430,
... | true | true |
1c48fbb34627d1bebd1ced1abced3024490050b7 | 4,516 | py | Python | dataset/compute_metrics.py | sc0ttms/SE-TFCN | 466a2d641c6ff4184c768c1e7aaf2b8a8158ce51 | [
"BSD-3-Clause"
] | 9 | 2022-01-18T05:30:33.000Z | 2022-03-09T02:25:11.000Z | dataset/compute_metrics.py | sc0ttms/SE-TFCN | 466a2d641c6ff4184c768c1e7aaf2b8a8158ce51 | [
"BSD-3-Clause"
] | 1 | 2022-01-22T01:52:08.000Z | 2022-01-28T03:01:33.000Z | dataset/compute_metrics.py | sc0ttms/SE-TFCN | 466a2d641c6ff4184c768c1e7aaf2b8a8158ce51 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
import argparse
import toml
import librosa
import pandas as pd
import numpy as np
from tqdm import tqdm
from joblib import Parallel, delayed
sys.path.append(os.getcwd())
from audio.metrics import SI_SDR, STOI, WB_PESQ, NB_PESQ, REGISTERED_METRICS
def calculate_metric(noi... | 31.58042 | 102 | 0.611382 |
import sys
import os
import argparse
import toml
import librosa
import pandas as pd
import numpy as np
from tqdm import tqdm
from joblib import Parallel, delayed
sys.path.append(os.getcwd())
from audio.metrics import SI_SDR, STOI, WB_PESQ, NB_PESQ, REGISTERED_METRICS
def calculate_metric(noisy_file, clean_file, sr=... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.