hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1a2d1a29f5cb596f805c8dc2c4e6f24fbfee15 | 3,666 | py | Python | pynq/lib/pynqmicroblaze/magic.py | vishwas1234567/PYNQ | bf63ce403b99e1981fb89329fb5b6fa0e1380ac1 | [
"BSD-3-Clause"
] | 1 | 2019-10-23T07:32:33.000Z | 2019-10-23T07:32:33.000Z | pynq/lib/pynqmicroblaze/magic.py | vishwas1234567/PYNQ | bf63ce403b99e1981fb89329fb5b6fa0e1380ac1 | [
"BSD-3-Clause"
] | 1 | 2020-01-14T17:26:15.000Z | 2020-01-14T18:12:33.000Z | pynq/lib/pynqmicroblaze/magic.py | vishwas1234567/PYNQ | bf63ce403b99e1981fb89329fb5b6fa0e1380ac1 | [
"BSD-3-Clause"
] | 1 | 2021-11-16T21:27:06.000Z | 2021-11-16T21:27:06.000Z | # Copyright (c) 2018, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | 35.941176 | 79 | 0.698854 |
__author__ = "Peter Ogden"
__copyright__ = "Copyright 2018, Xilinx"
__email__ = "pynq_support@xilinx.com"
from IPython.core.magic import cell_magic, Magics, magics_class
from IPython import get_ipython
from IPython.display import display, HTML
from IPython.display import display_javascrip... | true | true |
1c1a2d3c2410813741bc63d61fb63415f6f7c23c | 3,133 | py | Python | base_client_2.py | HagenSR/byte_le_royale_2022 | d501bf2418337d543dac982112ea924d37164205 | [
"MIT"
] | 1 | 2022-03-10T01:38:12.000Z | 2022-03-10T01:38:12.000Z | base_client_2.py | HagenSR/byte_le_royale_2022 | d501bf2418337d543dac982112ea924d37164205 | [
"MIT"
] | 2 | 2022-01-31T18:28:14.000Z | 2022-01-31T18:28:24.000Z | base_client_2.py | HagenSR/byte_le_royale_2022 | d501bf2418337d543dac982112ea924d37164205 | [
"MIT"
] | null | null | null | import math
from game.client.user_client import UserClient
from game.common.enums import *
######################################################
# imports for type hints
from game.common.action import Action
from game.common.moving.shooter import Shooter
from game.utils.partition_grid import PartitionGrid
###########... | 51.360656 | 119 | 0.650814 | import math
from game.client.user_client import UserClient
from game.common.enums import *
| true | true |
1c1a2d6c5e8391397b7cb3abf56b4b4d896aa926 | 87,511 | py | Python | tests/test_nodes.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | tests/test_nodes.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | tests/test_nodes.py | hongyi-zhao/aiida-core | d6e8c7d10537b754d1cb6334689ba2edf4347d43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 42.584428 | 119 | 0.598576 |
_] in qb.all()]
self.assertEqual(set([i.pk for i in results]), set([a3.pk, a4.pk]))
qb = orm.QueryBuilder()
qb.append(orm.Dict, filters={'extras': {'has_key': extra_name}})
results = [_ for [_] in qb.all()]
self.assertEqual(set([i.pk for i in results]), set([a4.pk]))
... | true | true |
1c1a2dd521e875093ceff3c2fbc7bc68fa975f8e | 1,387 | py | Python | pipeline/topic/storage/topic_data_storage.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | 1 | 2021-12-16T06:29:41.000Z | 2021-12-16T06:29:41.000Z | pipeline/topic/storage/topic_data_storage.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | null | null | null | pipeline/topic/storage/topic_data_storage.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | null | null | null | from model.model.topic.topic import Topic
from pipeline.common.utils.data_utils import add_tenant_id_to_instance
from pipeline.database.topic.adapter.topic_storage_adapter import get_template_by_datasource_id
def save_topic_instance(topic: Topic, instance, current_user=None):
template = get_template_by_datasourc... | 39.628571 | 104 | 0.828407 | from model.model.topic.topic import Topic
from pipeline.common.utils.data_utils import add_tenant_id_to_instance
from pipeline.database.topic.adapter.topic_storage_adapter import get_template_by_datasource_id
def save_topic_instance(topic: Topic, instance, current_user=None):
template = get_template_by_datasourc... | true | true |
1c1a2ead5cd1cbf522774dd809f213e8feed23cf | 6,699 | py | Python | askIt/views.py | anubhav06/what-is-it | 5e59c2950da7c4a99e0afbdb083d963e17fed936 | [
"MIT"
] | null | null | null | askIt/views.py | anubhav06/what-is-it | 5e59c2950da7c4a99e0afbdb083d963e17fed936 | [
"MIT"
] | null | null | null | askIt/views.py | anubhav06/what-is-it | 5e59c2950da7c4a99e0afbdb083d963e17fed936 | [
"MIT"
] | null | null | null | import json
from django.contrib.auth import authenticate, login, logout
from django.db import IntegrityError
from django.db.utils import Error
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.contrib.auth.decorators import login_r... | 32.678049 | 120 | 0.632184 | import json
from django.contrib.auth import authenticate, login, logout
from django.db import IntegrityError
from django.db.utils import Error
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.contrib.auth.decorators import login_r... | true | true |
1c1a2f22b2135e9b0b188ed3298d374d319c7e26 | 2,139 | py | Python | skrf/constants.py | sxntxn/scikit-rf | 0cd4e0eafb46d6da49cc552d4e0ee5a290b0cc77 | [
"BSD-3-Clause"
] | null | null | null | skrf/constants.py | sxntxn/scikit-rf | 0cd4e0eafb46d6da49cc552d4e0ee5a290b0cc77 | [
"BSD-3-Clause"
] | null | null | null | skrf/constants.py | sxntxn/scikit-rf | 0cd4e0eafb46d6da49cc552d4e0ee5a290b0cc77 | [
"BSD-3-Clause"
] | null | null | null |
'''
.. currentmodule:: skrf.constants
========================================
constants (:mod:`skrf.constants`)
========================================
This module contains constants, numerical approximations, and unit conversions
.. data:: INF
A very very large value (1e99)
.. data:: ONE
1 + epsilon... | 20.371429 | 78 | 0.487144 |
from scipy.constants import c, micron, mil, inch, centi, milli, nano, micro,pi
INF = 1e99
ONE = 1.0 + 1/1e14
ZERO = 1e-6
K_BOLTZMANN = 1.38064852e-23
T0 = 290.
S_DEFINITIONS = ['power', 'pseudo', 'traveling']
S_DEF_DEFAULT = 'power'
global distance_dict
distance_dict = {'m':1.,
'cm':1e-2,
... | true | true |
1c1a2fdb0a22b4539598bad79d54b817af6164e8 | 4,482 | py | Python | testproject/core/settings.py | ravillarreal/django-channels-jwt-auth-middleware | b53fc009ce7dd867eca436f18e0ad03c0f0c80be | [
"MIT"
] | 9 | 2021-01-21T16:26:48.000Z | 2021-09-20T01:47:58.000Z | testproject/core/settings.py | ravillarreal/django-channels-jwt-auth-middleware | b53fc009ce7dd867eca436f18e0ad03c0f0c80be | [
"MIT"
] | null | null | null | testproject/core/settings.py | ravillarreal/django-channels-jwt-auth-middleware | b53fc009ce7dd867eca436f18e0ad03c0f0c80be | [
"MIT"
] | 5 | 2021-04-11T09:40:44.000Z | 2021-06-09T08:05:48.000Z | from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '-^l@j0x^$(@xi)bz@2+u4f2pk$o(+2rj4%2lp+6vzn)wwbk=v-'
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', ]
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'... | 25.179775 | 91 | 0.686301 | from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '-^l@j0x^$(@xi)bz@2+u4f2pk$o(+2rj4%2lp+6vzn)wwbk=v-'
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', ]
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'... | true | true |
1c1a30a6d0d8daf88c1c9bb95c55c91f8a957c99 | 1,965 | py | Python | transmute/transmuter.py | comoyo/python-transmute | 29f67a8da717d640028647570311bd66ca6c6616 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-06-03T05:53:03.000Z | 2020-02-22T07:12:07.000Z | transmute/transmuter.py | comoyo/python-transmute | 29f67a8da717d640028647570311bd66ca6c6616 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | transmute/transmuter.py | comoyo/python-transmute | 29f67a8da717d640028647570311bd66ca6c6616 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2014 Telenor Digital AS
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 30.703125 | 79 | 0.672774 |
import os
import pkg_resources
import sys
import transmute.bootstrap
class Transmuter(object):
def __init__(self, entries):
self.working_set = pkg_resources.WorkingSet(entries)
@staticmethod
def _dist_conflicts(dist):
return any(module in sys.modules
for modu... | true | true |
1c1a30dd0aa19253e4d058c13f7f1e4ae716ce7a | 8,330 | py | Python | corrscope/wave.py | Lactozilla/corrscope | 9d7da86019b20c9aef75d10fcafd028d4b782b46 | [
"BSD-2-Clause"
] | null | null | null | corrscope/wave.py | Lactozilla/corrscope | 9d7da86019b20c9aef75d10fcafd028d4b782b46 | [
"BSD-2-Clause"
] | null | null | null | corrscope/wave.py | Lactozilla/corrscope | 9d7da86019b20c9aef75d10fcafd028d4b782b46 | [
"BSD-2-Clause"
] | null | null | null | import copy
import enum
from typing import Union, List
import numpy as np
import corrscope.utils.scipy.wavfile as wavfile
from corrscope.config import CorrError, TypedEnumDump
FLOAT = np.single
# Depends on FLOAT
from corrscope.utils.windows import rightpad
@enum.unique
class Flatten(str, TypedEnumDump):
""" ... | 30.072202 | 87 | 0.605402 | import copy
import enum
from typing import Union, List
import numpy as np
import corrscope.utils.scipy.wavfile as wavfile
from corrscope.config import CorrError, TypedEnumDump
FLOAT = np.single
from corrscope.utils.windows import rightpad
@enum.unique
class Flatten(str, TypedEnumDump):
Stereo = "stereo... | true | true |
1c1a3171bd36b83c1a678ca777f1d8025cc4f19b | 812 | py | Python | data/gen_class_embeddings.py | nickgkan/beauty_detr | 502ee85e35c0a8a488fc71bb301e8c5bb1827250 | [
"MIT"
] | 18 | 2021-12-16T04:41:55.000Z | 2022-02-24T12:53:22.000Z | data/gen_class_embeddings.py | nickgkan/beauty_detr | 502ee85e35c0a8a488fc71bb301e8c5bb1827250 | [
"MIT"
] | null | null | null | data/gen_class_embeddings.py | nickgkan/beauty_detr | 502ee85e35c0a8a488fc71bb301e8c5bb1827250 | [
"MIT"
] | 1 | 2021-12-19T12:53:28.000Z | 2021-12-19T12:53:28.000Z | from transformers import RobertaModel, RobertaTokenizerFast
import numpy as np
from data.model_util_scannet import ScannetDatasetConfig
import ipdb
st = ipdb.set_trace
config = ScannetDatasetConfig()
output_path = 'data/class_embeddings3d.npy'
tokenizer = RobertaTokenizerFast.from_pretrained('roberta-base')
text_enc... | 31.230769 | 75 | 0.791872 | from transformers import RobertaModel, RobertaTokenizerFast
import numpy as np
from data.model_util_scannet import ScannetDatasetConfig
import ipdb
st = ipdb.set_trace
config = ScannetDatasetConfig()
output_path = 'data/class_embeddings3d.npy'
tokenizer = RobertaTokenizerFast.from_pretrained('roberta-base')
text_enc... | true | true |
1c1a322136bb8eaaf75866c1e784acf0974bae4a | 1,629 | py | Python | gunpowder/nodes/hdf5_source.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-05-03T22:27:11.000Z | 2022-02-11T19:07:28.000Z | gunpowder/nodes/hdf5_source.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 102 | 2017-06-09T10:11:06.000Z | 2022-03-29T13:56:37.000Z | gunpowder/nodes/hdf5_source.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-04-25T20:25:17.000Z | 2022-02-11T19:07:34.000Z | from gunpowder.ext import h5py
from .hdf5like_source_base import Hdf5LikeSource
class Hdf5Source(Hdf5LikeSource):
'''An HDF5 data source.
Provides arrays from HDF5 datasets. If the attribute ``resolution`` is set
in a HDF5 dataset, it will be used as the array's ``voxel_size``. If the
attribute ``offs... | 40.725 | 82 | 0.661756 | from gunpowder.ext import h5py
from .hdf5like_source_base import Hdf5LikeSource
class Hdf5Source(Hdf5LikeSource):
def _open_file(self, filename):
return h5py.File(filename, 'r')
| true | true |
1c1a33b257506c53f9f0eb2b6ea3c31ffd557d61 | 941 | py | Python | summarization/utils/Stems.py | Untesler/New-s | bdc7f98e6abe783b3b304c351204a13432b3d287 | [
"Apache-2.0"
] | null | null | null | summarization/utils/Stems.py | Untesler/New-s | bdc7f98e6abe783b3b304c351204a13432b3d287 | [
"Apache-2.0"
] | 4 | 2020-03-16T05:18:42.000Z | 2021-12-13T20:40:36.000Z | summarization/utils/Stems.py | Untesler/New-s | bdc7f98e6abe783b3b304c351204a13432b3d287 | [
"Apache-2.0"
] | 1 | 2020-05-26T16:01:58.000Z | 2020-05-26T16:01:58.000Z | from corpus import thai_stems
LANGUAGE_SUPPORT = [
'th'
]
def get_stem(word:str, lang:str='th') -> str:
if not lang in LANGUAGE_SUPPORT:
return word
if lang == 'th':
#THAI_STEM_PAIR_INDEX = {}
#THAI_WORD_PAIR_STEM_INDEX = {}
#stem_index = 0
for element in thai_stems... | 27.676471 | 61 | 0.498406 | from corpus import thai_stems
LANGUAGE_SUPPORT = [
'th'
]
def get_stem(word:str, lang:str='th') -> str:
if not lang in LANGUAGE_SUPPORT:
return word
if lang == 'th':
for element in thai_stems():
tmp = element.split(',')
stem = tmp[0]
... | true | true |
1c1a34400ff24a5d93af91e85ca18a8ffd17b699 | 61,194 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_network_interfaces_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.572165 | 354 | 0.680443 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c1a34fa452d21e5f850106fcc8cc14f25b6b64f | 502 | py | Python | Code/Python2.7/Kattis/33onechickenperperson.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T15:56:03.000Z | 2019-11-21T15:56:03.000Z | Code/Python2.7/Kattis/33onechickenperperson.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 12 | 2019-11-21T21:00:57.000Z | 2022-02-27T01:46:56.000Z | Code/Python2.7/Kattis/33onechickenperperson.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T20:49:18.000Z | 2019-11-21T20:49:18.000Z | from sys import stdin
nums = [int(n) for n in stdin.readline().split()]
if nums[0] < nums[1]:
if nums[1] - nums[0] == 1:
print "Dr. Chaz will have 1 piece of chicken left over!"
else:
print "Dr. Chaz will have %s pieces of chicken left over!" % (str(nums[1] - nums[0]))
elif nums[0] > nums[1]:
... | 33.466667 | 93 | 0.581673 | from sys import stdin
nums = [int(n) for n in stdin.readline().split()]
if nums[0] < nums[1]:
if nums[1] - nums[0] == 1:
print "Dr. Chaz will have 1 piece of chicken left over!"
else:
print "Dr. Chaz will have %s pieces of chicken left over!" % (str(nums[1] - nums[0]))
elif nums[0] > nums[1]:
... | false | true |
1c1a36b0cac85931b738b470d92bf3435b31f27b | 474 | py | Python | src/RIOT/tests/driver_grove_ledbar/tests/01-run.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | 2 | 2020-04-30T08:17:45.000Z | 2020-05-23T08:46:54.000Z | src/RIOT/tests/driver_grove_ledbar/tests/01-run.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | null | null | null | src/RIOT/tests/driver_grove_ledbar/tests/01-run.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | 1 | 2020-02-21T09:21:45.000Z | 2020-02-21T09:21:45.000Z | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# 2017 Sebastian Meiling <s@mlng.net>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
fr... | 23.7 | 68 | 0.71308 |
import sys
from testrunner import run
def testfunc(child):
child.expect_exact(u"[SUCCESS]", timeout=60)
if __name__ == "__main__":
sys.exit(run(testfunc))
| true | true |
1c1a36eab52770dc4787f2741aa5ec8b42450a05 | 1,096 | py | Python | requirement_library.py | sungmin-yang/Project_AI_melody | a6237f94ef62e6e5ef6f09a69edcb9e2f0ce18a8 | [
"Apache-2.0"
] | null | null | null | requirement_library.py | sungmin-yang/Project_AI_melody | a6237f94ef62e6e5ef6f09a69edcb9e2f0ce18a8 | [
"Apache-2.0"
] | null | null | null | requirement_library.py | sungmin-yang/Project_AI_melody | a6237f94ef62e6e5ef6f09a69edcb9e2f0ce18a8 | [
"Apache-2.0"
] | null | null | null | # Obligatory Library
import os, sys, shutil, glob, numpy, csv, cPickle
import random, subprocess
from keras.models import load_model
from keras.metrics import top_k_categorical_accuracy
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.sequence import pad_sequence
from keras.models impor... | 25.488372 | 96 | 0.824818 |
import os, sys, shutil, glob, numpy, csv, cPickle
import random, subprocess
from keras.models import load_model
from keras.metrics import top_k_categorical_accuracy
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.sequence import pad_sequence
from keras.models import Sequential
from ke... | true | true |
1c1a36f4ecd7f8f6c2a52c326639fe1c90c153e5 | 1,886 | py | Python | landscaper/common.py | rlquinn/landscaper | 9328e60499b0ac8ef2a14efa3f5f76a952cd9c84 | [
"Apache-2.0"
] | 36 | 2017-11-21T16:06:32.000Z | 2022-02-21T09:41:12.000Z | landscaper/common.py | rlquinn/landscaper | 9328e60499b0ac8ef2a14efa3f5f76a952cd9c84 | [
"Apache-2.0"
] | 4 | 2019-04-08T10:27:28.000Z | 2019-12-10T08:41:31.000Z | landscaper/common.py | rlquinn/landscaper | 9328e60499b0ac8ef2a14efa3f5f76a952cd9c84 | [
"Apache-2.0"
] | 9 | 2017-11-28T17:28:12.000Z | 2020-01-18T09:08:55.000Z | # Copyright (c) 2017, Intel Research and Development Ireland Ltd.
#
# 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 app... | 29.46875 | 74 | 0.753977 |
import logging
from logging.handlers import RotatingFileHandler
import os
import sys
from landscaper import paths
SERVICE_NAME = 'landscaper'
LOG = logging.getLogger(SERVICE_NAME)
LOG_DIR = "{}/logs".format(paths.PROJECT_ROOT)
if not os.path.exists(LOG_DIR):
os.makedirs(LOG_DIR)
LOGF = "{}/landscap... | true | true |
1c1a38097099b412d31907562b5a1d77450d244e | 606 | py | Python | gym/forms.py | marcelovicentegc/gym-model-2 | 97993d84d73509647dc10198d78489a5d3c4dd22 | [
"MIT"
] | 1 | 2019-03-21T02:01:14.000Z | 2019-03-21T02:01:14.000Z | gym/forms.py | marcelovicentegc/gym-model-2 | 97993d84d73509647dc10198d78489a5d3c4dd22 | [
"MIT"
] | null | null | null | gym/forms.py | marcelovicentegc/gym-model-2 | 97993d84d73509647dc10198d78489a5d3c4dd22 | [
"MIT"
] | null | null | null | from django import forms
from gym.models import Contact as ContactModel
class Contact(forms.ModelForm):
sender_name = forms.CharField(max_length=100, label='Name', label_suffix=None, required=True)
sender_email = forms.EmailField(label='Email', label_suffix=None, required=True)
subject = forms.CharFiel... | 31.894737 | 117 | 0.735974 | from django import forms
from gym.models import Contact as ContactModel
class Contact(forms.ModelForm):
sender_name = forms.CharField(max_length=100, label='Name', label_suffix=None, required=True)
sender_email = forms.EmailField(label='Email', label_suffix=None, required=True)
subject = forms.CharFiel... | true | true |
1c1a3a00a5cbcb7994ddd9977fb2ac532c28e3c9 | 5,046 | py | Python | src/handwriting_features/interface/featurizer/handlers.py | BDALab/handwriting-features | 4402c8b03370f13e94d0371858d95f65c79669b2 | [
"MIT"
] | 1 | 2021-11-23T20:52:14.000Z | 2021-11-23T20:52:14.000Z | src/handwriting_features/interface/featurizer/handlers.py | BDALab/handwriting-features | 4402c8b03370f13e94d0371858d95f65c79669b2 | [
"MIT"
] | null | null | null | src/handwriting_features/interface/featurizer/handlers.py | BDALab/handwriting-features | 4402c8b03370f13e94d0371858d95f65c79669b2 | [
"MIT"
] | 1 | 2021-11-23T21:10:52.000Z | 2021-11-23T21:10:52.000Z | import numpy
from handwriting_features.features import HandwritingFeatures
from handwriting_features.features.configuration.mapping import HandwritingFeaturesMapping
from handwriting_features.features.validation import HandwritingFeaturesValidation
from handwriting_features.interface.featurizer.utils import (
Singl... | 36.302158 | 102 | 0.680935 | import numpy
from handwriting_features.features import HandwritingFeatures
from handwriting_features.features.configuration.mapping import HandwritingFeaturesMapping
from handwriting_features.features.validation import HandwritingFeaturesValidation
from handwriting_features.interface.featurizer.utils import (
Singl... | true | true |
1c1a3b516d6b0f899f0e8e4c991bbaee65cf11ab | 5,071 | py | Python | dql_grasping/tf_critics.py | kinoute/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 1 | 2022-03-25T07:11:45.000Z | 2022-03-25T07:11:45.000Z | dql_grasping/tf_critics.py | zhangyuezjx/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | null | null | null | dql_grasping/tf_critics.py | zhangyuezjx/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 2 | 2020-05-07T17:43:37.000Z | 2020-12-06T14:43:30.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.562963 | 79 | 0.647801 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import gin
from six.moves import range
import tensorflow as tf
from dql_grasping import tf_modules
slim = tf.contrib.slim
@gin.configurable
def cnn_ia_v1(state,
... | true | true |
1c1a3b981a7050b70b52f14396c54b13361e444a | 376 | py | Python | src/rest_framework_expandable/serializers.py | caltechads/django-rest-framework-expandable | d16ef281b4fb2a974cd82cc0f6991a4dd5a0150b | [
"BSD-2-Clause"
] | null | null | null | src/rest_framework_expandable/serializers.py | caltechads/django-rest-framework-expandable | d16ef281b4fb2a974cd82cc0f6991a4dd5a0150b | [
"BSD-2-Clause"
] | 7 | 2020-06-06T00:01:53.000Z | 2022-02-10T10:40:36.000Z | src/rest_framework_expandable/serializers.py | caltechads/django-rest-framework-expandable | d16ef281b4fb2a974cd82cc0f6991a4dd5a0150b | [
"BSD-2-Clause"
] | 1 | 2020-04-09T00:42:34.000Z | 2020-04-09T00:42:34.000Z | from rest_framework.serializers import ModelSerializer, HyperlinkedModelSerializer
from .mixins.expandable_model_serializer import ExpandableModelSerializerMixin
class ExpandableHyperlinkedModelSerializer(
ExpandableModelSerializerMixin, HyperlinkedModelSerializer
):
pass
class ExpandableModelSerializer(Exp... | 28.923077 | 82 | 0.875 | from rest_framework.serializers import ModelSerializer, HyperlinkedModelSerializer
from .mixins.expandable_model_serializer import ExpandableModelSerializerMixin
class ExpandableHyperlinkedModelSerializer(
ExpandableModelSerializerMixin, HyperlinkedModelSerializer
):
pass
class ExpandableModelSerializer(Exp... | true | true |
1c1a3ce4e063170cbeda31ad23aef30d424cd83d | 415 | py | Python | flask_api_demo/api/v1/users/schemas.py | deluxebrain/flask-api-demo | 33e5d55bbc21122fce755025e45c31e5059a8b1f | [
"MIT"
] | null | null | null | flask_api_demo/api/v1/users/schemas.py | deluxebrain/flask-api-demo | 33e5d55bbc21122fce755025e45c31e5059a8b1f | [
"MIT"
] | null | null | null | flask_api_demo/api/v1/users/schemas.py | deluxebrain/flask-api-demo | 33e5d55bbc21122fce755025e45c31e5059a8b1f | [
"MIT"
] | null | null | null | from marshmallow import fields
from flask_api_demo.extensions import ma
class UserSchema(ma.Schema):
name = fields.Str(required=True)
created_at = fields.Date(required=True)
_links = ma.Hyperlinks({
'self': ma.URLFor('api_v1_user.user_detail', user_id='<id>'),
'collection': ma.URLFor('api_... | 27.666667 | 69 | 0.713253 | from marshmallow import fields
from flask_api_demo.extensions import ma
class UserSchema(ma.Schema):
name = fields.Str(required=True)
created_at = fields.Date(required=True)
_links = ma.Hyperlinks({
'self': ma.URLFor('api_v1_user.user_detail', user_id='<id>'),
'collection': ma.URLFor('api_... | true | true |
1c1a3d4c11686dc1e180bd8c2ab8095631003cb0 | 4,812 | py | Python | app.py | nicolascatalan/voz-test | f1666fd58a6bb73130d8c3af80eef69d928fcc85 | [
"Apache-2.0"
] | null | null | null | app.py | nicolascatalan/voz-test | f1666fd58a6bb73130d8c3af80eef69d928fcc85 | [
"Apache-2.0"
] | 1 | 2021-05-11T01:16:44.000Z | 2021-05-11T01:16:44.000Z | app.py | nicolascatalan/voz-test | f1666fd58a6bb73130d8c3af80eef69d928fcc85 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM Corp. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the “License”)
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 33.186207 | 129 | 0.688695 |
import json
import os
import requests
from dotenv import load_dotenv
from flask import Flask, Response
from flask import jsonify
from flask import request, redirect
from flask_socketio import SocketIO
from flask_cors import CORS
from ibm_watson import AssistantV1
from ibm_watson import SpeechToTextV1
fro... | true | true |
1c1a3f0ed32cdc14ada83f1a1912256b9d6e3e6c | 15,309 | py | Python | tests/test_dagbuilder.py | ilaichi/dag-factory | 13f7e13fb1b547d6e0a3ec66412e279819886a99 | [
"MIT"
] | null | null | null | tests/test_dagbuilder.py | ilaichi/dag-factory | 13f7e13fb1b547d6e0a3ec66412e279819886a99 | [
"MIT"
] | null | null | null | tests/test_dagbuilder.py | ilaichi/dag-factory | 13f7e13fb1b547d6e0a3ec66412e279819886a99 | [
"MIT"
] | null | null | null | import os
import datetime
from unittest.mock import patch
import pendulum
import pytest
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow import __version__ as AIRFLOW_VERSION
from packaging import version
from da... | 36.36342 | 88 | 0.602391 | import os
import datetime
from unittest.mock import patch
import pendulum
import pytest
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow import __version__ as AIRFLOW_VERSION
from packaging import version
from da... | true | true |
1c1a3f2deab05cd6f7d6c05a27e0486fe24e5796 | 6,499 | py | Python | NFW/tests/test_mass_concentration.py | joergdietrich/NFW | 58b0ff6b5382461e6053e12c75d35543dd3f8b13 | [
"BSD-2-Clause"
] | 8 | 2016-01-22T18:39:30.000Z | 2021-12-01T09:43:00.000Z | NFW/tests/test_mass_concentration.py | joergdietrich/NFW | 58b0ff6b5382461e6053e12c75d35543dd3f8b13 | [
"BSD-2-Clause"
] | 5 | 2015-01-13T01:04:53.000Z | 2018-02-01T11:25:19.000Z | NFW/tests/test_mass_concentration.py | joergdietrich/NFW | 58b0ff6b5382461e6053e12c75d35543dd3f8b13 | [
"BSD-2-Clause"
] | 4 | 2015-03-15T22:21:28.000Z | 2019-04-24T17:59:11.000Z | import numpy as np
from numpy.testing import (TestCase, assert_array_equal, assert_equal,
assert_almost_equal, assert_array_almost_equal,
assert_raises)
from numpy.testing.decorators import knownfailureif
import astropy.cosmology
from astropy import units as u
try:... | 42.201299 | 76 | 0.56978 | import numpy as np
from numpy.testing import (TestCase, assert_array_equal, assert_equal,
assert_almost_equal, assert_array_almost_equal,
assert_raises)
from numpy.testing.decorators import knownfailureif
import astropy.cosmology
from astropy import units as u
try:... | true | true |
1c1a40a80e7b9b7b8da4468b7d784df6cab2c909 | 346 | py | Python | zoo/public/repvgg/repvgg_b1.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | 23 | 2021-12-08T02:35:01.000Z | 2022-03-16T02:23:19.000Z | zoo/public/repvgg/repvgg_b1.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | 4 | 2021-12-23T11:31:17.000Z | 2022-02-28T01:35:31.000Z | zoo/public/repvgg/repvgg_b1.py | megvii-research/basecls | 6b395a0a888370b4523764afb78a5a7634a3f6cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
from basecls.configs import RepVGGConfig
_cfg = dict(
model=dict(
name="repvgg_b1",
),
)
class Cfg(RepVGGConfig):
def __init__(self, values_or_file=None, **kwargs):
super().__init__(_cfg)
self.merge(... | 21.625 | 58 | 0.66763 |
from basecls.configs import RepVGGConfig
_cfg = dict(
model=dict(
name="repvgg_b1",
),
)
class Cfg(RepVGGConfig):
def __init__(self, values_or_file=None, **kwargs):
super().__init__(_cfg)
self.merge(values_or_file, **kwargs)
| true | true |
1c1a40bc96cb279b87f7e302482b16c175176e0f | 5,727 | py | Python | src/netappfiles-preview/azext_netappfiles_preview/tests/latest/test_account_commands_ext.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/netappfiles-preview/azext_netappfiles_preview/tests/latest/test_account_commands_ext.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/netappfiles-preview/azext_netappfiles_preview/tests/latest/test_account_commands_ext.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 59.65625 | 216 | 0.661079 |
from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer
class AzureNetAppFilesExtAccountServiceScenarioTest(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_tests_rg_')
def test_ext_create_delete_account(self):
account_name = self.create_random_name(prefix='cli', length=24)
... | true | true |
1c1a43e7f775ebe22ea42cd7378db7c4d27de0b4 | 439 | py | Python | tables.py | shashank-ssriva/My-Travel-Tracker | aab4741588dd428d5d4e279a937441741894663a | [
"MIT"
] | null | null | null | tables.py | shashank-ssriva/My-Travel-Tracker | aab4741588dd428d5d4e279a937441741894663a | [
"MIT"
] | null | null | null | tables.py | shashank-ssriva/My-Travel-Tracker | aab4741588dd428d5d4e279a937441741894663a | [
"MIT"
] | null | null | null | from flask_table import Table, Col, LinkCol
class Results(Table):
travel_id = Col('Id', show=False)
source_airport = Col('Source Airport')
destination_airport = Col('Destination Airport')
travel_date = Col('Trip Date')
trip_type = Col('Trip Category')
edit = LinkCol('Edit', 'tripDetai... | 36.583333 | 79 | 0.678815 | from flask_table import Table, Col, LinkCol
class Results(Table):
travel_id = Col('Id', show=False)
source_airport = Col('Source Airport')
destination_airport = Col('Destination Airport')
travel_date = Col('Trip Date')
trip_type = Col('Trip Category')
edit = LinkCol('Edit', 'tripDetai... | true | true |
1c1a4478fc92cf63484d4eb07543e00db514c509 | 3,062 | py | Python | pygazebo/msg/propagation_particle_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | pygazebo/msg/propagation_particle_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | pygazebo/msg/propagation_particle_pb2.py | CryptoCopter/pygazebo | f16704f3b59cb50a1390ef92fde283558fd71f8f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: propagation_particle.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from g... | 36.023529 | 204 | 0.768452 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='propa... | true | true |
1c1a4542e4833934683dcdd895dde877ddec6a99 | 83,477 | py | Python | h2o-py/h2o/estimators/random_forest.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/h2o/estimators/random_forest.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/h2o/estimators/random_forest.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.utils.metaclass import dep... | 45.816136 | 229 | 0.583442 |
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.utils.metaclass import deprecated_params, deprecated_property
from h2o.estimators.estimator_base import H2OEstimator
from h2o.exceptions import H2OValueError
from h2o.frame import H2OFrame
from h2o.utils.typechecks import... | true | true |
1c1a461dd69b915e004b9b29875c190ec8621eca | 6,966 | py | Python | privacy/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py | tkgsn/P3GM | 443550b7781b7ab3c920893923056a8faef44994 | [
"MIT"
] | 1,605 | 2018-12-21T18:47:34.000Z | 2022-03-31T07:16:12.000Z | privacy/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py | tkgsn/P3GM | 443550b7781b7ab3c920893923056a8faef44994 | [
"MIT"
] | 190 | 2018-12-26T06:13:27.000Z | 2022-03-27T17:14:00.000Z | privacy/tensorflow_privacy/privacy/dp_query/distributed_discrete_gaussian_query_test.py | tkgsn/P3GM | 443550b7781b7ab3c920893923056a8faef44994 | [
"MIT"
] | 396 | 2018-12-21T19:19:49.000Z | 2022-03-27T08:26:14.000Z | # Copyright 2021, The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 41.963855 | 87 | 0.698249 |
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow_privacy.privacy.dp_query import discrete_gaussian_utils
from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query
from tensorflow_privacy.privacy.dp_query import test_utils
ddg_sum_... | true | true |
1c1a463e72433af25f1dfd09346ab1752afb233d | 1,167 | py | Python | src/okchain1/theme/rtd/conf/clients_pdo.py | sakya666/crate-docs-theme | 5767fe05c342581d1387baa7222ec09f61ce9cc5 | [
"Apache-2.0"
] | null | null | null | src/okchain1/theme/rtd/conf/clients_pdo.py | sakya666/crate-docs-theme | 5767fe05c342581d1387baa7222ec09f61ce9cc5 | [
"Apache-2.0"
] | null | null | null | src/okchain1/theme/rtd/conf/clients_pdo.py | sakya666/crate-docs-theme | 5767fe05c342581d1387baa7222ec09f61ce9cc5 | [
"Apache-2.0"
] | 1 | 2022-03-14T04:06:36.000Z | 2022-03-14T04:06:36.000Z | # -*- coding: utf-8; -*-
#
# Licensed to Crate (https://crate.io) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# yo... | 40.241379 | 77 | 0.763496 |
from okchain1.theme.rtd.conf import *
project = u'Crate PDO'
html_theme_options.update({
'canonical_url_path': 'docs/clients/pdo/en/latest/',
})
| true | true |
1c1a469c04961216bda94a44c37ea32a8acf434f | 11,567 | py | Python | src/game.py | ytyaru/Python.Pyxel.Reversi.20200419000000 | 25b715943ad39c20cd6b5e9ee124a2195919a735 | [
"CC0-1.0"
] | null | null | null | src/game.py | ytyaru/Python.Pyxel.Reversi.20200419000000 | 25b715943ad39c20cd6b5e9ee124a2195919a735 | [
"CC0-1.0"
] | null | null | null | src/game.py | ytyaru/Python.Pyxel.Reversi.20200419000000 | 25b715943ad39c20cd6b5e9ee124a2195919a735 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf8
import os, enum, random, numpy, pyxel
from abc import ABCMeta, abstractmethod
class App:
def __init__(self):
self.__window = Window()
globals()['Window'] = self.__window
self.__scene = SceneManager()
pyxel.run(self.update, self.draw)
def upd... | 39.077703 | 148 | 0.580358 |
import os, enum, random, numpy, pyxel
from abc import ABCMeta, abstractmethod
class App:
def __init__(self):
self.__window = Window()
globals()['Window'] = self.__window
self.__scene = SceneManager()
pyxel.run(self.update, self.draw)
def update(self):
self.__scene.upda... | true | true |
1c1a470a6bbbb32e7329ae928e285a0b96302406 | 6,473 | py | Python | walq/questionnaire.py | pedrosiracusa/walQ | 1d1fca90d11fd54cc77a887d059d532a8a2481fb | [
"MIT"
] | null | null | null | walq/questionnaire.py | pedrosiracusa/walQ | 1d1fca90d11fd54cc77a887d059d532a8a2481fb | [
"MIT"
] | 1 | 2018-12-04T09:38:55.000Z | 2018-12-05T22:15:11.000Z | walq/questionnaire.py | pedrosiracusa/walQ | 1d1fca90d11fd54cc77a887d059d532a8a2481fb | [
"MIT"
] | null | null | null | from .question import Question
from .response import Response
from .context import Context
class Questionnaire:
"""
Stores a graph of questions and runs it; keeps track of interactions using a context dictionary.
A questionnaire knows how to send questions to user, record user input and respond accordingl... | 31.8867 | 300 | 0.610691 | from .question import Question
from .response import Response
from .context import Context
class Questionnaire:
def __init__(self, questionnaire_dict=None, initial_question_id=None):
self.initial_question_id = initial_question_id
if questionnaire_dict:
self.questions = { ... | true | true |
1c1a47298a049b03200f105a576b1a69953108ee | 7,753 | py | Python | labs/lab2/lab2a.py | MITLLRacecar/racecar-steven-lei | 07b9d07fb4c5f10d66382bcd6a9bfc041132fd5f | [
"MIT"
] | null | null | null | labs/lab2/lab2a.py | MITLLRacecar/racecar-steven-lei | 07b9d07fb4c5f10d66382bcd6a9bfc041132fd5f | [
"MIT"
] | null | null | null | labs/lab2/lab2a.py | MITLLRacecar/racecar-steven-lei | 07b9d07fb4c5f10d66382bcd6a9bfc041132fd5f | [
"MIT"
] | null | null | null | """
Copyright MIT and Harvey Mudd College
MIT License
Summer 2020
Lab 2A - Color Image Line Following
"""
########################################################################################
# Imports
########################################################################################
import sys
import cv2 a... | 33.418103 | 88 | 0.581065 | true | true | |
1c1a49ef1cd51ba53ad9054f2c6259564d451c5b | 215 | py | Python | dockerfile-lint-extension/server/test_app.py | HEMINSAN/sourcegraph-extension-samples | 140444cb990ea45298c893ec665658c64a949487 | [
"MIT"
] | 8 | 2018-09-18T14:39:28.000Z | 2021-05-14T18:07:36.000Z | dockerfile-lint-extension/server/test_app.py | HEMINSAN/sourcegraph-extension-samples | 140444cb990ea45298c893ec665658c64a949487 | [
"MIT"
] | 37 | 2018-12-23T14:12:07.000Z | 2021-09-01T15:54:09.000Z | dockerfile-lint-extension/server/test_app.py | HEMINSAN/sourcegraph-extension-samples | 140444cb990ea45298c893ec665658c64a949487 | [
"MIT"
] | 4 | 2019-01-23T20:35:12.000Z | 2020-12-02T10:40:18.000Z | from flask import url_for
class TestApp:
def test_healthcheck(self, client):
res = client.get(url_for('health_check'))
assert res.status_code == 200
assert res.json == {'status': 'ok'}
| 23.888889 | 49 | 0.64186 | from flask import url_for
class TestApp:
def test_healthcheck(self, client):
res = client.get(url_for('health_check'))
assert res.status_code == 200
assert res.json == {'status': 'ok'}
| true | true |
1c1a4b305675fc8c4fbc60c787e0048eed65429b | 22,493 | py | Python | tensorflow_federated/python/core/impl/executors/executor_test_utils.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/executors/executor_test_utils.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/executors/executor_test_utils.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | 1 | 2022-02-27T18:31:12.000Z | 2022-02-27T18:31:12.000Z | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.162379 | 89 | 0.755213 |
import asyncio
import functools
from absl.testing import absltest
from absl.testing import parameterized
import tensorflow as tf
from tensorflow_federated.proto.v0 import computation_pb2 as pb
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.common_libs i... | true | true |
1c1a4c4e1248d0c6b6585c9c96ddd2efee40f98c | 4,947 | py | Python | tests/test_xtai_calendar.py | rajeshyogeshwar/exchange_calendars | a5f2ca17fc4a9195bc56b4b783420b4e9b999fc5 | [
"Apache-2.0"
] | 1 | 2021-03-14T22:40:55.000Z | 2021-03-14T22:40:55.000Z | tests/test_xtai_calendar.py | rajeshyogeshwar/exchange_calendars | a5f2ca17fc4a9195bc56b4b783420b4e9b999fc5 | [
"Apache-2.0"
] | 7 | 2021-11-03T01:20:29.000Z | 2022-03-31T01:28:12.000Z | tests/test_xtai_calendar.py | rajeshyogeshwar/exchange_calendars | a5f2ca17fc4a9195bc56b4b783420b4e9b999fc5 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
import pandas as pd
from pytz import UTC
from exchange_calendars.exchange_calendar_xtai import XTAIExchangeCalendar
from .test_exchange_calendar import NoDSTExchangeCalendarTestBase
class XTAICalendarTestCase(NoDSTExchangeCalendarTestBase, TestCase):
answer_key_filename = "xtai"
... | 41.225 | 75 | 0.606024 | from unittest import TestCase
import pandas as pd
from pytz import UTC
from exchange_calendars.exchange_calendar_xtai import XTAIExchangeCalendar
from .test_exchange_calendar import NoDSTExchangeCalendarTestBase
class XTAICalendarTestCase(NoDSTExchangeCalendarTestBase, TestCase):
answer_key_filename = "xtai"
... | true | true |
1c1a4c7272ea084fde9bca216c5388a0f56361cf | 409 | py | Python | honeybot/plugins/downloaded/diary/info.py | hailenwashere/honeybot | 95a6cd54283db1dcd4b33b9d281a7f6e1056ec09 | [
"MIT"
] | 60 | 2019-06-04T13:57:38.000Z | 2021-10-19T10:17:56.000Z | honeybot/plugins/downloaded/diary/info.py | hailenwashere/honeybot | 95a6cd54283db1dcd4b33b9d281a7f6e1056ec09 | [
"MIT"
] | 70 | 2019-06-04T13:59:53.000Z | 2021-10-05T10:14:16.000Z | honeybot/plugins/downloaded/diary/info.py | hailenwashere/honeybot | 95a6cd54283db1dcd4b33b9d281a7f6e1056ec09 | [
"MIT"
] | 95 | 2019-06-04T15:13:42.000Z | 2021-08-09T17:15:35.000Z |
NAME = 'diary.py'
ORIGINAL_AUTHORS = [
'Angelo Giacco'
]
ABOUT = '''
Keeps a record of your diary
'''
COMMANDS = '''
>>>.diary record <diary entry>
Adds to that day's diary entry
>>>.diary show <date>
Will show the diary entry of specified date (can also accept "today", "yesterday")
>>>.diary delete
Will delet... | 15.730769 | 82 | 0.672372 |
NAME = 'diary.py'
ORIGINAL_AUTHORS = [
'Angelo Giacco'
]
ABOUT = '''
Keeps a record of your diary
'''
COMMANDS = '''
>>>.diary record <diary entry>
Adds to that day's diary entry
>>>.diary show <date>
Will show the diary entry of specified date (can also accept "today", "yesterday")
>>>.diary delete
Will delet... | true | true |
1c1a4c8a5f64924db722e3d813e59fa1982da8ea | 8,362 | py | Python | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_event_log.py | rparrapy/dagster | 453ebedb326eae48b5f8fa2a4a3811d94629dc6e | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_event_log.py | rparrapy/dagster | 453ebedb326eae48b5f8fa2a4a3811d94629dc6e | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/storage_tests/test_event_log.py | rparrapy/dagster | 453ebedb326eae48b5f8fa2a4a3811d94629dc6e | [
"Apache-2.0"
] | null | null | null | import os
import time
import pytest
import sqlalchemy
from dagster import seven
from dagster.core.events import DagsterEvent, DagsterEventType, EngineEventData
from dagster.core.events.log import DagsterEventRecord
from dagster.core.storage.event_log import (
DagsterEventLogInvalidForRun,
InMemoryEventLogStor... | 32.92126 | 109 | 0.626764 | import os
import time
import pytest
import sqlalchemy
from dagster import seven
from dagster.core.events import DagsterEvent, DagsterEventType, EngineEventData
from dagster.core.events.log import DagsterEventRecord
from dagster.core.storage.event_log import (
DagsterEventLogInvalidForRun,
InMemoryEventLogStor... | true | true |
1c1a4d4f331b4648a40653f6ed69f70363af53fd | 1,114 | py | Python | JumpscaleCore/servers/myjobs/tests/2_simple_error.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 1 | 2020-06-21T11:18:52.000Z | 2020-06-21T11:18:52.000Z | JumpscaleCore/servers/myjobs/tests/2_simple_error.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 644 | 2019-08-25T10:19:56.000Z | 2020-12-23T09:41:04.000Z | JumpscaleCore/servers/myjobs/tests/2_simple_error.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 11 | 2019-08-29T21:38:50.000Z | 2020-06-21T11:18:55.000Z | from Jumpscale import j
myjobs = j.servers.myjobs
skip = j.baseclasses.testtools._skip
@skip("https://github.com/threefoldtech/jumpscaleX_core/issues/493")
def test_simple_error():
"""
kosmos -p 'j.servers.myjobs.test("simple_error")'
"""
myjobs._test_setup()
j.tools.logger.debug = True
d... | 20.254545 | 68 | 0.641831 | from Jumpscale import j
myjobs = j.servers.myjobs
skip = j.baseclasses.testtools._skip
@skip("https://github.com/threefoldtech/jumpscaleX_core/issues/493")
def test_simple_error():
myjobs._test_setup()
j.tools.logger.debug = True
def add(a=None, b=None):
assert a
assert b
rais... | true | true |
1c1a4d5d8c04269e190bf5395597e01e39182291 | 8,055 | py | Python | metadata_sync/update_acdd_metadata.py | alex-ip/metadata_sync | a6b9de7e1fe1d3bae8669ec41cd09407e3e0afbc | [
"Apache-2.0"
] | null | null | null | metadata_sync/update_acdd_metadata.py | alex-ip/metadata_sync | a6b9de7e1fe1d3bae8669ec41cd09407e3e0afbc | [
"Apache-2.0"
] | null | null | null | metadata_sync/update_acdd_metadata.py | alex-ip/metadata_sync | a6b9de7e1fe1d3bae8669ec41cd09407e3e0afbc | [
"Apache-2.0"
] | null | null | null | '''
Utility to update ACDD global attributes in NetCDF files using metadata sourced from GeoNetwork
Created on Apr 7, 2016
@author: Alex Ip, Geoscience Australia
'''
import os
import netCDF4
import logging
import yaml
import numpy as np
import argparse
from geophys_utils import NetCDFGridUtils, NetCDFLineUtils, get_s... | 41.096939 | 124 | 0.67784 | import os
import netCDF4
import logging
import yaml
import numpy as np
import argparse
from geophys_utils import NetCDFGridUtils, NetCDFLineUtils, get_spatial_ref_from_crs
from metadata_sync.metadata import XMLMetadata
from geophys_utils import DataStats
from metadata_json import write_json_metadata
from _metadata_syn... | true | true |
1c1a4dda2d37c1b953bf145afdcb08103e8a99a6 | 239 | py | Python | leetcode-algorithms/125. Valid Palindrome/solution.py | joyfeel/leetcode | 80991f9e7d7825597342810fb5ee3f8637130667 | [
"MIT"
] | 3 | 2019-06-01T13:23:53.000Z | 2020-04-23T19:07:54.000Z | leetcode-algorithms/125. Valid Palindrome/solution.py | joyfeel/leetcode | 80991f9e7d7825597342810fb5ee3f8637130667 | [
"MIT"
] | null | null | null | leetcode-algorithms/125. Valid Palindrome/solution.py | joyfeel/leetcode | 80991f9e7d7825597342810fb5ee3f8637130667 | [
"MIT"
] | 1 | 2019-06-03T08:17:56.000Z | 2019-06-03T08:17:56.000Z | #
# @lc app=leetcode id=125 lang=python3
#
# [125] Valid Palindrome
#
class Solution:
def isPalindrome(self, s: str) -> bool:
clean_list = [ c for c in s.lower() if c.isalnum() ]
return clean_list == clean_list[::-1]
| 19.916667 | 60 | 0.615063 |
class Solution:
def isPalindrome(self, s: str) -> bool:
clean_list = [ c for c in s.lower() if c.isalnum() ]
return clean_list == clean_list[::-1]
| true | true |
1c1a4f1d129def3ab43d35ecc61399b344eed32c | 2,642 | py | Python | mindspore/ops/composite/multitype_ops/zeros_like_impl.py | TommyLike/mindspore | 401dabb786a9097d6dd84f391657d266b04e9a37 | [
"Apache-2.0"
] | 2 | 2020-04-28T03:49:10.000Z | 2020-04-28T03:49:13.000Z | mindspore/ops/composite/multitype_ops/zeros_like_impl.py | liyong126/mindspore | 930a1fb0a8fa9432025442c4f4732058bb7af592 | [
"Apache-2.0"
] | 7 | 2020-03-30T08:31:56.000Z | 2020-04-01T09:54:39.000Z | mindspore/ops/composite/multitype_ops/zeros_like_impl.py | liyong126/mindspore | 930a1fb0a8fa9432025442c4f4732058bb7af592 | [
"Apache-2.0"
] | 1 | 2020-03-30T17:07:43.000Z | 2020-03-30T17:07:43.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 25.901961 | 116 | 0.69455 |
from ...composite import base
from ... import functional as F
zeros_like_leaf = base.MultitypeFuncGraph('zeros_like_leaf')
@zeros_like_leaf.register("Number")
def _zeros_like_scala(x):
return 0
newenv = base.EnvInstance_()
@zeros_like_leaf.register("Function")
def _zeros_like_func(x):
... | true | true |
1c1a4f93377fdb07b0baa4856b683aa28fab00ee | 402 | py | Python | Coding/Python_Prgs/Compress_the_string.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null | Coding/Python_Prgs/Compress_the_string.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null | Coding/Python_Prgs/Compress_the_string.py | Phantom586/My_Codes | 900c4e5e95ab833e4f78f1594e3b25178a74f1a7 | [
"MIT"
] | null | null | null |
def compress(lst):
lst1 = []
result = []
lst1.append(lst[0])
for i in range(1, len(lst) + 1):
c = 1
print("Outer", i)
while(lst[i] == lst[i-1]):
c += 1
i += 1
print("Inner", i)
result.append((c, lst[i-1]))
lst1.append(lst[i])
... | 18.272727 | 36 | 0.442786 |
def compress(lst):
lst1 = []
result = []
lst1.append(lst[0])
for i in range(1, len(lst) + 1):
c = 1
print("Outer", i)
while(lst[i] == lst[i-1]):
c += 1
i += 1
print("Inner", i)
result.append((c, lst[i-1]))
lst1.append(lst[i])
... | true | true |
1c1a500e63e2295bf3b0a736046f940e88a0f87e | 1,635 | py | Python | contrib/samba-aad-server/build/infosrv/domaininfo.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | 2 | 2020-08-27T05:21:14.000Z | 2020-09-29T14:34:09.000Z | contrib/samba-aad-server/build/infosrv/domaininfo.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | 178 | 2020-12-10T19:40:01.000Z | 2022-02-27T09:53:15.000Z | contrib/samba-aad-server/build/infosrv/domaininfo.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | 1 | 2020-11-17T08:19:48.000Z | 2020-11-17T08:19:48.000Z | import sys
import json
import os
from flask import Flask
from flask_restful import reqparse, abort, Api, Resource
from flask import request, jsonify
import base64
import subprocess
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
def cmd_exec(cmdStr):
try:
output = subprocess.ch... | 25.952381 | 93 | 0.560245 | import sys
import json
import os
from flask import Flask
from flask_restful import reqparse, abort, Api, Resource
from flask import request, jsonify
import base64
import subprocess
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
def cmd_exec(cmdStr):
try:
output = subprocess.ch... | true | true |
1c1a50be6ebe086fa0a1bb5911759b883f21ca47 | 4,873 | py | Python | src/stactools/sentinel1/grd/stac.py | jmakovecki/sentinel1 | e195e86abe0a9b4c2d64c30dd62ef45ef3978083 | [
"Apache-2.0"
] | null | null | null | src/stactools/sentinel1/grd/stac.py | jmakovecki/sentinel1 | e195e86abe0a9b4c2d64c30dd62ef45ef3978083 | [
"Apache-2.0"
] | null | null | null | src/stactools/sentinel1/grd/stac.py | jmakovecki/sentinel1 | e195e86abe0a9b4c2d64c30dd62ef45ef3978083 | [
"Apache-2.0"
] | null | null | null | import logging
import os
from typing import Optional
import pystac
from pystac.extensions.eo import EOExtension
from pystac.extensions.sar import SarExtension
from pystac.extensions.sat import SatExtension
from stactools.core.io import ReadHrefModifier
from . import Format
from .bands import image_asset_from_href
fro... | 36.096296 | 98 | 0.663041 | import logging
import os
from typing import Optional
import pystac
from pystac.extensions.eo import EOExtension
from pystac.extensions.sar import SarExtension
from pystac.extensions.sat import SatExtension
from stactools.core.io import ReadHrefModifier
from . import Format
from .bands import image_asset_from_href
fro... | true | true |
1c1a50ffd47c3a245d153286db2f6ab4be9b1260 | 7,195 | py | Python | object_detector_ssd/data/coco.py | ekmungi/ml_courses | b7c0cfc0bcde0c319def0704afc22ca98799e8af | [
"Apache-2.0"
] | null | null | null | object_detector_ssd/data/coco.py | ekmungi/ml_courses | b7c0cfc0bcde0c319def0704afc22ca98799e8af | [
"Apache-2.0"
] | 1 | 2019-08-01T07:13:06.000Z | 2019-08-01T07:13:06.000Z | object_detector_ssd/data/coco.py | ekmungi/ml_courses | b7c0cfc0bcde0c319def0704afc22ca98799e8af | [
"Apache-2.0"
] | null | null | null | from .config import HOME
import os
import os.path as osp
import sys
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import cv2
import numpy as np
COCO_ROOT = osp.join(HOME, 'data/coco/')
IMAGES = 'images'
ANNOTATIONS = 'annotations'
COCO_API = 'PythonAPI'
INSTANCES_SET = 'insta... | 39.103261 | 90 | 0.562891 | from .config import HOME
import os
import os.path as osp
import sys
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import cv2
import numpy as np
COCO_ROOT = osp.join(HOME, 'data/coco/')
IMAGES = 'images'
ANNOTATIONS = 'annotations'
COCO_API = 'PythonAPI'
INSTANCES_SET = 'insta... | true | true |
1c1a51b7980917377bf65c6a8d5ff06a8e18d797 | 11,695 | py | Python | cwltool/schemas/v1.0/salad/tests/test_examples.py | jeremiahsavage/cwltool | fe1c06f16f866fa2d1a4655f236b9a52b9564fac | [
"Apache-2.0"
] | 2 | 2017-07-06T13:25:23.000Z | 2017-07-06T13:26:15.000Z | cwltool/schemas/v1.0/salad/tests/test_examples.py | jeremiahsavage/cwltool | fe1c06f16f866fa2d1a4655f236b9a52b9564fac | [
"Apache-2.0"
] | 1 | 2017-09-08T18:32:41.000Z | 2017-11-30T18:28:43.000Z | cwltool/schemas/v1.0/salad/tests/test_examples.py | jeremiahsavage/cwltool | fe1c06f16f866fa2d1a4655f236b9a52b9564fac | [
"Apache-2.0"
] | 3 | 2018-04-05T17:14:59.000Z | 2021-07-12T00:54:13.000Z | import unittest
import schema_salad.ref_resolver
import schema_salad.main
import schema_salad.schema
from schema_salad.jsonld_context import makerdf
import rdflib
import ruamel.yaml as yaml
import json
import os
try:
from ruamel.yaml import CSafeLoader as SafeLoader
except ImportError:
from ruamel.yaml import ... | 32.851124 | 101 | 0.415562 | import unittest
import schema_salad.ref_resolver
import schema_salad.main
import schema_salad.schema
from schema_salad.jsonld_context import makerdf
import rdflib
import ruamel.yaml as yaml
import json
import os
try:
from ruamel.yaml import CSafeLoader as SafeLoader
except ImportError:
from ruamel.yaml import ... | true | true |
1c1a51bc2ef7878c8c58d8a1b909c9540830c92e | 2,188 | py | Python | PyBank/main.py | SamHoney71/python-challenge_1 | 8db8bf04ad02893b5a63b5373fdd03cf5e95db4b | [
"RSA-MD"
] | null | null | null | PyBank/main.py | SamHoney71/python-challenge_1 | 8db8bf04ad02893b5a63b5373fdd03cf5e95db4b | [
"RSA-MD"
] | null | null | null | PyBank/main.py | SamHoney71/python-challenge_1 | 8db8bf04ad02893b5a63b5373fdd03cf5e95db4b | [
"RSA-MD"
] | null | null | null | #PyBank Homework Assignment - two columns - Date & Profit/Loss
import numpy as np
#Read budget_data.csv file
import os
import csv
# Path to collect data from the Resoures folder
budget_csv = os.path.join(".","Resources","budget_data.csv")
# set list to collect month over month profit & loss & month
Profit_mon... | 25.149425 | 68 | 0.642596 |
import numpy as np
import os
import csv
budget_csv = os.path.join(".","Resources","budget_data.csv")
Profit_month = []
profit_Monthly = []
total_revenue = 0
total_month = 0
previous_revenue = 0
monthly_profit_loss = 0
current_revenue = 0
count = 0
with open(budget_csv) as csv_file:
csvreader = csv.r... | true | true |
1c1a52f5da22ac5000bc35a670eb83f9304cb031 | 816 | py | Python | src/my_messenger/mongo_db/test_core.py | thunderamur/my_messenger | 53327fbef9c603b834695231406226cd487244d6 | [
"MIT"
] | null | null | null | src/my_messenger/mongo_db/test_core.py | thunderamur/my_messenger | 53327fbef9c603b834695231406226cd487244d6 | [
"MIT"
] | null | null | null | src/my_messenger/mongo_db/test_core.py | thunderamur/my_messenger | 53327fbef9c603b834695231406226cd487244d6 | [
"MIT"
] | null | null | null | from .core import MongoRepo
class TestMongoRepo:
def setup(self):
self.mongo_repo = MongoRepo()
def test_push_and_pop(self):
if not self.mongo_repo.connected:
return
self.mongo_repo.push('test_from', 'test_to', 'test_message')
self.mongo_repo.push('test_from', 'tes... | 34 | 93 | 0.605392 | from .core import MongoRepo
class TestMongoRepo:
def setup(self):
self.mongo_repo = MongoRepo()
def test_push_and_pop(self):
if not self.mongo_repo.connected:
return
self.mongo_repo.push('test_from', 'test_to', 'test_message')
self.mongo_repo.push('test_from', 'tes... | true | true |
1c1a5318a337321e1d8d88fa5f465345dbc98f7b | 3,052 | py | Python | classification/classification.py | aninda-github/DeepLearning-OpenCV | cd4726fd0a1df35d18695380407bcc9739235edb | [
"MIT"
] | null | null | null | classification/classification.py | aninda-github/DeepLearning-OpenCV | cd4726fd0a1df35d18695380407bcc9739235edb | [
"MIT"
] | null | null | null | classification/classification.py | aninda-github/DeepLearning-OpenCV | cd4726fd0a1df35d18695380407bcc9739235edb | [
"MIT"
] | null | null | null | import tensorflow as tf
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import numpy as np
import matplotlib.pyplot as plt
# We will be using GPU to train our model. I have a Nvidia GTX 1650 card with compute capabili... | 35.905882 | 116 | 0.752294 | import tensorflow as tf
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import numpy as np
import matplotlib.pyplot as plt
if tf.test.gpu_device_name():
print('Default GPU Device:{}'.format(tf.test.gpu_device_na... | true | true |
1c1a535aa9637ad0d4823e5997cb99c9bc2dfcaa | 1,184 | py | Python | conanfile.py | bincrafters/conan-rang | 26c461d03dda528da5350e0837947ba56aaae9f2 | [
"MIT"
] | null | null | null | conanfile.py | bincrafters/conan-rang | 26c461d03dda528da5350e0837947ba56aaae9f2 | [
"MIT"
] | null | null | null | conanfile.py | bincrafters/conan-rang | 26c461d03dda528da5350e0837947ba56aaae9f2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools
import os
class RangConan(ConanFile):
name = "rang"
version = "2.1"
url = "https://github.com/bincrafters/conan-rang"
description = "A Minimal, Header only Modern c++ library for colors in your terminal"
# Indi... | 30.358974 | 89 | 0.661318 |
from conans import ConanFile, tools
import os
class RangConan(ConanFile):
name = "rang"
version = "2.1"
url = "https://github.com/bincrafters/conan-rang"
description = "A Minimal, Header only Modern c++ library for colors in your terminal"
license = "Unlicense"
exports =... | true | true |
1c1a535bb3ef20bda713b287bdee0c58b5562088 | 3,616 | py | Python | app.py | qiuosier/prometheus | 7c104dadb4769caf4368f37973f986b6d194931c | [
"MIT"
] | null | null | null | app.py | qiuosier/prometheus | 7c104dadb4769caf4368f37973f986b6d194931c | [
"MIT"
] | null | null | null | app.py | qiuosier/prometheus | 7c104dadb4769caf4368f37973f986b6d194931c | [
"MIT"
] | null | null | null | import requests
import time
import sys
import traceback
import argparse
from contextlib import suppress
from prometheus_client import start_http_server, REGISTRY, Gauge
# Remove the default metrics
for name in list(REGISTRY._names_to_collectors.values()):
with suppress(KeyError):
REGISTRY.unregister(name)
... | 33.794393 | 117 | 0.681416 | import requests
import time
import sys
import traceback
import argparse
from contextlib import suppress
from prometheus_client import start_http_server, REGISTRY, Gauge
for name in list(REGISTRY._names_to_collectors.values()):
with suppress(KeyError):
REGISTRY.unregister(name)
SERVICE_UP = Gauge('sampl... | true | true |
1c1a53b715ba10d8a6f5c7848d7d38511477165b | 398 | py | Python | WebProject/wsgi.py | Hoter11/WebProject | 430b61cc268ba6981db9ff8f479fa982272d6f08 | [
"MIT"
] | null | null | null | WebProject/wsgi.py | Hoter11/WebProject | 430b61cc268ba6981db9ff8f479fa982272d6f08 | [
"MIT"
] | 2 | 2021-04-08T21:08:14.000Z | 2021-06-09T18:35:12.000Z | WebProject/wsgi.py | Hoter11/WebProject | 430b61cc268ba6981db9ff8f479fa982272d6f08 | [
"MIT"
] | null | null | null | """
WSGI config for WebProject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | 23.411765 | 78 | 0.788945 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebProject.settings")
application = get_wsgi_application()
| true | true |
1c1a558d1c56a3d9e9bbcae9f06c4027d708c441 | 707 | py | Python | 111_Minimum Depth of Binary Tree.py | Alvin1994/leetcode-python3- | ba2bde873c925554cc39f2bd13be81967713477d | [
"Apache-2.0"
] | null | null | null | 111_Minimum Depth of Binary Tree.py | Alvin1994/leetcode-python3- | ba2bde873c925554cc39f2bd13be81967713477d | [
"Apache-2.0"
] | null | null | null | 111_Minimum Depth of Binary Tree.py | Alvin1994/leetcode-python3- | ba2bde873c925554cc39f2bd13be81967713477d | [
"Apache-2.0"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def minDepth(self, root: 'TreeNode') -> 'int':
# caculate level by bottom Up
# dfsHeight(node)->'int'
def helper(... | 28.28 | 57 | 0.502122 |
class Solution:
def minDepth(self, root: 'TreeNode') -> 'int':
def helper(node):
childrens = [node.left,node.right]
if not any(childrens):
return 1
minVal = float('inf')
for children in childrens:
if chi... | true | true |
1c1a56bb87bfae5906d151e5c6eb532b4a3ef198 | 4,638 | py | Python | deeppavlov/dataset_readers/insurance_reader.py | amithfernando/DeepPavlov | d643000f0a5bb4c220a28899d727e12e195000e0 | [
"Apache-2.0"
] | 1 | 2018-09-28T05:49:43.000Z | 2018-09-28T05:49:43.000Z | deeppavlov/dataset_readers/insurance_reader.py | amithfernando/DeepPavlov | d643000f0a5bb4c220a28899d727e12e195000e0 | [
"Apache-2.0"
] | null | null | null | deeppavlov/dataset_readers/insurance_reader.py | amithfernando/DeepPavlov | d643000f0a5bb4c220a28899d727e12e195000e0 | [
"Apache-2.0"
] | null | null | null | from deeppavlov.core.data.dataset_reader import DatasetReader
from pathlib import Path
from deeppavlov.core.common.registry import register
from deeppavlov.core.data.utils import download_decompress, mark_done, is_done
from deeppavlov.core.commands.utils import get_deeppavlov_root, expand_path
from typing import Dict, ... | 41.783784 | 122 | 0.591203 | from deeppavlov.core.data.dataset_reader import DatasetReader
from pathlib import Path
from deeppavlov.core.common.registry import register
from deeppavlov.core.data.utils import download_decompress, mark_done, is_done
from deeppavlov.core.commands.utils import get_deeppavlov_root, expand_path
from typing import Dict, ... | true | true |
1c1a56f38aea27d45d69e6b6e1b5a9fec9aa09c5 | 39 | py | Python | async_bus/__init__.py | nicolaszein/py-async-bus | d0496a08d5f86af9cdae8a0ecb49b97f6e18bad8 | [
"MIT"
] | 1 | 2021-04-13T08:10:40.000Z | 2021-04-13T08:10:40.000Z | async_bus/__init__.py | nicolaszein/py-async-bus | d0496a08d5f86af9cdae8a0ecb49b97f6e18bad8 | [
"MIT"
] | 1 | 2021-03-07T13:01:33.000Z | 2021-03-07T13:01:33.000Z | async_bus/__init__.py | nicolaszein/py-async-bus | d0496a08d5f86af9cdae8a0ecb49b97f6e18bad8 | [
"MIT"
] | null | null | null | from .event_bus import EventBus # noqa
| 19.5 | 38 | 0.794872 | from .event_bus import EventBus
| true | true |
1c1a5804df58d2ab9739ece9a28921bb17ee41a0 | 4,213 | py | Python | dialogs.py | max99x/automata-editor | b700849f0925662acf56b0e50fff0098b94d8a62 | [
"MIT"
] | 18 | 2015-08-04T08:14:43.000Z | 2021-03-28T16:22:04.000Z | dialogs.py | max99x/automata-editor | b700849f0925662acf56b0e50fff0098b94d8a62 | [
"MIT"
] | 1 | 2021-06-04T23:57:21.000Z | 2021-06-04T23:57:21.000Z | dialogs.py | max99x/automata-editor | b700849f0925662acf56b0e50fff0098b94d8a62 | [
"MIT"
] | 6 | 2016-09-08T02:01:42.000Z | 2022-03-23T20:21:48.000Z | import tkinter as tk
import tkinter.simpledialog
import tkinter.filedialog
import tkinter.messagebox
class ChoiceWindow(object):
def __init__(self, master, choices, title='Selection', text='Select item:', selected=0):
if len(choices) == 0:
raise RuntimeError('No choices supplied.')
se... | 32.160305 | 141 | 0.641823 | import tkinter as tk
import tkinter.simpledialog
import tkinter.filedialog
import tkinter.messagebox
class ChoiceWindow(object):
def __init__(self, master, choices, title='Selection', text='Select item:', selected=0):
if len(choices) == 0:
raise RuntimeError('No choices supplied.')
se... | true | true |
1c1a587624ac7ad3250d51383919c9f64df323d5 | 1,293 | py | Python | about/tests/test_views.py | RomanMelnikS/Yatube | ae146c5d0ab448fcf5d5437bc8cc3041b04551d1 | [
"BSD-3-Clause"
] | null | null | null | about/tests/test_views.py | RomanMelnikS/Yatube | ae146c5d0ab448fcf5d5437bc8cc3041b04551d1 | [
"BSD-3-Clause"
] | null | null | null | about/tests/test_views.py | RomanMelnikS/Yatube | ae146c5d0ab448fcf5d5437bc8cc3041b04551d1 | [
"BSD-3-Clause"
] | null | null | null | from django.test import Client, TestCase
from django.urls import reverse
class StaticViewsTests(TestCase):
def setUp(self):
self.guest_client = Client()
self.templates_pages_names = {
'about/author.html': reverse('about:author'),
'about/tech.html': reverse('about:tech'),
... | 40.40625 | 77 | 0.622583 | from django.test import Client, TestCase
from django.urls import reverse
class StaticViewsTests(TestCase):
def setUp(self):
self.guest_client = Client()
self.templates_pages_names = {
'about/author.html': reverse('about:author'),
'about/tech.html': reverse('about:tech'),
... | true | true |
1c1a58d93df00c766c2a861c6a0923311cc0b654 | 1,998 | py | Python | setup.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | null | null | null | setup.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | null | null | null | setup.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
__version__ = '0.32.0'
setup(
name='cartography',
version=__version__,
description='Explore assets and their relationships across your technical infrastructure.',
url='https://www.github.com/lyft/cartography',
maintainer='Lyft',
... | 28.542857 | 95 | 0.544545 | from setuptools import find_packages
from setuptools import setup
__version__ = '0.32.0'
setup(
name='cartography',
version=__version__,
description='Explore assets and their relationships across your technical infrastructure.',
url='https://www.github.com/lyft/cartography',
maintainer='Lyft',
... | true | true |
1c1a5986d85a79d63e6620223aab3d50d41a5dd5 | 8,302 | py | Python | src/gluonts/model/tpp/deeptpp/_estimator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 20 | 2021-07-22T08:32:36.000Z | 2022-03-11T10:21:25.000Z | src/gluonts/model/tpp/deeptpp/_estimator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 3 | 2021-10-15T18:59:46.000Z | 2022-02-07T16:59:32.000Z | src/gluonts/model/tpp/deeptpp/_estimator.py | dstefanov46/Reproducibility-Challenge-2021 | 55a0500c2aa6e8b2c117057f4259fbfd4b9b5f53 | [
"Apache-2.0"
] | 8 | 2021-08-04T16:12:19.000Z | 2022-01-12T18:28:58.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 38.613953 | 80 | 0.666586 |
from functools import partial
from typing import Optional
from mxnet.gluon import HybridBlock
from gluonts.core.component import validated
from gluonts.dataset.common import Dataset
from gluonts.mx.model.estimator import GluonEstimator, TrainOutput
from gluonts.model.predictor import Predictor
from gluont... | true | true |
1c1a5a55b02d160acdeebf9ca81a66ee26e074ee | 4,289 | py | Python | timedLyricsCreator.py | Chris-Development-Official/timedLyricsCreator.py | 18bf85f08bb8b81e8578e171ea7dc7fff3a73251 | [
"MIT"
] | 1 | 2022-01-24T05:32:29.000Z | 2022-01-24T05:32:29.000Z | timedLyricsCreator.py | Chris-Development-Official/timedLyricsCreator.py | 18bf85f08bb8b81e8578e171ea7dc7fff3a73251 | [
"MIT"
] | null | null | null | timedLyricsCreator.py | Chris-Development-Official/timedLyricsCreator.py | 18bf85f08bb8b81e8578e171ea7dc7fff3a73251 | [
"MIT"
] | null | null | null | import sys,os,inspect
import time
import vlc
import music_tag
thisdir = os.getcwd()
def formatTime(x):
x = int(x)
#milliseconds
ms = x%1000
x=x//1000
#seconds
s=x%60
#minutes
m=x//60
result = '['+str(m).zfill(2)+':'+str(s).zfill(2)+'.'+str(ms).zfill(3)+']'
retu... | 36.347458 | 95 | 0.343437 | import sys,os,inspect
import time
import vlc
import music_tag
thisdir = os.getcwd()
def formatTime(x):
x = int(x)
ms = x%1000
x=x//1000
s=x%60
m=x//60
result = '['+str(m).zfill(2)+':'+str(s).zfill(2)+'.'+str(ms).zfill(3)+']'
return result
print("TimedLyricsC... | true | true |
1c1a5aab557cb759b8fd53cd185eb8894e85414c | 1,107 | py | Python | 2021/day-10/part2.py | nairraghav/advent-of-code-2019 | 274a2a4a59a8be39afb323356c592af5e1921e54 | [
"MIT"
] | null | null | null | 2021/day-10/part2.py | nairraghav/advent-of-code-2019 | 274a2a4a59a8be39afb323356c592af5e1921e54 | [
"MIT"
] | null | null | null | 2021/day-10/part2.py | nairraghav/advent-of-code-2019 | 274a2a4a59a8be39afb323356c592af5e1921e54 | [
"MIT"
] | null | null | null | puzzle_input_list = []
with open("input.txt", "r") as puzzle_input:
for line in puzzle_input:
line = line.strip()
puzzle_input_list.append(line)
open_brackets = {"{", "(", "[", "<"}
bracket_mapping = {"}": "{", ")": "(", "]": "[", ">": "<",
"{": "}", "(": ")", "[": "]", "<": ">"... | 27 | 62 | 0.543812 | puzzle_input_list = []
with open("input.txt", "r") as puzzle_input:
for line in puzzle_input:
line = line.strip()
puzzle_input_list.append(line)
open_brackets = {"{", "(", "[", "<"}
bracket_mapping = {"}": "{", ")": "(", "]": "[", ">": "<",
"{": "}", "(": ")", "[": "]", "<": ">"... | true | true |
1c1a5ac156fdd85fd00b1c6225a2d139b70f16b1 | 2,120 | py | Python | manager/cached_templates/templates/base_ajax.htm.py | jordancarlson08/MyStuff | 4f4f6fdd298ce00e4a1f8a4621aaf94c0ccdb773 | [
"Apache-2.0"
] | null | null | null | manager/cached_templates/templates/base_ajax.htm.py | jordancarlson08/MyStuff | 4f4f6fdd298ce00e4a1f8a4621aaf94c0ccdb773 | [
"Apache-2.0"
] | null | null | null | manager/cached_templates/templates/base_ajax.htm.py | jordancarlson08/MyStuff | 4f4f6fdd298ce00e4a1f8a4621aaf94c0ccdb773 | [
"Apache-2.0"
] | null | null | null | # -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 9
_modified_time = 1396897262.153267
_enable_loop = True
_template_filename = 'C:\\Users\\Jordan Carlson\\Desktop\\MyStuff\\base_app\\templates/base_ajax.htm'... | 32.121212 | 167 | 0.662264 |
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 9
_modified_time = 1396897262.153267
_enable_loop = True
_template_filename = 'C:\\Users\\Jordan Carlson\\Desktop\\MyStuff\\base_app\\templates/base_ajax.htm'
_template_uri = 'base... | true | true |
1c1a5c7fd312a7097cc0f57469c25bcd1f7a338b | 6,361 | py | Python | pytfa/thermo/utils.py | OmidOftadeh/pytfa | 686a6a238a33f7a66c4d34e0ef96d48c3e92304c | [
"Apache-2.0"
] | null | null | null | pytfa/thermo/utils.py | OmidOftadeh/pytfa | 686a6a238a33f7a66c4d34e0ef96d48c3e92304c | [
"Apache-2.0"
] | null | null | null | pytfa/thermo/utils.py | OmidOftadeh/pytfa | 686a6a238a33f7a66c4d34e0ef96d48c3e92304c | [
"Apache-2.0"
] | null | null | null | """
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Thermodynamics-based Flux Analysis
.. moduleauthor:: pyTFA team
Some tools around COBRApy models used by pyTFA
"""
import re
Formula_regex = re.compile("([A-Z][a-z]*)([0-9]*)")
def check_reaction_balance(reaction, proton = None):
"""
Check t... | 31.805 | 84 | 0.617827 | import re
Formula_regex = re.compile("([A-Z][a-z]*)([0-9]*)")
def check_reaction_balance(reaction, proton = None):
sum_charge = 0
if len(reaction.metabolites) == 1:
return 'drain flux'
Atoms_sum = [0] * 26
for metabolite in reaction.metabolites:
if metabolite.formula... | true | true |
1c1a5dbc0e6779f447b3cd935a9c11caa9a63b0a | 22,516 | py | Python | tools/kconfig_new/confgen.py | 123swk123/esp-idf | a117c94a27de3c4a49bf4b6bbc19b8eab7c9f972 | [
"Apache-2.0"
] | null | null | null | tools/kconfig_new/confgen.py | 123swk123/esp-idf | a117c94a27de3c4a49bf4b6bbc19b8eab7c9f972 | [
"Apache-2.0"
] | null | null | null | tools/kconfig_new/confgen.py | 123swk123/esp-idf | a117c94a27de3c4a49bf4b6bbc19b8eab7c9f972 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Command line tool to take in ESP-IDF sdkconfig files with project
# settings and output data in multiple formats (update config, generate
# header file, generate .cmake include file, documentation, etc).
#
# Used internally by the ESP-IDF build system. But designed to be
# non-IDF-specific.
#
... | 39.780919 | 141 | 0.578566 |
function
import argparse
import json
import os
import os.path
import re
import sys
import tempfile
import gen_kconfig_doc
try:
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
__version__ = "0.1"
if "IDF_CMAKE" no... | true | true |
1c1a5f0bd6ca9c58bc47cc9f43dab13490bb5917 | 920 | py | Python | jivago/wsgi/invocation/parameter_selection/optional_query_parameter_selector.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 12 | 2018-03-19T20:57:44.000Z | 2020-01-27T14:11:24.000Z | jivago/wsgi/invocation/parameter_selection/optional_query_parameter_selector.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 73 | 2018-04-20T22:26:00.000Z | 2021-12-01T14:17:37.000Z | jivago/wsgi/invocation/parameter_selection/optional_query_parameter_selector.py | keotl/jivago | 892dfb0cae773e36245083c3e56f0f8523145523 | [
"MIT"
] | 1 | 2019-02-28T13:33:45.000Z | 2019-02-28T13:33:45.000Z | from jivago.lang.annotations import Override
from jivago.wsgi.invocation.missing_route_invocation_argument import MissingRouteInvocationArgument
from jivago.wsgi.invocation.parameter_selection.query_parameter_selector import QueryParameterSelector
from jivago.wsgi.invocation.parameters import OptionalQueryParam
from ji... | 46 | 118 | 0.805435 | from jivago.lang.annotations import Override
from jivago.wsgi.invocation.missing_route_invocation_argument import MissingRouteInvocationArgument
from jivago.wsgi.invocation.parameter_selection.query_parameter_selector import QueryParameterSelector
from jivago.wsgi.invocation.parameters import OptionalQueryParam
from ji... | true | true |
1c1a5ffa03938918facbddd0c1f691b54b6e0f0d | 7,304 | py | Python | cinder/volume/rpcapi.py | oodrive/cinder | 40b43d6698128ab26b056586e0a5c5e818e21c11 | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:28.000Z | 2015-11-25T10:18:28.000Z | cinder/volume/rpcapi.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | cinder/volume/rpcapi.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012, Intel, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 43.47619 | 79 | 0.626506 |
from oslo.config import cfg
from oslo import messaging
from cinder.openstack.common import jsonutils
from cinder import rpc
CONF = cfg.CONF
class VolumeAPI(object):
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic=None):
super(VolumeAPI, self).__init__()
target = messa... | true | true |
1c1a623c8bfa03a23e71a4112e07ddad2fb025b5 | 12,083 | py | Python | fpga/lib/eth/lib/axis/tb/test_axis_frame_length_adjust_fifo_64.py | totuwei/corundum | e983ad519fb4523d0ffca32f5e436195bcfc945c | [
"BSD-2-Clause-FreeBSD"
] | 1,121 | 2015-05-26T14:41:44.000Z | 2022-03-31T07:17:48.000Z | lib/axis/tb/test_axis_frame_length_adjust_fifo_64.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 98 | 2016-02-12T21:15:45.000Z | 2022-03-31T03:13:00.000Z | lib/axis/tb/test_axis_frame_length_adjust_fifo_64.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 368 | 2015-05-05T20:49:01.000Z | 2022-03-31T09:43:53.000Z | #!/usr/bin/env python
"""
Copyright (c) 2015-2018 Alex Forencich
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,... | 32.656757 | 101 | 0.52818 |
from myhdl import *
import os
import axis_ep
module = 'axis_frame_length_adjust_fifo'
testbench = 'test_%s_64' % module
srcs = []
srcs.append("../rtl/%s.v" % module)
srcs.append("../rtl/axis_frame_length_adjust.v")
srcs.append("../rtl/axis_fifo.v")
srcs.append("%s.v" % testbench)
src = ' '.join(srcs)
build_cmd ... | true | true |
1c1a63eb71837863bae4b877fd45203fba34718c | 534 | py | Python | main.py | i-m-pulse/export-google-drive-files | 460bab05cdd332de17f0a558925971ac87b364c0 | [
"MIT"
] | null | null | null | main.py | i-m-pulse/export-google-drive-files | 460bab05cdd332de17f0a558925971ac87b364c0 | [
"MIT"
] | null | null | null | main.py | i-m-pulse/export-google-drive-files | 460bab05cdd332de17f0a558925971ac87b364c0 | [
"MIT"
] | null | null | null | from gdrive import gdrive
from config import Config
#Instantiate an object
foo = gdrive(Config)
## Authenticating
# Get inital code to access token
code = foo.getCode()
#Access the access_token and refresh_token
foo.writeToken(code)
# Get fileid for your file
src_filename = 'your Google Drive filename... | 24.272727 | 63 | 0.758427 | from gdrive import gdrive
from config import Config
foo = gdrive(Config)
tCode()
foo.writeToken(code)
src_filename = 'your Google Drive filename Google Spreadsheet'
file_id = foo.getFileId(src_filename)
dst_filename = 'test.csv'
dst_mimetype = 'text/csv'
foo.downloadFile(file_id, dst_mimetype, dst_... | true | true |
1c1a65eb706f892b25a75390ed34dbad341b5550 | 845 | py | Python | build/common/openwisp/tasks.py | Wired-Mind-Labs/docker-openwisp-home | d7ce4e3fd78319ae82349b8e655b50f41b64a173 | [
"BSD-3-Clause"
] | 127 | 2019-07-12T15:41:20.000Z | 2022-03-29T18:50:37.000Z | build/common/openwisp/tasks.py | Wired-Mind-Labs/docker-openwisp-home | d7ce4e3fd78319ae82349b8e655b50f41b64a173 | [
"BSD-3-Clause"
] | 138 | 2019-05-14T19:38:30.000Z | 2022-03-31T20:33:56.000Z | build/common/openwisp/tasks.py | Wired-Mind-Labs/docker-openwisp-home | d7ce4e3fd78319ae82349b8e655b50f41b64a173 | [
"BSD-3-Clause"
] | 69 | 2019-05-16T18:56:41.000Z | 2022-03-23T05:41:55.000Z | from __future__ import absolute_import, unicode_literals
from django.core import management
from celery import shared_task
import os
@shared_task
def radius_tasks():
management.call_command(
"delete_old_radacct", int(os.environ['CRON_DELETE_OLD_RADACCT'])
)
management.call_command(
"delet... | 25.606061 | 86 | 0.753846 | from __future__ import absolute_import, unicode_literals
from django.core import management
from celery import shared_task
import os
@shared_task
def radius_tasks():
management.call_command(
"delete_old_radacct", int(os.environ['CRON_DELETE_OLD_RADACCT'])
)
management.call_command(
"delet... | true | true |
1c1a665b25ed011308ed95a90ba39f3b9e945485 | 1,303 | py | Python | parser/fase2/team17/Traduccion/InterpreteF2/Soporte_aFun/argumento.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team17/Traduccion/InterpreteF2/Soporte_aFun/argumento.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team17/Traduccion/InterpreteF2/Soporte_aFun/argumento.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from InterpreteF2.NodoAST import NodoArbol
from InterpreteF2.Tabla_de_simbolos import Tabla_de_simbolos
from InterpreteF2.Arbol import Arbol
from InterpreteF2.Valor.Valor import Valor
from InterpreteF2.Primitivos.TIPO import TIPO
from InterpreteF2.Primitivos.COMPROBADOR_deTipos import COMPROBADOR_deTipos
from Interpret... | 34.289474 | 80 | 0.726784 | from InterpreteF2.NodoAST import NodoArbol
from InterpreteF2.Tabla_de_simbolos import Tabla_de_simbolos
from InterpreteF2.Arbol import Arbol
from InterpreteF2.Valor.Valor import Valor
from InterpreteF2.Primitivos.TIPO import TIPO
from InterpreteF2.Primitivos.COMPROBADOR_deTipos import COMPROBADOR_deTipos
from Interpret... | true | true |
1c1a66b274ce4d059083e2adafe28b0b40ab4435 | 15,626 | py | Python | docker/build.py | LaudateCorpus1/dlcookbook-dlbs | 998a44940eb80f534ed682f8ef010e35df6b89a2 | [
"Apache-2.0"
] | 123 | 2017-11-28T20:21:24.000Z | 2022-03-22T11:21:04.000Z | docker/build.py | LaudateCorpus1/dlcookbook-dlbs | 998a44940eb80f534ed682f8ef010e35df6b89a2 | [
"Apache-2.0"
] | 17 | 2018-01-05T00:05:13.000Z | 2020-09-18T05:12:45.000Z | docker/build.py | LaudateCorpus1/dlcookbook-dlbs | 998a44940eb80f534ed682f8ef010e35df6b89a2 | [
"Apache-2.0"
] | 48 | 2018-01-04T20:52:51.000Z | 2022-03-06T00:47:17.000Z | import os
import sys
import json
import shutil
import logging
import argparse
import typing as t
from pathlib import Path
from datetime import datetime
from collections import defaultdict
logger = logging.getLogger(__name__)
def dlbs_log(labels: t.Optional[t.Union[t.Text, t.List[t.Text]]] = None, level: int = loggin... | 45.690058 | 120 | 0.626776 | import os
import sys
import json
import shutil
import logging
import argparse
import typing as t
from pathlib import Path
from datetime import datetime
from collections import defaultdict
logger = logging.getLogger(__name__)
def dlbs_log(labels: t.Optional[t.Union[t.Text, t.List[t.Text]]] = None, level: int = loggin... | true | true |
1c1a67417537e21c8ed08680e7c9e533d851abfa | 3,510 | py | Python | dmpipe/scripts/extract_castro_data.py | fermiPy/dmpipe | e5b3f950d18d5077f7abf46f53fcf59e97bb3301 | [
"BSD-3-Clause"
] | null | null | null | dmpipe/scripts/extract_castro_data.py | fermiPy/dmpipe | e5b3f950d18d5077f7abf46f53fcf59e97bb3301 | [
"BSD-3-Clause"
] | null | null | null | dmpipe/scripts/extract_castro_data.py | fermiPy/dmpipe | e5b3f950d18d5077f7abf46f53fcf59e97bb3301 | [
"BSD-3-Clause"
] | 2 | 2017-10-24T20:41:05.000Z | 2022-02-23T19:53:49.000Z | #!/usr/bin/env python
#
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Top levels scripts to extract castro data from an all-sky analysis
"""
import os
import argparse
import numpy as np
import yaml
from astropy import table
from fermipy import fits_utils
from dmpipe import dmp_roi
from dmpi... | 30.521739 | 99 | 0.647293 |
import os
import argparse
import numpy as np
import yaml
from astropy import table
from fermipy import fits_utils
from dmpipe import dmp_roi
from dmpipe.dm_target import DMTargetFactory
def read_targets(filepath):
return read_targets_from_fits(filepath)
def read_targets_from_fits(fitsfile):
tab = ... | true | true |
1c1a67a1a4477bdf58794674f21c5517a2968f02 | 1,031 | py | Python | BridgePattern/Bridge.py | JiangKlijna/DesignPattern | 445411a106348d0b63c2252e9b604af8c63cb1b3 | [
"Apache-2.0"
] | 6 | 2016-04-08T11:10:28.000Z | 2016-07-27T12:12:51.000Z | BridgePattern/Bridge.py | JiangKlijna/design-pattern | 445411a106348d0b63c2252e9b604af8c63cb1b3 | [
"Apache-2.0"
] | null | null | null | BridgePattern/Bridge.py | JiangKlijna/design-pattern | 445411a106348d0b63c2252e9b604af8c63cb1b3 | [
"Apache-2.0"
] | null | null | null | # encoding = utf-8
# ConcreteImplementor 1/2
class DrawingAPI1(object):
def draw_circle(self, x, y, radius):
print('API1.circle at {}:{} radius {}'.format(x, y, radius))
# ConcreteImplementor 2/2
class DrawingAPI2(object):
def draw_circle(self, x, y, radius):
print('API2.circle at {}:{} radiu... | 22.911111 | 69 | 0.612027 |
class DrawingAPI1(object):
def draw_circle(self, x, y, radius):
print('API1.circle at {}:{} radius {}'.format(x, y, radius))
class DrawingAPI2(object):
def draw_circle(self, x, y, radius):
print('API2.circle at {}:{} radius {}'.format(x, y, radius))
class CircleShape(object):
def __... | true | true |
1c1a68228887d71c91d792322361043113bd7ae1 | 92,517 | py | Python | managed/devops/bin/yb_backup.py | tedyu/yugabyte-db | 242e589b23c4bd8afffefcf30944883f77174c88 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | managed/devops/bin/yb_backup.py | tedyu/yugabyte-db | 242e589b23c4bd8afffefcf30944883f77174c88 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | managed/devops/bin/yb_backup.py | tedyu/yugabyte-db | 242e589b23c4bd8afffefcf30944883f77174c88 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2019 YugaByte, Inc. and Contributors
#
# Licensed under the Polyform Free Trial License 1.0.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# https://github.com/YugaByte/yugabyte-db/blob/master/licenses... | 44.976665 | 100 | 0.608591 |
from __future__ import print_function
import argparse
import atexit
import copy
import logging
import pipes
import random
import shutil
import string
import subprocess
import time
import json
from argparse import RawDescriptionHelpFormatter
from boto.utils import get_instance_metadata
from multiprocessing.po... | true | true |
1c1a68596f11bb195fa9cb84ebba48674d16c168 | 4,505 | py | Python | theme_manager/hooks.py | SherinKR/theme_manager | 86380a375c83a0d672761ac3ae6b5a3550f93a82 | [
"MIT"
] | 3 | 2021-07-28T06:25:01.000Z | 2021-12-25T23:37:52.000Z | theme_manager/hooks.py | SherinKR/theme_manager | 86380a375c83a0d672761ac3ae6b5a3550f93a82 | [
"MIT"
] | null | null | null | theme_manager/hooks.py | SherinKR/theme_manager | 86380a375c83a0d672761ac3ae6b5a3550f93a82 | [
"MIT"
] | 6 | 2021-07-25T09:57:46.000Z | 2021-12-28T20:04:32.000Z | from . import __version__ as app_version
app_name = "theme_manager"
app_title = "Theme Manager"
app_publisher = "efeone"
app_description = "Theme Manger is an frappe app build for customising theme with ERPNext Support"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "sherin@efeone.com"
app_... | 23.463542 | 98 | 0.674362 | from . import __version__ as app_version
app_name = "theme_manager"
app_title = "Theme Manager"
app_publisher = "efeone"
app_description = "Theme Manger is an frappe app build for customising theme with ERPNext Support"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "sherin@efeone.com"
app_... | true | true |
1c1a68b532727daaa37b4e28a2f793ee5d61233b | 1,631 | py | Python | app/gui/ToolTip.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null | app/gui/ToolTip.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null | app/gui/ToolTip.py | williamo1099/Automated-Document-Clusterer | f6531a0b67cbb1bb0ab31c4f50be0a4919cbbd72 | [
"MIT"
] | null | null | null |
import tkinter as tk
class ToolTip:
def __init__(self, widget, tip):
"""
The constructor for ToolTip class.
Parameters
----------
widget : Tk button
The button.
tip : string
The tool tip message.
Returns
-------
... | 24.343284 | 93 | 0.509503 |
import tkinter as tk
class ToolTip:
def __init__(self, widget, tip):
self.__widget = widget
self.__widget.bind('<Enter>', self.__enter)
self.__widget.bind('<Leave>', self.__close)
self.__tip = tip
def __enter(self, event=None):
x = y = 0
x, y, cx, ... | true | true |
1c1a68ba0ae93a3d4c98c5f37358709c5c6cf3ac | 436 | py | Python | posts/migrations/0005_auto_20200530_1752.py | Brenda-M/instagram-clone | 4f30d7168db6c6cc36c1ebf012771f6df1ce4975 | [
"MIT"
] | null | null | null | posts/migrations/0005_auto_20200530_1752.py | Brenda-M/instagram-clone | 4f30d7168db6c6cc36c1ebf012771f6df1ce4975 | [
"MIT"
] | 6 | 2021-03-30T13:40:47.000Z | 2022-01-13T02:48:38.000Z | posts/migrations/0005_auto_20200530_1752.py | Brenda-M/instagram-clone | 4f30d7168db6c6cc36c1ebf012771f6df1ce4975 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-30 14:52
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('posts', '0004_auto_20200530_1521'),
]
operations = [
migrations.AlterField(
model_name='image',
... | 21.8 | 70 | 0.62844 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('posts', '0004_auto_20200530_1521'),
]
operations = [
migrations.AlterField(
model_name='image',
name='created_at',
field=m... | true | true |
1c1a69473e7e79fea9261e49965f774e61138777 | 11,850 | py | Python | flow/visualize/visualizer_rllib.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | null | null | null | flow/visualize/visualizer_rllib.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | 1 | 2021-12-13T20:03:01.000Z | 2021-12-13T20:03:01.000Z | flow/visualize/visualizer_rllib.py | alt113/flow | 28224d05acd4b03cdb78105d142619e4a01d3d5f | [
"MIT"
] | null | null | null | """Visualizer for rllib experiments.
Attributes
----------
EXAMPLE_USAGE : str
Example call to the function, which is
::
python ./visualizer_rllib.py /tmp/ray/result_dir 1
parser : ArgumentParser
Command-line argument parser
"""
import argparse
from datetime import datetime
import gym
import num... | 34.149856 | 79 | 0.601603 |
import argparse
from datetime import datetime
import gym
import numpy as np
import os
import sys
import time
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.tune.registry import register_env
from flow.core.u... | true | true |
1c1a696cff254327964996b17c9efb36dc95856c | 1,271 | py | Python | st2client/st2client/models/action_alias.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 4,920 | 2015-01-01T15:12:17.000Z | 2022-03-31T19:31:15.000Z | st2client/st2client/models/action_alias.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 3,563 | 2015-01-05T19:02:19.000Z | 2022-03-31T19:23:09.000Z | st2client/st2client/models/action_alias.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 774 | 2015-01-01T20:41:24.000Z | 2022-03-31T13:25:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 32.589744 | 74 | 0.742722 |
from __future__ import absolute_import
from st2client.models import core
__all__ = ["ActionAlias", "ActionAliasMatch"]
class ActionAlias(core.Resource):
_alias = "Action-Alias"
_display_name = "Action Alias"
_plural = "ActionAliases"
_plural_display_name = "Action Aliases"
_url_pa... | true | true |
1c1a69c276536460e1b90465b482bd6aed835fe2 | 6,395 | py | Python | models/seq2seq-pytorch/seq2seq.py | Cospui/cotk | 9038420787f7251049534baf3b35eac538a82148 | [
"Apache-2.0"
] | null | null | null | models/seq2seq-pytorch/seq2seq.py | Cospui/cotk | 9038420787f7251049534baf3b35eac538a82148 | [
"Apache-2.0"
] | null | null | null | models/seq2seq-pytorch/seq2seq.py | Cospui/cotk | 9038420787f7251049534baf3b35eac538a82148 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
import logging
import time
import os
import torch
from torch import nn, optim
import numpy as np
from utils import Storage, cuda, BaseModel, SummaryHelper, get_mean, storage_to_list, \
CheckpointManager
from network import Network
class Seq2seq(BaseModel):
def __init__(self, param):
args = param.a... | 30.023474 | 87 | 0.699609 |
import logging
import time
import os
import torch
from torch import nn, optim
import numpy as np
from utils import Storage, cuda, BaseModel, SummaryHelper, get_mean, storage_to_list, \
CheckpointManager
from network import Network
class Seq2seq(BaseModel):
def __init__(self, param):
args = param.args
net = Ne... | true | true |
1c1a69e57a75b8edf475c0c4bee1f5342b0880f2 | 700 | py | Python | src/sage/sets/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/sets/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/sets/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | from sage.misc.lazy_import import lazy_import
lazy_import('sage.sets.real_set', 'RealSet')
from .set import Set
from .integer_range import IntegerRange
from .non_negative_integers import NonNegativeIntegers
from .positive_integers import PositiveIntegers
from .finite_enumerated_set import FiniteEnumeratedSet
lazy_impor... | 43.75 | 78 | 0.875714 | from sage.misc.lazy_import import lazy_import
lazy_import('sage.sets.real_set', 'RealSet')
from .set import Set
from .integer_range import IntegerRange
from .non_negative_integers import NonNegativeIntegers
from .positive_integers import PositiveIntegers
from .finite_enumerated_set import FiniteEnumeratedSet
lazy_impor... | true | true |
1c1a6ae54209e564c9d5fe881656d546c79aeb27 | 123,755 | py | Python | packages/slycat/web/server/handlers.py | sandialabs/slycat | efbb91ce4ea4da08b58399eb820f6d6987408e44 | [
"BSD-3-Clause"
] | 66 | 2015-01-06T20:53:50.000Z | 2022-03-30T17:25:04.000Z | packages/slycat/web/server/handlers.py | sandialabs/slycat | efbb91ce4ea4da08b58399eb820f6d6987408e44 | [
"BSD-3-Clause"
] | 782 | 2015-01-05T15:42:30.000Z | 2022-03-11T03:27:52.000Z | packages/slycat/web/server/handlers.py | sandialabs/slycat | efbb91ce4ea4da08b58399eb820f6d6987408e44 | [
"BSD-3-Clause"
] | 23 | 2015-04-29T08:16:27.000Z | 2022-01-05T23:21:54.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
# DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
# retains certain rights in this software.
import traceback
import cherryp... | 41.64031 | 239 | 0.646148 |
import traceback
import cherrypy
import hashlib
import itertools
import json
import logging.handlers
import numbers
import numpy
import os
import time
import _pickle
import re
import slycat.hdf5
import slycat.hyperchunks
import slycat.uri
import slycat.web.server
import slycat.web.server.authentication
import slyc... | true | true |
1c1a6c6a8dd4282990bd66f30e60ceb4205367d7 | 6,950 | py | Python | controlm_client/models/user_data.py | apsinha-equinix/controlm-client | f24e0f935c82306074f4e4025cf62c217348dc3f | [
"MIT"
] | 1 | 2021-12-02T08:49:25.000Z | 2021-12-02T08:49:25.000Z | controlm_client/models/user_data.py | apsinha-equinix/controlm-client | f24e0f935c82306074f4e4025cf62c217348dc3f | [
"MIT"
] | null | null | null | controlm_client/models/user_data.py | apsinha-equinix/controlm-client | f24e0f935c82306074f4e4025cf62c217348dc3f | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.18.3
Contact: support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from controlm_client.model... | 27.042802 | 135 | 0.578129 |
import pprint
import re
import six
from controlm_client.models.authentication_data import AuthenticationData
from controlm_client.models.role_data import RoleData
class UserData(object):
swagger_types = {
'name': 'str',
'description': 'str',
'full_name': 'str',
'authen... | true | true |
1c1a6ff1480b14f857590938fa02223161bf6a94 | 1,088 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/framebuffer_multisample_coverage.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/framebuffer_multisample_coverage.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/framebuffer_multisample_coverage.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | 51.809524 | 133 | 0.835478 | from OpenGL import platform as _p, arrays
from OpenGL.raw.GL import _types as _cs
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_NV_framebuffer_multisample_coverage'
def _f( function ):
return _p.createF... | true | true |
1c1a7007802003958367eb7cba8febafab54fa5f | 4,862 | py | Python | sendook.py | faragoa/sendook | aaee5a2c3a0cea212d571358b9bfc0a472265202 | [
"Apache-2.0"
] | null | null | null | sendook.py | faragoa/sendook | aaee5a2c3a0cea212d571358b9bfc0a472265202 | [
"Apache-2.0"
] | null | null | null | sendook.py | faragoa/sendook | aaee5a2c3a0cea212d571358b9bfc0a472265202 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import time
import logging
import sys
# import RPi.GPIO as GPIO #using dynamic import instead for test running on standard PC
import importlib
global GPIO
global parser
parser = argparse.ArgumentParser()
def gpio_init(gpio):
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio, GPIO... | 29.828221 | 117 | 0.585356 |
import argparse
import time
import logging
import sys
se.ArgumentParser()
def gpio_init(gpio):
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio, GPIO.OUT)
def gpio_cleanup():
GPIO.cleanup()
def sleep_finegrain(delay):
logger = logging.getLogger()
_delay = delay / 100
logger.debug("Sleeping for " + ... | true | true |
1c1a70b623272b8d16e7f8b9c62f52b23752ddd7 | 421 | py | Python | evap/evaluation/migrations/0051_change_question_order_verbose.py | felixrindt/EvaP | fe65fcc511cc942695ce1edbaab170894f0d37b1 | [
"MIT"
] | 29 | 2020-02-28T23:03:41.000Z | 2022-02-19T09:29:36.000Z | evap/evaluation/migrations/0051_change_question_order_verbose.py | felixrindt/EvaP | fe65fcc511cc942695ce1edbaab170894f0d37b1 | [
"MIT"
] | 737 | 2015-01-02T17:43:25.000Z | 2018-12-10T20:45:10.000Z | evap/evaluation/migrations/0051_change_question_order_verbose.py | felixrindt/EvaP | fe65fcc511cc942695ce1edbaab170894f0d37b1 | [
"MIT"
] | 83 | 2015-01-14T12:39:41.000Z | 2018-10-29T16:36:43.000Z | # Generated by Django 1.9.2 on 2016-05-22 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0050_auto_20160509_1943'),
]
operations = [
migrations.AlterField(
model_name='question',
name='order'... | 22.157895 | 81 | 0.615202 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0050_auto_20160509_1943'),
]
operations = [
migrations.AlterField(
model_name='question',
name='order',
field=models.IntegerField(default... | true | true |
1c1a72db0566f188452b1ad4a004863eae3dcb7f | 14,533 | py | Python | corehq/apps/userreports/reports/filters/choice_providers.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/userreports/reports/filters/choice_providers.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/userreports/reports/filters/choice_providers.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from django.utils.translation import ugettext
from sqlalchemy import or_
from sqlalchemy.exc import ProgrammingError
from corehq.apps.es import GroupES, UserES
from corehq.apps.locations.models impor... | 35.795567 | 115 | 0.660566 | from __future__ import absolute_import
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from django.utils.translation import ugettext
from sqlalchemy import or_
from sqlalchemy.exc import ProgrammingError
from corehq.apps.es import GroupES, UserES
from corehq.apps.locations.models impor... | true | true |
1c1a733d6abc0de974c41da7c7dd9fc17046584d | 4,212 | py | Python | metashare/sync/views.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | 1 | 2017-07-10T08:15:07.000Z | 2017-07-10T08:15:07.000Z | metashare/sync/views.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | null | null | null | metashare/sync/views.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | 1 | 2018-07-03T07:55:56.000Z | 2018-07-03T07:55:56.000Z | from StringIO import StringIO
from django.http import HttpResponse
import json
from zipfile import ZipFile
from metashare import settings
from django.db.models import Q
from django.shortcuts import get_object_or_404
from metashare.storage.models import StorageObject, MASTER, PROXY, INTERNAL, \
REMOTE
def inventor... | 47.863636 | 102 | 0.721035 | from StringIO import StringIO
from django.http import HttpResponse
import json
from zipfile import ZipFile
from metashare import settings
from django.db.models import Q
from django.shortcuts import get_object_or_404
from metashare.storage.models import StorageObject, MASTER, PROXY, INTERNAL, \
REMOTE
def inventor... | true | true |
1c1a73e6a98a5efeaf8846a28604796fc365a83c | 7,297 | py | Python | sql-cli/src/opensearch_sql_cli/opensearch_connection.py | weicongs-amazon/sql-1 | ede1d14f06639333483a8cbb2f78ca935b67c4dd | [
"Apache-2.0"
] | null | null | null | sql-cli/src/opensearch_sql_cli/opensearch_connection.py | weicongs-amazon/sql-1 | ede1d14f06639333483a8cbb2f78ca935b67c4dd | [
"Apache-2.0"
] | null | null | null | sql-cli/src/opensearch_sql_cli/opensearch_connection.py | weicongs-amazon/sql-1 | ede1d14f06639333483a8cbb2f78ca935b67c4dd | [
"Apache-2.0"
] | null | null | null | """
SPDX-License-Identifier: Apache-2.0
The OpenSearch Contributors require contributions made to
this file be licensed under the Apache-2.0 license or a
compatible open source license.
Modifications Copyright OpenSearch Contributors. See
GitHub history for details.
"""
"""
Copyright 2020 Amazon.com, Inc. or its affi... | 37.420513 | 115 | 0.639578 | import boto3
import click
import logging
import ssl
import sys
import urllib3
from elasticsearch import Elasticsearch as OpenSearch, RequestsHttpConnection
from elasticsearch.exceptions import ConnectionError, RequestError
from elasticsearch.connection import create_ssl_context
from requests_aws4auth import AWS4Auth
... | true | true |
1c1a7591d200b87dcf241720f942c10d32509e2d | 3,084 | py | Python | brainda/algorithms/deep_learning/guney_net.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | 20 | 2022-02-07T12:13:58.000Z | 2022-03-25T06:40:43.000Z | brainda/algorithms/deep_learning/guney_net.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | 1 | 2022-03-09T06:18:03.000Z | 2022-03-12T05:22:05.000Z | brainda/algorithms/deep_learning/guney_net.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | 7 | 2022-02-08T01:52:33.000Z | 2022-03-11T06:51:32.000Z | # -*- coding: utf-8 -*-
"""
Guney's network proposed in A Deep Neural Network for SSVEP-based Brain-Computer Interfaces.
Modified from https://github.com/osmanberke/Deep-SSVEP-BCI.git
"""
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from .base import compute_... | 38.074074 | 98 | 0.616407 |
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from .base import compute_same_pad2d, _narrow_normal_weight_zero_bias, compute_out_size, SkorchNet
@SkorchNet
class GuneyNet(nn.Module):
def __init__(self, n_channels, n_samples, n_classes, n_bands,
n... | true | true |
1c1a75926e64201a64903d34cf091b1df62f4b6a | 16,005 | py | Python | disk_balance_test.py | tlasica/cassandra-dtest | 550c4ed1584428645b096efd224cc0af81214493 | [
"Apache-2.0"
] | null | null | null | disk_balance_test.py | tlasica/cassandra-dtest | 550c4ed1584428645b096efd224cc0af81214493 | [
"Apache-2.0"
] | null | null | null | disk_balance_test.py | tlasica/cassandra-dtest | 550c4ed1584428645b096efd224cc0af81214493 | [
"Apache-2.0"
] | null | null | null | import os
import os.path
import re
from time import sleep
import pytest
import logging
from ccmlib.node import Node
from dtest import Tester, create_ks
from tools.assertions import assert_almost_equal
from tools.data import create_c1c2_table, insert_c1c2, query_c1c2
from tools.jmxutils import (JolokiaAgent, make_mbea... | 43.729508 | 180 | 0.654171 | import os
import os.path
import re
from time import sleep
import pytest
import logging
from ccmlib.node import Node
from dtest import Tester, create_ks
from tools.assertions import assert_almost_equal
from tools.data import create_c1c2_table, insert_c1c2, query_c1c2
from tools.jmxutils import (JolokiaAgent, make_mbea... | true | true |
1c1a75c1505079f8e3ddd20c842ad468f22092fb | 644 | py | Python | yatube/posts/migrations/0005_auto_20220126_1319.py | HaRumiCoder/hw05_final | 95e4a5628838380630033f7531eef296185a52b5 | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/migrations/0005_auto_20220126_1319.py | HaRumiCoder/hw05_final | 95e4a5628838380630033f7531eef296185a52b5 | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/migrations/0005_auto_20220126_1319.py | HaRumiCoder/hw05_final | 95e4a5628838380630033f7531eef296185a52b5 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.9 on 2022-01-26 10:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posts", "0004_auto_20220123_2025"),
]
operations = [
migrations.AlterField(
model_name="group", name="slug", field=models.SlugFi... | 25.76 | 85 | 0.600932 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posts", "0004_auto_20220123_2025"),
]
operations = [
migrations.AlterField(
model_name="group", name="slug", field=models.SlugField(unique=True),
),
migrations... | true | true |
1c1a765cd83176db6e572d051b206dc100e6b672 | 9,047 | py | Python | src/gluonts/model/rotbaum/_predictor.py | kaijennissen/gluon-ts | 754fdd4184e2c19b8d667eb97d5ae20d486e3cd3 | [
"Apache-2.0"
] | 1 | 2020-11-30T18:05:24.000Z | 2020-11-30T18:05:24.000Z | src/gluonts/model/rotbaum/_predictor.py | kaijennissen/gluon-ts | 754fdd4184e2c19b8d667eb97d5ae20d486e3cd3 | [
"Apache-2.0"
] | null | null | null | src/gluonts/model/rotbaum/_predictor.py | kaijennissen/gluon-ts | 754fdd4184e2c19b8d667eb97d5ae20d486e3cd3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 35.478431 | 112 | 0.622306 |
from typing import Iterator, List, Optional
from pathlib import Path
import json
import numpy as np
import pandas as pd
from itertools import chain
import concurrent.futures
import logging
import gluonts
from gluonts.core.component import validated, equals
from gluonts.core import fqname_for
from glu... | true | true |
1c1a767f91a8bbdad527ab41020aa50c2ae3c71c | 2,338 | py | Python | MCMTranslate.py | chesko256/MCMTranslate | 8e8c8563b7add42a70330b4c5971aa045049c7f1 | [
"Unlicense"
] | 4 | 2016-03-27T04:55:42.000Z | 2019-04-29T17:44:36.000Z | MCMTranslate.py | chesko256/MCMTranslate | 8e8c8563b7add42a70330b4c5971aa045049c7f1 | [
"Unlicense"
] | null | null | null | MCMTranslate.py | chesko256/MCMTranslate | 8e8c8563b7add42a70330b4c5971aa045049c7f1 | [
"Unlicense"
] | null | null | null | import sys
import codecs
import ntpath
from googleapiclient.discovery import build
if len(sys.argv) < 2:
print "Usage: MCMTranslate.py [English MCM translation file] | [--help]"
sys.exit()
if sys.argv[1] == '--help':
print "Usage: MCMTranslate.py [English MCM translation file] | [--help]"
print "\n"
... | 32.929577 | 127 | 0.627459 | import sys
import codecs
import ntpath
from googleapiclient.discovery import build
if len(sys.argv) < 2:
print "Usage: MCMTranslate.py [English MCM translation file] | [--help]"
sys.exit()
if sys.argv[1] == '--help':
print "Usage: MCMTranslate.py [English MCM translation file] | [--help]"
print "\n"
... | false | true |
1c1a786704823c1cd6e4585d9787567346545f39 | 10,183 | py | Python | config/CExtendedSetup.py | namsonx/python-jsonpreprocessor | 09fa34e57cc09a227b68b11a4a89f6b2d52cec33 | [
"Apache-2.0"
] | 2 | 2021-12-20T02:49:39.000Z | 2021-12-22T01:50:49.000Z | config/CExtendedSetup.py | namsonx/python-jsonpreprocessor | 09fa34e57cc09a227b68b11a4a89f6b2d52cec33 | [
"Apache-2.0"
] | 1 | 2022-03-15T16:31:55.000Z | 2022-03-17T12:08:32.000Z | config/CExtendedSetup.py | namsonx/python-jsonpreprocessor | 09fa34e57cc09a227b68b11a4a89f6b2d52cec33 | [
"Apache-2.0"
] | 2 | 2022-01-13T08:35:51.000Z | 2022-02-15T05:36:57.000Z | # **************************************************************************************************************
#
# Copyright 2020-2022 Robert Bosch GmbH
#
# 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... | 40.090551 | 125 | 0.530688 |
import os, sys, platform, shlex, subprocess, shutil
import colorama as col
col.init(autoreset=True)
COLBR = col.Style.BRIGHT + col.Fore.RED
COLBY = col.Style.BRIGHT + col.Fore.YELLOW
COLBG = col.Style.BRIGHT + col.Fore.GREEN
SUCCESS = 0
ERROR = 1
def printerror(sMsg):
sys... | true | true |
1c1a797a680bc93e8b6fb499fb58d5ca2c268763 | 26,266 | py | Python | test/orm/test_options.py | davidjb/sqlalchemy | 3bd58fac7b607007cb42ab7e41d2e2d01fc390e2 | [
"MIT"
] | 1 | 2016-07-26T14:47:04.000Z | 2016-07-26T14:47:04.000Z | test/orm/test_options.py | davidjb/sqlalchemy | 3bd58fac7b607007cb42ab7e41d2e2d01fc390e2 | [
"MIT"
] | null | null | null | test/orm/test_options.py | davidjb/sqlalchemy | 3bd58fac7b607007cb42ab7e41d2e2d01fc390e2 | [
"MIT"
] | null | null | null | from sqlalchemy import inspect
from sqlalchemy.orm import attributes, mapper, relationship, backref, \
configure_mappers, create_session, synonym, Session, class_mapper, \
aliased, column_property, joinedload_all, joinedload, Query,\
util as orm_util, Load
import sqlalchemy as sa
from sqlalchemy import test... | 34.515112 | 91 | 0.594533 | from sqlalchemy import inspect
from sqlalchemy.orm import attributes, mapper, relationship, backref, \
configure_mappers, create_session, synonym, Session, class_mapper, \
aliased, column_property, joinedload_all, joinedload, Query,\
util as orm_util, Load
import sqlalchemy as sa
from sqlalchemy import test... | true | true |
1c1a7a0d6fa7b274abe29af2d45a9e40c8dd262e | 5,198 | py | Python | src/compas/geometry/_primitives/curve.py | robin-oval/compas | e4dc751e95648c5ffb9449f239f3879d39f19887 | [
"MIT"
] | 1 | 2019-03-27T22:32:56.000Z | 2019-03-27T22:32:56.000Z | src/compas/geometry/_primitives/curve.py | robin-oval/compas | e4dc751e95648c5ffb9449f239f3879d39f19887 | [
"MIT"
] | null | null | null | src/compas/geometry/_primitives/curve.py | robin-oval/compas | e4dc751e95648c5ffb9449f239f3879d39f19887 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from math import factorial
from compas.geometry.basic import scale_vector
from compas.geometry.basic import normalize_vector
from compas.geometry.basic import add_vectors
from compas.geometry.basic import subt... | 24.635071 | 83 | 0.531935 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from math import factorial
from compas.geometry.basic import scale_vector
from compas.geometry.basic import normalize_vector
from compas.geometry.basic import add_vectors
from compas.geometry.basic import subt... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.