hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f716683184b12be70591300c446fc7951aa0428a | 4,386 | py | Python | contrib/seeds/generate-seeds.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | FcoinFup/litecoin | f60e79f2bf373dafd258264ae197cee44ab4a314 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.328571 | 99 | 0.583903 |
from base64 import b32decode
from binascii import a2b_hex
import sys
import os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(a... | true | true |
f71669461b57160bac0b4efc0928e6826dc11176 | 15,093 | py | Python | tests/test_collections.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 72 | 2016-03-21T03:58:33.000Z | 2022-03-29T10:24:51.000Z | tests/test_collections.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 14 | 2016-03-21T03:58:39.000Z | 2021-09-07T16:26:03.000Z | tests/test_collections.py | fperetti/callee | 58740f73ff9a76f5fe0075bf18d7345a0f9d961c | [
"BSD-3-Clause"
] | 9 | 2016-10-26T14:39:00.000Z | 2021-08-13T17:39:35.000Z | """
Tests for collections' matchers.
"""
import collections
from taipan.testing import skipIf
from callee._compat import OrderedDict as _OrderedDict
import callee.collections as __unit__
from tests import MatcherTestCase
class Iterable(MatcherTestCase):
test_none = lambda self: self.assert_no_match(None)
te... | 38.899485 | 79 | 0.681309 | import collections
from taipan.testing import skipIf
from callee._compat import OrderedDict as _OrderedDict
import callee.collections as __unit__
from tests import MatcherTestCase
class Iterable(MatcherTestCase):
test_none = lambda self: self.assert_no_match(None)
test_zero = lambda self: self.assert_no_mat... | true | true |
f71669ba767a939cc5d439ef370d6333952c145a | 226 | py | Python | course_api/templatetags/time_converter.py | dragonbone81/bobcat-courses-backend | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 3 | 2018-10-25T12:41:33.000Z | 2019-09-19T19:47:39.000Z | course_api/templatetags/time_converter.py | dragonbone81/bobcat-courses-backend | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 22 | 2018-04-01T02:43:01.000Z | 2022-03-11T23:15:55.000Z | course_api/templatetags/time_converter.py | dragonbone81/cse120 | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 1 | 2019-09-19T19:48:59.000Z | 2019-09-19T19:48:59.000Z | from django.template.defaulttags import register
@register.filter
def get_item(dictionary, key):
return dictionary.get(key)
@register.filter
def get_item_dict(dictionary, key):
return {'data': dictionary.get(key)}
| 18.833333 | 48 | 0.761062 | from django.template.defaulttags import register
@register.filter
def get_item(dictionary, key):
return dictionary.get(key)
@register.filter
def get_item_dict(dictionary, key):
return {'data': dictionary.get(key)}
| true | true |
f71669f5529851928377789218c8de2abda6eaf6 | 5,513 | py | Python | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time: 2020/2/5,005 22:02
# @Last Update: 2020/2/5,005 22:02
# @Author: 徐缘
# @FileName: 2.practices_on_nlp.py
# @Software: PyCharm
from __future__ import absolute_import, division, print_function, unicode_literals # 导入一些熟悉的陌生人
# 绝对引入,精确除法,print,unicode类型字符串。都是为了适配python2,不加也罢
import nu... | 29.169312 | 108 | 0.643751 |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense, Flatten, Conv2D
from tensorflow.keras import Model
from tensorflow import keras
import tensorflow_hub as hub
import tensorflow_da... | true | true |
f7166a5ae2764771f45e5ae446f7d0e4b402bd2c | 3,231 | py | Python | test/test_default_api.py | cinaq/axxell-client-python | a862dd36552ef8149517c5d5034a52a37abc2d33 | [
"Apache-2.0"
] | null | null | null | test/test_default_api.py | cinaq/axxell-client-python | a862dd36552ef8149517c5d5034a52a37abc2d33 | [
"Apache-2.0"
] | null | null | null | test/test_default_api.py | cinaq/axxell-client-python | a862dd36552ef8149517c5d5034a52a37abc2d33 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
axxell-api
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
... | 18.357955 | 105 | 0.573197 |
from __future__ import absolute_import
import os
import sys
import unittest
import AxxellClient
from AxxellClient.rest import ApiException
from AxxellClient.apis.default_api import DefaultApi
class TestDefaultApi(unittest.TestCase):
def setUp(self):
self.api = AxxellClient.apis.default_api.DefaultAp... | true | true |
f7166ab579b24ca3fb29824e02008e934e83680a | 22,183 | py | Python | openmdao/components/interp_util/interp.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | null | null | null | openmdao/components/interp_util/interp.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | null | null | null | openmdao/components/interp_util/interp.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | null | null | null | """
Base class for interpolation methods that calculate values for each dimension independently.
Based on Tables in NPSS, and was added to bridge the gap between some of the slower scipy
implementations.
"""
import numpy as np
from openmdao.components.interp_util.interp_akima import InterpAkima, Interp1DAkima
from op... | 38.246552 | 100 | 0.580129 | import numpy as np
from openmdao.components.interp_util.interp_akima import InterpAkima, Interp1DAkima
from openmdao.components.interp_util.interp_bsplines import InterpBSplines
from openmdao.components.interp_util.interp_cubic import InterpCubic
from openmdao.components.interp_util.interp_lagrange2 import InterpLagra... | true | true |
f7166b29a260dc30035dc8c5f38d515125a10b02 | 1,410 | py | Python | data/shape_dataset.py | mremilien/object-deformnet | bb07fe05f1ee3983835ebe071252541cee5c42f8 | [
"MIT"
] | 66 | 2020-07-17T05:15:42.000Z | 2022-02-22T12:28:01.000Z | data/shape_dataset.py | mremilien/object-deformnet | bb07fe05f1ee3983835ebe071252541cee5c42f8 | [
"MIT"
] | 25 | 2020-07-17T11:45:16.000Z | 2022-02-07T06:11:44.000Z | data/shape_dataset.py | mremilien/object-deformnet | bb07fe05f1ee3983835ebe071252541cee5c42f8 | [
"MIT"
] | 16 | 2020-07-18T22:15:20.000Z | 2022-01-05T09:05:40.000Z | import h5py
import numpy as np
import torch.utils.data as data
class ShapeDataset(data.Dataset):
def __init__(self, h5_file, mode, n_points=2048, augment=False):
assert (mode == 'train' or mode == 'val'), 'Mode must be "train" or "val".'
self.mode = mode
self.n_points = n_points
se... | 35.25 | 97 | 0.576596 | import h5py
import numpy as np
import torch.utils.data as data
class ShapeDataset(data.Dataset):
def __init__(self, h5_file, mode, n_points=2048, augment=False):
assert (mode == 'train' or mode == 'val'), 'Mode must be "train" or "val".'
self.mode = mode
self.n_points = n_points
se... | true | true |
f7166b34ac455a0f2c35b9f39db244c8be3a6461 | 1,936 | py | Python | evalai/utils/urls.py | Ram81/evalai-cli | 3fee2108b013461b3de8aa354473ba6eaba6539b | [
"BSD-3-Clause"
] | null | null | null | evalai/utils/urls.py | Ram81/evalai-cli | 3fee2108b013461b3de8aa354473ba6eaba6539b | [
"BSD-3-Clause"
] | null | null | null | evalai/utils/urls.py | Ram81/evalai-cli | 3fee2108b013461b3de8aa354473ba6eaba6539b | [
"BSD-3-Clause"
] | null | null | null | from enum import Enum
class URLS(Enum):
login = "/api/auth/login"
challenge_list = "/api/challenges/challenge/all"
past_challenge_list = "/api/challenges/challenge/past"
future_challenge_list = "/api/challenges/challenge/future"
challenge_details = "/api/challenges/challenge/{}"
challenge_phas... | 53.777778 | 106 | 0.741736 | from enum import Enum
class URLS(Enum):
login = "/api/auth/login"
challenge_list = "/api/challenges/challenge/all"
past_challenge_list = "/api/challenges/challenge/past"
future_challenge_list = "/api/challenges/challenge/future"
challenge_details = "/api/challenges/challenge/{}"
challenge_phas... | true | true |
f7166c21c50fd68775ca54dcd3b3e04554955178 | 581 | py | Python | insta/migrations/0007_profile_editor.py | SheilaKamotho/InstaClone | 7dd644118dfb5523fa253d3454d4aa0f2f599c69 | [
"Unlicense",
"MIT"
] | null | null | null | insta/migrations/0007_profile_editor.py | SheilaKamotho/InstaClone | 7dd644118dfb5523fa253d3454d4aa0f2f599c69 | [
"Unlicense",
"MIT"
] | null | null | null | insta/migrations/0007_profile_editor.py | SheilaKamotho/InstaClone | 7dd644118dfb5523fa253d3454d4aa0f2f599c69 | [
"Unlicense",
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2020-10-19 10:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('insta', '0006_image_edit... | 26.409091 | 121 | 0.672978 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('insta', '0006_image_editor'),
]
operations = [
migrati... | true | true |
f7166c87d0624aa75acb312538b76c621625e86c | 7,883 | py | Python | .history/docs/conf_20191028085309.py | bkraft4257/kaggle_titanic | f29ea1773773109a867278c001dbd21a9f7b21dd | [
"MIT"
] | null | null | null | .history/docs/conf_20191028085309.py | bkraft4257/kaggle_titanic | f29ea1773773109a867278c001dbd21a9f7b21dd | [
"MIT"
] | null | null | null | .history/docs/conf_20191028085309.py | bkraft4257/kaggle_titanic | f29ea1773773109a867278c001dbd21a9f7b21dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# kaggle_titanic documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values... | 32.044715 | 80 | 0.708487 |
import os
import sys
extensions = []
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'kaggle_titanic'
# |version| and |release|, also used in various other places t... | true | true |
f7166ed99d1178bc1af8dfbf95b904d906ba4586 | 12,868 | py | Python | src/python/src/grpc/framework/assembly/implementations.py | jonywtf/grpc | 124f3c5a4b65bb88f13be7c68482eb83d945ad02 | [
"BSD-3-Clause"
] | 1 | 2022-01-14T04:25:01.000Z | 2022-01-14T04:25:01.000Z | src/python/src/grpc/framework/assembly/implementations.py | jonywtf/grpc | 124f3c5a4b65bb88f13be7c68482eb83d945ad02 | [
"BSD-3-Clause"
] | null | null | null | src/python/src/grpc/framework/assembly/implementations.py | jonywtf/grpc | 124f3c5a4b65bb88f13be7c68482eb83d945ad02 | [
"BSD-3-Clause"
] | 1 | 2022-01-14T04:25:02.000Z | 2022-01-14T04:25:02.000Z | # Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 40.465409 | 105 | 0.756062 |
import threading
from grpc.framework.assembly import interfaces
from grpc.framework.base import util as base_utilities
from grpc.framework.base.packets import implementations as tickets_implementations
from grpc.framework.base.packets import interfaces as tickets_interfaces
from grpc.... | true | true |
f7166f854ffcad07870a5030cb9bfd7720c7b846 | 4,685 | py | Python | relationships/relationship.py | emre/relationships | 9452af1dd2897a6b102c4a391c95b499622c2f28 | [
"MIT"
] | 85 | 2015-08-05T06:13:28.000Z | 2021-05-07T13:56:30.000Z | relationships/relationship.py | emre/relationships | 9452af1dd2897a6b102c4a391c95b499622c2f28 | [
"MIT"
] | 3 | 2015-08-06T05:50:37.000Z | 2015-08-07T05:31:50.000Z | relationships/relationship.py | emre/relationships | 9452af1dd2897a6b102c4a391c95b499622c2f28 | [
"MIT"
] | 7 | 2015-08-06T01:34:14.000Z | 2018-12-21T01:17:33.000Z |
import redis
from keys import key_list as default_key_list
class Relationship(object):
def __init__(self, redis_connection=None, key_list=None, actor=None):
if key_list:
self.key_list = default_key_list.copy()
self.key_list.update(key_list)
else:
self.key_l... | 31.655405 | 108 | 0.639488 |
import redis
from keys import key_list as default_key_list
class Relationship(object):
def __init__(self, redis_connection=None, key_list=None, actor=None):
if key_list:
self.key_list = default_key_list.copy()
self.key_list.update(key_list)
else:
self.key_l... | true | true |
f71670077ff7bfc22a95558c4ef9773e2b4a8e07 | 4,867 | py | Python | deeplearning_examples/loaders/Churn.py | dileep-kishore/deeplearning-examples | 2b230ea17f366f602044d44cc8abcac419d4e521 | [
"MIT"
] | null | null | null | deeplearning_examples/loaders/Churn.py | dileep-kishore/deeplearning-examples | 2b230ea17f366f602044d44cc8abcac419d4e521 | [
"MIT"
] | 321 | 2017-11-23T20:37:03.000Z | 2020-12-28T13:06:15.000Z | deeplearning_examples/loaders/Churn.py | dileep-kishore/deeplearning-examples | 2b230ea17f366f602044d44cc8abcac419d4e521 | [
"MIT"
] | null | null | null | # @Author: dileep
# @Last Modified by: dileep
from collections import OrderedDict
import os
from typing import Tuple, Iterable, Sequence, Dict, Union
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.model_selection import train_test_split
from . import... | 38.322835 | 97 | 0.589275 |
from collections import OrderedDict
import os
from typing import Tuple, Iterable, Sequence, Dict, Union
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.model_selection import train_test_split
from . import datapath
from ..preprocessing import Encoder
... | true | true |
f716709e2478d7522c2c591d1f65cf3807762b7e | 255 | py | Python | Project Euler/1_Multiples_of_3_and_5.py | Ashwanigupta9125/code-DS-ALGO | 49f6cf7d0c682da669db23619aef3f80697b352b | [
"MIT"
] | 36 | 2019-12-27T08:23:08.000Z | 2022-01-24T20:35:47.000Z | Project Euler/1_Multiples_of_3_and_5.py | Ashwanigupta9125/code-DS-ALGO | 49f6cf7d0c682da669db23619aef3f80697b352b | [
"MIT"
] | 10 | 2019-11-13T02:55:18.000Z | 2021-10-13T23:28:09.000Z | Project Euler/1_Multiples_of_3_and_5.py | Ashwanigupta9125/code-DS-ALGO | 49f6cf7d0c682da669db23619aef3f80697b352b | [
"MIT"
] | 53 | 2020-08-15T11:08:40.000Z | 2021-10-09T15:51:38.000Z | # If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
print(sum( i for i in range(1000) if i % 3 == 0 or i % 5 == 0 )) | 63.75 | 131 | 0.670588 |
print(sum( i for i in range(1000) if i % 3 == 0 or i % 5 == 0 )) | true | true |
f71671890da4aa3c0e2138334e26e8ab78927add | 451 | py | Python | musicbotv2/plugins/loader.py | dabolink/MusicBot | 38ab851b2c533e5bc703c4a4b3bb4af07059139f | [
"MIT"
] | null | null | null | musicbotv2/plugins/loader.py | dabolink/MusicBot | 38ab851b2c533e5bc703c4a4b3bb4af07059139f | [
"MIT"
] | null | null | null | musicbotv2/plugins/loader.py | dabolink/MusicBot | 38ab851b2c533e5bc703c4a4b3bb4af07059139f | [
"MIT"
] | null | null | null | import importlib
from typing import List
class ModuleInterface:
@staticmethod
def register() -> None:
"""Init the command"""
def import_module(name: str) -> ModuleInterface:
return importlib.import_module(name) # type: ignore
def load_commands(commands: List[str]) -> None:
for command_nam... | 22.55 | 56 | 0.678492 | import importlib
from typing import List
class ModuleInterface:
@staticmethod
def register() -> None:
def import_module(name: str) -> ModuleInterface:
return importlib.import_module(name)
def load_commands(commands: List[str]) -> None:
for command_name in commands:
print("loading command... | true | true |
f716730fc1f1eb3c334d8d580c59f6f1e1e87d19 | 793 | py | Python | setup.py | fginter/simstring-cuda | 7773bca1e3ecf6dd9eac8f7c007549d098539356 | [
"Apache-2.0"
] | 2 | 2022-02-02T13:47:32.000Z | 2022-02-10T04:30:38.000Z | setup.py | fginter/simstring-cuda | 7773bca1e3ecf6dd9eac8f7c007549d098539356 | [
"Apache-2.0"
] | 1 | 2022-02-10T04:40:00.000Z | 2022-02-10T04:40:00.000Z | setup.py | fginter/simstring-cuda | 7773bca1e3ecf6dd9eac8f7c007549d098539356 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='SimString-cuda',
version='0.1.0',
url='https://github.com/fginter/sim... | 37.761905 | 190 | 0.725095 | from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='SimString-cuda',
version='0.1.0',
url='https://github.com/fginter/sim... | true | true |
f716732d7832fd5fb2824492c9a76cc168282fea | 7,206 | bzl | Python | scala_proto/private/scalapb_aspect.bzl | majcherm-da/rules_scala | 78104d8014d4e4fc8f905cd34b91dfabd9a268c8 | [
"Apache-2.0"
] | null | null | null | scala_proto/private/scalapb_aspect.bzl | majcherm-da/rules_scala | 78104d8014d4e4fc8f905cd34b91dfabd9a268c8 | [
"Apache-2.0"
] | null | null | null | scala_proto/private/scalapb_aspect.bzl | majcherm-da/rules_scala | 78104d8014d4e4fc8f905cd34b91dfabd9a268c8 | [
"Apache-2.0"
] | null | null | null | load(
"//scala/private:common.bzl",
"write_manifest_file",
)
load("//scala/private:rule_impls.bzl", "compile_scala")
load("//scala_proto/private:proto_to_scala_src.bzl", "proto_to_scala_src")
ScalaPBAspectInfo = provider(fields = [
"proto_info",
"src_jars",
"output_files",
"java_info",
])
S... | 31.605263 | 119 | 0.614627 | load(
"//scala/private:common.bzl",
"write_manifest_file",
)
load("//scala/private:rule_impls.bzl", "compile_scala")
load("//scala_proto/private:proto_to_scala_src.bzl", "proto_to_scala_src")
ScalaPBAspectInfo = provider(fields = [
"proto_info",
"src_jars",
"output_files",
"java_info",
])
S... | true | true |
f7167381295d7b56237bfdcc1b5bedebfca834ed | 477 | py | Python | mac/pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationLine.py | albertz/music-player | d23586f5bf657cbaea8147223be7814d117ae73d | [
"BSD-2-Clause"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationLine.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Quartz/PyObjCTest/test_PDFAnnotationLine.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z |
from PyObjCTools.TestSupport import *
from Quartz.PDFKit import *
class TestPDFAnnotationLine (TestCase):
def testConstants(self):
self.assertEqual(kPDFLineStyleNone, 0)
self.assertEqual(kPDFLineStyleSquare, 1)
self.assertEqual(kPDFLineStyleCircle, 2)
self.assertEqual(kPDFLineStyle... | 29.8125 | 53 | 0.727463 |
from PyObjCTools.TestSupport import *
from Quartz.PDFKit import *
class TestPDFAnnotationLine (TestCase):
def testConstants(self):
self.assertEqual(kPDFLineStyleNone, 0)
self.assertEqual(kPDFLineStyleSquare, 1)
self.assertEqual(kPDFLineStyleCircle, 2)
self.assertEqual(kPDFLineStyle... | true | true |
f71673edb368999b65c6db4d94b46852b8198252 | 886 | py | Python | setup.py | olivier-m/django-graffle | e2049b048e0c7944022e99800ca8f241c7d849ba | [
"BSD-3-Clause"
] | 1 | 2015-10-21T21:09:39.000Z | 2015-10-21T21:09:39.000Z | setup.py | olivier-m/django-graffle | e2049b048e0c7944022e99800ca8f241c7d849ba | [
"BSD-3-Clause"
] | null | null | null | setup.py | olivier-m/django-graffle | e2049b048e0c7944022e99800ca8f241c7d849ba | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Django graffle released under the BSD license.
# See the LICENSE for more information.
from setuptools import setup, find_packages
version = '0.5'
packages = ['django_graffle'] + ['django_graffle.%s' % x for x in find_packages('django_graffle',)]
setup(
name='djan... | 30.551724 | 99 | 0.654628 |
from setuptools import setup, find_packages
version = '0.5'
packages = ['django_graffle'] + ['django_graffle.%s' % x for x in find_packages('django_graffle',)]
setup(
name='django_graffle',
version=version,
description='Graph your django views with Omnigraffle.',
author='Olivier Meunier',
aut... | true | true |
f716742ca70ffea5e8234ece3da288effc4a72ca | 5,631 | py | Python | tests/test_metrics/test_issue_metrics.py | Joshinn-io/augur | 6759204dbae2ebb992dcd8c1f05408b9206c4ba3 | [
"MIT"
] | 443 | 2018-09-19T00:30:36.000Z | 2022-03-31T11:39:13.000Z | tests/test_metrics/test_issue_metrics.py | Romelo-S/augur | e9410887f58af2b26c350edf08e3f70ff783bdc5 | [
"MIT"
] | 613 | 2018-09-19T18:31:13.000Z | 2022-03-31T05:41:16.000Z | tests/test_metrics/test_issue_metrics.py | Romelo-S/augur | e9410887f58af2b26c350edf08e3f70ff783bdc5 | [
"MIT"
] | 764 | 2018-10-17T01:08:10.000Z | 2022-03-31T05:25:01.000Z | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
def test_issues_new(metrics):
#repo_id
assert metrics.issues_new(1, 1 , period='year').iloc[0]['issues'] > 0
#repo_group_id
assert metrics.issues_new(10, period='year').iloc[1]['issues'] > 0
#begin_date & end_date
assert metrics... | 38.834483 | 142 | 0.672527 |
import pytest
import pandas as pd
def test_issues_new(metrics):
assert metrics.issues_new(1, 1 , period='year').iloc[0]['issues'] > 0
assert metrics.issues_new(10, period='year').iloc[1]['issues'] > 0
assert metrics.issues_new(10, 25430, period='week', begin_date='2017',
... | true | true |
f71676329ad1aa128a74b82803791f78a3149af3 | 1,831 | py | Python | pydescriptors/helpers.py | c-martinez/compactness | 679a1644e0cd3ded278e9917efe171b5e89fc780 | [
"Apache-2.0"
] | 9 | 2017-02-15T10:44:17.000Z | 2022-03-05T10:14:21.000Z | pydescriptors/helpers.py | c-martinez/compactness | 679a1644e0cd3ded278e9917efe171b5e89fc780 | [
"Apache-2.0"
] | 1 | 2021-11-22T02:31:37.000Z | 2021-11-22T10:33:39.000Z | pydescriptors/helpers.py | c-martinez/compactness | 679a1644e0cd3ded278e9917efe171b5e89fc780 | [
"Apache-2.0"
] | 4 | 2019-04-17T02:28:01.000Z | 2022-02-15T02:03:38.000Z | import numpy as _np
from .moments import immoment3D as _immoment3D
def getSphere(side):
"""Create a 3D volume of sideXsideXside, where voxels representing a
sphere are ones and background is zeros.
Keyword arguments:
side -- the number of voxels the 3D volume should have on each side.
Returns:
... | 26.926471 | 72 | 0.550519 | import numpy as _np
from .moments import immoment3D as _immoment3D
def getSphere(side):
volume = _np.zeros((side, side, side))
r = side / 2
Xs, Ys = _np.meshgrid(_np.arange(-r, r), _np.arange(-r, r))
for k, z in enumerate(_np.arange(-r, r)):
volume[:, :, k] = _np.sqrt(Xs ** 2 + Ys ** 2 + z ** ... | true | true |
f716766002a0b6aae9b9a89d8422883c38d8d8f9 | 19,179 | py | Python | tests/jobs/test_local_task_job.py | anitakar/airflow | fc32d36d44f9d36b30333ce0676f2f3a6b133619 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/jobs/test_local_task_job.py | anitakar/airflow | fc32d36d44f9d36b30333ce0676f2f3a6b133619 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/jobs/test_local_task_job.py | anitakar/airflow | fc32d36d44f9d36b30333ce0676f2f3a6b133619 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.531429 | 107 | 0.640388 |
import multiprocessing
import os
import time
import unittest
import uuid
from multiprocessing import Lock, Value
from unittest import mock
from unittest.mock import patch
import pytest
from airflow import settings
from airflow.exceptions import AirflowException, AirflowFailException
from airflow.exe... | true | true |
f71676683a6637366c41785b4c0e85fe9f8fcaf2 | 2,554 | py | Python | tests/test_submission.py | Uchimura85/wswp | 54b7e59390721cbd1e3ce0d7ed255af3c2b4511e | [
"MIT"
] | 4 | 2020-12-27T00:31:49.000Z | 2021-08-03T22:33:41.000Z | tests/test_submission.py | Uchimura85/wswp | 54b7e59390721cbd1e3ce0d7ed255af3c2b4511e | [
"MIT"
] | 1 | 2021-04-08T02:59:31.000Z | 2021-04-08T02:59:31.000Z | tests/test_submission.py | Uchimura85/wswp | 54b7e59390721cbd1e3ce0d7ed255af3c2b4511e | [
"MIT"
] | 1 | 2021-08-03T22:33:42.000Z | 2021-08-03T22:33:42.000Z | """Tests for submission functionality-- primarily if a submission
form is validated properly and passed to the backend.
"""
import pytest
import pathlib, json
from src.model import Activity, Submission
# Load in sample submissions and their expected status codes if they were submitted:
with open(pathlib.Path(__file__... | 43.288136 | 150 | 0.698904 |
import pytest
import pathlib, json
from src.model import Activity, Submission
with open(pathlib.Path(__file__).parent.absolute()/'data'/'sample_submissions_base.json') as samples:
json_data = json.load(samples)
sample_submissions = [pytest.param(x['submission'], x['status_code'], x.get('broken_field'), id=x[... | true | true |
f71678195657d243066d4e9b9ea9b1e9901b4130 | 4,061 | py | Python | scripts/Emdometrial/Statistics/mut_analysis.py | yaront/MutSig | 456dc793ab2dbd955b5cef098fd14539d428de0b | [
"Apache-2.0"
] | null | null | null | scripts/Emdometrial/Statistics/mut_analysis.py | yaront/MutSig | 456dc793ab2dbd955b5cef098fd14539d428de0b | [
"Apache-2.0"
] | null | null | null | scripts/Emdometrial/Statistics/mut_analysis.py | yaront/MutSig | 456dc793ab2dbd955b5cef098fd14539d428de0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 26 20:42:43 2018
@author: tomer
"""
#%%
# =================================================
# # Mutation per gene
# =================================================
import numpy as np
import pandas as pd
#%%
#tumor = sys.argv[1]
#tumor = tumor.... | 35.622807 | 217 | 0.676927 |
np
import pandas as pd
tumor = 'UCEC'
print("Starting: " + tumor)
mut_data = pd.read_table('./../../../databases/Endometrial/TCGA_MAFs/' + tumor + '.maf', sep = '\t')
bmi_data = pd.read_table('./../../../databases/Endometrial/information/TCGA_bmi_data.txt', sep = '\t')
pat_bmi = bmi_data[bmi_data['bmi']... | true | true |
f71678545058b774df26f6e4aec31a97d2933afd | 406 | py | Python | zerver/migrations/0062_default_timezone.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 17,004 | 2015-09-25T18:27:24.000Z | 2022-03-31T22:02:32.000Z | zerver/migrations/0062_default_timezone.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 20,344 | 2015-09-25T19:02:42.000Z | 2022-03-31T23:54:40.000Z | zerver/migrations/0062_default_timezone.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 7,271 | 2015-09-25T18:48:39.000Z | 2022-03-31T21:06:11.000Z | # Generated by Django 1.10.5 on 2017-03-16 12:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("zerver", "0061_userprofile_timezone"),
]
operations = [
migrations.AlterField(
model_name="userprofile",
name="timez... | 22.555556 | 62 | 0.608374 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("zerver", "0061_userprofile_timezone"),
]
operations = [
migrations.AlterField(
model_name="userprofile",
name="timezone",
field=models.CharField(default... | true | true |
f7167876873bfd4fe4f89c9dbfccf3393adb7076 | 1,589 | py | Python | expmgmt/utils/structures.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | expmgmt/utils/structures.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | expmgmt/utils/structures.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | # ===========================================================================
# dictionary.py -----------------------------------------------------------
# ===========================================================================
# function ----------------------------------------------------------------
# -----... | 38.756098 | 77 | 0.349276 |
def update_dict(a, b):
if a and b and isinstance(a, dict):
a.update(b)
return a
def get_dict_element(dict_list, field, query):
for item in dict_list:
if item[field] == query:
return item
return dict()
def get_dict_elements(dict_list, field, query, update... | true | true |
f71678a61c98b95204ecbdc16742b5edb4c3e82f | 458 | py | Python | dataset_results.py | polikutinevgeny/FrontsCNN | a9f48d5afcdd7e0fe561840d94af36c0fedf1c15 | [
"MIT"
] | 1 | 2019-12-28T08:40:44.000Z | 2019-12-28T08:40:44.000Z | dataset_results.py | polikutinevgeny/FrontsCNN | a9f48d5afcdd7e0fe561840d94af36c0fedf1c15 | [
"MIT"
] | null | null | null | dataset_results.py | polikutinevgeny/FrontsCNN | a9f48d5afcdd7e0fe561840d94af36c0fedf1c15 | [
"MIT"
] | null | null | null | import gc
import numpy as np
def dataset_results(dataset, model, binary=False):
x = np.array([dataset[i][0][0] for i in range(len(dataset))])
y_true = np.array([dataset[i][1][0] for i in range(len(dataset))])
y_pred = model.predict(x, batch_size=1, verbose=0).flatten()
if binary:
y_true = y_tr... | 28.625 | 70 | 0.626638 | import gc
import numpy as np
def dataset_results(dataset, model, binary=False):
x = np.array([dataset[i][0][0] for i in range(len(dataset))])
y_true = np.array([dataset[i][1][0] for i in range(len(dataset))])
y_pred = model.predict(x, batch_size=1, verbose=0).flatten()
if binary:
y_true = y_tr... | true | true |
f716792771771c2a540c7c03471ad8050e7db370 | 6,984 | py | Python | mbrl/env/pets_reacher.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | mbrl/env/pets_reacher.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | mbrl/env/pets_reacher.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | import os
from typing import Tuple
import numpy as np
from numpy.random import MT19937, RandomState, SeedSequence
import torch
from gym import utils
from gym.envs.mujoco import mujoco_env
class Reacher3DEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, task_id=None, hide_goal=False):
self.vie... | 37.751351 | 77 | 0.477663 | import os
from typing import Tuple
import numpy as np
from numpy.random import MT19937, RandomState, SeedSequence
import torch
from gym import utils
from gym.envs.mujoco import mujoco_env
class Reacher3DEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, task_id=None, hide_goal=False):
self.vie... | true | true |
f716795d8f15462f698be1ecce4ae982839d72ed | 2,091 | py | Python | src/front-door/azext_front_door/vendored_sdks/models/managed_rule_override.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2022-03-22T15:02:32.000Z | 2022-03-22T15:02:32.000Z | src/front-door/azext_front_door/vendored_sdks/models/managed_rule_override.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-02-10T22:04:59.000Z | 2021-02-10T22:04:59.000Z | src/front-door/azext_front_door/vendored_sdks/models/managed_rule_override.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-06-03T19:31:10.000Z | 2021-06-03T19:31:10.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 ... | 40.211538 | 78 | 0.636059 |
from msrest.serialization import Model
class ManagedRuleOverride(Model):
_validation = {
'rule_id': {'required': True},
}
_attribute_map = {
'rule_id': {'key': 'ruleId', 'type': 'str'},
'enabled_state': {'key': 'enabledState', 'type': 'str'},
'action': {'key': ... | true | true |
f71679d226b40ff0d00a91dabe615ef3a5c5b9e5 | 1,354 | py | Python | Asyncio/asyncio_queue.py | xlui/PythonExamples | 0389efb84e01dc1310bb2bab7aa2433c0e1b45c4 | [
"MIT"
] | null | null | null | Asyncio/asyncio_queue.py | xlui/PythonExamples | 0389efb84e01dc1310bb2bab7aa2433c0e1b45c4 | [
"MIT"
] | null | null | null | Asyncio/asyncio_queue.py | xlui/PythonExamples | 0389efb84e01dc1310bb2bab7aa2433c0e1b45c4 | [
"MIT"
] | null | null | null | # asyncio_queue.py
import asyncio
async def consumer(n, _queue):
""":type _queue asyncio.Queue"""
# print('consumer {}: waiting for item'.format(n))
while True:
print('consumer {}: waiting for item'.format(n))
item = await _queue.get()
print('consumer {}: has item {}'.format(n, it... | 28.208333 | 81 | 0.637371 |
import asyncio
async def consumer(n, _queue):
while True:
print('consumer {}: waiting for item'.format(n))
item = await _queue.get()
print('consumer {}: has item {}'.format(n, item))
if item is None:
_queue.task_done()
break
else:
... | true | true |
f71679e9a79db28502e7b077981e0b0b7bee67f6 | 37,770 | py | Python | apprise_api/api/views.py | adamus1red/apprise-api | 757adce17642a3dfaa2b2e3244e147911386dabb | [
"MIT"
] | 160 | 2019-10-27T19:39:01.000Z | 2022-03-30T21:43:16.000Z | apprise_api/api/views.py | adamus1red/apprise-api | 757adce17642a3dfaa2b2e3244e147911386dabb | [
"MIT"
] | 51 | 2019-12-25T12:28:11.000Z | 2022-03-31T23:57:30.000Z | apprise_api/api/views.py | adamus1red/apprise-api | 757adce17642a3dfaa2b2e3244e147911386dabb | [
"MIT"
] | 26 | 2020-01-10T14:58:01.000Z | 2022-02-19T03:02:28.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in th... | 36.074499 | 79 | 0.533625 |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
from django.views import View
from django.conf import settings
from django.utils.html import escape
from django.utils.decorators import method_decorator
from django.views.decorators.cach... | true | true |
f7167dafa438abb972d4d287944bf016ae2c3bf7 | 15,655 | py | Python | MuJoCo/modules/utils.py | mosesnah-shared/whip-project-targeting | 7f47598635f027e2cb05ad33b66ed67627d20329 | [
"BSD-3-Clause"
] | null | null | null | MuJoCo/modules/utils.py | mosesnah-shared/whip-project-targeting | 7f47598635f027e2cb05ad33b66ed67627d20329 | [
"BSD-3-Clause"
] | null | null | null | MuJoCo/modules/utils.py | mosesnah-shared/whip-project-targeting | 7f47598635f027e2cb05ad33b66ed67627d20329 | [
"BSD-3-Clause"
] | null | null | null | # [Built-in modules]
import os
import re
import sys
import shutil
import time, datetime
import math as myMath
import glob
# [3rd party modules]
import cv2
import numpy as np
import xml.etree.ElementTree as ET
import sympy as sp
from sympy.utilities.lambdify import lambdify, implemented_function
from... | 42.196765 | 846 | 0.570808 |
import os
import re
import sys
import shutil
import time, datetime
import math as myMath
import glob
import cv2
import numpy as np
import xml.etree.ElementTree as ET
import sympy as sp
from sympy.utilities.lambdify import lambdify, implemented_function
from scipy.special import lambertw
from sc... | true | true |
f7167e61cefc29e05e76cf5f35782284b46a20aa | 4,682 | py | Python | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.757009 | 133 | 0.65912 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f7167ea0d6c0f9e11b4a88a19c5af9d2c9a92a69 | 17,093 | py | Python | intersight/model/niatelemetry_supervisor_module_details.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/niatelemetry_supervisor_module_details.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/niatelemetry_supervisor_module_details.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 54.091772 | 1,678 | 0.639677 |
import re
import sys
from intersight.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def la... | true | true |
f7167ec21a6a129bda61142db392f78aae4d6960 | 271 | py | Python | tests/database.py | tophat/ormar-postgres-extensions | 88fcab5a73bc89090739c38f063191d8473957a5 | [
"Apache-2.0"
] | 6 | 2021-08-02T22:24:34.000Z | 2022-03-21T08:59:22.000Z | tests/database.py | tophat/ormar-postgres-extensions | 88fcab5a73bc89090739c38f063191d8473957a5 | [
"Apache-2.0"
] | 14 | 2021-08-03T00:03:55.000Z | 2022-02-17T02:10:08.000Z | tests/database.py | tophat/ormar-postgres-extensions | 88fcab5a73bc89090739c38f063191d8473957a5 | [
"Apache-2.0"
] | 2 | 2022-01-28T20:10:12.000Z | 2022-02-09T16:49:01.000Z | import databases
import sqlalchemy
DB_HOST = "localhost"
DB_NAME = "TEST_DATABASE"
DATABASE_URL = databases.DatabaseURL(
f"postgres://DEV_USER:DEV_PASSWORD@{DB_HOST}:5432/{DB_NAME}"
)
database = databases.Database(str(DATABASE_URL))
metadata = sqlalchemy.MetaData()
| 24.636364 | 64 | 0.782288 | import databases
import sqlalchemy
DB_HOST = "localhost"
DB_NAME = "TEST_DATABASE"
DATABASE_URL = databases.DatabaseURL(
f"postgres://DEV_USER:DEV_PASSWORD@{DB_HOST}:5432/{DB_NAME}"
)
database = databases.Database(str(DATABASE_URL))
metadata = sqlalchemy.MetaData()
| true | true |
f71680e22b485ad498455c52808137f6caab7e0c | 910 | py | Python | gammapy/stats/tests/test_significance.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | null | null | null | gammapy/stats/tests/test_significance.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:55:46.000Z | 2020-10-29T19:55:46.000Z | gammapy/stats/tests/test_significance.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from numpy.testing import assert_allclose
from ...stats import (
significance_to_probability_normal,
probability_to_significance_normal,
probability_to_significa... | 32.5 | 82 | 0.806593 |
from __future__ import absolute_import, division, print_function, unicode_literals
from numpy.testing import assert_allclose
from ...stats import (
significance_to_probability_normal,
probability_to_significance_normal,
probability_to_significance_normal_limit,
significance_to_probability_normal_limit,... | true | true |
f716815fb86995f906bd4284b72bbcf1851ecedc | 9,243 | py | Python | ros_pkg/dock/scripts/dock_generator.py | introlab/securbot | 0652ddf3e2dbcf0bb6ffcf76898749b67e443327 | [
"Apache-2.0"
] | 20 | 2019-03-13T13:37:51.000Z | 2022-01-25T16:56:35.000Z | ros_pkg/dock/scripts/dock_generator.py | introlab/securbot | 0652ddf3e2dbcf0bb6ffcf76898749b67e443327 | [
"Apache-2.0"
] | 15 | 2019-02-27T20:29:34.000Z | 2020-08-24T19:44:20.000Z | ros_pkg/dock/scripts/dock_generator.py | introlab/securbot | 0652ddf3e2dbcf0bb6ffcf76898749b67e443327 | [
"Apache-2.0"
] | 13 | 2019-07-31T00:47:49.000Z | 2021-04-15T01:33:02.000Z | #!/usr/bin/env python
"""Provide docking motivation layer node."""
import rospy
import json
import math
from enum import Enum
from threading import Lock
import tf
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Bool
from std_msgs.msg import Empty
from geometry_msgs.msg import PoseStamped... | 33.48913 | 80 | 0.612896 |
import rospy
import json
import math
from enum import Enum
from threading import Lock
import tf
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Bool
from std_msgs.msg import Empty
from geometry_msgs.msg import PoseStamped
from sensor_msgs.msg import BatteryState
from hbba_msgs.msg impor... | true | true |
f716825448eb20eaa87e600968288d77efb47ddf | 14,659 | py | Python | dataReader.py | tsfw/yolov3 | bf6d03d9a84a0ac1e94bcc4f9a026f7d32dfbdab | [
"Apache-2.0"
] | null | null | null | dataReader.py | tsfw/yolov3 | bf6d03d9a84a0ac1e94bcc4f9a026f7d32dfbdab | [
"Apache-2.0"
] | null | null | null | dataReader.py | tsfw/yolov3 | bf6d03d9a84a0ac1e94bcc4f9a026f7d32dfbdab | [
"Apache-2.0"
] | null | null | null | import os
import config
import json
import tensorflow as tf
import numpy as np
from collections import defaultdict
class Reader:
def __init__(self, mode, data_dir, anchors_path, num_classes, tfrecord_num = 12, input_shape = 416, max_boxes = 20):
"""
Introduction
------------
构造函... | 44.966258 | 209 | 0.548469 | import os
import config
import json
import tensorflow as tf
import numpy as np
from collections import defaultdict
class Reader:
def __init__(self, mode, data_dir, anchors_path, num_classes, tfrecord_num = 12, input_shape = 416, max_boxes = 20):
self.data_dir = data_dir
self.input_shape = input_sha... | true | true |
f71684275afc20018793ca67d49712a2693a0850 | 10,212 | py | Python | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | 1 | 2020-12-15T17:19:33.000Z | 2020-12-15T17:19:33.000Z | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | """ A3C in Code - Centralized/ Gobal Network Parameter Server/ Controller
Based On:
A3C Code as in the book Deep Reinforcement Learning, Chapter 12.
Runtime: Python 3.6.5
Dependencies: numpy, matplotlib, tensorflow (/ tensorflow-gpu), gym
DocStrings: GoogleStyle
Author : Mohit Sewak (p20150023@goa-bits-pilani.a... | 39.890625 | 158 | 0.665785 |
Agent_Type = 3
learning_rate = 0.0001
import multiprocessing
cores = multiprocessing.cpu_count()
ys.path.append(r'C:\Users\surface\Documents\Python\RL\MLxE\Mohit Sewak RL\Mohit12_A3C')
import time
import winsound
import logging
import os
import numpy as np
import matplotlib.pyplot as plt
logging.basicConfig... | true | true |
f716847b7e7f2b74e68a21c9fff18732128dc20b | 1,196 | py | Python | examples/cdv/plttraj.py | geflaspohler/deep-OTD | 0daec276669776952b5142149007175b8a3c4d87 | [
"MIT"
] | 1 | 2020-07-18T02:00:50.000Z | 2020-07-18T02:00:50.000Z | examples/cdv/plttraj.py | geflaspohler/deep-OTD | 0daec276669776952b5142149007175b8a3c4d87 | [
"MIT"
] | null | null | null | examples/cdv/plttraj.py | geflaspohler/deep-OTD | 0daec276669776952b5142149007175b8a3c4d87 | [
"MIT"
] | 3 | 2019-11-28T04:15:59.000Z | 2020-03-27T16:15:36.000Z | import numpy as np
import matplotlib
from matplotlib import pyplot as plt
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.size'] = 9
ndim = 6
data = np.genfromtxt('dOTD_tst1.out')
xticks = [900, 1100, 1300]
yticks = [[0.7, 0.8, 0.9, 1],
[-0.2, 0, 0.2, 0.4],
[-0.5, 0, 0.... | 29.170732 | 64 | 0.591137 | import numpy as np
import matplotlib
from matplotlib import pyplot as plt
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.size'] = 9
ndim = 6
data = np.genfromtxt('dOTD_tst1.out')
xticks = [900, 1100, 1300]
yticks = [[0.7, 0.8, 0.9, 1],
[-0.2, 0, 0.2, 0.4],
[-0.5, 0, 0.... | true | true |
f7168651a64c6d1d8e833e8659ea210c7750b724 | 662 | py | Python | exercicio55Corrigido.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | exercicio55Corrigido.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | exercicio55Corrigido.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | '''maior = 0
menor = 0
for p in range(1, 6):
peso = float(input('digite o {}o peso '.format(p)))
if p == 1:
menor = peso
maior = peso
else:
if peso >= maior:
maior = peso
if peso < menor:
menor = peso
print('O maior peso registrado foi {:.1f}kg \nO men... | 28.782609 | 105 | 0.575529 |
lst=[]
for c in range(1, 6):
peso=float(input('Peso da {}ª pessoa: '.format(c)))
lst+=[peso]
print('')
print('O Maior peso foi:', max(lst))
print('O Menor peso foi:', min(lst))
| true | true |
f71686608991387d6cf7844d049a4fbe7531d303 | 1,071 | py | Python | learning/set-background-image-v2.py | CrtomirJuren/pyfirmata-arduino | 020873972d119955e80387f44bcc193ad0b460a6 | [
"MIT"
] | null | null | null | learning/set-background-image-v2.py | CrtomirJuren/pyfirmata-arduino | 020873972d119955e80387f44bcc193ad0b460a6 | [
"MIT"
] | null | null | null | learning/set-background-image-v2.py | CrtomirJuren/pyfirmata-arduino | 020873972d119955e80387f44bcc193ad0b460a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 25 15:21:34 2021
@author: crtjur
"""
import tkinter as tk
from PIL import Image, ImageTk
root = tk.Tk()
root.title("Title")
root.geometry("280x350")
root.configure(background="black")
class Example(tk.Frame):
def __init__(self, master, *pargs):
tk.Frame.__i... | 24.340909 | 69 | 0.674136 |
import tkinter as tk
from PIL import Image, ImageTk
root = tk.Tk()
root.title("Title")
root.geometry("280x350")
root.configure(background="black")
class Example(tk.Frame):
def __init__(self, master, *pargs):
tk.Frame.__init__(self, master, *pargs)
self.image = Image.open("diagram-v2.png")
... | true | true |
f716868e337d9c56b7761e3167f53df728c5c6c1 | 4,185 | py | Python | tools/train.py | nikhilrayaprolu/food-version2 | 5fe558ba96be34e52e48ee60bdde2298245a769e | [
"Apache-2.0"
] | null | null | null | tools/train.py | nikhilrayaprolu/food-version2 | 5fe558ba96be34e52e48ee60bdde2298245a769e | [
"Apache-2.0"
] | null | null | null | tools/train.py | nikhilrayaprolu/food-version2 | 5fe558ba96be34e52e48ee60bdde2298245a769e | [
"Apache-2.0"
] | 1 | 2020-12-22T08:38:56.000Z | 2020-12-22T08:38:56.000Z | from __future__ import division
import argparse
import os
import os.path as osp
import time
import mmcv
import torch
from mmcv import Config
from mmcv.runner import init_dist
from mmdet import __version__
from mmdet.apis import set_random_seed, train_detector
from mmdet.datasets import build_dataset
from mmdet.models... | 32.952756 | 77 | 0.6681 | from __future__ import division
import argparse
import os
import os.path as osp
import time
import mmcv
import torch
from mmcv import Config
from mmcv.runner import init_dist
from mmdet import __version__
from mmdet.apis import set_random_seed, train_detector
from mmdet.datasets import build_dataset
from mmdet.models... | true | true |
f71687e21d8ea9780570ef161a23f33fdc061d2f | 2,837 | py | Python | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-115-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | 1 | 2021-07-08T14:02:12.000Z | 2021-07-08T14:02:12.000Z | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-115-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | samples/basic/executor/models/cisco-ios-xr/Cisco-IOS-XR-snmp-test-trap-act/nc-execute-xr-snmp-test-trap-act-115-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... | 34.180723 | 87 | 0.673599 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import ExecutorService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_snmp_test_trap_act \
as xr_snmp_test_trap_act
import logging
def prepare_sonet_line_status... | true | true |
f7168881dda3037f1831c4695a51ad6b12964680 | 963 | py | Python | membership/forms.py | carpentries/membershipdb | 9f6270cea7251c490686926f041e21a929218e6c | [
"MIT"
] | 3 | 2018-05-31T16:09:52.000Z | 2018-09-30T21:35:06.000Z | membership/forms.py | carpentries/membershipdb | 9f6270cea7251c490686926f041e21a929218e6c | [
"MIT"
] | 5 | 2018-06-19T21:51:16.000Z | 2020-01-19T20:18:48.000Z | membership/forms.py | carpentries/membershipdb | 9f6270cea7251c490686926f041e21a929218e6c | [
"MIT"
] | 1 | 2020-07-07T03:23:34.000Z | 2020-07-07T03:23:34.000Z | """Membership forms module
"""
from django.forms import ModelForm
from .models import Note, Term, Organization, Contact, Membership
class NoteForm(ModelForm):
"""Note Form
"""
class Meta:
model = Note
fields = ['title', 'content', 'date_time']
class TermForm(ModelForm):
"""Term Form
... | 19.26 | 65 | 0.553479 | from django.forms import ModelForm
from .models import Note, Term, Organization, Contact, Membership
class NoteForm(ModelForm):
class Meta:
model = Note
fields = ['title', 'content', 'date_time']
class TermForm(ModelForm):
class Meta:
model = Term
fields = ['mem_type', 'n_wor... | true | true |
f71688edd94f6768ac57dec0eba3a526f1529856 | 28,910 | py | Python | sdk/python/pulumi_azure_native/insights/v20150501/component.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/insights/v20150501/component.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/insights/v20150501/component.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 46.779935 | 651 | 0.661397 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
__all__ = ['ComponentArgs', 'Component']
@pulumi.input_type
class ComponentArgs:
def __init__(__self__, *,
... | true | true |
f7168a4422b050f7d1300a0db6bbaf4282e7bd75 | 1,953 | py | Python | jungle/code/sorting.py | nate-russell/Jungle | 114d744ed66fec11b8d5e62444253892a7ffa5cd | [
"MIT"
] | null | null | null | jungle/code/sorting.py | nate-russell/Jungle | 114d744ed66fec11b8d5e62444253892a7ffa5cd | [
"MIT"
] | 4 | 2017-12-28T02:07:33.000Z | 2018-01-04T06:38:43.000Z | jungle/code/sorting.py | nate-russell/Jungle | 114d744ed66fec11b8d5e62444253892a7ffa5cd | [
"MIT"
] | null | null | null | '''
Sorting Examples for showcasing and developing Jungle features
'''
import inspect
from jungle import JungleExperiment, JungleProfiler
import numpy as np
print('Finished Loading Modules')
class Sorting_Prototype:
print('\n---Test Sort N---')
@JungleExperiment(reps=1, n=[100, 500])
def test_sort_n(self... | 24.721519 | 100 | 0.63236 | import inspect
from jungle import JungleExperiment, JungleProfiler
import numpy as np
print('Finished Loading Modules')
class Sorting_Prototype:
print('\n---Test Sort N---')
@JungleExperiment(reps=1, n=[100, 500])
def test_sort_n(self, n=100, seed=1234):
np.random.seed(seed)
list... | true | true |
f7168a45d1129bfe9f7ee66ee3c14b06f2b75b19 | 432 | py | Python | exercicios/ex052.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | exercicios/ex052.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | exercicios/ex052.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | n = int(input('Digite um número inteiro: '))
cont = 0
for c in range(1, n + 1):
if n % c == 0:
print('\033[034m{}\033[m'.format(c), end=' ')
cont += 1
else:
print('\033[031m{}\033[m'.format(c), end=' ')
print('\nO número {} foi divisível {} vezes '.format(n, cont))
if cont == 2:
... | 24 | 62 | 0.546296 | n = int(input('Digite um número inteiro: '))
cont = 0
for c in range(1, n + 1):
if n % c == 0:
print('\033[034m{}\033[m'.format(c), end=' ')
cont += 1
else:
print('\033[031m{}\033[m'.format(c), end=' ')
print('\nO número {} foi divisível {} vezes '.format(n, cont))
if cont == 2:
... | true | true |
f7168a487b6bc455015981782fb336330a0490cd | 26,905 | py | Python | src/sage/rings/polynomial/flatten.py | nikmihale/sage | e2dcdeeabb578c37bcf0361c0be3079315e9252c | [
"BSL-1.0"
] | null | null | null | src/sage/rings/polynomial/flatten.py | nikmihale/sage | e2dcdeeabb578c37bcf0361c0be3079315e9252c | [
"BSL-1.0"
] | null | null | null | src/sage/rings/polynomial/flatten.py | nikmihale/sage | e2dcdeeabb578c37bcf0361c0be3079315e9252c | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Class to flatten polynomial rings over polynomial ring
For example ``QQ['a','b'],['x','y']`` flattens to ``QQ['a','b','x','y']``.
EXAMPLES::
sage: R = QQ['x']['y']['s','t']['X']
sage: from sage.rings.polynomial.flatten import FlatteningMorphism
sage: phi = FlatteningMorphism(... | 39.918398 | 179 | 0.55551 |
from __future__ import absolute_import, print_function
import itertools
from sage.categories.homset import Homset
from sage.categories.morphism import Morphism
from sage.misc.cachefunc import cached_method
from .polynomial_ring_constructor import PolynomialRing
from .polynomial_ring import is_PolynomialRin... | true | true |
f7168ba8849334a57d1b394944e515d207126631 | 19,617 | py | Python | main.py | gmathez/Project_ADA_2018_Bruttin_Mathez_Petitpierre | e237300b3d9fb966b0eb747dd66816cc6cfc11b3 | [
"Apache-2.0"
] | 1 | 2018-12-01T12:17:58.000Z | 2018-12-01T12:17:58.000Z | main.py | gmathez/Project_ADA_2018_Bruttin_Mathez_Petitpierre | e237300b3d9fb966b0eb747dd66816cc6cfc11b3 | [
"Apache-2.0"
] | null | null | null | main.py | gmathez/Project_ADA_2018_Bruttin_Mathez_Petitpierre | e237300b3d9fb966b0eb747dd66816cc6cfc11b3 | [
"Apache-2.0"
] | null | null | null | # Import kivy tools
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.recycleboxlayout import RecycleBoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.checkbox import CheckBox
from kivy.uix.spinner import ... | 39.470825 | 116 | 0.568181 |
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.recycleboxlayout import RecycleBoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.checkbox import CheckBox
from kivy.uix.spinner import Spinner
from kivy.u... | true | true |
f7168bb426ad7afb8dbd70d8b80b3ec7a14dbc4b | 28,177 | py | Python | sppas/sppas/src/ui/phoenix/page_files/associate.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/phoenix/page_files/associate.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/phoenix/page_files/associate.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | """
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | \ analysis
___/... | 35.894268 | 119 | 0.509245 |
import wx
import logging
from sppas import sppasTypeError
from sppas import sg
from sppas.src.config import ui_translation
from sppas.src.files import FileData
from sppas.src.files import States
from sppas.src.files import sppasFileDataFilters
from ..dialogs import Information, Error
from ..windows import sppasStati... | true | true |
f7168c18be9b4f3d5729f54a2173850564c1755b | 617 | py | Python | src/DoorControl_manual.py | oulkaid/MoSIG-SystemDesign-WCET | bbe640ebbad7a372e4bd826a3334a69f3aca28e7 | [
"MIT"
] | null | null | null | src/DoorControl_manual.py | oulkaid/MoSIG-SystemDesign-WCET | bbe640ebbad7a372e4bd826a3334a69f3aca28e7 | [
"MIT"
] | null | null | null | src/DoorControl_manual.py | oulkaid/MoSIG-SystemDesign-WCET | bbe640ebbad7a372e4bd826a3334a69f3aca28e7 | [
"MIT"
] | null | null | null |
start_addr = []
next_addr = []
start_addr.append(['8478'])
next_addr.append(['84a4','8498'])
start_addr.append(['8498'])
next_addr.append(['84b0','84a4'])
start_addr.append(['84a4'])
next_addr.append(['84b0'])
start_addr.append(['84b0'])
next_addr.append(['84e0','84d4'])
start_addr.append(['84d4'])
next_addr.app... | 20.566667 | 117 | 0.648298 |
start_addr = []
next_addr = []
start_addr.append(['8478'])
next_addr.append(['84a4','8498'])
start_addr.append(['8498'])
next_addr.append(['84b0','84a4'])
start_addr.append(['84a4'])
next_addr.append(['84b0'])
start_addr.append(['84b0'])
next_addr.append(['84e0','84d4'])
start_addr.append(['84d4'])
next_addr.app... | true | true |
f7168c43af7fe79343018a0288432cf66f89741a | 1,124 | py | Python | app/auth/views.py | 0xff-dev/SutAcmDRA | f3e744c19f66f930deb3f921b75d5f1189354b41 | [
"MIT"
] | 2 | 2018-07-16T16:14:32.000Z | 2018-07-23T06:48:29.000Z | app/auth/views.py | 0xff-dev/SutAcmDRA | f3e744c19f66f930deb3f921b75d5f1189354b41 | [
"MIT"
] | 3 | 2021-06-08T19:23:40.000Z | 2021-12-13T19:56:54.000Z | app/auth/views.py | stevenshuang/SutAcmDRA | f3e744c19f66f930deb3f921b75d5f1189354b41 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from flask import render_template, request
from flask import redirect, url_for, flash
from flask_login import login_user
from flask_login import login_required
from flask_login import logout_user
from . import auth
from ..models import User
from .. import logger
@auth.route('/log... | 28.1 | 72 | 0.6379 |
from flask import render_template, request
from flask import redirect, url_for, flash
from flask_login import login_user
from flask_login import login_required
from flask_login import logout_user
from . import auth
from ..models import User
from .. import logger
@auth.route('/login', methods=['GET', 'POST'])
def l... | true | true |
f7168e80f5e8ed5edf7f7288316f9a3d0d8192e3 | 5,675 | py | Python | nimiqclient/models/block.py | rraallvv/python-client | 65d0c3f835ed8ce3ba6bfa2565cac61f7da6b748 | [
"Apache-2.0"
] | 4 | 2020-11-03T21:13:13.000Z | 2022-01-18T08:40:27.000Z | nimiqclient/models/block.py | rraallvv/python-client | 65d0c3f835ed8ce3ba6bfa2565cac61f7da6b748 | [
"Apache-2.0"
] | 1 | 2020-08-09T21:36:02.000Z | 2020-08-09T21:36:02.000Z | nimiqclient/models/block.py | rraallvv/python-client | 65d0c3f835ed8ce3ba6bfa2565cac61f7da6b748 | [
"Apache-2.0"
] | 1 | 2020-08-03T01:05:44.000Z | 2020-08-03T01:05:44.000Z | __all__ = ["Block", "BlockTemplateHeader", "BlockTemplateBody", "BlockTemplate"]
from .transaction import Transaction
class Block:
"""
Block returned by the server.
:param number: Height of the block.
:type number: int
:param hash: Hex-encoded 32-byte hash of the block.
:type hash: str
:... | 34.815951 | 166 | 0.66185 | __all__ = ["Block", "BlockTemplateHeader", "BlockTemplateBody", "BlockTemplate"]
from .transaction import Transaction
class Block:
def __init__(
self,
number,
hash,
pow,
parentHash,
nonce,
bodyHash,
accountsHash,
difficulty,
timesta... | true | true |
f7168f6333b407972ae83a3eb73553f078b2cd44 | 7,304 | py | Python | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | r"""
Kazhdan-Lusztig Polynomials
AUTHORS:
- Daniel Bump (2008): initial version
- Alan J.X. Guo (2014-03-18): ``R_tilde()`` method.
"""
#*****************************************************************************
# Copyright (C) 2008 Daniel Bump <bump at match.stanford.edu>
#
# This program is free softwar... | 32.035088 | 92 | 0.529299 |
from __future__ import absolute_import, print_function, division
from sage.rings.polynomial.polynomial_element import is_Polynomial
from sage.misc.cachefunc import cached_method
from sage.rings.polynomial.laurent_polynomial import LaurentPolynomial
from sage.structure.sage_object import SageObject
from sage... | true | true |
f716900640c20a86067bea4f88ec8a40a962d91a | 1,771 | py | Python | server/apps/widgets/serializers/widget.py | Sergey-x/SibdevPractice | 12e3f7e704af93911a0c4a66aad60733d2121e15 | [
"MIT"
] | null | null | null | server/apps/widgets/serializers/widget.py | Sergey-x/SibdevPractice | 12e3f7e704af93911a0c4a66aad60733d2121e15 | [
"MIT"
] | null | null | null | server/apps/widgets/serializers/widget.py | Sergey-x/SibdevPractice | 12e3f7e704af93911a0c4a66aad60733d2121e15 | [
"MIT"
] | null | null | null | from datetime import timedelta
from rest_framework import serializers
from ..models.widget import Widget
class BaseWidgetSerializer(serializers.ModelSerializer):
"""
This is the base serializer class for Widget model.
Other widget serializers must be inherited from it.
"""
class Meta:
m... | 24.943662 | 79 | 0.579898 | from datetime import timedelta
from rest_framework import serializers
from ..models.widget import Widget
class BaseWidgetSerializer(serializers.ModelSerializer):
class Meta:
model = Widget
fields = (
'id',
'category',
'limit',
'duration',
... | true | true |
f716900a4d34d8a8bb3af91bb18c52ab94dfe78e | 2,563 | py | Python | src/server.py | alamminsalo/lua-webshop | 2f0f1123a9d693103c4dbaef02836777e779844c | [
"MIT"
] | 1 | 2016-09-12T16:16:33.000Z | 2016-09-12T16:16:33.000Z | src/server.py | alamminsalo/py-webshop | 2f0f1123a9d693103c4dbaef02836777e779844c | [
"MIT"
] | null | null | null | src/server.py | alamminsalo/py-webshop | 2f0f1123a9d693103c4dbaef02836777e779844c | [
"MIT"
] | null | null | null |
# Restfull api using falcon framework
from wsgiref import simple_server
import falcon
import json
#Resource endpoints import
from cartsResource import *
from productsResource import *
# Check that client has application/json in Accept header
# and Content-Type, if request has body
class RequireJSON(object):
d... | 29.802326 | 81 | 0.60359 |
from wsgiref import simple_server
import falcon
import json
from cartsResource import *
from productsResource import *
class RequireJSON(object):
def process_request(self, req, resp):
if not req.client_accepts_json:
raise falcon.HTTPNotAcceptable(
'This API only support... | true | true |
f7169146ec3baeb91915b19f26b91545909663f8 | 149 | py | Python | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | foundation/migrate.py | shreyashah115/foundation | 42f19d23cfda77bae533f4884aecc15b3cd07f14 | [
"MIT"
] | null | null | null | import frappe
from frappe.database import Database
from markdown2 import markdown
from frappe.utils import validate_email_add
def migrate():
pass
| 16.555556 | 43 | 0.832215 | import frappe
from frappe.database import Database
from markdown2 import markdown
from frappe.utils import validate_email_add
def migrate():
pass
| true | true |
f716914b86089ef9a2f697d9a1dfeb32bd90f95f | 599 | py | Python | HelloWorld/Models/admin.py | xautshuanglong/PythonWebApp | 68ae417121740e4115f0e56c12a2a4831df30fc1 | [
"MIT"
] | null | null | null | HelloWorld/Models/admin.py | xautshuanglong/PythonWebApp | 68ae417121740e4115f0e56c12a2a4831df30fc1 | [
"MIT"
] | null | null | null | HelloWorld/Models/admin.py | xautshuanglong/PythonWebApp | 68ae417121740e4115f0e56c12a2a4831df30fc1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from Models.models import UserInfo, Question, Choice
admin.site.register(UserInfo)
# admin.site.register(Question)
# admin.site.register(Choice)
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fi... | 23.038462 | 80 | 0.661102 | from django.contrib import admin
from Models.models import UserInfo, Question, Choice
admin.site.register(UserInfo)
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
... | true | true |
f71693818cb726573e4d1f282b8d61fe8a87df6b | 678 | py | Python | resource-timing/resources/fake_responses.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2022-03-19T09:43:35.000Z | 2022-03-19T09:43:35.000Z | resource-timing/resources/fake_responses.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T19:49:45.000Z | 2021-12-13T19:49:45.000Z | resource-timing/resources/fake_responses.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2021-04-06T20:06:58.000Z | 2021-04-06T20:06:58.000Z | # /xhr/resources/conditional.py -- to fake a 304 response
def main(request, response):
tag = request.GET.first("tag", None)
match = request.headers.get("If-None-Match", None)
date = request.GET.first("date", "")
modified = request.headers.get("If-Modified-Since", None)
if tag:
response.head... | 35.684211 | 61 | 0.613569 |
def main(request, response):
tag = request.GET.first("tag", None)
match = request.headers.get("If-None-Match", None)
date = request.GET.first("date", "")
modified = request.headers.get("If-Modified-Since", None)
if tag:
response.headers.set("ETag", '"%s"' % tag)
elif date:
resp... | true | true |
f71695c7f499b72a9e1e239c8622fe0294a9c60f | 3,752 | py | Python | personal/Ervin/run_knn_collaborative_item.py | edervishaj/spotify-recsys-challenge | 4077201ac7e4ed9da433bd10a92c183614182437 | [
"Apache-2.0"
] | 3 | 2018-10-12T20:19:57.000Z | 2019-12-11T01:11:38.000Z | personal/Ervin/run_knn_collaborative_item.py | kiminh/spotify-recsys-challenge | 5e7844a77ce3c26658400f161d2d74d682f30e69 | [
"Apache-2.0"
] | null | null | null | personal/Ervin/run_knn_collaborative_item.py | kiminh/spotify-recsys-challenge | 5e7844a77ce3c26658400f161d2d74d682f30e69 | [
"Apache-2.0"
] | 4 | 2018-10-27T20:30:18.000Z | 2020-10-14T07:43:27.000Z | from utils.datareader import Datareader
from utils.evaluator import Evaluator
from utils.submitter import Submitter
from utils.post_processing import eurm_to_recommendation_list_submission
from utils.post_processing import eurm_to_recommendation_list
from utils.pre_processing import norm_l1_row, norm_max_row, norm_ma... | 32.912281 | 140 | 0.676972 | from utils.datareader import Datareader
from utils.evaluator import Evaluator
from utils.submitter import Submitter
from utils.post_processing import eurm_to_recommendation_list_submission
from utils.post_processing import eurm_to_recommendation_list
from utils.pre_processing import norm_l1_row, norm_max_row, norm_ma... | true | true |
f71695f6ec0e1e0a59e525bb30d5fb132322b04b | 564 | py | Python | wagtail/core/migrations/0036_populate_page_last_published_at.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/core/migrations/0036_populate_page_last_published_at.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/core/migrations/0036_populate_page_last_published_at.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-01 11:03
from django.db import migrations
from django.db.models import F
def forwards_func(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
Page.objects.filter(has_unpublished_changes=False).update(last_published_at=F('latest_re... | 26.857143 | 112 | 0.719858 |
from django.db import migrations
from django.db.models import F
def forwards_func(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
Page.objects.filter(has_unpublished_changes=False).update(last_published_at=F('latest_revision_created_at'))
class Migration(migrations.Migration):
depe... | true | true |
f71696347edb214d95d4dd5dbb9b50d0df5285c4 | 5,287 | py | Python | integration-testing/test/test_multiple_deploys.py | ArturGajowy/rchain | 7785a9195a4863a89f8aa22743e245c3e5f7940c | [
"Apache-2.0"
] | null | null | null | integration-testing/test/test_multiple_deploys.py | ArturGajowy/rchain | 7785a9195a4863a89f8aa22743e245c3e5f7940c | [
"Apache-2.0"
] | null | null | null | integration-testing/test/test_multiple_deploys.py | ArturGajowy/rchain | 7785a9195a4863a89f8aa22743e245c3e5f7940c | [
"Apache-2.0"
] | 1 | 2018-09-12T10:26:23.000Z | 2018-09-12T10:26:23.000Z | import logging
import contextlib
import threading
from typing import (
TYPE_CHECKING,
Generator,
)
import pytest
import conftest
from rnode_testing.common import TestingContext
from rnode_testing.rnode import (
docker_network_with_started_bootstrap,
started_peer,
)
from rnode_testing.wait import (
... | 44.058333 | 200 | 0.635521 | import logging
import contextlib
import threading
from typing import (
TYPE_CHECKING,
Generator,
)
import pytest
import conftest
from rnode_testing.common import TestingContext
from rnode_testing.rnode import (
docker_network_with_started_bootstrap,
started_peer,
)
from rnode_testing.wait import (
... | true | true |
f716972ac65d7ac3dcdcd16d28ba7fac85854f2f | 4,791 | py | Python | estonian_learner/verb.py | natter1/estonian_learner | da7837f0d64f4c1f6a212a9c473252c4b834699a | [
"MIT"
] | null | null | null | estonian_learner/verb.py | natter1/estonian_learner | da7837f0d64f4c1f6a212a9c473252c4b834699a | [
"MIT"
] | null | null | null | estonian_learner/verb.py | natter1/estonian_learner | da7837f0d64f4c1f6a212a9c473252c4b834699a | [
"MIT"
] | null | null | null | """
@author: Nathanael Jöhrmann
"""
import json
import textwrap
class Conjugations:
def __init__(self):
self.person = {}
self.negative = ["", ""]
self.passive = ["", ""]
self.passive_negative = ["", ""]
@property
def summary(self) -> str:
result = ""
sep ... | 33.041379 | 107 | 0.557921 |
import json
import textwrap
class Conjugations:
def __init__(self):
self.person = {}
self.negative = ["", ""]
self.passive = ["", ""]
self.passive_negative = ["", ""]
@property
def summary(self) -> str:
result = ""
sep = " "
for i in range(1, 7):... | true | true |
f71697bced2a9b09c787e7d1ea296be902ceb742 | 2,498 | py | Python | src/cobald/daemon/runners/asyncio_runner.py | thoto/cobald | 27f7a0b5208383e8a7a386f358009a433084908e | [
"MIT"
] | 7 | 2019-06-11T12:57:10.000Z | 2019-10-07T17:46:41.000Z | src/cobald/daemon/runners/asyncio_runner.py | thoto/cobald | 27f7a0b5208383e8a7a386f358009a433084908e | [
"MIT"
] | 76 | 2019-03-01T08:24:08.000Z | 2022-03-24T20:37:23.000Z | src/cobald/daemon/runners/asyncio_runner.py | thoto/cobald | 27f7a0b5208383e8a7a386f358009a433084908e | [
"MIT"
] | 8 | 2019-06-27T13:06:12.000Z | 2022-02-15T15:27:58.000Z | import asyncio
from functools import partial
from .base_runner import BaseRunner
from .async_tools import raise_return, AsyncExecution
class AsyncioRunner(BaseRunner):
"""Runner for coroutines with :py:mod:`asyncio`"""
flavour = asyncio
def __init__(self):
super().__init__()
self.event_... | 30.463415 | 64 | 0.583667 | import asyncio
from functools import partial
from .base_runner import BaseRunner
from .async_tools import raise_return, AsyncExecution
class AsyncioRunner(BaseRunner):
flavour = asyncio
def __init__(self):
super().__init__()
self.event_loop = asyncio.new_event_loop()
self._tasks = s... | true | true |
f71697bcf73bda98b7059ee2d3fd8ac5e69857ec | 2,881 | py | Python | tests/test_fuzzy_completion.py | vijayraavi/mssql-cli | bc16073e371314b970479c2830266ff24d63bd16 | [
"BSD-3-Clause"
] | null | null | null | tests/test_fuzzy_completion.py | vijayraavi/mssql-cli | bc16073e371314b970479c2830266ff24d63bd16 | [
"BSD-3-Clause"
] | null | null | null | tests/test_fuzzy_completion.py | vijayraavi/mssql-cli | bc16073e371314b970479c2830266ff24d63bd16 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import pytest
@pytest.fixture
def completer():
import mssqlcli.mssqlcompleter as mssqlcompleter
return mssqlcompleter.MssqlCompleter()
def test_ranking_ignores_identifier_quotes(completer):
"""When calculating result rank, identifier quotes should be ignored.
... | 32.370787 | 78 | 0.72579 | from __future__ import unicode_literals
import pytest
@pytest.fixture
def completer():
import mssqlcli.mssqlcompleter as mssqlcompleter
return mssqlcompleter.MssqlCompleter()
def test_ranking_ignores_identifier_quotes(completer):
text = 'user'
collection = ['user_action', '"user"']
matches = co... | true | true |
f71697d88f48702950eaef9afcbbc278acd2b761 | 606 | py | Python | codewars/7 kyu/string-ends-with.py | sirken/coding-practice | 9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab | [
"MIT"
] | null | null | null | codewars/7 kyu/string-ends-with.py | sirken/coding-practice | 9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab | [
"MIT"
] | null | null | null | codewars/7 kyu/string-ends-with.py | sirken/coding-practice | 9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab | [
"MIT"
] | null | null | null | from Test import Test, Test as test
'''
Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).
Examples:
solution('abc', 'bc') # returns true
solution('abc', 'd') # returns false
'''
def solution(string, ending):
return True if string[-l... | 28.857143 | 129 | 0.714521 | from Test import Test, Test as test
def solution(string, ending):
return True if string[-len(ending):] == ending or len(ending) == 0 else False
def solution(string, ending):
return string.endswith(ending)
test.assert_equals(solution('abcde', 'cde'), True)
test.assert_equals(solution('abcde', 'abc'), False)... | true | true |
f7169805436b5cf887fbf1c99fd59f5c2e43d93c | 7,209 | py | Python | ros/src/styx/bridge.py | Valentinkvn/Udacity-Full-Autonomous-Vehicle-Project | b1313345a09f84c122a91c1145230fe69da0d20f | [
"MIT"
] | null | null | null | ros/src/styx/bridge.py | Valentinkvn/Udacity-Full-Autonomous-Vehicle-Project | b1313345a09f84c122a91c1145230fe69da0d20f | [
"MIT"
] | 6 | 2021-02-22T08:44:36.000Z | 2022-03-12T00:13:46.000Z | ros/src/styx/bridge.py | Valentinkvn/Udacity-Full-Autonomous-Vehicle-Project | b1313345a09f84c122a91c1145230fe69da0d20f | [
"MIT"
] | null | null | null |
import rospy
import tf
from geometry_msgs.msg import PoseStamped, Quaternion, TwistStamped
from dbw_mkz_msgs.msg import SteeringReport, ThrottleCmd, BrakeCmd, SteeringCmd
from std_msgs.msg import Float32 as Float
from std_msgs.msg import Bool
from sensor_msgs.msg import PointCloud2
from sensor_msgs.msg import Image
i... | 34.004717 | 129 | 0.627688 |
import rospy
import tf
from geometry_msgs.msg import PoseStamped, Quaternion, TwistStamped
from dbw_mkz_msgs.msg import SteeringReport, ThrottleCmd, BrakeCmd, SteeringCmd
from std_msgs.msg import Float32 as Float
from std_msgs.msg import Bool
from sensor_msgs.msg import PointCloud2
from sensor_msgs.msg import Image
i... | true | true |
f716984bca20b513662e2e393027677207b388b1 | 1,954 | py | Python | mfr2.py | HeegyuKim/face_recognition | d96d2c94225e49d3dd8f2cae4444d35d5c88d13b | [
"MIT"
] | null | null | null | mfr2.py | HeegyuKim/face_recognition | d96d2c94225e49d3dd8f2cae4444d35d5c88d13b | [
"MIT"
] | null | null | null | mfr2.py | HeegyuKim/face_recognition | d96d2c94225e49d3dd8f2cae4444d35d5c88d13b | [
"MIT"
] | null | null | null | import os
import shutil
import os
from glob import glob
import pandas as pd
import random
from collections import defaultdict
from PIL import Image
from torch.utils.data import Dataset, DataLoader
def get_all_images(dir):
types = ["jpeg", "jpg", "png"]
files = []
for t in types:
path = os.path.join(dir, "**... | 22.45977 | 75 | 0.592119 | import os
import shutil
import os
from glob import glob
import pandas as pd
import random
from collections import defaultdict
from PIL import Image
from torch.utils.data import Dataset, DataLoader
def get_all_images(dir):
types = ["jpeg", "jpg", "png"]
files = []
for t in types:
path = os.path.join(dir, "**... | true | true |
f716985e68c4ca47db77d1c2d95da2329e93bfc9 | 1,483 | py | Python | official/nlp/modeling/networks/__init__.py | akineeic/models | 2912042352009c9993dc05403624100bfe42d9c1 | [
"Apache-2.0"
] | 15 | 2018-08-15T19:29:39.000Z | 2021-11-05T02:14:59.000Z | official/nlp/modeling/networks/__init__.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 5 | 2020-10-01T09:02:34.000Z | 2021-02-21T12:50:11.000Z | official/nlp/modeling/networks/__init__.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 8 | 2019-06-06T20:37:15.000Z | 2022-03-04T13:54:38.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 54.925926 | 92 | 0.784895 |
from official.nlp.modeling.networks.albert_encoder import AlbertEncoder
from official.nlp.modeling.networks.bert_encoder import BertEncoder
from official.nlp.modeling.networks.classification import Classification
from official.nlp.modeling.networks.encoder_scaffold import EncoderScaffold
from official.nlp... | true | true |
f71698db8367f39cb85d20a59c8f5d11cc1b4ccc | 4,301 | py | Python | coding_problems/move_zeros.py | NescobarAlopLop/miscellaneous | 8e33cb34ddc54dad233d2418d4a90a96ce3c393e | [
"MIT"
] | null | null | null | coding_problems/move_zeros.py | NescobarAlopLop/miscellaneous | 8e33cb34ddc54dad233d2418d4a90a96ce3c393e | [
"MIT"
] | null | null | null | coding_problems/move_zeros.py | NescobarAlopLop/miscellaneous | 8e33cb34ddc54dad233d2418d4a90a96ce3c393e | [
"MIT"
] | null | null | null | """
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the
non-zero elements.
Example:
Input: [0,1,0,3,12]
Output: [1,3,12,0,0]
Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.
"""
from unit... | 52.45122 | 1,044 | 0.681702 | from unittest import TestCase
class Solution:
@staticmethod
def get_next(nums, start, zero=True):
for idx in range(start, len(nums)):
if zero and nums[idx] == 0:
return idx
if not zero and nums[idx] != zero:
return idx
return len(nums)
... | true | true |
f71699ccf4bde15c74f7288f21e09a3602fee877 | 4,755 | py | Python | events/yukicon2015/management/commands/setup_yukicon2015.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | events/yukicon2015/management/commands/setup_yukicon2015.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | events/yukicon2015/management/commands/setup_yukicon2015.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | # encoding: utf-8
from datetime import datetime, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from dateutil.tz import tzlocal
from core.utils import slugify
class Setup(object):
def setup(self, test=False):
self.te... | 38.04 | 175 | 0.606519 |
from datetime import datetime, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from dateutil.tz import tzlocal
from core.utils import slugify
class Setup(object):
def setup(self, test=False):
self.test = test
... | true | true |
f7169a3697dd8cdb379fbd71762594e9c77e9d4a | 5,784 | py | Python | emerge.py | puiterwijk/dnf-plugins-emerge | fc5640a374fb9fbc5eb6c749e1f6f32617dd9532 | [
"MIT"
] | 2 | 2018-02-27T23:25:36.000Z | 2018-03-01T09:18:47.000Z | emerge.py | puiterwijk/dnf-plugins-emerge | fc5640a374fb9fbc5eb6c749e1f6f32617dd9532 | [
"MIT"
] | null | null | null | emerge.py | puiterwijk/dnf-plugins-emerge | fc5640a374fb9fbc5eb6c749e1f6f32617dd9532 | [
"MIT"
] | null | null | null | import dnf
import dnf.cli
from glob import glob
import logging
import threading
import tempfile
import subprocess
import shutil
import os
logger = logging.getLogger('dnf')
class ErrorThread(threading.Thread):
_my_exception = None
def run(self, *args):
try:
self._run(*self._args)
... | 32.494382 | 112 | 0.584198 | import dnf
import dnf.cli
from glob import glob
import logging
import threading
import tempfile
import subprocess
import shutil
import os
logger = logging.getLogger('dnf')
class ErrorThread(threading.Thread):
_my_exception = None
def run(self, *args):
try:
self._run(*self._args)
... | true | true |
f7169acccf677a901455907c655d4e12841b5f55 | 11,443 | py | Python | tf_agents/experimental/examples/sac/haarnoja18/sac_train_eval.py | cmarlin/agents | 1729e06f42237b34dab8bd9d8c01980c2d2b391c | [
"Apache-2.0"
] | 1 | 2021-04-19T02:28:24.000Z | 2021-04-19T02:28:24.000Z | tf_agents/experimental/examples/sac/haarnoja18/sac_train_eval.py | cmarlin/agents | 1729e06f42237b34dab8bd9d8c01980c2d2b391c | [
"Apache-2.0"
] | null | null | null | tf_agents/experimental/examples/sac/haarnoja18/sac_train_eval.py | cmarlin/agents | 1729e06f42237b34dab8bd9d8c01980c2d2b391c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TF-Agents 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 la... | 33.361516 | 79 | 0.733811 |
import functools
import os
from absl import app
from absl import flags
from absl import logging
import gin
import reverb
import tensorflow as tf
from tf_agents.agents.sac import sac_agent
from tf_agents.agents.sac import tanh_normal_projection_network
from tf_agents.environments import suite_mujoco
f... | true | true |
f7169b0b69005cd6f9c943ebfaa084ff31332512 | 1,045 | py | Python | parameter_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | parameter_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | parameter_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | from glob import glob
import os
from setuptools import setup
package_name = 'parameter_tutorial_py'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + pac... | 29.027778 | 74 | 0.622967 | from glob import glob
import os
from setuptools import setup
package_name = 'parameter_tutorial_py'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + pac... | true | true |
f7169bb6a32f8e404c1c0086cbe414701694aecd | 2,198 | py | Python | ros/src/twist_controller/twist_controller.py | ysavchenko/carnd-capstone | 682eb7ed52153c667f63e7c7eb46f13584469888 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | ysavchenko/carnd-capstone | 682eb7ed52153c667f63e7c7eb46f13584469888 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | ysavchenko/carnd-capstone | 682eb7ed52153c667f63e7c7eb46f13584469888 | [
"MIT"
] | null | null | null | from yaw_controller import YawController
from pid import PID
from lowpass import LowPassFilter
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, wheel_radius, decel_limit):
self.yaw_controller = None
self.throttle_controller = None
... | 33.815385 | 125 | 0.674249 | from yaw_controller import YawController
from pid import PID
from lowpass import LowPassFilter
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, wheel_radius, decel_limit):
self.yaw_controller = None
self.throttle_controller = None
... | true | true |
f7169e22e550d5a34ea898f7d6792737a32dc834 | 2,050 | py | Python | pyJCal.py | Geeknux/jalali-calendar-widget | 034d6895cead2059825a931294ef9ffce7436caa | [
"MIT"
] | 1 | 2015-09-01T03:57:05.000Z | 2015-09-01T03:57:05.000Z | pyJCal.py | Geeknux/jalali-calendar-widget | 034d6895cead2059825a931294ef9ffce7436caa | [
"MIT"
] | 1 | 2015-09-01T03:56:35.000Z | 2015-09-01T03:56:35.000Z | pyJCal.py | Geeknux/jalali-calendar-widget | 034d6895cead2059825a931294ef9ffce7436caa | [
"MIT"
] | null | null | null | #! /usr/bin/python2
# coding=utf-8
class pyJCal:
def __init__(self):
pass
def div(self, a, b):
return a / b
def gregorian_to_jalali(self, g_y, g_m, g_d):
"""
this function returns result of converting ye gregorian date to jalali
"""
g_days_in_month = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31... | 19.711538 | 88 | 0.57122 |
class pyJCal:
def __init__(self):
pass
def div(self, a, b):
return a / b
def gregorian_to_jalali(self, g_y, g_m, g_d):
g_days_in_month = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
j_days_in_month = (31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29)
gy = g_y - 1600
gm = g_m - 1
gd = g_d... | true | true |
f7169ea9d45728fbd3a7a434bf6954f50de55d91 | 8,833 | py | Python | source/conf.py | abhivishal/website | 5debb3bc7da05a018996a7fbf7d140ad8b91a66e | [
"Apache-2.0"
] | 40 | 2015-07-24T14:11:25.000Z | 2021-08-02T14:25:09.000Z | source/conf.py | abhivishal/website | 5debb3bc7da05a018996a7fbf7d140ad8b91a66e | [
"Apache-2.0"
] | 79 | 2015-01-07T20:46:42.000Z | 2021-06-08T19:02:48.000Z | source/conf.py | abhivishal/website | 5debb3bc7da05a018996a7fbf7d140ad8b91a66e | [
"Apache-2.0"
] | 41 | 2015-01-29T00:10:00.000Z | 2022-03-20T02:55:45.000Z | # -*- coding: utf-8 -*-
#
# OSU DevOps BootCamp documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 15 12:20:17 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated f... | 32.355311 | 81 | 0.709498 |
import sys, os
extensions = ['sphinx.ext.todo',]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'OSU DevOps BootCamp'
copyright = u'2013-2017, Oregon State Unviersity'
# |version| and |release|, also used in various other places throughout t... | true | true |
f7169eeeb7b39a8b509cb6a7cc0f4ab643571126 | 331 | py | Python | api/app/api/endpoints/bets.py | franloza/apiestas | 46978f58858b1d3822b2f80eb8948009944aa005 | [
"MIT"
] | 53 | 2019-11-19T03:02:06.000Z | 2022-01-13T15:29:38.000Z | api/app/api/endpoints/bets.py | franloza/apiestas | 46978f58858b1d3822b2f80eb8948009944aa005 | [
"MIT"
] | 3 | 2019-12-27T22:49:11.000Z | 2021-03-31T18:59:36.000Z | api/app/api/endpoints/bets.py | franloza/apiestas | 46978f58858b1d3822b2f80eb8948009944aa005 | [
"MIT"
] | 5 | 2021-04-25T13:02:48.000Z | 2022-02-16T13:57:21.000Z | from fastapi import APIRouter, Depends
from ...api.dependencies.bets import get_bet_by_slug_from_path
from ...models.bets import Bet
router = APIRouter()
@router.get(
'/{slug}',
response_model=Bet,
name="bets:get-bet"
)
async def get_bet(bet=Depends(get_bet_by_slug_from_path)) -> Bet:
return Bet(**b... | 20.6875 | 65 | 0.719033 | from fastapi import APIRouter, Depends
from ...api.dependencies.bets import get_bet_by_slug_from_path
from ...models.bets import Bet
router = APIRouter()
@router.get(
'/{slug}',
response_model=Bet,
name="bets:get-bet"
)
async def get_bet(bet=Depends(get_bet_by_slug_from_path)) -> Bet:
return Bet(**b... | true | true |
f7169fa15e8d91d107ba43a0da61b69e67f59f1d | 34,678 | py | Python | networking_sfc/tests/unit/extensions/test_flowclassifier.py | huiweics/networking-sfc | e7675aa1a31769d55740c025a39644cc6e1ca8dd | [
"Apache-2.0"
] | null | null | null | networking_sfc/tests/unit/extensions/test_flowclassifier.py | huiweics/networking-sfc | e7675aa1a31769d55740c025a39644cc6e1ca8dd | [
"Apache-2.0"
] | null | null | null | networking_sfc/tests/unit/extensions/test_flowclassifier.py | huiweics/networking-sfc | e7675aa1a31769d55740c025a39644cc6e1ca8dd | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Futurewei. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 41.630252 | 78 | 0.603639 |
import copy
import mock
from neutron.api.v2 import resource as api_res_log
from neutron import manager
from neutron.notifiers import nova as nova_log
from neutron.tests.unit.api.v2 import test_base as test_api_v2
from neutron.tests.unit.extensions import base as test_api_v2_extension
from neutron_lib imp... | true | true |
f716a0394e3827031c5c048b941822b24f227531 | 7,848 | py | Python | research/compression/entropy_coder/core/entropy_coder_train.py | jdavidagudelo/tensorflow-models | 6f019beec73b01861363bf717706e27f4210b979 | [
"Apache-2.0"
] | 1 | 2021-05-17T01:42:29.000Z | 2021-05-17T01:42:29.000Z | research/compression/entropy_coder/core/entropy_coder_train.py | jdavidagudelo/tensorflow-models | 6f019beec73b01861363bf717706e27f4210b979 | [
"Apache-2.0"
] | null | null | null | research/compression/entropy_coder/core/entropy_coder_train.py | jdavidagudelo/tensorflow-models | 6f019beec73b01861363bf717706e27f4210b979 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 43.120879 | 87 | 0.605377 |
import time
import tensorflow as tf
from research.compression.entropy_coder.core import code_loader
from research.compression.entropy_coder.core import config_helper
from research.compression.entropy_coder.model import model_factory
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('master', ... | true | true |
f716a0a3d08f1b810ae639fdca8086b153407a06 | 260,784 | py | Python | instances/passenger_demand/pas-20210422-1717-int14000000000000001e/48.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int14000000000000001e/48.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int14000000000000001e/48.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 26645
passenger_arriving = (
(9, 10, 5, 5, 3, 2, 2, 3, 3, 1, 1, 0, 0, 6, 9, 0, 8, 12, 3, 4, 1, 0, 2, 2, 2, 0), # 0
(5, 10, 9, 11, 6, 2, 0, 5, 1, 1, 1, 0, 0, 11, 5, 5, 6, 6, 1, 2, 2, 1, 4, 0, 0, 0), # 1
(7, 9, 3, 3, 3, 3, 3, 5, 4, 4, 2, 0, 0, 9, 6, 5, 7, 9, 1, 5, 4, 2, 2, 2, 2,... | 278.913369 | 492 | 0.77175 |
numPassengers = 26645
passenger_arriving = (
(9, 10, 5, 5, 3, 2, 2, 3, 3, 1, 1, 0, 0, 6, 9, 0, 8, 12, 3, 4, 1, 0, 2, 2, 2, 0),
(5, 10, 9, 11, 6, 2, 0, 5, 1, 1, 1, 0, 0, 11, 5, 5, 6, 6, 1, 2, 2, 1, 4, 0, 0, 0),
(7, 9, 3, 3, 3, 3, 3, 5, 4, 4, 2, 0, 0, 9, 6, 5, 7, 9, 1, 5, 4, 2, 2, 2, 2, 0),
(5, 10, 11, 9, 12, 3... | true | true |
f716a1a5f632f06075f249c2221bcd21beac3b38 | 657 | py | Python | odc_gee/setup.py | admariner/data_cube_notebooks | 984a84b2f92114040e36a533d3f476dcf384695e | [
"Apache-2.0"
] | null | null | null | odc_gee/setup.py | admariner/data_cube_notebooks | 984a84b2f92114040e36a533d3f476dcf384695e | [
"Apache-2.0"
] | null | null | null | odc_gee/setup.py | admariner/data_cube_notebooks | 984a84b2f92114040e36a533d3f476dcf384695e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='odc-gee',
version='2.24',
description='Google Earth Engine indexing tools for Open Data Cube',
author='Andrew Lubawy',
author_email='andrew.m.lubawy@ama-inc.com',
install_requires=[
"google-auth>=1.11... | 29.863636 | 74 | 0.564688 |
from setuptools import setup, find_packages
setup(name='odc-gee',
version='2.24',
description='Google Earth Engine indexing tools for Open Data Cube',
author='Andrew Lubawy',
author_email='andrew.m.lubawy@ama-inc.com',
install_requires=[
"google-auth>=1.11.0,<=1.32.0"
... | true | true |
f716a22900c092bb89fd4f6f98a63d9202ab5429 | 7,980 | py | Python | client/deploy_kafka.py | jzmq/minos | 510b6e30758f4900a72fee1a5e6258bdc7c83f17 | [
"Apache-2.0"
] | 365 | 2015-01-26T13:56:42.000Z | 2022-03-28T06:36:31.000Z | client/deploy_kafka.py | jzmq/minos | 510b6e30758f4900a72fee1a5e6258bdc7c83f17 | [
"Apache-2.0"
] | 3 | 2015-12-29T07:44:24.000Z | 2021-03-18T06:13:07.000Z | client/deploy_kafka.py | jzmq/minos | 510b6e30758f4900a72fee1a5e6258bdc7c83f17 | [
"Apache-2.0"
] | 135 | 2015-01-31T00:46:51.000Z | 2022-03-03T06:31:09.000Z | #!/usr/bin/env python
import argparse
import os
import parallel_deploy
import service_config
import subprocess
import sys
import urlparse
import deploy_utils
from log import Log
ALL_JOBS = ["kafka", "kafkascribe"]
def _get_kafka_service_config(args):
args.kafka_config = deploy_utils.get_service_config(args)
def... | 38.550725 | 97 | 0.773308 |
import argparse
import os
import parallel_deploy
import service_config
import subprocess
import sys
import urlparse
import deploy_utils
from log import Log
ALL_JOBS = ["kafka", "kafkascribe"]
def _get_kafka_service_config(args):
args.kafka_config = deploy_utils.get_service_config(args)
def generate_configs(arg... | true | true |
f716a2954dca50e0e1254eb1298f66d92f7eacbe | 2,317 | py | Python | scripts/sanity_chk/scl.py | cinlyooi-intel/zephyr | 193fb971c24f827464982307b5b3bb34de0fa98d | [
"Apache-2.0"
] | null | null | null | scripts/sanity_chk/scl.py | cinlyooi-intel/zephyr | 193fb971c24f827464982307b5b3bb34de0fa98d | [
"Apache-2.0"
] | null | null | null | scripts/sanity_chk/scl.py | cinlyooi-intel/zephyr | 193fb971c24f827464982307b5b3bb34de0fa98d | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
#
# Zephyr's Sanity Check library
#
# Set of code that other projects can also import to do things on
# Zephyr's sanity check testcases.
import logging
import yaml
log = logging.getLogger("scl")
#
#
def yaml_load(filename):
"""
Safely load a YAML document
Follows recomendations from
... | 32.180556 | 94 | 0.678032 |
#
# Set of code that other projects can also import to do things on
# Zephyr's sanity check testcases.
import logging
import yaml
log = logging.getLogger("scl")
def yaml_load(filename):
try:
with open(filename, 'r') as f:
return yaml.safe_load(f)
except yaml.scanner.ScannerError as e... | true | true |
f716a3a44cd54534078de417bc370bb62502718a | 68,239 | py | Python | pandas/tests/groupby/test_groupby.py | gurukiran07/pandas | 67c9385787c4d854b75a6f2c04fdf6886fdb1a06 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2017-12-14T19:50:52.000Z | 2020-04-07T16:47:23.000Z | pandas/tests/groupby/test_groupby.py | zoehuang7/pandas | 3cce96f515917170ea9bce731ffcc913750464b8 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/test_groupby.py | zoehuang7/pandas | 3cce96f515917170ea9bce731ffcc913750464b8 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2018-01-26T08:33:54.000Z | 2018-01-26T08:33:54.000Z | from datetime import datetime
from decimal import Decimal
from io import StringIO
import numpy as np
import pytest
from pandas.compat import IS64
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Grouper,
Index,
MultiIndex,
Series,
... | 30.504694 | 88 | 0.587201 | from datetime import datetime
from decimal import Decimal
from io import StringIO
import numpy as np
import pytest
from pandas.compat import IS64
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Grouper,
Index,
MultiIndex,
Series,
... | true | true |
f716a3b6932792541e61b438e6424ea8e3b6dd6f | 5,536 | py | Python | src/modules/site/base/views/tools/heritability.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 3 | 2022-02-09T07:04:37.000Z | 2022-03-11T02:46:35.000Z | src/modules/site/base/views/tools/heritability.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 4 | 2022-01-28T22:28:08.000Z | 2022-02-11T21:47:15.000Z | src/modules/site/base/views/tools/heritability.py | AndersenLab/CAENDR | ce4cdb74db736db8226ffc90988959b71b0d5ff5 | [
"MIT"
] | 1 | 2022-01-11T03:39:02.000Z | 2022-01-11T03:39:02.000Z | import io
import pandas as pd
import json
from flask import (flash,
request,
redirect,
url_for,
jsonify,
render_template,
Blueprint,
abort)
from logzero import logger
from datetime impor... | 33.756098 | 164 | 0.684429 | import io
import pandas as pd
import json
from flask import (flash,
request,
redirect,
url_for,
jsonify,
render_template,
Blueprint,
abort)
from logzero import logger
from datetime impor... | true | true |
f716a488f4da02f72691c1194f86e83d967d3e2b | 45,335 | py | Python | test/test_sort_and_select.py | kbrose/pytorch | fc0b8e60337ae46b90ed5d2f6d1f623f0f8d6581 | [
"Intel"
] | null | null | null | test/test_sort_and_select.py | kbrose/pytorch | fc0b8e60337ae46b90ed5d2f6d1f623f0f8d6581 | [
"Intel"
] | null | null | null | test/test_sort_and_select.py | kbrose/pytorch | fc0b8e60337ae46b90ed5d2f6d1f623f0f8d6581 | [
"Intel"
] | null | null | null | import torch
import numpy as np
import random
from torch._six import nan
from itertools import permutations, product
from torch.testing import all_types, all_types_and
from torch.testing._internal.common_utils import \
(TEST_WITH_ROCM, TestCase, run_tests, make_tensor, slowTest)
from torch.testing._internal.commo... | 45.28971 | 131 | 0.543179 | import torch
import numpy as np
import random
from torch._six import nan
from itertools import permutations, product
from torch.testing import all_types, all_types_and
from torch.testing._internal.common_utils import \
(TEST_WITH_ROCM, TestCase, run_tests, make_tensor, slowTest)
from torch.testing._internal.commo... | true | true |
f716a4e754c3e3f35917e5279cd691b574a49a9b | 798 | py | Python | tests/test_api_v1_services_sshd_stop.py | pincher95/pfsense-api | 001a4b8a1ec39138668d6d92b3c9d0c89a7f1b45 | [
"Apache-2.0"
] | null | null | null | tests/test_api_v1_services_sshd_stop.py | pincher95/pfsense-api | 001a4b8a1ec39138668d6d92b3c9d0c89a7f1b45 | [
"Apache-2.0"
] | null | null | null | tests/test_api_v1_services_sshd_stop.py | pincher95/pfsense-api | 001a4b8a1ec39138668d6d92b3c9d0c89a7f1b45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Jared Hendrickson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 33.25 | 74 | 0.764411 |
import e2e_test_framework
class APIE2ETestServicesSSHdStop(e2e_test_framework.APIE2ETest):
uri = "/api/v1/services/sshd/stop"
post_tests = [{"name": "Stop the SSHd service"}]
APIE2ETestServicesSSHdStop()
| true | true |
f716a628b677fa7e5aaed86bc610566d88632de5 | 1,598 | py | Python | mySpider/spiders/wangyi.py | songw831/mySpider | 04312701e891e14ba7e470c3f2c0aa9997074096 | [
"MIT"
] | null | null | null | mySpider/spiders/wangyi.py | songw831/mySpider | 04312701e891e14ba7e470c3f2c0aa9997074096 | [
"MIT"
] | null | null | null | mySpider/spiders/wangyi.py | songw831/mySpider | 04312701e891e14ba7e470c3f2c0aa9997074096 | [
"MIT"
] | null | null | null | import scrapy
from selenium import webdriver
from mySpider.items import MyspiderItem
class FundSpider(scrapy.Spider):
name = 'wangyi'
#allowed_domains = ['www.xxx.com']
start_urls = ['http://news.163.com/']
modules_url = [] #存放五个版块的url
def __init__(self):
self.bro = webdriver.Chrome(execut... | 38.97561 | 103 | 0.61577 | import scrapy
from selenium import webdriver
from mySpider.items import MyspiderItem
class FundSpider(scrapy.Spider):
name = 'wangyi'
start_urls = ['http://news.163.com/']
modules_url = []
def __init__(self):
self.bro = webdriver.Chrome(executable_path='D:\PyCharm\mySpider\chromedriver.e... | true | true |
f716a6346eb2c4bb4c555f3cc80875549f7a88fc | 1,780 | py | Python | pandas_ta/performance/log_return.py | yssource/pandas-ta | 0f975320684a91db3c04f6ea3dd739177dcb65aa | [
"MIT"
] | 2 | 2021-03-30T01:23:14.000Z | 2021-04-02T18:04:51.000Z | pandas_ta/performance/log_return.py | lukaszbinden/pandas-ta | 98478f8bf049a4c8748d6f3c795f4f335ced05ca | [
"MIT"
] | null | null | null | pandas_ta/performance/log_return.py | lukaszbinden/pandas-ta | 98478f8bf049a4c8748d6f3c795f4f335ced05ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from numpy import log as nplog
from pandas_ta.utils import get_offset, verify_series
def log_return(close, length=None, cumulative=False, offset=None, **kwargs):
"""Indicator: Log Return"""
# Validate Arguments
close = verify_series(close)
length = int(length) if length and len... | 27.8125 | 88 | 0.690449 |
from numpy import log as nplog
from pandas_ta.utils import get_offset, verify_series
def log_return(close, length=None, cumulative=False, offset=None, **kwargs):
close = verify_series(close)
length = int(length) if length and length > 0 else 1
offset = get_offset(offset)
log_return = nplog... | true | true |
f716a9d014c49a805a816c403771d17f603d78f9 | 5,119 | py | Python | resolwe_bio/tools/basespace_download.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tools/basespace_download.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/tools/basespace_download.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Tool to download files from BaseSpace."""
import sys
import traceback
import atexit
import argparse
import requests
class BaseSpaceDownloadError(Exception):
"""BaseSpace download error."""
pass
def main():
"""Entry point."""
session = requests.Session()
atexit.registe... | 34.126667 | 117 | 0.632936 |
import sys
import traceback
import atexit
import argparse
import requests
class BaseSpaceDownloadError(Exception):
pass
def main():
session = requests.Session()
atexit.register(on_exit, session)
parser = argparse.ArgumentParser(description='Download file from Illumina BaseSpace.')
parser.add... | true | true |
f716aa1fd41279e8e408620b6f55302402277111 | 26,185 | py | Python | tests/test_sdb.py | peppelinux/pyoidc | 2e751ed84039259a2b138148eae204c877518950 | [
"Apache-2.0"
] | 1 | 2020-09-30T13:08:14.000Z | 2020-09-30T13:08:14.000Z | tests/test_sdb.py | peppelinux/pyoidc | 2e751ed84039259a2b138148eae204c877518950 | [
"Apache-2.0"
] | null | null | null | tests/test_sdb.py | peppelinux/pyoidc | 2e751ed84039259a2b138148eae204c877518950 | [
"Apache-2.0"
] | null | null | null | import base64
import datetime
import hashlib
import hmac
import json
import random
import time
from unittest import TestCase
import pytest
from freezegun import freeze_time
from oic.oic.message import AuthorizationRequest
from oic.oic.message import OpenIDRequest
from oic.utils.sdb import AccessCodeUsed
from oic.util... | 34.228758 | 88 | 0.586901 | import base64
import datetime
import hashlib
import hmac
import json
import random
import time
from unittest import TestCase
import pytest
from freezegun import freeze_time
from oic.oic.message import AuthorizationRequest
from oic.oic.message import OpenIDRequest
from oic.utils.sdb import AccessCodeUsed
from oic.util... | true | true |
f716aa23ec2670b3b6679f13ad0859e223f380ff | 309 | py | Python | dataset/proxies.py | unknown/reddit-aita | 557fd67120e529db8b014b74a71e3b926b0ed528 | [
"MIT"
] | null | null | null | dataset/proxies.py | unknown/reddit-aita | 557fd67120e529db8b014b74a71e3b926b0ed528 | [
"MIT"
] | null | null | null | dataset/proxies.py | unknown/reddit-aita | 557fd67120e529db8b014b74a71e3b926b0ed528 | [
"MIT"
] | null | null | null | import random
proxy_list = [
'http://p.webshare.io:19999'
]
def random_proxy():
i = random.randint(0, len(proxy_list) - 1)
p = {
'http': proxy_list[i]
}
return p
def remove_proxy(proxy):
proxy_list.remove(proxy)
print(f'Removed {proxy}-- {len(proxy_list)} proxies left') | 19.3125 | 62 | 0.621359 | import random
proxy_list = [
'http://p.webshare.io:19999'
]
def random_proxy():
i = random.randint(0, len(proxy_list) - 1)
p = {
'http': proxy_list[i]
}
return p
def remove_proxy(proxy):
proxy_list.remove(proxy)
print(f'Removed {proxy}-- {len(proxy_list)} proxies left') | true | true |
f716ab6b8551b5a9bf03bfb3d99382d22fe6e166 | 30,230 | py | Python | Scripts/simulation/interactions/utils/creation.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/utils/creation.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/utils/creation.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\utils\creation.py
# Compiled at: 2019-12-03 21:37:40
# Size of source mod 2**32: 42011 ... | 58.927875 | 452 | 0.673139 |
from animation.animation_utils import flush_all_animations
from carry.carry_elements import enter_carry_while_holding
from element_utils import build_critical_section
from event_testing.resolver import SingleSimResolver
from filters.sim_template import TunableSimTemplate
from filters.tunable import TunableSimFilt... | true | true |
f716ac0e3959c71c4d5608a0af8d5faae868b677 | 93 | py | Python | src/bot.py | amirsafiee/template_telegram_bot | 2dfaba93de6ff6066a8b2ac64e1ee95be19c1548 | [
"MIT"
] | null | null | null | src/bot.py | amirsafiee/template_telegram_bot | 2dfaba93de6ff6066a8b2ac64e1ee95be19c1548 | [
"MIT"
] | null | null | null | src/bot.py | amirsafiee/template_telegram_bot | 2dfaba93de6ff6066a8b2ac64e1ee95be19c1548 | [
"MIT"
] | 1 | 2022-01-24T12:59:19.000Z | 2022-01-24T12:59:19.000Z | import os
import telebot
bot = telebot.TeleBot(os.environ['BOT_TOKEN'], parse_mode='HTML')
| 15.5 | 65 | 0.752688 | import os
import telebot
bot = telebot.TeleBot(os.environ['BOT_TOKEN'], parse_mode='HTML')
| true | true |
f716ac52c89aa1029f08962d2e19db4bbf190274 | 796 | py | Python | util/plaintext.py | seounghwan-oh/homomorphic_encryption | be700505547b81671c37026e55c4eefbd44dcaae | [
"MIT"
] | 25 | 2020-11-06T13:54:33.000Z | 2022-03-18T18:53:37.000Z | util/plaintext.py | seounghwan-oh/homomorphic_encryption | be700505547b81671c37026e55c4eefbd44dcaae | [
"MIT"
] | 1 | 2021-04-04T17:49:00.000Z | 2021-04-05T13:46:21.000Z | util/plaintext.py | seounghwan-oh/homomorphic_encryption | be700505547b81671c37026e55c4eefbd44dcaae | [
"MIT"
] | 6 | 2021-04-04T17:26:09.000Z | 2022-03-28T19:26:29.000Z | """A module to keep track of a plaintext."""
class Plaintext:
"""An instance of a plaintext.
This is a wrapper class for a plaintext, which consists
of one polynomial.
Attributes:
poly (Polynomial): Plaintext polynomial.
scaling_factor (float): Scaling factor.
"""
def __init... | 25.677419 | 59 | 0.614322 |
class Plaintext:
def __init__(self, poly, scaling_factor=None):
self.poly = poly
self.scaling_factor = scaling_factor
def __str__(self):
return str(self.poly) | true | true |
f716acb54b4962beca238b19ba8258573c3ffe65 | 766 | py | Python | tst/util/chain_utils.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | tst/util/chain_utils.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | tst/util/chain_utils.py | TST-Group-BE/flax-blockchain | ed850df4f28ef4b6f71c175c8b6d07d27f7b3cd5 | [
"Apache-2.0"
] | null | null | null | from typing import List
from tst.types.blockchain_format.coin import Coin
from tst.types.blockchain_format.program import SerializedProgram
from tst.types.blockchain_format.sized_bytes import bytes32
from tst.util.condition_tools import (
conditions_dict_for_solution,
created_outputs_for_conditions_dict,
)
d... | 34.818182 | 100 | 0.784595 | from typing import List
from tst.types.blockchain_format.coin import Coin
from tst.types.blockchain_format.program import SerializedProgram
from tst.types.blockchain_format.sized_bytes import bytes32
from tst.util.condition_tools import (
conditions_dict_for_solution,
created_outputs_for_conditions_dict,
)
d... | true | true |
f716ada0abc16a0476ced0d0b57cf8389076e57f | 7,206 | py | Python | ABA_PY/CHK_2D_postp_part_A_v4.4.py | SunilAnandatheertha/ABAPYMAT | 48d4d178de38c1f3c4510ad7f06fe1647ae6227c | [
"BSD-3-Clause"
] | 1 | 2021-01-13T14:06:34.000Z | 2021-01-13T14:06:34.000Z | ABA_PY/CHK_2D_postp_part_A_v4.4.py | SunilAnandatheertha/ABAPYMAT | 48d4d178de38c1f3c4510ad7f06fe1647ae6227c | [
"BSD-3-Clause"
] | 5 | 2020-12-21T14:51:57.000Z | 2021-01-21T13:42:44.000Z | ABA_PY/CHK_2D_postp_part_A_v4.4.py | SunilAnandatheertha/ABAPYMAT-PXTAL-2D | 48d4d178de38c1f3c4510ad7f06fe1647ae6227c | [
"BSD-3-Clause"
] | 1 | 2022-02-25T20:03:18.000Z | 2022-02-25T20:03:18.000Z | """
COMPLETE DESCRIPTION HERE
"""
#-----------------------------------------------------------------
#1. Seperate this file for calibration models
# MAKE THE PYTHON PRE, MATLAB AND PYTHON POST and SPYDER pipelines ready for calibrations
# Set up the required folders
# Set up the excel file where to store the file numb... | 44.481481 | 156 | 0.664585 |
from abaqus import *
from abaqusConstants import *
from caeModules import *
from driverUtils import executeOnCaeStartup
import os
import visualization
import time
import numpy as np
executeOnCaeStartup()
Mdb()
from abaqus import getInputs
fields = (('Model_origin_x:', '0'),
('Model_or... | true | true |
f716adfe3834f0888422f74ed1401389c19dd141 | 21,995 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_vpn_connections_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.447248 | 220 | 0.672926 |
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.