hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7008828947614612adcc8a46a632853493925e1 | 1,259 | py | Python | release/ray_release/command_runner/_wait_cluster.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | release/ray_release/command_runner/_wait_cluster.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | release/ray_release/command_runner/_wait_cluster.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | import argparse
import time
import ray
ray.init(address="auto")
parser = argparse.ArgumentParser()
parser.add_argument(
"num_nodes", type=int, help="Wait for this number of nodes (includes head)"
)
parser.add_argument("max_time_s", type=int, help="Wait for this number of seconds")
parser.add_argument(
"--f... | 22.890909 | 83 | 0.640985 | import argparse
import time
import ray
ray.init(address="auto")
parser = argparse.ArgumentParser()
parser.add_argument(
"num_nodes", type=int, help="Wait for this number of nodes (includes head)"
)
parser.add_argument("max_time_s", type=int, help="Wait for this number of seconds")
parser.add_argument(
"--f... | true | true |
f70088778ecb6371359f0e87efb64d34322d52f5 | 631 | py | Python | pyaugmecon/flag.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | 5 | 2021-05-29T20:18:06.000Z | 2022-01-20T08:56:26.000Z | pyaugmecon/flag.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | null | null | null | pyaugmecon/flag.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | 3 | 2021-08-20T19:27:28.000Z | 2022-01-21T13:42:49.000Z | import itertools
from multiprocessing import Manager
from pyaugmecon.options import Options
class Flag(object):
def __init__(self, opts: Options):
self.opts = opts
if self.opts.shared_flag:
self.flag = Manager().dict()
else:
self.flag = {}
def set(self, flag_r... | 23.37037 | 67 | 0.58954 | import itertools
from multiprocessing import Manager
from pyaugmecon.options import Options
class Flag(object):
def __init__(self, opts: Options):
self.opts = opts
if self.opts.shared_flag:
self.flag = Manager().dict()
else:
self.flag = {}
def set(self, flag_r... | true | true |
f700899e7aad61c8932550f20436d641de1bb9a4 | 2,075 | py | Python | setup.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | setup.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | setup.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import os
from setuptools import setup, find_packages
__version__ = '3.1.0'
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
with open(requirements_path) as requirements_file:
... | 26.602564 | 107 | 0.64 |
import os
from setuptools import setup, find_packages
__version__ = '3.1.0'
requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt')
with open(requirements_path) as requirements_file:
requirements = requirements_file.readlines()
kafka = ['confluent-kafka==1.0.0']
cas... | true | true |
f7008ae99b3c59454e9e34e4cbe63def3c8a1517 | 4,844 | py | Python | mailchimp_marketing_asyncio/models/ecommerce_product_image2.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/ecommerce_product_image2.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/ecommerce_product_image2.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 27.83908 | 119 | 0.571016 |
import pprint
import re
import six
class EcommerceProductImage2(object):
swagger_types = {
'id': 'str',
'url': 'str',
'variant_ids': 'list[str]'
}
attribute_map = {
'id': 'id',
'url': 'url',
'variant_ids': 'variant_ids'
}
def __init__(self,... | true | true |
f7008b8b74da54459ac2d871150e917da983224b | 908 | py | Python | Metadata/data/tag_genes.py | agladstein/RNA-Seq-in-the-Cloud | 4e169b1e6640ae460db5c84ee016fddb7313ccef | [
"MIT"
] | null | null | null | Metadata/data/tag_genes.py | agladstein/RNA-Seq-in-the-Cloud | 4e169b1e6640ae460db5c84ee016fddb7313ccef | [
"MIT"
] | null | null | null | Metadata/data/tag_genes.py | agladstein/RNA-Seq-in-the-Cloud | 4e169b1e6640ae460db5c84ee016fddb7313ccef | [
"MIT"
] | null | null | null | from optparse import OptionParser
import json
def main():
usage = "" # TODO
parser = OptionParser(usage=usage)
#parser.add_option("-a", "--a_descrip", action="store_true", help="This is a flat")
#parser.add_option("-b", "--b_descrip", help="This is an argument")
(options, args) = parser.parse_args... | 27.515152 | 87 | 0.54185 | from optparse import OptionParser
import json
def main():
usage = ""
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
with open('transfected_sample_raw_metadata.json', 'r') as f:
sample_to_key_to_val = json.load(f)
gene_id_to_symbol = {}
gene_id_to_n... | true | true |
f7008baa955bb06131506507996a7de838f12036 | 6,104 | py | Python | Server/contact_pb2.py | raywenderlich/sc_protobufs | 64d0e53c74232d625b809a54a9626f92e5b5a986 | [
"Apache-2.0"
] | null | null | null | Server/contact_pb2.py | raywenderlich/sc_protobufs | 64d0e53c74232d625b809a54a9626f92e5b5a986 | [
"Apache-2.0"
] | null | null | null | Server/contact_pb2.py | raywenderlich/sc_protobufs | 64d0e53c74232d625b809a54a9626f92e5b5a986 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: contact.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | 33.723757 | 551 | 0.723952 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7008bf87b5a1c0780d7272b314fa3142ffb3ef3 | 18,984 | py | Python | netbox_agent/server.py | freberkivra/netbox-agent | 5f0aae6c011cd43f7d9e6d322f90a6b0f5195c61 | [
"Apache-2.0"
] | 24 | 2019-08-05T15:14:20.000Z | 2020-02-02T11:05:45.000Z | netbox_agent/server.py | freberkivra/netbox-agent | 5f0aae6c011cd43f7d9e6d322f90a6b0f5195c61 | [
"Apache-2.0"
] | 39 | 2019-08-04T18:12:07.000Z | 2020-01-30T21:42:38.000Z | netbox_agent/server.py | freberkivra/netbox-agent | 5f0aae6c011cd43f7d9e6d322f90a6b0f5195c61 | [
"Apache-2.0"
] | 8 | 2019-09-03T20:51:22.000Z | 2020-01-15T06:00:23.000Z | import netbox_agent.dmidecode as dmidecode
from netbox_agent.config import config
from netbox_agent.config import netbox_instance as nb
from netbox_agent.inventory import Inventory
from netbox_agent.location import Datacenter, Rack, Tenant
from netbox_agent.misc import create_netbox_tags, get_device_role, get_device_ty... | 36.43762 | 103 | 0.608038 | import netbox_agent.dmidecode as dmidecode
from netbox_agent.config import config
from netbox_agent.config import netbox_instance as nb
from netbox_agent.inventory import Inventory
from netbox_agent.location import Datacenter, Rack, Tenant
from netbox_agent.misc import create_netbox_tags, get_device_role, get_device_ty... | true | true |
f7008cfc80f9e3751a7d116237d6c8bfe4f57d66 | 893 | py | Python | led_demo2.py | san-carlos-tech-club/python-code | 6ad8d20419978ffbd537fb59cab8dbf4bce130fe | [
"MIT"
] | null | null | null | led_demo2.py | san-carlos-tech-club/python-code | 6ad8d20419978ffbd537fb59cab8dbf4bce130fe | [
"MIT"
] | null | null | null | led_demo2.py | san-carlos-tech-club/python-code | 6ad8d20419978ffbd537fb59cab8dbf4bce130fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import aiy.audio
import aiy.cloudspeech
import aiy.voicehat
import RPi.GPIO as GPIO
def main():
recognizer = aiy.cloudspeech.get_recognizer()
recognizer.expect_phrase('turn on the light')
recognizer.expect_phrase('turn off the light')
button = aiy.voicehat.get_button()
aiy.... | 24.135135 | 50 | 0.633819 |
import aiy.audio
import aiy.cloudspeech
import aiy.voicehat
import RPi.GPIO as GPIO
def main():
recognizer = aiy.cloudspeech.get_recognizer()
recognizer.expect_phrase('turn on the light')
recognizer.expect_phrase('turn off the light')
button = aiy.voicehat.get_button()
aiy.audio.get_recorder().s... | false | true |
f7008d92670c3650163883142c89725d1a464495 | 1,082 | py | Python | materials/sp20/project/project3/tests/q3_1_8.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | materials/sp20/project/project3/tests/q3_1_8.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | materials/sp20/project/project3/tests/q3_1_8.py | ds-modules/Deepnote-demo | 548c12ced6cae774ecd0036aa1e8bb833af6472c | [
"BSD-3-Clause"
] | null | null | null | test = {
'name': 'q3_1_8',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> genre_and_distances.labels == ('Genre', 'Distance')
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>>... | 22.081633 | 133 | 0.402033 | test = {
'name': 'q3_1_8',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> genre_and_distances.labels == ('Genre', 'Distance')
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>>... | true | true |
f7008f2091aa76b941269f244f6aa2b66995a917 | 867 | py | Python | bindings/python/examples/tunable.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | bindings/python/examples/tunable.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | bindings/python/examples/tunable.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 Stanford University
#
# 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... | 28.9 | 74 | 0.748558 |
from __future__ import print_function
import pygion
from pygion import task
@task
def main():
nprocs = pygion.Tunable.select(pygion.Tunable.GLOBAL_PYS).get()
print("Number of Python processors: %s" % nprocs)
if __name__ == '__main__':
main()
| true | true |
f7008f76e543b600fcd7b866e7bd44f5b31bbaac | 1,405 | py | Python | ooobuild/dyn/system/x_simple_mail_message.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/system/x_simple_mail_message.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/system/x_simple_mail_message.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.972973 | 92 | 0.775801 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.system import XSimpleMailMessage as XSimpleMailMessa... | true | true |
f7008fb056085ed53d88d859ea6921f6fd1e66d7 | 3,585 | py | Python | google/cloud/asset/v1p4beta1/asset-v1p4beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/asset/v1p4beta1/asset-v1p4beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/asset/v1p4beta1/asset-v1p4beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 26.954887 | 96 | 0.627336 |
import os
import pathlib
import shutil
import subprocess
import sys
import nox
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="u... | true | true |
f70090428c32764fe05fb109bcf1d9aa0d86e87c | 395 | py | Python | CongoCart/asgi.py | bshukla3041/CongoCart | 10e6cbb12393fb6c6e2b95fe5504fbeb69e01be4 | [
"MIT"
] | 1 | 2021-11-28T06:51:41.000Z | 2021-11-28T06:51:41.000Z | CongoCart/asgi.py | Vchourey/CongoCart | 10e6cbb12393fb6c6e2b95fe5504fbeb69e01be4 | [
"MIT"
] | 5 | 2020-11-05T04:40:26.000Z | 2022-03-12T00:50:49.000Z | CongoCart/asgi.py | Vchourey/CongoCart | 10e6cbb12393fb6c6e2b95fe5504fbeb69e01be4 | [
"MIT"
] | 1 | 2021-03-22T05:28:00.000Z | 2021-03-22T05:28:00.000Z | """
ASGI config for CongoCart project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CongoCart.settings')
application = get_asgi_application()
| true | true |
f70090e298a7ea7127d1e4e1f7b6e6bd2444f4d5 | 7,685 | py | Python | levels.py | IAmAbszol/CSC434AIFinalProject | e99eb420b698c9a7b6bab91d5ff0b8e6d0d48ec7 | [
"MIT"
] | 1 | 2019-02-13T12:00:54.000Z | 2019-02-13T12:00:54.000Z | levels.py | IAmAbszol/CSC434AIFinalProject | e99eb420b698c9a7b6bab91d5ff0b8e6d0d48ec7 | [
"MIT"
] | null | null | null | levels.py | IAmAbszol/CSC434AIFinalProject | e99eb420b698c9a7b6bab91d5ff0b8e6d0d48ec7 | [
"MIT"
] | null | null | null | import pygame
"""
levels.py
Houses all possible levels for the game to choose from.
Selection occurs by invoking the selected level
and by having a return tuple of (pad_sprite, trophies, car[x,y]).
Must still be rendered into the main game.
"""
class PadSprite(pygame.sprite.Sprite):
def __in... | 43.174157 | 69 | 0.609759 | import pygame
class PadSprite(pygame.sprite.Sprite):
def __init__(self, image, position):
super(PadSprite, self).__init__()
self.normal = pygame.image.load(image)
self.hit = pygame.image.load('images/collision.png')
self.rect = pygame.Rect(self.normal.get_rect())
self.rect.... | true | true |
f700912168122584b040923778840a8af9f80010 | 102 | py | Python | lista_ex7.py/exercicio3.py | robinson-1985/mentoria_exercises | 8359cead6ee5351851b04cb45f252e3881b79117 | [
"MIT"
] | null | null | null | lista_ex7.py/exercicio3.py | robinson-1985/mentoria_exercises | 8359cead6ee5351851b04cb45f252e3881b79117 | [
"MIT"
] | null | null | null | lista_ex7.py/exercicio3.py | robinson-1985/mentoria_exercises | 8359cead6ee5351851b04cb45f252e3881b79117 | [
"MIT"
] | null | null | null | ''' 3. Criar 2 matrizes 3x4 somar seus valores e armazenar o resultado em uma terceira
matriz 3x4.''' | 51 | 87 | 0.745098 | true | true | |
f70091bc00ef71cb750d7df541f40432cd5abbdb | 2,032 | py | Python | edna2/tasks/test/DozorTask/ControlDozor_plot_exec_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | null | null | null | edna2/tasks/test/DozorTask/ControlDozor_plot_exec_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | null | null | null | edna2/tasks/test/DozorTask/ControlDozor_plot_exec_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | null | null | null | #
# Copyright (c) European Synchrotron Radiation Facility (ESRF)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy,... | 40.64 | 82 | 0.749016 |
__authors__ = ["O. Svensson"]
__license__ = "MIT"
__date__ = "21/04/2019"
import os
import json
import unittest
from edna2.utils import UtilsTest
from edna2.tasks.DozorTasks import ControlDozor
class ControlDozorPlotExecTest(unittest.TestCase):
def setUp(self):
self.dataPath = Uti... | true | true |
f70092cb6fc521b2b73a69d9245778da258a42c2 | 4,282 | py | Python | rkpass/spiders/dzswMorningSpider.py | windowshappy/python | 02b43b657a284b2db300ce7d7862e5032c688b1d | [
"MIT"
] | 10 | 2019-01-17T15:09:01.000Z | 2022-03-01T06:19:22.000Z | rkpass/spiders/dzswMorningSpider.py | windowshappy/python | 02b43b657a284b2db300ce7d7862e5032c688b1d | [
"MIT"
] | null | null | null | rkpass/spiders/dzswMorningSpider.py | windowshappy/python | 02b43b657a284b2db300ce7d7862e5032c688b1d | [
"MIT"
] | 6 | 2018-10-29T15:31:50.000Z | 2020-08-13T08:34:46.000Z | # -*- coding: utf-8 -*-
import scrapy
import re
from rkpass.items import dzswMorningItem
# 电子商务设计师上午题
class DzswmorningspiderSpider(scrapy.Spider):
name = 'dzswMorningSpider'
allowed_domains = ['www.rkpass.cn']
start_urls = []
paperId_list = ['612', '541', '477', '453', '281', '280', '279', '278', '277... | 48.11236 | 204 | 0.565156 |
import scrapy
import re
from rkpass.items import dzswMorningItem
class DzswmorningspiderSpider(scrapy.Spider):
name = 'dzswMorningSpider'
allowed_domains = ['www.rkpass.cn']
start_urls = []
paperId_list = ['612', '541', '477', '453', '281', '280', '279', '278', '277', '276']
field_list = ['2018... | true | true |
f7009452b7e1d064e1688541f504bac2368a5057 | 835 | py | Python | code/functions/decoupling_regularization_prepare.py | YatongChen/decoupled_smoothing_on_graph | b5110db92841c00193577adb0f5d3daa70f46845 | [
"MIT"
] | 5 | 2019-02-25T20:05:47.000Z | 2021-06-23T21:38:52.000Z | code/functions/decoupling_regularization_prepare.py | YatongChen/decoupled_smoothing_on_graphs | b5110db92841c00193577adb0f5d3daa70f46845 | [
"MIT"
] | null | null | null | code/functions/decoupling_regularization_prepare.py | YatongChen/decoupled_smoothing_on_graphs | b5110db92841c00193577adb0f5d3daa70f46845 | [
"MIT"
] | null | null | null | def decoupling_regularization_prepare(graph, sigma_square,lambda_input):
# get W matrix, Z(for row sum) and Z_prime(for col sum), and A_tilde
# get matrix W:
A = np.array(nx.adjacency_matrix(graph).todense())
d = np.sum(A, axis=1)
D = np.diag(d)
n = len(D)
# Alternative way(19): set Sigma_s... | 30.925926 | 90 | 0.656287 | def decoupling_regularization_prepare(graph, sigma_square,lambda_input):
A = np.array(nx.adjacency_matrix(graph).todense())
d = np.sum(A, axis=1)
D = np.diag(d)
n = len(D)
Sigma_square = np.divide(sigma_square,d)
Sigma = np.diag(Sigma_square)
W = np.dot(A,inv(Sigma))
la... | true | true |
f7009467efb42d80a93347714e1b721a66b8decf | 933 | py | Python | spacy/lang/tt/punctuation.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 5 | 2019-04-19T06:27:29.000Z | 2019-12-02T13:30:47.000Z | spacy/lang/tt/punctuation.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | null | null | null | spacy/lang/tt/punctuation.py | algteam/spacy_zh_model | 0b0cba1a3964aa426e5f96087849c90e69e2a89d | [
"MIT"
] | 2 | 2019-04-19T06:27:18.000Z | 2019-10-04T12:39:15.000Z | # coding: utf8
from __future__ import unicode_literals
from ..char_classes import ALPHA, ALPHA_LOWER, ALPHA_UPPER, QUOTES, HYPHENS
from ..char_classes import LIST_ELLIPSES, LIST_ICONS
_hyphens_no_dash = HYPHENS.replace('-', '').strip('|').replace('||', '')
_infixes = (LIST_ELLIPSES + LIST_ICONS +
... | 46.65 | 81 | 0.438371 |
from __future__ import unicode_literals
from ..char_classes import ALPHA, ALPHA_LOWER, ALPHA_UPPER, QUOTES, HYPHENS
from ..char_classes import LIST_ELLIPSES, LIST_ICONS
_hyphens_no_dash = HYPHENS.replace('-', '').strip('|').replace('||', '')
_infixes = (LIST_ELLIPSES + LIST_ICONS +
[r'(?<=[{}])\.(... | true | true |
f7009491b89853fce1d4d18ea9022444bb997b6d | 6,123 | py | Python | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/doc_fragments/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/doc_fragments/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/community/sops/plugins/doc_fragments/sops.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
DOCUMENTATION = r'''... | 34.206704 | 98 | 0.59595 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
sops_binary:
description:
- Path to the sops binary.
- By default uses C(sops).
type: path
version_added: ... | true | true |
f700950d8b7c76e4f4003f45415bb8ac034eead4 | 1,492 | py | Python | tests/test_exceptions.py | meherett/pyxdc | c7e9283ce47a911b2e619e286ba443ec6c022790 | [
"MIT"
] | 4 | 2021-05-03T06:13:04.000Z | 2022-02-28T07:43:31.000Z | tests/test_exceptions.py | meherett/pyxdc | c7e9283ce47a911b2e619e286ba443ec6c022790 | [
"MIT"
] | null | null | null | tests/test_exceptions.py | meherett/pyxdc | c7e9283ce47a911b2e619e286ba443ec6c022790 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from pyxdc.exceptions import (
ProviderError, BalanceError, APIError, AddressError, InvalidURLError,
ClientError, NotFoundError, UnitError
)
import pytest
def test_exceptions():
with pytest.raises(ProviderError, match="error"):
raise ProviderError("error")
with pytest... | 36.390244 | 73 | 0.679625 |
from pyxdc.exceptions import (
ProviderError, BalanceError, APIError, AddressError, InvalidURLError,
ClientError, NotFoundError, UnitError
)
import pytest
def test_exceptions():
with pytest.raises(ProviderError, match="error"):
raise ProviderError("error")
with pytest.raises(ProviderError,... | true | true |
f70095cca0c48d2a0a12b85e465d3557a4792287 | 3,179 | py | Python | test/apis/test_convert_api.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | 5 | 2019-11-21T04:58:45.000Z | 2021-02-05T05:22:37.000Z | test/apis/test_convert_api.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | null | null | null | test/apis/test_convert_api.py | groupdocs-conversion-cloud/groupdocs-conversion-cloud-python | 841d06ad3205e10e8f2726517779ac2d7c33a02a | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and ass... | 38.301205 | 85 | 0.672539 |
from __future__ import absolute_import
import unittest
import os
from groupdocs_conversion_cloud import *
from test.test_context import TestContext
from test.test_file import TestFile
class TestConvertApi(TestContext):
def test_convert_document(self):
test_file = TestFile.one_... | true | true |
f700969b9239575a2ccde759ad10177179f6a30d | 3,430 | py | Python | build/lib/pygcn/utils.py | Pengchengpcx/Neighbor-Sampling-GCN | 4b47385bdbfeb5957a56b05c441482e701dd10de | [
"MIT"
] | null | null | null | build/lib/pygcn/utils.py | Pengchengpcx/Neighbor-Sampling-GCN | 4b47385bdbfeb5957a56b05c441482e701dd10de | [
"MIT"
] | null | null | null | build/lib/pygcn/utils.py | Pengchengpcx/Neighbor-Sampling-GCN | 4b47385bdbfeb5957a56b05c441482e701dd10de | [
"MIT"
] | null | null | null | import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get, labels)),
dtype... | 34.3 | 84 | 0.644315 | import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get, labels)),
dtype... | true | true |
f70096ab58ef93a1ddc7d2167014f93b402ca48b | 1,262 | py | Python | sdk/python/pulumi_azure_native/policyinsights/v20190701/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/policyinsights/v20190701/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/policyinsights/v20190701/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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... | 31.55 | 115 | 0.673534 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'RemediationFiltersArgs',
]
@pulumi.input_type
class RemediationFiltersArgs:
def __init__(__self__, *,
loca... | true | true |
f70096e5afdc64274cfbe8396736ce29e72dab01 | 178 | py | Python | decode/test.py | Brook1711/openda1 | 1d67912083ecf60b04daa6d9cf377339d179b1aa | [
"Apache-2.0"
] | null | null | null | decode/test.py | Brook1711/openda1 | 1d67912083ecf60b04daa6d9cf377339d179b1aa | [
"Apache-2.0"
] | null | null | null | decode/test.py | Brook1711/openda1 | 1d67912083ecf60b04daa6d9cf377339d179b1aa | [
"Apache-2.0"
] | null | null | null | import ast
with open('./test.txt',"r") as f: #设置文件对象
str = f.read() #可以是随便对文件的操作
print(str)
frame_list = ast.literal_eval(str)
for frame in frame_list:
print(frame) | 25.428571 | 44 | 0.668539 | import ast
with open('./test.txt',"r") as f:
str = f.read()
print(str)
frame_list = ast.literal_eval(str)
for frame in frame_list:
print(frame) | true | true |
f700972da3f6e769ff83355b91b6d1a68f9ff682 | 318 | py | Python | src/census2020/constants.py | khwilson/Census2020 | 906210b70feff45f7cf4ce82f71227a556ac86eb | [
"MIT"
] | null | null | null | src/census2020/constants.py | khwilson/Census2020 | 906210b70feff45f7cf4ce82f71227a556ac86eb | [
"MIT"
] | null | null | null | src/census2020/constants.py | khwilson/Census2020 | 906210b70feff45f7cf4ce82f71227a556ac86eb | [
"MIT"
] | null | null | null | """
Package-level constants
"""
from strenum import StrEnum
class SummaryLevel(StrEnum):
"""
Values for the SUMLEV column in PL94 data
"""
STATE = "040"
STATE_COUNTY = "050"
STATE_COUNTY_TRACT = "140"
STATE_COUNTY_TRACT_BLOCKGROUP = "150"
STATE_COUNTY_TRACT_BLOCKGROUP_BLOCK = "750"
| 18.705882 | 47 | 0.68239 | from strenum import StrEnum
class SummaryLevel(StrEnum):
STATE = "040"
STATE_COUNTY = "050"
STATE_COUNTY_TRACT = "140"
STATE_COUNTY_TRACT_BLOCKGROUP = "150"
STATE_COUNTY_TRACT_BLOCKGROUP_BLOCK = "750"
| true | true |
f700996f33ae0acd30aa7455caa3d1971ab521bd | 439 | py | Python | pyradox-master/tests/group_test.py | SaucyPigeon/ck3_mapdata | 5c24950cc5b23a08927be2833b8b3597a7e6bf12 | [
"MIT"
] | 20 | 2015-03-17T22:40:28.000Z | 2022-01-24T19:44:17.000Z | pyradox-master/tests/group_test.py | SaucyPigeon/ck3_mapdata | 5c24950cc5b23a08927be2833b8b3597a7e6bf12 | [
"MIT"
] | 21 | 2015-02-06T06:42:14.000Z | 2022-01-03T23:23:17.000Z | pyradox-master/tests/group_test.py | SaucyPigeon/ck3_mapdata | 5c24950cc5b23a08927be2833b8b3597a7e6bf12 | [
"MIT"
] | 10 | 2017-04-05T19:46:18.000Z | 2022-03-16T10:57:37.000Z | import _initpath
import pyradox
#result = pyradox.txt.parse_file('D:/Steam/steamapps/common/Europa Universalis IV/common/prices/00_prices.txt')
#print(result)
result = pyradox.parse("""
regular_group = { 1 2 3 }
empty_tree = {}
mixed_group = {
10
{}
{ a = 1 b = 2 }
20
}
player_countries={
ITA={
... | 12.911765 | 111 | 0.637813 | import _initpath
import pyradox
result = pyradox.parse("""
regular_group = { 1 2 3 }
empty_tree = {}
mixed_group = {
10
{}
{ a = 1 b = 2 }
20
}
player_countries={
ITA={
user="Evil4Zerggin"
country_leader=yes
pinned_theatres={
{
id=16
type=67
}
}
}
}
""")
print(result)
| true | true |
f70099ac7223f1be8c17620e702c90a2d07be3fd | 88,913 | py | Python | experimental/python/balancetwo.py | mgaertne/minqlx-plugin-tests | 10a827fe063c86481560dcc00a8a3ce2ba60861b | [
"BSD-3-Clause"
] | 4 | 2017-11-01T04:49:27.000Z | 2020-08-08T12:11:51.000Z | experimental/python/balancetwo.py | mgaertne/minqlx-plugin-tests | 10a827fe063c86481560dcc00a8a3ce2ba60861b | [
"BSD-3-Clause"
] | null | null | null | experimental/python/balancetwo.py | mgaertne/minqlx-plugin-tests | 10a827fe063c86481560dcc00a8a3ce2ba60861b | [
"BSD-3-Clause"
] | 1 | 2021-04-26T09:04:36.000Z | 2021-04-26T09:04:36.000Z | """
This is a plugin created by ShiN0
Copyright (c) 2020 ShiN0
<https://www.github.com/mgaertne/minqlx-plugin-tests>
You are free to modify this plugin to your own one.
"""
import minqlx
from minqlx import Plugin
from minqlx.database import Redis
import os
import math
import time
import random
import itertools
impo... | 41.374128 | 120 | 0.611193 |
import minqlx
from minqlx import Plugin
from minqlx.database import Redis
import os
import math
import time
import random
import itertools
import threading
from abc import abstractmethod
from operator import itemgetter
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.r... | true | true |
f7009b4a3e0f76e4a30b837e13cb2e62eac4f449 | 180 | py | Python | my_project/my_app/migrations/__init__.py | sotch-pr35mac/clinc-business-logic-server-template-python | 6178edb7b3bb368376720fe2baf0babe65a37329 | [
"BSD-3-Clause"
] | 1 | 2019-11-11T15:40:35.000Z | 2019-11-11T15:40:35.000Z | my_project/my_app/migrations/__init__.py | sotch-pr35mac/clinc-business-logic-server-template-python | 6178edb7b3bb368376720fe2baf0babe65a37329 | [
"BSD-3-Clause"
] | 3 | 2018-08-06T20:43:38.000Z | 2021-06-10T20:43:52.000Z | my_project/my_app/migrations/__init__.py | sotch-pr35mac/clinc-business-logic-server-template-python | 6178edb7b3bb368376720fe2baf0babe65a37329 | [
"BSD-3-Clause"
] | 2 | 2018-08-06T18:37:39.000Z | 2019-05-23T13:27:56.000Z | """
Module imports for templates.python.business_logic.my_project.my_app.migrations
This file is automatically generated by ./scripts/empty_pyinit.sh
DO NOT EDIT IT MANUALLY
"""
| 22.5 | 79 | 0.805556 | true | true | |
f7009c28eb8ff4184e41f42c2af62fb88a7ff608 | 436 | py | Python | lib/PyAMF-0.7.2/pyamf/adapters/tests/django_app/settings.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 2 | 2019-10-28T07:28:38.000Z | 2019-12-07T09:59:43.000Z | lib/PyAMF-0.7.2/pyamf/adapters/tests/django_app/settings.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 1 | 2017-08-10T13:14:13.000Z | 2017-08-25T05:30:36.000Z | lib/PyAMF-0.7.2/pyamf/adapters/tests/django_app/settings.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 3 | 2016-12-17T01:27:57.000Z | 2018-04-05T18:03:09.000Z | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
# The simplest Django settings possible
# support for Django < 1.5
DATABASE_ENGINE = 'django.db.backends.sqlite3'
DATABASE_NAME = ':memory:'
# support for Django >= 1.5
SECRET_KEY = 'unittest'
DATABASES = {
'default': {
'ENGINE': DATABASE... | 18.956522 | 46 | 0.678899 |
DATABASE_ENGINE = 'django.db.backends.sqlite3'
DATABASE_NAME = ':memory:'
SECRET_KEY = 'unittest'
DATABASES = {
'default': {
'ENGINE': DATABASE_ENGINE,
'NAME': DATABASE_NAME,
}
}
INSTALLED_APPS = ('django_app.adapters',)
MIDDLEWARE_CLASSES = ()
| true | true |
f7009c76b960f0e50baf3e0c331a76df5cc5279b | 9,074 | py | Python | src/ezdxf/addons/drawing/mtext_complex.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | src/ezdxf/addons/drawing/mtext_complex.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | src/ezdxf/addons/drawing/mtext_complex.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2021, Manfred Moitzi
# License: MIT License
import copy
import math
from typing import Iterable, List, Optional, Tuple
from ezdxf import colors
from ezdxf.entities import MText
from ezdxf.lldxf import const
from ezdxf.math import Matrix44, Vec3
from ezdxf.render.abstract_mtext_renderer import Abstrac... | 31.506944 | 87 | 0.593674 |
import copy
import math
from typing import Iterable, List, Optional, Tuple
from ezdxf import colors
from ezdxf.entities import MText
from ezdxf.lldxf import const
from ezdxf.math import Matrix44, Vec3
from ezdxf.render.abstract_mtext_renderer import AbstractMTextRenderer
from ezdxf.tools import text_layout as tl, fo... | true | true |
f7009d2e09408a9bdf32bbc1b599b260d75cd5d6 | 2,855 | py | Python | tests/utils/database.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:22:23.000Z | 2022-03-15T07:25:06.000Z | tests/utils/database.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:19:03.000Z | 2022-02-16T10:24:57.000Z | tests/utils/database.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 12 | 2018-03-28T14:15:43.000Z | 2021-07-19T17:33:20.000Z | # -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
"""database.py
Testing utils for creating database records ... | 26.682243 | 78 | 0.638879 |
from tests.utils import default_board_id, default_repo_id, default_list_id, \
default_issue_id, default_card_id, default_pull_request_id
from app import db
from app.models import Board, Issue, List, PullRequest, Repo, Subscription, \
SubscribedList
def create_board():
db.session.add(
... | true | true |
f7009d94e714d0a789f19656b62cc52da794095b | 1,426 | py | Python | postcodeinfo/apps/postcode_api/migrations/0004_local_authorities_and_gss_codes.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | null | null | null | postcodeinfo/apps/postcode_api/migrations/0004_local_authorities_and_gss_codes.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | null | null | null | postcodeinfo/apps/postcode_api/migrations/0004_local_authorities_and_gss_codes.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | 1 | 2021-04-11T09:12:19.000Z | 2021-04-11T09:12:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('postcode_api', '0003_populate_postcode_area'),
]
operations = [
migrations.CreateModel(
name='LocalAuthority',
... | 29.708333 | 70 | 0.495792 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('postcode_api', '0003_populate_postcode_area'),
]
operations = [
migrations.CreateModel(
name='LocalAuthority',
fields=[
... | true | true |
f7009dcf50aae16de77397752b83afd09472de19 | 1,089 | py | Python | superviselySDK/supervisely_lib/api/plugin_api.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 40 | 2019-05-05T08:08:18.000Z | 2021-10-17T00:07:58.000Z | superviselySDK/supervisely_lib/api/plugin_api.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 8 | 2019-06-13T06:00:08.000Z | 2021-07-24T05:25:33.000Z | superviselySDK/supervisely_lib/api/plugin_api.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 6 | 2019-07-30T06:36:27.000Z | 2021-06-03T11:57:36.000Z | # coding: utf-8
from collections import namedtuple
from supervisely_lib.api.module_api import ApiField, ModuleApi
from supervisely_lib._utils import camel_to_snake
class PluginApi(ModuleApi):
_info_sequence = [ApiField.ID,
ApiField.NAME,
ApiField.DESCRIPTION,
... | 38.892857 | 116 | 0.607897 |
from collections import namedtuple
from supervisely_lib.api.module_api import ApiField, ModuleApi
from supervisely_lib._utils import camel_to_snake
class PluginApi(ModuleApi):
_info_sequence = [ApiField.ID,
ApiField.NAME,
ApiField.DESCRIPTION,
Ap... | true | true |
f7009ea19933115ba936fea917bd4dfe3e15d011 | 4,755 | py | Python | examples/pervasive/modules/archive/expanding_resnet.py | EricLina/attn2d | 982653439dedc7306e484e00b3dfb90e2cd7c9e1 | [
"MIT"
] | 490 | 2018-08-18T14:25:38.000Z | 2022-03-25T12:19:35.000Z | examples/Supervised_simul_MT/modules/archive/expanding_resnet.py | sfu-natlang/Supervised-Simultaneous-MT | 12c3a53887c985ae24199ecef2f7b2335fe214c6 | [
"MIT"
] | 17 | 2018-08-23T06:04:29.000Z | 2022-03-26T07:35:26.000Z | examples/Supervised_simul_MT/modules/archive/expanding_resnet.py | sfu-natlang/Supervised-Simultaneous-MT | 12c3a53887c985ae24199ecef2f7b2335fe214c6 | [
"MIT"
] | 80 | 2018-08-20T09:54:49.000Z | 2022-03-22T01:18:23.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn as nn... | 34.208633 | 127 | 0.584648 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.modules import (
MaskedConvolution, MultiheadMaskedConvolution
)
class ExpandingResNet(nn.Module):
def __init__(self, num_init_features, args):
super().__init__()
num_layers = args.num_layers
num... | true | true |
f7009f2166caae3aa854a4fb28afdbb6002280e5 | 1,450 | py | Python | ABC151D/test_pasted_from_page.py | staguchi0703/prob_boot_camp_difficult | 77c2adcac98b6f84049acd66ead62e30dc48fa8b | [
"MIT"
] | null | null | null | ABC151D/test_pasted_from_page.py | staguchi0703/prob_boot_camp_difficult | 77c2adcac98b6f84049acd66ead62e30dc48fa8b | [
"MIT"
] | null | null | null | ABC151D/test_pasted_from_page.py | staguchi0703/prob_boot_camp_difficult | 77c2adcac98b6f84049acd66ead62e30dc48fa8b | [
"MIT"
] | null | null | null | #
from resolve import resolve
####################################
####################################
# 以下にプラグインの内容をペーストする
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout... | 22.65625 | 59 | 0.351724 |
from resolve import resolve
IO(input, output)
if __name__ == "__main__":
unittest.main() | true | true |
f7009fc34cb0dbf6679b794632fa7f4f545835a6 | 1,455 | py | Python | catalyst/contrib/datasets/imagewang.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 2,693 | 2019-01-23T19:16:12.000Z | 2022-03-31T02:12:42.000Z | catalyst/contrib/datasets/imagewang.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 763 | 2019-01-22T20:12:56.000Z | 2022-03-27T18:36:10.000Z | catalyst/contrib/datasets/imagewang.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 445 | 2019-01-23T17:07:09.000Z | 2022-03-30T05:38:45.000Z | from catalyst.contrib.datasets.misc_cv import ImageClassificationDataset
class Imagewang(ImageClassificationDataset):
"""
`Imagewang <https://github.com/fastai/imagenette#image%E7%BD%91>`_ Dataset.
.. note::
catalyst[cv] required for this dataset.
"""
name = "imagewang"
resources = [... | 25.086207 | 79 | 0.629553 | from catalyst.contrib.datasets.misc_cv import ImageClassificationDataset
class Imagewang(ImageClassificationDataset):
name = "imagewang"
resources = [
(
"https://s3.amazonaws.com/fast-ai-imageclas/imagewang.tgz",
"46f9749616a29837e7cd67b103396f6e",
)
]
class Imag... | true | true |
f7009fe5893e095621033c84f03e04542a553ee8 | 22,272 | py | Python | python/pyspark/sql/context.py | levyx/spark | 274f3b9ec86e4109c7678eef60f990d41dc3899f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 1 | 2016-07-29T06:38:10.000Z | 2016-07-29T06:38:10.000Z | python/pyspark/sql/context.py | hgd250/spark | 274f3b9ec86e4109c7678eef60f990d41dc3899f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | null | null | null | python/pyspark/sql/context.py | hgd250/spark | 274f3b9ec86e4109c7678eef60f990d41dc3899f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"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 us... | 39.349823 | 100 | 0.637213 |
from __future__ import print_function
import sys
import warnings
if sys.version >= '3':
basestring = unicode = str
from pyspark import since
from pyspark.rdd import ignore_unicode_prefix
from pyspark.sql.session import _monkey_patch_RDD, SparkSession
from pyspark.sql.dataframe import DataFrame
fr... | true | true |
f700a06f300a9f5f4c49afdae6d20eb6a25982c7 | 1,672 | py | Python | src/google_foobar/P008_carrotland/solution_01_tests.py | lakshmikanth-tesla/ProgrammingProblems | be67c9ad607e22c04634095a987f84967560568c | [
"MIT"
] | 1 | 2016-06-05T20:05:23.000Z | 2016-06-05T20:05:23.000Z | src/google_foobar/P008_carrotland/solution_01_tests.py | vikash-india/ProgrammingProblems | 2768bd6a61bfde705661e31dfe8374a0973e032b | [
"MIT"
] | null | null | null | src/google_foobar/P008_carrotland/solution_01_tests.py | vikash-india/ProgrammingProblems | 2768bd6a61bfde705661e31dfe8374a0973e032b | [
"MIT"
] | 1 | 2019-07-12T13:19:32.000Z | 2019-07-12T13:19:32.000Z | import unittest
from src.google_foobar.P008_carrotland.solution_01 import answer
class TestSolution(unittest.TestCase):
def testcase_001(self):
vertices = [[2, 3], [6, 9], [10, 160]]
expected = 289
self.assertEqual(answer(vertices), expected)
def testcase_002(self):
vertices ... | 30.4 | 69 | 0.617823 | import unittest
from src.google_foobar.P008_carrotland.solution_01 import answer
class TestSolution(unittest.TestCase):
def testcase_001(self):
vertices = [[2, 3], [6, 9], [10, 160]]
expected = 289
self.assertEqual(answer(vertices), expected)
def testcase_002(self):
vertices ... | true | true |
f700a0983480be6b04dcd914082502902f1a7ed5 | 5,717 | py | Python | jacket/tests/compute/unit/test_test.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/test_test.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/test_test.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 30.736559 | 79 | 0.533147 |
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
import six
from jacket import rpc
from jacket.compute import test
from jacket.tests.compute import fixtures
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('use_local', 'compute.condu... | true | true |
f700a0f85c56c6c32dc9556cd94098aa1d2efe6b | 863 | py | Python | experiment/exp1x.py | nguyen-binh-minh/logographic | 0f8ba133de7613ab2b3f90bac6860d6bc839a580 | [
"MIT"
] | null | null | null | experiment/exp1x.py | nguyen-binh-minh/logographic | 0f8ba133de7613ab2b3f90bac6860d6bc839a580 | [
"MIT"
] | null | null | null | experiment/exp1x.py | nguyen-binh-minh/logographic | 0f8ba133de7613ab2b3f90bac6860d6bc839a580 | [
"MIT"
] | null | null | null | from keras.layers import Input
from keras.layers.merge import Concatenate
from keras.models import Model
from keras.optimizers import Adam
from .keras_base import KerasBaseExp
from .keras_base import exp_bag_of_strokes
from .blocks import fc_branch, final_type1
class mlp_type1(KerasBaseExp):
def initialize_mode... | 28.766667 | 96 | 0.71263 | from keras.layers import Input
from keras.layers.merge import Concatenate
from keras.models import Model
from keras.optimizers import Adam
from .keras_base import KerasBaseExp
from .keras_base import exp_bag_of_strokes
from .blocks import fc_branch, final_type1
class mlp_type1(KerasBaseExp):
def initialize_mode... | true | true |
f700a130ca97bf4d018305705d64aaf883b87d2c | 5,998 | py | Python | ansible_collections/infoblox/b1ddi_modules/plugins/module_utils/b1ddi.py | anagha-infoblox/bloxone-ansible | d316e41557ad5bc47dd162d1ddb91074d09a60c8 | [
"Apache-2.0"
] | null | null | null | ansible_collections/infoblox/b1ddi_modules/plugins/module_utils/b1ddi.py | anagha-infoblox/bloxone-ansible | d316e41557ad5bc47dd162d1ddb91074d09a60c8 | [
"Apache-2.0"
] | null | null | null | ansible_collections/infoblox/b1ddi_modules/plugins/module_utils/b1ddi.py | anagha-infoblox/bloxone-ansible | d316e41557ad5bc47dd162d1ddb91074d09a60c8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Infoblox, Inc.
# Authors: Amit Mishra (@amishra2-infoblox), Vedant Sethia (@vedantsethia)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
try:
... | 35.076023 | 92 | 0.540013 |
from __future__ import (absolute_import, division, print_function)
try:
import requests
import json
import ipaddress
except:
raise ImportError("Requests module not found")
__metaclass__ = type
class Request(object):
def __init__(self,baseUrl, token):
self.baseUrl = baseUrl
s... | true | true |
f700a1d431d9e390aad8785a431875b52d31a7b2 | 1,626 | py | Python | auth-api/src/auth_api/resources/products.py | karthik-aot/sbc-auth | f24028040fda67d4f10ae9b608b8832c15d2a8ad | [
"Apache-2.0"
] | 11 | 2019-09-26T06:58:25.000Z | 2022-01-26T06:19:39.000Z | auth-api/src/auth_api/resources/products.py | karthik-aot/sbc-auth | f24028040fda67d4f10ae9b608b8832c15d2a8ad | [
"Apache-2.0"
] | 1,622 | 2019-05-07T21:08:38.000Z | 2022-03-28T17:07:15.000Z | auth-api/src/auth_api/resources/products.py | karthik-aot/sbc-auth | f24028040fda67d4f10ae9b608b8832c15d2a8ad | [
"Apache-2.0"
] | 98 | 2019-03-01T21:36:15.000Z | 2021-12-01T22:11:25.000Z | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 35.347826 | 108 | 0.739237 |
import json
from flask_restx import Namespace, Resource, cors
from auth_api import status as http_status
from auth_api.exceptions import BusinessException
from auth_api.services import Product as ProductService
from auth_api.tracer import Tracer
from auth_api.utils.util import cors_preflight
API = Nam... | true | true |
f700a20eb33e366942863503870fbc184e8babd3 | 5,114 | py | Python | arviz/plots/autocorrplot.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | 1 | 2021-06-13T00:29:11.000Z | 2021-06-13T00:29:11.000Z | arviz/plots/autocorrplot.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | 1 | 2021-07-23T19:32:21.000Z | 2021-07-23T19:32:21.000Z | arviz/plots/autocorrplot.py | FabioRosado/arviz | 6b958cc5abeb0cc3a1186f4a3dbeeaba73b899ee | [
"Apache-2.0"
] | 1 | 2019-03-02T03:23:12.000Z | 2019-03-02T03:23:12.000Z | """Autocorrelation plot of data."""
from ..data import convert_to_dataset
from ..labels import BaseLabeller
from ..sel_utils import xarray_var_iter
from ..rcparams import rcParams
from ..utils import _var_names
from .plot_utils import default_grid, filter_plotters_list, get_plotting_function
def plot_autocorr(
da... | 33.424837 | 100 | 0.674814 | from ..data import convert_to_dataset
from ..labels import BaseLabeller
from ..sel_utils import xarray_var_iter
from ..rcparams import rcParams
from ..utils import _var_names
from .plot_utils import default_grid, filter_plotters_list, get_plotting_function
def plot_autocorr(
data,
var_names=None,
filter_v... | true | true |
f700a2bdcc88af97d37ad62b96b2fa84a6190b83 | 755 | py | Python | authentication/admin.py | TechnoServe/Caju-Dashboard-v1 | ee5cde55d5700abd6223bb464fec4efa708dfdfc | [
"MIT"
] | null | null | null | authentication/admin.py | TechnoServe/Caju-Dashboard-v1 | ee5cde55d5700abd6223bb464fec4efa708dfdfc | [
"MIT"
] | null | null | null | authentication/admin.py | TechnoServe/Caju-Dashboard-v1 | ee5cde55d5700abd6223bb464fec4efa708dfdfc | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
from django.contrib import admin
# Register your models here.
from django.contrib import admin
from .models import RemOrganization, RemRole, RemUser, Nursery, NurseryPlantsHistory, MotherTree, Plantation, BeninYield, AlteiaData, DeptSatellite,... | 29.038462 | 179 | 0.813245 |
from django.contrib import admin
from django.contrib import admin
from .models import RemOrganization, RemRole, RemUser, Nursery, NurseryPlantsHistory, MotherTree, Plantation, BeninYield, AlteiaData, DeptSatellite, CommuneSatellite, SpecialTuple
admin.site.register(RemOrganization)
admin.site.register(RemRole)
ad... | true | true |
f700a2d53401ad7f036b114a974636da78dec066 | 127,983 | py | Python | tests/ga/test_update.py | dhivyaganesan/WALinuxAgent | 9b8e8d319d3188f07724da6d435883f344c77b65 | [
"Apache-2.0"
] | 1 | 2021-02-08T09:41:06.000Z | 2021-02-08T09:41:06.000Z | tests/ga/test_update.py | weidongkl/WALinuxAgent | 69ace490f62c04bc63dc0447c54dc5641332ff0d | [
"Apache-2.0"
] | null | null | null | tests/ga/test_update.py | weidongkl/WALinuxAgent | 69ace490f62c04bc63dc0447c54dc5641332ff0d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License.
from __future__ import print_function
import contextlib
import glob
import json
import os
import re
import shutil
import stat
import subprocess
import sys
import tempfile
import time
import unittest
import zipfile
from da... | 49.721445 | 190 | 0.686763 |
from __future__ import print_function
import contextlib
import glob
import json
import os
import re
import shutil
import stat
import subprocess
import sys
import tempfile
import time
import unittest
import zipfile
from datetime import datetime, timedelta
from threading import currentThread
_ORIGINAL_POPEN = subpro... | true | true |
f700a2d6a17e2fe83810602d327a20e948b905b8 | 2,532 | py | Python | template/image/gif.py | clayne/syringe-1 | 4a431aa65c371a2018fca95145a3952ba802a609 | [
"BSD-2-Clause"
] | 25 | 2015-04-14T21:53:46.000Z | 2022-03-30T19:15:24.000Z | template/image/gif.py | clayne/syringe-1 | 4a431aa65c371a2018fca95145a3952ba802a609 | [
"BSD-2-Clause"
] | 5 | 2020-03-23T20:19:59.000Z | 2021-05-24T19:38:31.000Z | template/image/gif.py | clayne/syringe-1 | 4a431aa65c371a2018fca95145a3952ba802a609 | [
"BSD-2-Clause"
] | 7 | 2015-07-31T13:26:37.000Z | 2021-03-05T19:35:37.000Z | from ptypes import *
class Header(pstruct.type):
_fields_ = [
(dyn.block(3), 'Signature'),
(dyn.block(3), 'Version'),
]
class LogicalScreenDescriptor(pstruct.type):
class _Flags(pbinary.struct):
_fields_ = [(1, 'Global Color Table'), (3, 'Color Resolution'), (1, 'Sort'), (3, 'Size'... | 26.93617 | 106 | 0.5703 | from ptypes import *
class Header(pstruct.type):
_fields_ = [
(dyn.block(3), 'Signature'),
(dyn.block(3), 'Version'),
]
class LogicalScreenDescriptor(pstruct.type):
class _Flags(pbinary.struct):
_fields_ = [(1, 'Global Color Table'), (3, 'Color Resolution'), (1, 'Sort'), (3, 'Size'... | true | true |
f700a3646ef373f0c80bd2f7108ae24442bd12c3 | 13,452 | py | Python | lib-python/3/test/test_peepholer.py | hausen/pypy3.6-7.3.0-osx | 462c07a2a2c152983281d5173e180dd0a3cbd8d2 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/3/test/test_peepholer.py | hausen/pypy3.6-7.3.0-osx | 462c07a2a2c152983281d5173e180dd0a3cbd8d2 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/3/test/test_peepholer.py | hausen/pypy3.6-7.3.0-osx | 462c07a2a2c152983281d5173e180dd0a3cbd8d2 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import dis
import re
import sys
import textwrap
import unittest
from test.support import cpython_only
from test.bytecode_helper import BytecodeTestCase
class TestTranforms(BytecodeTestCase):
def test_unot(self):
# UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE'
def unot(x):
if not... | 39.44868 | 81 | 0.509813 | import dis
import re
import sys
import textwrap
import unittest
from test.support import cpython_only
from test.bytecode_helper import BytecodeTestCase
class TestTranforms(BytecodeTestCase):
def test_unot(self):
def unot(x):
if not x == 2:
del x
self.assertNot... | true | true |
f700a37bd384a6b65858120edcefde6463b27494 | 104 | py | Python | plushcap/__init__.py | makaimc/plushcap | a95469710984ebf9c34f23ce3c7a33196b85172d | [
"BSD-3-Clause"
] | 2 | 2015-07-18T03:54:20.000Z | 2016-03-29T22:21:50.000Z | plushcap/__init__.py | mattmakai/plushcap-sms | a95469710984ebf9c34f23ce3c7a33196b85172d | [
"BSD-3-Clause"
] | null | null | null | plushcap/__init__.py | mattmakai/plushcap-sms | a95469710984ebf9c34f23ce3c7a33196b85172d | [
"BSD-3-Clause"
] | 2 | 2015-03-01T15:19:58.000Z | 2015-07-18T03:54:22.000Z | # -*- coding: utf-8 -*-
__author__ = 'Matt Makai'
__email__ = 'mmakai@twilio.com'
__version__ = '0.1.0' | 20.8 | 31 | 0.644231 |
__author__ = 'Matt Makai'
__email__ = 'mmakai@twilio.com'
__version__ = '0.1.0' | true | true |
f700a416cddf7700b768948b47eefbd9d1c95f58 | 2,572 | py | Python | gammapy/utils/fitting/tests/test_iminuit.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/utils/fitting/tests/test_iminuit.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/utils/fitting/tests/test_iminuit.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from numpy.testing import assert_allclose
from .. import Parameter, Parameters, optimize_iminuit
pytest.importorskip("iminuit")
def fcn(parameters):
x = parameters["x"].value
y = parameters["y"].value
z = parameters["z"].value
... | 31.365854 | 95 | 0.668351 |
import pytest
from numpy.testing import assert_allclose
from .. import Parameter, Parameters, optimize_iminuit
pytest.importorskip("iminuit")
def fcn(parameters):
x = parameters["x"].value
y = parameters["y"].value
z = parameters["z"].value
x_opt, y_opt, z_opt = 2, 3e5, 4e-5
x_err, y_err, z_err ... | true | true |
f700a493786519b523310641c62427069b266f4e | 290 | py | Python | contest/abc001/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc001/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc001/B.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | m = int(input())
m /= 1000
if m < 0.1:
print('00')
elif 0.1 <= m and m <= 5:
m = str(int(10 * m))
if len(m) == 1:
m = '0' + m
print(m)
elif 6 <= m and m <= 30:
print(int(m) + 50)
elif 35 <= m and m <= 70:
print((int(m) - 30) // 5 + 80)
else:
print('89')
| 18.125 | 34 | 0.431034 | m = int(input())
m /= 1000
if m < 0.1:
print('00')
elif 0.1 <= m and m <= 5:
m = str(int(10 * m))
if len(m) == 1:
m = '0' + m
print(m)
elif 6 <= m and m <= 30:
print(int(m) + 50)
elif 35 <= m and m <= 70:
print((int(m) - 30) // 5 + 80)
else:
print('89')
| true | true |
f700a51264270b80949b97bb209feb0811f5e21a | 3,610 | py | Python | stribor/flow.py | mbilos/stribor | 76082c255653d6bd8d506519223183e5d8395578 | [
"MIT"
] | 10 | 2021-06-23T17:14:25.000Z | 2022-03-08T11:34:18.000Z | stribor/flow.py | mbilos/stribor | 76082c255653d6bd8d506519223183e5d8395578 | [
"MIT"
] | null | null | null | stribor/flow.py | mbilos/stribor | 76082c255653d6bd8d506519223183e5d8395578 | [
"MIT"
] | 1 | 2021-03-11T13:34:44.000Z | 2021-03-11T13:34:44.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as td
class Flow(nn.Module):
"""
Building both normalizing flows and neural flows.
Example:
>>> import stribor as st
>>> torch.manual_seed(123)
>>> dim = 2
>>> flow = st.Flow(st.UnitN... | 38 | 88 | 0.579501 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as td
class Flow(nn.Module):
def __init__(self, base_dist=None, transforms=[]):
super().__init__()
self.base_dist = base_dist
self.transforms = nn.ModuleList(transforms)
def forward... | true | true |
f700a5a5161897c326bc5e5ed9d14e64454adf8b | 2,672 | py | Python | test/functional/rpc_signer.py | popy1970/blinkhash-core | d3135bcdb648e8de64ce5395b976b7f359ef822b | [
"MIT"
] | null | null | null | test/functional/rpc_signer.py | popy1970/blinkhash-core | d3135bcdb648e8de64ce5395b976b7f359ef822b | [
"MIT"
] | null | null | null | test/functional/rpc_signer.py | popy1970/blinkhash-core | d3135bcdb648e8de64ce5395b976b7f359ef822b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test external signer.
Verify that a blinkhashd node can use an external signer command.
See also walle... | 33.4 | 124 | 0.644087 |
import os
import platform
from test_framework.test_framework import BlinkhashTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class RPCSignerTest(BlinkhashTestFramework):
def mock_signer_path(self):
path = os.path.join(os.path.dirname(os.path.realpath(_... | true | true |
f700a5efbabcafda7e171a38a5f9eb3d47ebaada | 6,202 | py | Python | fairness/data/objects/Data.py | JSGoedhart/fairness-comparison | f6fcb7f39f15bb63aeab03ef24e41d0ffe353bb8 | [
"Apache-2.0"
] | null | null | null | fairness/data/objects/Data.py | JSGoedhart/fairness-comparison | f6fcb7f39f15bb63aeab03ef24e41d0ffe353bb8 | [
"Apache-2.0"
] | 1 | 2021-11-15T17:52:04.000Z | 2021-11-15T17:52:04.000Z | fairness/data/objects/Data.py | JSGoedhart/fairness-comparison | f6fcb7f39f15bb63aeab03ef24e41d0ffe353bb8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import pathlib
from fairness.results import local_results_path
BASE_DIR = local_results_path()
PACKAGE_DIR = pathlib.Path(__file__).parents[2]
RAW_DATA_DIR = PACKAGE_DIR / 'data' / 'raw'
PROCESSED_DATA_DIR = BASE_DIR / 'data' / 'preprocessed' # Joosje: BASE_DIR used to be PACKAGE_DIR
RESULT_DIR = B... | 39.503185 | 100 | 0.657207 | import pandas as pd
import pathlib
from fairness.results import local_results_path
BASE_DIR = local_results_path()
PACKAGE_DIR = pathlib.Path(__file__).parents[2]
RAW_DATA_DIR = PACKAGE_DIR / 'data' / 'raw'
PROCESSED_DATA_DIR = BASE_DIR / 'data' / 'preprocessed'
RESULT_DIR = BASE_DIR / "results"
ANALYSIS_DIR = BASE_D... | true | true |
f700a66e2fda15dce92ea91e7cebbb895d90ba20 | 6,150 | py | Python | src/olympia/api/tests/test_exceptions.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/api/tests/test_exceptions.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/api/tests/test_exceptions.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | from django.core.urlresolvers import reverse
from django.http import Http404
from django.test import TestCase, override_settings
import mock
from rest_framework.exceptions import APIException, PermissionDenied
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.... | 41.275168 | 79 | 0.672846 | from django.core.urlresolvers import reverse
from django.http import Http404
from django.test import TestCase, override_settings
import mock
from rest_framework.exceptions import APIException, PermissionDenied
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.... | true | true |
f700a70644d82c316ab0fc24f1e3f5646c62c338 | 4,777 | pyw | Python | ImageRenaming.pyw | QuentiumYT/ImageRenaming | ea280e43d004f7028dda4f64816306884d1fa13d | [
"MIT"
] | 1 | 2019-12-16T15:23:46.000Z | 2019-12-16T15:23:46.000Z | ImageRenaming.pyw | QuentiumYT/ImageRenaming | ea280e43d004f7028dda4f64816306884d1fa13d | [
"MIT"
] | null | null | null | ImageRenaming.pyw | QuentiumYT/ImageRenaming | ea280e43d004f7028dda4f64816306884d1fa13d | [
"MIT"
] | null | null | null | import os, sys, urllib.request
from tkinter import *
from tkinter.messagebox import *
__version__ = 3
__filename__ = "ImageRenaming"
__basename__ = os.path.basename(sys.argv[0])
__savepath__ = os.path.join(os.environ['APPDATA'], "QuentiumPrograms")
__iconpath__ = __savepath__ + "/{}.ico".format(__filename__)
try:urll... | 53.077778 | 174 | 0.650618 | import os, sys, urllib.request
from tkinter import *
from tkinter.messagebox import *
__version__ = 3
__filename__ = "ImageRenaming"
__basename__ = os.path.basename(sys.argv[0])
__savepath__ = os.path.join(os.environ['APPDATA'], "QuentiumPrograms")
__iconpath__ = __savepath__ + "/{}.ico".format(__filename__)
try:urll... | true | true |
f700a7b03a7ad1c8be84390b54d21475334757ea | 417 | py | Python | exam/migrations/0007_auto_20210124_0442.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | exam/migrations/0007_auto_20210124_0442.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | exam/migrations/0007_auto_20210124_0442.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-24 04:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0006_exam_duration'),
]
operations = [
migrations.AlterField(
model_name='exam',
name='duration',
... | 21.947368 | 89 | 0.606715 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0006_exam_duration'),
]
operations = [
migrations.AlterField(
model_name='exam',
name='duration',
field=models.CharField(default=0, max_length=... | true | true |
f700a89c0b32d02df5957e1b626dcb3be33f0f5e | 11,432 | py | Python | tests.py | shiaky/jsonrpc-websocket | bec76d39de39e752f91a9e34aac7015ca4026d4d | [
"BSD-3-Clause"
] | null | null | null | tests.py | shiaky/jsonrpc-websocket | bec76d39de39e752f91a9e34aac7015ca4026d4d | [
"BSD-3-Clause"
] | null | null | null | tests.py | shiaky/jsonrpc-websocket | bec76d39de39e752f91a9e34aac7015ca4026d4d | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import inspect
import json
import os
import random
import unittest
from unittest.mock import Mock
import aiohttp
import aiohttp.web
from aiohttp.test_utils import unittest_run_loop, setup_test_loop, teardown_test_loop
import pep8
import jsonrpc_base
import jsonrpc_websocket.jsonrpc
from jsonrpc_websock... | 35.175385 | 100 | 0.656753 | import asyncio
import inspect
import json
import os
import random
import unittest
from unittest.mock import Mock
import aiohttp
import aiohttp.web
from aiohttp.test_utils import unittest_run_loop, setup_test_loop, teardown_test_loop
import pep8
import jsonrpc_base
import jsonrpc_websocket.jsonrpc
from jsonrpc_websock... | true | true |
f700a8f4cec9fde4e8d43839bae356ee49f0283c | 80,346 | py | Python | src/sage/combinat/designs/incidence_structures.py | bopopescu/sagemath | 39f452b2691c5ac86654fea22414fa5851893b48 | [
"BSL-1.0"
] | 3 | 2018-09-11T11:16:26.000Z | 2019-09-10T15:26:37.000Z | src/sage/combinat/designs/incidence_structures.py | bopopescu/sagemath | 39f452b2691c5ac86654fea22414fa5851893b48 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/combinat/designs/incidence_structures.py | bopopescu/sagemath | 39f452b2691c5ac86654fea22414fa5851893b48 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | r"""
Incidence structures (i.e. hypergraphs, i.e. set systems)
An incidence structure is specified by a list of points, blocks, or an incidence
matrix ([1]_, [2]_). :class:`IncidenceStructure` instances have the following methods:
{METHODS_OF_IncidenceStructure}
REFERENCES:
.. [1] Block designs and incidence struct... | 36.110562 | 150 | 0.535621 |
from __future__ import print_function
import six
from six import itervalues
from six.moves import range
from sage.rings.integer import Integer
from sage.misc.latex import latex
from sage.sets.set import Set
class IncidenceStructure(object):
def __init__(self, points=None, blocks=None, incidence_matrix=None,
... | true | true |
f700a97fc9f25aeddc6468ca2d9b63e3f3c8c04e | 5,341 | py | Python | tests/test_compat.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/test_compat.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/test_compat.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Define source file encoding to support raw unicode characters in Python 2
import sys
# Third party
import pytest
# Project
from ddtrace.compat import to_unicode, PY2, reraise, get_connection_response
# Use different test suites for each Python version, this allows us to test the expected
#... | 38.42446 | 93 | 0.576858 |
import sys
import pytest
from ddtrace.compat import to_unicode, PY2, reraise, get_connection_response
if PY2:
class TestCompatPY2(object):
def test_to_unicode_string(self):
res = to_unicode('test')
assert type(res) == unicode
assert res == 'test'
... | true | true |
f700a9a5b731462eee5cc0aaf1dfbb70ffdaf312 | 19,647 | py | Python | fairseq/utils.py | xiaodashuaiya/fairseq | 9e3850bd87f4da751671d503406115730b99ea8a | [
"MIT"
] | null | null | null | fairseq/utils.py | xiaodashuaiya/fairseq | 9e3850bd87f4da751671d503406115730b99ea8a | [
"MIT"
] | null | null | null | fairseq/utils.py | xiaodashuaiya/fairseq | 9e3850bd87f4da751671d503406115730b99ea8a | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import copy
import importlib.util
import logging
import math
import os
import sys
import warnings
from collections import de... | 32.799666 | 111 | 0.649361 |
import contextlib
import copy
import importlib.util
import logging
import math
import os
import sys
import warnings
from collections import defaultdict
from itertools import accumulate
from typing import Callable, Dict, List, Optional
import numpy as np
import torch
import torch.nn.functional as F
from fairseq.lo... | true | true |
f700a9eaeb9d656f880043ec173164ac3cfad160 | 48,226 | py | Python | utils/analyze.py | MaryZolfaghar/WCSLS | fcb3bfd11c19bb90690ec772f91bbd107832d636 | [
"Apache-2.0"
] | null | null | null | utils/analyze.py | MaryZolfaghar/WCSLS | fcb3bfd11c19bb90690ec772f91bbd107832d636 | [
"Apache-2.0"
] | null | null | null | utils/analyze.py | MaryZolfaghar/WCSLS | fcb3bfd11c19bb90690ec772f91bbd107832d636 | [
"Apache-2.0"
] | null | null | null | from numpy.core.fromnumeric import reshape
import torch
import numpy as np
import pickle
from itertools import combinations, permutations
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from scipy.stats import pearsonr, ttest_ind
import statsmodels.api as sm
from dataset import get_loaders... | 46.95813 | 129 | 0.597396 | from numpy.core.fromnumeric import reshape
import torch
import numpy as np
import pickle
from itertools import combinations, permutations
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from scipy.stats import pearsonr, ttest_ind
import statsmodels.api as sm
from dataset import get_loaders... | true | true |
f700ab4f7f35965ae27c0141bce727a7b9e57f0f | 4,803 | py | Python | hummingbot/strategy/dev_5_vwap/dev_5_vwap_config_map.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 11 | 2020-09-15T08:21:59.000Z | 2022-03-19T05:06:59.000Z | hummingbot/strategy/dev_5_vwap/dev_5_vwap_config_map.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | null | null | null | hummingbot/strategy/dev_5_vwap/dev_5_vwap_config_map.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 5 | 2020-09-18T12:59:31.000Z | 2021-06-27T01:46:16.000Z | from hummingbot.client.config.config_var import ConfigVar
from hummingbot.client.config.config_validators import (
validate_exchange,
validate_market_trading_pair,
)
from hummingbot.client.settings import (
required_exchanges,
EXAMPLE_PAIRS,
)
from typing import Optional
def symbol_prompt():
excha... | 42.504425 | 136 | 0.581512 | from hummingbot.client.config.config_var import ConfigVar
from hummingbot.client.config.config_validators import (
validate_exchange,
validate_market_trading_pair,
)
from hummingbot.client.settings import (
required_exchanges,
EXAMPLE_PAIRS,
)
from typing import Optional
def symbol_prompt():
excha... | true | true |
f700ab70eeefaa8ec9d73a14d20594f4c8925cda | 535 | py | Python | nomadgram/views.py | Bansng/Banstagram | ddb8d7d7e73f425751ad279c77006f73ed92ae9f | [
"MIT"
] | null | null | null | nomadgram/views.py | Bansng/Banstagram | ddb8d7d7e73f425751ad279c77006f73ed92ae9f | [
"MIT"
] | 11 | 2020-06-05T17:00:30.000Z | 2022-02-10T10:19:48.000Z | nomadgram/views.py | Bansng/Banstagram | ddb8d7d7e73f425751ad279c77006f73ed92ae9f | [
"MIT"
] | null | null | null | from django.views.generic import View
from django.http import HttpResponse
from django.conf import settings
import os
class ReactAppView(View):
def get(self, request):
try:
with open(os.path.join(str(settings.ROOT_DIR), 'frontend', 'build', 'index.html')) as file:
return HttpR... | 25.47619 | 103 | 0.558879 | from django.views.generic import View
from django.http import HttpResponse
from django.conf import settings
import os
class ReactAppView(View):
def get(self, request):
try:
with open(os.path.join(str(settings.ROOT_DIR), 'frontend', 'build', 'index.html')) as file:
return HttpR... | true | true |
f700abc56953507b76d7e3217966bd5bcd4a58e5 | 1,060 | py | Python | scraper/storage_spiders/dcmobilevn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/dcmobilevn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/dcmobilevn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='ProductMain']/div[@class='product-title']/h1",
'price' : "//div[@class='Row Price']/div[@class='ProductPrice VariationPr... | 39.259259 | 96 | 0.637736 |
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='ProductMain']/div[@class='product-title']/h1",
'price' : "//div[@class='Row Price']/div[@class='ProductPrice VariationProductPrice']",
'category' : "//div[@id='Breadcrumb']/ul/li/a",
'desc... | true | true |
f700ae0bb1d78cf0c16d4cf634f82c75c1c3e574 | 1,229 | py | Python | test/functional/rpcnamedargs.py | randboy/BAYEMCOIN | d0f19e1e38a5bebeb9a7a230e1f0054134720250 | [
"MIT"
] | null | null | null | test/functional/rpcnamedargs.py | randboy/BAYEMCOIN | d0f19e1e38a5bebeb9a7a230e1f0054134720250 | [
"MIT"
] | null | null | null | test/functional/rpcnamedargs.py | randboy/BAYEMCOIN | d0f19e1e38a5bebeb9a7a230e1f0054134720250 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2017 The Ravencoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test using named arguments for RPCs."""
from test_framew... | 34.138889 | 92 | 0.676159 |
from test_framework.test_framework import BayemcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class NamedArgumentTest(BayemcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
node = self.nodes[0]
... | true | true |
f700ae813e4c52ee4e22cfb7c1ab5391d64a5a93 | 5,703 | py | Python | cnn_2bands.py | jirivrany/kagle-statoil | 8c70691fc7ca7d8a6a33a3544f76b22f1b508f7a | [
"MIT"
] | 1 | 2020-07-18T09:32:16.000Z | 2020-07-18T09:32:16.000Z | cnn_2bands.py | jirivrany/kagle-statoil | 8c70691fc7ca7d8a6a33a3544f76b22f1b508f7a | [
"MIT"
] | null | null | null | cnn_2bands.py | jirivrany/kagle-statoil | 8c70691fc7ca7d8a6a33a3544f76b22f1b508f7a | [
"MIT"
] | null | null | null |
# coding: utf-8
"""
"""
import pandas as pd
import numpy as np
import cv2 # Used to manipulated the images
from scipy.signal import wiener
np.random.seed(1207) # The seed I used - pick your own or comment out for a random seed. A constant seed allows for better comparisons though
# Import Keras
from keras.mo... | 28.949239 | 151 | 0.665089 |
import pandas as pd
import numpy as np
import cv2
from scipy.signal import wiener
np.random.seed(1207)
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Activation
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import EarlyStopping, ModelCheckpoint, Re... | true | true |
f700aecd29b584fcae3e02e2654389062cc13cb7 | 507 | py | Python | 00_Original/32_Parallele_Programmierung/concurrent.futures/pi_mit_wallis_threads.py | felixdittrich92/Python3_book | cd0e2b55aa72c51927d347b70199fb9ed928e06f | [
"MIT"
] | null | null | null | 00_Original/32_Parallele_Programmierung/concurrent.futures/pi_mit_wallis_threads.py | felixdittrich92/Python3_book | cd0e2b55aa72c51927d347b70199fb9ed928e06f | [
"MIT"
] | null | null | null | 00_Original/32_Parallele_Programmierung/concurrent.futures/pi_mit_wallis_threads.py | felixdittrich92/Python3_book | cd0e2b55aa72c51927d347b70199fb9ed928e06f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from concurrent import futures
def naehere_pi_an(n):
pi_halbe = 1
zaehler, nenner = 2.0, 1.0
for i in range(n):
pi_halbe *= zaehler / nenner
if i % 2:
zaehler += 2
else:
nenner += 2
return 2... | 16.9 | 60 | 0.532544 |
from concurrent import futures
def naehere_pi_an(n):
pi_halbe = 1
zaehler, nenner = 2.0, 1.0
for i in range(n):
pi_halbe *= zaehler / nenner
if i % 2:
zaehler += 2
else:
nenner += 2
return 2*pi_halbe
N = (
12345678,
1234567,... | true | true |
f700b037bdd4731f17b509c1a85a07970a9abd37 | 1,688 | py | Python | src/you_get/extractors/nicovideo.py | lgis80boy/you-get | 5d9c5b72a73abf183f4b072a2e4f5351a219b660 | [
"MIT"
] | 1 | 2021-09-20T02:54:36.000Z | 2021-09-20T02:54:36.000Z | src/you_get/extractors/nicovideo.py | piyipaya/you-get | ef16e74fe72e7779a0b10af56f435cb2558d90c7 | [
"MIT"
] | null | null | null | src/you_get/extractors/nicovideo.py | piyipaya/you-get | ef16e74fe72e7779a0b10af56f435cb2558d90c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__all__ = ['nicovideo_download']
from ..common import *
def nicovideo_login(user, password):
data = "current_form=login&mail=" + user +"&password=" + password + "&login_submit=Log+In"
response = request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", he... | 34.44898 | 154 | 0.67654 |
__all__ = ['nicovideo_download']
from ..common import *
def nicovideo_login(user, password):
data = "current_form=login&mail=" + user +"&password=" + password + "&login_submit=Log+In"
response = request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", headers=fake_headers, d... | true | true |
f700b137dc5c16793932cab6ed9aec10c35ffa6b | 2,843 | py | Python | tests/test_class_oelint_vars_valuequoted.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_valuequoted.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_valuequoted.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from .base import TestBaseClass
# flake8: noqa W291 - we want to explicitly test trailing whitespace here
class TestClassOelintVarsValueQuoted(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.valuequoted'])
@pytest.mark.parametrize('occurrence', [2])
@pytest.mark.parametrize('in... | 43.075758 | 139 | 0.27471 | import pytest
from .base import TestBaseClass
class TestClassOelintVarsValueQuoted(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.valuequoted'])
@pytest.mark.parametrize('occurrence', [2])
@pytest.mark.parametrize('input',
[
{
... | true | true |
f700b1e04ad8b6d4cd18e1a0bd8fbb8b376d26a2 | 124 | py | Python | flintrock/__init__.py | chaordic/flintrock | e2dc536ee392d8670061132ed95313c9c5570e31 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | flintrock/__init__.py | chaordic/flintrock | e2dc536ee392d8670061132ed95313c9c5570e31 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2018-06-20T13:56:07.000Z | 2019-01-06T00:52:21.000Z | flintrock/__init__.py | chaordic/flintrock | e2dc536ee392d8670061132ed95313c9c5570e31 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # See: https://packaging.python.org/en/latest/distributing/#standards-compliance-for-interoperability
__version__ = '0.9.0'
| 41.333333 | 101 | 0.790323 | true | true | |
f700b22cb1a32b0e843db2b1a61bebdd1afdf827 | 336 | py | Python | src/CodeLearn/plaintextCode/BloomTech/BTU5W2/U5W2P2_Task1_w1.py | MingjunGeng/Code-Knowledge | 5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa | [
"MIT"
] | null | null | null | src/CodeLearn/plaintextCode/BloomTech/BTU5W2/U5W2P2_Task1_w1.py | MingjunGeng/Code-Knowledge | 5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa | [
"MIT"
] | null | null | null | src/CodeLearn/plaintextCode/BloomTech/BTU5W2/U5W2P2_Task1_w1.py | MingjunGeng/Code-Knowledge | 5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa | [
"MIT"
] | 1 | 2022-03-18T04:52:10.000Z | 2022-03-18T04:52:10.000Z | #!/usr/bin/python3
# --- 001 > U5W1P1_Task1_w1
def solution(s):
# print( ''.join(reversed(s)) )
if( s==''.join(reversed(s))):
return bool(True)
return bool(False)
if __name__ == "__main__":
print('----------start------------')
s = "zork"
print(solution( s ))
print('------------en... | 22.4 | 40 | 0.479167 |
def solution(s):
if( s==''.join(reversed(s))):
return bool(True)
return bool(False)
if __name__ == "__main__":
print('----------start------------')
s = "zork"
print(solution( s ))
print('------------end------------')
| true | true |
f700b256e369857ea9dfec8ab0f769ac32b6bd1f | 5,301 | py | Python | pyuds/PyUds/bus/driver/vector/vxlbase.py | LevyHe/PyUds | 5d9297578790996d2d83c8fd13eb2b335cc38e4b | [
"MIT"
] | 2 | 2021-03-30T02:02:39.000Z | 2021-04-09T11:00:30.000Z | pyuds/PyUds/bus/driver/vector/vxlbase.py | xinkunlong/PyUds | 5d9297578790996d2d83c8fd13eb2b335cc38e4b | [
"MIT"
] | 1 | 2020-12-03T14:23:11.000Z | 2020-12-03T14:23:11.000Z | pyuds/PyUds/bus/driver/vector/vxlbase.py | xinkunlong/PyUds | 5d9297578790996d2d83c8fd13eb2b335cc38e4b | [
"MIT"
] | 4 | 2021-03-30T02:02:41.000Z | 2021-12-24T03:00:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 9 10:51:35 2019
@author: levy.he
"""
import ctypes
from . import vxlapy
def stringify(cobj, indent=2):
s = "%s\n" % type(cobj)
if issubclass(type(cobj), ctypes.Union):
cobj = getattr(cobj, cobj._fields_[0][0])
if issubclass(type(cobj), ctypes.Struct... | 37.06993 | 172 | 0.628372 |
import ctypes
from . import vxlapy
def stringify(cobj, indent=2):
s = "%s\n" % type(cobj)
if issubclass(type(cobj), ctypes.Union):
cobj = getattr(cobj, cobj._fields_[0][0])
if issubclass(type(cobj), ctypes.Structure):
for field in cobj._fields_:
s += "%s%s=%s\n" % (indent * ' ... | true | true |
f700b25bde58fdbd1872c08a5ca59c060b95b058 | 983 | py | Python | bucketers/StateBasedBucketer.py | pagun12/predictive-monitoring-benchmark | 78a3c2723406dd85aec3b5b01e1ae2edb657f8e2 | [
"Apache-2.0"
] | 17 | 2019-02-09T18:59:17.000Z | 2022-01-29T18:02:38.000Z | bucketers/StateBasedBucketer.py | pagun12/predictive-monitoring-benchmark | 78a3c2723406dd85aec3b5b01e1ae2edb657f8e2 | [
"Apache-2.0"
] | 2 | 2019-05-28T08:59:33.000Z | 2020-05-23T09:43:05.000Z | bucketers/StateBasedBucketer.py | pagun12/predictive-monitoring-benchmark | 78a3c2723406dd85aec3b5b01e1ae2edb657f8e2 | [
"Apache-2.0"
] | 13 | 2018-11-05T02:54:17.000Z | 2022-02-05T15:40:25.000Z | import pandas as pd
import numpy as np
from time import time
import sys
class StateBasedBucketer(object):
def __init__(self, encoder):
self.encoder = encoder
self.dt_states = None
self.n_states = 0
def fit(self, X, y=None):
dt_encoded = self.... | 24.575 | 82 | 0.57884 | import pandas as pd
import numpy as np
from time import time
import sys
class StateBasedBucketer(object):
def __init__(self, encoder):
self.encoder = encoder
self.dt_states = None
self.n_states = 0
def fit(self, X, y=None):
dt_encoded = self.... | true | true |
f700b2934cd8c92e5e974a0aa261366b0abef8fe | 23,040 | py | Python | venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | venv/Lib/site-packages/pandas/tests/plotting/test_hist_method.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | """ Test cases for .hist method """
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, Series, to_datetime
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase, _check_plot_works
pytestmark = pytest.mark.slow
@td.skip_if_no... | 35.832037 | 88 | 0.580295 |
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame, Index, Series, to_datetime
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase, _check_plot_works
pytestmark = pytest.mark.slow
@td.skip_if_no_mpl
class TestSeriesPlots(TestPlotB... | true | true |
f700b3d7ec5ca5d0b36abae1f89ee196d61bb1fd | 1,773 | py | Python | alipay/aop/api/domain/BillDingBizOrderSum.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/BillDingBizOrderSum.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/BillDingBizOrderSum.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class BillDingBizOrderSum(object):
def __init__(self):
self._biz_date = None
self._expenses = None
self._income = None
@property
def biz_date(self):
return self... | 24.971831 | 67 | 0.561196 |
import json
from alipay.aop.api.constant.ParamConstants import *
class BillDingBizOrderSum(object):
def __init__(self):
self._biz_date = None
self._expenses = None
self._income = None
@property
def biz_date(self):
return self._biz_date
@biz_date.setter
def biz... | true | true |
f700b4d5e209da6b72ab274298a7377e88be1783 | 427 | py | Python | Section1/1.5 Python Console/console.py | rneighborsphone/PyCharm-for-Power-Developer-v- | 2d757c29fd4c8127073800fffc9146ce096c49ec | [
"MIT"
] | null | null | null | Section1/1.5 Python Console/console.py | rneighborsphone/PyCharm-for-Power-Developer-v- | 2d757c29fd4c8127073800fffc9146ce096c49ec | [
"MIT"
] | null | null | null | Section1/1.5 Python Console/console.py | rneighborsphone/PyCharm-for-Power-Developer-v- | 2d757c29fd4c8127073800fffc9146ce096c49ec | [
"MIT"
] | null | null | null | class Calculator:
def __init__(self):
pass
def add(self, a, b):
return a + b
def divide(self, a, b):
return b / a
# Todo: Add subtract option
# def root(a):
# return math.sqrt()
def greetings(name):
print('Hello ' + name + '!')
def goodbye():
print('Good... | 13.774194 | 32 | 0.571429 | class Calculator:
def __init__(self):
pass
def add(self, a, b):
return a + b
def divide(self, a, b):
return b / a
def greetings(name):
print('Hello ' + name + '!')
def goodbye():
print('Goodbye!')
myCalculator = Calculator
myCalculator.subtract()
| true | true |
f700b5774c7202e1709ce0393be8b037314148e8 | 24,670 | py | Python | apps/microtvm/zephyr/template_project/microtvm_api_server.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 10 | 2019-03-09T07:51:56.000Z | 2021-09-14T03:06:20.000Z | apps/microtvm/zephyr/template_project/microtvm_api_server.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 1 | 2019-01-27T03:49:54.000Z | 2019-02-15T16:01:51.000Z | apps/microtvm/zephyr/template_project/microtvm_api_server.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 3 | 2021-07-27T07:32:30.000Z | 2021-10-19T06:15:02.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.656207 | 111 | 0.628658 |
import atexit
import collections
import collections.abc
import enum
import fcntl
import logging
import os
import os.path
import pathlib
import queue
import re
import select
import shlex
import shutil
import subprocess
import sys
import tarfile
import tempfile
import threading
import time
import json
i... | true | true |
f700b5a1d5722d07bde18b5f8ee9f35aee345d2c | 2,036 | py | Python | multi-modal-face-identification/config.py | yoga-suhas-km/facial-recognition | 2fab92ec977430ae5d887fe7d3cf6df1b988bef2 | [
"MIT"
] | null | null | null | multi-modal-face-identification/config.py | yoga-suhas-km/facial-recognition | 2fab92ec977430ae5d887fe7d3cf6df1b988bef2 | [
"MIT"
] | null | null | null | multi-modal-face-identification/config.py | yoga-suhas-km/facial-recognition | 2fab92ec977430ae5d887fe7d3cf6df1b988bef2 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2019 Yoga Suhas Kuruba Manjunath
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... | 27.890411 | 78 | 0.770138 |
image_folder = './images'
extracted_folder = './extracted_images'
models = './models'
graphs = './graphs'
image_size_vertical = 100
image_size_horizontal = 100
epoch = 100
batch_size = 64
train_ratio = 0.6
test_ratio = 0.2
validation_ratio = 0.2
x_shape = ()
GREY = 1
RGB = 3
vertical = "VERTIC... | true | true |
f700b5ea0958a3f503dbde8209de66f43cecf0b2 | 11,833 | py | Python | rllab/optimizers/conjugate_gradient_optimizer.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 26 | 2019-04-02T16:19:10.000Z | 2019-11-13T13:18:06.000Z | rllab/optimizers/conjugate_gradient_optimizer.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 1 | 2019-04-24T14:01:14.000Z | 2019-04-25T14:16:25.000Z | rllab/optimizers/conjugate_gradient_optimizer.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 8 | 2019-12-17T09:11:58.000Z | 2021-07-02T06:55:31.000Z | import numpy as np
import theano
import theano.tensor as TT
from rllab.core.serializable import Serializable
from rllab.misc import ext
from rllab.misc import krylov
from rllab.misc import logger
from rllab.misc.ext import sliced_fun
class PerlmutterHvp(Serializable):
def __init__(self, num_slices=1):
S... | 39.976351 | 119 | 0.615398 | import numpy as np
import theano
import theano.tensor as TT
from rllab.core.serializable import Serializable
from rllab.misc import ext
from rllab.misc import krylov
from rllab.misc import logger
from rllab.misc.ext import sliced_fun
class PerlmutterHvp(Serializable):
def __init__(self, num_slices=1):
S... | true | true |
f700b6065605f0516c95bcddcbbd8f967dfee687 | 3,825 | py | Python | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_cddl.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_cddl.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_cddl.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class TemplateCddl:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is js... | 24.208861 | 74 | 0.537778 |
import pprint
import re
import six
class TemplateCddl:
sensitive_list = []
openapi_types = {
'flow': 'FlowItem',
'states': 'dict(str, TemplateState)',
'workflow': 'Workflow'
}
attribute_map = {
'flow': 'flow',
'states': 'states',
'workflow': '... | true | true |
f700b617b69a760f427812c69e5b061c7327a011 | 10,429 | py | Python | app.py | ngwenbin/ExpenseTracker | f50793c9a4c6efc4f58cc7d759b45f2e16b7832e | [
"MIT"
] | null | null | null | app.py | ngwenbin/ExpenseTracker | f50793c9a4c6efc4f58cc7d759b45f2e16b7832e | [
"MIT"
] | 4 | 2021-03-31T19:30:25.000Z | 2021-12-13T20:35:51.000Z | app.py | ngwenbin/ExpenseTracker | f50793c9a4c6efc4f58cc7d759b45f2e16b7832e | [
"MIT"
] | null | null | null | from flask import Flask, render_template, redirect, url_for, flash, request, abort
from functions import UserLogin, UserRegistration, NewExpense
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import func
from datetime import datetime, timedelta, date
from flask_bcrypt import Bcrypt
from flask_login import Logi... | 39.206767 | 147 | 0.668329 | from flask import Flask, render_template, redirect, url_for, flash, request, abort
from functions import UserLogin, UserRegistration, NewExpense
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import func
from datetime import datetime, timedelta, date
from flask_bcrypt import Bcrypt
from flask_login import Logi... | true | true |
f700b7efa4ec83d6d4a38ddef069601eaf397756 | 6,566 | py | Python | tests/cupyx_tests/scipy_tests/sparse_tests/test_construct.py | sjperkins/cupy | 08aeca5653f47f44e39a554b3be2244902ea7bac | [
"MIT"
] | null | null | null | tests/cupyx_tests/scipy_tests/sparse_tests/test_construct.py | sjperkins/cupy | 08aeca5653f47f44e39a554b3be2244902ea7bac | [
"MIT"
] | null | null | null | tests/cupyx_tests/scipy_tests/sparse_tests/test_construct.py | sjperkins/cupy | 08aeca5653f47f44e39a554b3be2244902ea7bac | [
"MIT"
] | null | null | null | import unittest
import mock
import numpy
import pytest
import cupy
from cupy import testing
from cupyx.scipy import sparse
@testing.parameterize(*testing.product({
'dtype': [numpy.float32, numpy.float64, numpy.complex64, numpy.complex128],
'format': ['csr', 'csc', 'coo'],
'm': [3],
'n': [None, 3, 2]... | 34.020725 | 79 | 0.630673 | import unittest
import mock
import numpy
import pytest
import cupy
from cupy import testing
from cupyx.scipy import sparse
@testing.parameterize(*testing.product({
'dtype': [numpy.float32, numpy.float64, numpy.complex64, numpy.complex128],
'format': ['csr', 'csc', 'coo'],
'm': [3],
'n': [None, 3, 2]... | true | true |
f700b8636f4110c312c1bbfb4ee54a8ac3291212 | 3,101 | py | Python | utils.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | utils.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | utils.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | import torch
import numpy as np;
from torch.autograd import Variable
def normal_std(x):
return x.std() * np.sqrt((len(x) - 1.)/(len(x)))
class Data_utility(object):
# train and valid is the ratio of training set and validation set. test = 1 - train - valid
def __init__(self, dSet, train, valid, cuda, hor... | 34.842697 | 95 | 0.533054 | import torch
import numpy as np;
from torch.autograd import Variable
def normal_std(x):
return x.std() * np.sqrt((len(x) - 1.)/(len(x)))
class Data_utility(object):
def __init__(self, dSet, train, valid, cuda, horizon, window, normalize = 2):
self.cuda = cuda;
self.P = window;
se... | true | true |
f700bb925956016aa9adc57a8a43df7669cf6efa | 1,830 | py | Python | plugins/modules/device_administration_dictionary_attributes_policy_set_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/modules/device_administration_dictionary_attributes_policy_set_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/modules/device_administration_dictionary_attributes_policy_set_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: device_administration_dictionary_attributes_policy_set_info
short_description: Information module for Device Admin... | 28.59375 | 109 | 0.657923 |
DOCUMENTATION = r"""
---
module: device_administration_dictionary_attributes_policy_set_info
short_description: Information module for Device Administration Dictionary Attributes Policy Set
description:
- Get all Device Administration Dictionary Attributes Policy Set.
version_added: '1.0.0'
author: Rafael Campos ... | true | true |
f700bbd4ee4d01ed15ea57cc4e75b1e800b3d0b1 | 2,244 | py | Python | python/GafferTest/CompoundNumericNode.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 561 | 2016-10-18T04:30:48.000Z | 2022-03-30T06:52:04.000Z | python/GafferTest/CompoundNumericNode.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 1,828 | 2016-10-14T19:01:46.000Z | 2022-03-30T16:07:19.000Z | python/GafferTest/CompoundNumericNode.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 120 | 2016-10-18T15:19:13.000Z | 2021-12-20T16:28:23.000Z | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 43.153846 | 96 | 0.696524 | true | true | |
f700bc2536cd45e69a23e7a3d403820931620f1a | 3,899 | bzl | Python | examples/toolchains_examples/fancy_platform_commands.bzl | stardog-union/rules_foreign_cc | 4520018bc27dbd78b84d839cbe27a614ca3931f0 | [
"Apache-2.0"
] | null | null | null | examples/toolchains_examples/fancy_platform_commands.bzl | stardog-union/rules_foreign_cc | 4520018bc27dbd78b84d839cbe27a614ca3931f0 | [
"Apache-2.0"
] | null | null | null | examples/toolchains_examples/fancy_platform_commands.bzl | stardog-union/rules_foreign_cc | 4520018bc27dbd78b84d839cbe27a614ca3931f0 | [
"Apache-2.0"
] | null | null | null | # buildifier: disable=module-docstring
load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall")
_REPLACE_VALUE = "BAZEL_GEN_ROOT"
def os_name():
return "Fancy"
def pwd():
return "$(pwd)"
def echo(text):
return "printf \"{text}\"".format(text = text)... | 25.318182 | 150 | 0.628366 |
load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall")
_REPLACE_VALUE = "BAZEL_GEN_ROOT"
def os_name():
return "Fancy"
def pwd():
return "$(pwd)"
def echo(text):
return "printf \"{text}\"".format(text = text)
def export_var(name, value):
ret... | true | true |
f700bc34071ef6d48c20c00c6d54dbc8afe7de28 | 17,606 | py | Python | froide/foirequest/services.py | sthapa/froide | e751e071f33c7c0ffe67c4e1aabafbe52ab1e74f | [
"MIT"
] | null | null | null | froide/foirequest/services.py | sthapa/froide | e751e071f33c7c0ffe67c4e1aabafbe52ab1e74f | [
"MIT"
] | null | null | null | froide/foirequest/services.py | sthapa/froide | e751e071f33c7c0ffe67c4e1aabafbe52ab1e74f | [
"MIT"
] | null | null | null | import re
import uuid
from django.db import transaction
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.files import File
from django.utils.translation import gettext_lazy as _
from django.con... | 32.847015 | 88 | 0.617062 | import re
import uuid
from django.db import transaction
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.files import File
from django.utils.translation import gettext_lazy as _
from django.con... | true | true |
f700bd29a7ad1c8a51dda043c5b52a103e3f2ddc | 3,741 | py | Python | Gallery/settings.py | Emmanuel-9/Gallery | 01e6e5b45c0c080afe3597c99e2f83f742edc686 | [
"Unlicense"
] | null | null | null | Gallery/settings.py | Emmanuel-9/Gallery | 01e6e5b45c0c080afe3597c99e2f83f742edc686 | [
"Unlicense"
] | 3 | 2021-06-04T23:49:48.000Z | 2021-06-10T20:00:50.000Z | Gallery/settings.py | Emmanuel-9/Gallery | 01e6e5b45c0c080afe3597c99e2f83f742edc686 | [
"Unlicense"
] | null | null | null | """
Django settings for Gallery project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | 24.611842 | 91 | 0.679765 |
import os
import dj_database_url
from decouple import config,Csv
MODE=config("MODE", default="dev")
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
if config('MODE')=="dev":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAM... | true | true |
f700bd3e668d5f4fe3f075fecf18bb44137fc1c9 | 11,470 | py | Python | tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | """SwaggerToSdk core tools.
"""
from enum import Enum, unique
import json
import logging
import os
import re
import tempfile
from pathlib import Path
import requests
from github import Github, UnknownObjectException
from .autorest_tools import (
autorest_latest_version_finder,
autorest_bootstrap_version_find... | 38.233333 | 119 | 0.682476 | from enum import Enum, unique
import json
import logging
import os
import re
import tempfile
from pathlib import Path
import requests
from github import Github, UnknownObjectException
from .autorest_tools import (
autorest_latest_version_finder,
autorest_bootstrap_version_finder,
autorest_swagger_to_sdk_... | true | true |
f700bef04474f573b8e7dd32005b1b064a2a5e72 | 984 | py | Python | ptstat/dist/categorical.py | timmyzhao/ptstat | 0401203e5b6053df6d62b2af9ab4b831f1b41660 | [
"MIT"
] | 116 | 2017-06-23T07:21:28.000Z | 2022-03-11T20:27:22.000Z | ptstat/dist/categorical.py | afcarl/ptstat | 0401203e5b6053df6d62b2af9ab4b831f1b41660 | [
"MIT"
] | 2 | 2017-06-23T22:17:56.000Z | 2017-06-28T07:31:40.000Z | ptstat/dist/categorical.py | afcarl/ptstat | 0401203e5b6053df6d62b2af9ab4b831f1b41660 | [
"MIT"
] | 12 | 2017-06-25T02:59:59.000Z | 2020-07-19T21:33:45.000Z | import torch
from ptstat.core import RandomVariable, _to_v
class Categorical(RandomVariable):
"""
Categorical over 0,...,N-1 with arbitrary probabilities, 1-dimensional rv, long type.
"""
def __init__(self, p=None, p_min=1E-6, size=None, cuda=False):
super(Categorical, self).__init__()
... | 31.741935 | 89 | 0.590447 | import torch
from ptstat.core import RandomVariable, _to_v
class Categorical(RandomVariable):
def __init__(self, p=None, p_min=1E-6, size=None, cuda=False):
super(Categorical, self).__init__()
if size:
assert len(size) == 2, str(size)
p = _to_v(1 / size[1], size, cuda)
... | true | true |
f700c024a275c9ee0f49a271a5296e1a816514a5 | 225 | py | Python | http_check/datadog_checks/http_check/__init__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | http_check/datadog_checks/http_check/__init__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | http_check/datadog_checks/http_check/__init__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .http_check import HTTPCheck
__all__ = ['__version__', 'HTTPCheck']
| 25 | 59 | 0.76 |
from .__about__ import __version__
from .http_check import HTTPCheck
__all__ = ['__version__', 'HTTPCheck']
| true | true |
f700c071788d13b5a6146585b08da9e0f6ba13a4 | 4,675 | py | Python | tests/integration/test_ssm.py | jorges119/localstack | a8a78cda6c13b2e42bc46301b23c7143580132fb | [
"Apache-2.0"
] | 2 | 2021-08-21T15:37:56.000Z | 2022-02-04T23:18:16.000Z | tests/integration/test_ssm.py | jorges119/localstack | a8a78cda6c13b2e42bc46301b23c7143580132fb | [
"Apache-2.0"
] | null | null | null | tests/integration/test_ssm.py | jorges119/localstack | a8a78cda6c13b2e42bc46301b23c7143580132fb | [
"Apache-2.0"
] | null | null | null | import unittest
from localstack.utils.aws import aws_stack
class SSMTest(unittest.TestCase):
def test_describe_parameters(self):
ssm_client = aws_stack.connect_to_service("ssm")
response = ssm_client.describe_parameters()
self.assertIn("Parameters", response)
self.assertIsInstanc... | 34.375 | 89 | 0.616043 | import unittest
from localstack.utils.aws import aws_stack
class SSMTest(unittest.TestCase):
def test_describe_parameters(self):
ssm_client = aws_stack.connect_to_service("ssm")
response = ssm_client.describe_parameters()
self.assertIn("Parameters", response)
self.assertIsInstanc... | true | true |
f700c0c10f19f9f12a3b5a93890df68ad11c0b8c | 6,581 | py | Python | mapillary_tools/upload.py | LeonhardStrasser/https-github.com-mapillary-mapillary_tools | b19af6e1497ed35b23b5b92696cdc69f347185b4 | [
"BSD-2-Clause"
] | 1 | 2021-07-24T23:37:17.000Z | 2021-07-24T23:37:17.000Z | mapillary_tools/upload.py | erias04/mapillary_tools | 30051013a4016a1169cd8bd4561966d10ca255c7 | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/upload.py | erias04/mapillary_tools | 30051013a4016a1169cd8bd4561966d10ca255c7 | [
"BSD-2-Clause"
] | null | null | null | import json
import os
import sys
from . import uploader
from . import processing
from . import exif_read
def verify_mapillary_tag(filepath):
filepath_keep_original = processing.processed_images_rootpath(filepath)
if os.path.isfile(filepath_keep_original):
filepath = filepath_keep_original
"""
... | 38.040462 | 143 | 0.593071 | import json
import os
import sys
from . import uploader
from . import processing
from . import exif_read
def verify_mapillary_tag(filepath):
filepath_keep_original = processing.processed_images_rootpath(filepath)
if os.path.isfile(filepath_keep_original):
filepath = filepath_keep_original
return ... | true | true |
f700c1298744ddb3f8105de369ca905803a0b702 | 3,841 | py | Python | manim/cli/render/render_options.py | pradyunsg/manim | 1cd24892e58e76486c40a7130baed0eff889d93d | [
"MIT"
] | 1 | 2021-10-17T15:50:45.000Z | 2021-10-17T15:50:45.000Z | manim/cli/render/render_options.py | pradyunsg/manim | 1cd24892e58e76486c40a7130baed0eff889d93d | [
"MIT"
] | null | null | null | manim/cli/render/render_options.py | pradyunsg/manim | 1cd24892e58e76486c40a7130baed0eff889d93d | [
"MIT"
] | null | null | null | import re
import click
from cloup import option, option_group
from ... import logger
def validate_scene_range(ctx, param, value):
try:
start = int(value)
return (start,)
except Exception:
pass
if value:
try:
start, end = map(int, re.split(r"[;,\-]", value))
... | 25.437086 | 104 | 0.534236 | import re
import click
from cloup import option, option_group
from ... import logger
def validate_scene_range(ctx, param, value):
try:
start = int(value)
return (start,)
except Exception:
pass
if value:
try:
start, end = map(int, re.split(r"[;,\-]", value))
... | true | true |
f700c2a333fe7a9d1586abeb7311e40bd0617d83 | 241 | py | Python | setup.py | tyong920/intent_classifier | 32fdd57d65fb663777a38cfe15847948c40e651f | [
"MIT"
] | null | null | null | setup.py | tyong920/intent_classifier | 32fdd57d65fb663777a38cfe15847948c40e651f | [
"MIT"
] | null | null | null | setup.py | tyong920/intent_classifier | 32fdd57d65fb663777a38cfe15847948c40e651f | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="intent_classifier",
version="0.2.0",
packages=find_packages(),
include_package_data=True,
install_requires=["numpy", "scipy", "PyMySQL", "scikit-learn==0.20.3"]
)
| 24.1 | 74 | 0.692946 | from setuptools import setup, find_packages
setup(
name="intent_classifier",
version="0.2.0",
packages=find_packages(),
include_package_data=True,
install_requires=["numpy", "scipy", "PyMySQL", "scikit-learn==0.20.3"]
)
| true | true |
f700c3041172b654d4c238d06146f61576ec3a73 | 131 | py | Python | application/admin.py | iamchinu14/college_networking_website | a1ea36cd13845bcfcb196dbedec49f2d181b0ea9 | [
"MIT"
] | 1 | 2019-11-04T15:44:45.000Z | 2019-11-04T15:44:45.000Z | application/admin.py | iamchinu14/college_networking_website | a1ea36cd13845bcfcb196dbedec49f2d181b0ea9 | [
"MIT"
] | null | null | null | application/admin.py | iamchinu14/college_networking_website | a1ea36cd13845bcfcb196dbedec49f2d181b0ea9 | [
"MIT"
] | null | null | null | from django.contrib import admin
from application.models import Profile
# Register your models here.
admin.site.register(Profile)
| 21.833333 | 38 | 0.824427 | from django.contrib import admin
from application.models import Profile
admin.site.register(Profile)
| true | true |
f700c32e75708750bb036ba49cef94bd9c0b4e2f | 4,154 | py | Python | baseclasses/pyAero_geometry.py | lamkina/baseclasses | 88b6fcb9e9b18439884f9a2249c96a3c0090cd36 | [
"Apache-2.0"
] | null | null | null | baseclasses/pyAero_geometry.py | lamkina/baseclasses | 88b6fcb9e9b18439884f9a2249c96a3c0090cd36 | [
"Apache-2.0"
] | null | null | null | baseclasses/pyAero_geometry.py | lamkina/baseclasses | 88b6fcb9e9b18439884f9a2249c96a3c0090cd36 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
'''
pyAero_geometry
Holds the Python Aerodynamic Analysis Classes (base and inherited).
Copyright (c) 2008 by Dr. Ruben E. Perez
All rights reserved. Not to be used for commercial purposes.
Revision: 1.1 $Date: 21/05/2008 21:00$
Developers:
-----------
- Dr. Ruben E. Perez (RP)
History
--... | 27.328947 | 117 | 0.396485 |
__version__ = '$Revision: $'
import os, sys
import pdb
import numpy
class Geometry(object):
def __init__(self, name={},CGPercent = 0.25,ForeSparPercent = 0.25,
RearSparPercent = 0.75,StaticMarginPercent=0.05,
ForeThickCon = 0.01, RearThickCon = 0.99,
... | true | true |
f700c33dff8b0b405b5cbe542ef0ee4945ba1558 | 1,954 | py | Python | tests/device_tests/test_device_args_numpy_module.py | SX-Aurora/orchespy | 6b85a78831c8e3e05df7143101ca3418817fcbbd | [
"BSD-3-Clause"
] | null | null | null | tests/device_tests/test_device_args_numpy_module.py | SX-Aurora/orchespy | 6b85a78831c8e3e05df7143101ca3418817fcbbd | [
"BSD-3-Clause"
] | null | null | null | tests/device_tests/test_device_args_numpy_module.py | SX-Aurora/orchespy | 6b85a78831c8e3e05df7143101ca3418817fcbbd | [
"BSD-3-Clause"
] | null | null | null | from orchespy import device
from orchespy.devicetype import CUDAGPU, Host, VE
import sys
import pytest
import numpy as np
if "cupy" in sys.modules:
import cupy as cp
if "nlcpy" in sys.modules:
import nlcpy as vp
no_nlcpy = pytest.mark.skipif(
"nlcpy" not in sys.modules, reason=' test require nlcpy. '... | 32.566667 | 78 | 0.665814 | from orchespy import device
from orchespy.devicetype import CUDAGPU, Host, VE
import sys
import pytest
import numpy as np
if "cupy" in sys.modules:
import cupy as cp
if "nlcpy" in sys.modules:
import nlcpy as vp
no_nlcpy = pytest.mark.skipif(
"nlcpy" not in sys.modules, reason=' test require nlcpy. '... | true | true |
f700c57a203a727e26c5ba4059e2b290d8a2a3ba | 8,567 | py | Python | mask_sqlalchemy/__init__.py | Eastwu5788/Mask-SQLAlchemy | 527979b77cd6dec09ea77bea63f7027a75a48ac1 | [
"MIT"
] | 1 | 2021-06-29T03:16:31.000Z | 2021-06-29T03:16:31.000Z | mask_sqlalchemy/__init__.py | Eastwu5788/Mask-SQLAlchemy | 527979b77cd6dec09ea77bea63f7027a75a48ac1 | [
"MIT"
] | null | null | null | mask_sqlalchemy/__init__.py | Eastwu5788/Mask-SQLAlchemy | 527979b77cd6dec09ea77bea63f7027a75a48ac1 | [
"MIT"
] | null | null | null | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2021
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '6/29/21 10:49 AM'
# sys
import typing as t
from threading import Lock
from threading import get_ident
# 3p
import sqlalchemy
from sqlalchemy import (
orm,
schema,
)... | 27.546624 | 103 | 0.585503 |
import typing as t
from threading import Lock
from threading import get_ident
import sqlalchemy
from sqlalchemy import (
orm,
schema,
)
from sqlalchemy.engine import make_url
from sqlalchemy.orm import (
declarative_base,
DeclarativeMeta,
Session as SessionBase
)
from mask.globals import cu... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.