hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3fddd736b4b331ce0e9cce4a4deefad4aaaa9d | 5,605 | py | Python | ibis_mssql/compiler.py | safrazRampersaud/ibis-mssql | b4349d0d195c77b02c7a2531e4b83e6cf6ecd79a | [
"Apache-2.0"
] | null | null | null | ibis_mssql/compiler.py | safrazRampersaud/ibis-mssql | b4349d0d195c77b02c7a2531e4b83e6cf6ecd79a | [
"Apache-2.0"
] | 15 | 2020-06-04T17:27:26.000Z | 2021-02-15T16:29:14.000Z | ibis_mssql/compiler.py | safrazRampersaud/ibis-mssql | b4349d0d195c77b02c7a2531e4b83e6cf6ecd79a | [
"Apache-2.0"
] | 5 | 2021-01-05T23:20:13.000Z | 2021-04-17T10:52:53.000Z | import pyodbc
import sqlalchemy as sa
import sqlalchemy.dialects.mssql as mssql
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.backends.base_sqlalchemy.alchemy as alch
# used for literal translate
from ibis.backends.base_sqlalchemy.alchemy import f... | 27.077295 | 76 | 0.649955 | import pyodbc
import sqlalchemy as sa
import sqlalchemy.dialects.mssql as mssql
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.backends.base_sqlalchemy.alchemy as alch
from ibis.backends.base_sqlalchemy.alchemy import fixed_arity, unary
def raise... | true | true |
1c3fde21a6ddd37df1568bf727236ba6d5ba10f9 | 707 | py | Python | cla-backend/helpers/get_token.py | rinkeshbhutwala/easycla | b92eae57a696050b0a5c15c12e4084583f3d1c4c | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 52 | 2019-07-03T17:13:03.000Z | 2022-03-29T20:42:55.000Z | cla-backend/helpers/get_token.py | rinkeshbhutwala/easycla | b92eae57a696050b0a5c15c12e4084583f3d1c4c | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 1,368 | 2019-07-03T21:24:07.000Z | 2022-03-30T22:56:17.000Z | cla-backend/helpers/get_token.py | rinkeshbhutwala/easycla | b92eae57a696050b0a5c15c12e4084583f3d1c4c | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 49 | 2019-07-03T21:20:58.000Z | 2021-12-10T08:22:18.000Z | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
import sys
sys.path.append('../')
from keycloak import KeycloakOpenID
import cla
# kc = KeycloakOpenID(cla.conf['KEYCLOAK_ENDPOINT'],
# cla.conf['KEYCLOAK_CLIENT_ID'],
# cl... | 33.666667 | 100 | 0.678925 |
import sys
sys.path.append('../')
from keycloak import KeycloakOpenID
import cla
| true | true |
1c3fdfdf45eeccd2bbadce8856a0d6f7840228fe | 1,659 | py | Python | dive/soundex/stage1/soundex2c.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | dive/soundex/stage1/soundex2c.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | dive/soundex/stage1/soundex2c.py | abos5/pythontutor | eba451700def8bd98d74668d1b6cc08c0ccc0d3c | [
"MIT"
] | null | null | null | import string
import re
allchars = string.uppercase + string.lowercase
charToSoundex = string.maketrans(allchars, "91239129922455912623919292" * 2)
isOnlyChars = re.compile('^[A-Za-z]+$').search
def soundex(source):
"convert string to Soundex equivalent"
if not isOnlyChars(source):
return "0000"
... | 27.196721 | 76 | 0.621459 | import string
import re
allchars = string.uppercase + string.lowercase
charToSoundex = string.maketrans(allchars, "91239129922455912623919292" * 2)
isOnlyChars = re.compile('^[A-Za-z]+$').search
def soundex(source):
if not isOnlyChars(source):
return "0000"
digits = source[0].upper() + source[1:].tr... | true | true |
1c3fe0bfadc33918d956aa1c6d71ceca984dd702 | 28,756 | py | Python | archetypal/template/zonedefinition.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | archetypal/template/zonedefinition.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | archetypal/template/zonedefinition.py | louisleroy5/archetypal | 71f13aaed859c10e663e68624e2b74d816de631f | [
"MIT"
] | null | null | null | ################################################################################
# Module: archetypal.template
# Description:
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archetypal
################################################################################
import colle... | 35.326781 | 167 | 0.60224 |
import collections
import functools
import math
import sqlite3
import time
from operator import add
import numpy as np
from deprecation import deprecated
from eppy.bunch_subclass import BadEPFieldError
from geomeppy.geom.polygons import Polygon3D
from sigfig import round
from archetypal import __version__, is_refere... | true | true |
1c3fe2578a469520372eedadc600c4ff9471a9ef | 4,503 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py | doc22940/openapi-generator | 50d21cb0d161e7917bb410a7db78811635f0837b | [
"Apache-2.0"
] | 1 | 2020-09-16T22:26:09.000Z | 2020-09-16T22:26:09.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py | doc22940/openapi-generator | 50d21cb0d161e7917bb410a7db78811635f0837b | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py | doc22940/openapi-generator | 50d21cb0d161e7917bb410a7db78811635f0837b | [
"Apache-2.0"
] | 1 | 2020-10-06T15:41:06.000Z | 2020-10-06T15:41:06.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 33.604478 | 174 | 0.609594 |
from __future__ import absolute_import
import re import sys
import six
from petstore_api.model_utils import ( ModelComposed,
ModelNormal,
ModelSimple,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
class CatAllOf(ModelNormal):
allowe... | true | true |
1c3fe3235baa13687662db78218ee5a102d7bf2a | 1,780 | py | Python | src/omission/interface/highscore.py | mousepawmedia/omission | e2a25d9c510be5c2d3469d064ee764f03050911f | [
"BSD-3-Clause"
] | 13 | 2019-06-10T02:30:30.000Z | 2022-01-09T08:25:48.000Z | src/omission/interface/highscore.py | mousepawmedia/omission | e2a25d9c510be5c2d3469d064ee764f03050911f | [
"BSD-3-Clause"
] | null | null | null | src/omission/interface/highscore.py | mousepawmedia/omission | e2a25d9c510be5c2d3469d064ee764f03050911f | [
"BSD-3-Clause"
] | 2 | 2019-09-02T03:51:38.000Z | 2020-11-30T01:50:57.000Z | """
Highscore Prompt Interface [Omission]
"""
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
class Highscore(BoxLayout):
"""
Displays the prompt for entering a name for a new high score.
"""
def __init__(self, **kwargs):
super().__in... | 27.8125 | 81 | 0.57809 |
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
class Highscore(BoxLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.datastring = None
self.score = None
def set_info(self, datastring, score):
self... | true | true |
1c3fe36663b363fbad6630f23d3c1ce859e431dd | 158 | py | Python | gigs/filter.py | djangoLovers/fiverrClone | 567ea972603b4997590e1351a7d27fba8add91af | [
"MIT"
] | 2 | 2021-04-17T19:08:07.000Z | 2022-03-21T11:11:54.000Z | gigs/filter.py | djangoLovers/fiverrClone | 567ea972603b4997590e1351a7d27fba8add91af | [
"MIT"
] | null | null | null | gigs/filter.py | djangoLovers/fiverrClone | 567ea972603b4997590e1351a7d27fba8add91af | [
"MIT"
] | 4 | 2021-04-17T19:08:08.000Z | 2021-09-15T21:04:41.000Z | import django_filters
from .models import Gig
class gigFilter(django_filters.FilterSet):
class Meta:
model = Gig
fields = ['category']
| 15.8 | 42 | 0.677215 | import django_filters
from .models import Gig
class gigFilter(django_filters.FilterSet):
class Meta:
model = Gig
fields = ['category']
| true | true |
1c3fe426dc2304d925c2926fa64efd31c2a68274 | 16,293 | py | Python | examples/system/ota/native_ota_example/example_test.py | moolitayer/esp-idf | c1d0daf36d0dca81c23c226001560edfa51c30ea | [
"Apache-2.0"
] | 1 | 2020-02-26T02:30:07.000Z | 2020-02-26T02:30:07.000Z | examples/system/ota/native_ota_example/example_test.py | moolitayer/esp-idf | c1d0daf36d0dca81c23c226001560edfa51c30ea | [
"Apache-2.0"
] | null | null | null | examples/system/ota/native_ota_example/example_test.py | moolitayer/esp-idf | c1d0daf36d0dca81c23c226001560edfa51c30ea | [
"Apache-2.0"
] | null | null | null | import re
import os
import socket
import BaseHTTPServer
import SimpleHTTPServer
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
server_cert = "-----BEGIN CERTIFICATE-----\n" \
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz... | 48.204142 | 137 | 0.711471 | import re
import os
import socket
import BaseHTTPServer
import SimpleHTTPServer
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
server_cert = "-----BEGIN CERTIFICATE-----\n" \
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz... | true | true |
1c3fe459583d256e465eeff96c43107ef808c2d6 | 1,049 | py | Python | Totoro/bin/ic342_lst_range.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | 1 | 2018-08-22T00:34:30.000Z | 2018-08-22T00:34:30.000Z | Totoro/bin/ic342_lst_range.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | 4 | 2018-06-06T22:10:14.000Z | 2018-06-14T04:47:23.000Z | Totoro/bin/ic342_lst_range.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2019-10-07
# @Filename: ic342_lst_range.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
import sys
from Totoro.db import getConnection
def load_lst_ranges(lst0, lst1):
lst0 =... | 24.395349 | 89 | 0.620591 |
import sys
from Totoro.db import getConnection
def load_lst_ranges(lst0, lst1):
lst0 = float(lst0)
lst1 = float(lst1)
ic342_ra = 55.910158
ha0 = lst0 * 15. - ic342_ra
ha1 = lst1 * 15. - ic342_ra
db = getConnection()
session = db.Session()
ic342_plates = session.query(db.mangaDB.... | true | true |
1c3fe4ea951aef122728a7aed7fc4ecaf8e7607e | 4,082 | py | Python | tests/compare_results.py | an1018/PaddleOCR | 0a8ca67a0c4a4ed468e82a575cc64ce73f21e068 | [
"Apache-2.0"
] | 1 | 2022-01-21T07:48:15.000Z | 2022-01-21T07:48:15.000Z | tests/compare_results.py | an1018/PaddleOCR | 0a8ca67a0c4a4ed468e82a575cc64ce73f21e068 | [
"Apache-2.0"
] | null | null | null | tests/compare_results.py | an1018/PaddleOCR | 0a8ca67a0c4a4ed468e82a575cc64ce73f21e068 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import subprocess
import json
import argparse
import glob
def init_args():
parser = argparse.ArgumentParser()
# params for testing assert allclose
parser.add_argument("--atol", type=float, default=1e-3)
parser.add_argument("--rtol", type=float, default=1e-3)
parser.add... | 30.462687 | 111 | 0.628613 | import numpy as np
import os
import subprocess
import json
import argparse
import glob
def init_args():
parser = argparse.ArgumentParser()
parser.add_argument("--atol", type=float, default=1e-3)
parser.add_argument("--rtol", type=float, default=1e-3)
parser.add_argument("--gt_file", type=str, defa... | true | true |
1c3fe51d7dfc9a3980ef339a227c06617611f30a | 4,807 | py | Python | tests/forte/data/ontology/ndarray_attribute_test.py | bhaskar2443053/forte | 95fabd94126d45c0db07cdcc197049ed1859d228 | [
"Apache-2.0"
] | null | null | null | tests/forte/data/ontology/ndarray_attribute_test.py | bhaskar2443053/forte | 95fabd94126d45c0db07cdcc197049ed1859d228 | [
"Apache-2.0"
] | 1 | 2022-02-23T23:21:03.000Z | 2022-02-23T23:21:03.000Z | tests/forte/data/ontology/ndarray_attribute_test.py | KGerring/forte | 7dc6e6c7d62d9a4126bdfc5ca02d15be3ffd61ca | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
import unittest
from ddt import data, ddt
import numpy as np
from forte.data.data_pack import DataPack
from .test_outputs.ft.onto.test_ndarray import NdEntry1, NdEntry2, NdEntry3
"""
NdEntry1, NdEntry2, and NdEntry3 are sample Entry containing NdArray attributes
for testing.
NdEntry1 has b... | 34.092199 | 93 | 0.598294 | import os
import tempfile
import unittest
from ddt import data, ddt
import numpy as np
from forte.data.data_pack import DataPack
from .test_outputs.ft.onto.test_ndarray import NdEntry1, NdEntry2, NdEntry3
@ddt
class SerializationTest(unittest.TestCase):
@data(
NdEntry1,
NdEntry2,
NdEntry... | true | true |
1c3fe5c3f7e422f2e584fd59cb3e47b18251a7e5 | 235 | py | Python | pt-1/sem_7/6sem7_ex2_sum_array_elements.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null | pt-1/sem_7/6sem7_ex2_sum_array_elements.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null | pt-1/sem_7/6sem7_ex2_sum_array_elements.py | lucaszarza/python_coursera-usp-pt1 | eaf8d32ec09b82755f9716237ffadb0cf8d46169 | [
"Apache-2.0"
] | null | null | null | def soma_elementos(lista):
sum = 0
for i in lista:
sum += i
return sum
def test_sum():
test = [1, 2, 3, 4, 5]
assert soma_elementos(test) == 15
def test_sum2():
test = [5, 5, 4, 6, 9, 2, 5]
assert soma_elementos(test) == 36 | 16.785714 | 34 | 0.617021 | def soma_elementos(lista):
sum = 0
for i in lista:
sum += i
return sum
def test_sum():
test = [1, 2, 3, 4, 5]
assert soma_elementos(test) == 15
def test_sum2():
test = [5, 5, 4, 6, 9, 2, 5]
assert soma_elementos(test) == 36 | true | true |
1c3fe7b23b37e235bc5dbaeab901904b62b9b074 | 11,279 | py | Python | thirdparty/cv_bridge/core.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | null | null | null | thirdparty/cv_bridge/core.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | null | null | null | thirdparty/cv_bridge/core.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | 1 | 2020-12-19T05:48:01.000Z | 2020-12-19T05:48:01.000Z | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# Copyright (c) 2016, Tal Regev.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of ... | 41.164234 | 152 | 0.63862 |
import sensor_msgs.msg
import sys
import cv2
import numpy as np
class CvBridgeError(TypeError):
pass
class CvBridge(object):
def __init__(self):
import cv2
self.cvtype_to_name = {}
self.cvdepth_to_numpy_depth = {cv2.CV_8U: 'uint8', cv2.CV_8S: 'int8', cv2.CV_16U: 'uint16',
... | true | true |
1c3fe8fee0a2b724d2ae89380da2ede97ecde881 | 3,121 | py | Python | emtf_nnet/keras/layers/mutated_dense.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | emtf_nnet/keras/layers/mutated_dense.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | emtf_nnet/keras/layers/mutated_dense.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | # The following source code was originally obtained from:
# https://github.com/keras-team/keras/blob/r2.6/keras/layers/core.py#L1066-L1270
# ==============================================================================
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License... | 36.717647 | 95 | 0.627043 |
import tensorflow.compat.v2 as tf
from keras.layers.core import Dense
class MutatedDense(Dense):
def __init__(self,
units,
**kwargs):
super().__init__(units=units, **kwargs)
self.supports_masking = True
self._compute_output_and_mask_jointly = True
def _dense(self, in... | true | true |
1c3fe9a0321b68f22254ea683c2077a5ca3f207c | 5,419 | py | Python | enno/utils/annotation.py | HPI-Information-Systems/enno | 25d9c7aaf4a9ef0090bc7eca947684e354621586 | [
"MIT"
] | 5 | 2019-05-15T05:53:27.000Z | 2021-01-07T03:00:53.000Z | enno/utils/annotation.py | HPI-Information-Systems/enno | 25d9c7aaf4a9ef0090bc7eca947684e354621586 | [
"MIT"
] | 8 | 2017-09-28T13:41:49.000Z | 2018-06-27T09:38:51.000Z | enno/utils/annotation.py | TimRepke/enno | 25d9c7aaf4a9ef0090bc7eca947684e354621586 | [
"MIT"
] | 4 | 2017-09-28T14:34:04.000Z | 2017-10-11T14:23:25.000Z | import json
import re
class Annotation:
def __init__(self, wrapper='plaintext'):
self.anno = {}
self.wrapper = wrapper
# some helper "indices"
self.max = {
'denotations': 0,
'relations': 0
}
self.ids = {
'denotations': [],
... | 28.824468 | 107 | 0.532017 | import json
import re
class Annotation:
def __init__(self, wrapper='plaintext'):
self.anno = {}
self.wrapper = wrapper
self.max = {
'denotations': 0,
'relations': 0
}
self.ids = {
'denotations': [],
'relations': []
... | true | true |
1c3fea7ec6376c09b265b6fd7238ec2962f0cb87 | 866 | py | Python | scripts/deployment/deploy_multisig_keyholders.py | JohnAllerdyce/Sovryn-smart-contracts | e0dc44582b4e4ae2fc1bc3f9a7d775384c69d169 | [
"Apache-2.0"
] | 108 | 2020-08-30T17:52:32.000Z | 2022-02-26T00:00:15.000Z | scripts/deployment/deploy_multisig_keyholders.py | JohnAllerdyce/Sovryn-smart-contracts | e0dc44582b4e4ae2fc1bc3f9a7d775384c69d169 | [
"Apache-2.0"
] | 181 | 2020-08-24T09:28:53.000Z | 2022-02-11T13:22:22.000Z | scripts/deployment/deploy_multisig_keyholders.py | JohnAllerdyce/Sovryn-smart-contracts | e0dc44582b4e4ae2fc1bc3f9a7d775384c69d169 | [
"Apache-2.0"
] | 36 | 2020-09-10T07:53:41.000Z | 2022-03-26T00:35:30.000Z | from brownie import *
import json
def main():
thisNetwork = network.show_active()
if thisNetwork == "development":
acct = accounts[0]
# configFile = open('./scripts/contractInteraction/testnet_contracts.json')
elif thisNetwork == "testnet" or thisNetwork == "rsk-mainnet":
acct = a... | 36.083333 | 84 | 0.700924 | from brownie import *
import json
def main():
thisNetwork = network.show_active()
if thisNetwork == "development":
acct = accounts[0]
elif thisNetwork == "testnet" or thisNetwork == "rsk-mainnet":
acct = accounts.load("rskdeployer")
else:
raise Exception("network not su... | true | true |
1c3fecd87798632e7d2525d71f35386553f5ecb5 | 10,785 | py | Python | pyplusplus/creators_factory/sort_algorithms.py | electronicvisions/pyplusplus | 4d88bb8754d22654a61202ae8adc222807953e38 | [
"BSL-1.0"
] | 5 | 2021-01-29T19:54:34.000Z | 2022-03-23T11:16:37.000Z | pyplusplus/creators_factory/sort_algorithms.py | electronicvisions/pyplusplus | 4d88bb8754d22654a61202ae8adc222807953e38 | [
"BSL-1.0"
] | null | null | null | pyplusplus/creators_factory/sort_algorithms.py | electronicvisions/pyplusplus | 4d88bb8754d22654a61202ae8adc222807953e38 | [
"BSL-1.0"
] | null | null | null | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from pygccxml import declarations
from pyplusplus import decl_wrappers
class COLOR:
WHITE = 0
GRAY = 1
BLACK = 2
... | 38.935018 | 141 | 0.612239 |
from pygccxml import declarations
from pyplusplus import decl_wrappers
class COLOR:
WHITE = 0
GRAY = 1
BLACK = 2
class class_organizer_t(object):
def __init__( self, decls, include_vars=False):
object.__init__( self )
self.__include_vars = include_vars
self.__classes = [x for... | true | true |
1c3fef2e535e5662f29af722fb99adb738d0b837 | 3,279 | py | Python | jwql/tests/test_calculations.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 42 | 2018-10-03T13:38:18.000Z | 2022-03-11T12:19:32.000Z | jwql/tests/test_calculations.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 723 | 2018-08-29T18:29:49.000Z | 2022-03-31T21:09:20.000Z | jwql/tests/test_calculations.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 30 | 2018-08-29T18:17:32.000Z | 2022-03-10T19:43:39.000Z | #! /usr/bin/env python
"""Tests for the ``calculations`` module.
Authors
-------
- Bryan Hilbert
Use
---
These tests can be run via the command line (omit the ``-s`` to
suppress verbose output to stdout):
::
pytest -s test_calculations.py
"""
import numpy as np
from jwql.utils import cal... | 30.933962 | 97 | 0.625801 |
import numpy as np
from jwql.utils import calculations
def test_double_gaussian_fit():
amplitude1 = 500
mean_value1 = 0.5
sigma_value1 = 0.05
amplitude2 = 300
mean_value2 = 0.4
sigma_value2 = 0.03
bin_centers = np.arange(0., 1.1, 0.007)
input_params = [amplitude1, mean_value1, sig... | true | true |
1c3fefba1ba14e9ffa62bb96df0e1e0d72ed83e9 | 94 | py | Python | output/models/saxon_data/simple/simple046_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/saxon_data/simple/simple046_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/saxon_data/simple/simple046_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.saxon_data.simple.simple046_xsd.simple046 import E
__all__ = [
"E",
]
| 15.666667 | 69 | 0.734043 | from output.models.saxon_data.simple.simple046_xsd.simple046 import E
__all__ = [
"E",
]
| true | true |
1c3feffbedeeffc98326325bf161e1a8938e3714 | 610 | py | Python | music/models.py | parthrao/Django-Rest | 7921be3de53b7992409ae0dc6e620925f63f9af0 | [
"Unlicense"
] | null | null | null | music/models.py | parthrao/Django-Rest | 7921be3de53b7992409ae0dc6e620925f63f9af0 | [
"Unlicense"
] | null | null | null | music/models.py | parthrao/Django-Rest | 7921be3de53b7992409ae0dc6e620925f63f9af0 | [
"Unlicense"
] | null | null | null | from django.db import models
# Create your models here.
class Album(models.Model):
artist = models.CharField(max_length=250)
album_title = models.CharField(max_length=500)
genre = models.CharField(max_length=100)
album_logo = models.CharField(max_length=1000)
def __str__(self):
return self.album_title + ' - ' ... | 30.5 | 59 | 0.77377 | from django.db import models
class Album(models.Model):
artist = models.CharField(max_length=250)
album_title = models.CharField(max_length=500)
genre = models.CharField(max_length=100)
album_logo = models.CharField(max_length=1000)
def __str__(self):
return self.album_title + ' - ' + self.artist
class Song(... | true | true |
1c3ff1466c2b4efc9a30b95f8f66043026bac9d5 | 3,076 | py | Python | 2020/day/11/seating.py | mboos/advent-of-code | 4477bb32c50b951b0a1be4850ed28a2c6f78e65d | [
"Apache-2.0"
] | null | null | null | 2020/day/11/seating.py | mboos/advent-of-code | 4477bb32c50b951b0a1be4850ed28a2c6f78e65d | [
"Apache-2.0"
] | null | null | null | 2020/day/11/seating.py | mboos/advent-of-code | 4477bb32c50b951b0a1be4850ed28a2c6f78e65d | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
"""
Solution to https://adventofcode.com/2020/day/11
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
from collections import Counter
FLAGS = flags.FLAGS
flags.DEFINE_string("input", None, "... | 25.848739 | 78 | 0.575423 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
from collections import Counter
FLAGS = flags.FLAGS
flags.DEFINE_string("input", None, "Input file.")
flags.mark_flag_as_required("input")
def count_neighbours(s... | true | true |
1c3ff15c8a420e719e49ef9f29e7361f57a3b52b | 5,623 | py | Python | network/detecthead.py | 530824679/side_camera_perception | b83fb67b3128a048477def1330bac56f703766e6 | [
"MIT"
] | null | null | null | network/detecthead.py | 530824679/side_camera_perception | b83fb67b3128a048477def1330bac56f703766e6 | [
"MIT"
] | null | null | null | network/detecthead.py | 530824679/side_camera_perception | b83fb67b3128a048477def1330bac56f703766e6 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# coding=utf-8
#================================================================
# Copyright (C) 2020 * Ltd. All rights reserved.
#
# Editor : pycharm
# File name : train.py
# Author : oscar chen
# Created date: 2020-10-13 9:50:26
# Description :
#
#======================... | 57.377551 | 215 | 0.688067 |
import os
import numpy as np
import tensorflow as tf
from network.ops import conv2d, batch_normalization
from network.backbone import darknet53
class Model(object):
def __init__(self, norm_epsilon, norm_decay, classes_path, anchors_path, pre_train):
self.norm_epsilon = norm_epsilon
self.norm_decay... | true | true |
1c3ff197fb1a5a69165b018285460b36c006c720 | 5,726 | py | Python | zenml/core/steps/split/categorical_ratio_split_step.py | Camicb/zenml | 92788a76c7923a30612c5f5bdaaf5bb9554773a1 | [
"Apache-2.0"
] | 1 | 2021-05-04T17:11:23.000Z | 2021-05-04T17:11:23.000Z | zenml/core/steps/split/categorical_ratio_split_step.py | I-m-Zee/zenml | c0bfd70716c0cfed5ec825f467ab04b7bd97343e | [
"Apache-2.0"
] | null | null | null | zenml/core/steps/split/categorical_ratio_split_step.py | I-m-Zee/zenml | c0bfd70716c0cfed5ec825f467ab04b7bd97343e | [
"Apache-2.0"
] | 1 | 2020-12-27T08:16:42.000Z | 2020-12-27T08:16:42.000Z | # Copyright (c) maiot GmbH 2020. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.102941 | 79 | 0.663465 |
from typing import Text, List, Dict, Union
from zenml.core.steps.split import constants
from zenml.core.steps.split.base_split_step import BaseSplit
from zenml.core.steps.split.categorical_domain_split_step import \
CategoricalPartitionFn
from zenml.core.steps.split.utils import partition_cat_list
CategoricalVal... | true | true |
1c3ff1bdd5bd4f35b40e41df990e6222f62c69db | 16,550 | py | Python | docker-compose/core-network.py | kukkalli/oai-cn5g-fed | 15634fac935ac8671b61654bdf75bf8af07d3c3a | [
"Apache-2.0"
] | null | null | null | docker-compose/core-network.py | kukkalli/oai-cn5g-fed | 15634fac935ac8671b61654bdf75bf8af07d3c3a | [
"Apache-2.0"
] | null | null | null | docker-compose/core-network.py | kukkalli/oai-cn5g-fed | 15634fac935ac8671b61654bdf75bf8af07d3c3a | [
"Apache-2.0"
] | null | null | null | """
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version ... | 45.218579 | 194 | 0.603686 |
import yaml
import re
import subprocess
import time
import logging
import argparse
import sys
logging.basicConfig(
level=logging.DEBUG,
stream=sys.stdout,
format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s"
)
MINI_W_NRF = 'docker-compose-mini-nrf.yaml'
MINI_NO_NRF = 'docker-compose-mini-nonrf.yam... | true | true |
1c3ff1dd2ff12e899dc1584fe534fb5dbf17b99d | 2,578 | py | Python | camkes/parser/stage6.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/parser/stage6.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/parser/stage6.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE... | 29.632184 | 79 | 0.703646 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from camkes.internal.seven import cmp, filter, map, zip
from .base import Transformer
from camkes.ast import Assembly, Composition, Configuration, Group, \
TraversalAction
from .exception import ParseError
def precondition... | true | true |
1c3ff2bbb22ab4f99787b4f2b0fe0a3023f613cf | 10,932 | py | Python | pystac_client/stac_api_io.py | ocefpaf/pystac-client | ddf0e0566b2b1783a4d32d3d77f9f51b80270df3 | [
"Apache-2.0"
] | 52 | 2021-04-15T23:24:12.000Z | 2022-03-09T23:02:27.000Z | pystac_client/stac_api_io.py | ocefpaf/pystac-client | ddf0e0566b2b1783a4d32d3d77f9f51b80270df3 | [
"Apache-2.0"
] | 119 | 2021-04-13T11:42:01.000Z | 2022-02-24T10:02:35.000Z | pystac_client/stac_api_io.py | ocefpaf/pystac-client | ddf0e0566b2b1783a4d32d3d77f9f51b80270df3 | [
"Apache-2.0"
] | 14 | 2021-04-13T19:00:19.000Z | 2022-02-23T09:17:30.000Z | from copy import deepcopy
import json
import logging
from typing import (
Any,
Dict,
Iterator,
List,
Optional,
TYPE_CHECKING,
Union,
)
from urllib.parse import urlparse
import re
from requests import Request, Session
import pystac
from pystac.link import Link
from pystac.serialization impor... | 41.25283 | 117 | 0.589005 | from copy import deepcopy
import json
import logging
from typing import (
Any,
Dict,
Iterator,
List,
Optional,
TYPE_CHECKING,
Union,
)
from urllib.parse import urlparse
import re
from requests import Request, Session
import pystac
from pystac.link import Link
from pystac.serialization impor... | true | true |
1c3ff4337d079b6133dc0b44d79eca6a3b4a2637 | 1,919 | py | Python | scrap_from_cusat.py | abinshoby/Malayalam-word-net | c7c3f5915d9fc59f96a381c2d35a65f6bbdd3b43 | [
"MIT"
] | null | null | null | scrap_from_cusat.py | abinshoby/Malayalam-word-net | c7c3f5915d9fc59f96a381c2d35a65f6bbdd3b43 | [
"MIT"
] | null | null | null | scrap_from_cusat.py | abinshoby/Malayalam-word-net | c7c3f5915d9fc59f96a381c2d35a65f6bbdd3b43 | [
"MIT"
] | null | null | null | #from cusat using api
# -*- coding: utf-8 -*-
import requests
import csv
import sqlite3
import json
from sqlite3 import Error
import unicodedata
def add_to_csv(l):
f = open('test6_cusat.csv',"a")
csv_file = csv.writer(f)
l = json.loads(l)
csv_file.writerow([str(l[0]['sid']), l[0]['synset'] ,l[0]['meanin... | 24.922078 | 161 | 0.581553 | import requests
import csv
import sqlite3
import json
from sqlite3 import Error
import unicodedata
def add_to_csv(l):
f = open('test6_cusat.csv',"a")
csv_file = csv.writer(f)
l = json.loads(l)
csv_file.writerow([str(l[0]['sid']), l[0]['synset'] ,l[0]['meaning'] , l[0]['pos']] + l[0]['hypernym'] + l[0]['... | true | true |
1c3ff4ce33f9efe7358a1f50a8174fa7eefaac36 | 8,417 | py | Python | pointmvsnet/networks.py | MarcWong/PointMVSNet | b48f20f3695eb4418f522daedb60e7329eebf05f | [
"MIT"
] | 419 | 2019-08-13T06:03:32.000Z | 2022-03-29T06:26:08.000Z | pointmvsnet/networks.py | MarcWong/PointMVSNet | b48f20f3695eb4418f522daedb60e7329eebf05f | [
"MIT"
] | 31 | 2019-08-20T19:25:14.000Z | 2022-03-30T05:14:39.000Z | pointmvsnet/networks.py | MarcWong/PointMVSNet | b48f20f3695eb4418f522daedb60e7329eebf05f | [
"MIT"
] | 99 | 2019-08-13T08:52:46.000Z | 2022-03-20T08:30:22.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from pointmvsnet.functions.gather_knn import gather_knn
from pointmvsnet.nn.conv import *
class EdgeConv(nn.Module):
def __init__(self, in_channels, out_channels):
super(EdgeConv, self).__init__()
self.conv1 = nn.Conv1d(in_channe... | 40.466346 | 107 | 0.653439 | import torch
import torch.nn as nn
import torch.nn.functional as F
from pointmvsnet.functions.gather_knn import gather_knn
from pointmvsnet.nn.conv import *
class EdgeConv(nn.Module):
def __init__(self, in_channels, out_channels):
super(EdgeConv, self).__init__()
self.conv1 = nn.Conv1d(in_channe... | true | true |
1c3ff586b6fbef23eed4818abfd348673ee07652 | 2,762 | py | Python | chars/hud_scripts/HUDTester.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 27 | 2016-01-13T14:16:13.000Z | 2022-01-03T05:38:44.000Z | chars/hud_scripts/HUDTester.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 1 | 2017-04-29T00:51:26.000Z | 2017-04-29T00:54:43.000Z | chars/hud_scripts/HUDTester.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 14 | 2016-01-20T21:02:37.000Z | 2020-07-19T05:47:20.000Z | from bge import logic
from link_scripts.Gamepad import Gamepad
from hud_scripts.MessageBox import MessageBoxMode
from link_scripts.GameInit import initGame
from link_scripts.PlayerInventory import *
scene = logic.getCurrentScene()
def test(cont):
own = cont.owner
inventory = scene.objects['Inventory']
if... | 38.901408 | 307 | 0.658219 | from bge import logic
from link_scripts.Gamepad import Gamepad
from hud_scripts.MessageBox import MessageBoxMode
from link_scripts.GameInit import initGame
from link_scripts.PlayerInventory import *
scene = logic.getCurrentScene()
def test(cont):
own = cont.owner
inventory = scene.objects['Inventory']
if... | true | true |
1c3ff62f20f5327454cb556b874ff0cd2bb8a5d3 | 3,602 | py | Python | build.py | sfaleron/march-for-science-2017-sign | 9af7d41a734df1ca8f225f2fbea652169e323185 | [
"Apache-2.0"
] | null | null | null | build.py | sfaleron/march-for-science-2017-sign | 9af7d41a734df1ca8f225f2fbea652169e323185 | [
"Apache-2.0"
] | null | null | null | build.py | sfaleron/march-for-science-2017-sign | 9af7d41a734df1ca8f225f2fbea652169e323185 | [
"Apache-2.0"
] | null | null | null |
from __future__ import print_function
### Copyright 2017 Christopher Fuller
###
### 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
##... | 30.525424 | 112 | 0.574958 |
from __future__ import print_function
# expects to be run from project's root
SVG = 'src/sign.svg'
import sys
from string import Template
import xml.etree.ElementTree as ET
TMPLS = {
'outer' : [ Template(s) if s else None for s in (
'inkscape -Cj -i $id -y 255 --export-pdf=tmp/${name}1.pdf $svg',
... | true | true |
1c3ff6645dcf5bed9eac830cbeb144b7de90e41f | 2,667 | py | Python | slap.py | LokiL/troutslapbot | ddc4b9e2e3fb37f09882ee197dadd173dcccadfb | [
"MIT"
] | null | null | null | slap.py | LokiL/troutslapbot | ddc4b9e2e3fb37f09882ee197dadd173dcccadfb | [
"MIT"
] | null | null | null | slap.py | LokiL/troutslapbot | ddc4b9e2e3fb37f09882ee197dadd173dcccadfb | [
"MIT"
] | null | null | null | #!/usr/bin/python
import time
import requests
import sys
if (len(sys.argv) < 2):
print("Usage:")
print(" slap.py <bot_token>")
exit(1)
botapi_url = 'https://api.telegram.org/bot'
token = sys.argv[1]
endpoint = botapi_url + token
offset = 0
print(time.ctime(), ': bot started')
while(True):
try:
... | 38.1 | 91 | 0.425197 |
import time
import requests
import sys
if (len(sys.argv) < 2):
print("Usage:")
print(" slap.py <bot_token>")
exit(1)
botapi_url = 'https://api.telegram.org/bot'
token = sys.argv[1]
endpoint = botapi_url + token
offset = 0
print(time.ctime(), ': bot started')
while(True):
try:
method = 'getUp... | true | true |
1c3ff6a03a9eb1d011ed4514c214a6fdf8f75813 | 23,810 | py | Python | src/UIOverlay.py | alexberryman/poe-archnemesis-scanner | 0f274748cbde9d3ebe2e15af59e58c7bf2aa239c | [
"Apache-2.0"
] | null | null | null | src/UIOverlay.py | alexberryman/poe-archnemesis-scanner | 0f274748cbde9d3ebe2e15af59e58c7bf2aa239c | [
"Apache-2.0"
] | null | null | null | src/UIOverlay.py | alexberryman/poe-archnemesis-scanner | 0f274748cbde9d3ebe2e15af59e58c7bf2aa239c | [
"Apache-2.0"
] | null | null | null | from configparser import ConfigParser
import keyboard
import tkinter as tk
import sys
from win32clipboard import OpenClipboard, EmptyClipboard, SetClipboardText, CloseClipboard
from typing import Dict, List, Tuple
from DataClasses import PoeWindowInfo
from ArchnemesisItemsMap import ArchnemesisItemsMap
from ImageScann... | 47.52495 | 216 | 0.663251 | from configparser import ConfigParser
import keyboard
import tkinter as tk
import sys
from win32clipboard import OpenClipboard, EmptyClipboard, SetClipboardText, CloseClipboard
from typing import Dict, List, Tuple
from DataClasses import PoeWindowInfo
from ArchnemesisItemsMap import ArchnemesisItemsMap
from ImageScann... | true | true |
1c3ff6b906e239981544effbc56300d40607524e | 1,365 | py | Python | pysynphot/test/test_spectral_element.py | lheinke/pysynphot | b4a5eda2a6227b2f5782da22140f00fc087439cb | [
"BSD-3-Clause"
] | 24 | 2015-01-04T23:38:21.000Z | 2022-02-01T00:11:07.000Z | pysynphot/test/test_spectral_element.py | lheinke/pysynphot | b4a5eda2a6227b2f5782da22140f00fc087439cb | [
"BSD-3-Clause"
] | 126 | 2015-01-29T14:50:37.000Z | 2022-02-15T01:58:13.000Z | pysynphot/test/test_spectral_element.py | lheinke/pysynphot | b4a5eda2a6227b2f5782da22140f00fc087439cb | [
"BSD-3-Clause"
] | 25 | 2015-02-09T12:12:02.000Z | 2021-09-09T13:06:54.000Z | from __future__ import absolute_import, division, print_function
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ..obsbandpass import ObsBandpass
from ..spectrum import ArraySpectralElement
def test_sample_units():
"""Test that SpectralElement.sample respects internal units."""
... | 29.673913 | 71 | 0.668864 | from __future__ import absolute_import, division, print_function
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ..obsbandpass import ObsBandpass
from ..spectrum import ArraySpectralElement
def test_sample_units():
defwave = np.linspace(0.1, 1, 10)
s = ArraySpectralElement(de... | true | true |
1c3ff702ef6060894785080eb31a5db45d17ab8c | 1,321 | py | Python | Manny.CIFAR/CIFAR/CIFARPlotter.py | MannyGrewal/Manny.CIFAR | 03aefd7d89728a31e9bf6d0e44f083315816d289 | [
"MIT"
] | null | null | null | Manny.CIFAR/CIFAR/CIFARPlotter.py | MannyGrewal/Manny.CIFAR | 03aefd7d89728a31e9bf6d0e44f083315816d289 | [
"MIT"
] | null | null | null | Manny.CIFAR/CIFAR/CIFARPlotter.py | MannyGrewal/Manny.CIFAR | 03aefd7d89728a31e9bf6d0e44f083315816d289 | [
"MIT"
] | null | null | null | import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pylab
########################################################################
# 2017 - Manny Grewal
# Purpose of this class is to visualise a list of images from the CIFAR dataset
# How many columns to show... | 34.763158 | 94 | 0.660106 | import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pylab
MAX_COLS = 5
def PlotImages(arrayImages,arrayClassLabels,reShapeRequired=False):
totalImages=len(arrayImages)
if(reShapeRequired==True):
arrayImages = np.reshape(arrayImages, (totalIma... | true | true |
1c3ff82c8412663f83da8432c464a6225eacbbd2 | 23,071 | py | Python | tests/test_dataset_common.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | 2 | 2021-01-27T15:43:23.000Z | 2021-03-13T11:04:30.000Z | tests/test_dataset_common.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | null | null | null | tests/test_dataset_common.py | dkajtoch/datasets | 12ef7f0d541a5aca5b29ebc2dddf5e1214f0e3e9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 43.04291 | 168 | 0.635473 |
import glob
import os
import tempfile
import warnings
from functools import wraps
from multiprocessing import Pool
from typing import List, Optional
from unittest import TestCase
from absl.testing import parameterized
from datasets import (
BuilderConfig,
DatasetBuilder,
DownloadConfig,
Features,
... | true | true |
1c3ff83f7aed1ddf9f7b04a5468bb69fb1e9f9d7 | 4,389 | py | Python | chia/wallet/transaction_record.py | Hydrangea-Network/hydrangea-blockchain-1.3.0 | 241381a87366602ab35136c49536ff6e3e84c3da | [
"Apache-2.0"
] | 1 | 2022-03-20T14:52:23.000Z | 2022-03-20T14:52:23.000Z | chia/wallet/transaction_record.py | Hydrangea-Network/hydrangea-blockchain-1.3.0 | 241381a87366602ab35136c49536ff6e3e84c3da | [
"Apache-2.0"
] | null | null | null | chia/wallet/transaction_record.py | Hydrangea-Network/hydrangea-blockchain-1.3.0 | 241381a87366602ab35136c49536ff6e3e84c3da | [
"Apache-2.0"
] | 1 | 2022-03-20T14:51:39.000Z | 2022-03-20T14:51:39.000Z | from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict
from chia.consensus.coinbase import pool_parent_id, farmer_parent_id, timelord_parent_id
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.mempool_inclusion_sta... | 42.61165 | 99 | 0.673046 | from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict
from chia.consensus.coinbase import pool_parent_id, farmer_parent_id, timelord_parent_id
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.mempool_inclusion_sta... | true | true |
1c3ff86e371ed76b9e4a252ad92846827c7c3820 | 7,026 | py | Python | venv/Lib/site-packages/sklearn/neural_network/_base.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/neural_network/_base.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/neural_network/_base.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | null | null | null | """Utilities for the neural network modules
"""
# Author: Issam H. Laradji <issam.laradji@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy.special import expit as logistic_sigmoid
from scipy.special import xlogy
def identity(X):
"""Simply return the input array.
Parameters
... | 28.104 | 80 | 0.615571 |
import numpy as np
from scipy.special import expit as logistic_sigmoid
from scipy.special import xlogy
def identity(X):
return X
def logistic(X):
return logistic_sigmoid(X, out=X)
def tanh(X):
return np.tanh(X, out=X)
def relu(X):
np.clip(X, 0, np.finfo(X.dtype).max, out=... | true | true |
1c3ff8ac816503ffde423cc95cb5ce90b8da1b2e | 3,424 | py | Python | ptm/lda_gibbs.py | YLTsai0609/python-topic-modeling | 13f6e22d31ebc581cc1bd68e1b05ec560020248d | [
"Apache-2.0"
] | null | null | null | ptm/lda_gibbs.py | YLTsai0609/python-topic-modeling | 13f6e22d31ebc581cc1bd68e1b05ec560020248d | [
"Apache-2.0"
] | null | null | null | ptm/lda_gibbs.py | YLTsai0609/python-topic-modeling | 13f6e22d31ebc581cc1bd68e1b05ec560020248d | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import time
import numpy as np
from scipy.special import gammaln
from six.moves import xrange
from .base import BaseGibbsParamTopicModel
from .formatted_logger import formatted_logger
from .utils import sampling_from_dist
logger = formatted_logger("GibbsLDA")
class GibbsLDA(B... | 29.016949 | 83 | 0.521904 | from __future__ import print_function
import time
import numpy as np
from scipy.special import gammaln
from six.moves import xrange
from .base import BaseGibbsParamTopicModel
from .formatted_logger import formatted_logger
from .utils import sampling_from_dist
logger = formatted_logger("GibbsLDA")
class GibbsLDA(B... | true | true |
1c3ff995ba9abf5e372fb993b2378255bd9a7db1 | 4,026 | py | Python | model/resnet.py | RKorzeniowski/Cutout | 932a612d80071dd378c568a1633c711690de8608 | [
"ECL-2.0"
] | 460 | 2017-11-30T14:36:51.000Z | 2022-03-26T10:24:07.000Z | model/resnet.py | RKorzeniowski/Cutout | 932a612d80071dd378c568a1633c711690de8608 | [
"ECL-2.0"
] | 15 | 2018-06-12T13:42:36.000Z | 2022-02-18T01:57:52.000Z | model/resnet.py | RKorzeniowski/Cutout | 932a612d80071dd378c568a1633c711690de8608 | [
"ECL-2.0"
] | 150 | 2018-01-22T14:35:16.000Z | 2022-03-30T18:42:10.000Z | '''ResNet18/34/50/101/152 in Pytorch.'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)
class BasicBlock(nn.Module):... | 33.831933 | 102 | 0.631148 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(self... | true | true |
1c3ffa41c6f3e5bfc799516f57d14fa6f67806a9 | 4,315 | py | Python | vae.py | MarkintoshZ/FontTransformer | 5051db0d38a4b8ae7602fb22c75c008f9f59d2d1 | [
"MIT"
] | null | null | null | vae.py | MarkintoshZ/FontTransformer | 5051db0d38a4b8ae7602fb22c75c008f9f59d2d1 | [
"MIT"
] | null | null | null | vae.py | MarkintoshZ/FontTransformer | 5051db0d38a4b8ae7602fb22c75c008f9f59d2d1 | [
"MIT"
] | null | null | null | from keras.layers import Dense, Conv2D, Deconvolution2D, \
MaxPool2D, UpSampling2D, Flatten, Dropout, Reshape,\
Concatenate, Lambda
from keras.models import Sequential, Model, load_model, Input
from keras.losses import mse, categorical_crossentropy
from keras.utils import to_categorical
from keras import backen... | 33.192308 | 78 | 0.689455 | from keras.layers import Dense, Conv2D, Deconvolution2D, \
MaxPool2D, UpSampling2D, Flatten, Dropout, Reshape,\
Concatenate, Lambda
from keras.models import Sequential, Model, load_model, Input
from keras.losses import mse, categorical_crossentropy
from keras.utils import to_categorical
from keras import backen... | true | true |
1c3ffaec1a29ef25b021b63a4fcd78bed2b78692 | 3,785 | py | Python | thorpy/miscgui/functions.py | YannThorimbert/Torus | 367b1de7b6a2751a8dd5ecbfa8946bbd6bf2e580 | [
"MIT"
] | 2 | 2019-05-29T16:17:29.000Z | 2021-08-15T23:41:52.000Z | thorpy/miscgui/functions.py | YannThorimbert/Torus | 367b1de7b6a2751a8dd5ecbfa8946bbd6bf2e580 | [
"MIT"
] | null | null | null | thorpy/miscgui/functions.py | YannThorimbert/Torus | 367b1de7b6a2751a8dd5ecbfa8946bbd6bf2e580 | [
"MIT"
] | 1 | 2019-04-22T18:42:35.000Z | 2019-04-22T18:42:35.000Z | import pygame.event as pygame_event
import pygame
from thorpy.miscgui import constants, application, parameters
def obtain_valid_painter(painter_class, **kwargs):
"""Returns a valid painter whose class is <painter_class>. You can try any
argument you want ; only arguments existing in painter's __init__ metho... | 31.280992 | 78 | 0.684808 | import pygame.event as pygame_event
import pygame
from thorpy.miscgui import constants, application, parameters
def obtain_valid_painter(painter_class, **kwargs):
try:
painter = painter_class(**kwargs)
except TypeError:
painter = painter_class()
args_okay = {}
for arg in kwarg... | true | true |
1c3ffe0e7312e14c944b616c7e6c57c5b159664d | 2,662 | py | Python | mango/placedorder.py | dendisuhubdy/mango-explorer | d49294f2cd8d3521062e228013e240b193909ca8 | [
"MIT"
] | null | null | null | mango/placedorder.py | dendisuhubdy/mango-explorer | d49294f2cd8d3521062e228013e240b193909ca8 | [
"MIT"
] | null | null | null | mango/placedorder.py | dendisuhubdy/mango-explorer | d49294f2cd8d3521062e228013e240b193909ca8 | [
"MIT"
] | null | null | null | # # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 40.953846 | 198 | 0.717506 |
import typing
from decimal import Decimal
from .orders import Side
class PlacedOrder(typing.NamedTuple):
id: int
client_id: int
side: Side
@staticmethod
def build_from_open_orders_data(free_slot_bits: Decimal, is_bid_bits: Decimal, order_ids: typing.Sequence[Decimal], client_order_ids: typing... | true | true |
1c3ffe11d33e1d6f639ee0ab88dbc29ee217b249 | 82,816 | py | Python | tools/tensorflow_docs/api_generator/parser.py | abhi13-nitb/docs | 8deb998a040ecf17b8887cf568fa919e16243560 | [
"Apache-2.0"
] | null | null | null | tools/tensorflow_docs/api_generator/parser.py | abhi13-nitb/docs | 8deb998a040ecf17b8887cf568fa919e16243560 | [
"Apache-2.0"
] | null | null | null | tools/tensorflow_docs/api_generator/parser.py | abhi13-nitb/docs | 8deb998a040ecf17b8887cf568fa919e16243560 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 32.798416 | 118 | 0.676137 |
import ast
import collections
import enum
import functools
import inspect
import itertools
import json
import os
import re
import textwrap
import typing
from typing import Any, Dict, List, Tuple, Iterable, NamedTuple, Optional, Union
import astor
from tensorflow_docs.api_generator import doc_controls
from tensorflo... | true | true |
1c3ffe2cf70624885065508ede4bcba03719650b | 93 | py | Python | UpDownMethods/__init__.py | codles/UpDownMethods | 948e469e1d26da85ff620e566be7a104cdf33530 | [
"MIT"
] | 1 | 2016-10-31T02:16:39.000Z | 2016-10-31T02:16:39.000Z | UpDownMethods/__init__.py | codles/UpDownMethods | 948e469e1d26da85ff620e566be7a104cdf33530 | [
"MIT"
] | null | null | null | UpDownMethods/__init__.py | codles/UpDownMethods | 948e469e1d26da85ff620e566be7a104cdf33530 | [
"MIT"
] | null | null | null | from plot import *
from process import *
from updownmethods import *
from procedure import *
| 18.6 | 27 | 0.784946 | from plot import *
from process import *
from updownmethods import *
from procedure import *
| true | true |
1c3ffe2e7ff0758cfd78cf696fe6c81519bb4e70 | 2,660 | py | Python | scripts/pulse-view/pygraphGL_multsine.py | jsheedy/biofeedback-cube | 178a518d70fdf0dfa3b51226a2a97dbfa68a0543 | [
"Unlicense"
] | 2 | 2022-03-03T04:07:06.000Z | 2022-03-15T15:59:20.000Z | scripts/pulse-view/pygraphGL_multsine.py | jsheedy/biofeedback-cube | 178a518d70fdf0dfa3b51226a2a97dbfa68a0543 | [
"Unlicense"
] | null | null | null | scripts/pulse-view/pygraphGL_multsine.py | jsheedy/biofeedback-cube | 178a518d70fdf0dfa3b51226a2a97dbfa68a0543 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Animated 3D sinc function
requires:
1. pyqtgraph
- download from here http://www.pyqtgraph.org/
2. pyopenGL
- if you have Anaconda, run the following command
>>> conda install -c anaconda pyopengl
"""
from pyqtgraph.Qt... | 29.88764 | 80 | 0.515038 |
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
import sys
import time
class Visualizer(object):
def __init__(self):
self.traces = dict()
self.app = QtGui.QApplication(sys.argv)
self.w = gl.GLViewWidget()
... | true | true |
1c3ffe94b14dd3e7b2ece143d99bc6e06579c84c | 19,813 | py | Python | fairseq/data/iterators.py | Epsilon-Lee/fairseq-da | fbe7a39717afcb60dd4a3e1cd6abd3c763354fe1 | [
"MIT"
] | 6 | 2021-07-03T10:16:13.000Z | 2021-09-22T18:15:23.000Z | fairseq/data/iterators.py | Epsilon-Lee/fairseq-da | fbe7a39717afcb60dd4a3e1cd6abd3c763354fe1 | [
"MIT"
] | null | null | null | fairseq/data/iterators.py | Epsilon-Lee/fairseq-da | fbe7a39717afcb60dd4a3e1cd6abd3c763354fe1 | [
"MIT"
] | 3 | 2021-07-14T13:12:19.000Z | 2021-12-04T08:46:29.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 itertools
import logging
import math
import operator
import os
import queue
import time
from threading import Thread
import numpy as n... | 33.984563 | 94 | 0.604401 |
import itertools
import logging
import math
import operator
import os
import queue
import time
from threading import Thread
import numpy as np
import torch
from fairseq.data import data_utils
logger = logging.getLogger(__name__)
_sentinel = object()
class CountingIterator(object):
def __init__(self, iterabl... | true | true |
1c4001234382c3c924fd3f3bd6638f4fdf34b0b8 | 287 | py | Python | ctfproblems/Lovelace/90_lottery_pt2/grader.py | milesmcc/pactf-2018 | cfd9d94a7b6828259220f52ab3c5893a28429c62 | [
"MIT"
] | null | null | null | ctfproblems/Lovelace/90_lottery_pt2/grader.py | milesmcc/pactf-2018 | cfd9d94a7b6828259220f52ab3c5893a28429c62 | [
"MIT"
] | null | null | null | ctfproblems/Lovelace/90_lottery_pt2/grader.py | milesmcc/pactf-2018 | cfd9d94a7b6828259220f52ab3c5893a28429c62 | [
"MIT"
] | null | null | null | def grade(key, submission):
if submission == "3956993139":
return True, "You untwisted it and mastered fate itself! That's worth 65 points; sort of anticlimactic..."
else:
return False, "Fate remains untwisted! Is there any way to master random chance itself..."
| 47.833333 | 114 | 0.69338 | def grade(key, submission):
if submission == "3956993139":
return True, "You untwisted it and mastered fate itself! That's worth 65 points; sort of anticlimactic..."
else:
return False, "Fate remains untwisted! Is there any way to master random chance itself..."
| true | true |
1c400335e23bb7eebf107a65485cbca1209d221c | 517 | py | Python | array/python3/21_subarray_with_sum_zero.py | suvambasak/cp | e015b662a4b8906d3363322c10a896e3cef0e69f | [
"MIT"
] | null | null | null | array/python3/21_subarray_with_sum_zero.py | suvambasak/cp | e015b662a4b8906d3363322c10a896e3cef0e69f | [
"MIT"
] | 1 | 2021-02-28T20:17:32.000Z | 2021-02-28T20:17:32.000Z | array/python3/21_subarray_with_sum_zero.py | scodebox/cp | e015b662a4b8906d3363322c10a896e3cef0e69f | [
"MIT"
] | 1 | 2020-12-12T18:36:24.000Z | 2020-12-12T18:36:24.000Z | # Calculate all prefix sum
# 1 > If any prefix sum repeats -> True
# 2 > If any prefix sum is zero -> True
# TC: O(n) | SC: O(n)
def solution_1(arr):
sum = 0
sum_set = set()
for num in arr:
sum += num
if 0 == sum or sum in sum_set:
return True
sum_set.add(sum)
... | 19.884615 | 43 | 0.510638 |
def solution_1(arr):
sum = 0
sum_set = set()
for num in arr:
sum += num
if 0 == sum or sum in sum_set:
return True
sum_set.add(sum)
return False
if __name__ == '__main__':
arr = [4, 2, -3, 1, 6] arr = [4, 2, 0, 1, 6] arr = [-3, 2, 3, 1, 6]
p... | true | true |
1c4003585f72e25173366417eabfafae167b215a | 27,603 | py | Python | session0/ecc.py | jimmysong/pw-exercises | 8d7fc065e9fe01399fa240ff88a7b1557901defb | [
"MIT"
] | 8 | 2019-02-21T04:22:48.000Z | 2020-07-24T11:03:16.000Z | session0/ecc.py | jimmysong/pw-exercises | 8d7fc065e9fe01399fa240ff88a7b1557901defb | [
"MIT"
] | null | null | null | session0/ecc.py | jimmysong/pw-exercises | 8d7fc065e9fe01399fa240ff88a7b1557901defb | [
"MIT"
] | 2 | 2020-01-23T16:24:16.000Z | 2020-02-10T23:00:29.000Z | from io import BytesIO
from random import randint
from unittest import TestCase
import hmac
import hashlib
from helper import (
big_endian_to_int,
encode_base58_checksum,
hash160,
hash256,
int_to_big_endian,
raw_decode_base58,
)
class FieldElement:
def __init__(self, num, prime):
... | 35.479434 | 165 | 0.566786 | from io import BytesIO
from random import randint
from unittest import TestCase
import hmac
import hashlib
from helper import (
big_endian_to_int,
encode_base58_checksum,
hash160,
hash256,
int_to_big_endian,
raw_decode_base58,
)
class FieldElement:
def __init__(self, num, prime):
... | true | true |
1c4006aa0d55930f34f8dd6c895baeb0c2c04c55 | 964 | py | Python | infinitd_server/handler/debug_battle_input.py | rhofour/InfiniTDBackend | 8763d64a82d02e4282abff5419e1ab256af41d7e | [
"MIT"
] | null | null | null | infinitd_server/handler/debug_battle_input.py | rhofour/InfiniTDBackend | 8763d64a82d02e4282abff5419e1ab256af41d7e | [
"MIT"
] | null | null | null | infinitd_server/handler/debug_battle_input.py | rhofour/InfiniTDBackend | 8763d64a82d02e4282abff5419e1ab256af41d7e | [
"MIT"
] | null | null | null | import cattr
from infinitd_server.battle_computer import BattleCalculationException
from infinitd_server.game import Game
from infinitd_server.handler.base import BaseHandler
class DebugBattleInputHandler(BaseHandler):
game: Game # See https://github.com/google/pytype/issues/652
def get(self, attackerName, d... | 35.703704 | 93 | 0.665975 | import cattr
from infinitd_server.battle_computer import BattleCalculationException
from infinitd_server.game import Game
from infinitd_server.handler.base import BaseHandler
class DebugBattleInputHandler(BaseHandler):
game: Game
def get(self, attackerName, defenderName):
self.logInfo(f"Trying to dow... | true | true |
1c4007c0021d8943500c88dc970ef3782332364a | 146 | py | Python | 6kyu/(6 kyu) CamelCase Method/(6 kyu) CamelCase Method.py | e1r0nd/codewars | dc98484281345e7675eb5e8a51c192e2fa77c443 | [
"MIT"
] | 49 | 2018-04-30T06:42:45.000Z | 2021-07-22T16:39:02.000Z | (6 kyu) CamelCase Method/(6 kyu) CamelCase Method.py | novsunheng/codewars | c54b1d822356889b91587b088d02ca0bd3d8dc9e | [
"MIT"
] | 1 | 2020-08-31T02:36:53.000Z | 2020-08-31T10:14:00.000Z | (6 kyu) CamelCase Method/(6 kyu) CamelCase Method.py | novsunheng/codewars | c54b1d822356889b91587b088d02ca0bd3d8dc9e | [
"MIT"
] | 25 | 2018-04-02T20:57:58.000Z | 2021-05-28T15:24:51.000Z | def camel_case(string):
# #1
# return "".join(c.capitalize() for c in string.split())
# #2
return string.title().replace(" ", "")
| 24.333333 | 60 | 0.568493 | def camel_case(string):
return string.title().replace(" ", "")
| true | true |
1c4007ea8923b4de35b22c4e30e314948e3d4ee2 | 1,604 | py | Python | setup.py | frafra/django-dataporten | 4236017611e08d08bd810be0beae1b994cb5fc67 | [
"MIT"
] | null | null | null | setup.py | frafra/django-dataporten | 4236017611e08d08bd810be0beae1b994cb5fc67 | [
"MIT"
] | null | null | null | setup.py | frafra/django-dataporten | 4236017611e08d08bd810be0beae1b994cb5fc67 | [
"MIT"
] | null | null | null | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-dataporten',
... | 30.846154 | 79 | 0.596633 | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-dataporten',
version='0.4.0',
packages=find_packa... | true | true |
1c40084536a1e2b5687248de68f5c8bf4fea9c84 | 1,863 | py | Python | src/ripe_rainbow/domain/wrappers.py | ripe-tech/ripe-rainbow | 12b430d15102ed6a731d239db00d32dae87384df | [
"Apache-2.0"
] | 2 | 2019-06-11T09:19:48.000Z | 2020-06-30T09:30:29.000Z | src/ripe_rainbow/domain/wrappers.py | ripe-tech/ripe-rainbow | 12b430d15102ed6a731d239db00d32dae87384df | [
"Apache-2.0"
] | 43 | 2019-06-06T10:06:46.000Z | 2022-02-02T10:47:53.000Z | src/ripe_rainbow/domain/wrappers.py | ripe-tech/ripe-rainbow | 12b430d15102ed6a731d239db00d32dae87384df | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from . import base
from . import logic
BASE_TUPLES = (
("logic", base.LogicPart),
("interactions", base.InteractionsPart),
("waits", base.WaitsPart)
)
COPPER_TUPLES = (
("provision", logic.ProvisionPart),
("id", logic.RipeIdPart),
("cor... | 23.582278 | 45 | 0.613527 |
from . import base
from . import logic
BASE_TUPLES = (
("logic", base.LogicPart),
("interactions", base.InteractionsPart),
("waits", base.WaitsPart)
)
COPPER_TUPLES = (
("provision", logic.ProvisionPart),
("id", logic.RipeIdPart),
("core", logic.RipeCorePart),
("copper", log... | true | true |
1c4008e1576b02de561702fde7cd6805892c7693 | 11,504 | py | Python | depreciated/AlexNet-paddle/paddlevision/datasets/folder.py | dyning/AlexNet-Prod | 54de9dfcf540997ff227bd92d0c7a73dc73c45aa | [
"Apache-2.0"
] | 17 | 2021-08-11T13:42:03.000Z | 2022-03-30T03:50:27.000Z | ResNet_paddle/paddlevision/datasets/folder.py | livingbody/resnet-livingbody | a8c04faf9cc6896f7c3aef06cddfe38ce74f00ee | [
"Apache-2.0"
] | 11 | 2021-08-12T06:29:17.000Z | 2021-12-23T03:15:39.000Z | ResNet_paddle/paddlevision/datasets/folder.py | livingbody/resnet-livingbody | a8c04faf9cc6896f7c3aef06cddfe38ce74f00ee | [
"Apache-2.0"
] | 17 | 2021-08-11T14:12:38.000Z | 2022-03-30T03:50:31.000Z | from .vision import VisionDataset
from PIL import Image
import os
import os.path
from typing import Any, Callable, cast, Dict, List, Optional, Tuple
def has_file_allowed_extension(filename: str,
extensions: Tuple[str, ...]) -> bool:
"""Checks if a file is an allowed extension.
... | 37.109677 | 114 | 0.617872 | from .vision import VisionDataset
from PIL import Image
import os
import os.path
from typing import Any, Callable, cast, Dict, List, Optional, Tuple
def has_file_allowed_extension(filename: str,
extensions: Tuple[str, ...]) -> bool:
return filename.lower().endswith(extensions)
d... | true | true |
1c400d658bd27193884881656fdae4b634a9be03 | 5,179 | py | Python | rest_framework_tus/middleware.py | v01dXYZ/drf-tus | 50146fdfcfa062421671e7dee283c7905e91da17 | [
"MIT"
] | 21 | 2017-03-09T14:38:15.000Z | 2021-10-18T21:45:11.000Z | rest_framework_tus/middleware.py | v01dXYZ/drf-tus | 50146fdfcfa062421671e7dee283c7905e91da17 | [
"MIT"
] | 10 | 2017-05-29T09:22:42.000Z | 2020-07-08T10:03:35.000Z | rest_framework_tus/middleware.py | v01dXYZ/drf-tus | 50146fdfcfa062421671e7dee283c7905e91da17 | [
"MIT"
] | 19 | 2017-06-15T13:03:17.000Z | 2021-08-08T03:30:39.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http.response import HttpResponse
from rest_framework import status
from . import tus_api_version, constants
from .compat import decode_base64
class TusMiddleware(object):
def __init__(self, get_response=None):
self.get_respon... | 32.987261 | 114 | 0.652056 | from __future__ import unicode_literals
from django.http.response import HttpResponse
from rest_framework import status
from . import tus_api_version, constants
from .compat import decode_base64
class TusMiddleware(object):
def __init__(self, get_response=None):
self.get_response = get_response
d... | true | true |
1c400ded776e891dffc01de25e92db74f075460f | 3,957 | py | Python | CIM14/IEC61970/Core/Substation.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM14/IEC61970/Core/Substation.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM14/IEC61970/Core/Substation.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 35.017699 | 195 | 0.669194 |
from CIM14.IEC61970.Core.EquipmentContainer import EquipmentContainer
class Substation(EquipmentContainer):
def __init__(self, VoltageLevels=None, Bays=None, Region=None, *args, **kw_args):
self._VoltageLevels = []
self.VoltageLevels = [] if VoltageLevels is None else VoltageLevels
self.... | true | true |
1c400e32a35995c7e40f35eeb37445d32d6544e3 | 5,201 | py | Python | chaospy/quadrature/gauss_legendre.py | krystophny/chaospy | e09f8e3f6dfc26145f15774edd5b03665140712f | [
"MIT"
] | 1 | 2019-12-20T00:32:44.000Z | 2019-12-20T00:32:44.000Z | chaospy/quadrature/gauss_legendre.py | QianWanghhu/chaospy | 18ff6c4fc56c632825e53fb24e17de51a7febd7d | [
"MIT"
] | null | null | null | chaospy/quadrature/gauss_legendre.py | QianWanghhu/chaospy | 18ff6c4fc56c632825e53fb24e17de51a7febd7d | [
"MIT"
] | null | null | null | r"""
The Gauss-Legendre quadrature rule is properly supported by in :ref:`gaussian`.
However, as Gauss-Legendre is a special case where the weight function is
constant, it can in principle be used to integrate any weighting function. In
other words, this is the same Gauss-Legendre integration rule, but only in the
cont... | 36.626761 | 79 | 0.63757 | from __future__ import print_function
import numpy
from .recurrence import (
construct_recurrence_coefficients, coefficients_to_quadrature)
from .combine import combine_quadrature
def quad_gauss_legendre(
order,
domain=(0, 1),
rule="fejer",
accuracy=100,
recurrence_algori... | true | true |
1c400e6dc56b89f7054a5122914fe338bc57dd00 | 12,317 | py | Python | management/test/test_endpoints/test_endpoint_utils.py | poussa/inference-model-manager | 33e487be32b8487290a296daaf90529263a09801 | [
"Apache-2.0"
] | null | null | null | management/test/test_endpoints/test_endpoint_utils.py | poussa/inference-model-manager | 33e487be32b8487290a296daaf90529263a09801 | [
"Apache-2.0"
] | null | null | null | management/test/test_endpoints/test_endpoint_utils.py | poussa/inference-model-manager | 33e487be32b8487290a296daaf90529263a09801 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2018 Intel Corporation
#
# 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 ... | 51.320833 | 100 | 0.731022 |
from management_api.endpoints.endpoint_utils import create_endpoint, delete_endpoint, \
create_url_to_service, update_endpoint, scale_endpoint, list_endpoints, view_endpoint
from kubernetes.client.rest import ApiException
import pytest
from unittest.mock import Mock
from test_utils.token_stuff import user_... | true | true |
1c400f0eed5bedcf15ac83b8b0358c7c54ae6b43 | 21 | py | Python | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | VERSION = "0.4.14.2"
| 10.5 | 20 | 0.571429 | VERSION = "0.4.14.2"
| true | true |
1c400fafd6f6f7bdff3f1627fb61ae1acfd933ac | 3,354 | py | Python | python/dgl/nn/mxnet/conv/ginconv.py | zhengdao-chen/dgl | 39503d879e6427d3c9677b3b1fa6df33c60e2f21 | [
"Apache-2.0"
] | 2 | 2021-12-09T12:36:13.000Z | 2022-03-01T21:22:36.000Z | python/dgl/nn/mxnet/conv/ginconv.py | zhengdao-chen/dgl | 39503d879e6427d3c9677b3b1fa6df33c60e2f21 | [
"Apache-2.0"
] | null | null | null | python/dgl/nn/mxnet/conv/ginconv.py | zhengdao-chen/dgl | 39503d879e6427d3c9677b3b1fa6df33c60e2f21 | [
"Apache-2.0"
] | 2 | 2020-12-07T09:34:01.000Z | 2020-12-13T06:18:58.000Z | """MXNet Module for Graph Isomorphism Network layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ....utils import expand_as_pair
class GINConv(nn.Block):
r"""Graph Isomorphism Network layer from paper `How Power... | 39.458824 | 91 | 0.560525 | import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ....utils import expand_as_pair
class GINConv(nn.Block):
def __init__(self,
apply_func,
aggregator_type,
init_eps=0,
learn_eps=False):
super(GINConv, self... | true | true |
1c400fb076e4857384f6b36220fa468373d8ff69 | 399 | py | Python | backend/yalla_33420/wsgi.py | crowdbotics-apps/yalla-33420 | 5a0c521f76a50f01012c4fb838cebb45779a939e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/yalla_33420/wsgi.py | crowdbotics-apps/yalla-33420 | 5a0c521f76a50f01012c4fb838cebb45779a939e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/yalla_33420/wsgi.py | crowdbotics-apps/yalla-33420 | 5a0c521f76a50f01012c4fb838cebb45779a939e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for yalla_33420 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yalla_33420.settings')
application = get_wsgi_application()
| true | true |
1c400fd841135e23efbd58b8d45e46398faadef3 | 9,093 | py | Python | tests/inventory/pipelines/test_data/fake_backend_services.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | tests/inventory/pipelines/test_data/fake_backend_services.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | tests/inventory/pipelines/test_data/fake_backend_services.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Forseti Security 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
#
#... | 45.238806 | 938 | 0.599692 |
FAKE_API_RESPONSE1 = [
{
"kind": "compute#backendService",
"id": "3072061062494750400",
"creationTimestamp": "2017-04-03T14:01:35.687-07:00",
"name": "bs-1",
"description": "bs-1-desc",
"selfLink": "https://www.googleapis.com/compute/v1/projects/project1/global/back... | true | true |
1c40117a7c4ffc2d0fd1610c995de60fbfac1c4d | 13,101 | py | Python | main.py | boazjohn/pyspark-job-server | bda2fa454b7875494869be81c9d75802df194feb | [
"BSD-3-Clause"
] | null | null | null | main.py | boazjohn/pyspark-job-server | bda2fa454b7875494869be81c9d75802df194feb | [
"BSD-3-Clause"
] | null | null | null | main.py | boazjohn/pyspark-job-server | bda2fa454b7875494869be81c9d75802df194feb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Standard Library
import argparse
import json
import time
import os
import sys
import logging
import socket
import traceback
import uuid
from collections import defaultdict
from threading import Thread, Lock
# Third Party
import mixingboard
import pip
from chassis.models import JobHistory
from fla... | 24.906844 | 122 | 0.635982 |
import argparse
import json
import time
import os
import sys
import logging
import socket
import traceback
import uuid
from collections import defaultdict
from threading import Thread, Lock
import mixingboard
import pip
from chassis.models import JobHistory
from flask import Flask, jsonify, request
from werkzeug.uti... | true | true |
1c40131505a9c1c3ada0e0182de0005470fab0cb | 366 | py | Python | catch/datasets/jugra.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 58 | 2018-01-24T16:31:37.000Z | 2022-02-25T07:46:35.000Z | catch/datasets/jugra.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 29 | 2018-04-17T17:36:06.000Z | 2022-02-25T11:48:58.000Z | catch/datasets/jugra.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 16 | 2018-05-23T12:19:41.000Z | 2021-08-09T04:16:00.000Z | """Dataset with 'Jugra virus' sequences.
A dataset with 1 'Jugra virus' genomes.
THIS PYTHON FILE WAS GENERATED BY A COMPUTER PROGRAM! DO NOT EDIT!
"""
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("data/jugra.fasta.g... | 22.875 | 66 | 0.778689 |
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("data/jugra.fasta.gz", relative=True)
sys.modules[__name__] = ds
| true | true |
1c40161c7ff249c0a4e40c65d2c621db8b13c028 | 64,078 | py | Python | django/db/migrations/autodetector.py | terceiro/django | 5931d2e96ae94b204d146b7f751e0e804da74953 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2019-09-29T20:42:14.000Z | 2019-09-29T20:42:18.000Z | django/db/migrations/autodetector.py | terceiro/django | 5931d2e96ae94b204d146b7f751e0e804da74953 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/migrations/autodetector.py | terceiro/django | 5931d2e96ae94b204d146b7f751e0e804da74953 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-26T09:40:10.000Z | 2020-10-26T09:40:10.000Z | import functools
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOptions
from django.db.migrations.optimizer ... | 48.397281 | 118 | 0.578545 | import functools
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOptions
from django.db.migrations.optimizer ... | true | true |
1c40166384101a304b9d9f488d064e203b8ca472 | 10,242 | py | Python | venv/Lib/site-packages/prawcore/sessions.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 4 | 2021-07-27T23:39:02.000Z | 2021-09-23T04:17:08.000Z | venv/Lib/site-packages/prawcore/sessions.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 12 | 2021-04-11T19:46:06.000Z | 2021-06-18T16:08:37.000Z | venv/Lib/site-packages/prawcore/sessions.py | GuilhermeJC13/storIA | eeecbe9030426f70c6aa73ca0ce8382860c8495c | [
"MIT"
] | 3 | 2021-07-27T17:33:58.000Z | 2021-07-29T12:46:59.000Z | """prawcore.sessions: Provides prawcore.Session and prawcore.session."""
import logging
import random
import time
from copy import deepcopy
from urllib.parse import urljoin
from requests.exceptions import (
ChunkedEncodingError,
ConnectionError,
ReadTimeout,
)
from requests.status_codes import codes
from ... | 29.601156 | 94 | 0.58514 | import logging
import random
import time
from copy import deepcopy
from urllib.parse import urljoin
from requests.exceptions import (
ChunkedEncodingError,
ConnectionError,
ReadTimeout,
)
from requests.status_codes import codes
from .auth import BaseAuthorizer
from .const import TIMEOUT
from .exceptions i... | true | true |
1c40171d2ddf0f16141403f2b22f08acf9f1f5a1 | 14,283 | py | Python | behave/runner_util.py | DisruptiveLabs/behave | 04ef02550bdf90fad4e073fe39d1730ee2152d31 | [
"BSD-2-Clause"
] | null | null | null | behave/runner_util.py | DisruptiveLabs/behave | 04ef02550bdf90fad4e073fe39d1730ee2152d31 | [
"BSD-2-Clause"
] | null | null | null | behave/runner_util.py | DisruptiveLabs/behave | 04ef02550bdf90fad4e073fe39d1730ee2152d31 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Contains utility functions and classes for Runners.
"""
from behave import parser
from behave.model import FileLocation
from bisect import bisect
from six import string_types
import glob
import os.path
import re
import sys
# ----------------------------------------------------------------... | 35.796992 | 80 | 0.595743 |
from behave import parser
from behave.model import FileLocation
from bisect import bisect
from six import string_types
import glob
import os.path
import re
import sys
class FileNotFoundError(LookupError):
pass
class InvalidFileLocationError(LookupError):
pass
class InvalidFilenameError(ValueError):
p... | true | true |
1c40177e30c7a93d9b6a4a223742ba6d3c4047f6 | 18,865 | py | Python | venv/lib/python3.6/site-packages/twilio/rest/messaging/v1/session/participant.py | fernandoleira/stocktext | f755f83ffdaee3b179e21de955854354aced9134 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/twilio/rest/messaging/v1/session/participant.py | fernandoleira/stocktext | f755f83ffdaee3b179e21de955854354aced9134 | [
"MIT"
] | 11 | 2019-12-26T17:21:03.000Z | 2022-03-21T22:17:07.000Z | venv/Lib/python3.6/site-packages/twilio/rest/messaging/v1/session/participant.py | chinmaya-dev/ttbdonation | 1ea4cb2c279db86465040b68f1fa48dbb5f7e17c | [
"MIT"
] | null | null | null | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import ... | 35.796964 | 118 | 0.638219 |
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class Participa... | true | true |
1c4017ff39b79daa31f30c496461589a2d01b756 | 7,938 | py | Python | examples/source_separation/utils/metrics.py | popcornell/audio | 7b6b2d000023e2aa3365b769866c5f375e0d5fda | [
"BSD-2-Clause"
] | 1,718 | 2017-05-05T01:15:00.000Z | 2022-03-31T10:33:51.000Z | examples/source_separation/utils/metrics.py | popcornell/audio | 7b6b2d000023e2aa3365b769866c5f375e0d5fda | [
"BSD-2-Clause"
] | 1,590 | 2017-05-07T18:38:39.000Z | 2022-03-31T22:22:10.000Z | examples/source_separation/utils/metrics.py | popcornell/audio | 7b6b2d000023e2aa3365b769866c5f375e0d5fda | [
"BSD-2-Clause"
] | 464 | 2017-05-05T04:42:43.000Z | 2022-03-29T20:32:00.000Z | import math
from itertools import permutations
from typing import Optional
import torch
def sdr(
estimate: torch.Tensor, reference: torch.Tensor, mask: Optional[torch.Tensor] = None, epsilon: float = 1e-8
) -> torch.Tensor:
"""Computes source-to-distortion ratio.
1. scale the reference signal with power... | 40.090909 | 116 | 0.660998 | import math
from itertools import permutations
from typing import Optional
import torch
def sdr(
estimate: torch.Tensor, reference: torch.Tensor, mask: Optional[torch.Tensor] = None, epsilon: float = 1e-8
) -> torch.Tensor:
reference_pow = reference.pow(2).mean(axis=2, keepdim=True)
mix_pow = (estimate *... | true | true |
1c401881165075b2fee60265029483b41229a85b | 6,234 | py | Python | code.py | Venkat-77/Dr-VVR-Greyatom_olympic-hero | 695f93628fa1c69022cf55b7fe9b4bd1b86dfd28 | [
"MIT"
] | null | null | null | code.py | Venkat-77/Dr-VVR-Greyatom_olympic-hero | 695f93628fa1c69022cf55b7fe9b4bd1b86dfd28 | [
"MIT"
] | null | null | null | code.py | Venkat-77/Dr-VVR-Greyatom_olympic-hero | 695f93628fa1c69022cf55b7fe9b4bd1b86dfd28 | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
data = pd.read_csv(path)
data = pd.DataFrame(data)
data.rename(columns = {'Total':'Total_Medals'}, inplace = True)
data.head(10)
#Code starts here
# --------------
#C... | 29.40566 | 105 | 0.703722 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path
data = pd.read_csv(path)
data = pd.DataFrame(data)
data.rename(columns = {'Total':'Total_Medals'}, inplace = True)
data.head(10)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path
data = pd.read_csv(... | true | true |
1c4018ebeed7341777b2f8ab65eb0279eba32088 | 1,005 | py | Python | official/modeling/hyperparams/__init__.py | davidnugent2425/models | 4b266855705212c21af762df72783d816596a790 | [
"Apache-2.0"
] | 1 | 2021-05-06T16:04:17.000Z | 2021-05-06T16:04:17.000Z | official/modeling/hyperparams/__init__.py | parthsaxena1909/models | 440e7851f50cc7a7bcc8f4d7a4d6ae3861f60ade | [
"Apache-2.0"
] | null | null | null | official/modeling/hyperparams/__init__.py | parthsaxena1909/models | 440e7851f50cc7a7bcc8f4d7a4d6ae3861f60ade | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 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 ... | 47.857143 | 110 | 0.727363 | from official.modeling.hyperparams.base_config import *
from official.modeling.hyperparams.config_definitions import CallbacksConfig, RuntimeConfig, TensorboardConfig
from official.modeling.hyperparams.params_dict import *
| true | true |
1c4019063e9304e210ed555cf2e82f2ec4f42c1b | 8,620 | py | Python | ytopt/search/async_search.py | Kerilk/ytopt | 05cc166d76dbf2a9ec77f3c9ed435ea3ebcb104c | [
"BSD-2-Clause"
] | null | null | null | ytopt/search/async_search.py | Kerilk/ytopt | 05cc166d76dbf2a9ec77f3c9ed435ea3ebcb104c | [
"BSD-2-Clause"
] | null | null | null | ytopt/search/async_search.py | Kerilk/ytopt | 05cc166d76dbf2a9ec77f3c9ed435ea3ebcb104c | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
#from NeuralNetworksDropoutRegressor import NeuralNetworksDropoutRegressor
from mpi4py import MPI
import re
import os
import sys
import time
import json
import math
from skopt import Optimizer
import os
import argparse
from skopt.acquisition import gaussian_e... | 46.847826 | 148 | 0.520302 | from __future__ import print_function
from mpi4py import MPI
import re
import os
import sys
import time
import json
import math
from skopt import Optimizer
import os
import argparse
from skopt.acquisition import gaussian_ei, gaussian_pi, gaussian_lcb
import numpy as np
from ytopt.search.NeuralNetworksDropoutRegressor ... | true | true |
1c40190902964cf6e1c37651233e06b92a761122 | 1,379 | py | Python | src/entities/challenge.py | koddas/python-oop-consistency-lab | 8ee3124aa230359d296fdfbe0c23773602769c8c | [
"MIT"
] | null | null | null | src/entities/challenge.py | koddas/python-oop-consistency-lab | 8ee3124aa230359d296fdfbe0c23773602769c8c | [
"MIT"
] | null | null | null | src/entities/challenge.py | koddas/python-oop-consistency-lab | 8ee3124aa230359d296fdfbe0c23773602769c8c | [
"MIT"
] | null | null | null | from entities.token import Token
class Challenge:
'''
Challenge represents a challenge for the participants to solve.
'''
# Please don't fiddle with these variables!
#__question: str = ""
#__response: int = 0
#__token: Token = None
#__counter: int = 0
def __init__(self, t... | 25.072727 | 68 | 0.546048 | from entities.token import Token
class Challenge:
#__question: str = ""
#__response: int = 0
#__token: Token = None
#__counter: int = 0
def __init__(self, token: Token):
self.__question = ""
self.__response = 0
self.__token = token
self.__counter = 0
... | true | true |
1c401a62963e50ff04a74be5b15427dba187edf6 | 20,060 | py | Python | nova/virt/vmwareapi/images.py | belmiromoreira/nova | d03ef34b0b1ed96a2f2bea1f5f01f09436c55125 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/images.py | belmiromoreira/nova | d03ef34b0b1ed96a2f2bea1f5f01f09436c55125 | [
"Apache-2.0"
] | 1 | 2019-01-02T01:30:35.000Z | 2019-01-02T01:38:02.000Z | nova/virt/vmwareapi/images.py | jeffrey4l/nova | 35375133398d862a61334783c1e7a90b95f34cdb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# 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://w... | 39.960159 | 79 | 0.625174 |
import os
import tarfile
import tempfile
from lxml import etree
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import strutils
from oslo_utils import units
from oslo_vmware import rw_handles
import six
from nova import exception
from nova.i18n import _, _LE, _LI
from nova import imag... | true | true |
1c401b0419c86d9f826bfaacb0a8386932017d6d | 6,167 | py | Python | webapp/survey_molecular_similarity/retrieve_user_data.py | enricogandini/paper_similarity_prediction | ef7762edc8c55ccfcb5c791685eac8ef93f0d554 | [
"MIT"
] | null | null | null | webapp/survey_molecular_similarity/retrieve_user_data.py | enricogandini/paper_similarity_prediction | ef7762edc8c55ccfcb5c791685eac8ef93f0d554 | [
"MIT"
] | null | null | null | webapp/survey_molecular_similarity/retrieve_user_data.py | enricogandini/paper_similarity_prediction | ef7762edc8c55ccfcb5c791685eac8ef93f0d554 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created on Fri Mar 26 16:35:26 2021
# Copyright © Enrico Gandini <enricogandini93@gmail.com>
#
# Distributed under terms of the MIT License.
"""Retrieve data from database, and save it as CSV files
that can be further analyzed.
Files will be saved in a separate direc... | 33.335135 | 91 | 0.60921 |
import argparse
import datetime
from os import environ
from pathlib import Path
import subprocess
import pandas as pd
from sqlalchemy import func, case, cast, Integer
from database_utils import MolecularPair, User, Answer
from database_utils import create_db_engine_and_session
parser = argparse.ArgumentParser(des... | true | true |
1c401cab3fd9f8fe9bd8a9d3bfb697d74c325a68 | 310 | py | Python | other/dingding/dingtalk/api/rest/OapiEduPeriodGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduPeriodGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduPeriodGetRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2019.07.09
'''
from dingtalk.api.base import RestApi
class OapiEduPeriodGetRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.period_id = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.edu.period.get'
| 20.666667 | 39 | 0.748387 | from dingtalk.api.base import RestApi
class OapiEduPeriodGetRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.period_id = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.edu.period.get'
| true | true |
1c401cb24281af4a5f86e6e43da587c11b8cb10d | 11,564 | py | Python | rplugin/python3/deoplete/sources/deoplete_go.py | khogeland/deoplete-go | 71f8363b179bc24c2d85185ee72362051d1041e1 | [
"MIT"
] | null | null | null | rplugin/python3/deoplete/sources/deoplete_go.py | khogeland/deoplete-go | 71f8363b179bc24c2d85185ee72362051d1041e1 | [
"MIT"
] | null | null | null | rplugin/python3/deoplete/sources/deoplete_go.py | khogeland/deoplete-go | 71f8363b179bc24c2d85185ee72362051d1041e1 | [
"MIT"
] | null | null | null | import os
import re
import platform
import subprocess
from collections import OrderedDict
from .base import Base
from deoplete.util import charpos2bytepos, expand, getlines, load_external_module
load_external_module(__file__, 'sources/deoplete_go')
from cgo import cgo
from stdlib import stdlib
try:
load_externa... | 35.472393 | 81 | 0.52992 | import os
import re
import platform
import subprocess
from collections import OrderedDict
from .base import Base
from deoplete.util import charpos2bytepos, expand, getlines, load_external_module
load_external_module(__file__, 'sources/deoplete_go')
from cgo import cgo
from stdlib import stdlib
try:
load_externa... | true | true |
1c401dd16d84eb14e77c53697579fd3180578310 | 31 | py | Python | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 5 | 2018-01-18T14:11:52.000Z | 2020-10-23T16:02:25.000Z | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 10 | 2018-02-02T20:19:36.000Z | 2020-10-05T08:46:36.000Z | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | null | null | null | from .server import * # noqa
| 15.5 | 30 | 0.645161 | from .server import * | true | true |
1c401ebfa08df6fdf5e1fa623582ec6382f5c9e9 | 2,738 | py | Python | pysnmp-with-texts/ADTX-SMI-S2.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/ADTX-SMI-S2.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/ADTX-SMI-S2.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ADTX-SMI-S2 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ADTX-SMI-S2
# Produced by pysmi-0.3.4 at Wed May 1 11:15:06 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 0... | 94.413793 | 505 | 0.762966 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
1c401f08edba009994f2bcd60453c7d9b0eae9e9 | 3,850 | py | Python | validation/test_cluster_install.py | afcollins/openshift-toolkit | 16bf5b054fd5bdfb5018c1f4e06b80470fde716f | [
"Apache-2.0"
] | 227 | 2017-05-20T05:33:32.000Z | 2022-01-17T01:42:36.000Z | validation/test_cluster_install.py | afcollins/openshift-toolkit | 16bf5b054fd5bdfb5018c1f4e06b80470fde716f | [
"Apache-2.0"
] | 88 | 2017-04-10T20:43:12.000Z | 2020-07-17T12:15:39.000Z | validation/test_cluster_install.py | afcollins/openshift-toolkit | 16bf5b054fd5bdfb5018c1f4e06b80470fde716f | [
"Apache-2.0"
] | 163 | 2017-04-07T17:10:11.000Z | 2021-07-06T17:20:54.000Z | from .lib import k8sHelper
import pytest
# Instantiate k8s_helper class from k8s_helper library.
k8s_client = k8sHelper.k8sHelper()
# Master Test Section #
@pytest.mark.master
def test_master_controllers(master_node_count):
assert k8s_client.get_running_pods_by_label(
'kube-system', 'openshift.io/compone... | 38.118812 | 118 | 0.750909 | from .lib import k8sHelper
import pytest
k8s_client = k8sHelper.k8sHelper()
@pytest.mark.master
def test_master_controllers(master_node_count):
assert k8s_client.get_running_pods_by_label(
'kube-system', 'openshift.io/component=controllers') == int(master_node_count), \
"Should have {} master con... | true | true |
1c401fc39fc8f8e717d1bc2feb82071a4adfba43 | 13,328 | py | Python | airflow/providers/google/cloud/operators/bigquery_dts.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | 2 | 2021-07-30T17:25:56.000Z | 2021-08-03T13:51:09.000Z | airflow/providers/google/cloud/operators/bigquery_dts.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/cloud/operators/bigquery_dts.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 44.27907 | 108 | 0.698454 | from typing import Optional, Sequence, Tuple, Union
from google.api_core.retry import Retry
from google.protobuf.json_format import MessageToDict
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.bigquery_dts import BiqQueryDataTransferServiceHook, get_object_id
from airflow.utils.deco... | true | true |
1c40202510961b7ae320ca6faf2d5bab4a73c076 | 20,855 | py | Python | src/residual_anomaly_detector/exps/StarAiFlow.py | eliavw/residual-anomaly-detector | 8840a56aa226120456d0af8e6cca927a7e0e712b | [
"MIT"
] | null | null | null | src/residual_anomaly_detector/exps/StarAiFlow.py | eliavw/residual-anomaly-detector | 8840a56aa226120456d0af8e6cca927a7e0e712b | [
"MIT"
] | null | null | null | src/residual_anomaly_detector/exps/StarAiFlow.py | eliavw/residual-anomaly-detector | 8840a56aa226120456d0af8e6cca927a7e0e712b | [
"MIT"
] | null | null | null | import time
import warnings
from pathlib import Path
import mercs
import numpy as np
from mercs import Mercs
import pandas as pd
from mercs.utils.encoding import code_to_query, query_to_code
from sklearn.metrics import (
accuracy_score,
average_precision_score,
f1_score,
roc_auc_score,
)
from affe.f... | 27.659151 | 87 | 0.569456 | import time
import warnings
from pathlib import Path
import mercs
import numpy as np
from mercs import Mercs
import pandas as pd
from mercs.utils.encoding import code_to_query, query_to_code
from sklearn.metrics import (
accuracy_score,
average_precision_score,
f1_score,
roc_auc_score,
)
from affe.f... | true | true |
1c4020f22073f142cf5c3deab3c63e1457cb284f | 440 | py | Python | payments/forms.py | ugohuche/ugohshopping | 331ecdbbc8a6aae9d16d49fc4fc94cc285edc39f | [
"MIT"
] | 1 | 2020-09-09T16:29:26.000Z | 2020-09-09T16:29:26.000Z | payments/forms.py | ugohuche/ugohshopping | 331ecdbbc8a6aae9d16d49fc4fc94cc285edc39f | [
"MIT"
] | 9 | 2021-03-30T14:17:30.000Z | 2022-03-12T00:44:55.000Z | payments/forms.py | ugohuche/ugohshopping | 331ecdbbc8a6aae9d16d49fc4fc94cc285edc39f | [
"MIT"
] | null | null | null | from django import forms
class CouponForm(forms.Form):
code = forms.CharField(widget=forms.TextInput(attrs={
'class': 'form-control',
'placeholder': 'Promo code',
'aria-label': 'Recipient\'s username',
'aria-describedby': 'basic-addon2'
}))
class RefundForm(forms.Form):
reference_code = form... | 24.444444 | 57 | 0.679545 | from django import forms
class CouponForm(forms.Form):
code = forms.CharField(widget=forms.TextInput(attrs={
'class': 'form-control',
'placeholder': 'Promo code',
'aria-label': 'Recipient\'s username',
'aria-describedby': 'basic-addon2'
}))
class RefundForm(forms.Form):
reference_code = form... | true | true |
1c40214352ed30453b417f615dbf2c359872fb8a | 23,907 | py | Python | cinder/volume/drivers/windows/smbfs.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/windows/smbfs.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/volume/drivers/windows/smbfs.py | liangintel/stx-cinder | f4c43797a3f8c0caebfd8fb67244c084d26d9741 | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright (c) 2014 Cloudbase Solutions SRL
# 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
#
# Unle... | 41.006861 | 79 | 0.633538 |
import os
import sys
from os_brick.remotefs import windows_remotefs as remotefs_brick
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import fileutils
from oslo_utils import units
from cinder import context
from cinder import coordination
from cinder im... | true | true |
1c402220bf1776fdb1e333358163fcdcc1643862 | 6,550 | py | Python | setup.py | basnijholt/ipyparaview | 6550093d6d5df4c04d1b50e57d9c3a773789ec21 | [
"Apache-2.0"
] | null | null | null | setup.py | basnijholt/ipyparaview | 6550093d6d5df4c04d1b50e57d9c3a773789ec21 | [
"Apache-2.0"
] | null | null | null | setup.py | basnijholt/ipyparaview | 6550093d6d5df4c04d1b50e57d9c3a773789ec21 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import platform
import sys
from subprocess import check_call
from setuptools import Command, find_packages, setup
from setuptools.command.build_py import build_py
from setuptools.command.egg_info import egg_info
from setuptools.command.sdist import sdist
here = os.path... | 31.042654 | 117 | 0.575725 | from __future__ import print_function
import os
import platform
import sys
from subprocess import check_call
from setuptools import Command, find_packages, setup
from setuptools.command.build_py import build_py
from setuptools.command.egg_info import egg_info
from setuptools.command.sdist import sdist
here = os.path... | true | true |
1c4022651ca89b6ae53bd0f71df3a270235c0479 | 7,515 | py | Python | terroroftinytown/tracker/app.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | null | null | null | terroroftinytown/tracker/app.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | null | null | null | terroroftinytown/tracker/app.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | null | null | null | # encoding=utf-8
import functools
import os.path
from tornado.web import URLSpec as U
import tornado.web
from terroroftinytown.client.alphabet import str_to_int, int_to_str
from terroroftinytown.services.registry import registry
from terroroftinytown.tracker import account, admin, project, api
from terroroftinytown.t... | 37.575 | 100 | 0.623021 | import functools
import os.path
from tornado.web import URLSpec as U
import tornado.web
from terroroftinytown.client.alphabet import str_to_int, int_to_str
from terroroftinytown.services.registry import registry
from terroroftinytown.tracker import account, admin, project, api
from terroroftinytown.tracker import mod... | true | true |
1c40251801215384e7fc1e986dec8972ef669060 | 4,347 | py | Python | tests/scripts/thread-cert/Cert_9_2_14_PanIdQuery.py | yuzhyang/openthread | 38f206c6708d8fc7eae21db6ff3e3a50a2053b58 | [
"BSD-3-Clause"
] | 1 | 2018-09-25T15:27:26.000Z | 2018-09-25T15:27:26.000Z | tests/scripts/thread-cert/Cert_9_2_14_PanIdQuery.py | yuzhyang/openthread | 38f206c6708d8fc7eae21db6ff3e3a50a2053b58 | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_9_2_14_PanIdQuery.py | yuzhyang/openthread | 38f206c6708d8fc7eae21db6ff3e3a50a2053b58 | [
"BSD-3-Clause"
] | 1 | 2019-08-03T17:35:08.000Z | 2019-08-03T17:35:08.000Z | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 39.162162 | 98 | 0.701173 |
import time
import unittest
import config
import node
COMMISSIONER = 1
LEADER1 = 2
ROUTER1 = 3
LEADER2 = 4
class Cert_9_2_14_PanIdQuery(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
self.nodes = {}
for i in range(1,5):
self.nodes[i] ... | true | true |
1c4027d3d9397504f77f1fd2e9f27861c20ffbc9 | 14,780 | py | Python | tensorflow_data_validation/statistics/generators/image_stats_generator_test.py | brills/data-validation | 4f8a5d12b3d5db7383ae53d5fe184af1d781449a | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/statistics/generators/image_stats_generator_test.py | brills/data-validation | 4f8a5d12b3d5db7383ae53d5fe184af1d781449a | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/statistics/generators/image_stats_generator_test.py | brills/data-validation | 4f8a5d12b3d5db7383ae53d5fe184af1d781449a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.438914 | 82 | 0.542355 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import pickle
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
import pyarrow as pa
import tensorflow as tf
from tensorflow_data_validation.stat... | true | true |
1c4028347673966a10a131e5c8132d694a7847cb | 814 | py | Python | src/algoritmos-ordenacion/propuestos/strings.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | src/algoritmos-ordenacion/propuestos/strings.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | src/algoritmos-ordenacion/propuestos/strings.py | GokoshiJr/algoritmos2-py | 106dcbed31739309c193a77c671522aac17f6e45 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def seleccion(stringArray: list) -> list:
for i in range (0, len(stringArray) - 1):
minimo = i
for j in range (i + 1, len(stringArray)):
if stringArray[j].lower() < stringArray[minimo].lower():
minimo = j
temporal = stringAr... | 32.56 | 96 | 0.563882 |
def seleccion(stringArray: list) -> list:
for i in range (0, len(stringArray) - 1):
minimo = i
for j in range (i + 1, len(stringArray)):
if stringArray[j].lower() < stringArray[minimo].lower():
minimo = j
temporal = stringArray[i]
stringAr... | true | true |
1c40292a31e03b7306247700a6e10cd93b2c1eb6 | 4,792 | py | Python | myhealthapp/views.py | SORARAwo4649/HamatteruProject | 72d5d1a4fc3fa4ef6d09048b6852256500feed84 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | myhealthapp/views.py | SORARAwo4649/HamatteruProject | 72d5d1a4fc3fa4ef6d09048b6852256500feed84 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | myhealthapp/views.py | SORARAwo4649/HamatteruProject | 72d5d1a4fc3fa4ef6d09048b6852256500feed84 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect, resolve_url
from django.urls import reverse_lazy
from django.vi... | 29.580247 | 93 | 0.625626 | from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect, resolve_url
from django.urls import reverse_lazy
from django.vi... | true | true |
1c4029d47a1c7c126aba0f3c556081df61aa58d5 | 1,020 | py | Python | desktop/core/ext-py/odfpy-1.4.1/examples/loadsave.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/odfpy-1.4.1/examples/loadsave.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/odfpy-1.4.1/examples/loadsave.py | e11it/hue-1 | 436704c40b5fa6ffd30bd972bf50ffeec738d091 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in th... | 32.903226 | 80 | 0.742157 |
import sys
from odf.opendocument import load
infile = sys.argv[1]
doc = load(infile)
outfile = infile[:-4] + "-bak" + infile[-4:]
doc.save(outfile)
| true | true |
1c402aa994bdd161da5cc185a9ce804ea220c003 | 3,669 | py | Python | bindings/python/ensmallen/datasets/string/candidatuswolfebacteriabacteriumrifcsphigho201full4822.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/candidatuswolfebacteriabacteriumrifcsphigho201full4822.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/candidatuswolfebacteriabacteriumrifcsphigho201full4822.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Candidatus Wolfebacteria bacterium RIFCSPHIGHO2_01_FULL_48_22.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
... | 34.942857 | 223 | 0.693377 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def CandidatusWolfebacteriaBacteriumRifcsphigho201Full4822(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
... | true | true |
1c402c1157900ff1ad5c6c296a409c9e8fb96d2b | 538 | py | Python | contrail-openstack/hooks/charmhelpers/core/kernel_factory/centos.py | exsdev0/tf-charms | a7a3cfc7463332e5bc0b335c0304dace1025f18c | [
"Apache-2.0"
] | 19 | 2016-04-17T04:00:53.000Z | 2020-05-06T14:18:16.000Z | contrail-openstack/hooks/charmhelpers/core/kernel_factory/centos.py | exsdev0/tf-charms | a7a3cfc7463332e5bc0b335c0304dace1025f18c | [
"Apache-2.0"
] | 313 | 2017-09-15T13:22:58.000Z | 2022-02-25T17:55:01.000Z | contrail-openstack/hooks/charmhelpers/core/kernel_factory/centos.py | exsdev0/tf-charms | a7a3cfc7463332e5bc0b335c0304dace1025f18c | [
"Apache-2.0"
] | 136 | 2017-09-19T13:37:33.000Z | 2022-03-29T11:08:00.000Z | import subprocess
import os
def persistent_modprobe(module):
"""Load a kernel module and configure for auto-load on reboot."""
if not os.path.exists('/etc/rc.modules'):
open('/etc/rc.modules', 'a')
os.chmod('/etc/rc.modules', 111)
with open('/etc/rc.modules', 'r+') as modules:
if m... | 29.888889 | 69 | 0.635688 | import subprocess
import os
def persistent_modprobe(module):
if not os.path.exists('/etc/rc.modules'):
open('/etc/rc.modules', 'a')
os.chmod('/etc/rc.modules', 111)
with open('/etc/rc.modules', 'r+') as modules:
if module not in modules.read():
modules.write('modprobe %s\n'... | true | true |
1c402c625b8cb842ac8f5996a1b4775910c1cdc3 | 2,631 | py | Python | exams/signals.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 32 | 2016-03-25T01:03:13.000Z | 2022-01-15T19:35:42.000Z | exams/signals.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 4,858 | 2016-03-03T13:48:30.000Z | 2022-03-29T22:09:51.000Z | exams/signals.py | umarmughal824/micromasters | ea92d3bcea9be4601150fc497302ddacc1161622 | [
"BSD-3-Clause"
] | 20 | 2016-08-18T22:07:44.000Z | 2021-11-15T13:35:35.000Z | """
Signals for exams
"""
import logging
from django.db import transaction
from django.db.models.signals import post_save
from django.dispatch import receiver
from courses.models import CourseRun
from dashboard.models import CachedEnrollment
from dashboard.utils import get_mmtrack
from ecommerce.models import Order
... | 38.130435 | 111 | 0.789434 | import logging
from django.db import transaction
from django.db.models.signals import post_save
from django.dispatch import receiver
from courses.models import CourseRun
from dashboard.models import CachedEnrollment
from dashboard.utils import get_mmtrack
from ecommerce.models import Order
from exams.api import auth... | true | true |
1c402c9cfa73e3ef59b9cbae5d064c0a06d1cbc7 | 22 | py | Python | pineboolib/system_module/forms/__init__.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | 2 | 2017-12-10T23:06:16.000Z | 2017-12-10T23:06:23.000Z | pineboolib/system_module/forms/__init__.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 36 | 2017-11-05T21:13:47.000Z | 2020-08-26T15:56:15.000Z | pineboolib/system_module/forms/__init__.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 8 | 2017-11-05T15:56:31.000Z | 2019-04-25T16:32:28.000Z | """Forms packages."""
| 11 | 21 | 0.590909 | true | true | |
1c402e150e2445a9b07e007e65b56c3dca9a80e4 | 25,773 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.754826 | 146 | 0.789858 |
try:
from ._models_py3 import AdditionalCapabilities
from ._models_py3 import AdditionalUnattendContent
from ._models_py3 import ApiEntityReference
from ._models_py3 import ApiError
from ._models_py3 import ApiErrorBase
from ._models_py3 import AutomaticOSUpgradePolicy
from ._models_py3 imp... | true | true |
1c402f34e07ad043935b8aaecd277213c8f6f438 | 16,675 | py | Python | code/train_pc_img.py | Mehooz/VGSNet | 18ddae20fb3ccc440a38bd8b23cba8fcaa753518 | [
"MIT"
] | 3 | 2020-10-26T19:52:53.000Z | 2021-12-27T07:59:36.000Z | code/train_pc_img.py | Mehooz/VGSNet | 18ddae20fb3ccc440a38bd8b23cba8fcaa753518 | [
"MIT"
] | null | null | null | code/train_pc_img.py | Mehooz/VGSNet | 18ddae20fb3ccc440a38bd8b23cba8fcaa753518 | [
"MIT"
] | null | null | null | """
This is the main trainer script for point cloud AE/VAE experiments.
Use scripts/train_ae_pc_chair.sh or scripts/train_vae_pc_chair.sh to run.
Before that, you need to run scripts/pretrain_part_pc_ae_chair.sh or scripts/pretrain_part_pc_vae_chair.sh
to pretrain part geometry AE/VAE.
"""
import os
im... | 44.113757 | 206 | 0.630045 |
import os
import time
import sys
import shutil
import random
from time import strftime
from argparse import ArgumentParser
import numpy as np
import torch
import torch.utils.data
from config import add_train_vae_args
from data import PartNetDataset, Tree
import utils
# torch.set_num_threads(1)
os.environ["CUDA_VISIBL... | true | true |
1c402fbf836bccd97ab91e5f40db2a16171cb7b4 | 2,931 | py | Python | homeassistant/components/syncthru/binary_sensor.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 5 | 2017-01-26T16:33:09.000Z | 2018-07-20T13:50:47.000Z | homeassistant/components/syncthru/binary_sensor.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/syncthru/binary_sensor.py | SergioBPereira/core | 4501906da369e23b304857b8a3512798696f26a0 | [
"Apache-2.0"
] | 7 | 2018-10-04T10:12:45.000Z | 2021-12-29T20:55:40.000Z | """Support for Samsung Printers with SyncThru web interface."""
from pysyncthru import SyncThru, SyncthruState
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_PROBLEM,
BinarySensorEntity,
)
from homeassistant.const import CONF_NAME
from homeassistant.helpers.up... | 29.019802 | 85 | 0.701467 |
from pysyncthru import SyncThru, SyncthruState
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_PROBLEM,
BinarySensorEntity,
)
from homeassistant.const import CONF_NAME
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateC... | true | true |
1c40300dd755571a66248088c4c3405a029e7a3f | 1,064 | py | Python | src/app/models.py | wking/spdx-online-tools | b9e8373303a90c379cf2afb57904fc930413649e | [
"Apache-2.0"
] | null | null | null | src/app/models.py | wking/spdx-online-tools | b9e8373303a90c379cf2afb57904fc930413649e | [
"Apache-2.0"
] | null | null | null | src/app/models.py | wking/spdx-online-tools | b9e8373303a90c379cf2afb57904fc930413649e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Rohit Lodha
# 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... | 36.689655 | 90 | 0.760338 |
from __future__ import unicode_literals
from django.db import models
from datetime import datetime
from django import forms
from django.contrib.auth.models import User
class UserID(models.Model):
user = models.OneToOneField(User)
organisation = models.CharField("Organisation",max_length=64, null=False, bl... | true | true |
1c403039845af0999712ad952c18ca9c4f246b16 | 60 | py | Python | river/base/multi_output.py | fox-ds/river | 9ce947ebfc012ec7059de0a09c765b2da7fc1d25 | [
"BSD-3-Clause"
] | 2,184 | 2020-11-11T12:31:12.000Z | 2022-03-31T16:45:41.000Z | river/base/multi_output.py | raphaelsty/river | 2e0b25a2ef2d2ba9ec080cf86a491f7465433b18 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/base/multi_output.py | raphaelsty/river | 2e0b25a2ef2d2ba9ec080cf86a491f7465433b18 | [
"BSD-3-Clause"
] | 240 | 2020-11-11T14:25:03.000Z | 2022-03-31T08:25:50.000Z | class MultiOutputMixin:
"""A multi-output estimator."""
| 20 | 35 | 0.7 | class MultiOutputMixin:
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.