hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73ec953ced26c903337e19ca86ba26fc4a6046e | 2,484 | py | Python | authentik/policies/migrations/0005_binding_group.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/policies/migrations/0005_binding_group.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/policies/migrations/0005_binding_group.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | # Generated by Django 3.1.6 on 2021-02-08 18:36
import django.db.models.deletion
from django.apps.registry import Apps
from django.conf import settings
from django.db import migrations, models
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
import authentik.lib.models
def migrate_from_groupmembe... | 32.25974 | 87 | 0.610306 |
import django.db.models.deletion
from django.apps.registry import Apps
from django.conf import settings
from django.db import migrations, models
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
import authentik.lib.models
def migrate_from_groupmembership(apps: Apps, schema_editor: BaseDatabaseSc... | true | true |
f73ecacbe4cb787e06512814164b21187d010431 | 1,347 | py | Python | alluvian/commands/cmd/look.py | rparker-indeed/mudserver | 70a6227af3e977ecda2fc4a1752dd4703f206778 | [
"MIT"
] | 2 | 2020-09-22T23:02:44.000Z | 2021-07-12T02:50:55.000Z | alluvian/commands/cmd/look.py | rparker-indeed/mudserver | 70a6227af3e977ecda2fc4a1752dd4703f206778 | [
"MIT"
] | 24 | 2020-09-08T19:15:24.000Z | 2020-09-20T22:05:32.000Z | alluvian/commands/cmd/look.py | rparker-indeed/alluvian-engine | 70a6227af3e977ecda2fc4a1752dd4703f206778 | [
"MIT"
] | null | null | null | from alluvian.commands.mud_command import MudCommand
import alluvian.globals as glob
from util.colors import Colors
from util.asciimap import show_map
class Look(MudCommand):
key = 'look'
aliases = ['l', 'loo']
def execute(self):
user = glob.sessions[self.actor]
msg = f'{Colors.fg.BCYAN... | 34.538462 | 103 | 0.593912 | from alluvian.commands.mud_command import MudCommand
import alluvian.globals as glob
from util.colors import Colors
from util.asciimap import show_map
class Look(MudCommand):
key = 'look'
aliases = ['l', 'loo']
def execute(self):
user = glob.sessions[self.actor]
msg = f'{Colors.fg.BCYAN... | true | true |
f73ecad5273b1dcbd0d8a76ed4c009ba8b1403bf | 120 | py | Python | nodenet/python/nodenet/interface/console/__init__.py | NOOXY-research/NodeNet | 8bf7e0c2fd0e4fae4a51b2900014004728f3c935 | [
"Apache-2.0"
] | 2 | 2018-01-31T05:52:23.000Z | 2020-08-07T19:14:18.000Z | nodenet/python/nodenet/interface/console/__init__.py | NOOXY-research/NodeNet | 8bf7e0c2fd0e4fae4a51b2900014004728f3c935 | [
"Apache-2.0"
] | 1 | 2017-11-22T09:39:50.000Z | 2017-11-22T09:39:50.000Z | nodenet/python/nodenet/interface/console/__init__.py | magneticchen/NodeNet | 8bf7e0c2fd0e4fae4a51b2900014004728f3c935 | [
"Apache-2.0"
] | null | null | null | # Create alias
from nodenet.interface.console.commons import *
from nodenet.interface.console.neuralneteditor import *
| 24 | 55 | 0.825 |
from nodenet.interface.console.commons import *
from nodenet.interface.console.neuralneteditor import *
| true | true |
f73ecb27ebebf2c25ca51870ce539bc4c932b442 | 221 | py | Python | angola_erp/rent_a_car/doctype/vehicle_lastmile/test_vehicle_lastmile.py | smehata/angola_erp | 51614992709476e353aef1c03099d78f2a7cedb2 | [
"MIT"
] | 4 | 2019-06-12T06:54:10.000Z | 2021-08-28T06:07:42.000Z | angola_erp/rent_a_car/doctype/vehicle_lastmile/test_vehicle_lastmile.py | proenterprise/angola_erp | 1c171362b132e567390cf702e6ebd72577297cdf | [
"MIT"
] | 4 | 2017-08-24T17:33:45.000Z | 2017-09-24T16:54:01.000Z | angola_erp/rent_a_car/doctype/vehicle_lastmile/test_vehicle_lastmile.py | proenterprise/angola_erp | 1c171362b132e567390cf702e6ebd72577297cdf | [
"MIT"
] | 4 | 2018-02-10T21:08:10.000Z | 2021-08-28T06:08:11.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Helio de Jesus and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicle_lastmile(unittest.TestCase):
pass
| 20.090909 | 53 | 0.773756 |
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicle_lastmile(unittest.TestCase):
pass
| true | true |
f73eccca1f6451c4287340924638a57533a180b5 | 5,938 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/opaque_f86f4a4822065deb46f8e3927f1f473f.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/opaque_f86f4a4822065deb46f8e3927f1f473f.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/opaque_f86f4a4822065deb46f8e3927f1f473f.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 36.429448 | 168 | 0.665712 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class Opaque(Base):
__slots__ = ()
_SDM_NAME = 'opaque'
_SDM_ATT_MAP = {
'EnableRouterTlv': 'enableRouterTlv',
}
_SDM_ENUM_MAP = {
}
def __init... | true | true |
f73ecd86ef9f389a06f6296d2b2d8def11eda364 | 2,342 | py | Python | sheldon_servos/scripts/utilities/test/claw_open_right.py | zwartepoester/sheldon | 7001551b65cd5b595a0a93e58528198d3d1e5553 | [
"Apache-2.0"
] | null | null | null | sheldon_servos/scripts/utilities/test/claw_open_right.py | zwartepoester/sheldon | 7001551b65cd5b595a0a93e58528198d3d1e5553 | [
"Apache-2.0"
] | null | null | null | sheldon_servos/scripts/utilities/test/claw_open_right.py | zwartepoester/sheldon | 7001551b65cd5b595a0a93e58528198d3d1e5553 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import time
from std_msgs.msg import Float64
import random
# 90 degrees = 1.57, 45 = 0.785
# global
# ================================================================
# RIGHT
def right_gripper_open_half():
print("-----> right_gripper_open")
pub_right_arm_gripper.publish(... | 37.174603 | 125 | 0.725448 |
import rospy
import time
from std_msgs.msg import Float64
import random
def right_gripper_open_half():
print("-----> right_gripper_open")
pub_right_arm_gripper.publish(-1.0)
def right_gripper_close():
print("-----> right_gripper_close")
pub_right_arm_gripper.publish(-2.0)
if __name__ ... | false | true |
f73ecdd06eb906b293865cb023a4ce0a095ae660 | 1,624 | py | Python | 3. data_structures/linked_list/linked_lists_circular.py | sourcery-ai-bot/udacity-datastructures-algorithms | c3dfdb8db744540c03a69f4abf833a0fa1f0a345 | [
"MIT"
] | 3 | 2021-05-30T17:21:17.000Z | 2021-09-12T15:18:17.000Z | 3. data_structures/linked_list/linked_lists_circular.py | sourcery-ai-bot/udacity-datastructures-algorithms | c3dfdb8db744540c03a69f4abf833a0fa1f0a345 | [
"MIT"
] | null | null | null | 3. data_structures/linked_list/linked_lists_circular.py | sourcery-ai-bot/udacity-datastructures-algorithms | c3dfdb8db744540c03a69f4abf833a0fa1f0a345 | [
"MIT"
] | 1 | 2021-09-12T15:18:18.000Z | 2021-09-12T15:18:18.000Z | class Node:
def __init__(self, value):
self.value = value
self.next = None
class LinkedList:
def __init__(self, init_list: list = None):
self.head = None
if init_list:
for value in init_list:
self.append(value)
def append(self, value):
i... | 24.606061 | 86 | 0.616379 | class Node:
def __init__(self, value):
self.value = value
self.next = None
class LinkedList:
def __init__(self, init_list: list = None):
self.head = None
if init_list:
for value in init_list:
self.append(value)
def append(self, value):
i... | true | true |
f73ece18807f3472e1a42d321949f3a118b450c1 | 7,057 | py | Python | lamb/nascell.py | jkkummerfeld/lamb | 769adaa76394dc74746c2fd8d31afe9c3ca7895b | [
"Apache-2.0"
] | 130 | 2020-01-29T13:50:34.000Z | 2022-02-21T01:24:28.000Z | lamb/nascell.py | jkkummerfeld/lamb | 769adaa76394dc74746c2fd8d31afe9c3ca7895b | [
"Apache-2.0"
] | 10 | 2020-02-06T17:15:00.000Z | 2021-06-13T07:25:55.000Z | lamb/nascell.py | jkkummerfeld/lamb | 769adaa76394dc74746c2fd8d31afe9c3ca7895b | [
"Apache-2.0"
] | 25 | 2020-01-30T13:20:20.000Z | 2022-03-07T07:17:55.000Z | # Copyright 2018 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 36.189744 | 80 | 0.680176 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
class NASCell(tf.nn.rnn_cell.RNNCell):
def __init__(self, num_units, num_proj=None,
use_biases=False, reuse=None,
initializer... | true | true |
f73ece756e563abcdc1083081570082d648bf77e | 304 | py | Python | main/routes/__init__.py | ohioh/ohioh_Framework_Cluster_1_Flask | 7e4343d48e84fb98593da4baacbcae595722f766 | [
"Apache-2.0"
] | 1 | 2020-08-11T18:37:35.000Z | 2020-08-11T18:37:35.000Z | main/routes/__init__.py | ohioh/ohioh_Framework_Cluster_1_Flask | 7e4343d48e84fb98593da4baacbcae595722f766 | [
"Apache-2.0"
] | null | null | null | main/routes/__init__.py | ohioh/ohioh_Framework_Cluster_1_Flask | 7e4343d48e84fb98593da4baacbcae595722f766 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint
from .users import UserList, User
from flask_restful import Api
from .beat import Beat
api_bp = Blueprint('api', __name__)
api = Api(api_bp, prefix='/ohioh/api/v1')
api.add_resource(Beat, '/')
api.add_resource(UserList, '/users')
api.add_resource(User, '/users/<user_id>')
| 23.384615 | 42 | 0.746711 | from flask import Blueprint
from .users import UserList, User
from flask_restful import Api
from .beat import Beat
api_bp = Blueprint('api', __name__)
api = Api(api_bp, prefix='/ohioh/api/v1')
api.add_resource(Beat, '/')
api.add_resource(UserList, '/users')
api.add_resource(User, '/users/<user_id>')
| true | true |
f73ed01fac9c6ea3af473a0a56e63ee296ecd3a6 | 978 | py | Python | ivy/functional/backends/tensorflow/array_api/linear_algebra.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/tensorflow/array_api/linear_algebra.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/tensorflow/array_api/linear_algebra.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | null | null | null | # global
import tensorflow as tf
from tensorflow.python.types.core import Tensor
from typing import Union, Optional, Tuple, Literal
# local
from ivy import inf
# noinspection PyUnusedLocal,PyShadowingBuiltins
def vector_norm(x: Tensor,
axis: Optional[Union[int, Tuple[int]]] = None,
k... | 31.548387 | 96 | 0.643149 |
import tensorflow as tf
from tensorflow.python.types.core import Tensor
from typing import Union, Optional, Tuple, Literal
from ivy import inf
def vector_norm(x: Tensor,
axis: Optional[Union[int, Tuple[int]]] = None,
keepdims: bool = False,
ord: Union[int, float, L... | true | true |
f73ed21e930460ee4ea180f65f931421c418acab | 23,530 | py | Python | cart_venv/Lib/site-packages/tensorboard/compat/proto/event_pb2.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | null | null | null | cart_venv/Lib/site-packages/tensorboard/compat/proto/event_pb2.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | null | null | null | cart_venv/Lib/site-packages/tensorboard/compat/proto/event_pb2.py | juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | 654be60f7986ac9bb7ce1d080ddee377c3389f93 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorboard/compat/proto/event.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descr... | 39.746622 | 2,343 | 0.755164 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobu... | true | true |
f73ed3c3be2ef1739d2732a5f01a67362bcf79c0 | 6,410 | py | Python | feature_extraction.py | ddboline/kaggle_predict_west_nile | b4dbb3eed450beaf2b73d2a772e0fb3266926418 | [
"MIT"
] | null | null | null | feature_extraction.py | ddboline/kaggle_predict_west_nile | b4dbb3eed450beaf2b73d2a772e0fb3266926418 | [
"MIT"
] | null | null | null | feature_extraction.py | ddboline/kaggle_predict_west_nile | b4dbb3eed450beaf2b73d2a772e0fb3266926418 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Fri May 1 16:28:06 2015
@author: ddboline
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import csv
import gzip
import numpy as np
import pandas as pd
f... | 37.705882 | 82 | 0.493916 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import csv
import gzip
import numpy as np
import pandas as pd
from dateutil.parser import parse
WEATHER_VARS_WITH_M_T = (u'Tmax', u'Tmin', u'Tavg', u'Depart', u'DewP... | true | true |
f73ed4313e2920afdf2322264eecf863e4fd48bf | 4,583 | py | Python | lang_id.py | neulab/idiomata-bot | f397e49fb9d1d59b9b74e0e528a72307637a18e9 | [
"BSD-3-Clause"
] | null | null | null | lang_id.py | neulab/idiomata-bot | f397e49fb9d1d59b9b74e0e528a72307637a18e9 | [
"BSD-3-Clause"
] | 14 | 2019-08-13T14:01:46.000Z | 2019-08-16T20:24:46.000Z | lang_id.py | neulab/idiomata-bot | f397e49fb9d1d59b9b74e0e528a72307637a18e9 | [
"BSD-3-Clause"
] | 1 | 2019-08-13T14:46:18.000Z | 2019-08-13T14:46:18.000Z | import numpy as np
import iso639
from collections import defaultdict
all_langs = ('cay', 'dan', 'deu', 'eng', 'fra', 'kwk', 'see', 'swe')
codelang = [('cay', 'Cayuga'), ('see', 'Seneca'), ('other', 'Other')]
code2lang_dict = {c:l for (c,l) in codelang}
lang2code_dict = {l:c for (c,l) in codelang}
def code2lang(code)... | 32.735714 | 167 | 0.66703 | import numpy as np
import iso639
from collections import defaultdict
all_langs = ('cay', 'dan', 'deu', 'eng', 'fra', 'kwk', 'see', 'swe')
codelang = [('cay', 'Cayuga'), ('see', 'Seneca'), ('other', 'Other')]
code2lang_dict = {c:l for (c,l) in codelang}
lang2code_dict = {l:c for (c,l) in codelang}
def code2lang(code)... | true | true |
f73ed44b958e1d6ea789574bb397f2a57261e54d | 1,926 | py | Python | rlpyt/ul/experiments/rl_with_ul/configs/atari_dqn_ul.py | erfanMhi/rlpyt | 56574ea209f48075c26179c5b2f1a4676c38efdd | [
"MIT"
] | null | null | null | rlpyt/ul/experiments/rl_with_ul/configs/atari_dqn_ul.py | erfanMhi/rlpyt | 56574ea209f48075c26179c5b2f1a4676c38efdd | [
"MIT"
] | null | null | null | rlpyt/ul/experiments/rl_with_ul/configs/atari_dqn_ul.py | erfanMhi/rlpyt | 56574ea209f48075c26179c5b2f1a4676c38efdd | [
"MIT"
] | null | null | null |
import copy
configs = dict()
config = dict(
agent=dict(),
algo=dict(
discount=0.99,
batch_size=256,
learning_rate=1.5e-4, # Adam Optimizer
target_update_interval=1000,
clip_grad_norm=40.,
min_steps_rl=int(1e5),
double_dqn=True,
prioritized_rep... | 25.012987 | 63 | 0.586708 |
import copy
configs = dict()
config = dict(
agent=dict(),
algo=dict(
discount=0.99,
batch_size=256,
learning_rate=1.5e-4,
target_update_interval=1000,
clip_grad_norm=40.,
min_steps_rl=int(1e5),
double_dqn=True,
prioritized_replay=False,
... | true | true |
f73ed4b730a149cec73763219e19df0c835b21fc | 5,626 | py | Python | src/olympia/shelves/views.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/shelves/views.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/shelves/views.py | renancleyson-dev/addons-server | 1db556b40260aa4c0c63e84c4d9e3c2d7609eb10 | [
"BSD-3-Clause"
] | null | null | null | from django.db.transaction import non_atomic_requests
from django.utils.decorators import classonlymethod
from django_statsd.clients import statsd
from elasticsearch_dsl import Q, query
from rest_framework import mixins, status, viewsets
from rest_framework.decorators import action
from rest_framework.exceptions impor... | 36.771242 | 88 | 0.662105 | from django.db.transaction import non_atomic_requests
from django.utils.decorators import classonlymethod
from django_statsd.clients import statsd
from elasticsearch_dsl import Q, query
from rest_framework import mixins, status, viewsets
from rest_framework.decorators import action
from rest_framework.exceptions impor... | true | true |
f73ed58ffca385adc268bc8ac6189cdf5a71a949 | 345 | py | Python | utils.py | ofirkris/Hifill-tensorflow | 85a3332975a0c2da60116f72dc5a17f76c2d1b96 | [
"MIT"
] | 39 | 2020-10-15T00:57:57.000Z | 2022-02-24T13:53:32.000Z | utils.py | ofirkris/Hifill-tensorflow | 85a3332975a0c2da60116f72dc5a17f76c2d1b96 | [
"MIT"
] | 7 | 2020-10-28T03:59:03.000Z | 2020-12-17T09:11:16.000Z | utils.py | ofirkris/Hifill-tensorflow | 85a3332975a0c2da60116f72dc5a17f76c2d1b96 | [
"MIT"
] | 13 | 2020-10-26T01:34:01.000Z | 2022-03-23T01:52:23.000Z | import yaml
from easydict import EasyDict as edict
from tensorflow.python.ops import data_flow_ops
import tensorflow as tf
def load_yml(path):
with open(path, 'r') as f:
try:
config = yaml.load(f)
print(config)
return edict(config)
except yaml.YAMLError as exc:
... | 23 | 47 | 0.62029 | import yaml
from easydict import EasyDict as edict
from tensorflow.python.ops import data_flow_ops
import tensorflow as tf
def load_yml(path):
with open(path, 'r') as f:
try:
config = yaml.load(f)
print(config)
return edict(config)
except yaml.YAMLError as exc:
... | true | true |
f73ed6bd22d1a75a235635d5025edd24dfd253e5 | 657 | py | Python | Modules/Attention.py | drat/Neural-Voice-Cloning-With-Few-Samples | 4febde43ccc143fc88d74d5fa0c5a117636778b4 | [
"MIT"
] | 361 | 2018-08-17T14:37:29.000Z | 2022-03-15T13:04:16.000Z | Modules/Attention.py | drat/Neural-Voice-Cloning-With-Few-Samples | 4febde43ccc143fc88d74d5fa0c5a117636778b4 | [
"MIT"
] | 22 | 2018-11-25T13:42:26.000Z | 2020-04-29T05:16:25.000Z | Modules/Attention.py | drat/Neural-Voice-Cloning-With-Few-Samples | 4febde43ccc143fc88d74d5fa0c5a117636778b4 | [
"MIT"
] | 121 | 2018-08-30T03:53:09.000Z | 2022-03-25T09:03:17.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
from Modules.MultiHeadAttention import MultiHeadAttention
class Attention(nn.Module):
def __init__(self, dim):
super(Attention, self).__init__()
self.encoders = self._build_model(dim)
def _build_model(self, dim):
... | 24.333333 | 57 | 0.6621 | import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
from Modules.MultiHeadAttention import MultiHeadAttention
class Attention(nn.Module):
def __init__(self, dim):
super(Attention, self).__init__()
self.encoders = self._build_model(dim)
def _build_model(self, dim):
... | true | true |
f73ed7111bd86e854b241abd7a8e95261d3d782b | 3,076 | py | Python | monoloco/monoloco/visuals/plot_3d_box.py | galvinw/fairmotdocker | 032d50a4025788b97ca36b0d97b7df15ddb5986c | [
"MIT"
] | null | null | null | monoloco/monoloco/visuals/plot_3d_box.py | galvinw/fairmotdocker | 032d50a4025788b97ca36b0d97b7df15ddb5986c | [
"MIT"
] | null | null | null | monoloco/monoloco/visuals/plot_3d_box.py | galvinw/fairmotdocker | 032d50a4025788b97ca36b0d97b7df15ddb5986c | [
"MIT"
] | 2 | 2021-11-15T03:01:28.000Z | 2021-11-15T03:20:20.000Z |
import numpy as np
def correct_boxes(boxes, hwls, xyzs, yaws, path_calib):
with open(path_calib, "r") as ff:
file = ff.readlines()
p2_str = file[2].split()[1:]
p2_list = [float(xx) for xx in p2_str]
P = np.array(p2_list).reshape(3, 4)
boxes_new = []
for idx in range(boxes):
h... | 32.041667 | 76 | 0.586476 |
import numpy as np
def correct_boxes(boxes, hwls, xyzs, yaws, path_calib):
with open(path_calib, "r") as ff:
file = ff.readlines()
p2_str = file[2].split()[1:]
p2_list = [float(xx) for xx in p2_str]
P = np.array(p2_list).reshape(3, 4)
boxes_new = []
for idx in range(boxes):
h... | true | true |
f73ed73da48ea47de03e0fde95f500a416689a67 | 409 | py | Python | pyfk/__init__.py | ziyixi/pyfk | 2db56621cd4f9db5cf6a866fa0ca25fcb994b1d4 | [
"MIT"
] | 29 | 2019-09-08T03:43:55.000Z | 2022-03-16T06:13:08.000Z | pyfk/__init__.py | ziyixi/pyfk | 2db56621cd4f9db5cf6a866fa0ca25fcb994b1d4 | [
"MIT"
] | 9 | 2020-12-16T01:52:44.000Z | 2022-03-22T14:04:27.000Z | pyfk/__init__.py | ziyixi/pyfk | 2db56621cd4f9db5cf6a866fa0ca25fcb994b1d4 | [
"MIT"
] | 5 | 2021-02-17T14:46:32.000Z | 2022-01-24T02:43:03.000Z | from pyfk.config.config import Config, SeisModel, SourceModel
from pyfk.gf.gf import calculate_gf
from pyfk.gf.waveform_integration import mpi_info
from pyfk.sync.sync import calculate_sync, generate_source_time_function
__all__ = [
"SourceModel",
"SeisModel",
"Config",
"calculate_gf",
"calculate_s... | 25.5625 | 72 | 0.748166 | from pyfk.config.config import Config, SeisModel, SourceModel
from pyfk.gf.gf import calculate_gf
from pyfk.gf.waveform_integration import mpi_info
from pyfk.sync.sync import calculate_sync, generate_source_time_function
__all__ = [
"SourceModel",
"SeisModel",
"Config",
"calculate_gf",
"calculate_s... | true | true |
f73ed9d559c84ba26e305e2fdcda6d6bd470264c | 7,690 | py | Python | processingfcmsvd.py | Ditskih/Project | 87170245e55e615b0a14966d60afe41caece0434 | [
"Unlicense"
] | null | null | null | processingfcmsvd.py | Ditskih/Project | 87170245e55e615b0a14966d60afe41caece0434 | [
"Unlicense"
] | null | null | null | processingfcmsvd.py | Ditskih/Project | 87170245e55e615b0a14966d60afe41caece0434 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 21 15:38:52 2019
@author: Ditskih
"""
import os
import json
import re
import csv
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from sklearn.feature_extraction.text import CountVectorizer
#from sklearn.feature_extraction.text ... | 50.927152 | 159 | 0.477373 |
import os
import json
import re
import csv
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.random_projection import GaussianRandomProjection as G... | true | true |
f73eda20134489981bf33c4a600b93ed20064d0e | 3,045 | py | Python | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/DescribeCenRegionDomainRouteEntriesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/DescribeCenRegionDomainRouteEntriesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cbn/aliyunsdkcbn/request/v20170912/DescribeCenRegionDomainRouteEntriesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 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 u... | 38.544304 | 88 | 0.758949 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkcbn.endpoint import endpoint_data
class DescribeCenRegionDomainRouteEntriesRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Cbn', '2017-09-12', 'DescribeCenRegionDomainRouteEntries')
self.set_method('POST')
if h... | true | true |
f73eda34b97d868c08b0f2dbd69dbddb700a6dbb | 842 | py | Python | migrations/versions/3ee15b8edebb_add_sessions_table.py | romantomjak/dns-cockpit | 6fd5fc269061dec647b0d1fba79cb6c982777795 | [
"MIT"
] | 1 | 2018-08-27T10:07:25.000Z | 2018-08-27T10:07:25.000Z | migrations/versions/3ee15b8edebb_add_sessions_table.py | romantomjak/dns-cockpit | 6fd5fc269061dec647b0d1fba79cb6c982777795 | [
"MIT"
] | null | null | null | migrations/versions/3ee15b8edebb_add_sessions_table.py | romantomjak/dns-cockpit | 6fd5fc269061dec647b0d1fba79cb6c982777795 | [
"MIT"
] | 2 | 2018-10-06T22:56:33.000Z | 2021-01-03T16:14:53.000Z | """add sessions table
Revision ID: 3ee15b8edebb
Revises: feac35539764
Create Date: 2018-08-03 23:32:03.940252
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3ee15b8edebb'
down_revision = 'feac35539764'
branch_labels = None
depends_on = None
def upgrade():
... | 24.764706 | 68 | 0.673397 | from alembic import op
import sqlalchemy as sa
revision = '3ee15b8edebb'
down_revision = 'feac35539764'
branch_labels = None
depends_on = None
def upgrade():
mn('expires_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
| true | true |
f73edb68cd488318c962441da4a8b1eb42b61ff1 | 4,191 | py | Python | molecules/utils/callback.py | hengma1001/molecules | c6694cc77ef1eb246f3fdab1f201481d1bcaa07c | [
"MIT"
] | null | null | null | molecules/utils/callback.py | hengma1001/molecules | c6694cc77ef1eb246f3fdab1f201481d1bcaa07c | [
"MIT"
] | 1 | 2020-06-08T15:12:31.000Z | 2020-06-08T15:12:31.000Z | molecules/utils/callback.py | hengma1001/molecules | c6694cc77ef1eb246f3fdab1f201481d1bcaa07c | [
"MIT"
] | null | null | null | import os
import time
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Callback:
def __init__(self): pass
def on_train_begin(self, logs): pass
def on_train_end(self, logs): pass
def on_epoch_begin(self, epoch, logs): pass
def on_epoch_end(self, epoch, logs):... | 30.591241 | 85 | 0.599141 | import os
import time
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Callback:
def __init__(self): pass
def on_train_begin(self, logs): pass
def on_train_end(self, logs): pass
def on_epoch_begin(self, epoch, logs): pass
def on_epoch_end(self, epoch, logs):... | true | true |
f73edc7b371a9296edd3f0d18f5e398f84a86a1c | 3,305 | py | Python | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/data/data_service.py | suunni/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 2 | 2020-10-30T09:54:25.000Z | 2021-12-14T19:13:18.000Z | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/data/data_service.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 98 | 2017-01-19T04:24:02.000Z | 2017-10-27T11:30:50.000Z | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/data/data_service.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 294 | 2017-01-09T13:18:39.000Z | 2018-07-13T01:32:24.000Z | import iu.i524.S17IRP013.ncdc.weather_services as Services
import iu.i524.S17IRP013.dao.stations_dao as stations
import iu.i524.S17IRP013.dao.weather_dao as weather
import iu.i524.S17IRP013.util.app_util as AppUtil
###############################################################
def load_stations():
limit = 25 ... | 45.902778 | 148 | 0.591225 | import iu.i524.S17IRP013.ncdc.weather_services as Services
import iu.i524.S17IRP013.dao.stations_dao as stations
import iu.i524.S17IRP013.dao.weather_dao as weather
import iu.i524.S17IRP013.util.app_util as AppUtil
| false | true |
f73edcaf21e30793f30976838e24e314b008e00d | 371 | py | Python | programmers/lv1/12940.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | 1 | 2021-01-22T15:58:32.000Z | 2021-01-22T15:58:32.000Z | programmers/lv1/12940.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | programmers/lv1/12940.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | from math import gcd
# def getGcd(n, m):
# while m != 0:
# temp = n % m
# n = m
# m = temp
# return n
def solution(n: int, m: int):
# gcd = getGcd(n, m)
# lcm = n * m // gcd
# return [gcd, lcm]
g = gcd(n, m)
l = n * m // g
return g, l
if __name__ == "__main_... | 14.84 | 29 | 0.433962 | from math import gcd
def solution(n: int, m: int):
g = gcd(n, m)
l = n * m // g
return g, l
if __name__ == "__main__":
n = 3
m = 12
print(solution(n, m))
| true | true |
f73edcc14f750dd6ab36d1acd8f72ad451ac843e | 4,212 | py | Python | start.py | blairgao/iMessageChatbot | 73fca49536673da40dcfd24b0a70dce0a8202942 | [
"BSD-3-Clause"
] | null | null | null | start.py | blairgao/iMessageChatbot | 73fca49536673da40dcfd24b0a70dce0a8202942 | [
"BSD-3-Clause"
] | null | null | null | start.py | blairgao/iMessageChatbot | 73fca49536673da40dcfd24b0a70dce0a8202942 | [
"BSD-3-Clause"
] | null | null | null | import sys
import random
import string
import datetime
import logging
import subprocess
import json
import time
import requests
import urllib.request
import ssl
# Fixed Scraping: SSL: CERTIFICATE_VERIFY_FAILED error
ssl._create_default_https_context = ssl._create_unverified_context
HELP = """OPTIONS:
--cute ... | 32.4 | 121 | 0.597578 | import sys
import random
import string
import datetime
import logging
import subprocess
import json
import time
import requests
import urllib.request
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
HELP = """OPTIONS:
--cute (default) sends cute/caring/lovie-... | true | true |
f73eddf2f7412f9fb8281475ab7723626cb37399 | 2,486 | py | Python | testCases/noiseTest/sixMachineNoise4.ltd.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | testCases/noiseTest/sixMachineNoise4.ltd.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | testCases/noiseTest/sixMachineNoise4.ltd.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | # LTD simulation models / perturbances
# Attribute name case sensitive.
# Commented and empty lines are ignored
# Double quoted variable names in sysPert parameters ignored
# Uses Steps and no ACE filtering
# Perturbances
mirror.sysPerturbances = [
#'load 9 : step P 5 75 rel',
#'gen 5 : step Pm 5 -75 rel',
... | 35.514286 | 80 | 0.532985 |
mirror.sysPerturbances = [
]
mirror.sysPowerPlants ={'pp1': ["gen 2 1: 0.75 : step", "gen 2 2 : 0.25: step"],
'pp2': ["gen 3 : 0.75: step", "gen 4 : 0.25: step"],
}
mirror.NoiseAgent = ltd.perturbance.LoadNoiseAgent(mirror, 0.3, True)
mirro... | true | true |
f73ede6eb958c71d8efb3e061a8e2d340d744406 | 7,064 | py | Python | web/mainApp/views.py | njw1204/golf-online-judge | adb22653c457e97d5a239aa562725144235a2ab8 | [
"MIT"
] | 3 | 2019-07-22T20:00:07.000Z | 2021-12-17T17:54:09.000Z | web/mainApp/views.py | njw1204/golf-online-judge | adb22653c457e97d5a239aa562725144235a2ab8 | [
"MIT"
] | null | null | null | web/mainApp/views.py | njw1204/golf-online-judge | adb22653c457e97d5a239aa562725144235a2ab8 | [
"MIT"
] | 2 | 2019-06-18T18:41:10.000Z | 2021-04-15T09:57:31.000Z | from django.shortcuts import redirect, render
from django.views.generic.base import TemplateView
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from django.contrib.auth import login
from django.contrib import messages
from django.db import transaction
from .forms import CustomUser... | 39.909605 | 136 | 0.648783 | from django.shortcuts import redirect, render
from django.views.generic.base import TemplateView
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from django.contrib.auth import login
from django.contrib import messages
from django.db import transaction
from .forms import CustomUser... | true | true |
f73edfd15082c761095976f1e0a74df5e1ef490b | 1,734 | py | Python | whist/core/scoring/elo.py | Whist-Team/Whist-Core | b0130c6988592ba2094c7e1384362daabaefb3f4 | [
"MIT"
] | 1 | 2021-07-01T09:11:35.000Z | 2021-07-01T09:11:35.000Z | whist/core/scoring/elo.py | Whist-Team/Whist-Core | b0130c6988592ba2094c7e1384362daabaefb3f4 | [
"MIT"
] | 156 | 2021-04-20T10:01:21.000Z | 2022-03-29T21:20:25.000Z | whist/core/scoring/elo.py | Whist-Team/Whist-Core | b0130c6988592ba2094c7e1384362daabaefb3f4 | [
"MIT"
] | 2 | 2021-04-18T21:26:22.000Z | 2022-03-20T17:41:13.000Z | """
Elo Rating Calculator
"""
from whist.core.scoring.score_card import ScoreCard
from whist.core.scoring.team import Team
from whist.core.user.player import Player
# pylint: disable=too-few-public-methods
class EloRater:
"""
Static class that calculates the Elo-Rating for players after several hands played.
... | 29.896552 | 87 | 0.620531 | from whist.core.scoring.score_card import ScoreCard
from whist.core.scoring.team import Team
from whist.core.user.player import Player
class EloRater:
@staticmethod
def rate(teams: list[Team], scores: ScoreCard) -> None:
delta = EloRater._score_delta(teams[0], teams[1], scores)
for team in t... | true | true |
f73edffebe683195910b7afb5e25cdffa1d8f234 | 19,234 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/protection_containers_operations.py | AlexanderYukhanov/azure-sdk-for-python | 41e37c8a10876db40697a63e828ed7cafc19c7d6 | [
"MIT"
] | null | null | null | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/protection_containers_operations.py | AlexanderYukhanov/azure-sdk-for-python | 41e37c8a10876db40697a63e828ed7cafc19c7d6 | [
"MIT"
] | null | null | null | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/protection_containers_operations.py | AlexanderYukhanov/azure-sdk-for-python | 41e37c8a10876db40697a63e828ed7cafc19c7d6 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.958442 | 228 | 0.68145 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class ProtectionContainersOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
s... | true | true |
f73ee06e0cd088c903736ac6be38d340e03b4d63 | 153 | py | Python | rl_env/gym-tictac4/setup.py | SeanAmmirati/fantasy_football_pred | d361af3afa6595112f80b47571eb5c42a7c69dbf | [
"MIT"
] | null | null | null | rl_env/gym-tictac4/setup.py | SeanAmmirati/fantasy_football_pred | d361af3afa6595112f80b47571eb5c42a7c69dbf | [
"MIT"
] | null | null | null | rl_env/gym-tictac4/setup.py | SeanAmmirati/fantasy_football_pred | d361af3afa6595112f80b47571eb5c42a7c69dbf | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='gym_tictac4',
version='0.0.1',
install_requires=['gym'] # And any other dependencies foo needs
) | 25.5 | 70 | 0.686275 | from setuptools import setup
setup(name='gym_tictac4',
version='0.0.1',
install_requires=['gym']
) | true | true |
f73ee0974fc20e64b8d52ff2d9b8a6938da54a2b | 2,079 | py | Python | watevrCTF-2019/challenges/web/NewPwd/train.py | bemrdo/CTF-2019 | 424512f7c43278d72091aa737da78907c14f9fc1 | [
"MIT"
] | null | null | null | watevrCTF-2019/challenges/web/NewPwd/train.py | bemrdo/CTF-2019 | 424512f7c43278d72091aa737da78907c14f9fc1 | [
"MIT"
] | null | null | null | watevrCTF-2019/challenges/web/NewPwd/train.py | bemrdo/CTF-2019 | 424512f7c43278d72091aa737da78907c14f9fc1 | [
"MIT"
] | 1 | 2020-03-14T07:24:12.000Z | 2020-03-14T07:24:12.000Z | import requests
import urllib.parse
import base64
import json
import io
import numpy as np
from PIL import Image
import cv2.cv2 as cv
from solve import *
def combine_and_show_alphabet():
imgTop = np.empty((50, 0))
imgBottom = np.empty((50, 0))
for char in alphabet[:16]:
imgTop = np.append(imgTop, n... | 31.029851 | 87 | 0.570948 | import requests
import urllib.parse
import base64
import json
import io
import numpy as np
from PIL import Image
import cv2.cv2 as cv
from solve import *
def combine_and_show_alphabet():
imgTop = np.empty((50, 0))
imgBottom = np.empty((50, 0))
for char in alphabet[:16]:
imgTop = np.append(imgTop, n... | true | true |
f73ee10290ecacf9ebc8b85843f1c2704c4354fe | 1,036 | py | Python | src/tests/TestResultsWriter.py | mjyeaney/CustomVisionParallelScoring | 2803cdb13f9512763a4204db4e44e1c9d6e7f7c1 | [
"MIT"
] | 3 | 2019-09-06T19:49:05.000Z | 2019-10-28T19:07:21.000Z | src/tests/TestResultsWriter.py | mjyeaney/CustomVisionParallelScoring | 2803cdb13f9512763a4204db4e44e1c9d6e7f7c1 | [
"MIT"
] | 6 | 2019-09-11T22:49:57.000Z | 2022-03-11T23:57:28.000Z | src/tests/TestResultsWriter.py | mjyeaney/CustomVisionParallelScoring | 2803cdb13f9512763a4204db4e44e1c9d6e7f7c1 | [
"MIT"
] | 2 | 2019-09-17T11:23:00.000Z | 2019-10-28T19:07:30.000Z | import unittest
import sys
import os
import glob
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)
from ResultsWriter import ImageWithBoundingBoxes
class TestResultsWriter(unittest.TestCase):
def test_basic_box_drawing(self):
writer = ImageWithBoundingBoxes()
... | 30.470588 | 91 | 0.647683 | import unittest
import sys
import os
import glob
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)
from ResultsWriter import ImageWithBoundingBoxes
class TestResultsWriter(unittest.TestCase):
def test_basic_box_drawing(self):
writer = ImageWithBoundingBoxes()
... | true | true |
f73ee15fbc73a5653c396a273bf36cbeb81d3f6f | 18,934 | py | Python | lib/matplotlib/spines.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-15T09:40:53.000Z | 2019-04-15T09:40:53.000Z | lib/matplotlib/spines.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/spines.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import matplotlib
import matplotlib.artist as martist
from matplotlib.artist import allow_rasterization
from matplotlib import docstring
import matplotlib.transforms as mtransforms
import matplotli... | 38.719836 | 79 | 0.538344 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import matplotlib
import matplotlib.artist as martist
from matplotlib.artist import allow_rasterization
from matplotlib import docstring
import matplotlib.transforms as mtransforms
import matplotli... | true | true |
f73ee32bc10b29282276512bc591b64393af49f2 | 657 | py | Python | model/new_user.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | model/new_user.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | model/new_user.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | """
class NewUser:
def __init__(self, fName, mName, lName, nickName, photo, title, company, address, hTel, mTel, wTel, eMail, homepage, sAddress, sHome, sNotes):
self.fName = fName
self.mName = mName
self.lName = lName
self.nickName = nickName
self.photo = photo
self.... | 29.863636 | 146 | 0.584475 | true | true | |
f73ee4e9ce460650c7d139ea552aab8018d7f942 | 244 | py | Python | slaterify/utils.py | merindorium/slaterify | 3af3f4d811ae43442b13a532e932c34e301b90c6 | [
"MIT"
] | 1 | 2019-04-10T19:53:56.000Z | 2019-04-10T19:53:56.000Z | slaterify/utils.py | merindorium/slaterify | 3af3f4d811ae43442b13a532e932c34e301b90c6 | [
"MIT"
] | null | null | null | slaterify/utils.py | merindorium/slaterify | 3af3f4d811ae43442b13a532e932c34e301b90c6 | [
"MIT"
] | null | null | null | _components = {}
def add_component(path, data):
_components[path] = data
def get_component(path):
try:
return _components[path]
except KeyError:
raise NameError('There is no component with path {}'.format(path))
| 18.769231 | 74 | 0.663934 | _components = {}
def add_component(path, data):
_components[path] = data
def get_component(path):
try:
return _components[path]
except KeyError:
raise NameError('There is no component with path {}'.format(path))
| true | true |
f73ee516b43ca3f50af6df73c9a1ebb43b5efd25 | 4,763 | py | Python | src/beanmachine/ppl/inference/tests/inference_test.py | ToddSmall/beanmachine | 85768bd1785bf6a8b3760a04f37a8fca69b4e4ca | [
"MIT"
] | null | null | null | src/beanmachine/ppl/inference/tests/inference_test.py | ToddSmall/beanmachine | 85768bd1785bf6a8b3760a04f37a8fca69b4e4ca | [
"MIT"
] | null | null | null | src/beanmachine/ppl/inference/tests/inference_test.py | ToddSmall/beanmachine | 85768bd1785bf6a8b3760a04f37a8fca69b4e4ca | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import sys
import beanmachine.ppl as bm
import pytest
import torch
import torch.distributions as dist
from beanmachine.ppl.infe... | 29.76875 | 86 | 0.678564 |
import math
import sys
import beanmachine.ppl as bm
import pytest
import torch
import torch.distributions as dist
from beanmachine.ppl.inference.proposer.base_proposer import (
BaseProposer,
)
from beanmachine.ppl.world import World, init_from_prior
class SampleModel:
@bm.random_variable
def foo(sel... | true | true |
f73ee62acd60598726c4a8b903210294712cd4c2 | 3,813 | py | Python | config.py | trantinan2512/Francis | f5f7cd3c5af6efd36d6c25c0c516dbf286195f11 | [
"MIT"
] | null | null | null | config.py | trantinan2512/Francis | f5f7cd3c5af6efd36d6c25c0c516dbf286195f11 | [
"MIT"
] | 2 | 2020-02-11T23:06:52.000Z | 2020-06-05T18:46:58.000Z | config.py | trantinan2512/francis-discord-bot | f5f7cd3c5af6efd36d6c25c0c516dbf286195f11 | [
"MIT"
] | 1 | 2019-06-12T21:33:20.000Z | 2019-06-12T21:33:20.000Z | import os
from decouple import config, Csv
DEBUG = config('DEBUG', default=False, cast=bool)
FRANCIS_TOKEN = config('FRANCIS_TOKEN')
OZ_TOKEN = config('OZ_TOKEN')
MY_ID = config('MY_ID', cast=int)
SERVER_ID = config('SERVER_ID', cast=int)
BOT_PREFIX = config('BOT_PREFIX', default='!')
# Twitter stuff
TWITTER_CONSUME... | 29.10687 | 111 | 0.717545 | import os
from decouple import config, Csv
DEBUG = config('DEBUG', default=False, cast=bool)
FRANCIS_TOKEN = config('FRANCIS_TOKEN')
OZ_TOKEN = config('OZ_TOKEN')
MY_ID = config('MY_ID', cast=int)
SERVER_ID = config('SERVER_ID', cast=int)
BOT_PREFIX = config('BOT_PREFIX', default='!')
TWITTER_CONSUMER_KEY = config(... | true | true |
f73ee6c7fa31b135d219baa1fac0e39fa5293694 | 3,642 | py | Python | fuxi/core/databases/orm/discovery/port_orm.py | jeffzh3ng/fuxi-scanner | fadb1136b8896fe2a0f7783627bda867d5e6fd98 | [
"MIT"
] | 731 | 2018-06-13T05:41:04.000Z | 2019-09-06T01:36:57.000Z | fuxi/core/databases/orm/discovery/port_orm.py | riusksk/fuxi | fadb1136b8896fe2a0f7783627bda867d5e6fd98 | [
"MIT"
] | 16 | 2019-10-14T08:17:13.000Z | 2021-12-13T20:13:23.000Z | fuxi/core/databases/orm/discovery/port_orm.py | riusksk/fuxi | fadb1136b8896fe2a0f7783627bda867d5e6fd98 | [
"MIT"
] | 238 | 2018-06-14T08:59:44.000Z | 2019-09-04T06:35:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 2019/9/6
# @File : port_orm.py
# @Desc : ""
import time
from bson import ObjectId
from flask import session
from fuxi.core.databases.db_error import DatabaseError
from fuxi.core.databases.orm.database_base import DatabaseBase
from... | 30.605042 | 90 | 0.551345 |
import time
from bson import ObjectId
from flask import session
from fuxi.core.databases.db_error import DatabaseError
from fuxi.core.databases.orm.database_base import DatabaseBase
from fuxi.core.databases.db_mongo import mongo, T_PORT_TASKS, T_PORT_RESULT
from fuxi.common.utils.logger import logger
class _D... | true | true |
f73ee6d250c43b153743c980a135d678be14cdab | 2,095 | py | Python | src/editor/wxUI/baseTreeControl.py | rehmanx/PandaEditor | 125c79605fd46a045201e5ff6a88709764ac104f | [
"MIT"
] | null | null | null | src/editor/wxUI/baseTreeControl.py | rehmanx/PandaEditor | 125c79605fd46a045201e5ff6a88709764ac104f | [
"MIT"
] | null | null | null | src/editor/wxUI/baseTreeControl.py | rehmanx/PandaEditor | 125c79605fd46a045201e5ff6a88709764ac104f | [
"MIT"
] | null | null | null | import wx
import wx.lib.agw.customtreectrl as customtree
class BaseTreeControl(customtree.CustomTreeCtrl):
def __init__(self, parent, *args, **kwargs):
"""Base tree controls implements a custom drag drop operation"""
customtree.CustomTreeCtrl.__init__(self, parent, *args, **kwargs)
# for... | 32.230769 | 96 | 0.601909 | import wx
import wx.lib.agw.customtreectrl as customtree
class BaseTreeControl(customtree.CustomTreeCtrl):
def __init__(self, parent, *args, **kwargs):
customtree.CustomTreeCtrl.__init__(self, parent, *args, **kwargs)
self.mouse_left_down = False
self.is_dragging = False
... | true | true |
f73ee7cbd890517075626fd833578fb3110e4e9f | 3,077 | py | Python | wgail_info_2/preprocess.py | hzyjerry/InfoGAIL | 89bf3bee42242f4a8a41401d17296773294e6b6a | [
"MIT"
] | null | null | null | wgail_info_2/preprocess.py | hzyjerry/InfoGAIL | 89bf3bee42242f4a8a41401d17296773294e6b6a | [
"MIT"
] | null | null | null | wgail_info_2/preprocess.py | hzyjerry/InfoGAIL | 89bf3bee42242f4a8a41401d17296773294e6b6a | [
"MIT"
] | null | null | null | from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input
from keras.models import Model
import numpy as np
import time
import cv2
def collect_demo(path, num_patch, aux_dim, action_dim):
for i in range(num_patch):
path_... | 33.086022 | 93 | 0.574911 | from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input
from keras.models import Model
import numpy as np
import time
import cv2
def collect_demo(path, num_patch, aux_dim, action_dim):
for i in range(num_patch):
path_... | true | true |
f73ee8077f517575e1ee630a42cad76392adc9c9 | 1,947 | py | Python | tests/Simple/SupLstm/visualize_policy.py | maxiaoba/rlk | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | 1 | 2021-09-28T21:16:54.000Z | 2021-09-28T21:16:54.000Z | tests/Simple/SupLstm/visualize_policy.py | maxiaoba/rlkit | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | null | null | null | tests/Simple/SupLstm/visualize_policy.py | maxiaoba/rlkit | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | null | null | null | import torch
import numpy as np
import time
import pdb
from rlkit.torch.core import eval_np, np_ify
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--exp_name', type=str, default='SimpleSupLSTM')
parser.add_argument('--extra_name', type=str, default='obs1int10')
parser.add_argument('--log_dir',... | 27.041667 | 83 | 0.724191 | import torch
import numpy as np
import time
import pdb
from rlkit.torch.core import eval_np, np_ify
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--exp_name', type=str, default='SimpleSupLSTM')
parser.add_argument('--extra_name', type=str, default='obs1int10')
parser.add_argument('--log_dir',... | true | true |
f73ee9e5af67073b0da598dca04d06e699fdccd1 | 440 | py | Python | PrepareData.py | YungRAW/ComputerScienceLicense---PlagiarismChecker | 411199d4d8cb33dbeebc0f204c46d74c976fb9cd | [
"MIT"
] | 10 | 2020-06-29T13:18:22.000Z | 2021-07-29T02:19:54.000Z | PrepareData.py | YungRAW/ComputerScienceLicense---PlagiarismChecker | 411199d4d8cb33dbeebc0f204c46d74c976fb9cd | [
"MIT"
] | 1 | 2020-08-20T17:29:31.000Z | 2020-08-20T19:43:12.000Z | PrepareData.py | YungRAW/ComputerScienceLicense---PlagiarismChecker | 411199d4d8cb33dbeebc0f204c46d74c976fb9cd | [
"MIT"
] | 2 | 2021-08-24T18:57:20.000Z | 2022-02-17T00:31:02.000Z | import os
import Utils
def load_data():
files = []
documents = []
path = 'Data/Plagiarism Documents';
for r, d, f in os.walk(path):
for file in f:
if '.txt' in file:
files.append(path+'/'+file)
for path in files:
file = open(path ,'r')
lines = ... | 17.6 | 64 | 0.540909 | import os
import Utils
def load_data():
files = []
documents = []
path = 'Data/Plagiarism Documents';
for r, d, f in os.walk(path):
for file in f:
if '.txt' in file:
files.append(path+'/'+file)
for path in files:
file = open(path ,'r')
lines = ... | true | true |
f73eea9cc59b6add9520d8d1d1d611aa98560f52 | 285 | py | Python | examples/promote_as_admin.py | fedor-chemashkin/harbor-python | d7b0e63e9b460530c66918d8849ed5aba4319c49 | [
"Apache-2.0"
] | 11 | 2019-01-28T08:08:18.000Z | 2022-02-03T15:47:49.000Z | examples/promote_as_admin.py | fedor-chemashkin/harbor-python | d7b0e63e9b460530c66918d8849ed5aba4319c49 | [
"Apache-2.0"
] | null | null | null | examples/promote_as_admin.py | fedor-chemashkin/harbor-python | d7b0e63e9b460530c66918d8849ed5aba4319c49 | [
"Apache-2.0"
] | 12 | 2019-05-28T18:25:26.000Z | 2022-03-17T11:08:40.000Z | #!/usr/bin/env python
import sys
sys.path.append("../")
from harborclient_light import harborclient
host = "127.0.0.1"
user = "admin"
password = "Harbor12345"
client = harborclient.HarborClient(host, user, password)
# Promote as admin
user_id = 2
client.promote_as_admin(user_id)
| 16.764706 | 56 | 0.74386 |
import sys
sys.path.append("../")
from harborclient_light import harborclient
host = "127.0.0.1"
user = "admin"
password = "Harbor12345"
client = harborclient.HarborClient(host, user, password)
user_id = 2
client.promote_as_admin(user_id)
| true | true |
f73eeadec33885d91247f63d260772f3be335b8a | 543 | py | Python | devices/master/plugins/epg_sat/read_epg_json.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | null | null | null | devices/master/plugins/epg_sat/read_epg_json.py | stko/Schnipsl | 824572c657e48f18950f584b9529661ff5bb8069 | [
"MIT"
] | 29 | 2020-08-30T15:07:50.000Z | 2022-02-19T03:41:26.000Z | devices/master/plugins/epg_sat/read_epg_json.py | wifitvbox/Schnipsl | 553ce8de3dda26fb92297ad76e92f4a363070e4e | [
"MIT"
] | 1 | 2020-12-28T05:46:17.000Z | 2020-12-28T05:46:17.000Z | import sys
import json
from datetime import datetime
lastEnd=0
with open(sys.argv[1]) as json_file:
data = json.load(json_file)
times=sorted(list(data['details']))
for time in times:
p=data['details'][time]
print('{0} {1} {2}-{3}'.format(
datetime.utcfromtimestamp(p['unixTimeBegin']).strftime('%Y-%m-%d %H:%... | 24.681818 | 84 | 0.627993 | import sys
import json
from datetime import datetime
lastEnd=0
with open(sys.argv[1]) as json_file:
data = json.load(json_file)
times=sorted(list(data['details']))
for time in times:
p=data['details'][time]
print('{0} {1} {2}-{3}'.format(
datetime.utcfromtimestamp(p['unixTimeBegin']).strftime('%Y-%m-%d %H:%... | true | true |
f73eeb5dbe470dea4ec0a9950f7e35c6c2859821 | 6,522 | py | Python | cvpods/engine/setup.py | reinforcementdriving/cvpods | 32d98b74745020be035a0e20337ad934201615c4 | [
"Apache-2.0"
] | 758 | 2021-03-11T08:14:26.000Z | 2022-03-31T07:24:13.000Z | cvpods/engine/setup.py | wondervictor/cvpods | 614a975e5425bbaeb66bbd1ffca552d633ba89ca | [
"Apache-2.0"
] | 58 | 2020-12-04T19:47:10.000Z | 2022-03-30T06:52:13.000Z | cvpods/engine/setup.py | wondervictor/cvpods | 614a975e5425bbaeb66bbd1ffca552d633ba89ca | [
"Apache-2.0"
] | 110 | 2021-03-18T01:59:31.000Z | 2022-03-18T21:26:56.000Z | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
This file contains components with some default boilerplate logic user may need
in training / testing. They will not work for everyone, but many users may find them useful.
The behavior of functions/classes in this file ... | 39.289157 | 97 | 0.665747 |
import argparse
import os
import torch
from cvpods.utils import PathManager, collect_env_info, comm, seed_all_rng, setup_logger
__all__ = ["default_argument_parser", "default_setup"]
def default_argument_parser():
parser = argparse.ArgumentParser(description="cvpods Training")
parser.add_argument(
... | true | true |
f73eebb96d95028ff8078a10cf24ef3d0370bb84 | 2,202 | py | Python | google/ads/googleads/v9/resources/types/distance_view.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/resources/types/distance_view.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/resources/types/distance_view.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 34.952381 | 96 | 0.710718 |
import proto
from google.ads.googleads.v9.enums.types import (
distance_bucket as gage_distance_bucket,
)
__protobuf__ = proto.module(
package="google.ads.googleads.v9.resources",
marshal="google.ads.googleads.v9",
manifest={"DistanceView",},
)
class DistanceView(proto.Message):
... | true | true |
f73eebc9fcb0dae3af2ebfd4cf16484ab4e2e10d | 921 | py | Python | audiofile_processor.py | ChameleonTartu/audio-files-to-pomodoro-counts | 654e090b94e145ec7ed73e9c62f7819483265eeb | [
"MIT"
] | null | null | null | audiofile_processor.py | ChameleonTartu/audio-files-to-pomodoro-counts | 654e090b94e145ec7ed73e9c62f7819483265eeb | [
"MIT"
] | 10 | 2019-10-01T19:24:12.000Z | 2020-05-14T12:22:21.000Z | audiofile_processor.py | ChameleonTartu/audio-files-to-pomodoro-counts | 654e090b94e145ec7ed73e9c62f7819483265eeb | [
"MIT"
] | null | null | null | from os import listdir
import os.path as osp
class AudiofileProcessor(object):
SECONDS = 60
POMADORO_LENGTH_IN_SECONDS = 25 * SECONDS
def __init__(self, directory, filter_by_ext, length_calculator):
self.directory = directory
self.filter_by_ext = filter_by_ext
self.length_calculator = length_calculator
de... | 28.78125 | 73 | 0.724213 | from os import listdir
import os.path as osp
class AudiofileProcessor(object):
SECONDS = 60
POMADORO_LENGTH_IN_SECONDS = 25 * SECONDS
def __init__(self, directory, filter_by_ext, length_calculator):
self.directory = directory
self.filter_by_ext = filter_by_ext
self.length_calculator = length_calculator
de... | true | true |
f73eebfe78f6d70463ddaa46312924b97cedc2d0 | 60 | py | Python | dndgui/__init__.py | a24ma/msg2eml | dc5d23339cd231991918fc6956a94a30308b72d5 | [
"MIT"
] | 1 | 2020-10-11T14:21:30.000Z | 2020-10-11T14:21:30.000Z | dndgui/__init__.py | a24ma/msg2eml | dc5d23339cd231991918fc6956a94a30308b72d5 | [
"MIT"
] | null | null | null | dndgui/__init__.py | a24ma/msg2eml | dc5d23339cd231991918fc6956a94a30308b72d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from dndgui.gui import MainForm
| 15 | 32 | 0.616667 |
from dndgui.gui import MainForm
| true | true |
f73eec910b41c90b9ba6b5d397715bcc48037279 | 8,709 | py | Python | tetris.py | olemb/tetris | 198f2e88915ea9af792eede47179f677dc5e993b | [
"MIT"
] | 1 | 2020-12-06T14:07:17.000Z | 2020-12-06T14:07:17.000Z | tetris.py | olemb/tetris | 198f2e88915ea9af792eede47179f677dc5e993b | [
"MIT"
] | null | null | null | tetris.py | olemb/tetris | 198f2e88915ea9af792eede47179f677dc5e993b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Tetris for Python / Tkinter
Ole Martin Bjorndalen
https://github.com/olemb/tetris/
http://tetris.wikia.com/wiki/Tetris_Guideline
"""
import random
from dataclasses import dataclass, replace
import tkinter
shapes = {
# See README.md for format.
'O': ['56a9', '6a95', 'a956', '956a']... | 26.390909 | 78 | 0.531289 |
import random
from dataclasses import dataclass, replace
import tkinter
shapes = {
'O': ['56a9', '6a95', 'a956', '956a'],
'I': ['4567', '26ae', 'ba98', 'd951'],
'J': ['0456', '2159', 'a654', '8951'],
'L': ['2654', 'a951', '8456', '0159'],
'T': ['1456', '6159', '9654', '4951'],
'Z': ['015... | true | true |
f73eed23beb24e99fb12f3935fece405e40ae4ef | 946 | py | Python | tests/programs/import_variants/some_package/Child1.py | RESP3CT88/Nuitka | 0fcc25d9f00c4fc78c79a863c4b7987f573962e1 | [
"Apache-2.0"
] | 5,421 | 2018-09-24T08:04:06.000Z | 2022-03-31T20:02:37.000Z | tests/programs/import_variants/some_package/Child1.py | ztessler/Nuitka | 04c9a5471b702a0e5f28398f2661c93b83ab0d1a | [
"Apache-2.0"
] | 1,348 | 2018-09-22T13:41:00.000Z | 2022-03-31T22:33:40.000Z | tests/programs/import_variants/some_package/Child1.py | ztessler/Nuitka | 04c9a5471b702a0e5f28398f2661c93b83ab0d1a | [
"Apache-2.0"
] | 396 | 2018-09-28T15:37:03.000Z | 2022-03-29T10:52:09.000Z | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 33.785714 | 79 | 0.714588 |
from __future__ import print_function
from . import Child3 as localname
print("*** Child1: Begin")
print("*** Child1: Imported Child3", localname)
print("*** Child1: End")
| true | true |
f73eed4de0acdd9e394274d88cb030e2f3e15656 | 58,707 | py | Python | ietf/meeting/models.py | jimfenton/datatracker | 25c7c4801a0d971f30027d7e1ac21120cefeb242 | [
"BSD-3-Clause"
] | null | null | null | ietf/meeting/models.py | jimfenton/datatracker | 25c7c4801a0d971f30027d7e1ac21120cefeb242 | [
"BSD-3-Clause"
] | 9 | 2022-01-14T05:56:29.000Z | 2022-01-20T05:27:41.000Z | ietf/meeting/models.py | jimfenton/datatracker | 25c7c4801a0d971f30027d7e1ac21120cefeb242 | [
"BSD-3-Clause"
] | 1 | 2022-02-22T21:43:25.000Z | 2022-02-22T21:43:25.000Z | # Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# old meeting models can be found in ../proceedings/models.py
import datetime
import io
import os
import pytz
import random
import re
import string
from collections import namedtuple
from pathlib import Path
from urllib.parse import u... | 42.47974 | 216 | 0.657877 |
import datetime
import io
import os
import pytz
import random
import re
import string
from collections import namedtuple
from pathlib import Path
from urllib.parse import urljoin
import debug
from django.core.validators import MinValueValidator, RegexValidator
from django.db import ... | true | true |
f73eed7e2c3b541fcdd6322f243ee0ce268c9008 | 89 | py | Python | coaches/apps.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | coaches/apps.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | coaches/apps.py | keeks-mtl/go-tennis | af3f325a9cfb2faba4d935824492f4aea6d10309 | [
"W3C",
"PostgreSQL"
] | null | null | null | from django.apps import AppConfig
class CoachesConfig(AppConfig):
name = 'coaches'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class CoachesConfig(AppConfig):
name = 'coaches'
| true | true |
f73eeebd09ea4fb83b7179f39a77f63e26e50787 | 4,743 | py | Python | tests/test_dask_image/test_ndfilters/test__conv.py | anlavandier/dask-image | a858c61ac5beb7de7d7644d7e85714b5c16c2a7a | [
"BSD-3-Clause"
] | 144 | 2018-03-02T16:52:10.000Z | 2022-03-29T11:41:06.000Z | tests/test_dask_image/test_ndfilters/test__conv.py | anlavandier/dask-image | a858c61ac5beb7de7d7644d7e85714b5c16c2a7a | [
"BSD-3-Clause"
] | 184 | 2018-03-02T19:43:26.000Z | 2022-03-31T10:20:05.000Z | tests/test_dask_image/test_ndfilters/test__conv.py | anlavandier/dask-image | a858c61ac5beb7de7d7644d7e85714b5c16c2a7a | [
"BSD-3-Clause"
] | 35 | 2018-03-02T16:37:48.000Z | 2021-12-10T20:47:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import scipy.ndimage
import dask.array as da
import dask_image.ndfilters
@pytest.mark.parametrize(
"da_func",
[
(dask_image.ndfilters.convolve),
(dask_image.ndfilters.correlate),
]
)
@pytest.mark.parametrize(
... | 25.228723 | 74 | 0.520557 |
import pytest
import numpy as np
import scipy.ndimage
import dask.array as da
import dask_image.ndfilters
@pytest.mark.parametrize(
"da_func",
[
(dask_image.ndfilters.convolve),
(dask_image.ndfilters.correlate),
]
)
@pytest.mark.parametrize(
"err_type, weights, origin",
[
... | true | true |
f73eeed44ee1612072a37709a299d44b2467fc68 | 134 | py | Python | fedot/core/utils.py | alievilya/nas-fedot | ce1b07505cd189f3097f1cfa6c38cb4f0d56ccea | [
"BSD-3-Clause"
] | 13 | 2020-07-14T10:52:40.000Z | 2022-03-31T13:01:47.000Z | fedot/core/utils.py | alievilya/nas-fedot | ce1b07505cd189f3097f1cfa6c38cb4f0d56ccea | [
"BSD-3-Clause"
] | null | null | null | fedot/core/utils.py | alievilya/nas-fedot | ce1b07505cd189f3097f1cfa6c38cb4f0d56ccea | [
"BSD-3-Clause"
] | 5 | 2020-08-10T09:43:22.000Z | 2022-03-22T08:28:08.000Z | from pathlib import Path
def project_root() -> Path:
"""Returns project root folder."""
return Path(__file__).parent.parent
| 19.142857 | 39 | 0.701493 | from pathlib import Path
def project_root() -> Path:
return Path(__file__).parent.parent
| true | true |
f73ef0e03b53552f5c2372166d7234b5de548074 | 404 | py | Python | onadata/apps/messaging/constants.py | childhelpline/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | onadata/apps/messaging/constants.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | onadata/apps/messaging/constants.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | # -*- coding: utf-8 -*-
"""
Messaging constant variables.
"""
from __future__ import unicode_literals
from builtins import str as text
from django.utils.translation import ugettext as _
XFORM = text('xform')
PROJECT = text('project')
USER = text('user')
APP_LABEL_MAPPING = {
XFORM: 'logger',
PROJECT: 'logg... | 16.833333 | 50 | 0.685644 |
from __future__ import unicode_literals
from builtins import str as text
from django.utils.translation import ugettext as _
XFORM = text('xform')
PROJECT = text('project')
USER = text('user')
APP_LABEL_MAPPING = {
XFORM: 'logger',
PROJECT: 'logger',
USER: 'auth',
}
MESSAGE = 'message'
UNKNOWN_TARGET ... | true | true |
f73ef15a6862806cc0d1f25594d5afbcc3576211 | 32,638 | py | Python | venv/lib/python3.7/site-packages/scapy/layers/tls/automaton_cli.py | nicholasadamou/python-proxy | 5be02cf0a20c243bd619808e11a1fa6b26bf7998 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/scapy/layers/tls/automaton_cli.py | nicholasadamou/python-proxy | 5be02cf0a20c243bd619808e11a1fa6b26bf7998 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/scapy/layers/tls/automaton_cli.py | nicholasadamou/python-proxy | 5be02cf0a20c243bd619808e11a1fa6b26bf7998 | [
"MIT"
] | null | null | null | # This file is part of Scapy
# Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
# 2015, 2016, 2017 Maxence Tury
# This program is published under a GPLv2 license
"""
TLS client automaton. This makes for a primitive TLS stack.
Obviously you need rights for network access.
We support versions SSLv2 to TLS 1.... | 34.464625 | 101 | 0.660549 |
from __future__ import print_function
import socket
from scapy.pton_ntop import inet_pton
from scapy.utils import randstring, repr_hex
from scapy.automaton import ATMT
from scapy.layers.tls.automaton import _TLSAutomaton
from scapy.layers.tls.basefields import _tls_version, _tls_version_options
from scapy.layers... | true | true |
f73ef1ca33f42dc641ef0eed3b2bcc6482af570d | 1,206 | py | Python | app/scripts/GeopackageCADRG.py | GeoJamesJones/EZ-Admin | 0299f8bc826d3ce8320ca89c2f7ce501698864ea | [
"Apache-2.0"
] | null | null | null | app/scripts/GeopackageCADRG.py | GeoJamesJones/EZ-Admin | 0299f8bc826d3ce8320ca89c2f7ce501698864ea | [
"Apache-2.0"
] | 3 | 2020-03-24T17:28:41.000Z | 2021-02-02T22:09:16.000Z | app/scripts/GeopackageCADRG.py | GeoJamesJones/EZ-Admin | 0299f8bc826d3ce8320ca89c2f7ce501698864ea | [
"Apache-2.0"
] | null | null | null | import arcpy
import os
# Creates an OGC Geopackage from the CADRG Folder
cwd = arcpy.env.workspace = r"C:\services\data\cadrg"
workspaces = arcpy.ListWorkspaces("*")
gpkgs = []
try:
for workspace in workspaces:
gpkg_name = os.path.split(workspace)[1] + ".gpkg"
if arcpy.Exists(gpkg_name) == Fal... | 28.046512 | 92 | 0.580431 | import arcpy
import os
cwd = arcpy.env.workspace = r"C:\services\data\cadrg"
workspaces = arcpy.ListWorkspaces("*")
gpkgs = []
try:
for workspace in workspaces:
gpkg_name = os.path.split(workspace)[1] + ".gpkg"
if arcpy.Exists(gpkg_name) == False:
arcpy.CreateSQLiteDatabase_manage... | true | true |
f73ef23572dce6b683dc4340a9c67b607b580186 | 431 | py | Python | CPAC/nuisance/__init__.py | chrisfoulon/C-PAC | 2746a90c39cea586aede98343c5927252bb8e81a | [
"BSD-3-Clause"
] | 1 | 2021-08-02T23:23:39.000Z | 2021-08-02T23:23:39.000Z | CPAC/nuisance/__init__.py | chrisfoulon/C-PAC | 2746a90c39cea586aede98343c5927252bb8e81a | [
"BSD-3-Clause"
] | null | null | null | CPAC/nuisance/__init__.py | chrisfoulon/C-PAC | 2746a90c39cea586aede98343c5927252bb8e81a | [
"BSD-3-Clause"
] | 2 | 2021-08-02T23:23:40.000Z | 2022-02-26T12:39:30.000Z | from utils import calc_compcor_components, \
erode_mask
from nuisance import create_nuisance, \
calc_residuals, \
bandpass_voxels, \
extract_tissue_data
__all__ = ['create_nuisance', \
'calc_residuals', \
'bandpass_... | 30.785714 | 44 | 0.538283 | from utils import calc_compcor_components, \
erode_mask
from nuisance import create_nuisance, \
calc_residuals, \
bandpass_voxels, \
extract_tissue_data
__all__ = ['create_nuisance', \
'calc_residuals', \
'bandpass_... | true | true |
f73ef3d18da8643d83606f0a870879efe1d93302 | 1,790 | py | Python | tests/sentry/models/test_grouprelease.py | noscripter/sentry | 1c5b1b53e740ffd2747afb7f0995e026be9468d0 | [
"BSD-3-Clause"
] | 1 | 2021-01-13T15:40:03.000Z | 2021-01-13T15:40:03.000Z | tests/sentry/models/test_grouprelease.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/models/test_grouprelease.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 1 | 2019-11-01T14:48:32.000Z | 2019-11-01T14:48:32.000Z | from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import Environment, GroupRelease, Release
from sentry.testutils import TestCase
class GetOrCreateTest(TestCase):
def test_simple(self):
project = self.create_project()
group... | 31.964286 | 76 | 0.658659 | from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import Environment, GroupRelease, Release
from sentry.testutils import TestCase
class GetOrCreateTest(TestCase):
def test_simple(self):
project = self.create_project()
group... | true | true |
f73ef48d70537bc6eecfe62bab783fa41409b09d | 11,057 | py | Python | requirements/docutils-0.18/test/test_transforms/test_contents.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_transforms/test_contents.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_transforms/test_contents.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | 1 | 2022-02-03T08:03:30.000Z | 2022-02-03T08:03:30.000Z | #! /usr/bin/env python
# $Id: test_contents.py 8771 2021-06-18 18:55:08Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for `docutils.transforms.parts.Contents` (via
`docutils.transforms.universal.LastReaderPending`).
"""
from __future__ i... | 25.360092 | 110 | 0.450303 |
from __future__ import absolute_import
if __name__ == '__main__':
import __init__
from test_transforms import DocutilsTestSupport
from docutils.transforms.references import Substitutions
from docutils.parsers.rst import Parser
def suite():
parser = Parser()
s = DocutilsTestSupport.TransformTestSuit... | true | true |
f73ef4f88fc8819babe560f8e63665260364827d | 1,176 | py | Python | meal_hack_flask/models/product.py | davidoort/meal_hack | db37db30f8fc34092d6c65af94186609d1e2e5f2 | [
"MIT"
] | null | null | null | meal_hack_flask/models/product.py | davidoort/meal_hack | db37db30f8fc34092d6c65af94186609d1e2e5f2 | [
"MIT"
] | null | null | null | meal_hack_flask/models/product.py | davidoort/meal_hack | db37db30f8fc34092d6c65af94186609d1e2e5f2 | [
"MIT"
] | null | null | null | from mongoengine import (
Document,
DynamicDocument,
StringField,
FloatField,
DateField,
IntField,
EmbeddedDocument,
EmbeddedDocumentField,
ListField
)
import re
class Image(EmbeddedDocument):
original = StringField()
stack = StringField()
class Product(DynamicDocume... | 27.348837 | 89 | 0.629252 | from mongoengine import (
Document,
DynamicDocument,
StringField,
FloatField,
DateField,
IntField,
EmbeddedDocument,
EmbeddedDocumentField,
ListField
)
import re
class Image(EmbeddedDocument):
original = StringField()
stack = StringField()
class Product(DynamicDocume... | true | true |
f73ef504d81d130349b318dd0dea445b6221b659 | 7,444 | py | Python | mythril/laser/smt/bitvecfunc.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | null | null | null | mythril/laser/smt/bitvecfunc.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | null | null | null | mythril/laser/smt/bitvecfunc.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 1 | 2021-09-06T03:14:58.000Z | 2021-09-06T03:14:58.000Z | from typing import Optional, Union, cast, Callable
import z3
from mythril.laser.smt.bitvec import BitVec, Bool, And, Annotations
from mythril.laser.smt.bool import Or
import operator
def _arithmetic_helper(
a: "BitVecFunc", b: Union[BitVec, int], operation: Callable
) -> "BitVecFunc":
"""
Helper functi... | 32.938053 | 82 | 0.635277 | from typing import Optional, Union, cast, Callable
import z3
from mythril.laser.smt.bitvec import BitVec, Bool, And, Annotations
from mythril.laser.smt.bool import Or
import operator
def _arithmetic_helper(
a: "BitVecFunc", b: Union[BitVec, int], operation: Callable
) -> "BitVecFunc":
if isinstance(b, int)... | true | true |
f73ef6524eb7f6a2908d2e47235afca6f0976eb2 | 3,902 | py | Python | Previsao_valor_aluguel/app.py | ViniViniAntunes/Prevendo_Valor_de_Aluguel_em_SP | e37d54da0b2c8ce3c6ddb4ec45191b069834427c | [
"MIT"
] | null | null | null | Previsao_valor_aluguel/app.py | ViniViniAntunes/Prevendo_Valor_de_Aluguel_em_SP | e37d54da0b2c8ce3c6ddb4ec45191b069834427c | [
"MIT"
] | null | null | null | Previsao_valor_aluguel/app.py | ViniViniAntunes/Prevendo_Valor_de_Aluguel_em_SP | e37d54da0b2c8ce3c6ddb4ec45191b069834427c | [
"MIT"
] | 1 | 2020-05-24T03:09:26.000Z | 2020-05-24T03:09:26.000Z | # Importando as bibliotecas necessárias
import pandas as pd
import streamlit as st
import plotly.express as px
from sklearn.ensemble import RandomForestRegressor
# Criando uma função para carregar o dataset
#@st.cache # Notação para ficar em cache
def get_data():
return pd.read_csv("model/data_deploy.csv")
# Cria... | 37.519231 | 170 | 0.740902 |
import pandas as pd
import streamlit as st
import plotly.express as px
from sklearn.ensemble import RandomForestRegressor
d.read_csv("model/data_deploy.csv")
def train_model():
data = get_data()
X = data.drop(["valor", "bairro"], axis=1)
y = data["valor"]
rf_regressor = RandomForestRegressor(n_esti... | true | true |
f73ef660b4872a5b92efd54cfb0ffe1dd549454d | 50,627 | py | Python | tensorflow/python/keras/layers/core.py | LucasLorenc/tensorflow | 10a7b61cdf55d13c85c2a3cc5ca669e3d9ea8e11 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/layers/core.py | LucasLorenc/tensorflow | 10a7b61cdf55d13c85c2a3cc5ca669e3d9ea8e11 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/layers/core.py | LucasLorenc/tensorflow | 10a7b61cdf55d13c85c2a3cc5ca669e3d9ea8e11 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.308032 | 102 | 0.691054 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import sys
import types as python_types
import warnings
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensor... | true | true |
f73ef6b63c8bf7a138e8dcaf8a35fc2798322aea | 7,145 | py | Python | youtube_dl/extractor/crackle.py | xiaobailong653/scripts | c68c988f59b8b9428163f687d0116429e9a0d479 | [
"Apache-2.0"
] | 2 | 2019-11-25T01:16:13.000Z | 2022-02-10T17:14:06.000Z | venv/lib/python3.7/site-packages/youtube_dl/extractor/crackle.py | edubaschool/college-de-france-dl | 1b67c489a3c6d427f2674394a28c9e37ab72a017 | [
"MIT"
] | 1 | 2019-01-24T09:33:42.000Z | 2019-01-24T09:33:42.000Z | venv/lib/python3.7/site-packages/youtube_dl/extractor/crackle.py | edubaschool/college-de-france-dl | 1b67c489a3c6d427f2674394a28c9e37ab72a017 | [
"MIT"
] | 1 | 2020-10-13T18:15:09.000Z | 2020-10-13T18:15:09.000Z | # coding: utf-8
from __future__ import unicode_literals, division
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
parse_age_limit,
parse_duration,
url_or_none,
ExtractorError
)
class Crackl... | 36.641026 | 120 | 0.478097 |
from __future__ import unicode_literals, division
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
parse_age_limit,
parse_duration,
url_or_none,
ExtractorError
)
class CrackleIE(InfoExtract... | true | true |
f73ef6fa474f506787e08bba7e9f951f15ccd11b | 1,264 | py | Python | gg_custom/doc_events/payment_entry.py | libermatic/gg_custom | 3aa14165dc19cccedb651adb196f06882fc123e4 | [
"MIT"
] | 1 | 2021-07-07T12:43:15.000Z | 2021-07-07T12:43:15.000Z | gg_custom/doc_events/payment_entry.py | libermatic/gg_custom | 3aa14165dc19cccedb651adb196f06882fc123e4 | [
"MIT"
] | null | null | null | gg_custom/doc_events/payment_entry.py | libermatic/gg_custom | 3aa14165dc19cccedb651adb196f06882fc123e4 | [
"MIT"
] | 1 | 2021-07-07T12:43:15.000Z | 2021-07-07T12:43:15.000Z | from __future__ import unicode_literals
import frappe
from toolz.curried import compose, unique, map, filter
def on_submit(doc, method):
_update_booking_orders(
[x for x in doc.references if x.reference_doctype == "Sales Invoice"]
)
def on_cancel(doc, method):
_update_booking_orders(
[x ... | 29.395349 | 77 | 0.606804 | from __future__ import unicode_literals
import frappe
from toolz.curried import compose, unique, map, filter
def on_submit(doc, method):
_update_booking_orders(
[x for x in doc.references if x.reference_doctype == "Sales Invoice"]
)
def on_cancel(doc, method):
_update_booking_orders(
[x ... | true | true |
f73ef70cbe103a2be2e2f515a8652492733571ee | 29 | py | Python | src/python-import-from-url/tests/fixture/agent/bad_execution_code.py | ivangeorgiev/gems | 823076051695029b4d699744dc76c959a8476230 | [
"CC0-1.0"
] | 10 | 2020-11-12T23:45:31.000Z | 2022-03-25T07:29:42.000Z | src/python-import-from-url/tests/fixture/agent/bad_execution_code.py | ivangeorgiev/gems | 823076051695029b4d699744dc76c959a8476230 | [
"CC0-1.0"
] | null | null | null | src/python-import-from-url/tests/fixture/agent/bad_execution_code.py | ivangeorgiev/gems | 823076051695029b4d699744dc76c959a8476230 | [
"CC0-1.0"
] | 7 | 2020-12-15T20:40:00.000Z | 2022-03-18T01:41:48.000Z |
do_you_know_this_function()
| 9.666667 | 27 | 0.862069 |
do_you_know_this_function()
| true | true |
f73ef74024fcd0c7728702b93dde518f191d6d9a | 3,815 | py | Python | torch_audiomentations/augmentations/impulse_response.py | KentoNishi/torch-audiomentations | d7d3ae5787a354f720da7e9abfea8ba91900cab3 | [
"MIT"
] | 430 | 2020-06-22T16:30:11.000Z | 2022-03-29T10:14:56.000Z | torch_audiomentations/augmentations/impulse_response.py | keunwoochoi/torch-audiomentations | e8547601f3336fea478bce97a0fc6b1e06744a8c | [
"MIT"
] | 106 | 2020-09-23T10:21:21.000Z | 2022-03-31T13:59:27.000Z | torch_audiomentations/augmentations/impulse_response.py | keunwoochoi/torch-audiomentations | e8547601f3336fea478bce97a0fc6b1e06744a8c | [
"MIT"
] | 48 | 2020-09-23T12:34:07.000Z | 2022-03-28T09:53:56.000Z | import random
from pathlib import Path
from typing import Union, List
import torch
from torch.nn.utils.rnn import pad_sequence
from ..core.transforms_interface import BaseWaveformTransform, EmptyPathException
from ..utils.convolution import convolve
from ..utils.file import find_audio_files
from ..utils.io import Aud... | 35 | 102 | 0.62962 | import random
from pathlib import Path
from typing import Union, List
import torch
from torch.nn.utils.rnn import pad_sequence
from ..core.transforms_interface import BaseWaveformTransform, EmptyPathException
from ..utils.convolution import convolve
from ..utils.file import find_audio_files
from ..utils.io import Aud... | true | true |
f73ef7df12e6fe398210177da34bb6af7697172c | 117 | py | Python | python/demo_queries/publication_details/taxa_by_authority.py | jocelynpender/fna-query | e538563f63eaea7b4bc84b7446e7ed7b53001774 | [
"MIT"
] | null | null | null | python/demo_queries/publication_details/taxa_by_authority.py | jocelynpender/fna-query | e538563f63eaea7b4bc84b7446e7ed7b53001774 | [
"MIT"
] | 6 | 2020-01-30T16:52:47.000Z | 2021-06-02T00:59:48.000Z | python/demo_queries/publication_details/taxa_by_authority.py | jocelynpender/fna-query | e538563f63eaea7b4bc84b7446e7ed7b53001774 | [
"MIT"
] | null | null | null | from src.query import *
if __name__ == '__main__':
ask_query("[[Authority::Linnaeus]]", "taxa_by_linnaeus.csv")
| 23.4 | 64 | 0.692308 | from src.query import *
if __name__ == '__main__':
ask_query("[[Authority::Linnaeus]]", "taxa_by_linnaeus.csv")
| true | true |
f73ef8407e5a79d4fe07a150e0bf9f61ccbcabb9 | 2,925 | py | Python | meeting/hooks.py | Zlash65/meeting | 20f54ceb184b66d7814dd0e1fa686e6627d0a408 | [
"MIT"
] | null | null | null | meeting/hooks.py | Zlash65/meeting | 20f54ceb184b66d7814dd0e1fa686e6627d0a408 | [
"MIT"
] | null | null | null | meeting/hooks.py | Zlash65/meeting | 20f54ceb184b66d7814dd0e1fa686e6627d0a408 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "meeting"
app_title = "Meeting"
app_publisher = "Zlash65"
app_description = "Set up Meetings and stuff"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "zarrar65@gmail.com"
app... | 22.159091 | 78 | 0.664274 |
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "meeting"
app_title = "Meeting"
app_publisher = "Zlash65"
app_description = "Set up Meetings and stuff"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "zarrar65@gmail.com"
app_license = "MIT"
... | true | true |
f73ef9358094273864da2ab9a75a2dcad7f01d96 | 10,289 | py | Python | mcmaps/mc/biomes/zoom.py | LanetheGreat/mcmaps | 823c4d267f8838140723cb3802c8e846e8060403 | [
"Apache-2.0"
] | null | null | null | mcmaps/mc/biomes/zoom.py | LanetheGreat/mcmaps | 823c4d267f8838140723cb3802c8e846e8060403 | [
"Apache-2.0"
] | null | null | null | mcmaps/mc/biomes/zoom.py | LanetheGreat/mcmaps | 823c4d267f8838140723cb3802c8e846e8060403 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Lane Shaw
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... | 39.725869 | 123 | 0.570318 |
hod
from ._abc import BaseLayer
from mcmaps.mc.constants import BIOME_ID
__all__ = [
'FuzzyZoomLayer', 'VoronoiZoomLayer', 'ZoomLayer',
]
class _BaseZoomLayer(BaseLayer):
def get_area(self, x_pos, z_pos, x_width, z_depth):
child_x_pos = x_pos >> 1
child_z_pos = z_pos >> 1
chil... | true | true |
f73ef93efcbdb5fa4801e735cf6f19b216c824a0 | 9,922 | py | Python | robel/dclaw/turn.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 109 | 2019-08-29T22:55:41.000Z | 2022-03-19T18:26:37.000Z | robel/dclaw/turn.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 12 | 2019-11-14T05:16:00.000Z | 2021-02-21T07:49:32.000Z | robel/dclaw/turn.py | Del9fina/robel | 63dfac65932757134e5766f1e20a339efe281bc7 | [
"Apache-2.0"
] | 40 | 2019-09-29T06:50:44.000Z | 2022-03-19T18:34:20.000Z | # Copyright 2019 The ROBEL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 36.344322 | 80 | 0.621447 |
import abc
import collections
from typing import Dict, Optional, Sequence
import numpy as np
from transforms3d.euler import euler2quat
from robel.components.robot.dynamixel_robot import DynamixelRobotState
from robel.dclaw.base_env import BaseDClawObjectEnv
from robel.simulation.randomize import SimRan... | true | true |
f73efa7be5b2e2b12fb7644ab7921f9729c9b268 | 19,270 | py | Python | ophyd/ophydobj.py | NSLS-II/ophyd | d5fc722eef4d3d83845b1d523004302ec3aadb78 | [
"BSD-3-Clause"
] | 16 | 2015-05-20T20:48:25.000Z | 2019-04-24T21:12:59.000Z | ophyd/ophydobj.py | NSLS-II/ophyd | d5fc722eef4d3d83845b1d523004302ec3aadb78 | [
"BSD-3-Clause"
] | 594 | 2015-01-05T21:55:21.000Z | 2019-05-10T02:05:24.000Z | ophyd/ophydobj.py | NSLS-II/ophyd | d5fc722eef4d3d83845b1d523004302ec3aadb78 | [
"BSD-3-Clause"
] | 34 | 2015-01-23T19:50:58.000Z | 2019-05-07T05:38:57.000Z | import functools
import time
import weakref
from enum import IntFlag
from itertools import count
from logging import LoggerAdapter, getLogger
from typing import ClassVar, FrozenSet
from .log import control_layer_logger
def select_version(cls, version):
"""Select closest compatible version to requested version
... | 32.441077 | 97 | 0.59891 | import functools
import time
import weakref
from enum import IntFlag
from itertools import count
from logging import LoggerAdapter, getLogger
from typing import ClassVar, FrozenSet
from .log import control_layer_logger
def select_version(cls, version):
all_versions = cls._class_info_['versions']
matched_vers... | true | true |
f73efa905368690c9968c1900733ad9c5b029954 | 4,885 | py | Python | scripts/create_headers.py | Nikita240/LaTeX2AI | f76e9f1709ad93774358bcc13e6bdc4e7fcc8f40 | [
"MIT"
] | null | null | null | scripts/create_headers.py | Nikita240/LaTeX2AI | f76e9f1709ad93774358bcc13e6bdc4e7fcc8f40 | [
"MIT"
] | null | null | null | scripts/create_headers.py | Nikita240/LaTeX2AI | f76e9f1709ad93774358bcc13e6bdc4e7fcc8f40 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2020 Ivo Steinbrecher
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | 32.785235 | 80 | 0.624565 |
import sys
import subprocess
import os
from check_license import (get_license_text, license_to_source,
get_repository_dir)
def get_git_sha():
process = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
stdout=subprocess.PIPE)
out, _err = process.communicate()
retu... | true | true |
f73efab3d92188e4f727f0e4a1f216c9e517ec78 | 16,438 | py | Python | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_params.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | 2 | 2020-07-22T18:53:05.000Z | 2021-09-11T05:52:33.000Z | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_params.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_params.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 80.185366 | 314 | 0.773817 |
import argparse
import getpass
from argcomplete.completers import FilesCompleter
from azure.mgmt.compute.models import (VirtualHardDisk,
CachingTypes,
ContainerServiceOchestratorTypes,
UpgradeMod... | true | true |
f73efad578328f021962b73bff802e4dbb8abc0d | 1,323 | py | Python | python/calculator/__init__.py | kmhsonnenkind/thrift-example | 8abfee8d390ee24c131428f38d7c32034f462945 | [
"MIT"
] | null | null | null | python/calculator/__init__.py | kmhsonnenkind/thrift-example | 8abfee8d390ee24c131428f38d7c32034f462945 | [
"MIT"
] | null | null | null | python/calculator/__init__.py | kmhsonnenkind/thrift-example | 8abfee8d390ee24c131428f38d7c32034f462945 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Martin Kloesch
#
# 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, merg... | 40.090909 | 79 | 0.77551 |
__all__ = ['Client', 'Server', 'DivideByZeroException']
from .gen.calculator.ttypes import DivideByZeroException
from .client import Client
from .server import Server
| true | true |
f73efafeeba2c32476651fcf1c16adf137ba29d8 | 417 | py | Python | PythonRearrangement/setup.py | QuantumQuadrate/Rearrangement | 5f8d64bd18a471a488747ed8d17b00304b4ab293 | [
"MIT"
] | null | null | null | PythonRearrangement/setup.py | QuantumQuadrate/Rearrangement | 5f8d64bd18a471a488747ed8d17b00304b4ab293 | [
"MIT"
] | 1 | 2019-06-18T23:13:45.000Z | 2019-06-18T23:13:45.000Z | PythonRearrangement/setup.py | QuantumQuadrate/Rearrangement | 5f8d64bd18a471a488747ed8d17b00304b4ab293 | [
"MIT"
] | 2 | 2019-05-23T15:52:20.000Z | 2021-07-03T15:25:19.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 22 13:22:01 2018
@author: Cody
"""
from setuptools import setup
from setuptools import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("Rearranger", sources= ["pyRearranger... | 24.529412 | 162 | 0.717026 |
from setuptools import setup
from setuptools import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("Rearranger", sources= ["pyRearranger.pyx","../CPPrearrangement/Rearrangement.cpp"],language='c++',include_dirs=[np.get... | true | true |
f73efbddcc46b0af04ccaa3518cffb2c82d731c7 | 41 | py | Python | code/abc082_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc082_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc082_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | print(-~sum(map(int,input().split()))//2) | 41 | 41 | 0.609756 | print(-~sum(map(int,input().split()))//2) | true | true |
f73efd40fffd193c0a2234d000f69837b308ca6b | 301 | py | Python | src/OFS/tests/testEtagSupport.py | CMYanko/Zope | bbd2f4ce565740bfc9d9cae00c147f963ba49085 | [
"ZPL-2.1"
] | 289 | 2015-01-05T12:38:21.000Z | 2022-03-05T21:20:39.000Z | src/OFS/tests/testEtagSupport.py | CMYanko/Zope | bbd2f4ce565740bfc9d9cae00c147f963ba49085 | [
"ZPL-2.1"
] | 732 | 2015-02-09T23:35:57.000Z | 2022-03-31T09:10:13.000Z | src/OFS/tests/testEtagSupport.py | CMYanko/Zope | bbd2f4ce565740bfc9d9cae00c147f963ba49085 | [
"ZPL-2.1"
] | 102 | 2015-01-12T14:03:35.000Z | 2022-03-30T11:02:44.000Z | import unittest
class TestEtagSupport(unittest.TestCase):
def test_interfaces(self):
from OFS.EtagSupport import EtagBaseInterface
from OFS.EtagSupport import EtagSupport
from zope.interface.verify import verifyClass
verifyClass(EtagBaseInterface, EtagSupport)
| 25.083333 | 53 | 0.754153 | import unittest
class TestEtagSupport(unittest.TestCase):
def test_interfaces(self):
from OFS.EtagSupport import EtagBaseInterface
from OFS.EtagSupport import EtagSupport
from zope.interface.verify import verifyClass
verifyClass(EtagBaseInterface, EtagSupport)
| true | true |
f73efdeb30de1d72a08bebac223e212a621df029 | 96 | py | Python | py_function/fn_.py | rajkubp020/helloword | 4bd22691de24b30a0f5b73821c35a7ac0666b034 | [
"MIT"
] | null | null | null | py_function/fn_.py | rajkubp020/helloword | 4bd22691de24b30a0f5b73821c35a7ac0666b034 | [
"MIT"
] | null | null | null | py_function/fn_.py | rajkubp020/helloword | 4bd22691de24b30a0f5b73821c35a7ac0666b034 | [
"MIT"
] | null | null | null | import dat_NABS
import importlib
importlib.reload(dat_NABS)
dat_NABS.printme(str="al10.dat")
| 12 | 32 | 0.802083 | import dat_NABS
import importlib
importlib.reload(dat_NABS)
dat_NABS.printme(str="al10.dat")
| true | true |
f73efe1c11faebf1039b899ddb6e160016089932 | 210 | py | Python | westworld/objects/__init__.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null | westworld/objects/__init__.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | 3 | 2021-09-06T23:12:23.000Z | 2021-09-17T01:04:34.000Z | westworld/objects/__init__.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null | from .base_object import BaseObject
from .rectangle import BaseRectangle
from .collectible import BaseCollectible
from .trigger import BaseTrigger
from .obstacle import BaseObstacle
from .layer import BaseLayer | 35 | 40 | 0.861905 | from .base_object import BaseObject
from .rectangle import BaseRectangle
from .collectible import BaseCollectible
from .trigger import BaseTrigger
from .obstacle import BaseObstacle
from .layer import BaseLayer | true | true |
f73efe8cda7157490bc554bfb0da84e8ef3c6d77 | 11,719 | py | Python | passes.py | singlautsav/two-pass-assembler | 0c4eab227da9b1ea0810eda2914af88c008ad297 | [
"MIT"
] | 1 | 2020-02-27T16:32:47.000Z | 2020-02-27T16:32:47.000Z | passes.py | singlautsav/two-pass-assembler | 0c4eab227da9b1ea0810eda2914af88c008ad297 | [
"MIT"
] | null | null | null | passes.py | singlautsav/two-pass-assembler | 0c4eab227da9b1ea0810eda2914af88c008ad297 | [
"MIT"
] | null | null | null | programCounterX = 0
lines = []
symbol_Table=[]
ErrorFlag = False
ErrorList = []
opCode_Table = {'CLA': 0, 'LAC': 1, 'SAC': 2, 'ADD': 3, 'SUB': 4, 'BRZ': 5, 'BRN': 6, 'BRP': 7, 'INP': 8, 'DSP': 9, 'MUL': 10, 'DIV': 11, 'STP': 12, 'DW':13}
def lineCheck(line):
# used to check if line[0] is a label or symbol
if ... | 42.306859 | 157 | 0.478966 | programCounterX = 0
lines = []
symbol_Table=[]
ErrorFlag = False
ErrorList = []
opCode_Table = {'CLA': 0, 'LAC': 1, 'SAC': 2, 'ADD': 3, 'SUB': 4, 'BRZ': 5, 'BRN': 6, 'BRP': 7, 'INP': 8, 'DSP': 9, 'MUL': 10, 'DIV': 11, 'STP': 12, 'DW':13}
def lineCheck(line):
if line[0][-1] == ':':
return 1
... | true | true |
f73efff8349b1d3161201f711d769acb83a38239 | 1,825 | py | Python | plugins/lastpass_enterprise/komand_lastpass_enterprise/actions/deprovision_user/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/lastpass_enterprise/komand_lastpass_enterprise/actions/deprovision_user/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/lastpass_enterprise/komand_lastpass_enterprise/actions/deprovision_user/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
import requests
from .schema import DeprovisionUserInput, DeprovisionUserOutput
class DeprovisionUser(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="deprovision_user",
description="remove user",
input=DeprovisionUserInput()... | 28.515625 | 115 | 0.582466 | import komand
import requests
from .schema import DeprovisionUserInput, DeprovisionUserOutput
class DeprovisionUser(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="deprovision_user",
description="remove user",
input=DeprovisionUserInput()... | true | true |
f73f00267f89b854ce528acc63461261f4444a06 | 47 | py | Python | variables.py | fabiolealsc/quest | 8f936aa6d8208ec23cc13f28148b9e39a976d997 | [
"MIT"
] | 2 | 2021-09-29T02:39:20.000Z | 2021-11-08T08:56:50.000Z | variables.py | fabiolealsc/quest | 8f936aa6d8208ec23cc13f28148b9e39a976d997 | [
"MIT"
] | null | null | null | variables.py | fabiolealsc/quest | 8f936aa6d8208ec23cc13f28148b9e39a976d997 | [
"MIT"
] | null | null | null | favorite_robot = "Cedric"
meaning_of_life = 42 | 23.5 | 25 | 0.787234 | favorite_robot = "Cedric"
meaning_of_life = 42 | true | true |
f73f0164313501a01674acc32e937c8dc0060da1 | 1,069 | py | Python | tests/test_isocolor.py | CagtayFabry/ipygany | 1ccaf45412b02dbd9548041bfa1d1f84eda94c76 | [
"BSD-3-Clause"
] | 3 | 2019-11-28T21:43:12.000Z | 2021-02-02T22:15:00.000Z | tests/test_isocolor.py | CagtayFabry/ipygany | 1ccaf45412b02dbd9548041bfa1d1f84eda94c76 | [
"BSD-3-Clause"
] | null | null | null | tests/test_isocolor.py | CagtayFabry/ipygany | 1ccaf45412b02dbd9548041bfa1d1f84eda94c76 | [
"BSD-3-Clause"
] | 1 | 2020-11-10T09:40:42.000Z | 2020-11-10T09:40:42.000Z | import pytest
from traitlets import TraitError
from ipygany import PolyMesh, IsoColor
from .utils import get_test_assets
def test_default_input():
vertices, triangles, data_1d, data_3d = get_test_assets()
poly = PolyMesh(vertices=vertices, triangle_indices=triangles, data=[data_1d, data_3d])
colored_... | 24.295455 | 91 | 0.690365 | import pytest
from traitlets import TraitError
from ipygany import PolyMesh, IsoColor
from .utils import get_test_assets
def test_default_input():
vertices, triangles, data_1d, data_3d = get_test_assets()
poly = PolyMesh(vertices=vertices, triangle_indices=triangles, data=[data_1d, data_3d])
colored_... | true | true |
f73f017bacc74b91d4bd111a13edc876e72084f0 | 157 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_NoCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_NoCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_NoCycle_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['PolyTrend'] , ['NoCycle'] , ['ARX'] ); | 39.25 | 79 | 0.745223 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['PolyTrend'] , ['NoCycle'] , ['ARX'] ); | true | true |
f73f028e24b99fdfeeaeccb87b58f4f3c2a51a9b | 6,540 | py | Python | KRIS/urllib3/dummyserver/testcase.py | AnarchyTeam/Anarchy.py6 | 090522fd4aae659bcaea8661126062e93f846f71 | [
"MIT"
] | 1 | 2021-06-05T07:02:26.000Z | 2021-06-05T07:02:26.000Z | KRIS/urllib3/dummyserver/testcase.py | AnarchyTeam/Anarchy.py6 | 090522fd4aae659bcaea8661126062e93f846f71 | [
"MIT"
] | 2 | 2020-03-24T15:25:06.000Z | 2020-03-30T20:04:12.000Z | KRIS/urllib3/dummyserver/testcase.py | AnarchyTeam/Anarchy.py6 | 090522fd4aae659bcaea8661126062e93f846f71 | [
"MIT"
] | 1 | 2020-01-18T06:29:31.000Z | 2020-01-18T06:29:31.000Z | import sys
import threading
import pytest
from tornado import ioloop, web
from dummyserver.server import (
SocketServerThread,
run_tornado_app,
run_loop_in_thread,
DEFAULT_CERTS,
HAS_IPV6,
)
from dummyserver.handlers import TestingApp
from dummyserver.proxy import ProxyHandler
if sys.version_info... | 30.418605 | 77 | 0.636391 | import sys
import threading
import pytest
from tornado import ioloop, web
from dummyserver.server import (
SocketServerThread,
run_tornado_app,
run_loop_in_thread,
DEFAULT_CERTS,
HAS_IPV6,
)
from dummyserver.handlers import TestingApp
from dummyserver.proxy import ProxyHandler
if sys.version_info... | true | true |
f73f03100409d8b6c8563a740e55306d7f0fdb9f | 40,516 | py | Python | spytest/apis/switching/pvst.py | mykolaf/sonic-mgmt | de77268526173c5e3a345f3f3703b56eb40c5eed | [
"Apache-2.0"
] | 1 | 2021-09-15T17:09:13.000Z | 2021-09-15T17:09:13.000Z | spytest/apis/switching/pvst.py | mykolaf/sonic-mgmt | de77268526173c5e3a345f3f3703b56eb40c5eed | [
"Apache-2.0"
] | 1 | 2020-02-05T16:51:53.000Z | 2020-02-05T16:51:53.000Z | spytest/apis/switching/pvst.py | mykolaf/sonic-mgmt | de77268526173c5e3a345f3f3703b56eb40c5eed | [
"Apache-2.0"
] | null | null | null | import re
import utilities.utils as utils
from spytest import st
from spytest.utils import filter_and_select
from spytest.utils import exec_foreach, exec_all
import utilities.common as utility
import apis.switching.portchannel as portchannel
import apis.system.basic as basic
from utilities.parallel import ensure_no_exc... | 36.046263 | 129 | 0.603218 | import re
import utilities.utils as utils
from spytest import st
from spytest.utils import filter_and_select
from spytest.utils import exec_foreach, exec_all
import utilities.common as utility
import apis.switching.portchannel as portchannel
import apis.system.basic as basic
from utilities.parallel import ensure_no_exc... | true | true |
f73f038abd8df85dad45c93c54e548648f4864d8 | 1,820 | py | Python | adal/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | adal/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | adal/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation.
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated ... | 40.444444 | 81 | 0.67967 |
__version__ = '0.4.7'
import logging
from .authentication_context import AuthenticationContext
from .token_cache import TokenCache
from .log import (set_logging_options,
get_logging_options,
ADAL_LOGGER_NAME)
from .adal_error import AdalErr... | false | true |
f73f03be3b3051fb1ca517ba8b376fbb92a0af77 | 5,982 | py | Python | python_stub.py | skazanyNaGlany/python_stub | 50a137e9360d0d83535abb863948afdf9594204b | [
"MIT"
] | null | null | null | python_stub.py | skazanyNaGlany/python_stub | 50a137e9360d0d83535abb863948afdf9594204b | [
"MIT"
] | null | null | null | python_stub.py | skazanyNaGlany/python_stub | 50a137e9360d0d83535abb863948afdf9594204b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2019 Paweł Kacperski (screamingbox@gmail.com)
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, inc... | 27.953271 | 99 | 0.621364 |
def install_pip_and_modules(package_names):
import os
import os.path
import sys
import shutil
import subprocess
assert sys.version_info >= (2, 7) or sys.version_info >= (3, 4), 'Python 2.7+ or 3.4+ required'
count_installed_packages = 0
try:
import urllib2
except Modu... | true | true |
f73f03f6b88df9e59ef3cd1050ce5d365459d2e4 | 2,046 | py | Python | sigda/user/services.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | null | null | null | sigda/user/services.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | 3 | 2017-08-21T07:26:11.000Z | 2017-11-09T02:19:23.000Z | sigda/user/services.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | null | null | null | #coding:utf-8
import flask_login
from flask import render_template
from sigda.models import db, User
from sigda.config.common import ErrorCode
import logging
login_manager = flask_login.LoginManager()
class UserDbService(object):
@staticmethod
def add(email, name, passwd):
u = UserDbService.get_u... | 19.485714 | 64 | 0.631476 |
import flask_login
from flask import render_template
from sigda.models import db, User
from sigda.config.common import ErrorCode
import logging
login_manager = flask_login.LoginManager()
class UserDbService(object):
@staticmethod
def add(email, name, passwd):
u = UserDbService.get_user_by_email(... | true | true |
f73f0441d196355b3a55813b217924e970336016 | 1,743 | py | Python | Converter-Scripts/StanfordConll_to_IOB.py | Jadaju/Korpus-Plenarprotokolle | 3ed32a5f3f47503b65563f3816a0ffce2adfa927 | [
"Apache-2.0"
] | null | null | null | Converter-Scripts/StanfordConll_to_IOB.py | Jadaju/Korpus-Plenarprotokolle | 3ed32a5f3f47503b65563f3816a0ffce2adfa927 | [
"Apache-2.0"
] | null | null | null | Converter-Scripts/StanfordConll_to_IOB.py | Jadaju/Korpus-Plenarprotokolle | 3ed32a5f3f47503b65563f3816a0ffce2adfa927 | [
"Apache-2.0"
] | null | null | null | import codecs
import re
filename = "18181.txt"
#fileone = codecs.open("F:/Dropbox/Master/Plenarprotokolle/Annotiert/alle-final/Gold-18181-noAnhang.conll", "r", "utf-8")
fileone = codecs.open("F:/Dropbox/Master/"+filename+".conll", "r", "utf-8")
TextString = fileone.read()
#print(TextString)
TextList = TextString.spl... | 35.571429 | 121 | 0.620769 | import codecs
import re
filename = "18181.txt"
fileone = codecs.open("F:/Dropbox/Master/"+filename+".conll", "r", "utf-8")
TextString = fileone.read()
TextList = TextString.splitlines()
newfile = open(r"F:/Dropbox/Master/"+filename+"_IOB.conll","w+", encoding="utf-8")
indi = 0
for x in TextList:
if re.findall... | true | true |
f73f06226e99e3ac82701806c60f2979cccfda02 | 722 | py | Python | server/store/views.py | duxevy/SPbSTU_Django_Shop | a94b140aa57cec83f788aabc8e7bb1e11968a657 | [
"Apache-2.0"
] | null | null | null | server/store/views.py | duxevy/SPbSTU_Django_Shop | a94b140aa57cec83f788aabc8e7bb1e11968a657 | [
"Apache-2.0"
] | null | null | null | server/store/views.py | duxevy/SPbSTU_Django_Shop | a94b140aa57cec83f788aabc8e7bb1e11968a657 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import get_object_or_404, render
from .models import Category, Product
def product_all(request):
products = Product.products.all()
return render(request, 'home.html', {'products': products})
def category_list(request, category_slug=None):
category = get_object_or_404(Category, slu... | 26.740741 | 76 | 0.740997 | from django.shortcuts import get_object_or_404, render
from .models import Category, Product
def product_all(request):
products = Product.products.all()
return render(request, 'home.html', {'products': products})
def category_list(request, category_slug=None):
category = get_object_or_404(Category, slu... | true | true |
f73f06dc3fef4787483a60ba28a28bc38651e10a | 2,877 | py | Python | ceshi.py | Lechatelia/Welding_Joints | 7cb5b8ac4c961c4080e1590934c24130bfde3a26 | [
"MIT"
] | null | null | null | ceshi.py | Lechatelia/Welding_Joints | 7cb5b8ac4c961c4080e1590934c24130bfde3a26 | [
"MIT"
] | null | null | null | ceshi.py | Lechatelia/Welding_Joints | 7cb5b8ac4c961c4080e1590934c24130bfde3a26 | [
"MIT"
] | null | null | null | import cv2
import tensorflow as tf
import numpy as np
import random
y = tf.constant([1,2,3,4,5,6], name='y',dtype=tf.float32)
y_ = tf.constant([0,1,2,3,4,5], name='Y_',dtype=tf.float32)
y = tf.reshape(y,[2,3])
y_ = tf.reshape(y_,[2,3])
z= tf.constant([1,2], name='z',dtype=tf.float32)
z=tf.reshape(z,[2,-1])
... | 25.6875 | 213 | 0.595412 | import cv2
import tensorflow as tf
import numpy as np
import random
y = tf.constant([1,2,3,4,5,6], name='y',dtype=tf.float32)
y_ = tf.constant([0,1,2,3,4,5], name='Y_',dtype=tf.float32)
y = tf.reshape(y,[2,3])
y_ = tf.reshape(y_,[2,3])
z= tf.constant([1,2], name='z',dtype=tf.float32)
z=tf.reshape(z,[2,-1])
... | true | true |
f73f085b8b441f06632d5e3418089087d969e1f6 | 2,074 | py | Python | cipher.py | ilwoong/neural_distinguisher | 92bc49f58dd10a3c75a24be2813aeb8a2141e6f0 | [
"MIT"
] | 3 | 2019-09-03T18:01:06.000Z | 2020-01-04T05:27:41.000Z | cipher.py | ilwoong/neural_distinguisher | 92bc49f58dd10a3c75a24be2813aeb8a2141e6f0 | [
"MIT"
] | null | null | null | cipher.py | ilwoong/neural_distinguisher | 92bc49f58dd10a3c75a24be2813aeb8a2141e6f0 | [
"MIT"
] | null | null | null | from abc import *
class Cipher(metaclass=ABCMeta):
WORDSIZE = 0
WORDMASK = 0
NUM_ROUNDS = 0
@abstractmethod
def name(self):
pass
@abstractmethod
def expand_key(self, mk, num_rounds):
pass
@abstractmethod
def encrypt_one_round(self, pt, rk):
... | 26.589744 | 89 | 0.513983 | from abc import *
class Cipher(metaclass=ABCMeta):
WORDSIZE = 0
WORDMASK = 0
NUM_ROUNDS = 0
@abstractmethod
def name(self):
pass
@abstractmethod
def expand_key(self, mk, num_rounds):
pass
@abstractmethod
def encrypt_one_round(self, pt, rk):
... | true | true |
f73f09158e9653e7a88bdc68620948b1a65fddef | 5,315 | py | Python | gcloud/label/models.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | 1 | 2021-05-19T04:31:34.000Z | 2021-05-19T04:31:34.000Z | gcloud/label/models.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | gcloud/label/models.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 42.862903 | 118 | 0.70969 |
import logging
from collections import defaultdict
from django.db import models
from django.db.models import Count
from django.utils.translation import ugettext_lazy as _
logger = logging.getLogger("root")
class LabelManager(models.Manager):
def check_label_ids(self, label_ids):
if len(label_ids) != s... | true | true |
f73f0921ad38985f43c3b0c2f97416efa06040be | 1,306 | py | Python | tools/skp/page_sets/skia_motionmarksuits_desktop.py | vibeus/skia | 498bfa4a8590398ac01cb801ea1349a293054073 | [
"BSD-3-Clause"
] | 6,304 | 2015-01-05T23:45:12.000Z | 2022-03-31T09:48:13.000Z | tools/skp/page_sets/skia_motionmarksuits_desktop.py | lbnb/skia | f61ec43f84dd73508a566c36ef085156b40285f0 | [
"BSD-3-Clause"
] | 67 | 2016-04-18T13:30:02.000Z | 2022-03-31T23:06:55.000Z | tools/skp/page_sets/skia_motionmarksuits_desktop.py | lbnb/skia | f61ec43f84dd73508a566c36ef085156b40285f0 | [
"BSD-3-Clause"
] | 1,231 | 2015-01-05T03:17:39.000Z | 2022-03-31T22:54:58.000Z | # Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | 31.095238 | 75 | 0.75268 |
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
name=url,
page_set=pa... | true | true |
f73f09751e813cde35a74416c7d826ba7d39d4be | 5,658 | py | Python | src/scripts/RQ1.py | WeiyuCheng/FIA-KDD-19 | 18f29f8babbf1c505973a8a62ac48c6ca34ccd8a | [
"MIT"
] | 16 | 2019-05-15T05:54:22.000Z | 2021-11-30T03:31:42.000Z | src/scripts/RQ1.py | WeiyuCheng/FIA-KDD-19 | 18f29f8babbf1c505973a8a62ac48c6ca34ccd8a | [
"MIT"
] | 1 | 2019-11-21T01:38:04.000Z | 2019-11-22T03:24:43.000Z | src/scripts/RQ1.py | WeiyuCheng/FIA-KDD-19 | 18f29f8babbf1c505973a8a62ac48c6ca34ccd8a | [
"MIT"
] | 4 | 2020-09-03T02:35:39.000Z | 2022-03-16T13:47:44.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
import argparse
import os
from scipy.stats import pearsonr
import sys
sys.path.append("..")
from scripts.load_movielens import load_movielens
from scri... | 37.470199 | 96 | 0.696713 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
import argparse
import os
from scipy.stats import pearsonr
import sys
sys.path.append("..")
from scripts.load_movielens import load_movielens
from scri... | true | true |
f73f09a92559444565258b2573b324e84d3b177d | 793 | py | Python | GalDM/prop_mod.py | nickrodd/GalDM | 6ea9ed3882ecf4235fb4a773f8370858ad9ebf1e | [
"MIT"
] | null | null | null | GalDM/prop_mod.py | nickrodd/GalDM | 6ea9ed3882ecf4235fb4a773f8370858ad9ebf1e | [
"MIT"
] | null | null | null | GalDM/prop_mod.py | nickrodd/GalDM | 6ea9ed3882ecf4235fb4a773f8370858ad9ebf1e | [
"MIT"
] | null | null | null | ###############################################################################
# prop_mod.py
###############################################################################
#
# Calculate mod without numpy issue
#
###############################################################################
import numpy as np
from t... | 26.433333 | 79 | 0.373266 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.