hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3e28b9b4e22d45e6bc49dc9b089760647d975c | 969 | py | Python | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import PhraseMatcher
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
animals = ["Golden Retriever", "cat", "turtle", "Rattus norvegicus"]
animal_patterns = list(nlp.pipe(animals))
print("animal_patterns:", animal_patterns)
matcher = PhraseMatcher(nlp.vocab)
matcher.add(... | 32.3 | 83 | 0.734778 | import spacy
from spacy.matcher import PhraseMatcher
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
animals = ["Golden Retriever", "cat", "turtle", "Rattus norvegicus"]
animal_patterns = list(nlp.pipe(animals))
print("animal_patterns:", animal_patterns)
matcher = PhraseMatcher(nlp.vocab)
matcher.add(... | true | true |
1c3e28f5a566ed14d744c671218a676d561e1fb3 | 2,754 | py | Python | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 82 | 2018-11-13T05:39:44.000Z | 2022-01-18T17:08:44.000Z | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 25 | 2018-12-02T18:45:52.000Z | 2022-03-21T22:54:19.000Z | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 23 | 2019-01-22T20:04:50.000Z | 2022-02-01T14:57:28.000Z | """Test the normal tagging process."""
from tests.helper import assert_sticker_contains_tags
from stickerfinder.models import Tag
from stickerfinder.logic.tag import tag_sticker
def test_add_tags(session, user, sticker_set):
"""Add new tags to a sticker."""
for sticker in sticker_set.stickers:
# Crea... | 33.585366 | 87 | 0.702251 | from tests.helper import assert_sticker_contains_tags
from stickerfinder.models import Tag
from stickerfinder.logic.tag import tag_sticker
def test_add_tags(session, user, sticker_set):
for sticker in sticker_set.stickers:
tag_sticker(session, f"tag-{sticker.file_id}", sticker, user)
session... | true | true |
1c3e2932ba0ff0ebb282143338f70a8062bf3935 | 914 | py | Python | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | # generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/autolabor/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg"
services_str = ""
pkg_name = "costmap_2d"
dependencies_str = "std_msgs;geometry_msgs;map_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "costmap_2d;/... | 76.166667 | 444 | 0.794311 |
messages_str = "/home/autolabor/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg"
services_str = ""
pkg_name = "costmap_2d"
dependencies_str = "std_msgs;geometry_msgs;map_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "costmap_2d;/home/autolabor/catkin_ws/src/navigation/costmap_2d/m... | true | true |
1c3e29688e081410e4d2cebe46cf7c935368e8e9 | 4,017 | py | Python | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | import aiohttp
import asyncio
import time
from websites_metrics_collector.helpers.regex_functions import check_patterns_in_webpage
from collections import namedtuple
from typing import Tuple, NamedTuple
WebCheck = namedtuple('WebCheck', ['url', 'http_status', 'elapsed_time', 'pattern_verified'])
async def fetch_url_... | 51.5 | 238 | 0.717202 | import aiohttp
import asyncio
import time
from websites_metrics_collector.helpers.regex_functions import check_patterns_in_webpage
from collections import namedtuple
from typing import Tuple, NamedTuple
WebCheck = namedtuple('WebCheck', ['url', 'http_status', 'elapsed_time', 'pattern_verified'])
async def fetch_url_... | true | true |
1c3e29d0b0480d986c373efdc3b0b54efb1318d0 | 495 | py | Python | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | 3 | 2021-04-10T21:10:56.000Z | 2021-04-18T12:08:45.000Z | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | null | null | null | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | null | null | null | from ursina import *
# 9. Create sky
class Sky(Entity):
def __init__(self):
super().__init__(
parent = scene, # Specifies parent of sky so it scales properly
model = 'sphere', # Specifies sky model
texture = 'assets/sky.jpg', # Sk... | 38.076923 | 92 | 0.50303 | from ursina import *
class Sky(Entity):
def __init__(self):
super().__init__(
parent = scene, model = 'sphere', texture = 'assets/sky.jpg', scale = 1000, double_sided = True ... | true | true |
1c3e29e29ac16f488b5df61e155bff9bc5c1340c | 877 | py | Python | galileo/framework/pytorch/python/dataset/__init__.py | YaoPu2021/galileo | 0ebee2052bf78205f93f8cbbe0e2884095dd7af7 | [
"Apache-2.0"
] | 115 | 2021-09-09T03:01:58.000Z | 2022-03-30T10:46:26.000Z | galileo/framework/pytorch/python/dataset/__init__.py | Hacky-DH/galileo | e4d5021f0287dc879730dfa287b9a056f152f712 | [
"Apache-2.0"
] | 1 | 2021-12-09T07:34:41.000Z | 2021-12-20T06:24:27.000Z | galileo/framework/pytorch/python/dataset/__init__.py | Hacky-DH/galileo | e4d5021f0287dc879730dfa287b9a056f152f712 | [
"Apache-2.0"
] | 28 | 2021-09-10T08:47:20.000Z | 2022-03-17T07:29:26.000Z | # Copyright 2020 JD.com, Inc. Galileo 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 a... | 33.730769 | 80 | 0.676169 |
from . import (
base_dataset,
batched_dataloader,
vertex_dataset,
edge_dataset,
dataset_pipeline,
textline_dataset,
range_dataset,
tensor_dataset,
)
| true | true |
1c3e2a7a0cc37de06ca731cbcf5536d7446fb1d5 | 2,120 | py | Python | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | 1 | 2016-05-09T06:57:10.000Z | 2016-05-09T06:57:10.000Z | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | null | null | null | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rigidbody_lib as rb
from scipy.integrate import odeint
from numpy import array, arange, zeros
# Dimensions of rigid body in the three body fixed directions
# Following are the dimensions of an iPhone 3G taken from apple.com
h = 0.1155 # meters in the 1 direction
w = 0.0621 # met... | 29.444444 | 101 | 0.616981 | import rigidbody_lib as rb
from scipy.integrate import odeint
from numpy import array, arange, zeros
h = 0.1155 w = 0.0621 d = 0.0123 m = 0.135 g = 0.0081 I11 = m*(w**2 + d**2)/12.
I22 = m*(h**2 + d**2)/12.
I33 = m*(h**2 + w**2)/12.
params = [m, 0, I11, I22, I33]
q0 = [0.0, 0.0, 0.0, .05... | true | true |
1c3e2b451501a4e34182c8af139665bf7d618113 | 497 | py | Python | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | class Marks:
def __init__(self,num = None):
self.mark = num
def __add__(self,other):
obj = Marks()
obj.mark = self.mark + other.mark
return obj
Q1 = Marks(int(input("Quiz 1 (out of 10): ")))
Q2 = Marks(int(input("Quiz 2 (out of 10): ")))
Lab = Marks(int(input("Lab (out of 30): "... | 33.133333 | 48 | 0.581489 | class Marks:
def __init__(self,num = None):
self.mark = num
def __add__(self,other):
obj = Marks()
obj.mark = self.mark + other.mark
return obj
Q1 = Marks(int(input("Quiz 1 (out of 10): ")))
Q2 = Marks(int(input("Quiz 2 (out of 10): ")))
Lab = Marks(int(input("Lab (out of 30): "... | true | true |
1c3e2bbadcd5954813727b42a7702e096675d480 | 6,464 | py | Python | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.727273 | 76 | 0.691368 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
layers = tf.keras.layers
FLOAT_TYPE = tf.float32
def build_birnn(rnn_type, rnn_hidden_dim):
rnn_type = rnn_type.lower()
if rnn_type == "gru":
rnn_unit = l... | true | true |
1c3e2bdebb7ce8eab502e84ca3413255a0d6fe7a | 8,786 | py | Python | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 44.598985 | 678 | 0.665946 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['HcxEnterpriseSiteArgs', 'HcxEnterpriseSite']
@pulumi.input_type
class HcxEnterpriseSiteArgs:
def __init__(__self__, *,
private_cloud_nam... | true | true |
1c3e2ca8021695e3f7b0ca2fa0cef92808120aef | 10,751 | py | Python | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 44.061475 | 237 | 0.61278 |
import unittest
import azure.mgmt.redhatopenshift
from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer
AZURE_LOCATION = 'australiaeast'
@unittest.skip("skip test")
class MgmtAzureRedHatOpenShiftClientTest(AzureMgmtTestCase):
def setUp(self):
super(MgmtAzureRedHatOpenShiftClientTes... | true | true |
1c3e2d7a94c129453bc740cb391bfd2454d467f1 | 14,082 | py | Python | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 45 | 2016-06-21T22:28:43.000Z | 2022-03-26T12:21:46.000Z | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 6 | 2020-07-12T18:00:10.000Z | 2021-11-30T11:20:14.000Z | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 5 | 2019-09-03T17:20:34.000Z | 2022-01-30T15:10:21.000Z | from py_tests_common import *
def TypeNameInErrorMessage_FundamentalTypes():
c_program_text= """
fn Foo()
{
var i32 x= 0.0f;
}
"""
errors_list= ConvertErrors( tests_lib.build_program_with_errors( c_program_text ) )
assert( len(errors_list) > 0 )
# must print something, like "conversion from f32 to i32"
... | 32.978923 | 102 | 0.687757 | from py_tests_common import *
def TypeNameInErrorMessage_FundamentalTypes():
c_program_text= """
fn Foo()
{
var i32 x= 0.0f;
}
"""
errors_list= ConvertErrors( tests_lib.build_program_with_errors( c_program_text ) )
assert( len(errors_list) > 0 )
assert( errors_list[0].error_code == "TypesMismatch" )
a... | true | true |
1c3e2e4500ec56f373ffa34b204ef913befead83 | 892 | py | Python | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | 1 | 2018-04-03T15:37:34.000Z | 2018-04-03T15:37:34.000Z | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | null | null | null | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
data = np.loadtxt('./data.csv', delimiter=',', unpack=True, dtype='float32')
playTime = np.transpose(data[0])
rank = np.transpose(data[1])
W = tf.Variable(tf.random_uniform([1], 0, 20000))
b = tf.Variable(tf.random_uniform([1], 1, 2000000))
X = tf.placeholder(tf.float32, n... | 30.758621 | 80 | 0.692825 | import tensorflow as tf
import numpy as np
data = np.loadtxt('./data.csv', delimiter=',', unpack=True, dtype='float32')
playTime = np.transpose(data[0])
rank = np.transpose(data[1])
W = tf.Variable(tf.random_uniform([1], 0, 20000))
b = tf.Variable(tf.random_uniform([1], 1, 2000000))
X = tf.placeholder(tf.float32, n... | true | true |
1c3e2e5dede47d12cc5e4c184ba07d5166260b1c | 1,259 | py | Python | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 43 | 2018-07-26T07:20:42.000Z | 2022-03-02T10:23:12.000Z | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 212 | 2018-09-21T10:44:07.000Z | 2022-03-22T14:33:05.000Z | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 16 | 2018-07-25T15:00:36.000Z | 2022-03-22T14:19:46.000Z | import argparse
import json
import math
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--directory', type=str, help='Directory to check for latest file.', required=True)
parser.add_argument('--objective', type=int, help='Objective function.', required=True)
parser.a... | 27.369565 | 107 | 0.621922 | import argparse
import json
import math
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--directory', type=str, help='Directory to check for latest file.', required=True)
parser.add_argument('--objective', type=int, help='Objective function.', required=True)
parser.a... | true | true |
1c3e30d6b87fe2900c07eb89a0d860f637827108 | 3,954 | py | Python | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Version agnostic psutil hack to fully support both old (<2.0) and new (>=2.0)
psutil versions.
The old <1.0 psutil API is dropped in psutil 3.0
Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6)
Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html
''... | 33.226891 | 109 | 0.608245 |
from __future__ import absolute_import, print_function, unicode_literals
from salt.ext import six
import psutil # pylint: disable=3rd-party-module-not-gated
if psutil.version_info >= (2, 0):
from psutil import * # pylint: disable=wildcard-import,unused-wildcard-import,3rd-party-module-not-gated
else:
# Im... | true | true |
1c3e321b75875673f93646662427b6867f9f25aa | 2,514 | py | Python | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | import railrl.misc.hyperparameter as hyp
from multiworld.envs.pygame.point2d import Point2DWallEnv
from railrl.data_management.obs_dict_count_based_replay_buffer import ObsDictCountBasedRelabelingBuffer
from railrl.launchers.experiments.murtaza.multiworld_her import her_td3_experiment
from railrl.launchers.launcher_uti... | 32.649351 | 103 | 0.627287 | import railrl.misc.hyperparameter as hyp
from multiworld.envs.pygame.point2d import Point2DWallEnv
from railrl.data_management.obs_dict_count_based_replay_buffer import ObsDictCountBasedRelabelingBuffer
from railrl.launchers.experiments.murtaza.multiworld_her import her_td3_experiment
from railrl.launchers.launcher_uti... | true | true |
1c3e331971bd647943a1017508dcc29d184c53b3 | 6,660 | py | Python | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Any, Dict, Optional, Text
from rasa.constants import DOCS_URL_MIGRATION_GUIDE
from rasa.core.constants import DEFAULT_POLICY_PRIORITY, DIALOGUE
from rasa.core.featurizers import TrackerFeaturizer
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.utils.tensorflow.constants ... | 39.176471 | 87 | 0.668769 | import logging
from typing import Any, Dict, Optional, Text
from rasa.constants import DOCS_URL_MIGRATION_GUIDE
from rasa.core.constants import DEFAULT_POLICY_PRIORITY, DIALOGUE
from rasa.core.featurizers import TrackerFeaturizer
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.utils.tensorflow.constants ... | true | true |
1c3e33c7f0102c2010cb88e2f21ad95e7f86bb16 | 8,725 | py | Python | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Developed by Haozhe Xie <cshzxie@gmail.com>
import json
import numpy as np
import os
import torch
import torch.backends.cudnn
import torch.utils.data
import utils.binvox_visualization
import utils.data_loaders
import utils.data_transforms
import utils.network_utils
from datetime import da... | 42.560976 | 119 | 0.615931 |
import json
import numpy as np
import os
import torch
import torch.backends.cudnn
import torch.utils.data
import utils.binvox_visualization
import utils.data_loaders
import utils.data_transforms
import utils.network_utils
from datetime import datetime as dt
from models.encoder import Encoder
from models.decoder imp... | true | true |
1c3e3463540fc028f1d93f2a5ec8e2f0d1614f17 | 4,399 | py | Python | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | 3 | 2021-04-11T07:34:11.000Z | 2022-03-23T08:43:37.000Z | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | null | null | null | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | 1 | 2021-05-28T11:26:20.000Z | 2021-05-28T11:26:20.000Z | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | 34.367188 | 111 | 0.605592 | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | true | true |
1c3e34bfe2cd4e5b3c1b755fca75ab3620ff4d3c | 1,422 | py | Python | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 25.392857 | 79 | 0.552743 |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
def setUp(self):
self.set_filename('chart_gradient10.xlsx')
def test_create_file(self):
workbook = Workbook(self.got_filename)
worksheet = wor... | true | true |
1c3e3559ddaf9744115065e974ddb78f69bb6858 | 912 | py | Python | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | null | null | null | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | null | null | null | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | 1 | 2018-03-04T04:48:44.000Z | 2018-03-04T04:48:44.000Z | #-*- coding: utf-8 -*
#
# Copyright 2011 shuotao.me
# Copyright 2012 2013 2014 msx.com
# by error.d@gmail.com
# 2014-08-26
#
from datetime import datetime
from sputnik.SpuDBObject import SpuDBObject, Field
from sputnik.SpuDateTime import SpuDateTime
class FoodAndPlace(SpuDBObject):
_table_ = 'sputnik.food_and_pla... | 35.076923 | 88 | 0.673246 |
from datetime import datetime
from sputnik.SpuDBObject import SpuDBObject, Field
from sputnik.SpuDateTime import SpuDateTime
class FoodAndPlace(SpuDBObject):
_table_ = 'sputnik.food_and_place'
def __init__(self, spudb, spucache, debug):
SpuDBObject.__init__(self, FoodAndPlace._table_, spudb, spucache,... | true | true |
1c3e35c660ab6db7e356e609d03b3debbcd82e20 | 253 | py | Python | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=unused-import
from .db_oauth import OAuth
from .db_library import Library
from .common import TOKEN_URL, str_to_base64, Mark
from .client_aouth import get_access_token, save_access_token
from .client_requests import generate_playlist
| 31.625 | 61 | 0.84585 |
from .db_oauth import OAuth
from .db_library import Library
from .common import TOKEN_URL, str_to_base64, Mark
from .client_aouth import get_access_token, save_access_token
from .client_requests import generate_playlist
| true | true |
1c3e365b10d8d6c328efd3f1e795a8fe15bbcc68 | 1,245 | py | Python | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: consensus_message.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message... | 35.571429 | 155 | 0.818474 | from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default(... | true | true |
1c3e393d8d84c64a7dbeda497a5fda44ee5664af | 3,201 | py | Python | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | import json
import os
from collections import OrderedDict
import numpy as np
import tensorflow as tf
import tabulate
CODE_DIR = os.path.abspath(os.path.dirname(__file__))
CONF_DIR = os.path.join(CODE_DIR, "conf")
def save_scores(scores, file, args):
"""Write scores in table format to a .txt file and to a .tex ... | 26.454545 | 114 | 0.657295 | import json
import os
from collections import OrderedDict
import numpy as np
import tensorflow as tf
import tabulate
CODE_DIR = os.path.abspath(os.path.dirname(__file__))
CONF_DIR = os.path.join(CODE_DIR, "conf")
def save_scores(scores, file, args):
envs = sorted(scores.keys())
labels = [label for label ... | true | true |
1c3e39601e53da411311267ee7a86cb6a1474cd3 | 891 | py | Python | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | null | null | null | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | 1 | 2021-12-02T06:13:15.000Z | 2021-12-02T06:13:15.000Z | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | 1 | 2021-12-02T16:08:44.000Z | 2021-12-02T16:08:44.000Z |
"""vocalkiev URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 31.821429 | 77 | 0.710438 |
from django.contrib import admin
from django.urls import include, path
from django.conf.urls.i18n import i18n_patterns
urlpatterns = [
]
urlpatterns += i18n_patterns(
path('', include('crm.urls')),
path('admin', admin.site.urls), )
| true | true |
1c3e39edd4fba2c79db95c44ce2cbc3db03c56cf | 122 | py | Python | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | """
Contains credentials, Email or Phone and Password
"""
# enter your credentials here
EMAIL_OR_PHONE = ''
PASSWORD = '' | 17.428571 | 49 | 0.721311 |
EMAIL_OR_PHONE = ''
PASSWORD = '' | true | true |
1c3e3b78b0a80f991205c4899e210a194da71819 | 589 | py | Python | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
testerlib.models.suite_code
This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ) on 08/03/2016
"""
class SuiteCode(object):
"""Implementation of the 'SuiteCode' enum.
A integer based enum representing a Suite in a game of cards
... | 19 | 109 | 0.634975 |
class SuiteCode(object):
HEARTS = 1
SPADES = 2
CLUBS = 3
DIAMONDS = 4
| true | true |
1c3e3c2b893f760a44c50c9da620ef79ee4dd129 | 6,894 | py | Python | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 30 | 2016-11-14T23:26:52.000Z | 2022-02-23T02:06:40.000Z | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 64 | 2017-04-28T21:19:01.000Z | 2021-06-12T16:40:29.000Z | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 25 | 2016-11-16T19:37:31.000Z | 2022-02-23T02:06:22.000Z | import logging
import queue
from wsgiref import simple_server
import prometheus_client
from ctf_gameserver.lib.metrics import SilentHandler
def inc(metrics_queue, name, value=1, labels=None):
metrics_queue.put(MetricsMessage(name, 'inc', value, labels))
def dec(metrics_queue, name, value=1, labels=None):
... | 36.47619 | 109 | 0.6481 | import logging
import queue
from wsgiref import simple_server
import prometheus_client
from ctf_gameserver.lib.metrics import SilentHandler
def inc(metrics_queue, name, value=1, labels=None):
metrics_queue.put(MetricsMessage(name, 'inc', value, labels))
def dec(metrics_queue, name, value=1, labels=None):
... | true | true |
1c3e3c5371505395b1b5ede79b55396e902e1f0b | 348 | py | Python | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
import sys
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("cctbx_sgtbx_asu_ext")
from cctbx_sgtbx_asu_ext import *
def asu_show_(asu, f=None):
if f is None:
f = sys.stdout
print(asu.as_string(), file=f)
direct_space_asu.show_compre... | 24.857143 | 64 | 0.79023 | from __future__ import absolute_import, division, print_function
import sys
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("cctbx_sgtbx_asu_ext")
from cctbx_sgtbx_asu_ext import *
def asu_show_(asu, f=None):
if f is None:
f = sys.stdout
print(asu.as_string(), file=f)
direct_space_asu.show_compre... | true | true |
1c3e3c5ad328772370c7da8c0fc0264690bcf649 | 8,357 | py | Python | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | """
Test the keycache
"""
import os
import tempfile
import shutil
import unittest
from unittest import mock
from scitokens.utils.keycache import KeyCache
from scitokens.utils.errors import UnableToCreateCache
from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key
from cryptography.hazmat.backen... | 35.411017 | 119 | 0.637669 |
import os
import tempfile
import shutil
import unittest
from unittest import mock
from scitokens.utils.keycache import KeyCache
from scitokens.utils.errors import UnableToCreateCache
from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key
from cryptography.hazmat.backends import default_backend
... | true | true |
1c3e3dc3cd371984b5da1866b6293f75fd8c2b20 | 351 | py | Python | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | 1 | 2015-12-30T22:03:42.000Z | 2015-12-30T22:03:42.000Z | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | null | null | null | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | null | null | null | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'posts$', views.posts, name='posts'),
url(r'posts/post/(?P<post_id>[0-9]+)/$', views.post, name='post'),
url(r'logout$', views.logout_user, name='logout_user'),
url(r'login$', views.log... | 29.25 | 70 | 0.635328 | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'posts$', views.posts, name='posts'),
url(r'posts/post/(?P<post_id>[0-9]+)/$', views.post, name='post'),
url(r'logout$', views.logout_user, name='logout_user'),
url(r'login$', views.log... | true | true |
1c3e3e2f5dec30762f5afd5a04fa89772914f997 | 1,128 | py | Python | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib import messages
from braces.views import LoginRequiredMixin
from django.views.generic import (
ListView,
CreateView,
UpdateView,
DeleteView
)
from .models import Medicos
class MedicosMixin(object):
@property
def success_msg(self):
return No... | 20.888889 | 70 | 0.693262 |
from django.contrib import messages
from braces.views import LoginRequiredMixin
from django.views.generic import (
ListView,
CreateView,
UpdateView,
DeleteView
)
from .models import Medicos
class MedicosMixin(object):
@property
def success_msg(self):
return NotImplemented
def ge... | true | true |
1c3e3e3be4e2e71a4c6cf9a26979d0ca814dbfcb | 69 | py | Python | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | """
@author: magician
@file: __init__.py.py
@date: 2020/10/22
""" | 13.8 | 23 | 0.608696 | true | true | |
1c3e3e76cf5680110bc941958c2cb7a3e671d5f4 | 539 | py | Python | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | 6 | 2015-08-10T01:43:54.000Z | 2020-10-06T19:09:10.000Z | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | null | null | null | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | null | null | null | import os.path
import unittest
import layout
class TestVersion(unittest.TestCase):
def text_version_exists(self):
assert layout.__version__
def test_version_tuple(self):
assert layout.__version_info__
assert len(layout.__version_info__) == 3
for value in layout.__versi... | 26.95 | 76 | 0.666048 | import os.path
import unittest
import layout
class TestVersion(unittest.TestCase):
def text_version_exists(self):
assert layout.__version__
def test_version_tuple(self):
assert layout.__version_info__
assert len(layout.__version_info__) == 3
for value in layout.__versi... | true | true |
1c3e3fa2eeb30250a2c5eee6f0177b7298022c3b | 3,320 | py | Python | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 07:57:41 2020
@author: edison
"""
import numpy as np
import pandas as pd
lista_numeros = [1,2,3]
tupla_numeros = (1,2,3)
np_numeros = np.array([1,2,3])
series_a = pd.Series(lista_numeros)
series_b = pd.Series(tupla_numeros)
series_c = pd.Serie... | 19.761905 | 119 | 0.702108 |
import numpy as np
import pandas as pd
lista_numeros = [1,2,3]
tupla_numeros = (1,2,3)
np_numeros = np.array([1,2,3])
series_a = pd.Series(lista_numeros)
series_b = pd.Series(tupla_numeros)
series_c = pd.Series(np_numeros)
series_d = pd.Series(
[True,
False,
12,
12.12,
"EDISON",
None,
(1... | true | true |
1c3e417eccb4ae602abfb27f20df371f2ec0b0da | 5,520 | py | Python | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | 2 | 2019-03-09T10:03:47.000Z | 2019-03-23T19:59:08.000Z | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
#... | 32.093023 | 186 | 0.567391 | #
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
""
}
import re
import sys
import dns.resolver
import collections
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{... | true | true |
1c3e427700e8283980f5d1e25076bee67001188e | 3,242 | py | Python | project/settings.py | martinfaucheux/django-archving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | 1 | 2022-01-19T19:03:53.000Z | 2022-01-19T19:03:53.000Z | project/settings.py | martinfaucheux/django-archiving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | null | null | null | project/settings.py | martinfaucheux/django-archiving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | null | null | null | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... | 25.730159 | 91 | 0.700494 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure--*6_ke@q3!$(w!u1g!3fmh&&7iqm=(5p8j!w7rsp#%yb7olt$6'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... | true | true |
1c3e4427f0acdcd97d1d8b28cfb60e335832903b | 11,958 | py | Python | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 48 | 2015-11-16T13:35:11.000Z | 2022-02-24T11:02:14.000Z | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 30 | 2015-11-16T14:37:46.000Z | 2021-02-22T19:39:34.000Z | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 61 | 2015-11-12T18:31:58.000Z | 2022-03-04T12:59:35.000Z | #!/usr/bin/env python3
from copy import copy
import numpy as np
import logging
from sequence import Step
log = logging.getLogger('LabberDriver')
# TODO remove Step dep from CompositeGate
class BaseGate:
"""Base class for a qubit gate.
"""
def get_adjusted_pulse(self, pulse):
pulse = copy(pulse)... | 26.281319 | 79 | 0.594581 | from copy import copy
import numpy as np
import logging
from sequence import Step
log = logging.getLogger('LabberDriver')
class BaseGate:
def get_adjusted_pulse(self, pulse):
pulse = copy(pulse)
return pulse
def __repr__(self):
return self.__str__()
class OneQubitGate(BaseGate):
... | true | true |
1c3e4597b373a87c78c63dc3fc76ffc8ff061d3a | 349 | py | Python | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | 10 | 2019-01-05T13:51:01.000Z | 2022-03-18T01:32:14.000Z | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | null | null | null | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | 6 | 2017-11-16T01:00:09.000Z | 2022-01-17T14:08:26.000Z | import numpy as np
import numpy.testing as npt
import projgrad
def test_basic():
def objective(x):
f = np.sum(x**2)
grad = 2 * x
return f, grad
res = projgrad.minimize(objective, [0.1, 0.7, 0.2], reltol=1e-8)
npt.assert_allclose(res.x, np.ones(3)/3.0)
if __name__ == '__main__'... | 21.8125 | 68 | 0.613181 | import numpy as np
import numpy.testing as npt
import projgrad
def test_basic():
def objective(x):
f = np.sum(x**2)
grad = 2 * x
return f, grad
res = projgrad.minimize(objective, [0.1, 0.7, 0.2], reltol=1e-8)
npt.assert_allclose(res.x, np.ones(3)/3.0)
if __name__ == '__main__'... | true | true |
1c3e4881dd472c3c3641cb8a815e4baf723a9eb9 | 4,758 | py | Python | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | 6 | 2021-03-17T09:53:10.000Z | 2022-03-28T18:26:22.000Z | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | null | null | null | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | null | null | null | import json
import random
from argparse import ArgumentParser, FileType, ArgumentDefaultsHelpFormatter
from web_table_embedding_model import WebTableEmbeddingModel
from fasttext_embedding_model import FasttextEmbeddingModel
from dataset_loader import DatasetLoader
def create_arg_parser():
parser = ArgumentParser... | 40.322034 | 136 | 0.648382 | import json
import random
from argparse import ArgumentParser, FileType, ArgumentDefaultsHelpFormatter
from web_table_embedding_model import WebTableEmbeddingModel
from fasttext_embedding_model import FasttextEmbeddingModel
from dataset_loader import DatasetLoader
def create_arg_parser():
parser = ArgumentParser... | true | true |
1c3e49531beeb3eeeae61b576d87ce5954cb8183 | 13,826 | py | Python | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-PORT-STORM-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-PORT-STORM-CONTROL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:53:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | 116.184874 | 2,067 | 0.756907 | OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.impo... | true | true |
1c3e4a2aa5c64da844f61435080a6ca743e744d5 | 5,823 | py | Python | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | 5 | 2016-03-01T02:04:47.000Z | 2017-12-28T22:28:53.000Z | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | null | null | null | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | 3 | 2016-03-01T02:04:49.000Z | 2019-02-08T09:55:18.000Z | """
The MIT License (MIT)
Copyright (c) 2016 Fastboot Mobile LLC.
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
... | 32.898305 | 105 | 0.641765 |
from flask import render_template, Blueprint, url_for, \
redirect, flash, request
from flask.ext.login import login_user, logout_user, login_required, current_user
from project import bcrypt, db
from project.models import User, PushDevice
from project.user.forms import *
from project.push.tasks import sendpush... | true | true |
1c3e4a7f8481de0720dcd6f1810d7ec36b019d1f | 5,716 | py | Python | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | 3 | 2020-06-05T08:29:16.000Z | 2021-12-09T05:44:54.000Z | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | null | null | null | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | 1 | 2020-09-15T14:50:31.000Z | 2020-09-15T14:50:31.000Z | #!/usr/bin/env python3
'''
Bilibili 各分区视频数量查询脚本
作者: WuSiYu(wu.siyu@hotmail.com)
日期: 2018-07-26 00:54
本脚本参考了uupers团队的研究: https://github.com/uupers/BiliSpider/wiki
'''
from urllib import request
import json
ALL_RID = (12, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 37, 39, 41, 46, 47,... | 42.340741 | 459 | 0.501924 | from urllib import request
import json
ALL_RID = (12, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 37, 39, 41, 46, 47, 50, 51, 53, 54, 56, 59, 60, 65, 67, 71, 74, 75, 76, 77, 79, 80, 82, 83, 85, 86, 94, 95, 96, 98, 114, 116, 118, 120, 121, 122, 124, 125, 126, 127, 128, 130, 131, 134, 135, 136... | true | true |
1c3e4b284b2e2a931344b34edf163c476a161ef9 | 12,893 | py | Python | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | 1 | 2021-08-05T01:45:26.000Z | 2021-08-05T01:45:26.000Z | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | 1 | 2021-02-16T00:47:46.000Z | 2021-02-16T00:47:46.000Z | # Copyright The PyTorch Lightning team.
#
# 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 i... | 39.670769 | 118 | 0.692701 | from collections import namedtuple
from unittest.mock import patch
import pytest
import torch
from torchtext.data import Batch, Dataset, Example, Field, LabelField
import tests.helpers.pipelines as tpipes
import tests.helpers.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.utilities impor... | true | true |
1c3e4b60b760a917f64869badc26e0447f7b250e | 1,864 | py | Python | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 38 | 2016-02-22T07:49:40.000Z | 2021-07-14T09:46:48.000Z | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 8 | 2016-02-22T07:51:16.000Z | 2018-10-05T02:11:51.000Z | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 16 | 2016-03-27T03:36:16.000Z | 2020-09-23T10:04:52.000Z | # -*- coding: utf-8 -*-
import logging
from doodle.config import CONFIG
from doodle.core.property import IntegerProperty, StringProperty
from doodle.core.redis_client import redis_cache_client
from .base_model import JSONModel
class KeywordArticle(JSONModel):
keywords = StringProperty()
article_id = Intege... | 35.846154 | 115 | 0.656652 |
import logging
from doodle.config import CONFIG
from doodle.core.property import IntegerProperty, StringProperty
from doodle.core.redis_client import redis_cache_client
from .base_model import JSONModel
class KeywordArticle(JSONModel):
keywords = StringProperty()
article_id = IntegerProperty()
def _ge... | true | true |
1c3e4baf278cb9e16666ec1e8178813371e0b652 | 1,569 | py | Python | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 19 | 2020-05-04T18:40:36.000Z | 2022-01-24T08:53:14.000Z | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 369 | 2020-04-06T14:20:08.000Z | 2022-03-31T16:05:48.000Z | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 10 | 2020-03-31T20:06:00.000Z | 2022-03-26T08:25:49.000Z | from pathlib import Path
import yaml
import json
class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
def remove_implicit_resolver(cls, tag_to_remove):
"""
Solution from here: https://stackoverflow.com/a/37958106/11483674
Remove implicit resolvers for a particular tag
Takes ... | 34.108696 | 95 | 0.660293 | from pathlib import Path
import yaml
import json
class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
def remove_implicit_resolver(cls, tag_to_remove):
if not "yaml_implicit_resolvers" in cls.__dict__:
cls.yaml_implicit_resolvers = cls.yaml_implicit_resolvers.copy()
for first_le... | true | true |
1c3e4c815d7c51fa5a1627fcbb87e19f55a67ceb | 11,265 | py | Python | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
import math
import libtbx
import libtbx.load_env
from libtbx import adopt_init_args
from scitbx.array_family import flex
import scitbx.lbfgs
import scitbx.math
from scitbx import matrix
class function_base(object):
def __call__(self, x_obs):
raise NotImplementedError
def par... | 31.37883 | 118 | 0.647226 | from __future__ import division
import math
import libtbx
import libtbx.load_env
from libtbx import adopt_init_args
from scitbx.array_family import flex
import scitbx.lbfgs
import scitbx.math
from scitbx import matrix
class function_base(object):
def __call__(self, x_obs):
raise NotImplementedError
def par... | true | true |
1c3e4cb556f40621a237c070e9f08e895f5000c9 | 193 | py | Python | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | 1 | 2021-07-01T16:00:54.000Z | 2021-07-01T16:00:54.000Z | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | null | null | null | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | null | null | null | def parsed_arguments_dict(my_args):
keys = [key for key in dir(my_args) if key[0] != '_']
dict = {}
for key in keys:
dict[key] = eval('my_args.' + str(key))
return dict
| 27.571429 | 57 | 0.585492 | def parsed_arguments_dict(my_args):
keys = [key for key in dir(my_args) if key[0] != '_']
dict = {}
for key in keys:
dict[key] = eval('my_args.' + str(key))
return dict
| true | true |
1c3e4d459da0c92c85b9d2f62df84f0f6e5f3f1a | 3,589 | py | Python | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123): #all letters except first alphabet
alphabet.append(chr(letter))
alphabet1 = [] #first letter alpha... | 37 | 140 | 0.58735 | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123): alphabet.append(chr(letter))
alphabet1 = [] for letter in range(97,123):
alphabet1.app... | true | true |
1c3e4d48552630c2b67eed26096157fd2ff94ad5 | 9,209 | py | Python | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 6 | 2020-07-06T14:31:18.000Z | 2021-09-13T10:15:14.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 2 | 2021-09-12T17:49:09.000Z | 2021-09-14T15:28:54.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 1 | 2021-06-07T01:46:44.000Z | 2021-06-07T01:46:44.000Z | # This code is used to generate an analysis html for the results of the mturk batch of project -
# TexKBC useful? (id=1419750).
# It requires the results.csv downloaded from mturk.
# Quality control is done, by giving all true facts (data from test.txt, which is known to be true)
# If turker choses false, then that hit... | 40.03913 | 162 | 0.621349 | import pandas as pd
import numpy as np
import pprint
import argparse
import collections
import string
import os
import bs4 as bs
import itertools
ANSWER_OPTIONS = ['true','false']
REASON_OPTIONS = ['know','exp','guess','web']
def get_key_answer(key,id):
return string.Template('Answer.${key}_${id}.on').substitute... | true | true |
1c3e4e3785dd3453a62a10e3b0d8d4dc0d97b925 | 9,759 | py | Python | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | import tensorflow as tf
from modules.base_modules_default_init import *
def sampler(input_pitch, input_mfc, final_filters=1, reuse=False, \
scope_name='sampler'):
# Inputs have shape [batch_size, num_features, time]
inputs = tf.concat([input_mfc, input_pitch], axis=1, \
... | 39.510121 | 74 | 0.586536 | import tensorflow as tf
from modules.base_modules_default_init import *
def sampler(input_pitch, input_mfc, final_filters=1, reuse=False, \
scope_name='sampler'):
inputs = tf.concat([input_mfc, input_pitch], axis=1, \
name='sampler_input')
inpu... | true | true |
1c3e4e762da2a3ebd8df6777b090dcb9b9a5eb3e | 251 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | marks = input("Plase Enter your Marks: ")
marks = int(marks)
if marks >= 80:
grade = "A+"
elif marks >= 70:
grade = "A"
elif marks >= 60:
grade = "A-"
elif marks >= 50:
grade = "B"
else:
grade = "F"
print("Your Grade is", grade)
| 15.6875 | 41 | 0.553785 | marks = input("Plase Enter your Marks: ")
marks = int(marks)
if marks >= 80:
grade = "A+"
elif marks >= 70:
grade = "A"
elif marks >= 60:
grade = "A-"
elif marks >= 50:
grade = "B"
else:
grade = "F"
print("Your Grade is", grade)
| true | true |
1c3e4f66c4687b21cb3f34b0350b3438ab41ebc9 | 1,431 | py | Python | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2019-09-19T04:53:22.000Z | 2019-09-19T04:53:22.000Z | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | null | null | null | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2021-12-28T04:26:02.000Z | 2021-12-28T04:26:02.000Z | import pymysql
# 创建到数据的连接
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='tedu.cn',
db='nsd1904',
charset='utf8'
)
cur = conn.cursor() # 创建游标,相当于文件对象
###################################
# 添加部门
# insert_dep = 'INSERT INTO departments(dep_id, dep_name) VALUES(%s, %s)'
... | 25.105263 | 73 | 0.540881 | import pymysql
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='tedu.cn',
db='nsd1904',
charset='utf8'
)
cur = conn.cursor() delete1 = 'DELETE FROM departments WHERE dep_id=%s'
cur.execute(delete1, (6,))
conn.commit()
cur.close()
conn.close()
| true | true |
1c3e506c7cd9bffe9f51f40d44ca105d09573419 | 663 | py | Python | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | null | null | null | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | 6 | 2020-09-04T21:25:37.000Z | 2022-02-26T10:47:20.000Z | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-05-13 12:41
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
... | 25.5 | 93 | 0.615385 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
name='created_at',
field=... | true | true |
1c3e50c250c7df75e0b0d02658e0878ba7b1ece9 | 506 | py | Python | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 4 | 2018-12-24T16:35:07.000Z | 2021-08-29T08:59:58.000Z | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 1 | 2019-01-15T18:04:07.000Z | 2019-01-15T18:04:07.000Z | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 19 | 2018-10-10T10:41:40.000Z | 2022-02-22T19:39:15.000Z | from src.search import main
def test():
if len(main("", "PineaPple")) > 0 and main("", "PineaPple")[
0][2] == 'slice of pineapple upside-down cake.':
print("1. Case insensitive query working :)")
else:
print("1. Case insensitive query not working")
if main("", "miles at") == ... | 29.764706 | 86 | 0.55336 | from src.search import main
def test():
if len(main("", "PineaPple")) > 0 and main("", "PineaPple")[
0][2] == 'slice of pineapple upside-down cake.':
print("1. Case insensitive query working :)")
else:
print("1. Case insensitive query not working")
if main("", "miles at") == ... | true | true |
1c3e5273f4da456a4adae683289a7a58bb42048b | 857 | py | Python | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | # mdf: mit document fetcher
import os, argparse, re, wget
import urllib.request as urllib2
from urllib.parse import urlparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description='Fetch MIT lecture notes.')
parser.add_argument('--url', type=str, help='an url for fetching documents', required=Tru... | 34.28 | 97 | 0.746791 | import os, argparse, re, wget
import urllib.request as urllib2
from urllib.parse import urlparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description='Fetch MIT lecture notes.')
parser.add_argument('--url', type=str, help='an url for fetching documents', required=True)
parser.add_argument('--ou... | true | true |
1c3e52fc15eba82355db186e7615fceca4b2570d | 387 | py | Python | Chapter13/educa/educa/asgi.py | sabin-web/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 628 | 2019-11-13T14:13:40.000Z | 2022-03-30T19:02:05.000Z | Chapter13/educa/educa/asgi.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 96 | 2020-04-17T17:35:33.000Z | 2022-02-17T09:25:06.000Z | Chapter13/educa/educa/asgi.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 782 | 2019-10-15T07:29:27.000Z | 2022-03-30T17:25:08.000Z | """
ASGI config for educa project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'educa.settings')
application = get_asgi_application()
| true | true |
1c3e5369d9f22afc39fa65ce87df45fec511d081 | 904 | py | Python | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 701 | 2018-10-22T11:54:09.000Z | 2022-03-31T14:39:30.000Z | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 229 | 2018-10-24T09:15:31.000Z | 2021-12-24T16:51:37.000Z | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 131 | 2018-11-25T18:33:03.000Z | 2022-03-24T03:18:07.000Z | """
Classes from the 'DataDetectorsCore' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DDScannerResult = _Class("DDScannerResult")
DDMess... | 27.393939 | 71 | 0.779867 |
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DDScannerResult = _Class("DDScannerResult")
DDMessageCache = _Class("DDMessageCache")
DDMessageCacheElemen... | true | true |
1c3e54391ff27af20fc3bcfa1e1f3e00e98acf7f | 2,558 | py | Python | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 294 | 2017-10-10T19:01:04.000Z | 2022-03-18T15:52:19.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 285 | 2017-10-20T09:27:21.000Z | 2022-03-29T15:33:45.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 134 | 2017-10-11T13:55:17.000Z | 2022-03-23T07:21:17.000Z | import django
import pytest
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.context import Context
from aws_xray_sdk.ext.django.db import patch_db
@pytest.fixture(scope='module', autouse=True)
def setup():
django.setup()
xray_recorder.configure(context=Context(),
... | 29.068182 | 79 | 0.686083 | import django
import pytest
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.context import Context
from aws_xray_sdk.ext.django.db import patch_db
@pytest.fixture(scope='module', autouse=True)
def setup():
django.setup()
xray_recorder.configure(context=Context(),
... | true | true |
1c3e546477e59e8ded61d921ed350c2e11799802 | 228 | py | Python | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import User
# Register your models here.
class UserAdmin(admin.ModelAdmin):
list_display = ('username',
'password')
admin.site.register(User, UserAdmin)
| 17.538462 | 36 | 0.688596 | from django.contrib import admin
from .models import User
class UserAdmin(admin.ModelAdmin):
list_display = ('username',
'password')
admin.site.register(User, UserAdmin)
| true | true |
1c3e5537f56c529cc6e68fecdfa6ff529fa172fb | 2,238 | py | Python | python/runtime/explainer.py | Smirenost/sqlflow | fe9da6995fe2625c9ebeb4ee108ada6bf1329ac2 | [
"Apache-2.0"
] | 2 | 2020-08-09T14:30:15.000Z | 2020-09-20T16:33:30.000Z | python/runtime/explainer.py | vmnet04/sqlflow | 244366196e71834ea2a3a67b90406f7e99e4bcf0 | [
"Apache-2.0"
] | 9 | 2020-08-09T11:12:05.000Z | 2020-10-14T00:19:57.000Z | python/runtime/explainer.py | vmnet04/sqlflow | 244366196e71834ea2a3a67b90406f7e99e4bcf0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SQLFlow 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 applicable law o... | 36.096774 | 78 | 0.682306 |
import sys
import matplotlib
import matplotlib.pyplot as plt
from runtime.oss import copyfileobj
def plot_and_save(plotfunc,
oss_dest=None,
oss_ak=None,
oss_sk=None,
oss_endpoint=None,
oss_bucket_name=None,
... | true | true |
1c3e55d605c6247301920b6c2d2be5324e789cb5 | 5,160 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.263158 | 133 | 0.661628 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
1c3e55d9cf8f0c9f568d667c30c0e10e59977b55 | 9,951 | py | Python | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 19 | 2021-11-02T17:56:04.000Z | 2022-03-30T18:05:20.000Z | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 6 | 2021-12-25T04:42:09.000Z | 2022-03-14T17:49:06.000Z | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 5 | 2021-12-08T12:30:40.000Z | 2022-01-28T06:30:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Meeko preparation
#
import os
import sys
from collections import OrderedDict
import warnings
from rdkit import Chem
from .molsetup import OBMoleculeSetup
from .molsetup import RDKitMoleculeSetup
from .atomtyper import AtomTyper
from .bondtyper import BondTyperLegacy
... | 42.892241 | 130 | 0.60195 |
import os
import sys
from collections import OrderedDict
import warnings
from rdkit import Chem
from .molsetup import OBMoleculeSetup
from .molsetup import RDKitMoleculeSetup
from .atomtyper import AtomTyper
from .bondtyper import BondTyperLegacy
from .hydrate import HydrateMoleculeLegacy
from .macrocycle import Fle... | true | true |
1c3e55e808e02330d778b3785ff224fbb576fff4 | 1,017 | py | Python | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | 1 | 2021-11-28T15:03:32.000Z | 2021-11-28T15:03:32.000Z | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
def sortInplace(array):
for j in range(1, len(array)):
key = array[j]
i = j - 1
while i>-1 and key<array[i]:
array[i+1] = array[i]
i -= ... | 26.763158 | 65 | 0.427729 | class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
def sortInplace(array):
for j in range(1, len(array)):
key = array[j]
i = j - 1
while i>-1 and key<array[i]:
array[i+1] = array[i]
i -= ... | true | true |
1c3e5785efc594605381dfaf666e99e54412cda7 | 558 | py | Python | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | 1 | 2022-03-21T00:40:23.000Z | 2022-03-21T00:40:23.000Z | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | null | null | null | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | null | null | null |
import numpy as np
from ..regularization_operator import RegularizationOperator
class IdentityOperator(RegularizationOperator):
"""
Corresponds to to the identity operator :math:`I(v) = v`.
"""
def __init__(self, dim):
self._mat = np.identity(dim)
def fwd(self, v: np.ndarray) -> np.ndar... | 22.32 | 61 | 0.596774 |
import numpy as np
from ..regularization_operator import RegularizationOperator
class IdentityOperator(RegularizationOperator):
def __init__(self, dim):
self._mat = np.identity(dim)
def fwd(self, v: np.ndarray) -> np.ndarray:
return v
def adj(self, v: np.ndarray) -> np.ndarray:
... | true | true |
1c3e58d667c0b70d47852665e13afc344c61b3be | 1,524 | py | Python | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyFord(PythonPackage):
"""FORD, standing for FORtran Documenter, is an automatic d... | 41.189189 | 96 | 0.681102 |
from spack.package import *
class PyFord(PythonPackage):
pypi = "FORD/FORD-6.1.11.tar.gz"
maintainers = ['wscullin']
version('6.1.12', sha256='101191e1aa33cfe780ea5b2d66d02c7281b9b314e82bb138d76809a49c08506a')
version('6.1.11', sha256='feb9a88040e717e84c632e4b023904ab36a463fc9a8ff80c8c7f86454e... | true | true |
1c3e59634d8299d2a8cbde37093eaae92000aa89 | 1,686 | py | Python | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
from collections import Counter
import click
import msgpack # TODO: add cache saving and loading
import util
@click.command()
@click.option('--data-path',
required=True,
type=click.Path(writable=False),
help="Path to messages subfolder insi... | 33.72 | 78 | 0.657177 | import os
from collections import Counter
import click
import msgpack
import util
@click.command()
@click.option('--data-path',
required=True,
type=click.Path(writable=False),
help="Path to messages subfolder inside downloaded data folder")
@click.option('-n', default=50, ... | true | true |
1c3e5e5858537d5973709b737be108ceedebf419 | 1,435 | py | Python | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | 1 | 2021-05-31T11:45:48.000Z | 2021-05-31T11:45:48.000Z | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | null | null | null | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | null | null | null | import coc
import creds
from discord.ext import commands
CLAN_TAG = creds.clan_tag
WAR_REPORT_CHANNEL_ID = creds.war_channel
REPORT_STYLE = """
{att.attacker.name} (No. {att.attacker.map_position}, TH{att.attacker.town_hall}) just {verb} {att.defender.name}
(No. {att.defender.map_position}, TH{att.defender.town_hal... | 27.596154 | 114 | 0.666899 | import coc
import creds
from discord.ext import commands
CLAN_TAG = creds.clan_tag
WAR_REPORT_CHANNEL_ID = creds.war_channel
REPORT_STYLE = """
{att.attacker.name} (No. {att.attacker.map_position}, TH{att.attacker.town_hall}) just {verb} {att.defender.name}
(No. {att.defender.map_position}, TH{att.defender.town_hal... | true | true |
1c3e5e95c0929efda0ad6e413536850bdd6dd9bb | 1,340 | py | Python | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 30.454545 | 76 | 0.73806 |
import unittest
import savu.test.test_utils as tu
from savu.test.travis.framework_tests.plugin_runner_test import \
run_protected_plugin_runner
class Hdf5SaverTest(unittest.TestCase):
global data_file, experiment
data_file = '24737.nxs'
experiment = None
def test_hdf5_saver(self):
p... | true | true |
1c3e5f127a35de9cd737fa25f47565a78e3c6411 | 5,190 | py | Python | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 5 | 2021-09-28T13:28:01.000Z | 2021-12-21T07:25:44.000Z | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 1 | 2019-11-18T03:03:37.000Z | 2019-11-18T03:03:37.000Z | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 4 | 2021-08-11T08:25:10.000Z | 2021-10-16T07:41:59.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 28.833333 | 80 | 0.529672 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
from paddle.fluid.initializer import MSRA
from paddle.fluid.param_attr import ParamAttr
__all__ = ['MobileNet']
train_parameters = {
"input_size": [3, 224, 224],
"input_mea... | true | true |
1c3e60118f62a2af01266746e8cb66503874e06b | 810 | py | Python | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | null | null | null | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | 20 | 2021-11-22T15:16:53.000Z | 2022-01-04T16:55:26.000Z | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | null | null | null | import ray
from ray import serve
import urllib.parse
from ray.worker import get
from ..app import app
def get_endpoint(deployment_name: str):
return urllib.parse.urlparse(serve.get_deployment(deployment_name).url).path
@serve.deployment(name='info', route_prefix="/", ray_actor_options={"num_cpus": 0.1})
@serve.... | 28.928571 | 113 | 0.644444 | import ray
from ray import serve
import urllib.parse
from ray.worker import get
from ..app import app
def get_endpoint(deployment_name: str):
return urllib.parse.urlparse(serve.get_deployment(deployment_name).url).path
@serve.deployment(name='info', route_prefix="/", ray_actor_options={"num_cpus": 0.1})
@serve.... | true | true |
1c3e6117bda03f7d7b432c1399b91fe766ad7fa8 | 1,105 | py | Python | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 5 | 2017-04-11T17:47:35.000Z | 2021-08-06T17:38:47.000Z | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 11 | 2017-09-25T23:32:59.000Z | 2018-06-25T23:38:44.000Z | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 7 | 2017-09-23T01:56:14.000Z | 2020-12-18T02:24:11.000Z | #!/usr/bin/env python
import sys
import pyca
from options import Options
from Pv import Pv
if __name__ == '__main__':
options = Options(['pvnames'], ['timeout'], [])
try:
options.parse()
except Exception as msg:
options.usage(str(msg))
sys.exit()
pvnames = options.pvnames.spl... | 26.95122 | 79 | 0.541176 | import sys
import pyca
from options import Options
from Pv import Pv
if __name__ == '__main__':
options = Options(['pvnames'], ['timeout'], [])
try:
options.parse()
except Exception as msg:
options.usage(str(msg))
sys.exit()
pvnames = options.pvnames.split()
if options.t... | true | true |
1c3e6226c1833759f2f38ad6e6e1d37b078e47a9 | 13,351 | py | Python | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-08-31T02:14:19.000Z | 2021-12-28T19:20:59.000Z | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-07-12T13:55:00.000Z | 2021-10-04T14:53:21.000Z | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-16T05:06:18.000Z | 2021-09-16T05:06:18.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import sys
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.editor as editor
impor... | 50.958015 | 119 | 0.752453 | import os
import sys
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.math as math
import azlmbr.paths
import azlmbr.legacy.general as general
sys.path.append(os.path.join(azlmbr.paths.projectroot, "Gem", "PythonTests"))
import editor_python_test_tools.hydra_editor_u... | true | true |
1c3e62dc38ce4440d5e4870548943f939964bef3 | 8,786 | py | Python | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | null | null | null | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | null | null | null | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | 1 | 2020-03-15T15:05:40.000Z | 2020-03-15T15:05:40.000Z | import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
import autosar
from tests.arxml.common import ARXMLTestClass
import unittest
def _create_packages(ws):
package=ws.createPackage('DataTypes', role='DataType')
package.createSubPackage('CompuMethods', r... | 56.683871 | 160 | 0.674596 | import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
import autosar
from tests.arxml.common import ARXMLTestClass
import unittest
def _create_packages(ws):
package=ws.createPackage('DataTypes', role='DataType')
package.createSubPackage('CompuMethods', r... | true | true |
1c3e630fd839b16105479f88dbb3ae9a39a1958a | 3,059 | py | Python | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | import numpy as np
import pandas
import scipy.interpolate
import requests
from html.parser import HTMLParser
def scrapegradedata(URL="http://gpa.eng.uci.edu/"):
page = requests.get(URL)
class GradeHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.intr... | 30.287129 | 88 | 0.520758 | import numpy as np
import pandas
import scipy.interpolate
import requests
from html.parser import HTMLParser
def scrapegradedata(URL="http://gpa.eng.uci.edu/"):
page = requests.get(URL)
class GradeHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.intr... | true | true |
1c3e633bf644ebaf5a7f7c2a5e95432142f3c7c9 | 1,004 | py | Python | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | 1 | 2020-06-26T05:03:48.000Z | 2020-06-26T05:03:48.000Z | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | 1 | 2021-06-02T02:15:07.000Z | 2021-06-02T02:15:07.000Z | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | null | null | null | """empty message
Revision ID: 4a9fa306c69c
Revises: 3d2cc737a6c7
Create Date: 2020-07-24 12:48:22.326512
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a9fa306c69c'
down_revision = '3d2cc737a6c7'
branch_labels = None
depends_on = None
def upgrade():
# ... | 27.135135 | 70 | 0.685259 | from alembic import op
import sqlalchemy as sa
revision = '4a9fa306c69c'
down_revision = '3d2cc737a6c7'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('payment_settings',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('name', sa.String(), nullable... | true | true |
1c3e638e76c10ae20b3ae3c7635e42736dec7735 | 6,727 | py | Python | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 29 | 2019-10-20T21:10:35.000Z | 2022-02-15T23:43:30.000Z | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 29 | 2020-10-30T00:53:45.000Z | 2021-03-11T07:41:08.000Z | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 8 | 2019-10-22T13:08:54.000Z | 2021-07-28T15:28:49.000Z | from viabel._psis import psislw
from viabel.approximations import MFGaussian
from viabel.diagnostics import all_diagnostics
from viabel.models import Model, StanModel
from viabel.objectives import ExclusiveKL
from viabel.optimization import FASO, RMSProp
all = [
'bbvi',
'vi_diagnostics',
]
def bbvi(dimension... | 39.110465 | 94 | 0.662405 | from viabel._psis import psislw
from viabel.approximations import MFGaussian
from viabel.diagnostics import all_diagnostics
from viabel.models import Model, StanModel
from viabel.objectives import ExclusiveKL
from viabel.optimization import FASO, RMSProp
all = [
'bbvi',
'vi_diagnostics',
]
def bbvi(dimension... | true | true |
1c3e64579dc9a5b29cd306056b4a6227f1271f5c | 6,026 | py | Python | monai/metrics/froc.py | benduffy1/MONAI | 046e625b09262261373d7b8039fb652547201368 | [
"Apache-2.0"
] | 3 | 2020-06-22T20:59:14.000Z | 2021-04-09T21:24:45.000Z | monai/metrics/froc.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | null | null | null | monai/metrics/froc.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | 1 | 2020-06-22T19:22:59.000Z | 2020-06-22T19:22:59.000Z | # Copyright (c) MONAI Consortium
# 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, so... | 44.308824 | 113 | 0.710919 |
from typing import List, Optional, Tuple, Union
import numpy as np
import torch
def compute_fp_tp_probs(
probs: Union[np.ndarray, torch.Tensor],
y_coord: Union[np.ndarray, torch.Tensor],
x_coord: Union[np.ndarray, torch.Tensor],
evaluation_mask: Union[np.ndarray, torch.Tensor],
labels_to_exclud... | true | true |
1c3e64e83644603f93bba54d178f8945f101db1b | 821 | py | Python | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | """empty message
Revision ID: d0ccd9d7ac0c
Revises: e7d7ebcea26c
Create Date: 2021-11-22 12:05:31.814178
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd0ccd9d7ac0c'
down_revision = 'e7d7ebcea26c'
branch_labels = None
depends_on = None... | 25.65625 | 89 | 0.690621 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
revision = 'd0ccd9d7ac0c'
down_revision = 'e7d7ebcea26c'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('fido', sa.Column('user_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'fido', 'users', ['us... | true | true |
1c3e66fb87abebcf535ca1b30284269ed5319bb3 | 11,738 | py | Python | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Image augmentation functions
"""
import logging
import math
import random
import cv2
import numpy as np
from utils.general import check_version, colorstr, resample_segments, segment2box
from utils.metrics import bbox_ioa
class Albumentations:
# YOLOv5 Albumentati... | 42.071685 | 118 | 0.567388 |
import logging
import math
import random
import cv2
import numpy as np
from utils.general import check_version, colorstr, resample_segments, segment2box
from utils.metrics import bbox_ioa
class Albumentations:
def __init__(self):
self.transform = None
try:
import albumentations ... | true | true |
1c3e67025a83965a9ac3f68cba1fe13e7efbd30d | 1,031 | py | Python | exercicio 068.py | rayanesousa31/Python-Curso-em-video-Mundo-2 | 9f962557b5a373bd2b45509d8990d0658effce9c | [
"MIT"
] | null | null | null | exercicio 068.py | rayanesousa31/Python-Curso-em-video-Mundo-2 | 9f962557b5a373bd2b45509d8990d0658effce9c | [
"MIT"
] | null | null | null | exercicio 068.py | rayanesousa31/Python-Curso-em-video-Mundo-2 | 9f962557b5a373bd2b45509d8990d0658effce9c | [
"MIT"
] | null | null | null | #Faça um programa que jogue PAR ou IMPAR com o computador.
#O jogo será interrompido quando o jogador PERDER,mostrando
#o total de vitórias consecutivas que ele conquistou no
#final do jogo.
from random import randint
from time import sleep
print('Vamos jogar IMPAR ou par'),sleep(2)
cont = 0
while True:
jogador... | 27.864865 | 85 | 0.57711 |
from random import randint
from time import sleep
print('Vamos jogar IMPAR ou par'),sleep(2)
cont = 0
while True:
jogador = int(input('Digite um número '))
comp = randint(1,10)
jogo = comp + jogador
opção = ' '
while opção not in 'PI':
opção = str(input('Você escolhe impar ou par? [I / P... | true | true |
1c3e6793967ef5707643ead3c0be75ed24cd0414 | 10,245 | py | Python | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from urlparse import urlparse
from framework.auth.core import Auth
from website.models import NodeLog
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import (
ProjectFactory,
Registrat... | 48.098592 | 121 | 0.686774 | from nose.tools import * from urlparse import urlparse
from framework.auth.core import Auth
from website.models import NodeLog
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
)
from... | true | true |
1c3e69669f57fe674a926d9ade62e5797dbedaae | 1,266 | py | Python | polimorfo/datasets/utils.py | chrisPiemonte/polimorfo | 79e2178dbc21fe3f98e8d84d23f33b818244ab08 | [
"Apache-2.0"
] | null | null | null | polimorfo/datasets/utils.py | chrisPiemonte/polimorfo | 79e2178dbc21fe3f98e8d84d23f33b818244ab08 | [
"Apache-2.0"
] | null | null | null | polimorfo/datasets/utils.py | chrisPiemonte/polimorfo | 79e2178dbc21fe3f98e8d84d23f33b818244ab08 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
from functools import partial
import requests
from io import BytesIO
import multiprocessing
from multiprocessing.dummy import Pool
from tqdm.autonotebook import tqdm
import logging
log = logging.getLogger(__name__)
def download_image(url_path):
"""download an image and save to the destinati... | 29.44186 | 76 | 0.669036 | from PIL import Image
from functools import partial
import requests
from io import BytesIO
import multiprocessing
from multiprocessing.dummy import Pool
from tqdm.autonotebook import tqdm
import logging
log = logging.getLogger(__name__)
def download_image(url_path):
url, path = url_path
if path.exists():
... | true | true |
1c3e6a3d37aeaa774ede07ce507303532ab60719 | 888 | py | Python | pixelate/__init__.py | useless-tools/pixelate | 5e964c1a77780f933db20b1424807e59e899a427 | [
"BSD-3-Clause"
] | 23 | 2017-10-18T15:31:30.000Z | 2022-02-01T14:50:28.000Z | pixelate/__init__.py | useless-tools/pixelate | 5e964c1a77780f933db20b1424807e59e899a427 | [
"BSD-3-Clause"
] | 1 | 2021-04-06T05:15:29.000Z | 2022-02-18T15:07:06.000Z | pixelate/__init__.py | useless-tools/pixelate | 5e964c1a77780f933db20b1424807e59e899a427 | [
"BSD-3-Clause"
] | 5 | 2018-11-30T21:05:25.000Z | 2021-12-23T23:47:43.000Z | from PIL import Image
def pixelate(input_file_path: str, output_file_path: str, pixel_size: int):
"""
Create a pixel image from the input image.
Args:
input_file_path: the path to the source image file to be processed.
output_file_path: the path to the result file.
pixel_size:... | 30.62069 | 75 | 0.611486 | from PIL import Image
def pixelate(input_file_path: str, output_file_path: str, pixel_size: int):
with Image.open(input_file_path) as image:
image = image.resize(
(image.size[0] // pixel_size, image.size[1] // pixel_size),
Image.NEAREST
)
image = image.resize(
... | true | true |
1c3e6c6bab0854f4b3751c24a38dc7909dfdff70 | 5,736 | py | Python | src/pop3sf/adapters/DirectoryAdapterBase.py | vitlabuda/pop3sf | 3792b98da329fa8091308f3363808a499af58ad7 | [
"BSD-3-Clause"
] | 1 | 2022-03-16T18:58:19.000Z | 2022-03-16T18:58:19.000Z | src/pop3sf/adapters/DirectoryAdapterBase.py | vitlabuda/pop3sf | 3792b98da329fa8091308f3363808a499af58ad7 | [
"BSD-3-Clause"
] | null | null | null | src/pop3sf/adapters/DirectoryAdapterBase.py | vitlabuda/pop3sf | 3792b98da329fa8091308f3363808a499af58ad7 | [
"BSD-3-Clause"
] | 1 | 2022-03-17T18:01:43.000Z | 2022-03-17T18:01:43.000Z | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright (c) 2021 Vít Labuda. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice... | 47.404959 | 152 | 0.731695 |
from __future__ import annotations
from typing import List
import abc
import time
import os
import os.path
import glob
import fcntl
import hashlib
from .AdapterAuxiliaries import AdapterAuxiliaries
from .AdapterBase import AdapterBase
class DirectoryAdapterBase(AdapterBase, metaclass=abc.ABCMeta):
class _Messag... | true | true |
1c3e6d3b562e4192a449eec58aedf7c4a9e1563e | 2,568 | py | Python | environment/script/edit_dot_graph.py | computationalgeography/lue | 71993169bae67a9863d7bd7646d207405dc6f767 | [
"MIT"
] | 2 | 2021-02-26T22:45:56.000Z | 2021-05-02T10:28:48.000Z | environment/script/edit_dot_graph.py | pcraster/lue | e64c18f78a8b6d8a602b7578a2572e9740969202 | [
"MIT"
] | 262 | 2016-08-11T10:12:02.000Z | 2020-10-13T18:09:16.000Z | environment/script/edit_dot_graph.py | computationalgeography/lue | 71993169bae67a9863d7bd7646d207405dc6f767 | [
"MIT"
] | 1 | 2020-03-11T09:49:41.000Z | 2020-03-11T09:49:41.000Z | #!/usr/bin/env python
import functools
import os.path
import re
import sys
import traceback
import docopt
def checked_call(
function):
@functools.wraps(function)
def wrapper(
*args,
**kwargs):
result = 0
try:
result = function(*args, **kwargs)
... | 26.474227 | 77 | 0.608645 | import functools
import os.path
import re
import sys
import traceback
import docopt
def checked_call(
function):
@functools.wraps(function)
def wrapper(
*args,
**kwargs):
result = 0
try:
result = function(*args, **kwargs)
except:
... | true | true |
1c3e6de79b1a7d032b4af2b2d0cbd9ee93c15924 | 300 | py | Python | chapter 8/sampleCode5.py | DTAIEB/Thoughtful-Data-Science | 8b80e8f3e33b6fdc6672ecee1f27e0b983b28241 | [
"Apache-2.0"
] | 15 | 2018-06-01T19:18:32.000Z | 2021-11-28T03:31:35.000Z | chapter 8/sampleCode5.py | chshychen/Thoughtful-Data-Science | 8b80e8f3e33b6fdc6672ecee1f27e0b983b28241 | [
"Apache-2.0"
] | 1 | 2018-12-17T02:01:42.000Z | 2018-12-17T02:01:42.000Z | chapter 8/sampleCode5.py | chshychen/Thoughtful-Data-Science | 8b80e8f3e33b6fdc6672ecee1f27e0b983b28241 | [
"Apache-2.0"
] | 10 | 2018-09-23T02:45:45.000Z | 2022-03-12T15:32:05.000Z | import requests
databases = []
page = 1
while(page is not None):
payload = requests.get("https://www.quandl.com/api/v3/databases?api_key={}&page={}"\
.format(quandl.ApiConfig.api_key, page)).json()
databases += payload['databases']
page = payload['meta']['next_page']
| 33.333333 | 88 | 0.636667 | import requests
databases = []
page = 1
while(page is not None):
payload = requests.get("https://www.quandl.com/api/v3/databases?api_key={}&page={}"\
.format(quandl.ApiConfig.api_key, page)).json()
databases += payload['databases']
page = payload['meta']['next_page']
| true | true |
1c3e6f3666a6ca5f3a023941fb3c4c1b80494304 | 1,399 | py | Python | nuke_stubs/nuke/nuke_internal/scripts.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | 1 | 2022-01-12T01:29:16.000Z | 2022-01-12T01:29:16.000Z | nuke_stubs/nuke/nuke_internal/scripts.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | nuke_stubs/nuke/nuke_internal/scripts.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | """This module define the scriptSaveAndClear method for Nuke API.
nuke.scriptSaveAndClear will call nuke.scriptSave() if any changes were made and then calls nuke.scriptClear()
"""
import nuke_internal as nuke
def scriptSaveAndClear(filename=None, ignoreUnsavedChanges=False):
""" scriptSaveAndClear(filename=None, i... | 31.795455 | 110 | 0.706934 |
import nuke_internal as nuke
def scriptSaveAndClear(filename=None, ignoreUnsavedChanges=False):
root = nuke.Root()
if not ignoreUnsavedChanges and root is not None and root.modified() and len(root.nodes()) > 0:
runScriptSave = False
if filename is None:
scriptName = ''
try:
scriptNa... | true | true |
1c3e6f796d22ad4a6d1d7dcf66a8c3466bf58805 | 427 | py | Python | data/__init__.py | pishchalnikov/hacker-news-api-tests | 773b3dfbaaa4675fcebb1421ddb9d35ad0bfa65f | [
"MIT"
] | null | null | null | data/__init__.py | pishchalnikov/hacker-news-api-tests | 773b3dfbaaa4675fcebb1421ddb9d35ad0bfa65f | [
"MIT"
] | null | null | null | data/__init__.py | pishchalnikov/hacker-news-api-tests | 773b3dfbaaa4675fcebb1421ddb9d35ad0bfa65f | [
"MIT"
] | null | null | null | import os
import jsonref
class DataJsonReader(dict):
def __init__(self, file_name):
base_path = os.path.dirname(os.path.abspath(__file__))
json_path = os.path.join(base_path, file_name)
base_uri = f"file://{base_path}/"
with open(json_path) as input_file:
self.update(j... | 30.5 | 74 | 0.620609 | import os
import jsonref
class DataJsonReader(dict):
def __init__(self, file_name):
base_path = os.path.dirname(os.path.abspath(__file__))
json_path = os.path.join(base_path, file_name)
base_uri = f"file://{base_path}/"
with open(json_path) as input_file:
self.update(j... | true | true |
1c3e71024ceb589d01c4523ee29040d20dbbcdaf | 1,567 | py | Python | Trinket_Question_Block_Sound_Jewelry/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | Trinket_Question_Block_Sound_Jewelry/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | Trinket_Question_Block_Sound_Jewelry/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | # SPDX-FileCopyrightText: 2017 Limor Fried/ladyada for Adafruit Industries
# SPDX-FileCopyrightText: 2018 Mikey Sklar for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import simpleio
import pwmio
import digitalio
# PWM is not available on Trinket D1
vibration_pin = board.D1 # vibra... | 33.340426 | 74 | 0.668794 |
import time
import board
import simpleio
import pwmio
import digitalio
vibration_pin = board.D1 speaker_pin = board.D2 pwm_leds = board.D4
pwm = pwmio.PWMOut(pwm_leds, frequency=256, duty_cycle=50)
led_fade_delay = .001 led_fade_step = 1024
vpin = digitalio.DigitalInOut(vibration_pin)
v... | true | true |
1c3e71085a82468f1cdb29c08537996c0482b531 | 8,168 | py | Python | vericite_lms_client/models/report_meta_data.py | vericite/vericite_api_python | 1ffef5c7900c534c74b681254afe204260e0326c | [
"Apache-2.0"
] | null | null | null | vericite_lms_client/models/report_meta_data.py | vericite/vericite_api_python | 1ffef5c7900c534c74b681254afe204260e0326c | [
"Apache-2.0"
] | null | null | null | vericite_lms_client/models/report_meta_data.py | vericite/vericite_api_python | 1ffef5c7900c534c74b681254afe204260e0326c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
VeriCiteLmsApiV1
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Licens... | 28.659649 | 170 | 0.60835 |
from pprint import pformat
from six import iteritems
import re
class ReportMetaData(object):
def __init__(self, assignment_title=None, context_title=None, external_content_data=None, user_email=None, user_first_name=None, user_last_name=None, user_role=None):
self.swagger_types = {
'assignme... | true | true |
1c3e71189d4930286e5f0e16f6b38e6ad810cd26 | 7,674 | py | Python | tests/pytests/functional/states/test_win_certutil.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 1 | 2022-03-12T00:03:19.000Z | 2022-03-12T00:03:19.000Z | tests/pytests/functional/states/test_win_certutil.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:11:35.000Z | 2022-03-03T08:04:30.000Z | tests/pytests/functional/states/test_win_certutil.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | null | null | null | """
Tests for win_certutil state module
"""
import pytest
import salt.utils.files
pytestmark = [
pytest.mark.windows_whitelisted,
pytest.mark.skip_unless_on_windows,
]
@pytest.fixture(scope="module")
def certutil(states):
return states.certutil
@pytest.fixture(scope="module")
def certutil_mod(modules):... | 36.542857 | 84 | 0.681783 | import pytest
import salt.utils.files
pytestmark = [
pytest.mark.windows_whitelisted,
pytest.mark.skip_unless_on_windows,
]
@pytest.fixture(scope="module")
def certutil(states):
return states.certutil
@pytest.fixture(scope="module")
def certutil_mod(modules):
return modules.certutil
@pytest.fixtu... | true | true |
1c3e713af7c0116ccd04cf76d73556e884f2c1ce | 9,120 | py | Python | tests/test_data/test_personal.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | null | null | null | tests/test_data/test_personal.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | null | null | null | tests/test_data/test_personal.py | el/elizabeth | dc82cd9d2bb230acdb2f1a49bc16b1c3d12077ff | [
"MIT"
] | 1 | 2019-12-27T19:34:17.000Z | 2019-12-27T19:34:17.000Z | # -*- coding: utf-8 -*-
import re
from unittest import TestCase
from elizabeth import Personal
import elizabeth.core.interdata as common
from tests.test_data import DummyCase
from ._patterns import *
class PersonalBaseTest(TestCase):
def setUp(self):
self.personal = Personal()
def tearDown(self):
... | 34.285714 | 99 | 0.649561 |
import re
from unittest import TestCase
from elizabeth import Personal
import elizabeth.core.interdata as common
from tests.test_data import DummyCase
from ._patterns import *
class PersonalBaseTest(TestCase):
def setUp(self):
self.personal = Personal()
def tearDown(self):
del self.persona... | true | true |
1c3e7190f63670b6ac954e3ba27387d7957fe2ed | 7,366 | py | Python | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/set_/ipv6/next_vrf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/set_/ipv6/next_vrf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/set_/ipv6/next_vrf/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 59.403226 | 811 | 0.721423 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
1c3e71a10ea7e6e5d942f2a0f2035b00368692e9 | 925 | py | Python | setup.py | RollingStar/getnative | 7c30c882a37b07e54daa7bbddd9de63794d436ef | [
"MIT"
] | null | null | null | setup.py | RollingStar/getnative | 7c30c882a37b07e54daa7bbddd9de63794d436ef | [
"MIT"
] | null | null | null | setup.py | RollingStar/getnative | 7c30c882a37b07e54daa7bbddd9de63794d436ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_packages
with open("README.md") as fh:
long_description = fh.read()
with open("requirements.txt") as fh:
install_requires = fh.read()
setup(
name="getnative",
version='2.2.0',
description='Find the native resolution(s) of upscaled materia... | 28.90625 | 84 | 0.676757 |
from setuptools import setup, find_packages
with open("README.md") as fh:
long_description = fh.read()
with open("requirements.txt") as fh:
install_requires = fh.read()
setup(
name="getnative",
version='2.2.0',
description='Find the native resolution(s) of upscaled material (mostly anime)',
... | true | true |
1c3e74c023dfd36517727b4164044dbac99e87a4 | 983 | py | Python | MUNDO 3/ex113.py | athavus/Curso-em-video-Python-3 | a32be95adbccfcbe512a1ed30d3859141a230b5e | [
"MIT"
] | 1 | 2020-11-12T14:03:32.000Z | 2020-11-12T14:03:32.000Z | MUNDO 3/ex113.py | athavus/Curso-em-video-Python-3 | a32be95adbccfcbe512a1ed30d3859141a230b5e | [
"MIT"
] | null | null | null | MUNDO 3/ex113.py | athavus/Curso-em-video-Python-3 | a32be95adbccfcbe512a1ed30d3859141a230b5e | [
"MIT"
] | 1 | 2021-01-05T22:18:46.000Z | 2021-01-05T22:18:46.000Z | def leiaInt(msg):
while True:
try:
num = int(input(msg))
except (ValueError, TypeError):
print('\033[1;31mERRO! Por favor digite um número real válido.\033[m')
continue
except (KeyboardInterrupt):
print('\033[1;31mO Usuário resolveu não... | 30.71875 | 86 | 0.552391 | def leiaInt(msg):
while True:
try:
num = int(input(msg))
except (ValueError, TypeError):
print('\033[1;31mERRO! Por favor digite um número real válido.\033[m')
continue
except (KeyboardInterrupt):
print('\033[1;31mO Usuário resolveu não... | true | true |
1c3e74f1e2e6e4618e63c5d6c908d723ae6b7034 | 2,572 | py | Python | game/node.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | game/node.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | game/node.py | HexDecimal/7drl-2022 | 755949875cc11e288908eccaee102c7ca0e43777 | [
"CC0-1.0"
] | null | null | null | from __future__ import annotations
import logging
from typing import Any, Iterator, Optional, Set, Type, TypeVar
TNode = TypeVar("TNode", bound="Node")
logger = logging.getLogger(__name__)
class Node:
"""A mixin that allows instances to be organzied into a scene graph."""
def __init__(self, *, parent: Opt... | 32.974359 | 111 | 0.586703 | from __future__ import annotations
import logging
from typing import Any, Iterator, Optional, Set, Type, TypeVar
TNode = TypeVar("TNode", bound="Node")
logger = logging.getLogger(__name__)
class Node:
def __init__(self, *, parent: Optional[Node] = None) -> None:
super().__init__()
self._parent... | true | true |
1c3e750f020ac4a5d73c3160bb8c244aec04969a | 543 | py | Python | 08_run_wordcount.py | azmikamis/apache-beam-wordcount | be21156a8f5c1ca9b50f28cffe608589e8ce5383 | [
"MIT"
] | null | null | null | 08_run_wordcount.py | azmikamis/apache-beam-wordcount | be21156a8f5c1ca9b50f28cffe608589e8ce5383 | [
"MIT"
] | null | null | null | 08_run_wordcount.py | azmikamis/apache-beam-wordcount | be21156a8f5c1ca9b50f28cffe608589e8ce5383 | [
"MIT"
] | null | null | null | from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
from datetime import datetime
credentials = GoogleCredentials.get_application_default()
service = build('dataflow', 'v1b3', credentials=credentials)
request = service.projects().templates().launch(
projectId='PR... | 45.25 | 106 | 0.725599 | from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
from datetime import datetime
credentials = GoogleCredentials.get_application_default()
service = build('dataflow', 'v1b3', credentials=credentials)
request = service.projects().templates().launch(
projectId='PR... | true | true |
1c3e760e5296e1d4b6cedd5acd92fda6198682cd | 3,187 | py | Python | Assignment02/Part01/Graph_udemy.py | saurabhkakade21/AIS_spring2021 | 784d20670794c405505b09c1feea36e0a504ae5d | [
"MIT"
] | null | null | null | Assignment02/Part01/Graph_udemy.py | saurabhkakade21/AIS_spring2021 | 784d20670794c405505b09c1feea36e0a504ae5d | [
"MIT"
] | null | null | null | Assignment02/Part01/Graph_udemy.py | saurabhkakade21/AIS_spring2021 | 784d20670794c405505b09c1feea36e0a504ae5d | [
"MIT"
] | null | null | null | # Created by Elshad Karimov
# Copyright © 2021 AppMillers. All rights reserved.
class Graph:
def __init__(self, gdict=None):
if gdict is None:
gdict = {}
self.gdict = gdict
def addEdge(self, vertex, edge):
self.gdict[vertex].append(edge)
def bfs(self, vert... | 23.962406 | 72 | 0.503608 |
class Graph:
def __init__(self, gdict=None):
if gdict is None:
gdict = {}
self.gdict = gdict
def addEdge(self, vertex, edge):
self.gdict[vertex].append(edge)
def bfs(self, vertex):
visited = [vertex]
queue = [vertex]
while queue:
... | true | true |
1c3e767bdefa9d1ae404e50bbf6bc102d64b8573 | 4,263 | py | Python | adb-connect.py | remylavergne/ADB-Wi-Fi-Connect-GUI | de0a167534485a9ad1c172fe7e275f831e707e5f | [
"MIT"
] | 5 | 2020-03-21T00:15:13.000Z | 2021-12-10T07:59:20.000Z | adb-connect.py | remylavergne/ADB-Wi-Fi-Connect-GUI | de0a167534485a9ad1c172fe7e275f831e707e5f | [
"MIT"
] | null | null | null | adb-connect.py | remylavergne/ADB-Wi-Fi-Connect-GUI | de0a167534485a9ad1c172fe7e275f831e707e5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import sys
import time
from PySide2.QtWidgets import (QLineEdit, QPushButton, QApplication, QDialog, QLabel, QGridLayout)
class Form(QDialog):
def __init__(self, parent=None):
super(Form, self).__init__(parent)
self.setWindowTitle("ADB Wi-Fi Connect 0.2"... | 34.942623 | 100 | 0.571194 |
import subprocess
import sys
import time
from PySide2.QtWidgets import (QLineEdit, QPushButton, QApplication, QDialog, QLabel, QGridLayout)
class Form(QDialog):
def __init__(self, parent=None):
super(Form, self).__init__(parent)
self.setWindowTitle("ADB Wi-Fi Connect 0.2")
self.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.