hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f727c080bee1883b62b81efe7828d2d40ce4de8a | 375 | py | Python | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://app.codesignal.com/arcade/code-arcade/lab-of-transformations/vsKRjYKv4SCjzJc8r/
def higherVersion(ver1, ver2):
# Split by dots, convert individual elements to ints.
ver1 = [int(x) for x in ver1.split(".")]
ver2 = [int(x) for x in ver2.split(".")]
# This will do a comparison item-wise of all e... | 41.666667 | 89 | 0.696 |
def higherVersion(ver1, ver2):
ver1 = [int(x) for x in ver1.split(".")]
ver2 = [int(x) for x in ver2.split(".")]
return ver1 > ver2
| true | true |
f727c1a63c15749305645ffe5f2bcd064e0496d2 | 23,239 | py | Python | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | 4 | 2018-10-11T12:30:46.000Z | 2019-11-12T12:17:17.000Z | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | null | null | null | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | null | null | null | from lex import tsymbol_dict
from expression import *
from code_generate_table import *
from code_generate_utils import *
class CodeGenerator(object):
def __init__(self, tree):
self.tree = tree
self.base, self.offset, self.width = 1, 1, 1
self.TERMINAL, self.NONTERMINAL = 0, 1
self... | 36.887302 | 132 | 0.547399 | from lex import tsymbol_dict
from expression import *
from code_generate_table import *
from code_generate_utils import *
class CodeGenerator(object):
def __init__(self, tree):
self.tree = tree
self.base, self.offset, self.width = 1, 1, 1
self.TERMINAL, self.NONTERMINAL = 0, 1
self... | true | true |
f727c25e97bf1486886310c30e2304cba568c8b8 | 3,816 | py | Python | core/metrics/recall_k.py | overlordmax/PaddleRec | ddf6ec25b228ffde83e6592163d88c3ace9069f0 | [
"Apache-2.0"
] | 1 | 2020-09-29T01:14:22.000Z | 2020-09-29T01:14:22.000Z | core/metrics/recall_k.py | Qdriving/PaddleRec | b4d6ac77450d98a935c6a5d0eba6abbb21b9d06a | [
"Apache-2.0"
] | null | null | null | core/metrics/recall_k.py | Qdriving/PaddleRec | b4d6ac77450d98a935c6a5d0eba6abbb21b9d06a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 appli... | 36.692308 | 74 | 0.612945 |
import math
import numpy as np
import paddle.fluid as fluid
from paddlerec.core.metric import Metric
from paddle.fluid.layers import accuracy
from paddle.fluid.initializer import Constant
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.tensor import Variable
class RecallK(Me... | true | true |
f727c2bb12990251b7186d56d9373b097441a307 | 4,591 | py | Python | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 48.840426 | 245 | 0.648007 |
import oci
config = oci.config.from_file()
compartment_id = config["tenancy"]
identity = oci.identity.IdentityClient(config)
print('--------------------------------------------')
print('Eager load all results')
print('--------------------------------------------')
response = oci.pagination.list_call_ge... | true | true |
f727c3080a1e1cf10bc6a51628ccb3002fa6f009 | 6,213 | py | Python | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | import json
import logging
import urllib
from http.client import HTTPResponse
from ssl import SSLContext
from typing import Dict, Union, List, Optional
from urllib.error import HTTPError
from urllib.request import Request, urlopen, OpenerDirector, ProxyHandler, HTTPSHandler
from slack.errors import SlackRequestError
f... | 40.607843 | 124 | 0.584259 | import json
import logging
import urllib
from http.client import HTTPResponse
from ssl import SSLContext
from typing import Dict, Union, List, Optional
from urllib.error import HTTPError
from urllib.request import Request, urlopen, OpenerDirector, ProxyHandler, HTTPSHandler
from slack.errors import SlackRequestError
f... | true | true |
f727c35e7fd050c837120bd4cb292fd43c9f546f | 73 | py | Python | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
reverseWords = lambda str: ' '.join(str.split()[::-1])
| 18.25 | 54 | 0.589041 |
reverseWords = lambda str: ' '.join(str.split()[::-1])
| true | true |
f727c565e144343ffc38a97bdeaadb5f3c26c99d | 3,587 | py | Python | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | null | null | null | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 7 | 2018-09-05T10:53:44.000Z | 2022-03-08T09:36:14.000Z | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 8 | 2018-09-03T14:29:28.000Z | 2020-07-30T12:54:04.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 26.182482 | 85 | 0.647338 |
from sam_alignment_reconstructor.pairwise import pairwise_alignment
from sam_alignment_reconstructor.pairwise import cigar_split
from restui.lib.external import ensembl_sequence
from restui.lib.external import ensembl_protein
def fetch_pairwise(mapping):
pairwise_alignments = []
enst = mapping.transcript.e... | true | true |
f727c5f55aa71d5cb21714681206c4fac4c7f6bc | 762 | py | Python | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | from time import sleep
import logging
from dapr.clients import DaprClient
logging.basicConfig(level=logging.INFO)
DAPR_STORE_NAME = "statestore"
for i in range(1, 10):
orderId = str(i)
order = {'orderId': orderId}
with DaprClient() as client:
# Save state into the state store
client.save_... | 29.307692 | 68 | 0.670604 | from time import sleep
import logging
from dapr.clients import DaprClient
logging.basicConfig(level=logging.INFO)
DAPR_STORE_NAME = "statestore"
for i in range(1, 10):
orderId = str(i)
order = {'orderId': orderId}
with DaprClient() as client:
client.save_state(DAPR_STORE_NAME, orderId, s... | true | true |
f727c7c44cfc150a303ad06b4cd37d80fe4a6d31 | 3,598 | py | Python | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | """
Django settings for thomasdevri_es project.
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
impor... | 24.47619 | 91 | 0.663424 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('DJANGO_SECRET')
DEBUG = False
ALLOWED_HOSTS = [
'*'
]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'dja... | true | true |
f727c8673af3cda14875414f836d4092d8d30ac1 | 6,282 | py | Python | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from functools import reduce
import six
from .const import LABEL_CONTAINER_NUMBER
from .const import LABEL_SERVICE
class Container(object):
"""
Represents a Docker container, constructed from the output of
GET /containers/:i... | 28.554545 | 78 | 0.60554 | from __future__ import absolute_import
from __future__ import unicode_literals
from functools import reduce
import six
from .const import LABEL_CONTAINER_NUMBER
from .const import LABEL_SERVICE
class Container(object):
def __init__(self, client, dictionary, has_been_inspected=False):
self.client = clie... | true | true |
f727c89ca6002e8cedcf4b9d1b2de5100c7c9fad | 1,149 | py | Python | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | import pulsar as psr
def load_ref_system():
""" Returns beta-l-lyxopyranose as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 1.4299 0.2461 0.7896
O 0.4230 1.0739 1.3901
C ... | 41.035714 | 75 | 0.409051 | import pulsar as psr
def load_ref_system():
return psr.make_system("""
C 1.4299 0.2461 0.7896
O 0.4230 1.0739 1.3901
C -0.9416 0.6206 1.4010
C -1.3780 0.0314 0.0512
C -0.4016 -1.0958 -0.3576
O -... | true | true |
f727cb3319b78a06a0480e8cba138dfc007d6cb9 | 515 | py | Python | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | #######################################################
#
# ConnectHandler.py
# Python implementation of the Class ConnectHandler
# Generated by Enterprise Architect
# Created on: 29-Dec-2020 8:10:45 AM
# Original author: natha
#
#######################################################
from Catalog.Data.Federatio... | 27.105263 | 55 | 0.56699 | true | true | |
f727cb4f493f60788d46a5d0eb9211f2230cd556 | 3,947 | py | Python | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | import tensorflow as tf
from random import shuffle
import pandas as pd
import numpy as np
import imageio
import os
from detr_tf.data import processing
from detr_tf.data.transformation import detr_transform
from detr_tf import bbox
def morethan1(img, tbbox, tclass):
ret = False
print("morethan1 ", tbbox.shape... | 39.079208 | 174 | 0.7132 | import tensorflow as tf
from random import shuffle
import pandas as pd
import numpy as np
import imageio
import os
from detr_tf.data import processing
from detr_tf.data.transformation import detr_transform
from detr_tf import bbox
def morethan1(img, tbbox, tclass):
ret = False
print("morethan1 ", tbbox.shape... | true | true |
f727cbb2b75d40d5dda12a85631fd79800ebe553 | 3,639 | py | Python | docs/site/node_modules/js-datatable-1.1.0/minification.py | hargitomi97/sigstat | e4928fdbd8effa3b9bdf29929f1e7035ff9ccb1f | [
"MIT"
] | 1 | 2020-09-04T12:49:43.000Z | 2020-09-04T12:49:43.000Z | docs/site/node_modules/js-datatable-1.1.0/minification.py | hargitomi97/sigstat | e4928fdbd8effa3b9bdf29929f1e7035ff9ccb1f | [
"MIT"
] | null | null | null | docs/site/node_modules/js-datatable-1.1.0/minification.py | hargitomi97/sigstat | e4928fdbd8effa3b9bdf29929f1e7035ff9ccb1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
JS and CSS minification
============================
Author: Toni Heittola (toni.heittola@gmail.com)
This plugin will create dynamic datatable with charting features from given yaml-datafile.
"""
import os
import sys
import io
import argparse
import textwrap
from IPy... | 34.330189 | 120 | 0.592745 |
"""
JS and CSS minification
============================
Author: Toni Heittola (toni.heittola@gmail.com)
This plugin will create dynamic datatable with charting features from given yaml-datafile.
"""
import os
import sys
import io
import argparse
import textwrap
from IPython import embed
__version_info__ = ('0', '... | false | true |
f727cbca391bd911c82cd15a769a1235f13eebfd | 13,500 | py | Python | Simulation_Python/scenarios.py | tomAntoine/multi-UAV-simulator | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 22 | 2021-04-07T21:10:53.000Z | 2022-03-26T08:21:06.000Z | Simulation_Python/scenarios.py | alexMarFar/multi-UAV-simulator-1 | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 2 | 2021-04-12T06:23:50.000Z | 2021-05-20T04:33:35.000Z | Simulation_Python/scenarios.py | alexMarFar/multi-UAV-simulator-1 | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 4 | 2021-05-21T06:11:34.000Z | 2022-03-09T18:41:10.000Z | # -*- coding: utf-8 -*-
"""
author: John Bass
email: john.bobzwik@gmail.com
license: MIT
Please feel free to use and modify this, but keep the above information. Thanks!
adaptation
author: Tom Antoine and Alex Martinez
"""
import numpy as np
import matplotlib.pyplot as plt
import time
import cProfile
from trajectory i... | 56.25 | 199 | 0.669333 |
import numpy as np
import matplotlib.pyplot as plt
import time
import cProfile
from trajectory import Trajectory
from ctrl import Control
from quadFiles.quad import Quadcopter
from utils.windModel import Wind
import utils
import config
import mpl_toolkits.mplot3d.axes3d as p3
from matplotlib.legend import Legend
impor... | true | true |
f727cc1948a85ac6d72771c8c995e728612019c7 | 4,358 | py | Python | src/tequila/quantumchemistry/__init__.py | naomicurnow/tequila | 739a76222005558d348a428cf2ce7cb5dfe290de | [
"MIT"
] | 1 | 2021-01-11T18:40:47.000Z | 2021-01-11T18:40:47.000Z | src/tequila/quantumchemistry/__init__.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | src/tequila/quantumchemistry/__init__.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | import typing
from .qc_base import ParametersQC, QuantumChemistryBase
SUPPORTED_QCHEMISTRY_BACKENDS = ["base", "psi4"]
INSTALLED_QCHEMISTRY_BACKENDS = {"base": QuantumChemistryBase}
try:
from .psi4_interface import QuantumChemistryPsi4
INSTALLED_QCHEMISTRY_BACKENDS["psi4"] = QuantumChemistryPsi4
except Impo... | 37.568966 | 149 | 0.652593 | import typing
from .qc_base import ParametersQC, QuantumChemistryBase
SUPPORTED_QCHEMISTRY_BACKENDS = ["base", "psi4"]
INSTALLED_QCHEMISTRY_BACKENDS = {"base": QuantumChemistryBase}
try:
from .psi4_interface import QuantumChemistryPsi4
INSTALLED_QCHEMISTRY_BACKENDS["psi4"] = QuantumChemistryPsi4
except Impo... | true | true |
f727cd0adc9bd8230963be0b0db67ba35b37d18b | 2,254 | py | Python | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 5 | 2021-06-08T07:10:55.000Z | 2021-09-29T03:17:09.000Z | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 10 | 2020-04-02T01:58:11.000Z | 2021-04-19T02:13:29.000Z | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 4 | 2021-02-19T08:41:13.000Z | 2021-09-29T03:17:12.000Z | # coding: utf-8
"""
Harbor API
These APIs provide services for manipulating Harbor project.
OpenAPI spec version: 1.4.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_PATH"]... | 30.053333 | 245 | 0.712067 |
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_PATH"])
import unittest
import testutils
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.user_group import UserGroup
from swagger_client.models.configurations impor... | true | true |
f727ce30bcfff6735069c4eb270c2a0dffe87867 | 2,140 | py | Python | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | '''
Author: your name
Date: 2021-07-02 17:20:23
LastEditTime: 2021-07-08 16:28:05
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /genetic-drawing/2.py
'''
#coding:utf-8
import cv2
import math
import numpy as np
def dodgeNaive(image, mask):
# determine the shape of the input im... | 28.918919 | 64 | 0.614019 |
import cv2
import math
import numpy as np
def dodgeNaive(image, mask):
width, height = image.shape[:2]
blend = np.zeros((width, height), np.uint8)
for col in range(width):
for row in range(height):
if mask[col, row] == 255:
... | true | true |
f727cfe26e46b219012e5f007bb0788969651bf9 | 1,045 | py | Python | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-04-25 00:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredients'),
]
operations = [
migrations.CreateModel(
... | 36.034483 | 118 | 0.604785 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredients'),
]
operations = [
migrations.CreateModel(
name='Recipe',
fields=[
... | true | true |
f727d135c106864dba69965703e7f5f5144d703d | 1,168 | py | Python | tests/util/network.py | zcomputerwiz/gojiv2-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 2 | 2022-02-09T04:30:19.000Z | 2022-03-19T14:01:43.000Z | tests/util/network.py | zcomputerwiz/goji-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 1 | 2021-12-30T09:17:47.000Z | 2021-12-30T09:17:47.000Z | tests/util/network.py | zcomputerwiz/gojiv2-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 1 | 2022-03-15T08:42:52.000Z | 2022-03-15T08:42:52.000Z | import pytest
from goji.util.network import get_host_addr
class TestNetwork:
@pytest.mark.asyncio
async def test_get_host_addr4(self):
# Run these tests forcing IPv4 resolution
prefer_ipv6 = False
assert get_host_addr("127.0.0.1", prefer_ipv6) == "127.0.0.1"
assert get_host_add... | 44.923077 | 96 | 0.662671 | import pytest
from goji.util.network import get_host_addr
class TestNetwork:
@pytest.mark.asyncio
async def test_get_host_addr4(self):
prefer_ipv6 = False
assert get_host_addr("127.0.0.1", prefer_ipv6) == "127.0.0.1"
assert get_host_addr("10.11.12.13", prefer_ipv6) == "10.11.1... | true | true |
f727d1701f52f74bac125ca10ff531847da7e541 | 3,111 | py | Python | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | 1 | 2020-09-06T09:32:44.000Z | 2020-09-06T09:32:44.000Z | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | null | null | null | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | null | null | null | ######################################################################
#
# File: test_session.py
#
# Copyright 2018 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from b2.exception import InvalidAuthT... | 33.451613 | 160 | 0.608807 | true | true | |
f727d21a828f288a73ec9d141abf5a7e7130abba | 16,717 | py | Python | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A few checks to make sure the environment is sane
'''
from __future__ import absolute_import
# Original Author: Jeff Schroeder <jeffschroeder@computer.org>
# Import python libs
import os
import re
import sys
import stat
import errno
import socket
import logging
# Import third party libs
i... | 34.046843 | 83 | 0.562481 |
from __future__ import absolute_import
import os
import re
import sys
import stat
import errno
import socket
import logging
if sys.platform.startswith('win'):
import win32file
else:
import resource
from salt.log import is_console_configured
from salt.exceptions import SaltClientError
import salt.defaul... | true | true |
f727d2d7e7376be3e613532b9e1ea017af35747c | 1,794 | py | Python | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | 2 | 2020-12-01T09:41:54.000Z | 2020-12-13T14:10:19.000Z | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | import vaex
import vaex.ml
import tempfile
import vaex.ml.datasets
features = ['petal_length', 'petal_width', 'sepal_length', 'sepal_width']
def test_pca():
ds = vaex.ml.datasets.load_iris()
pca = vaex.ml.PCA(features=features, n_components=2)
pca.fit(ds)
ds1 = pca.transform(ds)
path = tempfile.m... | 27.181818 | 73 | 0.673356 | import vaex
import vaex.ml
import tempfile
import vaex.ml.datasets
features = ['petal_length', 'petal_width', 'sepal_length', 'sepal_width']
def test_pca():
ds = vaex.ml.datasets.load_iris()
pca = vaex.ml.PCA(features=features, n_components=2)
pca.fit(ds)
ds1 = pca.transform(ds)
path = tempfile.m... | true | true |
f727d359d96619c0985b1970043b681970bc7181 | 937 | py | Python | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 1 | 2017-10-03T14:40:09.000Z | 2017-10-03T14:40:09.000Z | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | null | null | null | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 2 | 2019-02-20T02:28:13.000Z | 2021-12-01T19:50:19.000Z | __version__ = '1.0'
__author__ = 'Zachary Nowak'
"""STANDARD LIBRARY IMPORTS"""
from statistics import *
def create_dict(tupleList,pressCharTimeLine,pressTimeLine,dataDict):
keyHistory = ""
timingList = [[] for i in range(len(tupleList))]
"""CREATE A STRING WITH ALL THE EVENTS"""
for char in pressCharTimeLine:
... | 30.225806 | 75 | 0.701174 | __version__ = '1.0'
__author__ = 'Zachary Nowak'
from statistics import *
def create_dict(tupleList,pressCharTimeLine,pressTimeLine,dataDict):
keyHistory = ""
timingList = [[] for i in range(len(tupleList))]
for char in pressCharTimeLine:
keyHistory += char
for string in tupleList:
i = 0
index = tupleLis... | true | true |
f727d3a4b3cb35b73b91afefa5df649fd90c9c96 | 1,670 | py | Python | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | foursquare/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 5 | 2015-01-28T14:32:27.000Z | 2020-03-23T03:01:34.000Z | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | caiocasado/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 1 | 2015-01-19T20:16:18.000Z | 2015-02-03T02:35:56.000Z | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | caiocasado/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 6 | 2015-01-09T21:05:16.000Z | 2020-10-29T09:53:14.000Z | # coding=utf-8
# Copyright 2011 Foursquare Labs Inc. All Rights Reserved
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import unittest
from foursquare.source_code_analysis.scala.scala_unused_import_remover impor... | 14.910714 | 102 | 0.697006 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import unittest
from foursquare.source_code_analysis.scala.scala_unused_import_remover import ScalaUnusedImportRemover
class ScalaUnusedImportRemoverTest(unittes... | true | true |
f727d3d70ff583c6743d4843417bbc2ecf9584ca | 4,770 | py | Python | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | wusirs/learn_python3_spider | a3301f8112e4ded25c3578162db8c6a263a0693b | [
"MIT"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 44 | 2019-05-27T10:59:29.000Z | 2022-03-31T14:14:29.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for positioning sentences.
"""
from __future__ import absolute_import, division
import itertools
from twisted.positioning import _sentence
from twisted.trial.unittest import TestCase
sentinelValueOne = "someStringValue"
sentinelValue... | 30 | 78 | 0.674843 |
from __future__ import absolute_import, division
import itertools
from twisted.positioning import _sentence
from twisted.trial.unittest import TestCase
sentinelValueOne = "someStringValue"
sentinelValueTwo = "someOtherStringValue"
class DummyProtocol(object):
@staticmethod
def getSentenceAttributes():... | true | true |
f727d41d6e60219428f3f297b23ca0f713529146 | 6,573 | py | Python | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | # Listing_22-8.py
# Copyright Warren & Csrter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Hangman game using PyQt
import sys
from PyQt4 import QtCore, QtGui, uic
import random
form_class = uic.loadUiType("... | 54.775 | 138 | 0.386125 |
import sys
from PyQt4 import QtCore, QtGui, uic
import random
form_class = uic.loadUiType("hangman.ui")[0]
def find_letters(letter, a_string):
locations = []
start = 0 ... | true | true |
f727d4361a24d0843a7fbc97eb2728198e8f07f6 | 1,923 | py | Python | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 881 | 2018-02-06T18:20:34.000Z | 2022-03-29T13:18:12.000Z | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 48 | 2018-02-13T21:31:24.000Z | 2021-07-03T13:35:21.000Z | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 224 | 2018-02-07T04:48:31.000Z | 2022-03-18T12:26:25.000Z | from abc import abstractmethod
from utils.utils import init_sess
class Gan:
def __init__(self):
self.oracle = None
self.generator = None
self.discriminator = None
self.gen_data_loader = None
self.dis_data_loader = None
self.oracle_data_loader = None
self.se... | 24.653846 | 81 | 0.583983 | from abc import abstractmethod
from utils.utils import init_sess
class Gan:
def __init__(self):
self.oracle = None
self.generator = None
self.discriminator = None
self.gen_data_loader = None
self.dis_data_loader = None
self.oracle_data_loader = None
self.se... | true | true |
f727d4b7735acda30dc72a1387415a5e055bed03 | 3,028 | py | Python | caillprocess_temp_pickledlist.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null | caillprocess_temp_pickledlist.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null | caillprocess_temp_pickledlist.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null |
import time, copy
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from scipy import optimize
from echem_plate_ui import *
from echem_plate_math import *
import pickle
p='C:/Users/Gregoire/Documents/CaltechWork/echemdrop/2012-9_FeCoNiTi/results/2012-9FeCoNiTi_500C_CAill_... | 29.686275 | 129 | 0.6714 |
import time, copy
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from scipy import optimize
from echem_plate_ui import *
from echem_plate_math import *
import pickle
p='C:/Users/Gregoire/Documents/CaltechWork/echemdrop/2012-9_FeCoNiTi/results/2012-9FeCoNiTi_500C_CAill_... | false | true |
f727d50e8dc0e67cf07b6f0c64f482507f96fdd0 | 1,306 | py | Python | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 4 | 2019-10-29T22:49:54.000Z | 2020-02-17T06:14:07.000Z | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 16 | 2019-11-25T02:39:18.000Z | 2022-02-10T13:28:22.000Z | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 1 | 2020-02-17T06:14:08.000Z | 2020-02-17T06:14:08.000Z | # chat/consumers.py
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'chat_%s' % self.room_name
# Join room g... | 28.391304 | 71 | 0.607198 |
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'chat_%s' % self.room_name
await self.channel_laye... | true | true |
f727d5d867163c130092b8569593782b91841822 | 716 | py | Python | robustness/CLEVER/cal_clever.py | asplos2020/DRTest | c3de497142d9b226e518a1a0f95f7350d2f7acd6 | [
"MIT"
] | 1 | 2021-04-01T07:31:17.000Z | 2021-04-01T07:31:17.000Z | robustness/CLEVER/cal_clever.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | null | null | null | robustness/CLEVER/cal_clever.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | 1 | 2020-12-24T12:12:54.000Z | 2020-12-24T12:12:54.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
clever.py
Compute CLEVER score using collected Lipschitz constants
Copyright (C) 2017-2018, IBM Corp.
Copyright (C) 2017, Lily Weng <twweng@mit.edu>
and Huan Zhang <ecezhang@ucdavis.edu>
This program is licenced under the Apache 2.0 licence,
contain... | 26.518519 | 132 | 0.717877 |
from clever import clever_score
dataset='mnist'
models=['vgg13']
attacks=['oritest']
istarget='target'
for model in models:
for attack in attacks:
clever_score(data_folder='lipschitz_mat/'+istarget+'/'+dataset+'/'+model+'/'+attack+'/'+dataset+'_'+model, untargeted=False)
| true | true |
f727d699f5a615818259e65a2e917920aa02c900 | 6,699 | py | Python | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | from types import SimpleNamespace
class Segment_Tree:
'''
A Class used to get partial sum of an array and update data
...
Attributes
----------
array : list
a list which to make a segment tree
Methods
-------
init(tree, start, end, node)
make segment t... | 35.632979 | 135 | 0.526198 | from types import SimpleNamespace
class Segment_Tree:
def __init__(self, array):
self.array = array
self.tree = [SimpleNamespace(value=0, lazy=0) for _ in range(len(self.array) * 4)]
self.init(self.tree, 0, len(self.array)-1, 1)
self.last_index = len(array)-1
def ini... | true | true |
f727d6b9303a121e5f44d4ef4deb26145ae90ae4 | 1,154 | py | Python | single_comment.py | zhao123minghao/sentiment | c534496afa452785e87fedc09e4abb3625673f86 | [
"BSD-2-Clause"
] | null | null | null | single_comment.py | zhao123minghao/sentiment | c534496afa452785e87fedc09e4abb3625673f86 | [
"BSD-2-Clause"
] | null | null | null | single_comment.py | zhao123minghao/sentiment | c534496afa452785e87fedc09e4abb3625673f86 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import sp
import pp
import fp
import step2
import ts
def sensplit(_src):
return pp.sensplit(_src,pp.sendivs)
argv = sys.argv
if(len(argv) < 2):
print 'we need an arguement'
sys.exit(0)
filename = argv[1]
if(not os.path.isfile(filename)):
... | 18.612903 | 50 | 0.60312 |
import sys
import os
import sp
import pp
import fp
import step2
import ts
def sensplit(_src):
return pp.sensplit(_src,pp.sendivs)
argv = sys.argv
if(len(argv) < 2):
print 'we need an arguement'
sys.exit(0)
filename = argv[1]
if(not os.path.isfile(filename)):
print '\t\ttest file don\'t exist'
s... | false | true |
f727d70b1803aaf3658f028f09b317b8765886e1 | 1,110 | py | Python | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 68 | 2019-03-21T13:39:01.000Z | 2022-01-22T13:53:43.000Z | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 3 | 2019-03-18T13:29:45.000Z | 2021-08-04T11:13:23.000Z | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 23 | 2020-01-14T10:05:03.000Z | 2021-12-08T03:43:10.000Z | from typing import Union
from pandas import Series
from datatypes.AbstractAttribute import AbstractAttribute
from datatypes.utils.DataType import DataType
class IntegerAttribute(AbstractAttribute):
def __init__(self, name: str, is_candidate_key, is_categorical, histogram_size: Union[int, str], data: Series):
... | 37 | 115 | 0.741441 | from typing import Union
from pandas import Series
from datatypes.AbstractAttribute import AbstractAttribute
from datatypes.utils.DataType import DataType
class IntegerAttribute(AbstractAttribute):
def __init__(self, name: str, is_candidate_key, is_categorical, histogram_size: Union[int, str], data: Series):
... | true | true |
f727d812d6c4a543c146cb1e1a5fbdc9a8873c15 | 45,449 | py | Python | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 36.388311 | 81 | 0.650685 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import os
import time
from absl import logging
import cloudpickle as pickle
import gin
import gym
from jax import grad
from jax import jit
from jax import la... | true | true |
f727db28729a6cb29c683b37edffca2af1fdd1c2 | 6,875 | py | Python | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import contextlib
import logging
import os
impo... | 36.184211 | 80 | 0.652945 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import contextlib
import logging
import os
import subprocess
import sys
import time
def _AddToPathIfNeeded(path):
if path not in sys.path:
sys.path.insert(0, path)
@contextlib.contextmanager
def C... | true | true |
f727dba422b880a9a9bc67a389966d3ac11e1460 | 463 | py | Python | econml/tree/__init__.py | lwschm/EconML | 6e7b107e1f8a7a5922489eb81143db8656ff01af | [
"BSD-3-Clause"
] | 1 | 2021-02-08T22:58:39.000Z | 2021-02-08T22:58:39.000Z | econml/tree/__init__.py | Jimmy-INL/EconML | 3e66b9507b43f8af291009d26186283fa4bb4ced | [
"BSD-3-Clause"
] | null | null | null | econml/tree/__init__.py | Jimmy-INL/EconML | 3e66b9507b43f8af291009d26186283fa4bb4ced | [
"BSD-3-Clause"
] | 1 | 2021-08-20T09:06:42.000Z | 2021-08-20T09:06:42.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from ._criterion import Criterion, RegressionCriterion, MSE
from ._splitter import Splitter, BestSplitter
from ._tree import DepthFirstTreeBuilder
from ._tree import Tree
__all__ = ["Tree",
"Splitter",
... | 28.9375 | 60 | 0.650108 |
from ._criterion import Criterion, RegressionCriterion, MSE
from ._splitter import Splitter, BestSplitter
from ._tree import DepthFirstTreeBuilder
from ._tree import Tree
__all__ = ["Tree",
"Splitter",
"BestSplitter",
"DepthFirstTreeBuilder",
"Criterion",
... | true | true |
f727dd0ea24c6f6c7eef4fa81bae3e2d89fcaac3 | 3,250 | py | Python | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | null | null | null | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | null | null | null | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | 2 | 2020-04-30T18:47:05.000Z | 2021-05-24T15:07:41.000Z | import nltk
import csv
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dInfoMoney = 'C:/Users/vitor/Documents/GetDataset/Infomoney/'
dInvesting = 'C:/Users/vitor/Documents/GetDataset/Investing.com/'
dTrad... | 33.505155 | 114 | 0.641538 | import nltk
import csv
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dInfoMoney = 'C:/Users/vitor/Documents/GetDataset/Infomoney/'
dInvesting = 'C:/Users/vitor/Documents/GetDataset/Investing.com/'
dTrad... | true | true |
f727dd3b7d4b012d0f7dec1bce4d8082d376ec1c | 295,763 | py | Python | kubernetes/client/apis/apps_v1beta1_api.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/apis/apps_v1beta1_api.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2021-04-30T20:41:19.000Z | 2021-04-30T20:41:19.000Z | venv/lib/python2.7/site-packages/kubernetes/client/apis/apps_v1beta1_api.py | 784134748/kubernetes-install | 5df59632c2619632e422948b667fb68eab9ff5be | [
"MIT"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
i... | 64.661784 | 1,390 | 0.651883 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..api_client import ApiClient
class AppsV1beta1Api(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
... | true | true |
f727dd8d7d3f08eb3d6179104991040375e54f90 | 5,354 | py | Python | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 2 | 2021-10-31T01:04:26.000Z | 2021-11-08T09:43:30.000Z | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 20 | 2020-12-19T22:32:23.000Z | 2022-02-01T01:07:06.000Z | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 2 | 2016-11-10T16:29:26.000Z | 2019-05-20T12:23:35.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.367647 | 92 | 0.649234 |
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import ServiceOffering, DiskOffering, Account, VirtualMachine,\
queryAsyncJobResult, PASS
from marvin.lib.common import get_domain, get_z... | true | true |
f727ddec1d4bf396d3560c014f5899414eb5618e | 180 | py | Python | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 3 | 2020-05-25T19:36:11.000Z | 2021-09-15T09:05:57.000Z | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 1 | 2021-04-30T21:11:44.000Z | 2021-04-30T21:11:44.000Z | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify
main_bp = Blueprint('main', __name__)
@main_bp.route('/')
def api_home():
return jsonify({"message": "Welcome to the Student Hub API"})
| 20 | 65 | 0.705556 | from flask import Blueprint, jsonify
main_bp = Blueprint('main', __name__)
@main_bp.route('/')
def api_home():
return jsonify({"message": "Welcome to the Student Hub API"})
| true | true |
f727e110b2656c38f2c08d157ab83662cd7bb00d | 3,506 | py | Python | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 34.372549 | 74 | 0.666572 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import instance_parser
from absl.testing import absltest
_TESTCASE_PATH = os.path.join('.', 'tests', 'fake_instances')
class ParserTest(absltest.TestCase):
def testInstanceValidat... | true | true |
f727e15a3cb3d79ce95f8fecbf0b1a12b57e08b8 | 1,268 | py | Python | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views.generic.detail import DetailView
from .models import Fly,Airport
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required(login_url='/login/'... | 31.7 | 141 | 0.689274 | from django.shortcuts import render, redirect
from django.views.generic.detail import DetailView
from .models import Fly,Airport
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.decorators import login_required
@login_required(login_url='/login/')
def selection_airport(r... | true | true |
f727e2c8e1a28f98877f1994152992973984a11f | 879 | py | Python | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from django.urls import reverse
from core.models import (Authorable,
Titleable,
TimeStampedModel)
class Recipe(Authorable, Titleable, TimeStampedModel):
"""
Recipe model as of v.1.0.
"""
CATEGORY = (
(... | 28.354839 | 79 | 0.633675 | import uuid
from django.db import models
from django.urls import reverse
from core.models import (Authorable,
Titleable,
TimeStampedModel)
class Recipe(Authorable, Titleable, TimeStampedModel):
CATEGORY = (
('WS', 'Western'),
('TB', 'Tibetan'),
... | true | true |
f727e34363c19a7e7e17351055f27d2efc065ca3 | 1,932 | py | Python | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 3 | 2022-03-03T19:10:25.000Z | 2022-03-03T19:57:15.000Z | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 9 | 2022-03-03T18:56:37.000Z | 2022-03-29T18:34:02.000Z | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 1 | 2022-03-04T11:59:11.000Z | 2022-03-04T11:59:11.000Z | from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... | 49.538462 | 137 | 0.710145 | from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... | true | true |
f727e3458cf9ec525e06fec4d8066046877248f1 | 5,378 | py | Python | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | null | null | null | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | null | null | null | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | 1 | 2022-01-15T04:39:30.000Z | 2022-01-15T04:39:30.000Z | """
##############################################################################
#
# Select top N distinct motifs with highest (statistically significant)
# activity Z-score (for every site separately)
#
# AUTHOR: Maciej_Bak
# AFFILIATION: University_of_Basel
# AFFILIATION: Swiss_Institute_of_Bioinformatics... | 30.556818 | 86 | 0.554481 |
import time
import logging
import logging.handlers
from argparse import ArgumentParser, RawTextHelpFormatter
import os
import pandas as pd
def parse_arguments():
parser = ArgumentParser(description=__doc__, formatter_class=RawTextHelpFormatter)
parser.add_argument(
"-v",
"--verbosity",
... | true | true |
f727e3880049704ad4f93c71f9dada6ffc47feb8 | 1,530 | py | Python | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import sys
from twython import Twython
import numpy as np
apiKey = '...'
apiSecret = '...'
accessToken = '...'
accessTokenSecret = '...'
#BeautifulSoup scraping algorythm
url = 'https://coinmarketcap.com'
soup = BeautifulSoup(requests.get(url).text, ... | 26.37931 | 138 | 0.62549 |
import requests
from bs4 import BeautifulSoup
import sys
from twython import Twython
import numpy as np
apiKey = '...'
apiSecret = '...'
accessToken = '...'
accessTokenSecret = '...'
url = 'https://coinmarketcap.com'
soup = BeautifulSoup(requests.get(url).text, 'lxml')
L=[]
F=0
for tr in soup.select('#currencies ... | true | true |
f727e3d280dbac1f16c6fe5d8782bb4bd6564767 | 59,646 | py | Python | allennlp/nn/util.py | threefoldo/allennlp | 983db284cb46fd18c898dd3b0e04eed6cb932768 | [
"Apache-2.0"
] | 3 | 2019-06-17T21:09:07.000Z | 2022-03-18T05:19:31.000Z | allennlp/nn/util.py | alisdairv/allennlp | 9fcc79566cc148cce9f967a7962ac03bc300f011 | [
"Apache-2.0"
] | null | null | null | allennlp/nn/util.py | alisdairv/allennlp | 9fcc79566cc148cce9f967a7962ac03bc300f011 | [
"Apache-2.0"
] | 1 | 2020-03-12T06:53:53.000Z | 2020-03-12T06:53:53.000Z | """
Assorted utilities for working with neural networks in AllenNLP.
"""
# pylint: disable=too-many-lines
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar
import logging
import math
import warnings
import torch
from allennlp.common.checks import ConfigurationE... | 46.634871 | 130 | 0.669349 |
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar
import logging
import math
import warnings
import torch
from allennlp.common.checks import ConfigurationError
logger = logging.getLogger(__name__)
T = TypeVar('T')
def has_tensor(obj) -> bool:
if isin... | true | true |
f727e5f78b42c3a1e0eaf2ad37a23824a5767c53 | 828 | py | Python | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | null | null | null | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | null | null | null | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | 1 | 2021-11-12T18:49:15.000Z | 2021-11-12T18:49:15.000Z | #!/usr/bin/python
import subprocess
try:
from subprocess import DEVNULL # py3k
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
version_path = "version.txt"
build_type = "rc"
with open(version_path, "r") as f:
version = f.readline()
build_number = 0
tag = "{0}-{1}.{2}".format(versio... | 28.551724 | 107 | 0.704106 |
import subprocess
try:
from subprocess import DEVNULL
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
version_path = "version.txt"
build_type = "rc"
with open(version_path, "r") as f:
version = f.readline()
build_number = 0
tag = "{0}-{1}.{2}".format(version, build_type, build_nu... | true | true |
f727e839bc9f60bee5264f963b12f7ba8265d8ef | 6,935 | py | Python | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | import logging
import re
from PyCRC.CRC16 import CRC16
from dsmr_parser.objects import MBusObject, CosemObject
from dsmr_parser.exceptions import ParseContentError, InvalidChecksumError, NoChecksumError
logger = logging.getLogger(__name__)
class TelegramParser(object):
def __init__(self, telegram_specificatio... | 31.098655 | 92 | 0.617159 | import logging
import re
from PyCRC.CRC16 import CRC16
from dsmr_parser.objects import MBusObject, CosemObject
from dsmr_parser.exceptions import ParseContentError, InvalidChecksumError, NoChecksumError
logger = logging.getLogger(__name__)
class TelegramParser(object):
def __init__(self, telegram_specificatio... | true | true |
f727e89ef20c8fb9be92012ad38858b527ba3813 | 579 | py | Python | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | discord_extensions = (
"core.controllers.discord.delete",
"core.controllers.discord.join",
"core.controllers.discord.leave",
"core.controllers.discord.logout",
"core.controllers.discord.ping",
"core.controllers.discord.tts",
"core.controllers.discord.poll",
"core.controllers.discord.roul... | 34.058824 | 43 | 0.721934 | discord_extensions = (
"core.controllers.discord.delete",
"core.controllers.discord.join",
"core.controllers.discord.leave",
"core.controllers.discord.logout",
"core.controllers.discord.ping",
"core.controllers.discord.tts",
"core.controllers.discord.poll",
"core.controllers.discord.roul... | true | true |
f727e976fa0a94180dd9383f9dc5be94b4aa493a | 8,537 | py | Python | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | """
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.mod... | 44.463542 | 130 | 0.660536 |
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.model import preprocess_true_boxes, yolo_body, tiny_yolo_bo... | true | true |
f727ea71d77bc5a71cddd8eb8f7f9da14738cd39 | 165 | py | Python | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 10 | 2020-08-25T09:23:02.000Z | 2021-01-12T14:00:35.000Z | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 140 | 2020-06-30T11:59:47.000Z | 2021-08-23T20:58:43.000Z | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | null | null | null | from .anomalies import AnomalyABC
from .labeler import AnomalySetLabeler
from .anomaly_generator import AnomalyGenerator
from .config import AnomalyGeneratorTemplate | 41.25 | 47 | 0.884848 | from .anomalies import AnomalyABC
from .labeler import AnomalySetLabeler
from .anomaly_generator import AnomalyGenerator
from .config import AnomalyGeneratorTemplate | true | true |
f727eacf052868602d35b1841a9c93d769a8fe24 | 4,382 | py | Python | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Dict
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
import syft as sy
# relative
from ..... import lib
from .....proto.core.node.common.action.get_enum_attribute_pb2 import (
... | 38.104348 | 95 | 0.689411 |
from typing import Dict
from typing import Optional
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
import syft as sy
from ..... import lib
from .....proto.core.node.common.action.get_enum_attribute_pb2 import (
GetEnumAttributeAction as GetEnumAttribute... | true | true |
f727ec286ffb28b7cbdb0a43ec55f52b2d947849 | 496 | py | Python | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | 2 | 2019-10-20T05:40:51.000Z | 2019-10-31T17:26:27.000Z | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | null | null | null | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import glob
##
from distutils.core import setup
import py2exe
assert py2exe != None
##
osp=os.path
windows = [
{
"script": "btn.py",
"icon_resources": [(1, "gui.ico")],
}
]
options = {
"py2exe": {
"includes": ["PyQt4", "sip"],
... | 16 | 43 | 0.528226 |
import os
import glob
from distutils.core import setup
import py2exe
assert py2exe != None
osp=os.path
windows = [
{
"script": "btn.py",
"icon_resources": [(1, "gui.ico")],
}
]
options = {
"py2exe": {
"includes": ["PyQt4", "sip"],
"dll_excludes": ["MSVCP90.dll"],
"... | true | true |
f727ecacbdc8f8fdc864e9a7692a7f8384a45b5b | 763 | py | Python | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class SignUpForm(UserCreationForm):
"""Custom signup form with additional fields."""
first_name = forms.CharField(max_length=50, required=False,
help_te... | 40.157895 | 92 | 0.646134 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class SignUpForm(UserCreationForm):
first_name = forms.CharField(max_length=50, required=False,
help_text='Optional. 50 characters or fewer.')
last_name... | true | true |
f727ed1dd0b38515ab9c60f47bb34d9f08bb15ec | 253 | py | Python | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | 4 | 2017-12-27T08:00:57.000Z | 2020-07-12T08:32:58.000Z | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | null | null | null | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
import motion_detector
if __name__ == "__main__":
while True:
if motion_detector.motion_detect():
print("Somebody is closing")
else:
print("Nobody")
time.sleep(1)
| 18.071429 | 43 | 0.596838 |
import time
import motion_detector
if __name__ == "__main__":
while True:
if motion_detector.motion_detect():
print("Somebody is closing")
else:
print("Nobody")
time.sleep(1)
| true | true |
f727ed746f16c529677c000a761dd7cf38da957f | 8,929 | py | Python | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... | 28.527157 | 206 | 0.652593 |
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
st.set_page_config(
page_title='Code Compendium Intro Page',
layout="wide"
)
def img_to_bytes(img_path):
img_bytes = Path(img_path).read_bytes()
encoded = base64.b64encode(img_bytes).decode()
... | true | true |
f727ee1e7b53a6244678c9e08fe4eea5eec42c76 | 509 | py | Python | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | 1 | 2017-09-05T08:09:47.000Z | 2017-09-05T08:09:47.000Z | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | null | null | null | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | 3 | 2017-09-24T03:13:19.000Z | 2018-08-12T07:44:38.000Z | from waldur_core.core import WaldurExtension
class PlaybookJobsExtension(WaldurExtension):
class Settings:
WALDUR_PLAYBOOK_JOBS = {
'PLAYBOOKS_DIR_NAME': 'ansible_playbooks',
'PLAYBOOK_ICON_SIZE': (64, 64),
}
@staticmethod
def django_app():
return 'waldur_a... | 22.130435 | 54 | 0.650295 | from waldur_core.core import WaldurExtension
class PlaybookJobsExtension(WaldurExtension):
class Settings:
WALDUR_PLAYBOOK_JOBS = {
'PLAYBOOKS_DIR_NAME': 'ansible_playbooks',
'PLAYBOOK_ICON_SIZE': (64, 64),
}
@staticmethod
def django_app():
return 'waldur_a... | true | true |
f727eea3db865e0f61cecbb74cf9356d9badf3b1 | 558 | py | Python | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 3 | 2017-09-18T18:02:42.000Z | 2021-05-19T06:47:46.000Z | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 1 | 2021-05-19T01:49:04.000Z | 2021-05-19T01:49:04.000Z | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 5 | 2017-07-13T11:31:38.000Z | 2021-05-19T01:12:47.000Z | """
PythonAEM error, contains a message and PythonAEM Result object
"""
class Error(RuntimeError):
"""
PythonAEM error, contains a message and PythonAEM Result object
useful for debugging the result and response when an error occurs
"""
def __init__(self, message, result):
"""
Ini... | 24.26087 | 69 | 0.636201 |
class Error(RuntimeError):
def __init__(self, message, result):
super().__init__()
self.message = message
self.result = result
| true | true |
f727eee784d7ad52a67a2cd8eda72f4b1d6284ef | 407 | py | Python | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-25 10:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('run', '0014_run_duration'),
]
operations = [
migrations.AlterField(
model_name='run',
name='pipeline_command',
... | 21.421053 | 74 | 0.604423 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('run', '0014_run_duration'),
]
operations = [
migrations.AlterField(
model_name='run',
name='pipeline_command',
field=models.CharField(blank=True, max_l... | true | true |
f727ef6eba35c3692bfb36895da54e014a64bb23 | 5,955 | py | Python | Footsites/Footlocker/FootlockerAUMonitor.py | CaioAugustoo/Sneaker-Monitors | b65dbcf549727112dae7b3ed3861a86c7d53dd8a | [
"MIT"
] | 1 | 2021-09-08T16:11:31.000Z | 2021-09-08T16:11:31.000Z | Footsites/Footlocker/FootlockerAUMonitor.py | CaioAugustoo/Sneaker-Monitors | b65dbcf549727112dae7b3ed3861a86c7d53dd8a | [
"MIT"
] | null | null | null | Footsites/Footlocker/FootlockerAUMonitor.py | CaioAugustoo/Sneaker-Monitors | b65dbcf549727112dae7b3ed3861a86c7d53dd8a | [
"MIT"
] | 1 | 2022-02-22T11:42:52.000Z | 2022-02-22T11:42:52.000Z | # No restocks, only releases
import requests
from datetime import datetime
import json
from bs4 import BeautifulSoup
import urllib3
import time
import logging
import dotenv
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, HardwareType
from fp.fp import FreeProxy
log... | 32.71978 | 131 | 0.580688 |
import requests
from datetime import datetime
import json
from bs4 import BeautifulSoup
import urllib3
import time
import logging
import dotenv
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, HardwareType
from fp.fp import FreeProxy
logging.basicConfig(filename='F... | false | true |
f727f0ca02c8ddd7cc426b246a89148e585b2b62 | 1,181 | py | Python | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#
# run iperf to measure the effective throughput between two nodes when
# n nodes are connected to a virtual wlan; run test for testsec
# and repeat for minnodes <= n <= maxnodes with a step size of
# nodestep
from core import load_logging_config
from core.emulator.emudata import IpPrefixes
from core... | 29.525 | 84 | 0.731583 |
from core import load_logging_config
from core.emulator.emudata import IpPrefixes
from core.enumerations import NodeTypes, EventTypes
load_logging_config()
def example(nodes):
prefixes = IpPrefixes("10.83.0.0/16")
coreemu = globals()["coreemu"]
session = coreemu.create_session()
... | true | true |
f727f10e73f0dd4907a634b339ec124db37c3bc9 | 20,980 | py | Python | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | """
Generates a wheel (.whl) file from the output of makepanda.
Since the wheel requires special linking, this will only work if compiled with
the `--wheel` parameter.
Please keep this file work with Panda3D 1.9 until that reaches EOL.
"""
from __future__ import print_function, unicode_literals
from distutils.util im... | 35.863248 | 153 | 0.60715 | from __future__ import print_function, unicode_literals
from distutils.util import get_platform
import json
import sys
import os
from os.path import join
import shutil
import zipfile
import hashlib
import tempfile
import subprocess
from distutils.sysconfig import get_config_var
from optparse import OptionParser
from m... | true | true |
f727f2af04e77662cb1b105b6ea82138d5057c4d | 435 | py | Python | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | 1 | 2021-04-28T05:40:59.000Z | 2021-04-28T05:40:59.000Z | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | null | null | null | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
z = np.arange(-7, 7, 0.01)
phi_z = sigmoid(z)
plt.plot(z, phi_z)
plt.axvline(0.0, color = 'k')
plt.axhspan(0.0, 1.0, facecolor = '1.0', alpha = 1.0, ls = 'dotted')
plt.axhline(0.5, ls = 'dotted... | 20.714286 | 68 | 0.602299 |
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
z = np.arange(-7, 7, 0.01)
phi_z = sigmoid(z)
plt.plot(z, phi_z)
plt.axvline(0.0, color = 'k')
plt.axhspan(0.0, 1.0, facecolor = '1.0', alpha = 1.0, ls = 'dotted')
plt.axhline(0.5, ls = 'dotted', color = 'k')
pl... | true | true |
f727f32f70eef26c04e670bca0235c128dc1f09b | 11,477 | py | Python | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | # Name: test_decoder.py
# Since: April 13th, 2020
# Author: Christen Ford
# Purpose: Implementes unit tests for simplejson.decoder.
from unittest import TestCase
import simplejson.decoder as decoder
import simplejson.errors as errors
class TestDecoder(TestCase):
"""Implements a set of unit tests for the simplej... | 26.87822 | 83 | 0.544393 |
from unittest import TestCase
import simplejson.decoder as decoder
import simplejson.errors as errors
class TestDecoder(TestCase):
def test_scanstring_correct(self):
test_input = '"{"abc": 0, "def": 1, "ghi": 2}"'
decoded_str, last_char_index = decoder.py_scanstring(
s=test_inpu... | true | true |
f727f373f944a10554dfcea5975a2aeb12ec2e24 | 21,937 | py | Python | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 1 | 2021-12-22T04:14:08.000Z | 2021-12-22T04:14:08.000Z | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 16 | 2020-01-28T22:49:47.000Z | 2022-03-11T23:51:24.000Z | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 1 | 2020-09-30T15:14:19.000Z | 2020-09-30T15:14:19.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import rospkg
import threading
import yaml
from copy import deepcopy
import message_filters
import numpy as np
import pyrobot.util a... | 35.962295 | 79 | 0.548161 |
import os
import rospkg
import threading
import yaml
from copy import deepcopy
import message_filters
import numpy as np
import pyrobot.util as prutil
import rospy
from cv_bridge import CvBridge, CvBridgeError
from pyrobot.core import Camera
from sensor_msgs.msg import CameraInfo
from sensor_msgs.msg import Image... | true | true |
f727f3abb30dc023a71e5a4bb0a7f4af4c4e0c66 | 8,529 | py | Python | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2015-06-02T19:14:37.000Z | 2017-09-17T03:49:19.000Z | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2016-07-28T18:45:57.000Z | 2020-12-05T06:13:00.000Z | #!/usr/bin/env python
'''Event constants from /usr/include/linux/input.h
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
# Synchro... | 15.736162 | 62 | 0.749326 |
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
SYN_REPORT = 0
SYN_CONFIG = 1
KEY_RESERVED = 0
KEY_ESC = 1
KEY_1 = 2
KEY_2 = 3
K... | true | true |
f727f3b193a37188b7de74a5fd1ff300f301659a | 1,439 | py | Python | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null |
monety = input("Podaj posiadane monety, dzieląc je przecinkiem: ")
monety = monety.replace(" ", "")
monety = monety.split(",")
monety = list(map(int, monety))
ilosc = len(monety)
reszta = int(input("Jaką reszte chcesz wydać? "))
licznik = 0
historia = []
while reszta > 0:
if licznik >= ilosc:
print("Nie... | 24.389831 | 98 | 0.549687 |
monety = input("Podaj posiadane monety, dzieląc je przecinkiem: ")
monety = monety.replace(" ", "")
monety = monety.split(",")
monety = list(map(int, monety))
ilosc = len(monety)
reszta = int(input("Jaką reszte chcesz wydać? "))
licznik = 0
historia = []
while reszta > 0:
if licznik >= ilosc:
print("Nie... | true | true |
f727f4410396c7d32520f3d46daef479d465926c | 991 | py | Python | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 42 | 2018-04-13T18:02:04.000Z | 2022-03-30T00:21:26.000Z | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 18 | 2019-02-08T11:50:46.000Z | 2022-03-29T10:12:03.000Z | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 19 | 2019-02-04T14:57:46.000Z | 2022-03-24T13:39:21.000Z | from .. import BaseClient
class Client(BaseClient):
REQUIRES_AUTHENTICATION = False
def __init__(self, session):
super().__init__(session)
self._signin_aws = self.session().client('signin_aws')
self._signin_amazon = self.session().client('signin_amazon')
def signin(self, email, ... | 30.030303 | 73 | 0.576186 | from .. import BaseClient
class Client(BaseClient):
REQUIRES_AUTHENTICATION = False
def __init__(self, session):
super().__init__(session)
self._signin_aws = self.session().client('signin_aws')
self._signin_amazon = self.session().client('signin_amazon')
def signin(self, email, ... | true | true |
f727f4f0204f36cf8008b3978cac8641ec0e174c | 216 | py | Python | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | 1 | 2021-08-31T18:47:58.000Z | 2021-08-31T18:47:58.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Baida and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestBeneficiaryAidType(unittest.TestCase):
pass
| 19.636364 | 48 | 0.768519 |
from __future__ import unicode_literals
import unittest
class TestBeneficiaryAidType(unittest.TestCase):
pass
| true | true |
f727f5054ef0bf3d339c999db4daac4c53effb65 | 3,466 | py | Python | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 10 | 2018-05-07T15:59:55.000Z | 2021-04-18T12:51:14.000Z | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 4 | 2018-06-03T16:46:57.000Z | 2018-08-08T21:48:05.000Z | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 4 | 2018-05-25T04:39:56.000Z | 2019-04-29T05:08:25.000Z | import os
import sys
try:
import cPickle as pickle
except ImportError:
import _pickle as pickle
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def _read_data(data_path, train_files):
"""Reads CIFAR-10 format data. Always returns NHWC format.
Returns:
... | 29.372881 | 73 | 0.644547 | import os
import sys
try:
import cPickle as pickle
except ImportError:
import _pickle as pickle
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def _read_data(data_path, train_files):
images, labels = [], []
for file_name in train_files:
print(file_n... | true | true |
f727f57947e671ebd44b45237afa3f439dc6b3c3 | 8,633 | py | Python | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | """
Collaborate with RestApiClient to make remote anonymous and authenticated calls.
Uses user_io to request user's login and password and obtain a token for calling authenticated
methods if receives AuthenticationException from RestApiClient.
Flow:
Directly invoke a REST method in RestApiClient, example: get_co... | 42.737624 | 100 | 0.664196 |
import hashlib
from uuid import getnode as get_mac
from conans.client.cmd.user import update_localdb
from conans.errors import AuthenticationException, ConanException, ForbiddenException
from conans.util.log import logger
def input_credentials_if_unauthorized(func):
LOGIN_RETRIES = 3
def wrapper(self, *arg... | true | true |
f727f68949533cfb5e6250be94f67cb523575870 | 21,471 | py | Python | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Wenwen Yu
# @Created Time: 7/12/2020 9:50 PM
import os
import numpy as np
from numpy import inf
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from src.utils import inf_loop
from src.utils.metrics import MetricTracker, Spa... | 44.088296 | 120 | 0.589912 |
import os
import numpy as np
from numpy import inf
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from src.utils import inf_loop
from src.utils.metrics import MetricTracker, SpanBasedF1MetricTracker
from torch.utils.tensorboard import SummaryWriter
from... | true | true |
f727f6cf011e2798bbf44b01f9e61c7dbe87ceb3 | 142 | py | Python | gala/potential/potential/__init__.py | zilishen/gala | f7184e6b09fbc42a349f6b5a2bca6242f1e9936e | [
"MIT"
] | 1 | 2020-11-20T18:27:25.000Z | 2020-11-20T18:27:25.000Z | gala/potential/potential/__init__.py | ltlancas/gala | 2621bb599d67e74a85446abf72d5930ef70ca181 | [
"MIT"
] | 3 | 2021-07-26T15:07:25.000Z | 2021-09-13T15:04:27.000Z | gala/potential/potential/__init__.py | ltlancas/gala | 2621bb599d67e74a85446abf72d5930ef70ca181 | [
"MIT"
] | 1 | 2018-10-23T23:20:20.000Z | 2018-10-23T23:20:20.000Z | from .core import *
from .cpotential import *
from .ccompositepotential import *
from .builtin import *
from .io import *
from .util import *
| 20.285714 | 34 | 0.746479 | from .core import *
from .cpotential import *
from .ccompositepotential import *
from .builtin import *
from .io import *
from .util import *
| true | true |
f727f7ba434ba285d0316a1377f3b4ae81748ed9 | 22,575 | py | Python | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from logger_impl import *
import MongoDao
import pandas as pd
import time
payload = {'key': 'ac9e8cf2dec81949d9ee1235ed6ae3fb', 'url':
'https://httpbin.org/ip'}
def scrapData(scorecardSoup, matchId, matchDesc, matchTypeText, pageUrl, season, Date, venue):
... | 48.340471 | 154 | 0.454707 | import requests
from bs4 import BeautifulSoup
from logger_impl import *
import MongoDao
import pandas as pd
import time
payload = {'key': 'ac9e8cf2dec81949d9ee1235ed6ae3fb', 'url':
'https://httpbin.org/ip'}
def scrapData(scorecardSoup, matchId, matchDesc, matchTypeText, pageUrl, season, Date, venue):
... | true | true |
f727f81a283fdf0533813dc879af7cc5b21230da | 879 | py | Python | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 162 | 2019-11-01T17:35:58.000Z | 2022-03-18T04:22:39.000Z | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 315 | 2019-11-01T17:32:05.000Z | 2022-03-30T03:51:42.000Z | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 55 | 2019-11-01T16:59:59.000Z | 2022-03-25T18:19:06.000Z | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 38.217391 | 84 | 0.753129 |
__version__ = "0.2.0"
| true | true |
f727fa256e9c15830ec9c93a29d55173626569d5 | 4,224 | py | Python | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 146 | 2021-08-01T12:51:04.000Z | 2022-03-27T18:34:11.000Z | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 14 | 2021-08-01T12:53:27.000Z | 2022-03-24T09:55:53.000Z | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 29 | 2021-08-02T12:04:14.000Z | 2022-03-31T03:56:55.000Z | # coding=utf-8
# Copyright 2021 Intel Corporation. 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 ... | 33.792 | 100 | 0.742661 |
import argparse
import datetime
import random
from itertools import product
import yaml
def get_yaml(file_name):
with open(file_name, "r") as stream:
try:
ym = yaml.safe_load(stream)
return ym
except yaml.YAMLError as e:
print(e)
def get_run_id... | true | true |
f727fa6638c95253d96d2e8f5ab19ff10be0c38a | 655 | py | Python | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | from App.Config.app import settings
DATABASES = {
'default': 'mysql',
'mysql': {
'driver': 'mysql',
'host': settings.DB_HOST,
'port': settings.DB_PORT,
'database': settings.DB_DATABASE,
'user': settings.DB_USER,
'password': settings.DB_PASSWORD,
'prefix':... | 27.291667 | 41 | 0.567939 | from App.Config.app import settings
DATABASES = {
'default': 'mysql',
'mysql': {
'driver': 'mysql',
'host': settings.DB_HOST,
'port': settings.DB_PORT,
'database': settings.DB_DATABASE,
'user': settings.DB_USER,
'password': settings.DB_PASSWORD,
'prefix':... | true | true |
f727fb7b85952005743a11740a3245a5d33e2124 | 4,124 | py | Python | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | import random
import string
import json
from django.shortcuts import render, redirect, reverse
from django.urls.exceptions import NoReverseMatch
from django.contrib.auth import login, authenticate
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import Jso... | 39.653846 | 102 | 0.690592 | import random
import string
import json
from django.shortcuts import render, redirect, reverse
from django.urls.exceptions import NoReverseMatch
from django.contrib.auth import login, authenticate
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import Jso... | true | true |
f727fd004d9faf9730132464a1939ae041c64ead | 13,745 | py | Python | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 3 | 2021-07-19T23:56:34.000Z | 2021-11-08T14:23:53.000Z | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 1 | 2022-01-19T22:06:49.000Z | 2022-01-24T15:16:53.000Z | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 1 | 2021-11-08T14:25:29.000Z | 2021-11-08T14:25:29.000Z | #!/usr/bin/env python
# Info module template
#############################################
# WARNING #
#############################################
#
# This file is auto generated by
# https://github.com/jgroom33/vmware_rest_code_generator
#
# Do not edit this file manually.
#
# Ch... | 32.72619 | 99 | 0.621462 |
s are: tpes, expectations'
- Used by I(state=['get'])
type: str
includeMetaData:
description:
- 'MetaData to be included. The allowed values are: layerRate'
- Used by I(state=['get'])
type: str
included:
description:
- Resources related to a FRE, such as FreData, EndPointData, Tpe... | true | true |
f727fd0a3a3c103e954ea648b1541bbaf0c9e7d8 | 75,787 | py | Python | manticore/platforms/linux.py | CSeq/manticore | 6133a0e2ed98de6a58f3bf574498ec320ccbc43e | [
"Apache-2.0"
] | null | null | null | manticore/platforms/linux.py | CSeq/manticore | 6133a0e2ed98de6a58f3bf574498ec320ccbc43e | [
"Apache-2.0"
] | null | null | null | manticore/platforms/linux.py | CSeq/manticore | 6133a0e2ed98de6a58f3bf574498ec320ccbc43e | [
"Apache-2.0"
] | 1 | 2021-12-26T12:57:01.000Z | 2021-12-26T12:57:01.000Z | import errno
import fcntl
import logging
import os
import random
import struct
import ctypes
from elftools.elf.elffile import ELFFile
from ..utils.helpers import issymbolic
from ..core.cpu.abstractcpu import Interruption, Syscall, ConcretizeArgument
from ..core.cpu.cpufactory import CpuFactory
from ..core.memory impo... | 35.816163 | 204 | 0.554752 | import errno
import fcntl
import logging
import os
import random
import struct
import ctypes
from elftools.elf.elffile import ELFFile
from ..utils.helpers import issymbolic
from ..core.cpu.abstractcpu import Interruption, Syscall, ConcretizeArgument
from ..core.cpu.cpufactory import CpuFactory
from ..core.memory impo... | false | true |
f727fdadcd3bc9ccad0ae50f7d825827d2eb27e6 | 1,146 | py | Python | manage-api/server/main.py | lisy09/spark-dev-box | ed362cb5b19400a798995e270869df14805600a0 | [
"MIT"
] | null | null | null | manage-api/server/main.py | lisy09/spark-dev-box | ed362cb5b19400a798995e270869df14805600a0 | [
"MIT"
] | null | null | null | manage-api/server/main.py | lisy09/spark-dev-box | ed362cb5b19400a798995e270869df14805600a0 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
import logging
from .routers import routers
from .core.config import get_config, get_gunicorn_config
from .core.logger import setup_logger, StubbedGunicornLogger
import gunicorn.app.base
def createSimpleFastapi():
app = FastAPI()
app.include_router(routers.router)
return app
... | 27.95122 | 68 | 0.696335 | from fastapi import FastAPI
import logging
from .routers import routers
from .core.config import get_config, get_gunicorn_config
from .core.logger import setup_logger, StubbedGunicornLogger
import gunicorn.app.base
def createSimpleFastapi():
app = FastAPI()
app.include_router(routers.router)
return app
... | true | true |
f727fdc01f072843395a369831bd24b9de4f8cb3 | 9,268 | py | Python | skimage/future/graph/graph_cut.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | 2 | 2020-02-24T02:24:43.000Z | 2021-12-19T11:44:34.000Z | skimage/future/graph/graph_cut.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | skimage/future/graph/graph_cut.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | 2 | 2019-06-16T06:38:28.000Z | 2021-12-19T11:44:48.000Z | try:
import networkx as nx
except ImportError:
from ..._shared.utils import warn
warn('RAGs require networkx')
import numpy as np
from . import _ncut
from . import _ncut_cy
from scipy.sparse import linalg
def cut_threshold(labels, rag, thresh, in_place=True):
"""Combine regions separated by weight les... | 31.416949 | 77 | 0.623867 | try:
import networkx as nx
except ImportError:
from ..._shared.utils import warn
warn('RAGs require networkx')
import numpy as np
from . import _ncut
from . import _ncut_cy
from scipy.sparse import linalg
def cut_threshold(labels, rag, thresh, in_place=True):
if not in_place:
rag = rag.copy()
... | true | true |
f727fddd3097c5ec42695160636f977e440b5a91 | 1,058 | py | Python | meijer/tests/test_meijer_list.py | sllawcj/python_Meijer | d8caf2e97ce30df565810bac9dff4d1cccc59022 | [
"MIT"
] | 6 | 2020-03-23T02:58:30.000Z | 2022-01-16T02:41:50.000Z | meijer/tests/test_meijer_list.py | sllawcj/python_Meijer | d8caf2e97ce30df565810bac9dff4d1cccc59022 | [
"MIT"
] | 1 | 2021-12-12T21:45:11.000Z | 2021-12-12T21:45:11.000Z | meijer/tests/test_meijer_list.py | sllawcj/python_Meijer | d8caf2e97ce30df565810bac9dff4d1cccc59022 | [
"MIT"
] | 3 | 2020-11-04T02:35:13.000Z | 2021-11-07T20:46:04.000Z | import pytest
from meijer import __version__
from meijer import Meijer
@pytest.fixture(scope="session")
def meijer():
with Meijer() as m:
m.login()
yield m
@pytest.fixture(scope="session")
def shopping_list(meijer):
shopping_list = meijer.list
shopping_list.clear()
yield shopping_li... | 22.041667 | 60 | 0.695652 | import pytest
from meijer import __version__
from meijer import Meijer
@pytest.fixture(scope="session")
def meijer():
with Meijer() as m:
m.login()
yield m
@pytest.fixture(scope="session")
def shopping_list(meijer):
shopping_list = meijer.list
shopping_list.clear()
yield shopping_li... | true | true |
f727febcbb7b6a2d542c6088719875fe0507db7e | 377 | py | Python | examples/using_R2018.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | examples/using_R2018.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | examples/using_R2018.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2017-2021 Manfred Moitzi
# License: MIT License
import ezdxf
doc = ezdxf.new("R2018", setup=True)
modelspace = doc.modelspace()
modelspace.add_circle(
center=(0, 0),
radius=1.5,
dxfattribs={
"layer": "test",
"linetype": "DASHED",
},
)
filename = "circle_R2018.dxf"
doc.s... | 19.842105 | 40 | 0.647215 |
import ezdxf
doc = ezdxf.new("R2018", setup=True)
modelspace = doc.modelspace()
modelspace.add_circle(
center=(0, 0),
radius=1.5,
dxfattribs={
"layer": "test",
"linetype": "DASHED",
},
)
filename = "circle_R2018.dxf"
doc.saveas(filename)
print(f"DXF file '{filename}' created.")
| true | true |
f727fee3fb973a4e34d1c41f7b2d1e4d3582c1bb | 43,980 | py | Python | DCT-Copula-Illustration.py | ibianka/HARK | 8678dbab0a0ace1520ac8f7ff5b33765122619f4 | [
"Apache-2.0"
] | null | null | null | DCT-Copula-Illustration.py | ibianka/HARK | 8678dbab0a0ace1520ac8f7ff5b33765122619f4 | [
"Apache-2.0"
] | null | null | null | DCT-Copula-Illustration.py | ibianka/HARK | 8678dbab0a0ace1520ac8f7ff5b33765122619f4 | [
"Apache-2.0"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.1.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # D... | 46.392405 | 769 | 0.670646 |
lse:
return False
except NameError:
return False
if in_ipynb():
get_ipython().run_line_magic('matplotlib', 'inline')
else:
get_ipython().run_line_magic('matplotlib', 'auto')
import sys
import os
my_file_path = os.path.dirname(os.path.abspath("TwoAss... | true | true |
f7280032dc7383b07665e3f89cd4ed34380fc45e | 146 | py | Python | 20180609/python_lines_04_with.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null | 20180609/python_lines_04_with.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null | 20180609/python_lines_04_with.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null |
with open('C:\\Python Practice\\MyProjects01\\MyProjects01\\20180609\\poem_01.txt') as f:
for k in f.readlines():
print(k.strip().split())
| 18.25 | 89 | 0.684932 |
with open('C:\\Python Practice\\MyProjects01\\MyProjects01\\20180609\\poem_01.txt') as f:
for k in f.readlines():
print(k.strip().split())
| true | true |
f728009e660bb4cab8c59f04834fb694b6e46262 | 16,687 | py | Python | espnet2/bin/enh_inference.py | arceushui/Keyword-Spotting-Alibaba | 10e718491075dee8f875c7860385bc4eef22a790 | [
"Apache-2.0"
] | null | null | null | espnet2/bin/enh_inference.py | arceushui/Keyword-Spotting-Alibaba | 10e718491075dee8f875c7860385bc4eef22a790 | [
"Apache-2.0"
] | null | null | null | espnet2/bin/enh_inference.py | arceushui/Keyword-Spotting-Alibaba | 10e718491075dee8f875c7860385bc4eef22a790 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import logging
from pathlib import Path
import sys
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
import humanfriendly
import numpy as np
import torch
from tqdm import trange
from typeguard import ... | 34.620332 | 88 | 0.597231 |
import argparse
import logging
from pathlib import Path
import sys
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
import humanfriendly
import numpy as np
import torch
from tqdm import trange
from typeguard import check_argument_types
... | true | true |
f7280122592f874c88490b185ae803033e4f575c | 2,254 | py | Python | webapp/python-web-multiple-browsers-test/WebappTest.py | elastest/demo-projects | d60fa75b98b3beccba28329e393392405727b492 | [
"Apache-2.0"
] | 3 | 2017-11-30T16:35:38.000Z | 2018-12-18T22:56:41.000Z | webapp/python-web-multiple-browsers-test/WebappTest.py | elastest/demo-projects | d60fa75b98b3beccba28329e393392405727b492 | [
"Apache-2.0"
] | 2 | 2018-12-06T07:58:52.000Z | 2020-12-04T17:21:28.000Z | webapp/python-web-multiple-browsers-test/WebappTest.py | elastest/demo-projects | d60fa75b98b3beccba28329e393392405727b492 | [
"Apache-2.0"
] | 6 | 2018-01-08T11:10:54.000Z | 2019-09-06T07:11:29.000Z | import unittest
import os
import sys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import xmlrunner
import ElasTestBase
class TestWebApp(ElasTestBase.ElasTestBase):
def test_check_tit... | 29.657895 | 66 | 0.639752 | import unittest
import os
import sys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import xmlrunner
import ElasTestBase
class TestWebApp(ElasTestBase.ElasTestBase):
def test_check_tit... | false | true |
f7280318fec0d22486693a1e350946abf99b5fec | 26,025 | py | Python | jade2/basic/structure/PythonPDB2.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T21:52:23.000Z | 2019-12-23T21:52:23.000Z | jade2/basic/structure/PythonPDB2.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | null | null | null | jade2/basic/structure/PythonPDB2.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | 1 | 2021-01-28T18:59:03.000Z | 2021-01-28T18:59:03.000Z |
## @author Jared Adolf-Bryfogle (jadolfbr@gmail.com)
#Python Imports
import copy
import pandas
import re, logging
from collections import defaultdict
from typing import Union, DefaultDict, List, Any, Dict
from pathlib import Path
from jade2.basic.path import *
class PythonPDB2:
def __init__(self, pdb_file_path:... | 36.914894 | 164 | 0.528108 |
m collections import defaultdict
from typing import Union, DefaultDict, List, Any, Dict
from pathlib import Path
from jade2.basic.path import *
class PythonPDB2:
def __init__(self, pdb_file_path: Union[str, Path] = ""):
self.elements = ("id", "atom_number", "atom_name", "alternate_location", \
... | true | true |
f728036c65d2fb7c85eff44144bdd6548137164c | 3,985 | py | Python | setup.py | moonso/loqusdb | 3f2ab2bd458f83b1c408e8573036024986d0ed4c | [
"MIT"
] | 4 | 2018-06-04T12:42:45.000Z | 2021-03-29T20:36:12.000Z | setup.py | moonso/loqusdb | 3f2ab2bd458f83b1c408e8573036024986d0ed4c | [
"MIT"
] | 50 | 2016-02-26T07:54:39.000Z | 2021-10-12T07:52:01.000Z | setup.py | moonso/loqusdb | 3f2ab2bd458f83b1c408e8573036024986d0ed4c | [
"MIT"
] | 8 | 2016-02-29T13:50:46.000Z | 2020-04-22T10:15:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
"""Based on https://github.com/kennethreitz/setup.py"""
import io
import os
import sys
from shutil import rmtree
from setuptools import... | 27.673611 | 86 | 0.636386 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'loqusdb'
DESCRIPTION = 'Store observations of vcf variants in a mongodb'
URL = 'https://github.com/moonso/loqusdb'
EMAIL = 'mans.magnusson@scilifelab.com'
AUTHOR = 'Måns Magnusson'
REQUIRES_P... | true | true |
f728044a58a0b35f5e119349ab2cfafc658bbc58 | 7,909 | py | Python | research/audioset/vggish/vggish_train_demo.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/audioset/vggish/vggish_train_demo.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/audioset/vggish/vggish_train_demo.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 40.979275 | 80 | 0.713491 |
from __future__ import print_function
from random import shuffle
import numpy as np
import tensorflow as tf
import vggish_input
import vggish_params
import vggish_slim
flags = tf.app.flags
slim = tf.contrib.slim
flags.DEFINE_integer(
'num_batches', 30,
'Number of batches of examples to feed ... | true | true |
f7280459bb1c11d05d44c03226ca1b7d0dd23522 | 449 | py | Python | python/sprint_12/tmp/code.py | Talgatovich/algorithms-templates | e7c6fd71451304ed0dacc393c3f30ca3f5282d46 | [
"MIT"
] | null | null | null | python/sprint_12/tmp/code.py | Talgatovich/algorithms-templates | e7c6fd71451304ed0dacc393c3f30ca3f5282d46 | [
"MIT"
] | null | null | null | python/sprint_12/tmp/code.py | Talgatovich/algorithms-templates | e7c6fd71451304ed0dacc393c3f30ca3f5282d46 | [
"MIT"
] | null | null | null | # Comment it before submitting
# class Node:
# def __init__(self, value, next_item=None):
# self.value = value
# self.next_item = next_item
def solution(node, idx):
# Your code
# ヽ(´▽`)/
pass
def test():
node3 = Node("node3", None)
node2 = Node("node2", node3)
node1 ... | 23.631579 | 50 | 0.581292 |
def solution(node, idx):
pass
def test():
node3 = Node("node3", None)
node2 = Node("node2", node3)
node1 = Node("node1", node2)
node0 = Node("node0", node1)
new_head = solution(node0, 1)
| true | true |
f728047ed3f41d811f58d70ae10b6265a2be9524 | 2,529 | py | Python | tests/test_transport_datagram.py | zentropi/python-zentropi | 96cf714b1e0eeb7ee887298eca0f1c92e8b6958e | [
"BSD-3-Clause"
] | 14 | 2017-04-21T05:47:02.000Z | 2018-10-23T21:28:19.000Z | tests/test_transport_datagram.py | zentropi/python-zentropi | 96cf714b1e0eeb7ee887298eca0f1c92e8b6958e | [
"BSD-3-Clause"
] | 22 | 2017-04-11T23:35:16.000Z | 2017-05-20T04:32:44.000Z | tests/test_transport_datagram.py | zentropi/python-zentropi | 96cf714b1e0eeb7ee887298eca0f1c92e8b6958e | [
"BSD-3-Clause"
] | 5 | 2017-04-05T23:21:05.000Z | 2017-10-29T15:28:05.000Z | import pytest
from zentropi import Agent
from zentropi import Frame
from zentropi.transport import datagram
class MockDatagram(object):
def __init__(self, login_ok=True, send_ok=True, recv_ok=True):
self._login_ok = login_ok
self._send_ok = send_ok
self._recv_ok = recv_ok
self.fra... | 31.6125 | 82 | 0.680506 | import pytest
from zentropi import Agent
from zentropi import Frame
from zentropi.transport import datagram
class MockDatagram(object):
def __init__(self, login_ok=True, send_ok=True, recv_ok=True):
self._login_ok = login_ok
self._send_ok = send_ok
self._recv_ok = recv_ok
self.fra... | true | true |
f72805554c757480caa6c16f5ee9bd0c52c96825 | 19,827 | py | Python | ipython/3_Training_Predicting/prnn_cb12_train_predict.py | samuelru/session-knn-ae | c6232667dbe57f82391d487875b52f651ca08a21 | [
"MIT"
] | 6 | 2019-12-08T12:58:02.000Z | 2021-06-29T23:52:03.000Z | ipython/3_Training_Predicting/prnn_cb12_train_predict.py | samuelru/session-knn-ae | c6232667dbe57f82391d487875b52f651ca08a21 | [
"MIT"
] | 1 | 2021-01-20T14:52:02.000Z | 2022-02-24T08:43:11.000Z | ipython/3_Training_Predicting/prnn_cb12_train_predict.py | samuelru/session-knn-ae | c6232667dbe57f82391d487875b52f651ca08a21 | [
"MIT"
] | 5 | 2019-12-08T13:09:03.000Z | 2020-09-04T04:53:51.000Z | from keras.layers import Input, Dense, concatenate
from keras.layers.recurrent import GRU
from keras.utils import plot_model
from keras.models import Model, load_model
from keras.callbacks import ModelCheckpoint
import keras
import pandas as pd
import numpy as np
import keras.backend as K
from keras.utils import to_cat... | 37.338983 | 153 | 0.643214 | from keras.layers import Input, Dense, concatenate
from keras.layers.recurrent import GRU
from keras.utils import plot_model
from keras.models import Model, load_model
from keras.callbacks import ModelCheckpoint
import keras
import pandas as pd
import numpy as np
import keras.backend as K
from keras.utils import to_cat... | true | true |
f728058691d28517eb5f80d44183878ec58ae0fc | 1,050 | py | Python | Structural/object_adapter.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | Structural/object_adapter.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | Structural/object_adapter.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | # This is the object-based adapter pattern
# It allows us to take an outside class 'StrangeCreature' with a different interface,
# and squeeze that SOB into another hierachy.
# The good thing about the object version of this pattern is that if StrangeCreature had
# a lot of subtypes, we would not need to write an adapt... | 30 | 127 | 0.728571 |
import abc
class StrangeCreature(object):
def make_horrible_noise(self):
print("Rawr")
class Animal(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def make_noise(self):
raise NotImplementedError
class Horse(Animal):
def make_noise(self):
print("Vrinsk")
class Plat... | true | true |
f728064f24ce70cc0b19b13c3a4c9545b7424ef4 | 849 | py | Python | tests/admin/test_pages.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | tests/admin/test_pages.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | tests/admin/test_pages.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | from tests.helpers import create_ctfd, destroy_ctfd, login_as_user
def test_previewing_pages_works():
"""Test that pages can be previewed properly"""
app = create_ctfd()
with app.app_context():
client = login_as_user(app, name="admin", password="password")
with client.session_tra... | 31.444444 | 71 | 0.530035 | from tests.helpers import create_ctfd, destroy_ctfd, login_as_user
def test_previewing_pages_works():
app = create_ctfd()
with app.app_context():
client = login_as_user(app, name="admin", password="password")
with client.session_transaction() as sess:
data = {
... | true | true |
f72806f1b468e69088235a72960fae80ff004757 | 752 | py | Python | phase2_scripts/p2_inference_test25_1M_epoch16.py | socom20/facebook-image-similarity-challenge-2021 | bf4226241be30cdf99180543f214edf571043e8d | [
"MIT"
] | 8 | 2021-12-02T04:05:59.000Z | 2022-02-23T07:57:22.000Z | phase2_scripts/p2_inference_test25_1M_epoch16.py | socom20/facebook-image-similarity-challenge-2021 | bf4226241be30cdf99180543f214edf571043e8d | [
"MIT"
] | 1 | 2021-12-07T07:05:37.000Z | 2021-12-08T02:24:17.000Z | phase2_scripts/p2_inference_test25_1M_epoch16.py | socom20/facebook-image-similarity-challenge-2021 | bf4226241be30cdf99180543f214edf571043e8d | [
"MIT"
] | 4 | 2021-12-12T09:58:01.000Z | 2022-03-29T05:50:57.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from model_inference import do_inference
# In[ ]:
from modules.Facebook_AF_model_v25 import ArgsT25_NfNetl1_ImageNet, FacebookModel
ckpt_filename = './checkpoints/smp_test25/FacebookModel_epoch=16_trn_loss_epoch=0.9023_trn_acc_epoch=0.0000_val_loss_epoch=0.4303_val_... | 21.485714 | 156 | 0.793883 |
from model_inference import do_inference
from modules.Facebook_AF_model_v25 import ArgsT25_NfNetl1_ImageNet, FacebookModel
ckpt_filename = './checkpoints/smp_test25/FacebookModel_epoch=16_trn_loss_epoch=0.9023_trn_acc_epoch=0.0000_val_loss_epoch=0.4303_val_acc_epoch=0.9911.ckpt'
args = ArgsT25_NfNetl1_Image... | true | true |
f7280780dc6c97a9f7524378205551ce5bb10c36 | 1,601 | py | Python | migrations/versions/0221_nullable_service_branding.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | migrations/versions/0221_nullable_service_branding.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | migrations/versions/0221_nullable_service_branding.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | """
Revision ID: 0221_nullable_service_branding
Revises: 0220_email_brand_type_non_null
Create Date: 2018-08-24 13:36:49.346156
"""
from alembic import op
from app.models import BRANDING_ORG, BRANDING_GOVUK
revision = '0221_nullable_service_branding'
down_revision = '0220_email_brand_type_non_null'
def upgrade():... | 27.603448 | 105 | 0.656465 | from alembic import op
from app.models import BRANDING_ORG, BRANDING_GOVUK
revision = '0221_nullable_service_branding'
down_revision = '0220_email_brand_type_non_null'
def upgrade():
op.drop_constraint('services_branding_fkey', 'services', type_='foreignkey')
op.drop_index('ix_services_history_branding', ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.