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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74eb2936a9adf7770152f4f0fe967390fc9909e | 2,634 | py | Python | usaspending_api/search/filters/elasticsearch/naics.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 1 | 2020-06-15T19:59:52.000Z | 2020-06-15T19:59:52.000Z | usaspending_api/search/filters/elasticsearch/naics.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | null | null | null | usaspending_api/search/filters/elasticsearch/naics.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | null | null | null | from usaspending_api.common.exceptions import InvalidParameterException
from usaspending_api.search.filters.elasticsearch.filter import _Filter, _QueryType
from usaspending_api.search.filters.elasticsearch.HierarchicalFilter import HierarchicalFilter, Node
from elasticsearch_dsl import Q as ES_Q
class NaicsCodes(_Fil... | 43.180328 | 120 | 0.683371 | from usaspending_api.common.exceptions import InvalidParameterException
from usaspending_api.search.filters.elasticsearch.filter import _Filter, _QueryType
from usaspending_api.search.filters.elasticsearch.HierarchicalFilter import HierarchicalFilter, Node
from elasticsearch_dsl import Q as ES_Q
class NaicsCodes(_Fil... | true | true |
f74eb2970a3657f1410b8b0b23c4331e857d8b86 | 1,225 | py | Python | accounts/managers.py | Zadigo/twitter_template | 110dd857bce219bd596a30db6e49acffca7af286 | [
"MIT"
] | 16 | 2020-07-01T03:42:40.000Z | 2022-02-21T21:02:27.000Z | accounts/managers.py | Zadigo/twitter_template | 110dd857bce219bd596a30db6e49acffca7af286 | [
"MIT"
] | 14 | 2020-11-19T18:55:28.000Z | 2022-02-01T22:08:23.000Z | accounts/managers.py | Zadigo/twitter_template | 110dd857bce219bd596a30db6e49acffca7af286 | [
"MIT"
] | 7 | 2020-06-30T23:55:36.000Z | 2021-11-12T00:06:40.000Z | from django.contrib.auth.models import BaseUserManager
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
class MyUserManager(BaseUserManager):
def create_user(self, email, firstname=None, lastname=None, username=None, password=None):
if not email:
... | 34.027778 | 97 | 0.690612 | from django.contrib.auth.models import BaseUserManager
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
class MyUserManager(BaseUserManager):
def create_user(self, email, firstname=None, lastname=None, username=None, password=None):
if not email:
... | true | true |
f74eb2a0e6a9da9a006170e2b8cffe1738b249ac | 84 | py | Python | guillotina_graphql/tests/conftest.py | masipcat/guillotina_graphql | 509d5d5a8724188c9a14eeb09b0a08f420d9e98e | [
"MIT"
] | 1 | 2020-09-27T16:36:29.000Z | 2020-09-27T16:36:29.000Z | guillotina_graphql/tests/conftest.py | masipcat/guillotina_graphql | 509d5d5a8724188c9a14eeb09b0a08f420d9e98e | [
"MIT"
] | null | null | null | guillotina_graphql/tests/conftest.py | masipcat/guillotina_graphql | 509d5d5a8724188c9a14eeb09b0a08f420d9e98e | [
"MIT"
] | null | null | null | pytest_plugins = ["guillotina.tests.fixtures", "guillotina_graphql.tests.fixtures"]
| 42 | 83 | 0.809524 | pytest_plugins = ["guillotina.tests.fixtures", "guillotina_graphql.tests.fixtures"]
| true | true |
f74eb2f20e33ca808e60bade0b3d0b83296f71bd | 11,898 | py | Python | .tox/scenario/lib/python2.7/site-packages/keystoneclient/tests/unit/test_ec2utils.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/keystoneclient/tests/unit/test_ec2utils.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/keystoneclient/tests/unit/test_ec2utils.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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... | 44.898113 | 75 | 0.552278 |
from __future__ import unicode_literals
import testtools
from keystoneclient.contrib.ec2 import utils
from keystoneclient.tests.unit import client_fixtures
class Ec2SignerTest(testtools.TestCase):
def setUp(self):
super(Ec2SignerTest, self).setUp()
self.useFixture(client_fixtures.... | true | true |
f74eb4044ebd77ad2d23fbed335972038a859265 | 3,795 | py | Python | tests/test_scaling.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 2 | 2020-02-10T17:30:34.000Z | 2021-04-05T22:02:21.000Z | tests/test_scaling.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 1 | 2020-06-25T05:01:35.000Z | 2020-06-25T08:49:09.000Z | tests/test_scaling.py | vpekar/forecastml | 55f667c33c5c0b17062117fb271748ef2a0a784e | [
"MIT"
] | 1 | 2020-06-24T14:57:42.000Z | 2020-06-24T14:57:42.000Z | from unittest import TestCase
from unittest.mock import Mock
import utils
import data
from utils import prepare_data
from tests.mock_data import get_df, get_preproc_config
class TestScaling2d(TestCase):
def setUp(self):
try:
reload(data)
reload(utils)
except NameError:
... | 30.853659 | 68 | 0.590514 | from unittest import TestCase
from unittest.mock import Mock
import utils
import data
from utils import prepare_data
from tests.mock_data import get_df, get_preproc_config
class TestScaling2d(TestCase):
def setUp(self):
try:
reload(data)
reload(utils)
except NameError:
... | true | true |
f74eb40d337a32336978ef4dd62f714d50499ba9 | 919 | py | Python | examples/cta_backtesting/backtesting_test.py | asciili/vnpy | df4b51f6c43dc579d260085c238f3cc97f0aeaf8 | [
"MIT"
] | null | null | null | examples/cta_backtesting/backtesting_test.py | asciili/vnpy | df4b51f6c43dc579d260085c238f3cc97f0aeaf8 | [
"MIT"
] | null | null | null | examples/cta_backtesting/backtesting_test.py | asciili/vnpy | df4b51f6c43dc579d260085c238f3cc97f0aeaf8 | [
"MIT"
] | null | null | null | # To add a new cell, type ''
# To add a new markdown cell, type ' [markdown]'
from vnpy.app.cta_strategy.backtesting import BacktestingEngine, OptimizationSetting
from vnpy.app.cta_strategy.strategies.test_strategy import (
TestStrategy,
)
from datetime import datetime
engine = BacktestingEngine()
engine.set_pa... | 20.886364 | 84 | 0.729053 |
from vnpy.app.cta_strategy.backtesting import BacktestingEngine, OptimizationSetting
from vnpy.app.cta_strategy.strategies.test_strategy import (
TestStrategy,
)
from datetime import datetime
engine = BacktestingEngine()
engine.set_parameters(
vt_symbol="rb1910.SHFE",
interval="1h",
start=datetime... | true | true |
f74eb4d35fdb19e339a1b4b942f9673144426e28 | 40,099 | py | Python | tests/test_func_api_classification_multiclass.py | Trevor-Waite/vecstack | e9185909e8ece6500139e0f4305635fc1fc9fb50 | [
"MIT"
] | 693 | 2016-11-24T13:07:52.000Z | 2022-03-24T16:30:07.000Z | tests/test_func_api_classification_multiclass.py | Trevor-Waite/vecstack | e9185909e8ece6500139e0f4305635fc1fc9fb50 | [
"MIT"
] | 44 | 2017-09-14T15:53:09.000Z | 2021-11-03T11:35:06.000Z | tests/test_func_api_classification_multiclass.py | Trevor-Waite/vecstack | e9185909e8ece6500139e0f4305635fc1fc9fb50 | [
"MIT"
] | 94 | 2016-11-25T10:15:20.000Z | 2022-02-27T10:13:24.000Z | #-------------------------------------------------------------------------------
# !!! cross_val_predict uses stratified split
#-------------------------------------------------------------------------------
# Main concept for testing returned arrays:
# 1). create ground truth e.g. with cross_val_predict
# 2). run vecs... | 46.954333 | 104 | 0.604653 |
from __future__ import print_function
from __future__ import division
import unittest
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
import os
import glob
import numpy as np
import scipy.stats as st
from sklearn.model_selection import cross_val_predict
from sklearn.mode... | true | true |
f74eb5597a77b94b6ace364148c8ca420d15e4f8 | 12,537 | py | Python | plugins/modules/oci_mysql_analytics_cluster_actions.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_actions.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_actions.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 35.216292 | 153 | 0.62838 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_mysql_analytics_cluster_actions
short_description: Perform actions on an... | true | true |
f74eb640087d2899fd87ee7e75cd155d2a5032c9 | 1,182 | py | Python | leetcode/merge_two_sorted_lists.py | jjrodcast/CompetitiveProblems | a91868c3d24ad164fa637a8b3d682ec70d7ed7aa | [
"MIT"
] | null | null | null | leetcode/merge_two_sorted_lists.py | jjrodcast/CompetitiveProblems | a91868c3d24ad164fa637a8b3d682ec70d7ed7aa | [
"MIT"
] | null | null | null | leetcode/merge_two_sorted_lists.py | jjrodcast/CompetitiveProblems | a91868c3d24ad164fa637a8b3d682ec70d7ed7aa | [
"MIT"
] | null | null | null | """
Enlace al problema:
https://leetcode.com/problems/merge-two-sorted-lists/
Si deseas probar la solución sólo tienes que copiar la clase Solution
ya que dicha clase es la que se ejecuta en la plataforma de LeetCode.
"""
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
... | 25.695652 | 70 | 0.607445 |
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
headOne, headTwo = l1, l2
merged = ListNode(0)
newHead = merged
while headOne and headTwo:
... | true | true |
f74eb6a1211b850dd0c08d41c1bfb52d80014d5e | 7,431 | py | Python | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | 1 | 2019-04-24T19:50:03.000Z | 2019-04-24T19:50:03.000Z | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | 3 | 2019-10-11T20:31:57.000Z | 2020-04-13T16:06:43.000Z | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | null | null | null | import json
_jalbums_relinked = """
{
"href": "https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=5&include_groups=album,single,compilation,appears_on&market=ES",
"items": [
{
"album_group": "album",
"album_type": "album",
"artists": [
{
"externa... | 31.35443 | 155 | 0.543534 | import json
_jalbums_relinked = """
{
"href": "https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=5&include_groups=album,single,compilation,appears_on&market=ES",
"items": [
{
"album_group": "album",
"album_type": "album",
"artists": [
{
"externa... | true | true |
f74eb7184b5eb5c314bfdd04b28c2d8846ad08c1 | 2,860 | py | Python | some_bandits/bandits/EXP3.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | null | null | null | some_bandits/bandits/EXP3.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | null | null | null | some_bandits/bandits/EXP3.py | EGAlberts/some_bandits | 99ee49e74c85ede2d941932396245c441a4b7e9b | [
"MIT"
] | 1 | 2022-03-23T03:40:11.000Z | 2022-03-23T03:40:11.000Z | import numpy as np
from random import sample
from some_bandits.bandit_options import bandit_args
from some_bandits.utilities import convert_conf, save_to_pickle, calculate_utility
from some_bandits.bandits.Bandit import Bandit
from some_bandits.bandits.Expert import Expert
from statistics import mean
ACTION = ... | 30.425532 | 106 | 0.588112 | import numpy as np
from random import sample
from some_bandits.bandit_options import bandit_args
from some_bandits.utilities import convert_conf, save_to_pickle, calculate_utility
from some_bandits.bandits.Bandit import Bandit
from some_bandits.bandits.Expert import Expert
from statistics import mean
ACTION = ... | true | true |
f74eb780a017833647cf73e03b2463d71982d50d | 2,535 | py | Python | cm/app/constant.py | HotMaps/heatsource_potential | f0ec72c3c68d887371603c7ebc8ecbf160fc0a40 | [
"Apache-2.0"
] | null | null | null | cm/app/constant.py | HotMaps/heatsource_potential | f0ec72c3c68d887371603c7ebc8ecbf160fc0a40 | [
"Apache-2.0"
] | null | null | null | cm/app/constant.py | HotMaps/heatsource_potential | f0ec72c3c68d887371603c7ebc8ecbf160fc0a40 | [
"Apache-2.0"
] | null | null | null | import os
CELERY_BROKER_URL_DOCKER = "amqp://admin:mypass@rabbit:5672/"
CELERY_BROKER_URL_LOCAL = "amqp://localhost/"
CM_REGISTER_Q = "rpc_queue_CM_register" # Do no change this value
CM_NAME = "CM - Heat sources potential"
RPC_CM_ALIVE = "rpc_queue_CM_ALIVE" # Do no change this value
RPC_Q = "rpc_queue_CM_comput... | 35.704225 | 173 | 0.63432 | import os
CELERY_BROKER_URL_DOCKER = "amqp://admin:mypass@rabbit:5672/"
CELERY_BROKER_URL_LOCAL = "amqp://localhost/"
CM_REGISTER_Q = "rpc_queue_CM_register"
CM_NAME = "CM - Heat sources potential"
RPC_CM_ALIVE = "rpc_queue_CM_ALIVE"
RPC_Q = "rpc_queue_CM_compute"
CM_ID = 11
PORT_LOCAL = int("500" + str(CM_... | true | true |
f74eb7e5baf985299324155626654ba151f357db | 304 | py | Python | app/main/forms.py | pullao/Farspeaker | 998a037d537f04e5297191f11c0bcd269b76ca31 | [
"MIT"
] | null | null | null | app/main/forms.py | pullao/Farspeaker | 998a037d537f04e5297191f11c0bcd269b76ca31 | [
"MIT"
] | 9 | 2016-10-17T06:28:28.000Z | 2016-12-09T02:29:19.000Z | app/main/forms.py | pullao/Farspeaker | 998a037d537f04e5297191f11c0bcd269b76ca31 | [
"MIT"
] | null | null | null | import flask_wtf
import wtforms
class LoginForm(flask_wtf.Form):
"""Accepts a nickname and a room."""
name = wtforms.fields.StringField('Name', validators=[wtforms.validators.Required()])
#room = StringField('Room', validators=[Required()])
submit = wtforms.fields.SubmitField('Start')
| 30.4 | 89 | 0.717105 | import flask_wtf
import wtforms
class LoginForm(flask_wtf.Form):
name = wtforms.fields.StringField('Name', validators=[wtforms.validators.Required()])
submit = wtforms.fields.SubmitField('Start')
| true | true |
f74eb867c824beb725deb89845230a8c358cd41d | 4,220 | py | Python | utils.py | Zdddzz/smartcontract | e587c72cb76883437cd653a47cf14f038ab72f74 | [
"MIT"
] | null | null | null | utils.py | Zdddzz/smartcontract | e587c72cb76883437cd653a47cf14f038ab72f74 | [
"MIT"
] | null | null | null | utils.py | Zdddzz/smartcontract | e587c72cb76883437cd653a47cf14f038ab72f74 | [
"MIT"
] | 1 | 2022-02-28T07:35:16.000Z | 2022-02-28T07:35:16.000Z | # -*- coding: utf-8 -*-
# @Time : 2020-12-25 22:28
# @Author : Di Zhu
import json
import logging
import os
import shutil
import torch
class Params(object):
"""Class that loads hyperparameters from a json file.
Example:
```
params = Params(json_path)
print(params.learning_rate)
params.lea... | 29.929078 | 109 | 0.658768 |
import json
import logging
import os
import shutil
import torch
class Params(object):
def __init__(self, json_path):
with open(json_path) as f:
params = json.load(f)
self.__dict__.update(params)
def save(self, json_path):
with open(json_path, 'w') as f:
... | true | true |
f74eb8aac4aebb041f1912306989076bf147aea6 | 1,944 | py | Python | backend/app/api.py | Joel-hanson/fastapi-reactjs-boilerplate | 5344b329185104b6850137b338aa988c32c917a6 | [
"MIT"
] | 1 | 2021-05-19T07:19:39.000Z | 2021-05-19T07:19:39.000Z | backend/app/api.py | Joel-hanson/fastapi-reactjs-boilerplate | 5344b329185104b6850137b338aa988c32c917a6 | [
"MIT"
] | null | null | null | backend/app/api.py | Joel-hanson/fastapi-reactjs-boilerplate | 5344b329185104b6850137b338aa988c32c917a6 | [
"MIT"
] | null | null | null | import os
import json
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.config import Config
from starlette.requests import Request
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import HTMLResponse, RedirectResponse
from authlib.integr... | 25.246753 | 88 | 0.69856 | import os
import json
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.config import Config
from starlette.requests import Request
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import HTMLResponse, RedirectResponse
from authlib.integr... | true | true |
f74eb9f683d016df1a54a02644f554f202c66dc7 | 1,327 | py | Python | var/spack/repos/builtin/packages/debugedit/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/debugedit/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/debugedit/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Debugedit(AutotoolsPackage):
"""
Debugedit is a set of libraries and programs for crea... | 36.861111 | 93 | 0.702336 |
from spack import *
class Debugedit(AutotoolsPackage):
homepage = "https://www.sourceware.org/debugedit/"
git = "git://sourceware.org/git/debugedit.git"
url = "https://sourceware.org/ftp/debugedit/0.2/debugedit-0.2.tar.xz"
version('develop', branch='main')
version('0.2', sha256="b... | true | true |
f74eba2a52a7181349b842c2757460c2144641e0 | 8,023 | py | Python | src/sdk/pynni/nni/compression/torch/pruning/one_shot.py | johnarthur1/nni | 2d026a13f97612bc7961d5a55f5088a169de9ee9 | [
"MIT"
] | 1 | 2020-11-15T20:11:23.000Z | 2020-11-15T20:11:23.000Z | src/sdk/pynni/nni/compression/torch/pruning/one_shot.py | ajeets1978/nni | 41312de5dcbe8ba1f59c08a7b62fd5207f623804 | [
"MIT"
] | 17 | 2020-11-13T19:01:15.000Z | 2022-02-27T09:34:49.000Z | src/sdk/pynni/nni/compression/torch/pruning/one_shot.py | ajeets1978/nni | 41312de5dcbe8ba1f59c08a7b62fd5207f623804 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
from schema import And, Optional
from .constants import MASKER_DICT
from ..utils.config_validation import CompressorSchema
from ..compressor import Pruner
__all__ = ['LevelPruner', 'SlimPruner', 'L1FilterPruner', 'L2FilterPruner',... | 35.657778 | 138 | 0.63991 |
import logging
from schema import And, Optional
from .constants import MASKER_DICT
from ..utils.config_validation import CompressorSchema
from ..compressor import Pruner
__all__ = ['LevelPruner', 'SlimPruner', 'L1FilterPruner', 'L2FilterPruner', 'FPGMPruner', \
'TaylorFOWeightFilterPruner', 'ActivationAPoZRankF... | true | true |
f74eba8dfe967fd144530f4580d4a85a6c9c8123 | 2,608 | py | Python | gcloud-fd.py | andrewbanonis/python-ai-projects | 62256d3486df6dadd66fcea94454f66d7ca19997 | [
"MIT"
] | null | null | null | gcloud-fd.py | andrewbanonis/python-ai-projects | 62256d3486df6dadd66fcea94454f66d7ca19997 | [
"MIT"
] | null | null | null | gcloud-fd.py | andrewbanonis/python-ai-projects | 62256d3486df6dadd66fcea94454f66d7ca19997 | [
"MIT"
] | null | null | null | """Draws squares around detected faces in the given image."""
import argparse
from google.cloud import vision
from PIL import Image, ImageDraw
def detect_face(face_file, max_results=4):
"""Uses the Vision API to detect faces in the given file.
Args:
face_file: A file-like object containing ... | 35.243243 | 77 | 0.631902 |
import argparse
from google.cloud import vision
from PIL import Image, ImageDraw
def detect_face(face_file, max_results=4):
client = vision.ImageAnnotatorClient()
content = face_file.read()
image = vision.Image(content=content)
return client.face_detection(
image=image, max_res... | true | true |
f74ebe14baa6ba95694360d61210e2f91b304e88 | 3,779 | py | Python | access360/view/AccountView.py | Kokoserver/lafiamiApi | f315d026096def948db4bd7a00d76b12fa09f247 | [
"MIT"
] | null | null | null | access360/view/AccountView.py | Kokoserver/lafiamiApi | f315d026096def948db4bd7a00d76b12fa09f247 | [
"MIT"
] | null | null | null | access360/view/AccountView.py | Kokoserver/lafiamiApi | f315d026096def948db4bd7a00d76b12fa09f247 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, status
from mongoengine import errors
from access360.api.model import accountModel
from access360.api.model.userMixin import AccountManager
from access360.view.generalMixin import Access360FullMixin
from access360.api.model.AccountPydanticModel import UserRegisterationInput, UserLoginIn... | 49.723684 | 102 | 0.598306 | from fastapi import APIRouter, status
from mongoengine import errors
from access360.api.model import accountModel
from access360.api.model.userMixin import AccountManager
from access360.view.generalMixin import Access360FullMixin
from access360.api.model.AccountPydanticModel import UserRegisterationInput, UserLoginIn... | true | true |
f74ebef29364402102e422e7b747a87ce3dd32b2 | 2,857 | py | Python | TMM_examples/TMM_bragg_multilayer.py | zhaonat/RCWA | a28fdf90b5b5fc0fedacc8bb44a0a0c2f2a02143 | [
"MIT"
] | 66 | 2019-03-11T11:59:26.000Z | 2022-03-25T05:17:11.000Z | TMM_examples/TMM_bragg_multilayer.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 5 | 2018-09-23T05:18:15.000Z | 2021-11-07T20:16:40.000Z | TMM_examples/TMM_bragg_multilayer.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 33 | 2018-09-23T05:16:59.000Z | 2022-03-23T08:37:07.000Z | import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import numpy as np
import matplotlib.pyplot as plt;
import cmath;
from TMM_functions import run_TMM_simulation as rTMM
## GOAL: simulate a BRAGG MIRROR at some wavelength (1 micron)
... | 32.83908 | 140 | 0.677284 | import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import numpy as np
import matplotlib.pyplot as plt;
import cmath;
from TMM_functions import run_TMM_simulation as rTMM
4*np.pi*10**-7;
c0 = 1/(np.sqrt(mu0*eps0))
I = np.matrix(np.eye... | true | true |
f74ebf473eb86b5827d161b7019fccf847a6e826 | 1,301 | py | Python | test.py | omardude/therover | 40710094a4864143f223d5ccca30e7796bc7b215 | [
"MIT"
] | null | null | null | test.py | omardude/therover | 40710094a4864143f223d5ccca30e7796bc7b215 | [
"MIT"
] | null | null | null | test.py | omardude/therover | 40710094a4864143f223d5ccca30e7796bc7b215 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import explorerhat
from time import sleep
from random import randint
#the explorer hat has already some motor functions build in
#invert() - Reverses the direction of forwards for this motor
#forwards( speed ) - Turns the motor "forwards" at speed ( default 100% )
#backwards( speed ) - Turns the ... | 23.232143 | 84 | 0.710992 |
import explorerhat
from time import sleep
from random import randint
speed = 65
def forwards():
explorerhat.motor.one.forward(65)
explorerhat.motor.two.forward(65)
sleep(0.5)
explorerhat.motor.one.stop()
explorerhat.motor.two.stop()
def backwards():
explorerhat.motor.one.backward... | true | true |
f74ec031f96c705f23642d3ddf01f21432843199 | 8,100 | py | Python | day20_2021.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | 1 | 2021-12-20T11:10:59.000Z | 2021-12-20T11:10:59.000Z | day20_2021.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | null | null | null | day20_2021.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | 1 | 2021-12-02T14:40:12.000Z | 2021-12-02T14:40:12.000Z | # Day20 - 2021 Advent of code
# source: https://adventofcode.com/2021/day/20
import os
import numpy as np
def clear_console():
os.system('clear')
print('< .... AoC 2021 Day 20, part 1 .... >')
print()
return
# convert from pixels to binary "...#...#." -> "000100010"
def pix_2_binary(the_... | 38.571429 | 199 | 0.57358 |
import os
import numpy as np
def clear_console():
os.system('clear')
print('< .... AoC 2021 Day 20, part 1 .... >')
print()
return
def pix_2_binary(the_9_pixels):
i = 0
binaryX = ""
pix = the_9_pixels
while i < 9:
if pix[i] == ".": binaryX += "0"
... | true | true |
f74ec1041bcd13928998dda827ecb0ec580a6a90 | 27,011 | py | Python | autotest/osr/osr_proj4.py | VirtualGeo/gdal | 1d799cf5d8c399d9ac3feb7ef9f05dc6e3297a82 | [
"MIT"
] | null | null | null | autotest/osr/osr_proj4.py | VirtualGeo/gdal | 1d799cf5d8c399d9ac3feb7ef9f05dc6e3297a82 | [
"MIT"
] | null | null | null | autotest/osr/osr_proj4.py | VirtualGeo/gdal | 1d799cf5d8c399d9ac3feb7ef9f05dc6e3297a82 | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test some PROJ.4 specific translation issues.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
###########################################... | 35.262402 | 357 | 0.550813 |
assert got_proj4str == expect_proj4str
###############################################################################
# Test unit parsing
#
def test_osr_proj4_16():
def almost(a, b):
if abs(a - b) > 0.000000000001:
return False
return True
units = (('km', 1000.),
... | true | true |
f74ec181416c4b6612b115bcb3e760a30c82215b | 18,321 | py | Python | fairseq/data/multilingual/sampled_multi_dataset.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 24 | 2021-10-18T04:17:07.000Z | 2022-03-24T08:13:37.000Z | fairseq/data/multilingual/sampled_multi_dataset.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 10 | 2021-11-14T12:28:48.000Z | 2022-02-28T14:13:40.000Z | fairseq/data/multilingual/sampled_multi_dataset.py | BowenBao/fairseq | a9f5741f58c05c581686b73465d7e3f9df5528f3 | [
"MIT"
] | 5 | 2021-11-10T08:55:33.000Z | 2022-03-14T14:57:48.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import hashlib
import logging
import time
from bisect import bisect_right
from collections import OrderedDict, defaultdict
fro... | 39.147436 | 119 | 0.596965 |
import datetime
import hashlib
import logging
import time
from bisect import bisect_right
from collections import OrderedDict, defaultdict
from enum import Enum
from typing import List
import numpy as np
import torch
from fairseq import distributed_utils
from fairseq.data import FairseqDataset, data_utils
def g... | true | true |
f74ec203cfc5d8a61a59353539718ac10db8ca35 | 565 | py | Python | app/blueprints/api/apimodels/__init__.py | neurothrone/project-dot | 20889075611bed645689a76a30257f96e4b55988 | [
"MIT"
] | null | null | null | app/blueprints/api/apimodels/__init__.py | neurothrone/project-dot | 20889075611bed645689a76a30257f96e4b55988 | [
"MIT"
] | null | null | null | app/blueprints/api/apimodels/__init__.py | neurothrone/project-dot | 20889075611bed645689a76a30257f96e4b55988 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from app.shared.operation import Operation
class APIModelBase(ABC):
def __init__(self):
self.detail: str = ""
self.status_code: int | None = None
self.was_successful: bool = False
@abstractmethod
def exec(self) -> None:
pass
@abstr... | 23.541667 | 54 | 0.658407 | from abc import ABC, abstractmethod
from app.shared.operation import Operation
class APIModelBase(ABC):
def __init__(self):
self.detail: str = ""
self.status_code: int | None = None
self.was_successful: bool = False
@abstractmethod
def exec(self) -> None:
pass
@abstr... | true | true |
f74ec56cee775e9b6fb28df287a4af784e5296be | 4,528 | py | Python | rec_to_nwb/processing/nwb/components/position/time/invalid/fl_pos_invalid_time_manager.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 8 | 2020-05-29T13:48:35.000Z | 2021-11-19T04:24:48.000Z | rec_to_nwb/processing/nwb/components/position/time/invalid/fl_pos_invalid_time_manager.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 12 | 2020-11-13T01:36:32.000Z | 2022-01-23T20:35:55.000Z | rec_to_nwb/processing/nwb/components/position/time/invalid/fl_pos_invalid_time_manager.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 3 | 2020-10-20T06:52:45.000Z | 2021-07-06T23:00:53.000Z | import numpy as np
from pynwb import NWBFile
from rec_to_nwb.processing.exceptions.missing_data_exception import MissingDataException
from rec_to_nwb.processing.nwb.components.position.time.invalid.fl_pos_invalid_time_builder import \
FlPosInvalidTimeBuilder
from rec_to_nwb.processing.tools.beartype.beartype impor... | 41.925926 | 120 | 0.706714 | import numpy as np
from pynwb import NWBFile
from rec_to_nwb.processing.exceptions.missing_data_exception import MissingDataException
from rec_to_nwb.processing.nwb.components.position.time.invalid.fl_pos_invalid_time_builder import \
FlPosInvalidTimeBuilder
from rec_to_nwb.processing.tools.beartype.beartype impor... | true | true |
f74ec5acc820115922f8d7a822d985d681cbe7ab | 3,645 | py | Python | src/pip/_internal/distributions/source.py | j420247/pip | 33cd93cac86690134e8b4874ac42c4e0ce8770d2 | [
"MIT"
] | null | null | null | src/pip/_internal/distributions/source.py | j420247/pip | 33cd93cac86690134e8b4874ac42c4e0ce8770d2 | [
"MIT"
] | 1 | 2019-12-12T02:34:38.000Z | 2019-12-12T02:34:38.000Z | src/pip/_internal/distributions/source.py | gudonglaile/pip-gui | ac9c49c54b7a882d8091959ba14eec37612a3845 | [
"MIT"
] | null | null | null | # The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import logging
from pip._internal.build_env import BuildEnvironment
from pip._internal.distributions.base import AbstractDistribution
from pip._internal.exceptions import InstallationError
from pip._internal.uti... | 39.619565 | 76 | 0.641427 |
import logging
from pip._internal.build_env import BuildEnvironment
from pip._internal.distributions.base import AbstractDistribution
from pip._internal.exceptions import InstallationError
from pip._internal.utils.subprocess import runner_with_spinner_message
logger = logging.getLogger(__name__)
class SourceDist... | true | true |
f74ec6d2a75ed29792558132bf8072e46cd3a66d | 11,624 | py | Python | torchreid/data/transforms.py | AHEAD-IntelligentCamera/deep-person-reid | a412f8e11f54f78f7bbef9e60dbb2159eed09917 | [
"MIT"
] | null | null | null | torchreid/data/transforms.py | AHEAD-IntelligentCamera/deep-person-reid | a412f8e11f54f78f7bbef9e60dbb2159eed09917 | [
"MIT"
] | null | null | null | torchreid/data/transforms.py | AHEAD-IntelligentCamera/deep-person-reid | a412f8e11f54f78f7bbef9e60dbb2159eed09917 | [
"MIT"
] | null | null | null | from __future__ import division, print_function, absolute_import
import math
import random
from collections import deque
import torch
from PIL import Image
from torchvision.transforms import (
Resize, Compose, ToTensor, Normalize, ColorJitter, RandomHorizontalFlip, Pad
)
class Random2DTranslation(object):
"""... | 31.759563 | 97 | 0.581211 | from __future__ import division, print_function, absolute_import
import math
import random
from collections import deque
import torch
from PIL import Image
from torchvision.transforms import (
Resize, Compose, ToTensor, Normalize, ColorJitter, RandomHorizontalFlip, Pad
)
class Random2DTranslation(object):
de... | true | true |
f74ec7cf96bbc9878acaea0c931ab47715a1eaf2 | 1,898 | py | Python | python_developer_tools/cv/bases/input_conv/space_to_depth.py | carlsummer/python_developer_tools | a8c4365b7cc601cda55648cdfd8c0cb1faae132f | [
"Apache-2.0"
] | 32 | 2021-06-21T04:49:48.000Z | 2022-03-29T05:46:59.000Z | python_developer_tools/cv/bases/input_conv/space_to_depth.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 1 | 2021-11-12T03:45:55.000Z | 2021-11-12T03:45:55.000Z | python_developer_tools/cv/bases/input_conv/space_to_depth.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 10 | 2021-06-03T08:05:05.000Z | 2021-12-13T03:10:42.000Z | # !/usr/bin/env python
# -- coding: utf-8 --
# @Author zengxiaohui
# Datatime:8/31/2021 2:50 PM
# @File:SpaceToDepthModuleConv
import torch
import torch.nn as nn
class SpaceToDepth(nn.Module):
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
... | 31.633333 | 102 | 0.517914 |
import torch
import torch.nn as nn
class SpaceToDepth(nn.Module):
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
def forward(self, x):
N, C, H, W = x.size()
x = x.view(N, C, H // self.bs, self.bs, W // self.bs, sel... | true | true |
f74ec916ba202a839d7a91708392acd9a02acee3 | 1,288 | py | Python | main.py | andreas-paul/map-of-mars | 71205dafdafccdeac76f05aff1ede5fb1911a5a2 | [
"MIT"
] | null | null | null | main.py | andreas-paul/map-of-mars | 71205dafdafccdeac76f05aff1ede5fb1911a5a2 | [
"MIT"
] | null | null | null | main.py | andreas-paul/map-of-mars | 71205dafdafccdeac76f05aff1ede5fb1911a5a2 | [
"MIT"
] | null | null | null | #%%
import rasterio
from pathlib import Path
import matplotlib.pyplot as plt
from blend_modes import blending_functions
from utils import get_dem_data, load_shapefile, crop_raster, save_raster, make_ramp
dem_path: Path = Path("https://planetarymaps.usgs.gov/mosaic/Mars_MGS_MOLA_DEM_mosaic_global_463m.tif")
cropped_r... | 35.777778 | 103 | 0.704193 |
import rasterio
from pathlib import Path
import matplotlib.pyplot as plt
from blend_modes import blending_functions
from utils import get_dem_data, load_shapefile, crop_raster, save_raster, make_ramp
dem_path: Path = Path("https://planetarymaps.usgs.gov/mosaic/Mars_MGS_MOLA_DEM_mosaic_global_463m.tif")
cropped_rast... | true | true |
f74ec985cfa654ecf6b00245ef10a0976a5c88be | 4,068 | py | Python | experiments/ashvin/rfeatures/sawyer/door2/bc_v3_imagenet1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rfeatures/sawyer/door2/bc_v3_imagenet1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rfeatures/sawyer/door2/bc_v3_imagenet1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | import gym
import railrl.torch.pytorch_util as ptu
from railrl.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer
from railrl.exploration_strategies.base import \
PolicyWrappedWithExplorationStrategy
from railrl.exploration_strategies.gaussian_and_epislon import \
GaussianAndEpislonStrategy
... | 36.321429 | 111 | 0.682153 | import gym
import railrl.torch.pytorch_util as ptu
from railrl.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer
from railrl.exploration_strategies.base import \
PolicyWrappedWithExplorationStrategy
from railrl.exploration_strategies.gaussian_and_epislon import \
GaussianAndEpislonStrategy
... | true | true |
f74eca0532bfeffaa5e7ea3470caba4036fbf5e1 | 10,249 | py | Python | applications/ForCA/languages/pt-br.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | 6 | 2018-01-25T01:07:55.000Z | 2019-04-26T23:58:29.000Z | applications/ForCA/languages/pt-br.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | null | null | null | applications/ForCA/languages/pt-br.py | forca-inf/forca | 99b63c63a7aaebd6f11cb4f73ec54de54ce25986 | [
"BSD-3-Clause"
] | 2 | 2018-02-03T02:55:56.000Z | 2018-02-06T19:55:10.000Z | # coding: utf8
{
'\n Ao clicar no botão "enviar" abaixo, você estará concordando com os termos de uso acima descritos': '\n Ao clicar no botão "enviar" abaixo, você estará concordando com os termos de uso acima descritos',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the r... | 52.290816 | 290 | 0.714411 |
{
'\n Ao clicar no botão "enviar" abaixo, você estará concordando com os termos de uso acima descritos': '\n Ao clicar no botão "enviar" abaixo, você estará concordando com os termos de uso acima descritos',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JO... | true | true |
f74eca7e77859726f4fb38addd1950435509cd67 | 1,428 | py | Python | froide/accesstoken/migrations/0001_initial.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | froide/accesstoken/migrations/0001_initial.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | froide/accesstoken/migrations/0001_initial.py | OpendataCH/froide | 8136bac0d8caa56f9cfc7ba15480be987280e55d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-09 15:29
from __future__ import unicode_literals
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 27.461538 | 88 | 0.460784 |
from __future__ import unicode_literals
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | true | true |
f74eca9dcabfb2ecf89fcb770f4889bcf25a70ae | 712 | py | Python | mmdet/models/detectors/__init__.py | daniel616/DL | b62087bb86bcfa4cdaa692bb0ae724d416761de3 | [
"Apache-2.0"
] | 2 | 2020-03-22T14:27:38.000Z | 2020-06-20T02:35:14.000Z | mmdet/models/detectors/__init__.py | daniel616/DL | b62087bb86bcfa4cdaa692bb0ae724d416761de3 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/__init__.py | daniel616/DL | b62087bb86bcfa4cdaa692bb0ae724d416761de3 | [
"Apache-2.0"
] | null | null | null | from .base import BaseDetector
from .single_stage import SingleStageDetector
from .two_stage import TwoStageDetector
from .rpn import RPN
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .mask_rcnn import MaskRCNN
from .cascade_rcnn import CascadeRCNN
from .htc import HybridTaskCascade
from .ret... | 33.904762 | 77 | 0.797753 | from .base import BaseDetector
from .single_stage import SingleStageDetector
from .two_stage import TwoStageDetector
from .rpn import RPN
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .mask_rcnn import MaskRCNN
from .cascade_rcnn import CascadeRCNN
from .htc import HybridTaskCascade
from .ret... | true | true |
f74ecbb250592175bdde67e1840eb58a48ad495e | 30,133 | py | Python | plugin.py | z1mEk/domoticz-airly | 28d7a7c72a9489456cc2e2415410442ad4fa060a | [
"MIT"
] | null | null | null | plugin.py | z1mEk/domoticz-airly | 28d7a7c72a9489456cc2e2415410442ad4fa060a | [
"MIT"
] | null | null | null | plugin.py | z1mEk/domoticz-airly | 28d7a7c72a9489456cc2e2415410442ad4fa060a | [
"MIT"
] | null | null | null | # A Python plugin for Domoticz to access airly api for smog information in Poland
#
# Author: fisher
#
# TODO: Update text sensors only when changed
#
#
# v0.1.0 - initial version, fetching data from airly sensor
# v0.1.1 - response body decode - error handling, minor language corrections
# v0.1.2 - removed gettext bas... | 36.436518 | 199 | 0.507483 |
import Domoticz
import datetime
import json
from http.client import HTTPSConnection
from urllib.parse import urlparse
from urllib.parse import urlencode
import socket
L10N = {
'pl': {
"Air Quality Index":
"Jakość powietrza",
"PM1":
"PM1",
"PM2,5":
... | true | true |
f74ecc1945a244ff07fa8377a9643f2e0d99ef73 | 12,765 | py | Python | Inference/src/recursive_placement/ocrnet_with_exit.py | ZSL98/ETBA | 618317698adb9e372fb11dc0c3a01f856e0759b0 | [
"MIT"
] | 1 | 2021-12-01T15:22:44.000Z | 2021-12-01T15:22:44.000Z | Inference/src/recursive_placement/ocrnet_with_exit.py | ZSL98/ETBA | 618317698adb9e372fb11dc0c3a01f856e0759b0 | [
"MIT"
] | null | null | null | Inference/src/recursive_placement/ocrnet_with_exit.py | ZSL98/ETBA | 618317698adb9e372fb11dc0c3a01f856e0759b0 | [
"MIT"
] | null | null | null | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Shulai Zhang
## Microsoft Research
## yuyua@microsoft.com
## Copyright (c) 2021
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##++++++++++++... | 42.408638 | 214 | 0.574853 | s1, backbone_s2
from lib.models.backbones.resnet.resnet_models import ResNetModels, ResNet, Bottleneck
from lib.models.backbones.resnet.resnet_backbone import DilatedResnetBackbone
class SpatialOCRNet_s1(nn.Module):
def __init__(self, split_point):
self.inplanes = 128
super(SpatialOCRNet_s1, self)... | true | true |
f74ecc544f3d44efc02ec339c56fe0a958873083 | 3,138 | py | Python | research/autoencoder/autoencoder_models/VariationalAutoencoder.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/autoencoder/autoencoder_models/VariationalAutoencoder.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/autoencoder/autoencoder_models/VariationalAutoencoder.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
class VariationalAutoencoder(object):
def __init__(self, n_input, n_hidden, optimizer = tf.train.AdamOptimizer()):
self.n_input = n_input
self.n_hidden = n_hidden
network_weights = self._initialize_weights()
self.weights = network_weights
... | 44.197183 | 116 | 0.622371 | import tensorflow as tf
class VariationalAutoencoder(object):
def __init__(self, n_input, n_hidden, optimizer = tf.train.AdamOptimizer()):
self.n_input = n_input
self.n_hidden = n_hidden
network_weights = self._initialize_weights()
self.weights = network_weights
... | true | true |
f74ecd2812eb533993c72e46e9ab93ce6fccf46d | 2,229 | py | Python | load_data_tf.py | aishwarya8615/MRNET-GAN | a66b4c83ef5566e95e7587f7ddad43b9ecc263d8 | [
"MIT"
] | null | null | null | load_data_tf.py | aishwarya8615/MRNET-GAN | a66b4c83ef5566e95e7587f7ddad43b9ecc263d8 | [
"MIT"
] | null | null | null | load_data_tf.py | aishwarya8615/MRNET-GAN | a66b4c83ef5566e95e7587f7ddad43b9ecc263d8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import tensorflow as tf
class MRNetDataset():
def __init__(self, root_dir, task, plane, train=True, transform=None, weights=None):
self.task = task
self.plane = plane
self.root_dir = root_dir
self.train = train
if self.train:
... | 34.292308 | 97 | 0.551368 | import numpy as np
import pandas as pd
import tensorflow as tf
class MRNetDataset():
def __init__(self, root_dir, task, plane, train=True, transform=None, weights=None):
self.task = task
self.plane = plane
self.root_dir = root_dir
self.train = train
if self.train:
... | true | true |
f74ecdf9f13e465ff5f11bc42aac2d00362a90ea | 918 | py | Python | benchmark/runtime/dgl/train.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 12,651 | 2017-10-28T15:14:24.000Z | 2021-09-12T07:22:57.000Z | benchmark/runtime/dgl/train.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 2,472 | 2017-10-30T23:38:47.000Z | 2021-09-12T06:41:44.000Z | benchmark/runtime/dgl/train.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 2,363 | 2017-12-01T13:25:05.000Z | 2021-09-12T07:23:09.000Z | import time
import torch
import torch.nn.functional as F
def train_runtime(model, data, epochs, device):
if hasattr(data, 'features'):
x = torch.tensor(data.features, dtype=torch.float, device=device)
else:
x = None
mask = data.train_mask if hasattr(data, 'train_mask') else data.train_idx... | 26.228571 | 77 | 0.645969 | import time
import torch
import torch.nn.functional as F
def train_runtime(model, data, epochs, device):
if hasattr(data, 'features'):
x = torch.tensor(data.features, dtype=torch.float, device=device)
else:
x = None
mask = data.train_mask if hasattr(data, 'train_mask') else data.train_idx... | true | true |
f74ece4b22a00dea620d412bd0ac21222b534e15 | 5,903 | py | Python | tests/integration/modules/test_mac_softwareupdate.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 1 | 2022-02-09T06:40:14.000Z | 2022-02-09T06:40:14.000Z | tests/integration/modules/test_mac_softwareupdate.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | tests/integration/modules/test_mac_softwareupdate.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
integration tests for mac_softwareupdate
'''
# Import python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.unit import skipIf
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, skip_if_not_root
# Import ... | 32.794444 | 95 | 0.645096 |
from __future__ import absolute_import
from tests.support.unit import skipIf
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, skip_if_not_root
import salt.utils
@skip_if_not_root
@skipIf(not salt.utils.is_darwin(), 'Test only available on macOS')
@skipIf(not salt.uti... | true | true |
f74ecec306905e837801c792eabcf067338974dd | 5,296 | py | Python | litedram/common.py | EwoutH/litedram | 8e01cba7e6d20a96487303f295803d678503bff2 | [
"OLDAP-2.6",
"OLDAP-2.7",
"OLDAP-2.3"
] | null | null | null | litedram/common.py | EwoutH/litedram | 8e01cba7e6d20a96487303f295803d678503bff2 | [
"OLDAP-2.6",
"OLDAP-2.7",
"OLDAP-2.3"
] | 1 | 2019-01-21T14:59:14.000Z | 2019-01-21T14:59:14.000Z | litedram/common.py | EwoutH/litedram | 8e01cba7e6d20a96487303f295803d678503bff2 | [
"OLDAP-2.6",
"OLDAP-2.7",
"OLDAP-2.3"
] | null | null | null | from migen import *
from litex.soc.interconnect import stream
burst_lengths = {
"SDR": 1,
"DDR": 4,
"LPDDR": 4,
"DDR2": 4,
"DDR3": 8,
"DDR4": 8
}
class Settings:
def set_attributes(self, attributes):
for k, v in attributes.items():
setattr(self, k, v)
class ... | 28.320856 | 101 | 0.578739 | from migen import *
from litex.soc.interconnect import stream
burst_lengths = {
"SDR": 1,
"DDR": 4,
"LPDDR": 4,
"DDR2": 4,
"DDR3": 8,
"DDR4": 8
}
class Settings:
def set_attributes(self, attributes):
for k, v in attributes.items():
setattr(self, k, v)
class ... | true | true |
f74ecedba296e529c7427114519bf8babee32a17 | 6,265 | py | Python | solaris/nets/infer.py | sandhi-artha/solaris | 230a58f94f300062ee880d43920d218edf3321c4 | [
"Apache-2.0"
] | null | null | null | solaris/nets/infer.py | sandhi-artha/solaris | 230a58f94f300062ee880d43920d218edf3321c4 | [
"Apache-2.0"
] | null | null | null | solaris/nets/infer.py | sandhi-artha/solaris | 230a58f94f300062ee880d43920d218edf3321c4 | [
"Apache-2.0"
] | null | null | null | import os
import torch
from osgeo import gdal
import numpy as np
from warnings import warn
from .model_io import get_model
from .transform import process_aug_dict
from .datagen import InferenceTiler
from ..raster.image import stitch_images, create_multiband_geotiff
from ..utils.core import get_data_paths
class Infere... | 45.729927 | 79 | 0.566959 | import os
import torch
from osgeo import gdal
import numpy as np
from warnings import warn
from .model_io import get_model
from .transform import process_aug_dict
from .datagen import InferenceTiler
from ..raster.image import stitch_images, create_multiband_geotiff
from ..utils.core import get_data_paths
class Infere... | true | true |
f74ecf4463e17871137e951d742381790fe05272 | 8,690 | py | Python | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/helpers.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/helpers.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 4 | 2021-04-30T08:10:26.000Z | 2021-04-30T13:53:34.000Z | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/helpers.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, publ... | 46.72043 | 146 | 0.7 |
from collections import defaultdict
from datetime import datetime
from typing import Dict, FrozenSet, Iterable, List
from airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog
from base_python import AirbyteLogger
from google.oauth2 import service_account
from goo... | true | true |
f74ecf6a233af7df8150ce1a4e7ffd0bcbd2bdf1 | 179 | py | Python | kosmos/__init__.py | abostroem/kosmos | 63758bb622a6ec83aeb3ac2350ccda5c6c1ef63b | [
"MIT"
] | 1 | 2022-02-24T21:50:06.000Z | 2022-02-24T21:50:06.000Z | kosmos/__init__.py | abostroem/kosmos | 63758bb622a6ec83aeb3ac2350ccda5c6c1ef63b | [
"MIT"
] | 2 | 2022-02-24T19:53:02.000Z | 2022-02-24T20:13:26.000Z | kosmos/__init__.py | abostroem/kosmos | 63758bb622a6ec83aeb3ac2350ccda5c6c1ef63b | [
"MIT"
] | 3 | 2022-01-26T18:27:42.000Z | 2022-03-16T13:50:03.000Z | from .fluxcal import *
from .flatfield import *
from .apextract import *
from .identify import *
from .imtools import *
from .wrappers import *
from .version import __version__
| 22.375 | 32 | 0.759777 | from .fluxcal import *
from .flatfield import *
from .apextract import *
from .identify import *
from .imtools import *
from .wrappers import *
from .version import __version__
| true | true |
f74ed1605604166bf11121b5950224375cc8b7ff | 3,968 | py | Python | test/example_telegrams.py | bremme/dsmr_parser | 97786576cf4dc2aaee5d10c737f44eb30c6923ae | [
"MIT"
] | 82 | 2016-11-07T13:59:38.000Z | 2022-03-21T14:48:45.000Z | test/example_telegrams.py | bremme/dsmr_parser | 97786576cf4dc2aaee5d10c737f44eb30c6923ae | [
"MIT"
] | 91 | 2016-09-10T20:13:18.000Z | 2022-03-07T20:51:35.000Z | test/example_telegrams.py | bremme/dsmr_parser | 97786576cf4dc2aaee5d10c737f44eb30c6923ae | [
"MIT"
] | 52 | 2016-11-06T19:38:32.000Z | 2022-03-19T23:16:34.000Z | TELEGRAM_V2_2 = (
'/ISk5\\2MT382-1004\r\n'
'\r\n'
'0-0:96.1.1(00000000000000)\r\n'
'1-0:1.8.1(00001.001*kWh)\r\n'
'1-0:1.8.2(00001.001*kWh)\r\n'
'1-0:2.8.1(00001.001*kWh)\r\n'
'1-0:2.8.2(00001.001*kWh)\r\n'
'0-0:96.14.0(0001)\r\n'
'1-0:1.7.0(0001.01*kW)\r\n'
'1-0:2.7.0(0000.00*kW... | 30.290076 | 80 | 0.52495 | TELEGRAM_V2_2 = (
'/ISk5\\2MT382-1004\r\n'
'\r\n'
'0-0:96.1.1(00000000000000)\r\n'
'1-0:1.8.1(00001.001*kWh)\r\n'
'1-0:1.8.2(00001.001*kWh)\r\n'
'1-0:2.8.1(00001.001*kWh)\r\n'
'1-0:2.8.2(00001.001*kWh)\r\n'
'0-0:96.14.0(0001)\r\n'
'1-0:1.7.0(0001.01*kW)\r\n'
'1-0:2.7.0(0000.00*kW... | true | true |
f74ed211dfedd0b720146912f4eedb191c09ef1c | 306 | py | Python | howlong/common/utils.py | zezaeoh/how-long | c6879a7857c24f947338dc725e5e1fc84d6e90c1 | [
"MIT"
] | 1 | 2020-08-04T12:29:35.000Z | 2020-08-04T12:29:35.000Z | howlong/common/utils.py | zezaeoh/how-long | c6879a7857c24f947338dc725e5e1fc84d6e90c1 | [
"MIT"
] | 4 | 2021-03-19T01:00:03.000Z | 2021-06-04T22:41:06.000Z | howlong/common/utils.py | zezaeoh/how-long | c6879a7857c24f947338dc725e5e1fc84d6e90c1 | [
"MIT"
] | null | null | null | import sys
import traceback
import logging
logger = logging.getLogger(__name__)
def logging_traceback():
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
error_message = ''.join(lines)
logger.error(error_message)
| 23.538462 | 74 | 0.764706 | import sys
import traceback
import logging
logger = logging.getLogger(__name__)
def logging_traceback():
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
error_message = ''.join(lines)
logger.error(error_message)
| true | true |
f74ed27e91f869ad40b4c04078bcddcb2fdb2e53 | 15,142 | py | Python | python/ray/util/placement_group.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | python/ray/util/placement_group.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 51 | 2018-05-17T05:55:28.000Z | 2020-03-18T06:49:49.000Z | python/ray/util/placement_group.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | from typing import Dict, Union, List, Optional
import ray
from ray._raylet import ObjectRef
from ray._raylet import PlacementGroupID
from ray._private.utils import hex_to_binary
from ray.util.annotations import PublicAPI, DeveloperAPI
from ray.ray_constants import to_memory_units
from ray._private.client_mode_hook imp... | 35.966746 | 88 | 0.670123 | from typing import Dict, Union, List, Optional
import ray
from ray._raylet import ObjectRef
from ray._raylet import PlacementGroupID
from ray._private.utils import hex_to_binary
from ray.util.annotations import PublicAPI, DeveloperAPI
from ray.ray_constants import to_memory_units
from ray._private.client_mode_hook imp... | true | true |
f74ed322e04678f1d8f849e4d551147db489f3a6 | 98 | py | Python | app_licences/apps.py | Donovan1905/Licence-api | 5e11c388be701f9e64fc11ec0fc7a3978de99b19 | [
"FSFAP"
] | null | null | null | app_licences/apps.py | Donovan1905/Licence-api | 5e11c388be701f9e64fc11ec0fc7a3978de99b19 | [
"FSFAP"
] | null | null | null | app_licences/apps.py | Donovan1905/Licence-api | 5e11c388be701f9e64fc11ec0fc7a3978de99b19 | [
"FSFAP"
] | null | null | null | from django.apps import AppConfig
class AppLicencesConfig(AppConfig):
name = 'app_licences'
| 16.333333 | 35 | 0.77551 | from django.apps import AppConfig
class AppLicencesConfig(AppConfig):
name = 'app_licences'
| true | true |
f74ed461f60f0be372df52a67c4b964677e67ec7 | 905 | py | Python | emit_main/workflow/test_tasks.py | emit-sds/emit-main | 7c2f6feacc68b8a962309d8a3a7f6decc571c69d | [
"Apache-2.0"
] | 1 | 2022-02-11T17:05:52.000Z | 2022-02-11T17:05:52.000Z | emit_main/workflow/test_tasks.py | emit-sds/emit-main | 7c2f6feacc68b8a962309d8a3a7f6decc571c69d | [
"Apache-2.0"
] | null | null | null | emit_main/workflow/test_tasks.py | emit-sds/emit-main | 7c2f6feacc68b8a962309d8a3a7f6decc571c69d | [
"Apache-2.0"
] | null | null | null | """
This code contains test tasks for luigi
Author: Winston Olson-Duvall, winston.olson-duvall@jpl.nasa.gov
"""
import os
import luigi
from emit_main.workflow.workflow_manager import WorkflowManager
from emit_main.workflow.slurm import SlurmJobTask
class ExampleTask(SlurmJobTask):
config_path = luigi.Paramet... | 23.205128 | 94 | 0.714917 |
import os
import luigi
from emit_main.workflow.workflow_manager import WorkflowManager
from emit_main.workflow.slurm import SlurmJobTask
class ExampleTask(SlurmJobTask):
config_path = luigi.Parameter()
acquisition_id = luigi.Parameter()
level = luigi.Parameter()
partition = luigi.Parameter()
... | true | true |
f74ed4c73e431c82e72f73e3461ac4abf92ec2be | 7,404 | py | Python | var/spack/repos/builtin/packages/tcl/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/tcl/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/tcl/package.py | QianJianhua1/spack | 363536fd929d2aee280e07780ff6c98498d7be46 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.util.environment import is_system_path
class Tcl(AutotoolsPackage, SourceforgePackage):
"""Tcl... | 45.423313 | 96 | 0.644652 |
import os
from spack.util.environment import is_system_path
class Tcl(AutotoolsPackage, SourceforgePackage):
homepage = "https://www.tcl.tk/"
sourceforge_mirror_path = "tcl/tcl8.6.11-src.tar.gz"
version('8.6.12', sha256='26c995dd0f167e48b11961d891ee555f680c175f7173ff8cb829f4ebcde4c1a6')
versio... | true | true |
f74ed4d3f6dbed79dd9cd8284ebd596853204398 | 2,074 | py | Python | numpy/distutils/__init__.py | Akhilesh271988/numpy | 1ab7e8fbf90ac4a81d2ffdde7d78ec464dccb02e | [
"BSD-3-Clause"
] | 1 | 2022-02-24T10:16:43.000Z | 2022-02-24T10:16:43.000Z | numpy/distutils/__init__.py | Akhilesh271988/numpy | 1ab7e8fbf90ac4a81d2ffdde7d78ec464dccb02e | [
"BSD-3-Clause"
] | 8 | 2021-10-07T10:59:49.000Z | 2021-11-22T20:06:49.000Z | numpy/distutils/__init__.py | Akhilesh271988/numpy | 1ab7e8fbf90ac4a81d2ffdde7d78ec464dccb02e | [
"BSD-3-Clause"
] | 1 | 2022-03-22T11:47:01.000Z | 2022-03-22T11:47:01.000Z | """
An enhanced distutils, providing support for Fortran compilers, for BLAS,
LAPACK and other common libraries for numerical computing, and more.
Public submodules are::
misc_util
system_info
cpu_info
log
exec_command
For details, please see the *Packaging* and *NumPy Distutils User Guide*
secti... | 31.907692 | 83 | 0.738187 |
import warnings
from . import ccompiler
from . import unixccompiler
from .npy_pkg_config import *
warnings.warn("\n\n"
" `numpy.distutils` is deprecated since NumPy 1.23.0, as a result\n"
" of the deprecation of `distutils` itself. It will be removed for\n"
" Python >= 3.12. For older Python versio... | true | true |
f74ed5315fac58db47670193bdff2dfda9b16a61 | 434 | py | Python | tests/test_ext_githubpages.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | 1 | 2020-07-10T03:38:08.000Z | 2020-07-10T03:38:08.000Z | tests/test_ext_githubpages.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | tests/test_ext_githubpages.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | 1 | 2018-11-29T06:45:05.000Z | 2018-11-29T06:45:05.000Z | # -*- coding: utf-8 -*-
"""
test_ext_githubpages
~~~~~~~~~~~~~~~~~~~~
Test sphinx.ext.githubpages extension.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from util import with_app
@with_app('html', testroot='ext-githubpages')
def t... | 22.842105 | 68 | 0.652074 |
from util import with_app
@with_app('html', testroot='ext-githubpages')
def test_githubpages(app, status, warning):
app.builder.build_all()
assert (app.outdir / '.nojekyll').exists()
| true | true |
f74ed785bbbfc8a56e418dc12f444b5b470f9514 | 4,954 | py | Python | libcxx/utils/ssh.py | jroelofs/apple-llvm-project | ed6b4c087baabbc7331524c56423ce2d9322c8f9 | [
"Apache-2.0"
] | 5 | 2021-02-21T22:35:08.000Z | 2022-02-01T18:22:50.000Z | libcxx/utils/ssh.py | jroelofs/apple-llvm-project | ed6b4c087baabbc7331524c56423ce2d9322c8f9 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/ssh.py | jroelofs/apple-llvm-project | ed6b4c087baabbc7331524c56423ce2d9322c8f9 | [
"Apache-2.0"
] | 1 | 2021-03-30T11:22:52.000Z | 2021-03-30T11:22:52.000Z | #!/usr/bin/env python
#===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------... | 43.45614 | 109 | 0.643924 |
import argparse
import os
import posixpath
import subprocess
import sys
import tarfile
import tempfile
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--host', type=str, required=True)
parser.add_argument('--execdir', type=str, required=True)
parser.add_argument('--codesign_ide... | true | true |
f74ed7e532d150e3317ce6d613829a354d93affd | 17,855 | py | Python | object_detection/model/detection/keypoint_rcnn.py | HeartFu/NeuralBabyTalk | acd9f927d3b977c69ff8286bc45f9fb073dd1b6b | [
"MIT"
] | 1 | 2020-10-01T21:03:39.000Z | 2020-10-01T21:03:39.000Z | object_detection/model/detection/keypoint_rcnn.py | HeartFu/NeuralBabyTalk | acd9f927d3b977c69ff8286bc45f9fb073dd1b6b | [
"MIT"
] | null | null | null | object_detection/model/detection/keypoint_rcnn.py | HeartFu/NeuralBabyTalk | acd9f927d3b977c69ff8286bc45f9fb073dd1b6b | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torchvision.ops import MultiScaleRoIAlign
from ..utils import load_state_dict_from_url
from .faster_rcnn import FasterRCNN
from .backbone_utils import resnet_fpn_backbone
__all__ = [
"KeypointRCNN", "keypointrcnn_resnet50_fpn"
]
class KeypointRCNN(FasterRCNN):
"""
... | 56.147799 | 116 | 0.654607 | import torch
from torch import nn
from torchvision.ops import MultiScaleRoIAlign
from ..utils import load_state_dict_from_url
from .faster_rcnn import FasterRCNN
from .backbone_utils import resnet_fpn_backbone
__all__ = [
"KeypointRCNN", "keypointrcnn_resnet50_fpn"
]
class KeypointRCNN(FasterRCNN):
def _... | true | true |
f74ed85f82d938f5edbdb982c027a1ebac115db6 | 1,002 | py | Python | part_07.py | vu-univ-3360-5360/assignment-02-barbourww | 4fccbd5dd7e96f9340db61eb06a40b0d4043d79d | [
"MIT"
] | null | null | null | part_07.py | vu-univ-3360-5360/assignment-02-barbourww | 4fccbd5dd7e96f9340db61eb06a40b0d4043d79d | [
"MIT"
] | null | null | null | part_07.py | vu-univ-3360-5360/assignment-02-barbourww | 4fccbd5dd7e96f9340db61eb06a40b0d4043d79d | [
"MIT"
] | null | null | null | # WILLIAM BARBOUR
# UNIV 5360
# ASSIGNMENT 1: PYTHON
# 01/22/2018
# PART 7
# SPARQL
# ---------------------------------------------------------------
# datadotworld module has been imported as dw
import datadotworld as dw
# We've written a SPARQL query for you and assigned it to the `sparql_query` variable:
sparql_... | 40.08 | 220 | 0.715569 |
import datadotworld as dw
sparql_query = "PREFIX GOT: <https://tutorial.linked.data.world/d/sparqltutorial/> SELECT ?FName ?LName WHERE {?person GOT:col-got-house \"Stark\" . ?person GOT:col-got-fname ?FName . ?person GOT:col-got-lname ?LName .}"
# Use the pre-defined SPARQL query to query dataset http://d... | true | true |
f74ed86d151466a79d00a1af2cdb6dc7a02c46b0 | 1,278 | py | Python | scripts/frames1.py | lottilotte/compas_occ | 0e6cd8fb90802995993fca82a65e26157bf193fd | [
"MIT"
] | 6 | 2021-03-23T09:31:02.000Z | 2022-02-14T13:13:43.000Z | scripts/frames1.py | lottilotte/compas_occ | 0e6cd8fb90802995993fca82a65e26157bf193fd | [
"MIT"
] | 6 | 2021-03-23T15:03:14.000Z | 2022-01-18T07:43:36.000Z | scripts/frames1.py | lottilotte/compas_occ | 0e6cd8fb90802995993fca82a65e26157bf193fd | [
"MIT"
] | 4 | 2021-03-23T14:51:31.000Z | 2022-03-29T07:48:42.000Z | from compas.geometry import Point, Polyline
from compas.utilities import meshgrid, flatten
from compas_view2.app import App
from compas_occ.geometry.curves import BSplineCurve
from compas_occ.geometry.surfaces import BSplineSurface
points1 = []
points1.append(Point(-4, 0, 2))
points1.append(Point(-7, 2, 2))
points1.... | 27.782609 | 86 | 0.63615 | from compas.geometry import Point, Polyline
from compas.utilities import meshgrid, flatten
from compas_view2.app import App
from compas_occ.geometry.curves import BSplineCurve
from compas_occ.geometry.surfaces import BSplineSurface
points1 = []
points1.append(Point(-4, 0, 2))
points1.append(Point(-7, 2, 2))
points1.... | true | true |
f74ed9383f88485ef3c1c88831d86817012b0f6b | 10,731 | py | Python | test/functional/wallet_listtransactions.py | cdonnachie/Avian | 31fbaaa732af33ed50bd9d5b51023d985c7de683 | [
"MIT"
] | null | null | null | test/functional/wallet_listtransactions.py | cdonnachie/Avian | 31fbaaa732af33ed50bd9d5b51023d985c7de683 | [
"MIT"
] | null | null | null | test/functional/wallet_listtransactions.py | cdonnachie/Avian | 31fbaaa732af33ed50bd9d5b51023d985c7de683 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from io import ... | 51.591346 | 116 | 0.599199 |
from io import BytesIO
from decimal import Decimal
from test_framework.test_framework import AvianTestFramework
from test_framework.util import hex_str_to_bytes, assert_array_result, sync_mempools, assert_equal, bytes_to_hex_str
from test_framework.mininode import CTransaction, COIN
def from_hex(hexstring):
... | true | true |
f74ed997dab0873e1f2a1668a5786575c2b00176 | 5,210 | py | Python | Translation/bin.py | liudan92221/translation | cc2ea460ebb9c2191f89f9c31591ca8b2a072b97 | [
"MIT"
] | 1 | 2017-07-02T08:25:39.000Z | 2017-07-02T08:25:39.000Z | Translation/bin.py | liudan92221/translation | cc2ea460ebb9c2191f89f9c31591ca8b2a072b97 | [
"MIT"
] | null | null | null | Translation/bin.py | liudan92221/translation | cc2ea460ebb9c2191f89f9c31591ca8b2a072b97 | [
"MIT"
] | null | null | null | import os, json, sys, re, random, time
import requests, inquirer
from jinja2 import Template
from termcolor import colored
root = os.path.dirname(os.path.realpath(__file__))
JSON_FILE = root + '/json.json'
ARR_FILE = root + '/arr.json'
MAP = {
'名词': 'n.',
'动词': 'vt.',
'形容词': 'adj.',
'副词': 'adv.',
'介词': 'pr... | 20.756972 | 119 | 0.565259 | import os, json, sys, re, random, time
import requests, inquirer
from jinja2 import Template
from termcolor import colored
root = os.path.dirname(os.path.realpath(__file__))
JSON_FILE = root + '/json.json'
ARR_FILE = root + '/arr.json'
MAP = {
'名词': 'n.',
'动词': 'vt.',
'形容词': 'adj.',
'副词': 'adv.',
'介词': 'pr... | true | true |
f74ed9c32ce2f3b2bef22c7458ed2566fe9abcdf | 5,048 | py | Python | dashboard/pagination.py | encode/dashboard | a184d749a3a806f8d65574b5712ddce24169c677 | [
"BSD-3-Clause"
] | 92 | 2020-04-09T17:26:33.000Z | 2022-03-21T02:23:59.000Z | dashboard/pagination.py | encode/staradmin | a184d749a3a806f8d65574b5712ddce24169c677 | [
"BSD-3-Clause"
] | 6 | 2020-04-21T14:01:56.000Z | 2021-11-23T14:29:50.000Z | dashboard/pagination.py | encode/staradmin | a184d749a3a806f8d65574b5712ddce24169c677 | [
"BSD-3-Clause"
] | 7 | 2020-04-13T13:59:07.000Z | 2022-03-13T02:18:41.000Z | import typing
from dataclasses import dataclass
from starlette.datastructures import URL, QueryParams
@dataclass
class PageControl:
text: str
url: URL = None
is_active: bool = False
is_disabled: bool = False
def inclusive_range(st: int, en: int, cutoff: int) -> typing.List[int]:
"""
Return ... | 34.813793 | 86 | 0.636094 | import typing
from dataclasses import dataclass
from starlette.datastructures import URL, QueryParams
@dataclass
class PageControl:
text: str
url: URL = None
is_active: bool = False
is_disabled: bool = False
def inclusive_range(st: int, en: int, cutoff: int) -> typing.List[int]:
st = max(st, 1)... | true | true |
f74eda3e8393dbebc8f2857f55114a96bf0bb2ae | 10,616 | bzl | Python | bazel/envoy_test.bzl | guillaumerosinosky/envoy | 2cc9b69f28caa34bd0bc0d4371b669f027807ccd | [
"Apache-2.0"
] | 1 | 2022-01-21T01:39:10.000Z | 2022-01-21T01:39:10.000Z | bazel/envoy_test.bzl | guillaumerosinosky/envoy | 2cc9b69f28caa34bd0bc0d4371b669f027807ccd | [
"Apache-2.0"
] | 221 | 2021-03-30T07:30:26.000Z | 2022-03-28T09:23:27.000Z | bazel/envoy_test.bzl | guillaumerosinosky/envoy | 2cc9b69f28caa34bd0bc0d4371b669f027807ccd | [
"Apache-2.0"
] | 1 | 2021-11-23T03:21:54.000Z | 2021-11-23T03:21:54.000Z | # DO NOT LOAD THIS FILE. Load envoy_build_system.bzl instead.
# Envoy test targets. This includes both test library and test binary targets.
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "fu... | 31.501484 | 125 | 0.566127 |
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "fuzzing_decoration")
load(":envoy_binary.bzl", "envoy_cc_binary")
load(":envoy_library.bzl", "tcmalloc_external_deps")
load(":envoy_pch.bzl",... | true | true |
f74edaf1665f7cb0eb24786b816ad917301f54f6 | 788 | py | Python | portfolio/portfolio_projects/models.py | Dafov/portfolio | fb3cb3721b944624c092d6046b0d9b005b7d9019 | [
"MIT"
] | null | null | null | portfolio/portfolio_projects/models.py | Dafov/portfolio | fb3cb3721b944624c092d6046b0d9b005b7d9019 | [
"MIT"
] | null | null | null | portfolio/portfolio_projects/models.py | Dafov/portfolio | fb3cb3721b944624c092d6046b0d9b005b7d9019 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.db import models
import uuid
UserModel = get_user_model()
class Project(models.Model):
title = models.CharField(max_length=20, unique=True)
description = models.TextField()
link = models.URLField(null=True)
image = models.ImageField(upload_t... | 28.142857 | 107 | 0.713198 | from django.contrib.auth import get_user_model
from django.db import models
import uuid
UserModel = get_user_model()
class Project(models.Model):
title = models.CharField(max_length=20, unique=True)
description = models.TextField()
link = models.URLField(null=True)
image = models.ImageField(upload_t... | true | true |
f74edb62de2292eb26ede2dbb95db180eda3b0fd | 9,047 | py | Python | samples/kidney/kidney3.py | MarziehHaghighi/Mask_RCNN | 54d23a28c7bd37c4364b41dbc825adcd104392ab | [
"MIT"
] | 1 | 2020-08-05T13:20:01.000Z | 2020-08-05T13:20:01.000Z | samples/kidney/kidney3.py | MarziehHaghighi/Mask_RCNN | 54d23a28c7bd37c4364b41dbc825adcd104392ab | [
"MIT"
] | null | null | null | samples/kidney/kidney3.py | MarziehHaghighi/Mask_RCNN | 54d23a28c7bd37c4364b41dbc825adcd104392ab | [
"MIT"
] | null | null | null | """
Mask R-CNN
Configurations and data loading code for the synthetic Shapes dataset.
This is a duplicate of the code in the noteobook train_shapes.ipynb for easy
import into other notebooks, such as inspect_model.ipynb.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Writt... | 41.122727 | 134 | 0.608157 |
import math
import random
import numpy as np
import cv2
import pickle
from config import Config
import utils
class KidneysConfig(Config):
NAME = "kidneys"
GPU_COUNT = 1
IMAGES_PER_GPU = 8
NUM_CLASSES = 1 + 2
IMAGE_MIN_DIM = 256
IMAGE_MAX_DIM = 256
... | true | true |
f74edd3ee559a374c76761dddf9a491b13dbd525 | 562 | py | Python | inventories/migrations/0068_auto_20200605_1818.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | inventories/migrations/0068_auto_20200605_1818.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | 7 | 2021-03-19T03:09:53.000Z | 2022-01-13T02:48:44.000Z | inventories/migrations/0068_auto_20200605_1818.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-05 18:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('digital_books', '0008_digital_book_rating'),
('inventories', '0067_auto_20200605_0418'),
]
operations = [
... | 26.761905 | 125 | 0.660142 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('digital_books', '0008_digital_book_rating'),
('inventories', '0067_auto_20200605_0418'),
]
operations = [
migrations.AlterField(
model... | true | true |
f74edd990707557cc1542a9f8c9c0f0672cf310c | 813 | py | Python | tests/unit/test_features.py | timgates42/lore | cfca2b459e2b333b8400c0751be2856cedb5eedd | [
"MIT"
] | 1,549 | 2017-11-09T10:45:41.000Z | 2022-02-25T02:11:43.000Z | tests/unit/test_features.py | timgates42/lore | cfca2b459e2b333b8400c0751be2856cedb5eedd | [
"MIT"
] | 65 | 2018-01-08T22:57:59.000Z | 2022-03-07T18:32:08.000Z | tests/unit/test_features.py | timgates42/lore | cfca2b459e2b333b8400c0751be2856cedb5eedd | [
"MIT"
] | 129 | 2018-01-10T21:39:30.000Z | 2022-03-18T05:40:00.000Z | import unittest
#from moto import mock_s3
import boto3
import pandas
from lore.io import download
from tests.mocks.features import UserWarehouseSearchesFeature
class TestFeatures(unittest.TestCase):
#@mock_s3
def xtest_s3_features(self):
s3 = boto3.resource('s3')
# We need to create the bu... | 29.035714 | 88 | 0.726937 | import unittest
import boto3
import pandas
from lore.io import download
from tests.mocks.features import UserWarehouseSearchesFeature
class TestFeatures(unittest.TestCase):
def xtest_s3_features(self):
s3 = boto3.resource('s3')
s3.create_bucket(Bucket='lore-test')
user_... | true | true |
f74eddf8629c16fff6aaf58fe820d866584e49c6 | 18,570 | py | Python | keras/engine/training_generator.py | IndigenousEngineering/keras_docker_with_NLTK | 075958831a3f74763ad1e094b3642f5174c7f817 | [
"MIT"
] | 10 | 2018-06-04T17:31:10.000Z | 2022-01-14T03:51:20.000Z | keras/engine/training_generator.py | Qily/keras | 1d81a20292ca6926e595d06a6cd725dbb104a146 | [
"MIT"
] | null | null | null | keras/engine/training_generator.py | Qily/keras | 1d81a20292ca6926e595d06a6cd725dbb104a146 | [
"MIT"
] | 7 | 2018-07-17T01:45:31.000Z | 2021-04-09T10:20:51.000Z | """Part of the training engine related to Python generators of array data.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import numpy as np
from .training_utils import is_sequence
from .training_utils import iter_sequence_infinite
from... | 39.094737 | 83 | 0.517717 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import numpy as np
from .training_utils import is_sequence
from .training_utils import iter_sequence_infinite
from .. import backend as K
from ..utils.data_utils import Sequence
from ..utils.da... | true | true |
f74ede5b92de3f2fcc944f8963d94e83c01d6e87 | 3,454 | py | Python | tests/test_modifier.py | chriswmackey/honeybee-schema | dbf2e040b940d50fc2874f6fbf3d222d9d25f3f5 | [
"BSD-3-Clause"
] | 9 | 2020-01-28T02:30:12.000Z | 2021-08-09T17:53:12.000Z | tests/test_modifier.py | chriswmackey/honeybee-schema | dbf2e040b940d50fc2874f6fbf3d222d9d25f3f5 | [
"BSD-3-Clause"
] | 317 | 2020-01-28T02:20:28.000Z | 2022-03-28T00:46:19.000Z | tests/test_modifier.py | chriswmackey/honeybee-schema | dbf2e040b940d50fc2874f6fbf3d222d9d25f3f5 | [
"BSD-3-Clause"
] | 9 | 2020-01-31T01:55:19.000Z | 2021-07-13T17:01:14.000Z | from honeybee_schema.radiance.modifier import Plastic, Glass, BSDF, Glow, Light, \
Trans, Mirror, Metal
from copy import copy
from pydantic import ValidationError
import pytest
import os
import json
# target folder where all of the samples live
root = os.path.dirname(os.path.dirname(__file__))
target_folder = os.p... | 31.4 | 84 | 0.753619 | from honeybee_schema.radiance.modifier import Plastic, Glass, BSDF, Glow, Light, \
Trans, Mirror, Metal
from copy import copy
from pydantic import ValidationError
import pytest
import os
import json
root = os.path.dirname(os.path.dirname(__file__))
target_folder = os.path.join(root, 'samples', 'modifier')
def t... | true | true |
f74eded0e71c4a88b4478b060a279a68a42803d7 | 2,452 | py | Python | var/spack/repos/builtin/packages/nlcglib/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/nlcglib/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/nlcglib/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Nlcglib(CMakePackage, CudaPackage):
"""Nonlinear CG methods for wave-function opti... | 37.723077 | 109 | 0.64478 |
from spack.package import *
class Nlcglib(CMakePackage, CudaPackage):
homepage = "https://github.com/simonpintarelli/nlcglib"
git = "https://github.com/simonpintarelli/nlcglib.git"
url = "https://github.com/simonpintarelli/nlcglib/archive/v0.9.tar.gz"
maintainers = ['simonpintarelli']... | true | true |
f74edffc19e1a664b4a4c3aa09ca334f7febad51 | 1,517 | py | Python | tests/components/switchbot/__init__.py | bastgau/core | 713d294627940e98e119f7ebcc27ccbdc7058497 | [
"Apache-2.0"
] | 3 | 2018-01-22T16:38:58.000Z | 2020-04-05T05:18:53.000Z | tests/components/switchbot/__init__.py | bastgau/core | 713d294627940e98e119f7ebcc27ccbdc7058497 | [
"Apache-2.0"
] | 20 | 2021-11-03T06:21:11.000Z | 2022-03-31T06:20:39.000Z | tests/components/switchbot/__init__.py | winning1120xx/home-assistant | 53d4c0ce2d374b5e97bbdc37742656c27adf8eea | [
"Apache-2.0"
] | 1 | 2021-08-01T06:12:13.000Z | 2021-08-01T06:12:13.000Z | """Tests for the switchbot integration."""
from unittest.mock import patch
from homeassistant.const import CONF_MAC, CONF_NAME, CONF_PASSWORD, CONF_SENSOR_TYPE
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
DOMAIN = "switchbot"
ENTRY_CONFIG = {
CONF_NAME: "test-name",
... | 23.338462 | 84 | 0.700066 | from unittest.mock import patch
from homeassistant.const import CONF_MAC, CONF_NAME, CONF_PASSWORD, CONF_SENSOR_TYPE
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
DOMAIN = "switchbot"
ENTRY_CONFIG = {
CONF_NAME: "test-name",
CONF_PASSWORD: "test-password",
CONF_MA... | true | true |
f74ee05f62a447918f32aa7cf9508d59edcedc07 | 1,481 | py | Python | flaskr/__init__.py | vitkhab/flask-example-app | ba65246a5068a42e5096724ea23b587f06a4114c | [
"BSD-3-Clause"
] | null | null | null | flaskr/__init__.py | vitkhab/flask-example-app | ba65246a5068a42e5096724ea23b587f06a4114c | [
"BSD-3-Clause"
] | null | null | null | flaskr/__init__.py | vitkhab/flask-example-app | ba65246a5068a42e5096724ea23b587f06a4114c | [
"BSD-3-Clause"
] | null | null | null | import os
import time
from flask import Flask
def create_app(test_config=None):
"""Create and configure an instance of the Flask application."""
time.sleep(10)
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
# a default secret that should be overridden by instanc... | 28.480769 | 71 | 0.667792 | import os
import time
from flask import Flask
def create_app(test_config=None):
time.sleep(10)
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_co... | true | true |
f74ee20f03371bd3dade381a4e25225f135d0893 | 35,740 | py | Python | Code/GameStateObj.py | Shahrose/lex-talionis | ef7e48124b36269f4212eb0e3a7747caf53bfadd | [
"MIT"
] | null | null | null | Code/GameStateObj.py | Shahrose/lex-talionis | ef7e48124b36269f4212eb0e3a7747caf53bfadd | [
"MIT"
] | null | null | null | Code/GameStateObj.py | Shahrose/lex-talionis | ef7e48124b36269f4212eb0e3a7747caf53bfadd | [
"MIT"
] | null | null | null | #! usr/bin/env python
import random
from collections import OrderedDict, Counter
# Custom imports
from . import GlobalConstants as GC
from . import configuration as cf
from . import static_random
from . import InputManager, Engine
from . import CustomObjects, StateMachine, AStar, Support, Dialogue, Cursor
fr... | 45.183312 | 156 | 0.584219 |
import random
from collections import OrderedDict, Counter
from . import GlobalConstants as GC
from . import configuration as cf
from . import static_random
from . import InputManager, Engine
from . import CustomObjects, StateMachine, AStar, Support, Dialogue, Cursor
from . import StatusCatalog, UnitObject, ... | true | true |
f74ee21dbccdba7193c0da0f22838acb601e447b | 9,303 | py | Python | tests/providers/google/cloud/operators/test_datafusion.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2019-12-11T15:54:13.000Z | 2021-05-24T20:21:08.000Z | tests/providers/google/cloud/operators/test_datafusion.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2021-02-08T20:40:47.000Z | 2022-03-29T22:27:53.000Z | tests/providers/google/cloud/operators/test_datafusion.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 2 | 2021-01-11T13:53:03.000Z | 2021-10-02T05:06:34.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.198444 | 88 | 0.688918 |
import mock
from airflow.providers.google.cloud.operators.datafusion import (
CloudDataFusionCreateInstanceOperator, CloudDataFusionCreatePipelineOperator,
CloudDataFusionDeleteInstanceOperator, CloudDataFusionDeletePipelineOperator,
CloudDataFusionGetInstanceOperator, CloudDataFusionListP... | true | true |
f74ee246a2dff82a9cbcdc4447d42dfe3bcd35fb | 16,455 | py | Python | Autocoders/src/generators/templates/serialize/namespaceSerialCpp.py | dstockhouse/eaglesat-fprime | e640b3faea0000e1ca8acab4d6ff66150196c32b | [
"Apache-2.0"
] | null | null | null | Autocoders/src/generators/templates/serialize/namespaceSerialCpp.py | dstockhouse/eaglesat-fprime | e640b3faea0000e1ca8acab4d6ff66150196c32b | [
"Apache-2.0"
] | null | null | null | Autocoders/src/generators/templates/serialize/namespaceSerialCpp.py | dstockhouse/eaglesat-fprime | e640b3faea0000e1ca8acab4d6ff66150196c32b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | 50.167683 | 138 | 0.554057 |
cals()]+SL+[globals(), builtin],"name",True)
if _v is not None: write(_filter(_v, rawExpr=u'${name}'))
write(u'''::''')
_v = VFSL([locals()]+SL+[globals(), builtin],"memname",True)
if _v is not None: write(_filter(_v, rawExpr=u'${memname}'))
... | true | true |
f74ee331dca4f611c64d455d2f18a7f796e3d536 | 263 | py | Python | wsgi/wsgi_api.py | RoMalms10/AirBnB_clone_v4 | 2f3188036bebe19b5ebc302d19fdebedcb6b27ff | [
"MIT"
] | null | null | null | wsgi/wsgi_api.py | RoMalms10/AirBnB_clone_v4 | 2f3188036bebe19b5ebc302d19fdebedcb6b27ff | [
"MIT"
] | null | null | null | wsgi/wsgi_api.py | RoMalms10/AirBnB_clone_v4 | 2f3188036bebe19b5ebc302d19fdebedcb6b27ff | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
imports API App for gunicorn configurations
gunicorn --bind 127.0.0.1:8002 wsgi.wsgi_api:app.app
"""
app = __import__('api.v1.app', globals(), locals(), ['*'])
if __name__ == "__main__":
"""runs the main flask app"""
app.app.run()
| 23.909091 | 58 | 0.65019 |
app = __import__('api.v1.app', globals(), locals(), ['*'])
if __name__ == "__main__":
app.app.run()
| true | true |
f74ee3c909eb3bc18038aee57bb8fb1da56bf55a | 1,422 | py | Python | diffiehellman/diffie_hellman.py | TOPDapp/py-diffie-hellman | ee7f12d5a07543d1bfdb95e9039ecd8e32c5564b | [
"MIT"
] | null | null | null | diffiehellman/diffie_hellman.py | TOPDapp/py-diffie-hellman | ee7f12d5a07543d1bfdb95e9039ecd8e32c5564b | [
"MIT"
] | null | null | null | diffiehellman/diffie_hellman.py | TOPDapp/py-diffie-hellman | ee7f12d5a07543d1bfdb95e9039ecd8e32c5564b | [
"MIT"
] | null | null | null | # Copyright (c) Kuba Szczodrzyński 2021-5-6.
import os
from .primes import PRIMES
class DiffieHellman:
_prime: int
_private_key: int
_public_key: int
_shared_key: int
@staticmethod
def _to_bytes(a: int) -> bytes:
return a.to_bytes((a.bit_length() + 7) // 8, byteorder="big")
de... | 31.6 | 74 | 0.672996 |
import os
from .primes import PRIMES
class DiffieHellman:
_prime: int
_private_key: int
_public_key: int
_shared_key: int
@staticmethod
def _to_bytes(a: int) -> bytes:
return a.to_bytes((a.bit_length() + 7) // 8, byteorder="big")
def __init__(self, group: int = 14, key_bits: i... | true | true |
f74ee3ca9f789d35686527fbd26b10564331383d | 195 | py | Python | Python/CodingBat/front_times.py | dvt32/cpp-journey | afd7db7a1ad106c41601fb09e963902187ae36e6 | [
"MIT"
] | 1 | 2018-05-24T11:30:05.000Z | 2018-05-24T11:30:05.000Z | Python/CodingBat/front_times.py | dvt32/cpp-journey | afd7db7a1ad106c41601fb09e963902187ae36e6 | [
"MIT"
] | null | null | null | Python/CodingBat/front_times.py | dvt32/cpp-journey | afd7db7a1ad106c41601fb09e963902187ae36e6 | [
"MIT"
] | 2 | 2017-08-11T06:53:30.000Z | 2017-08-29T12:07:52.000Z | # http://codingbat.com/prob/p165097
def front_times(str, n):
result = ""
for i in range(n):
if len(str) < 3:
result += str
else:
result += str[0:3]
return result
| 15 | 35 | 0.553846 |
def front_times(str, n):
result = ""
for i in range(n):
if len(str) < 3:
result += str
else:
result += str[0:3]
return result
| true | true |
f74ee3ef3a8e97329e37437e885e0be765fa6b74 | 2,038 | py | Python | felicette/utils/file_manager.py | plant999/felicette | 5fe758edb930d7ef4310ec3d89cffff00aeebd7a | [
"MIT"
] | 1 | 2020-11-02T10:20:17.000Z | 2020-11-02T10:20:17.000Z | felicette/utils/file_manager.py | plant999/felicette | 5fe758edb930d7ef4310ec3d89cffff00aeebd7a | [
"MIT"
] | 1 | 2021-06-01T07:40:07.000Z | 2021-06-01T07:40:07.000Z | felicette/utils/file_manager.py | plant999/felicette | 5fe758edb930d7ef4310ec3d89cffff00aeebd7a | [
"MIT"
] | 1 | 2020-07-28T01:37:50.000Z | 2020-07-28T01:37:50.000Z | import tempfile
import os
import requests
from tqdm import tqdm
from rich import print as rprint
from felicette.constants import band_tag_map
workdir = os.path.join(os.path.expanduser("~"), "felicette-data")
def check_sat_path(id):
data_path = os.path.join(workdir, id)
if not os.path.exists(data_path):
... | 33.966667 | 88 | 0.624141 | import tempfile
import os
import requests
from tqdm import tqdm
from rich import print as rprint
from felicette.constants import band_tag_map
workdir = os.path.join(os.path.expanduser("~"), "felicette-data")
def check_sat_path(id):
data_path = os.path.join(workdir, id)
if not os.path.exists(data_path):
... | true | true |
f74ee41ae39d93e9b2f719f5309fb7a662a56493 | 840 | py | Python | Scripts/rst2latex.py | reiyans/lineworks | f539e8a48c5618190a83cb36ca697d215a85ec57 | [
"MIT"
] | 1 | 2020-11-20T15:24:28.000Z | 2020-11-20T15:24:28.000Z | Scripts/rst2latex.py | 0yan/lineworks | f539e8a48c5618190a83cb36ca697d215a85ec57 | [
"MIT"
] | 3 | 2020-03-19T05:21:06.000Z | 2021-03-28T09:38:10.000Z | Scripts/rst2latex.py | reiyans/lineworks | f539e8a48c5618190a83cb36ca697d215a85ec57 | [
"MIT"
] | 1 | 2020-09-18T14:08:12.000Z | 2020-09-18T14:08:12.000Z | #!c:\users\reiya\pycharmprojects\lineworks\venv\scripts\python.exe
# $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing LaTeX.
"""
try:
import... | 31.111111 | 76 | 0.679762 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline
description = ('Generates LaTeX documents from standalone reStructuredText '
'sources. '
'Reads from <source> (default is stdin) and writes to '
... | true | true |
f74ee49d8b0b2c1d1238faef9005318a60f7a1fb | 2,564 | py | Python | sdk/diffgram/export/export.py | diffgram/python-sdk | 63ee7264c479ce1b4c97abd2a954e5b727fba5ea | [
"MIT"
] | 3 | 2021-08-28T01:25:43.000Z | 2021-12-07T18:22:23.000Z | sdk/diffgram/export/export.py | diffgram/python-sdk | 63ee7264c479ce1b4c97abd2a954e5b727fba5ea | [
"MIT"
] | 16 | 2021-04-14T22:54:07.000Z | 2021-11-22T15:11:17.000Z | sdk/diffgram/export/export.py | diffgram/python-sdk | 63ee7264c479ce1b4c97abd2a954e5b727fba5ea | [
"MIT"
] | null | null | null | from ..regular.regular import refresh_from_dict
class Export():
"""
An export object is metadata. ie Status, etc.
Exporting sample patterns:
A) Call generate_export() from a job object (or directory coming soon)
It will return JSON or a URL directly and is blocking.
Note, we maintain generate_export() as o... | 21.91453 | 89 | 0.703978 | from ..regular.regular import refresh_from_dict
class Export():
def __init__(self,
client):
self.client = client
def get_by_id(self, id: int):
raise NotImplemented
def new(self, export_dict: dict) -> 'Export':
export = Export(client = self.client)
refresh_from_dict(export, export_dict)
r... | true | true |
f74ee4ebcced5484e29b547361210deca5d07873 | 3,595 | py | Python | code6/qiubai/qiubai/middlewares.py | weijie88/spider_files | 9039f7ff0f4c76bc5aa80ca8b87b8280880392cc | [
"Apache-2.0"
] | null | null | null | code6/qiubai/qiubai/middlewares.py | weijie88/spider_files | 9039f7ff0f4c76bc5aa80ca8b87b8280880392cc | [
"Apache-2.0"
] | null | null | null | code6/qiubai/qiubai/middlewares.py | weijie88/spider_files | 9039f7ff0f4c76bc5aa80ca8b87b8280880392cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class QiubaiSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy a... | 34.567308 | 78 | 0.665925 |
from scrapy import signals
class QiubaiSpiderMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(self, response, spider):... | true | true |
f74ee508c06db999f3af4863585b1456bb834980 | 785 | py | Python | solutions/day5/test_solver.py | NunoMCSilva/My-Advent-of-Code-2017-Solutions | df818a2f7a733834d352b8fabcd340d75de8c0b1 | [
"MIT"
] | null | null | null | solutions/day5/test_solver.py | NunoMCSilva/My-Advent-of-Code-2017-Solutions | df818a2f7a733834d352b8fabcd340d75de8c0b1 | [
"MIT"
] | null | null | null | solutions/day5/test_solver.py | NunoMCSilva/My-Advent-of-Code-2017-Solutions | df818a2f7a733834d352b8fabcd340d75de8c0b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pytest
import solutions.day5.solver as solver
def test_solver1():
# act
output = solver.solver1([0, 3, 0, 1, -3])
# assert
assert output == 5
def test_solver1_jumps():
# arrange
jumps = [0, 3, 0, 1, -3]
# act
solver.solver1(ju... | 15.392157 | 53 | 0.585987 |
import pytest
import solutions.day5.solver as solver
def test_solver1():
output = solver.solver1([0, 3, 0, 1, -3])
assert output == 5
def test_solver1_jumps():
jumps = [0, 3, 0, 1, -3]
solver.solver1(jumps)
assert jumps == [2, 5, 0, 1, -2]
def test_solver2():
... | true | true |
f74ee724e6466774eca872b4da4d6542423fac7a | 4,238 | py | Python | openprocurement/bridge/basic/storages/elasticsearch_plugin.py | VDigitall/openprocurement.bridge.basic | 1ec9b75525a1c9666e7832c2cb91712667118120 | [
"Apache-2.0"
] | null | null | null | openprocurement/bridge/basic/storages/elasticsearch_plugin.py | VDigitall/openprocurement.bridge.basic | 1ec9b75525a1c9666e7832c2cb91712667118120 | [
"Apache-2.0"
] | null | null | null | openprocurement/bridge/basic/storages/elasticsearch_plugin.py | VDigitall/openprocurement.bridge.basic | 1ec9b75525a1c9666e7832c2cb91712667118120 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from elasticsearch import Elasticsearch
from functools import partial
LOGGER = logging.getLogger(__name__)
STORAGE_DEFAULTS = {
'host': '127.0.0.1',
'port': '9200',
'db_name': 'bridge_db',
'alias': 'bridge'
}
class ElasticsearchStorage(object):
def __init_... | 36.534483 | 79 | 0.529731 |
import logging
from elasticsearch import Elasticsearch
from functools import partial
LOGGER = logging.getLogger(__name__)
STORAGE_DEFAULTS = {
'host': '127.0.0.1',
'port': '9200',
'db_name': 'bridge_db',
'alias': 'bridge'
}
class ElasticsearchStorage(object):
def __init__(self, conf, resource)... | true | true |
f74ee7ebd92add35b65c5e3e4cbe6911b0ea7b22 | 12,642 | py | Python | oarepo_oai_pmh_harvester/ext.py | oarepo/invenio-oarepo-oai-pmh-harvester | 399ef743ac9da23d36e655e072aa72ee1b332372 | [
"MIT"
] | null | null | null | oarepo_oai_pmh_harvester/ext.py | oarepo/invenio-oarepo-oai-pmh-harvester | 399ef743ac9da23d36e655e072aa72ee1b332372 | [
"MIT"
] | 13 | 2020-11-04T13:47:55.000Z | 2021-04-15T17:56:33.000Z | oarepo_oai_pmh_harvester/ext.py | oarepo/oarepo-oai-pmh-harvester | 399ef743ac9da23d36e655e072aa72ee1b332372 | [
"MIT"
] | 1 | 2020-05-14T07:59:12.000Z | 2020-05-14T07:59:12.000Z | from collections import defaultdict
from typing import List, Union, Dict
from pkg_resources import iter_entry_points
from oarepo_oai_pmh_harvester.transformer import OAITransformer
from oarepo_oai_pmh_harvester.utils import infinite_dd
from . import config
from .provider import OAIProvider
from .synchronization impor... | 42.14 | 99 | 0.611849 | from collections import defaultdict
from typing import List, Union, Dict
from pkg_resources import iter_entry_points
from oarepo_oai_pmh_harvester.transformer import OAITransformer
from oarepo_oai_pmh_harvester.utils import infinite_dd
from . import config
from .provider import OAIProvider
from .synchronization impor... | true | true |
f74ee9badb73b35969412bd055cd21f9177d86a4 | 322 | py | Python | saleor/salingo/migrations/0002_update_prices.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | null | null | null | saleor/salingo/migrations/0002_update_prices.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | 8 | 2022-02-14T04:25:58.000Z | 2022-03-28T04:53:16.000Z | saleor/salingo/migrations/0002_update_prices.py | tgarbowski/saleor | 11218aeac8649112626c8f971ef3eec8378b5537 | [
"CC-BY-4.0"
] | null | null | null | # Generated by Django 3.1.2 on 2021-03-11 13:06
from django.db import migrations
from ..utils import read_sql_from_file
class Migration(migrations.Migration):
dependencies = [
("salingo", "0001_sku_to_date")
]
operations = [
migrations.RunSQL(read_sql_from_file('update_prices.sql'))
... | 21.466667 | 66 | 0.692547 |
from django.db import migrations
from ..utils import read_sql_from_file
class Migration(migrations.Migration):
dependencies = [
("salingo", "0001_sku_to_date")
]
operations = [
migrations.RunSQL(read_sql_from_file('update_prices.sql'))
]
| true | true |
f74ee9f69e0dcc714fda2c72c747ceefddf7b008 | 1,994 | py | Python | data/interpolate_elliptic_integral_1_2.py | pmehta08/MulensModel | 261738c445a8d116d09c90e65f6e847cfc8a7ad8 | [
"MIT"
] | 30 | 2016-08-30T23:32:43.000Z | 2022-03-07T20:06:25.000Z | data/interpolate_elliptic_integral_1_2.py | pmehta08/MulensModel | 261738c445a8d116d09c90e65f6e847cfc8a7ad8 | [
"MIT"
] | 25 | 2018-08-22T19:14:22.000Z | 2022-03-28T17:22:56.000Z | data/interpolate_elliptic_integral_1_2.py | pmehta08/MulensModel | 261738c445a8d116d09c90e65f6e847cfc8a7ad8 | [
"MIT"
] | 11 | 2016-10-03T16:00:50.000Z | 2022-03-23T16:53:54.000Z | """
Calculates interpolation tables for elliptical integral of
the first and second kind.
"""
import math
import numpy as np
from math import sin, cos, sqrt
from scipy import integrate
from scipy.interpolate import interp1d
from scipy.special import ellipk, ellipe
# These are complete elliptic integrals of the first an... | 28.084507 | 73 | 0.614343 | import math
import numpy as np
from math import sin, cos, sqrt
from scipy import integrate
from scipy.interpolate import interp1d
from scipy.special import ellipk, ellipe
accuracy = 1.e-6
n_divide = 10 + 1
x_start = 2.e-5
x_stop = 1. - 1.e-12
n_start = 10
def get_ellip(x):
k = []
e = []
for x_ in x:
... | true | true |
f74eeab37e7d540eafc54e8a725004f740007367 | 19,821 | py | Python | qiskit_metal/qlibrary/tlines/anchored_path.py | nikosavola/qiskit-metal | 3deaecbf85e75a056870edcab5cb73fcf5c0b4f3 | [
"Apache-2.0"
] | 167 | 2021-03-17T20:35:17.000Z | 2022-03-31T13:25:04.000Z | qiskit_metal/qlibrary/tlines/anchored_path.py | fgnyilmaz/qiskit-metal | 04c9e5c0b5573699564244127aa58b447cdf6f66 | [
"Apache-2.0"
] | 307 | 2021-03-17T14:07:43.000Z | 2022-03-23T14:22:20.000Z | qiskit_metal/qlibrary/tlines/anchored_path.py | fgnyilmaz/qiskit-metal | 04c9e5c0b5573699564244127aa58b447cdf6f66 | [
"Apache-2.0"
] | 122 | 2021-03-17T14:21:24.000Z | 2022-03-18T10:09:38.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 48.226277 | 125 | 0.572524 |
import numpy as np
from collections import OrderedDict
from qiskit_metal import Dict
from qiskit_metal.qlibrary.core import QRoute, QRoutePoint
from qiskit_metal.toolbox_metal import math_and_overrides as mao
from qiskit_metal.toolbox_metal.exceptions import QiskitMetalDesignError
from collections.abc im... | true | true |
f74eeba08b10498644f54297eb3728a6a10b0a69 | 1,471 | py | Python | Scripts/simulation/fame/fame_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/fame/fame_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/fame/fame_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\fame\fame_handlers.py
# Compiled at: 2019-02-12 19:48:29
# Size of source mod 2**32: 1335 bytes
from... | 54.481481 | 123 | 0.795377 |
from gsi_handlers.sim_handlers import _get_sim_info_by_id
from sims4.gsi.dispatcher import GsiHandler
from sims4.gsi.schema import GsiGridSchema
lifestyle_brand_schema = GsiGridSchema(label='Lifestyle Brand', sim_specific=True)
lifestyle_brand_schema.add_field('brand_name', 'Brand Name')
lifestyle_brand_schema.ad... | true | true |
f74eec6503fec005411770adf1acd4fbda142d47 | 431 | py | Python | deployments/admin.py | zhan9san/devops-tool | ce9aad2a3b194d3901aacb9959ef9f6efa0fa319 | [
"MIT"
] | null | null | null | deployments/admin.py | zhan9san/devops-tool | ce9aad2a3b194d3901aacb9959ef9f6efa0fa319 | [
"MIT"
] | 11 | 2020-11-20T04:02:23.000Z | 2021-03-03T12:48:31.000Z | deployments/admin.py | zhan9san/devops-tool | ce9aad2a3b194d3901aacb9959ef9f6efa0fa319 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Deployment, CurrentPackage
class DeploymentAdmin(admin.ModelAdmin):
list_display = ('env', 'app', 'package', 'ticket', 'jenkins_build_url')
class CurrentPackageAdmin(admin.ModelAdmin):
list_display = ('env', 'app', 'package', 'ticket', 'jenkins_build_url... | 26.9375 | 75 | 0.765661 | from django.contrib import admin
from .models import Deployment, CurrentPackage
class DeploymentAdmin(admin.ModelAdmin):
list_display = ('env', 'app', 'package', 'ticket', 'jenkins_build_url')
class CurrentPackageAdmin(admin.ModelAdmin):
list_display = ('env', 'app', 'package', 'ticket', 'jenkins_build_url... | true | true |
f74eece1a8d914632ae38d07d315d35302deaacf | 800 | py | Python | packages/candle/__init__.py | patrick-kidger/Deep-Signature-Transforms | 76d79bc88a0fba2a7b670ce6f12d1ee8c21aedfe | [
"Apache-2.0"
] | 57 | 2019-10-23T13:21:46.000Z | 2022-03-21T08:45:01.000Z | packages/candle/__init__.py | logsigRNN/Deep-Signature-Transforms | 76d79bc88a0fba2a7b670ce6f12d1ee8c21aedfe | [
"Apache-2.0"
] | 1 | 2019-09-26T14:48:21.000Z | 2019-09-27T13:22:28.000Z | packages/candle/__init__.py | logsigRNN/Deep-Signature-Transforms | 76d79bc88a0fba2a7b670ce6f12d1ee8c21aedfe | [
"Apache-2.0"
] | 16 | 2019-11-14T23:50:09.000Z | 2022-02-24T00:39:47.000Z | try:
from .engine import create_supervised_trainer
except ImportError: # no ignite
def create_supervised_trainer(*args, **kwargs):
raise ImportError('Ignite not installed')
from .modules import (Lambda,
Flatten,
View,
Concat,
... | 27.586207 | 51 | 0.45875 | try:
from .engine import create_supervised_trainer
except ImportError:
def create_supervised_trainer(*args, **kwargs):
raise ImportError('Ignite not installed')
from .modules import (Lambda,
Flatten,
View,
Concat,
... | true | true |
f74eed53cecb8ff092278197b2e476b2aa3e8eaf | 3,571 | py | Python | model/language.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 4 | 2019-07-08T08:09:59.000Z | 2019-07-16T10:55:12.000Z | model/language.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 1 | 2019-07-01T08:44:14.000Z | 2019-07-10T09:54:24.000Z | model/language.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 1 | 2019-07-10T07:29:25.000Z | 2019-07-10T07:29:25.000Z | #!/usr/bin/python3
from __future__ import annotations
from json import loads
from os.path import abspath, dirname, join
class Language:
'''
This class will hold information about a certain langauge
'''
_countrySpecific = ''
def __init__(self, iso3, iso, name):
self.iso3 = iso3
... | 27.259542 | 135 | 0.57939 |
from __future__ import annotations
from json import loads
from os.path import abspath, dirname, join
class Language:
_countrySpecific = ''
def __init__(self, iso3, iso, name):
self.iso3 = iso3
self.iso = iso
self._name = name
@property
def name(self):
if(self._coun... | true | true |
f74eedce219dde4c107d09cdd2f1951b50788e58 | 3,438 | py | Python | darts/tests/test_missing_values.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 1 | 2020-07-08T01:15:20.000Z | 2020-07-08T01:15:20.000Z | darts/tests/test_missing_values.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 1 | 2020-07-27T15:38:54.000Z | 2020-07-27T15:38:54.000Z | darts/tests/test_missing_values.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 1 | 2020-07-27T15:34:08.000Z | 2020-07-27T15:34:08.000Z | import unittest
import pandas as pd
import numpy as np
from ..timeseries import TimeSeries
from ..utils.missing_values import auto_fillna, na_ratio
class MissingValuesTestCase(unittest.TestCase):
time = pd.date_range('20130101', '20130130')
lin = [float(i) for i in range(len(time))]
cub = [float(i - 4) ... | 45.84 | 120 | 0.606457 | import unittest
import pandas as pd
import numpy as np
from ..timeseries import TimeSeries
from ..utils.missing_values import auto_fillna, na_ratio
class MissingValuesTestCase(unittest.TestCase):
time = pd.date_range('20130101', '20130130')
lin = [float(i) for i in range(len(time))]
cub = [float(i - 4) ... | true | true |
f74eef06de878efcb8e2e0458b6976519592ad37 | 1,574 | py | Python | scenarios/dualist_gps/pascal_test/plots/plot_all.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | 1 | 2020-01-13T09:44:22.000Z | 2020-01-13T09:44:22.000Z | scenarios/dualist_gps/pascal_test/plots/plot_all.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | null | null | null | scenarios/dualist_gps/pascal_test/plots/plot_all.py | domingoesteban/robolearn | 0d20125425c352b80ef2eeed1c0b11ab6497b11a | [
"BSD-3-Clause"
] | 1 | 2021-12-22T00:41:20.000Z | 2021-12-22T00:41:20.000Z | import os
from robolearn.old_utils.plots.policy_cost import plot_policy_cost
from robolearn.old_utils.plots.specific_cost import plot_specific_cost
from robolearn.old_utils.plots.duals import plot_duals
from robolearn.old_utils.plots.policy_final_distance import plot_policy_final_distance
method = 'gps' # 'gps' or 't... | 41.421053 | 86 | 0.727446 | import os
from robolearn.old_utils.plots.policy_cost import plot_policy_cost
from robolearn.old_utils.plots.specific_cost import plot_specific_cost
from robolearn.old_utils.plots.duals import plot_duals
from robolearn.old_utils.plots.policy_final_distance import plot_policy_final_distance
method = 'gps'
gps_director... | true | true |
f74eef86db9ae985fb7f65972e59cd63b4716392 | 611 | py | Python | gaussian.py | susan120433/distribution-is-all-you-need | d91510d07384ade86f271e48b1784039f15e0d48 | [
"MIT"
] | 1,390 | 2019-09-07T09:52:17.000Z | 2022-03-31T16:39:44.000Z | gaussian.py | susan120433/distribution-is-all-you-need | d91510d07384ade86f271e48b1784039f15e0d48 | [
"MIT"
] | 5 | 2019-09-07T12:38:27.000Z | 2020-11-14T16:57:02.000Z | gaussian.py | susan120433/distribution-is-all-you-need | d91510d07384ade86f271e48b1784039f15e0d48 | [
"MIT"
] | 350 | 2019-09-07T12:47:09.000Z | 2022-03-23T13:21:24.000Z | """
Code by Tae-Hwan Hung(@graykode)
https://en.wikipedia.org/wiki/Normal_distribution
"""
import numpy as np
from matplotlib import pyplot as plt
def gaussian(x, n):
u = x.mean()
s = x.std()
# divide [x.min(), x.max()] by n
x = np.linspace(x.min(), x.max(), n)
a = ((x - u) ** 2) / (2 * (... | 22.62963 | 58 | 0.548282 | import numpy as np
from matplotlib import pyplot as plt
def gaussian(x, n):
u = x.mean()
s = x.std()
x = np.linspace(x.min(), x.max(), n)
a = ((x - u) ** 2) / (2 * (s ** 2))
y = 1 / (s * np.sqrt(2 * np.pi)) * np.exp(-a)
return x, y, x.mean(), x.std()
x = np.arange(-100, 100)
x, y, u, ... | true | true |
f74eefaf7b5a256860e5fdd8ec3e44e12aaf5e55 | 1,120 | py | Python | performance/benchmarks/bm_crypto_pyaes.py | skeptycal/python_performance | d8c2108c614cf13295aba1b42ce0425750743359 | [
"MIT"
] | null | null | null | performance/benchmarks/bm_crypto_pyaes.py | skeptycal/python_performance | d8c2108c614cf13295aba1b42ce0425750743359 | [
"MIT"
] | null | null | null | performance/benchmarks/bm_crypto_pyaes.py | skeptycal/python_performance | d8c2108c614cf13295aba1b42ce0425750743359 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Pure-Python Implementation of the AES block-cipher.
Benchmark AES in CTR mode using the pyaes module.
"""
import perf
from six.moves import xrange
import pyaes
# 23,000 bytes
CLEARTEXT = b"This is a test. What could possibly go wrong? " * 500
# 128-bit key (16 bytes)
KEY = b'\xa1\xf6%\x8c... | 23.829787 | 67 | 0.651786 |
import perf
from six.moves import xrange
import pyaes
CLEARTEXT = b"This is a test. What could possibly go wrong? " * 500
KEY = b'\xa1\xf6%\x8c\x87}_\xcd\x89dHE8\xbf\xc9,'
def bench_pyaes(loops):
range_it = xrange(loops)
t0 = perf.perf_counter()
for loops in range_it:
aes = pyaes.AESModeOf... | true | true |
f74ef09a12eb5270c8b2491f64cf820e0955aa49 | 810 | py | Python | lib/spack/spack/cmd/restage.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | lib/spack/spack/cmd/restage.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | lib/spack/spack/cmd/restage.py | ttroy50/spack | adffa45264b0079a79aded048fff35f7b2c3ede6 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import argparse
import llnl.util.tty as tty
import spack.cmd
import spack.repo
description = "revert checked out packag... | 26.129032 | 73 | 0.709877 |
import argparse
import llnl.util.tty as tty
import spack.cmd
import spack.repo
description = "revert checked out package source code"
section = "build"
level = "long"
def setup_parser(subparser):
subparser.add_argument('packages', nargs=argparse.REMAINDER,
help="specs of package... | true | true |
f74ef1c4252e225e1cecea84581d2b079c680600 | 20,717 | py | Python | scripts/mapper.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | scripts/mapper.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | scripts/mapper.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2015 Dovetail Genomics LLC
#
#
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import map
from builtins import str
from builtins import range
from builtins import object
import pickle as pickle
debug=False
... | 31.725881 | 218 | 0.493701 |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import map
from builtins import str
from builtins import range
from builtins import object
import pickle as pickle
debug=False
class node(object):
def __init__(self,s,x):
self.s... | true | true |
f74ef287d1575ce39d6fecb4f2faa4dcf74907d7 | 16,295 | py | Python | tables/tests/common.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | 9 | 2021-09-28T05:20:22.000Z | 2022-03-16T11:09:06.000Z | tables/tests/common.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | null | null | null | tables/tests/common.py | scopatz/PyTables | 05a74def785688abd802224a5ba44393a701ebc7 | [
"BSD-3-Clause"
] | 3 | 2021-09-30T16:17:51.000Z | 2022-01-30T09:54:47.000Z | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: 2005-05-24
# Author: Ivan Vilata i Balaguer - ivan@selidor.net
#
# $Id$
#
########################################################################
"""Utilities for PyTables' test suites."""
fr... | 33.807054 | 79 | 0.57625 |
print("len(b.data) ==>", len(b.data))
return 0
# Multidimensional case
result = (a == b)
result = numpy.all(result)
if not result and verbose:
print("Some of the elements in arrays are not equal")
return result
def areArraysEqual(arr1, arr2):
t1 = type(arr1)... | true | true |
f74ef29f50dd6d72a4dacfb8ac9c0939de4ab774 | 10,422 | py | Python | Ops/test_ops.py | VTXNN/E2E | b877d1bf7fdb94f885804ac42f41cc9ecc3102f5 | [
"Apache-2.0"
] | null | null | null | Ops/test_ops.py | VTXNN/E2E | b877d1bf7fdb94f885804ac42f41cc9ecc3102f5 | [
"Apache-2.0"
] | null | null | null | Ops/test_ops.py | VTXNN/E2E | b877d1bf7fdb94f885804ac42f41cc9ecc3102f5 | [
"Apache-2.0"
] | 1 | 2020-05-18T10:54:13.000Z | 2020-05-18T10:54:13.000Z | import tensorflow as tf
import os
import math
import time
import numpy
import unittest
tf.compat.v1.disable_eager_execution()
from sklearn.neighbors import KernelDensity
from kde_histogram import KDEHistogram
from histogram_max import *
session = None
def get_session():
global session
if not session:
... | 41.031496 | 102 | 0.414604 | import tensorflow as tf
import os
import math
import time
import numpy
import unittest
tf.compat.v1.disable_eager_execution()
from sklearn.neighbors import KernelDensity
from kde_histogram import KDEHistogram
from histogram_max import *
session = None
def get_session():
global session
if not session:
... | true | true |
f74ef3d7f4b23a968190208d44fff55304e87231 | 58,824 | py | Python | dbReports/iondb/rundb/sample/views.py | sequencer2014/TS | 465804570349d46b47c1bdf131bdafea5c582dee | [
"Apache-2.0"
] | null | null | null | dbReports/iondb/rundb/sample/views.py | sequencer2014/TS | 465804570349d46b47c1bdf131bdafea5c582dee | [
"Apache-2.0"
] | null | null | null | dbReports/iondb/rundb/sample/views.py | sequencer2014/TS | 465804570349d46b47c1bdf131bdafea5c582dee | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
from django import http
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404, \
get_list_or_404
from django.conf import settings
from... | 43.189427 | 211 | 0.662264 |
from django import http
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404, \
get_list_or_404
from django.conf import settings
from django.db import transaction
from django.http import HttpResponse... | true | true |
f74ef7a910761ceff963db75eacee07850a1bebb | 5,545 | py | Python | colour/plotting/characterisation.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T01:53:40.000Z | 2021-09-09T01:53:40.000Z | colour/plotting/characterisation.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | null | null | null | colour/plotting/characterisation.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Characterisation Plotting
=========================
Defines the characterisation plotting objects:
- :func:`colour.plotting.plot_single_colour_checker`
- :func:`colour.plotting.plot_multi_colour_checkers`
"""
from __future__ import division
import numpy as np
from colour.models impo... | 29.494681 | 79 | 0.632822 |
from __future__ import division
import numpy as np
from colour.models import xyY_to_XYZ
from colour.plotting import (
CONSTANTS_COLOUR_STYLE, ColourSwatch, XYZ_to_plotting_colourspace, artist,
filter_colour_checkers, plot_multi_colour_swatches, override_style, render)
__author__ = 'Colour Developers'
__cop... | true | true |
f74ef856afe49533f85457829e7ef8f741090105 | 207 | py | Python | office365/communications/calls/invitation_participant_info.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 544 | 2016-08-04T17:10:16.000Z | 2022-03-31T07:17:20.000Z | office365/communications/calls/invitation_participant_info.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 438 | 2016-10-11T12:24:22.000Z | 2022-03-31T19:30:35.000Z | office365/communications/calls/invitation_participant_info.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 202 | 2016-08-22T19:29:40.000Z | 2022-03-30T20:26:15.000Z | from office365.runtime.client_value import ClientValue
class InvitationParticipantInfo(ClientValue):
"""This resource is used to represent the entity that is being invited to a group call."""
pass
| 29.571429 | 94 | 0.782609 | from office365.runtime.client_value import ClientValue
class InvitationParticipantInfo(ClientValue):
pass
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.