hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f767d6bbb46ecf14caae31ed1aeca381c36ad338 | 759 | py | Python | user.py | BrianTinega/password-locker | e15ce5f178da8a528f05c853d24fdf886c207059 | [
"MIT"
] | null | null | null | user.py | BrianTinega/password-locker | e15ce5f178da8a528f05c853d24fdf886c207059 | [
"MIT"
] | null | null | null | user.py | BrianTinega/password-locker | e15ce5f178da8a528f05c853d24fdf886c207059 | [
"MIT"
] | null | null | null | class User:
'''
Class that generates new Usernames and passwords
'''
pass
users_list=[]
def __init__(self,name,password):
'''
A function to create username and password
'''
self.name = name
self.password= password
def save_user(self):
'''
... | 23.71875 | 63 | 0.55863 | class User:
pass
users_list=[]
def __init__(self,name,password):
self.name = name
self.password= password
def save_user(self):
User.users_list.append(self)
def delete_user_credential(self):
User.users_list.remove(self)
@classmethod
def display_users(cls... | true | true |
f767d8e9b36a6c9b69811ebb154741b08b5f413d | 7,266 | py | Python | ServidorPython/python32_web/Lib/site-packages/prompt_toolkit/contrib/regular_languages/regex_parser.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | ServidorPython/python32_web/Lib/site-packages/prompt_toolkit/contrib/regular_languages/regex_parser.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | ServidorPython/python32_web/Lib/site-packages/prompt_toolkit/contrib/regular_languages/regex_parser.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | """
Parser for parsing a regular expression.
Take a string representing a regular expression and return the root node of its
parse tree.
usage::
root_node = parse_regex('(hello|world)')
Remarks:
- The regex parser processes multiline, it ignores all whitespace and supports
multiple named groups with the same n... | 27.627376 | 94 | 0.522984 | from __future__ import unicode_literals
import re
__all__ = [
'Repeat',
'Variable',
'Regex',
'Lookahead',
'tokenize_regex',
'parse_regex',
]
class Node(object):
def __add__(self, other_node):
return Sequence([self, other_node])
def __or__(self, other_node):
return An... | true | true |
f767d8eccfe17aadfc669d2fb72e9886e0d16cf6 | 14,651 | py | Python | napari/_qt/dialogs/qt_notification.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/qt_notification.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/qt_notification.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import os
from typing import Callable, Optional, Sequence, Tuple, Union
from qtpy.QtCore import (
QEasingCurve,
QObject,
QPoint,
QPropertyAnimation,
QRect,
QSize,
Qt,
QThread,
QTimer,
Signal,
)
from qtpy.QtWidgets import (
QApplication,
... | 36.175309 | 88 | 0.631151 | from __future__ import annotations
import os
from typing import Callable, Optional, Sequence, Tuple, Union
from qtpy.QtCore import (
QEasingCurve,
QObject,
QPoint,
QPropertyAnimation,
QRect,
QSize,
Qt,
QThread,
QTimer,
Signal,
)
from qtpy.QtWidgets import (
QApplication,
... | true | true |
f767da184d6be8fd90b3052fbb72058f4743d70a | 749 | py | Python | test/test_del_contact.py | ndo1989/pythoncourse2020 | 23c6842476c4b5c4e2b1c7a32f26171dfa7a5622 | [
"Apache-2.0"
] | null | null | null | test/test_del_contact.py | ndo1989/pythoncourse2020 | 23c6842476c4b5c4e2b1c7a32f26171dfa7a5622 | [
"Apache-2.0"
] | null | null | null | test/test_del_contact.py | ndo1989/pythoncourse2020 | 23c6842476c4b5c4e2b1c7a32f26171dfa7a5622 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_delete_some_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(first_name="test_name1", midle_name="test_midle_name1", last_name="test_last_name1", nikname="test_nikname1"))
old_cont... | 44.058824 | 145 | 0.739653 | from model.contact import Contact
import random
def test_delete_some_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(first_name="test_name1", midle_name="test_midle_name1", last_name="test_last_name1", nikname="test_nikname1"))
old_contacts = db.get_contact_li... | true | true |
f767dac11eb93651d3c835b0bb97b21fa79075e1 | 350 | py | Python | recipes/Python/577542_Pascals_triangle/recipe-577542.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/577542_Pascals_triangle/recipe-577542.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/577542_Pascals_triangle/recipe-577542.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | def pascals_triangle(n):
'''
Pascal's triangle:
for x in pascals_triangle(5):
print('{0:^16}'.format(x))
[1]
[1, 1]
[1, 2, 1]
[1, 3, 3, 1]
[1, 4, 6, 4, 1]
'''
x=[[1]]
for i in range(n-1):
x.append([sum(i) for i in zip([0]+x[... | 19.444444 | 60 | 0.388571 | def pascals_triangle(n):
x=[[1]]
for i in range(n-1):
x.append([sum(i) for i in zip([0]+x[-1],x[-1]+[0])])
return x
| true | true |
f767dcd26f341f7c6bcaf90ec1ea1d6e73aa0698 | 16,783 | py | Python | root/scripts/Library/utils.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | root/scripts/Library/utils.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | root/scripts/Library/utils.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 53 | 2019-03-12T16:50:21.000Z | 2022-03-15T23:16:18.000Z | import struct
import json, base64
from binascii import hexlify, unhexlify
import sys
from Crypto.Util.asn1 import DerSequence
from Crypto.PublicKey import RSA
from .avbtool3 import *
import os
import stat
# !/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2019, ZITiS, Do not distribute without permission ... | 36.092473 | 522 | 0.579515 | import struct
import json, base64
from binascii import hexlify, unhexlify
import sys
from Crypto.Util.asn1 import DerSequence
from Crypto.PublicKey import RSA
from .avbtool3 import *
import os
import stat
import hashlib
from binascii import hexlify, unhexlify
class rsa: def __init__(self, hashtype="SHA256"):
... | true | true |
f767dcd3a432c62f2cd428db60c7a0c157cb17a9 | 1,302 | py | Python | solutions/LRU Cache/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | 3 | 2021-06-06T22:03:15.000Z | 2021-06-08T08:49:04.000Z | solutions/LRU Cache/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | solutions/LRU Cache/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, k, v):
self.key = k
self.val = v
self.prev = None
self.next = None
class LRUCache:
def __init__(self, capacity):
self.capacity = capacity
self.dic = dict()
self.head = Node(0, 0)
self.tail = Node(0, 0)
self.... | 23.672727 | 67 | 0.500768 | class Node:
def __init__(self, k, v):
self.key = k
self.val = v
self.prev = None
self.next = None
class LRUCache:
def __init__(self, capacity):
self.capacity = capacity
self.dic = dict()
self.head = Node(0, 0)
self.tail = Node(0, 0)
self.... | true | true |
f767de9df4cc8d0edcaaf0b1de8703f23025844f | 3,089 | py | Python | TrustVisualizer.py | snovvcrash/TrustVisualizer | 9dadd852b69b7882577c0ab6ac7f42f539d9c58a | [
"BSD-3-Clause"
] | null | null | null | TrustVisualizer.py | snovvcrash/TrustVisualizer | 9dadd852b69b7882577c0ab6ac7f42f539d9c58a | [
"BSD-3-Clause"
] | null | null | null | TrustVisualizer.py | snovvcrash/TrustVisualizer | 9dadd852b69b7882577c0ab6ac7f42f539d9c58a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
##############################################################################
# Author: @harmj0y
#
# Based on: https://github.com/sixdub/DomainTrustExplorer by @sixdub
#
# Description: Uses pyyed (yEd) library to transform PowerView's updated
# Get-DomainTrustMapping functionality ... | 33.945055 | 153 | 0.665264 |
# Get-DomainTrustMapping functionality output to graphml
#
# License: BSD 3-clause
##############################################################################
import csv
from os.path import basename, splitext
from argparse import ArgumentParser
import pyyed
parser = ArgumentParser()
parser.add_argum... | true | true |
f767e0f184f80f3ab1bf01c43e71695bc7e52cd4 | 5,515 | py | Python | pytests/memcachedops/stats_ops.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pytests/memcachedops/stats_ops.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pytests/memcachedops/stats_ops.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | import time
from membase.api.rest_client import RestConnection, Bucket
from membase.helper.rebalance_helper import RebalanceHelper
from memcached.helper.data_helper import MemcachedClientHelper
from basetestcase import BaseTestCase
from mc_bin_client import MemcachedError
from couchbase_helper.documentgenerator import ... | 43.425197 | 171 | 0.63155 | import time
from membase.api.rest_client import RestConnection, Bucket
from membase.helper.rebalance_helper import RebalanceHelper
from memcached.helper.data_helper import MemcachedClientHelper
from basetestcase import BaseTestCase
from mc_bin_client import MemcachedError
from couchbase_helper.documentgenerator import ... | true | true |
f767e1487a9b7ae03eb008f27616a5c0868d372f | 4,822 | py | Python | mp/agents/segmentation_semisup_domain_pred_IRM_seg_agent.py | MECLabTUDA/OOD-Gen | f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e | [
"MIT"
] | null | null | null | mp/agents/segmentation_semisup_domain_pred_IRM_seg_agent.py | MECLabTUDA/OOD-Gen | f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e | [
"MIT"
] | null | null | null | mp/agents/segmentation_semisup_domain_pred_IRM_seg_agent.py | MECLabTUDA/OOD-Gen | f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e | [
"MIT"
] | null | null | null | import torch
from mp.agents.segmentation_semisup_domain_pred_agent import SegmentationSemisupDomainPredictionAgent
from mp.data.pytorch.domain_prediction_dataset_wrapper import DomainPredictionDatasetWrapper
from mp.eval.accumulator import Accumulator
from mp.eval.inference.predict import softmax
from mp.utils.domain_... | 47.27451 | 119 | 0.635006 | import torch
from mp.agents.segmentation_semisup_domain_pred_agent import SegmentationSemisupDomainPredictionAgent
from mp.data.pytorch.domain_prediction_dataset_wrapper import DomainPredictionDatasetWrapper
from mp.eval.accumulator import Accumulator
from mp.eval.inference.predict import softmax
from mp.utils.domain_... | true | true |
f767e156f70efb16bec574963b76f4c43e268473 | 1,213 | py | Python | fn_tenable_io_assets/fn_tenable_io_assets/util/selftest.py | khirazo/resilient-community-apps | 76d21d899945a5458203d6ba9cfaaf9907b395b2 | [
"MIT"
] | null | null | null | fn_tenable_io_assets/fn_tenable_io_assets/util/selftest.py | khirazo/resilient-community-apps | 76d21d899945a5458203d6ba9cfaaf9907b395b2 | [
"MIT"
] | null | null | null | fn_tenable_io_assets/fn_tenable_io_assets/util/selftest.py | khirazo/resilient-community-apps | 76d21d899945a5458203d6ba9cfaaf9907b395b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Function implementation test.
Usage: resilient-circuits selftest -l fn_tenable_io_assets
"""
import logging
from resilient_lib import RequestsCommon
from fn_tenable_io_assets.util.tenable_io_lib import call_tenable_io
from pprint import pformat
log = logging.getLogger(__name__)
log.setLev... | 30.325 | 106 | 0.670239 |
import logging
from resilient_lib import RequestsCommon
from fn_tenable_io_assets.util.tenable_io_lib import call_tenable_io
from pprint import pformat
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
log.addHandler(logging.StreamHandler())
def selftest_function(opts):
app_configs = opts.get("fn_ten... | true | true |
f767e1fc11134c7351ce2aeb983d9e05ff0bb52d | 221 | py | Python | unfuddle/AppEngine/bartlett/profilepage.py | pdbartlett/misc-stuff | 0cebbbf30d13a070a663d58519e2dd5c35c765d2 | [
"Apache-2.0"
] | null | null | null | unfuddle/AppEngine/bartlett/profilepage.py | pdbartlett/misc-stuff | 0cebbbf30d13a070a663d58519e2dd5c35c765d2 | [
"Apache-2.0"
] | 1 | 2020-03-24T22:28:58.000Z | 2020-03-24T22:28:58.000Z | unfuddle/AppEngine/bartlett/profilepage.py | pdbartlett/misc-stuff | 0cebbbf30d13a070a663d58519e2dd5c35c765d2 | [
"Apache-2.0"
] | null | null | null | import model
import template
from google.appengine.ext import webapp
class Page(webapp.RequestHandler):
def get(self):
template.render_standard_page(self, 'profile.html', { 'profile' : model.getProfile() }) | 27.625 | 91 | 0.737557 | import model
import template
from google.appengine.ext import webapp
class Page(webapp.RequestHandler):
def get(self):
template.render_standard_page(self, 'profile.html', { 'profile' : model.getProfile() }) | true | true |
f767e40f5aa1d22a1eea58e504c77135809fc500 | 2,383 | py | Python | shower/plot_shower.py | Jean1995/Masterarbeit | d7d6c4a2031f715fa788cc8d498f339d2df675ee | [
"MIT"
] | null | null | null | shower/plot_shower.py | Jean1995/Masterarbeit | d7d6c4a2031f715fa788cc8d498f339d2df675ee | [
"MIT"
] | null | null | null | shower/plot_shower.py | Jean1995/Masterarbeit | d7d6c4a2031f715fa788cc8d498f339d2df675ee | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import sys
import matplotlib
import matplotlib.cm as cm
from matplotlib.lines import Line2D
from matplotlibconfig import *
x_i_list, y_i_list, z_i_list, x_f_list, y_f_list, z_f_list, ID_list, energy_i_list = np.genfromtxt(sys.a... | 28.369048 | 148 | 0.710029 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import sys
import matplotlib
import matplotlib.cm as cm
from matplotlib.lines import Line2D
from matplotlibconfig import *
x_i_list, y_i_list, z_i_list, x_f_list, y_f_list, z_f_list, ID_list, energy_i_list = np.genfromtxt(sys.a... | true | true |
f767e477778a55dd08a4bf1ca69b906e16afd358 | 6,995 | py | Python | src/garage/tf/optimizers/first_order_optimizer.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | 1 | 2021-03-02T08:43:20.000Z | 2021-03-02T08:43:20.000Z | src/garage/tf/optimizers/first_order_optimizer.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | src/garage/tf/optimizers/first_order_optimizer.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | """First order optimizer."""
import time
from dowel import logger
import pyprind
import tensorflow as tf
from garage.np.optimizers import BatchDataset
from garage.tf.misc import tensor_utils
from garage.tf.optimizers.utils import LazyDict
class FirstOrderOptimizer:
"""First order optimier.
P... | 34.458128 | 80 | 0.556254 | import time
from dowel import logger
import pyprind
import tensorflow as tf
from garage.np.optimizers import BatchDataset
from garage.tf.misc import tensor_utils
from garage.tf.optimizers.utils import LazyDict
class FirstOrderOptimizer:
def __init__(self,
tf_optimizer_cls=None,
... | true | true |
f767e52e4e52925216b5a51bc248f84ed2669a1e | 37,217 | py | Python | src/sage/games/sudoku.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1 | 2020-08-30T04:27:27.000Z | 2020-08-30T04:27:27.000Z | src/sage/games/sudoku.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | null | null | null | src/sage/games/sudoku.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 3 | 2020-03-29T17:13:36.000Z | 2021-05-03T18:11:28.000Z | r"""
Sudoku Puzzles
This module provides algorithms to solve Sudoku puzzles, plus tools
for inputting, converting and displaying various ways of writing a
puzzle or its solution(s). Primarily this is accomplished with the
:class:`sage.games.sudoku.Sudoku` class, though the legacy top-level
:func:`sage.games.sudoku.su... | 41.58324 | 892 | 0.477739 | from __future__ import print_function, absolute_import
from six.moves import range
from six import string_types
from sage.structure.sage_object import SageObject
def sudoku(m):
from sage.structure.element import is_Matrix
if not is_Matrix(m):
raise ValueError('sudoku function expects puzzle to be a ... | true | true |
f767e5b098033f21d76f3d1ae066600ce91ffd27 | 2,279 | py | Python | quasimodo/tests/test_simple_wikipedia.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 16 | 2019-11-28T13:26:37.000Z | 2022-02-09T09:53:10.000Z | quasimodo/tests/test_simple_wikipedia.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 1 | 2021-03-26T20:31:48.000Z | 2021-07-15T08:52:47.000Z | quasimodo/tests/test_simple_wikipedia.py | Aunsiels/CSK | c88609bc76d865b4987aaf30ddf1247a2031b1a6 | [
"MIT"
] | 3 | 2020-08-14T23:23:25.000Z | 2021-12-24T14:02:35.000Z | import unittest
from quasimodo.data_structures.inputs import Inputs
from quasimodo.data_structures.generated_fact import GeneratedFact
from quasimodo.data_structures.multiple_scores import MultipleScore
from quasimodo.data_structures.multiple_source_occurrence import MultipleSourceOccurrence
from quasimodo.assertion_v... | 51.795455 | 119 | 0.739359 | import unittest
from quasimodo.data_structures.inputs import Inputs
from quasimodo.data_structures.generated_fact import GeneratedFact
from quasimodo.data_structures.multiple_scores import MultipleScore
from quasimodo.data_structures.multiple_source_occurrence import MultipleSourceOccurrence
from quasimodo.assertion_v... | true | true |
f767e5b514af479d90cf0b2ae1056d6f24183585 | 3,968 | py | Python | openprocurement/auctions/core/plugins/awarding/v3/models.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 2 | 2016-09-15T20:17:43.000Z | 2017-01-08T03:32:43.000Z | openprocurement/auctions/core/plugins/awarding/v3/models.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 183 | 2017-12-21T11:04:37.000Z | 2019-03-27T08:14:34.000Z | openprocurement/auctions/core/plugins/awarding/v3/models.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 12 | 2016-09-05T12:07:48.000Z | 2019-02-26T09:24:17.000Z | from pyramid.security import Allow
from schematics.transforms import (
blacklist,
whitelist
)
from schematics.types import StringType
from schematics.types.compound import ModelType
from schematics.types.serializable import serializable
from zope.interface import implementer
from openprocurement.api.models.com... | 41.768421 | 236 | 0.714214 | from pyramid.security import Allow
from schematics.transforms import (
blacklist,
whitelist
)
from schematics.types import StringType
from schematics.types.compound import ModelType
from schematics.types.serializable import serializable
from zope.interface import implementer
from openprocurement.api.models.com... | true | true |
f767e623f7cf6723c0f2c6d42f449c17eb458b0b | 2,723 | py | Python | random/visitor/vistor_ref_version/example.py | yimuw/yimu-blog | 280ab2eca1fa48602d1695d69366842ea40debda | [
"BSD-3-Clause"
] | 8 | 2021-06-11T05:50:40.000Z | 2022-03-29T02:41:05.000Z | random/visitor/vistor_ref_version/example.py | yimuw/yimu-blog | 280ab2eca1fa48602d1695d69366842ea40debda | [
"BSD-3-Clause"
] | 7 | 2020-06-28T13:58:26.000Z | 2021-12-09T22:30:54.000Z | random/visitor/vistor_ref_version/example.py | yimuw/yimu-blog | 280ab2eca1fa48602d1695d69366842ea40debda | [
"BSD-3-Clause"
] | 5 | 2021-07-07T04:00:14.000Z | 2022-03-30T03:42:54.000Z | from json_visitor import JsonDumper, JsonLoader
from binary_visitor import BinDumper, BinLoader
from visitor_ref import RefObj, Traversable
class TypeA(Traversable):
def __init__(self):
super().__init__()
self.version = RefObj(2)
self.a = RefObj(1)
self.b = RefObj("whateve... | 26.960396 | 65 | 0.605582 | from json_visitor import JsonDumper, JsonLoader
from binary_visitor import BinDumper, BinLoader
from visitor_ref import RefObj, Traversable
class TypeA(Traversable):
def __init__(self):
super().__init__()
self.version = RefObj(2)
self.a = RefObj(1)
self.b = RefObj("whateve... | true | true |
f767e6abc2b618440700316ed04c3b537af1bba2 | 437 | py | Python | Python/DiameterTree.py | Jspsun/LEETCodePractice | 9dba8c0441201a188b93e4d39a0a9b7602857a5f | [
"MIT"
] | 3 | 2017-10-14T19:49:28.000Z | 2019-01-12T21:51:11.000Z | Python/DiameterTree.py | Jspsun/LEETCodePractice | 9dba8c0441201a188b93e4d39a0a9b7602857a5f | [
"MIT"
] | null | null | null | Python/DiameterTree.py | Jspsun/LEETCodePractice | 9dba8c0441201a188b93e4d39a0a9b7602857a5f | [
"MIT"
] | 5 | 2017-02-06T19:10:23.000Z | 2020-12-19T01:58:10.000Z | def helper(root, diameter):
if not root:
return 0
left = helper(root.left, diameter)
right = helper(root.right, diameter)
if left + right > diameter[0]:
diameter[0] = left + right
return max(left, right) + 1
# main function
def getDiameterTree(root):
answer = [0]
helper(ro... | 19.863636 | 40 | 0.652174 | def helper(root, diameter):
if not root:
return 0
left = helper(root.left, diameter)
right = helper(root.right, diameter)
if left + right > diameter[0]:
diameter[0] = left + right
return max(left, right) + 1
def getDiameterTree(root):
answer = [0]
helper(root, answer)
... | false | true |
f767e6b18a5cc361d2c359165e458599d83bc8e4 | 64 | py | Python | ytmdl/__version__.py | jrejaud/ytmdl | 39af7c6565795da2a8cc9ab969b38a3b384d4e58 | [
"MIT"
] | null | null | null | ytmdl/__version__.py | jrejaud/ytmdl | 39af7c6565795da2a8cc9ab969b38a3b384d4e58 | [
"MIT"
] | null | null | null | ytmdl/__version__.py | jrejaud/ytmdl | 39af7c6565795da2a8cc9ab969b38a3b384d4e58 | [
"MIT"
] | null | null | null | # Store the version of the package
__version__ = "2020.11.20-1"
| 21.333333 | 34 | 0.734375 | __version__ = "2020.11.20-1"
| true | true |
f767e6d4a143c643399ff3e359e435bb62045317 | 15,482 | py | Python | contrib/python/scipy/scipy/sparse/csr.py | ZhekehZ/catboost | 3f774da539b8e57cca25686b89c473cbd1f61a6c | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | contrib/python/scipy/scipy/sparse/csr.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | contrib/python/scipy/scipy/sparse/csr.py | birichie/catboost | de75c6af12cf490700e76c22072fbdc15b35d679 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """Compressed Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from scipy._lib.six import xrange
from .base import spmatrix
from ._sparsetools import csr_tocsc, csr_tobs... | 33.656522 | 82 | 0.526999 |
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from scipy._lib.six import xrange
from .base import spmatrix
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
get_csr_sub... | true | true |
f767e6fca2fe0400d66baec38f98976eb156dc5a | 16,652 | py | Python | test/functional/test_framework/mininode.py | CryptoTeller/maza | 15745eac3d24accb65a532efaaa04c68aa6b366f | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | CryptoTeller/maza | 15745eac3d24accb65a532efaaa04c68aa6b366f | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | CryptoTeller/maza | 15745eac3d24accb65a532efaaa04c68aa6b366f | [
"MIT"
] | 2 | 2021-09-08T00:30:08.000Z | 2021-12-24T01:43:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... | 37.589165 | 182 | 0.635359 | import asyncore
from collections import defaultdict
from io import BytesIO
import logging
import socket
import struct
import sys
import threading
from test_framework.messages import *
from test_framework.util import wait_until
logger = logging.getLogger("TestFramework.mininode")
MESSAGEMAP = {
b"addr": msg_addr,... | true | true |
f767e7e6ffc64e6ed23019b4c57a3a72f4a8f673 | 6,113 | py | Python | Challenges/C_CPP/0015_command_injection/config.py | saucec0de/sifu | 7924844e1737c7634016c677237bccd7e7651818 | [
"MIT"
] | 5 | 2021-03-26T08:19:43.000Z | 2021-12-18T18:04:04.000Z | Challenges/C_CPP/0015_command_injection/config.py | saucec0de/sifu | 7924844e1737c7634016c677237bccd7e7651818 | [
"MIT"
] | null | null | null | Challenges/C_CPP/0015_command_injection/config.py | saucec0de/sifu | 7924844e1737c7634016c677237bccd7e7651818 | [
"MIT"
] | null | null | null | # HOW THIS CHALLENGE WORKS
# 1. main.c will call func.c with different input arguments as sent by checker.py.
# 2. main.c also knows the expected output and will change the value of the global
# variable accordingly to an executable that returns 0 (success) only when called
# correctly with the current input
# 3. main.... | 33.043243 | 96 | 0.649763 |
import os
import os.path
import random
import string
import re
import util
test_function_filename = './func.c'
output_filename = './main'
compiler = 'make'
compiler_args = ['clean', 'inject', 'main']
timeout = 3
TOUCH_FILE_PREFIX = "xDANGEROUS_INJECTION_"
TOUCH_FILE_SUFFIX = ".txt"
def check_for_output_match(ou... | true | true |
f767e92fcd53d1d0ea7fbd987f5131c741b2e8e0 | 521 | py | Python | presqt/utilities/utils/list_differences.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 3 | 2019-01-29T19:45:25.000Z | 2020-12-01T18:24:51.000Z | presqt/utilities/utils/list_differences.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 419 | 2018-09-13T23:11:15.000Z | 2021-09-22T17:49:00.000Z | presqt/utilities/utils/list_differences.py | djordjetrajkovic/presqt | 8424b61b1c5b8d29de74c7a333889d9e9eb7aee8 | [
"Apache-2.0"
] | 2 | 2020-04-10T08:19:41.000Z | 2021-01-04T15:29:42.000Z | def list_differences(list_one, list_two):
"""
Compares two lists and returns a list of differences
Parameters
----------
list_one: list
list_two: list
Returns
-------
A list of differences between the two given lists.
"""
difference_list = list(set([entry for entry in list... | 26.05 | 91 | 0.683301 | def list_differences(list_one, list_two):
difference_list = list(set([entry for entry in list_one if entry not in list_two]))
difference_list_two = list(set([entry for entry in list_two if entry not in list_one]))
difference_list.extend(difference_list_two)
return difference_list
| true | true |
f767ea30e740d13d482670ee1547c8bc041f619b | 7,464 | py | Python | oscar/controllers/joint_tor.py | NVlabs/oscar | df778a4173a118f10627cb2ef4021c26303231fc | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | 40 | 2021-10-05T21:49:21.000Z | 2022-03-31T07:35:48.000Z | oscar/controllers/joint_tor.py | NVlabs/oscar | df778a4173a118f10627cb2ef4021c26303231fc | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | 1 | 2022-02-11T19:56:24.000Z | 2022-03-15T00:58:40.000Z | oscar/controllers/joint_tor.py | NVlabs/oscar | df778a4173a118f10627cb2ef4021c26303231fc | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | 5 | 2021-10-17T03:15:11.000Z | 2022-02-02T16:40:34.000Z | # ---------------------------------------------------------------
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License
# for OSCAR. To view a copy of this license, see the LICENSE file.
# -----------------------------------------------------------... | 40.345946 | 130 | 0.629153 |
from isaacgym import gymapi
import torch
from .base_controller import Controller
class JointTorqueController(Controller):
def __init__(
self,
input_min,
input_max,
output_min,
output_max,
control_min,
control_max,
control_noise,
control_dim,... | true | true |
f767ea7611f877b094896670600d94e2cefbdf4c | 7,117 | py | Python | backend/black_water_28585/settings.py | crowdbotics-apps/black-water-28585 | 5244f66420243f363fa61bd3b722ad9209cecb8e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/black_water_28585/settings.py | crowdbotics-apps/black-water-28585 | 5244f66420243f363fa61bd3b722ad9209cecb8e | [
"FTL",
"AML",
"RSA-MD"
] | 6 | 2021-07-08T10:36:34.000Z | 2021-07-08T10:36:34.000Z | backend/black_water_28585/settings.py | crowdbotics-apps/black-water-28585 | 5244f66420243f363fa61bd3b722ad9209cecb8e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for black_water_28585 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
im... | 28.930894 | 112 | 0.729099 |
import os
import environ
import logging
env = environ.Env()
DEBUG = env.bool("DEBUG", default=False)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See h... | true | true |
f767eaf7697eba8ac83fccb4caff2ed7680f0786 | 4,144 | py | Python | setup.py | ntsurumi/Freenom-dns-updater | 46f11d31d48a86ab86948d923bd1f077a4b2eead | [
"MIT"
] | 4 | 2019-03-09T17:07:58.000Z | 2019-12-07T18:46:18.000Z | setup.py | ntsurumi/Freenom-dns-updater | 46f11d31d48a86ab86948d923bd1f077a4b2eead | [
"MIT"
] | null | null | null | setup.py | ntsurumi/Freenom-dns-updater | 46f11d31d48a86ab86948d923bd1f077a4b2eead | [
"MIT"
] | 2 | 2019-02-06T21:06:44.000Z | 2019-07-30T16:14:24.000Z | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
... | 37 | 94 | 0.680019 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
with open('requirements.txt', encoding='utf-8') as f:
install_requires = map(lambda l... | true | true |
f767ec3405d8b4a33c7db074b917636c05fb4392 | 97 | py | Python | frontend/urls.py | rajkumar3127/django-stackExchange-API | 911846320fc0fafff22c3aa7f7e201c92cb319d1 | [
"MIT"
] | 2 | 2020-08-03T09:38:05.000Z | 2020-08-04T03:52:26.000Z | frontend/urls.py | rajkumar3127/django-stackExchange-API | 911846320fc0fafff22c3aa7f7e201c92cb319d1 | [
"MIT"
] | 9 | 2021-03-19T00:29:30.000Z | 2022-03-12T00:17:33.000Z | frontend/urls.py | rajkumar3127/django-stackExchange-API | 911846320fc0fafff22c3aa7f7e201c92cb319d1 | [
"MIT"
] | 1 | 2020-11-13T08:15:12.000Z | 2020-11-13T08:15:12.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.index ),
]
| 12.125 | 28 | 0.659794 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index ),
]
| true | true |
f767ec360cf48ce286ad1d6d79baeca35b9ee973 | 1,460 | py | Python | akhet/demo/subscribers.py | Pylons/akhet | 4fbbddbe5ac392926617f1a41ca5612ba2a6835b | [
"MIT"
] | 2 | 2015-03-19T11:33:48.000Z | 2016-04-22T07:44:09.000Z | akhet/demo/subscribers.py | Pylons/akhet | 4fbbddbe5ac392926617f1a41ca5612ba2a6835b | [
"MIT"
] | null | null | null | akhet/demo/subscribers.py | Pylons/akhet | 4fbbddbe5ac392926617f1a41ca5612ba2a6835b | [
"MIT"
] | null | null | null | from akhet.urlgenerator import URLGenerator
import pyramid.threadlocal as threadlocal
from pyramid.exceptions import ConfigurationError
from .lib import helpers
def includeme(config):
"""Configure all application-specific subscribers."""
config.add_subscriber(create_url_generator, "pyramid.events.ContextFound... | 34.761905 | 78 | 0.732192 | from akhet.urlgenerator import URLGenerator
import pyramid.threadlocal as threadlocal
from pyramid.exceptions import ConfigurationError
from .lib import helpers
def includeme(config):
config.add_subscriber(create_url_generator, "pyramid.events.ContextFound")
config.add_subscriber(add_renderer_globals, "pyrami... | true | true |
f767ed3ce059cc15e5cd652d1dc648634516936c | 15,891 | py | Python | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.014793 | 210 | 0.651312 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f767ed79b61d34a7611b56e267e90ec0310aa1e2 | 11,719 | py | Python | tensorpack/tfutils/tower.py | rmunoz12/tensorpack | 60f4c6df7c4a27b553469352dd6ce73333db1ec6 | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | tensorpack/tfutils/tower.py | rmunoz12/tensorpack | 60f4c6df7c4a27b553469352dd6ce73333db1ec6 | [
"Apache-2.0"
] | null | null | null | tensorpack/tfutils/tower.py | rmunoz12/tensorpack | 60f4c6df7c4a27b553469352dd6ce73333db1ec6 | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: tower.py
import tensorflow as tf
from six.moves import zip
from ..utils import logger
from ..utils.argtools import call_only_once
from ..utils.naming import MOVING_SUMMARY_OPS_KEY
from ..utils.develop import HIDE_DOC
from .collection import CollectionGuard
from .... | 33.1983 | 114 | 0.620957 |
import tensorflow as tf
from six.moves import zip
from ..utils import logger
from ..utils.argtools import call_only_once
from ..utils.naming import MOVING_SUMMARY_OPS_KEY
from ..utils.develop import HIDE_DOC
from .collection import CollectionGuard
from .common import get_tf_version_number, get_op_or_tensor_by_name, ... | true | true |
f767ed93a66f339ae03a14724876cfa39e4e9814 | 31,055 | py | Python | nltk/test/unit/test_tgrep.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/test/unit/test_tgrep.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/test/unit/test_tgrep.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Natural Language Toolkit: TGrep search
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Will Roberts <wildwilhelm@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
'''
Unit tests for nltk.tgrep.
'''
import unittest
from nltk.tree impo... | 39.409898 | 88 | 0.448945 |
import unittest
from nltk.tree import ParentedTree
from nltk import tgrep
class TestSequenceFunctions(unittest.TestCase):
def test_tokenize_simple(self):
tokens = tgrep.tgrep_tokenize('A .. (B !< C . D) | ![<< (E , F) $ G]')
self.assertEqual(
tokens,
[
... | true | true |
f767f013affc023ff6e759c12206e2e89f30f8eb | 10,486 | py | Python | psana/psana/detector/UtilsGraphics.py | ZLLentz/lcls2 | 3edbea556779f619944ee9b97fb33cd815a19a37 | [
"BSD-3-Clause-LBNL"
] | null | null | null | psana/psana/detector/UtilsGraphics.py | ZLLentz/lcls2 | 3edbea556779f619944ee9b97fb33cd815a19a37 | [
"BSD-3-Clause-LBNL"
] | null | null | null | psana/psana/detector/UtilsGraphics.py | ZLLentz/lcls2 | 3edbea556779f619944ee9b97fb33cd815a19a37 | [
"BSD-3-Clause-LBNL"
] | null | null | null | """
Wrapper for graphical utils.
from psana.psana.detector.UtilsGraphics import *
from psana.psana.detector.UtilsGraphics import gr, fleximage, arr_median_limits
img = det.raw.image(evt)
arr = det.raw.calib(evt)
amin, amax = arr_median_limits(arr, nneg=1, npos=3)
flimg = fleximage(img, ar... | 35.666667 | 128 | 0.507629 | import logging
logger = logging.getLogger(__name__)
import numpy as np
import psana.pyalgos.generic.Graphics as gr
def arr_median_limits(arr, amin=None, amax=None, nneg=None, npos=None, fraclo=0.05, frachi=0.95):
if not(None in (amin, amax)): return amin, amax
if None in (nneg, npos):
qlo = np.quanti... | true | true |
f767f019762256cd1c400fe1a8e6e480b95e15b4 | 2,376 | py | Python | tests/test_utils.py | justanr/gonads | 4cd40eae04d3e738443d1232063c762b34784462 | [
"MIT"
] | 19 | 2015-03-21T07:47:15.000Z | 2019-10-05T21:20:36.000Z | tests/test_utils.py | justanr/gonads | 4cd40eae04d3e738443d1232063c762b34784462 | [
"MIT"
] | 7 | 2015-03-31T14:30:26.000Z | 2017-07-29T15:29:59.000Z | tests/test_utils.py | justanr/gonads | 4cd40eae04d3e738443d1232063c762b34784462 | [
"MIT"
] | 4 | 2017-10-18T08:07:46.000Z | 2019-10-05T21:20:38.000Z | import pytest
from functools import partial
from pynads import utils
def test_check_utils_iter():
assert utils._iter_but_not_str_or_map([])
assert utils._iter_but_not_str_or_map(set())
assert utils._iter_but_not_str_or_map(())
assert not utils._iter_but_not_str_or_map('')
assert not utils._iter_but... | 21.405405 | 71 | 0.613636 | import pytest
from functools import partial
from pynads import utils
def test_check_utils_iter():
assert utils._iter_but_not_str_or_map([])
assert utils._iter_but_not_str_or_map(set())
assert utils._iter_but_not_str_or_map(())
assert not utils._iter_but_not_str_or_map('')
assert not utils._iter_but... | true | true |
f767f112e25cb21a7ade07d7b23cd658a6677bf2 | 1,232 | py | Python | ast_project_2018/src/sensors/sensor_abstract_class.py | njanirudh/HBRS-AST-WS18 | ce127b8f3f1c4028f4acd0fa917ab2759f67d9cf | [
"MIT"
] | null | null | null | ast_project_2018/src/sensors/sensor_abstract_class.py | njanirudh/HBRS-AST-WS18 | ce127b8f3f1c4028f4acd0fa917ab2759f67d9cf | [
"MIT"
] | null | null | null | ast_project_2018/src/sensors/sensor_abstract_class.py | njanirudh/HBRS-AST-WS18 | ce127b8f3f1c4028f4acd0fa917ab2759f67d9cf | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from enum import Enum
class ALGO(Enum):
ImageMatching = 1
SemanticSegmentation = 2
class SensorAbstractClass(ABC):
"""
Abstract class which all sensor classes should inherit.
"""
def __init__(self):
"""
Initializing the basic data of the c... | 20.881356 | 59 | 0.564123 | from abc import ABC, abstractmethod
from enum import Enum
class ALGO(Enum):
ImageMatching = 1
SemanticSegmentation = 2
class SensorAbstractClass(ABC):
def __init__(self):
super().__init__()
self.sensor_name = str
self.sensor_data = []
self.algo = ALGO.ImageMatching
... | true | true |
f767f1508321e235f1642422a43c340173987eb2 | 28,022 | py | Python | abs_templates_ec/resistor/planar.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 1 | 2020-06-02T22:41:46.000Z | 2020-06-02T22:41:46.000Z | abs_templates_ec/resistor/planar.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 12 | 2018-10-23T18:08:37.000Z | 2022-02-24T10:51:34.000Z | abs_templates_ec/resistor/planar.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 18 | 2018-07-14T01:36:09.000Z | 2021-05-25T18:38:00.000Z | # -*- coding: utf-8 -*-
"""This module defines implementation of poly resistor templates in generic planar technology.
"""
from typing import Dict, Any, Tuple, List, Optional, Union, TYPE_CHECKING
import math
from bag.layout.util import BBox
from bag.layout.routing import TrackID, WireArray
from bag.layout.routing.... | 41.575668 | 116 | 0.580151 |
from typing import Dict, Any, Tuple, List, Optional, Union, TYPE_CHECKING
import math
from bag.layout.util import BBox
from bag.layout.routing import TrackID, WireArray
from bag.layout.routing.fill import fill_symmetric_const_space, fill_symmetric_max_density
from bag.layout.template import TemplateBase
from .base... | true | true |
f767f40b0b4bed08fdca9b370e8757f9eded16ff | 2,338 | py | Python | black_format.py | Sotilrac/sublime_black | a04ff58806844294ff5bed71b13bae15bc33eb68 | [
"MIT"
] | null | null | null | black_format.py | Sotilrac/sublime_black | a04ff58806844294ff5bed71b13bae15bc33eb68 | [
"MIT"
] | null | null | null | black_format.py | Sotilrac/sublime_black | a04ff58806844294ff5bed71b13bae15bc33eb68 | [
"MIT"
] | null | null | null | """
Sublime Text package to format Python code using `black`
https://github.com/ambv/black formatter.
"""
import os
import sublime
import sublime_plugin
#: name of the plugin
PLUGIN_NAME = os.path.splitext(os.path.basename(__file__))[0]
#: settings filename
SETTINGS = "{}.sublime-settings".format(PLUGIN_NAME)
def lo... | 30.363636 | 85 | 0.720274 | import os
import sublime
import sublime_plugin
PLUGIN_NAME = os.path.splitext(os.path.basename(__file__))[0]
SETTINGS = "{}.sublime-settings".format(PLUGIN_NAME)
def load_user_settings():
return sublime.load_settings(SETTINGS)
def execute(window, settings, diff_only=False):
file_name = window.active_view().... | true | true |
f767f482e8c50fc2390ff19d7be644b9207b0845 | 931 | py | Python | var/spack/repos/builtin/packages/jline3/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/jline3/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/jline3/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Jline3(MavenPackage):
"""JLine is a Java library for handling console input."""
homep... | 46.55 | 96 | 0.780881 |
from spack import *
class Jline3(MavenPackage):
homepage = "https://github.com/jline/jline3/"
url = "https://github.com/jline/jline3/archive/jline-parent-3.16.0.tar.gz"
version('3.16.0', sha256='d2de8dfe55a55e20752aeb082a75192bf835baaab75f257d3fab90ce350fdbcb')
version('3.15.0', sha256='3953c2... | true | true |
f767f51c0759075366f06ae87532bd5aadbea33a | 1,325 | py | Python | report_crawler/report_crawler/spiders/spiders_001/_N/NWSUAF001.py | HeadCow/ARPS | fa7257f2aaee70391b8def527dd09f59aa5d26fa | [
"MIT"
] | 1 | 2021-04-09T09:49:11.000Z | 2021-04-09T09:49:11.000Z | report_crawler/report_crawler/spiders/spiders_001/_N/NWSUAF001.py | HeadCow/ARPS | fa7257f2aaee70391b8def527dd09f59aa5d26fa | [
"MIT"
] | null | null | null | report_crawler/report_crawler/spiders/spiders_001/_N/NWSUAF001.py | HeadCow/ARPS | fa7257f2aaee70391b8def527dd09f59aa5d26fa | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import scrapy
from report_crawler.spiders.__Global_function import get_localtime
from report_crawler.spiders.__Global_variable import now_time, end_time
class SYSU001_Spider(scrapy.Spider):
name = 'NWSUAF001'
start_urls = ['http://cie.nwsuaf.edu.cn/xzhd/index.htm']
domains = 'http:/... | 42.741935 | 113 | 0.611321 | import scrapy
from report_crawler.spiders.__Global_function import get_localtime
from report_crawler.spiders.__Global_variable import now_time, end_time
class SYSU001_Spider(scrapy.Spider):
name = 'NWSUAF001'
start_urls = ['http://cie.nwsuaf.edu.cn/xzhd/index.htm']
domains = 'http://cie.nwsuaf.edu.cn/xzhd... | true | true |
f767f60aabc356972481eda38244c8ddb6d97d3c | 8,876 | py | Python | tripleoclient/v1/tripleo_launch_heat.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | null | null | null | tripleoclient/v1/tripleo_launch_heat.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | null | null | null | tripleoclient/v1/tripleo_launch_heat.py | paramite/python-tripleoclient | 2d7cf1b8061eaaf6fc4b31be4490586a1f80133d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Red Hat, 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 agreed ... | 39.625 | 79 | 0.566922 |
import argparse
import getpass
import logging
import os
from osc_lib.i18n import _
from tripleoclient import command
from tripleoclient.constants import (DEFAULT_EPHEMERAL_HEAT_CONTAINER,
DEFAULT_EPHEMERAL_HEAT_API_CONTAINER,
DEFAULT_EPHEMERAL... | true | true |
f767f72a6367a0eaf738a45cdc9033666d8c3c1c | 24,881 | py | Python | src/run_ner_ood.py | AIRI-Institute/uncertainty_transformers | 982b5ae8b39cb484ce3559a72f95d18f30487e38 | [
"MIT"
] | null | null | null | src/run_ner_ood.py | AIRI-Institute/uncertainty_transformers | 982b5ae8b39cb484ce3559a72f95d18f30487e38 | [
"MIT"
] | null | null | null | src/run_ner_ood.py | AIRI-Institute/uncertainty_transformers | 982b5ae8b39cb484ce3559a72f95d18f30487e38 | [
"MIT"
] | null | null | null | """ Finetuning the library models for sequence classification on GLUE (Bert, XLM, XLNet, RoBERTa, Albert, XLM-RoBERTa)."""
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
import os
import sys
import dataclasses
from dataclasses import dataclass, field
from typing import Callable, Dict,... | 31.857875 | 122 | 0.640006 |
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
import os
import sys
import dataclasses
from dataclasses import dataclass, field
from typing import Callable, Dict, Optional
from tqdm import tqdm
import json
import numpy as np
from pathlib import Path
import random
import torch
import h... | true | true |
f767f72bb491b5dcabb780f9bedf5dae9f02eba0 | 661 | py | Python | president/president.py | einstein808/Aula-de-Python | 837f235307f620c9569e1d639b23815b9e546fa7 | [
"MIT"
] | null | null | null | president/president.py | einstein808/Aula-de-Python | 837f235307f620c9569e1d639b23815b9e546fa7 | [
"MIT"
] | null | null | null | president/president.py | einstein808/Aula-de-Python | 837f235307f620c9569e1d639b23815b9e546fa7 | [
"MIT"
] | null | null | null | voto=[]
while True:
n = int(input("digite um voto , 0 sai"))
if n==0:
break
voto.append(n)
cad1=0
cand2=0
cand3=0
cand4=0
votob=0
voton=0
for x in voto:
if x ==1:
cad1+=1
if x ==2:
cand2+=1
if x ==3:
cand3+=1
if x ==4:
cand4+=1
if x ==6:
vo... | 18.885714 | 49 | 0.509834 | voto=[]
while True:
n = int(input("digite um voto , 0 sai"))
if n==0:
break
voto.append(n)
cad1=0
cand2=0
cand3=0
cand4=0
votob=0
voton=0
for x in voto:
if x ==1:
cad1+=1
if x ==2:
cand2+=1
if x ==3:
cand3+=1
if x ==4:
cand4+=1
if x ==6:
vo... | true | true |
f767f7c57a9bf97385b2f62c988e85ca34ce4383 | 3,248 | py | Python | bot/exts/holidays/easter/bunny_name_generator.py | hedyhli/pydis-lance | ba4b0e498191195d773c031fcfdaef862bd472b8 | [
"MIT"
] | 122 | 2020-11-22T17:25:24.000Z | 2022-03-30T22:53:30.000Z | bot/exts/holidays/easter/bunny_name_generator.py | hedyhli/pydis-lance | ba4b0e498191195d773c031fcfdaef862bd472b8 | [
"MIT"
] | 441 | 2020-11-21T00:06:19.000Z | 2022-03-25T02:45:56.000Z | bot/exts/holidays/easter/bunny_name_generator.py | hedyhli/pydis-lance | ba4b0e498191195d773c031fcfdaef862bd472b8 | [
"MIT"
] | 183 | 2020-11-22T09:24:47.000Z | 2022-03-26T08:21:36.000Z | import json
import logging
import random
import re
from pathlib import Path
from typing import Optional
from discord.ext import commands
from bot.bot import Bot
log = logging.getLogger(__name__)
BUNNY_NAMES = json.loads(Path("bot/resources/holidays/easter/bunny_names.json").read_text("utf8"))
class BunnyNameGener... | 34.189474 | 118 | 0.640394 | import json
import logging
import random
import re
from pathlib import Path
from typing import Optional
from discord.ext import commands
from bot.bot import Bot
log = logging.getLogger(__name__)
BUNNY_NAMES = json.loads(Path("bot/resources/holidays/easter/bunny_names.json").read_text("utf8"))
class BunnyNameGener... | true | true |
f767f8851b26bc798aad83e02eba6c1ed660e1a0 | 996 | py | Python | rescuetime_wrapper.py | psorianom/rescuescore | 9a647cbc1fc94f9a1ea265443295e84170da81f6 | [
"MIT"
] | 1 | 2019-11-20T14:05:37.000Z | 2019-11-20T14:05:37.000Z | rescuetime_wrapper.py | psorianom/rescuescore | 9a647cbc1fc94f9a1ea265443295e84170da81f6 | [
"MIT"
] | null | null | null | rescuetime_wrapper.py | psorianom/rescuescore | 9a647cbc1fc94f9a1ea265443295e84170da81f6 | [
"MIT"
] | null | null | null | # coding: utf-8
from datetime import date, timedelta
import pandas as pd
from rescuetime.api.service import Service
from rescuetime.api.access import AnalyticApiKey
def get_apikey():
with open("apikey", "r") as fileo:
key = fileo.read()
return key
apikey = get_apikey()
def get_efficiency():
... | 24.9 | 74 | 0.59739 | from datetime import date, timedelta
import pandas as pd
from rescuetime.api.service import Service
from rescuetime.api.access import AnalyticApiKey
def get_apikey():
with open("apikey", "r") as fileo:
key = fileo.read()
return key
apikey = get_apikey()
def get_efficiency():
try:
tod... | true | true |
f767f888a6a5b15922d2652d1eca6345035b7596 | 2,821 | py | Python | kale/rpc/kfp.py | jiapinai/kale | a706f4b1d22d68a6517e9233750e03aa94d15127 | [
"Apache-2.0"
] | null | null | null | kale/rpc/kfp.py | jiapinai/kale | a706f4b1d22d68a6517e9233750e03aa94d15127 | [
"Apache-2.0"
] | null | null | null | kale/rpc/kfp.py | jiapinai/kale | a706f4b1d22d68a6517e9233750e03aa94d15127 | [
"Apache-2.0"
] | null | null | null | import kfp
from kfp_server_api.rest import ApiException
_client = None
def _get_client(host=None):
global _client
if _client is None:
_client = kfp.Client()
return _client
def list_experiments(request):
c = _get_client()
experiments = [{"name": e.name,
"id": e.id}... | 34.82716 | 79 | 0.624601 | import kfp
from kfp_server_api.rest import ApiException
_client = None
def _get_client(host=None):
global _client
if _client is None:
_client = kfp.Client()
return _client
def list_experiments(request):
c = _get_client()
experiments = [{"name": e.name,
"id": e.id}... | true | true |
f767f89b8f07ef47c8f8f90a1944752212d9d7ff | 5,823 | py | Python | exot/util/plotting.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/util/plotting.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/util/plotting.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# 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 source code must retain the above copyright... | 37.567742 | 93 | 0.690194 |
import contextlib
import inspect
import pathlib
import typing as t
import matplotlib.pyplot as plt
import matplotlib.transforms as tx
import numpy as np
import pandas
import seaborn as sns
from matplotlib.collections import LineCollection
from exot.experiment.frequency_sweep import FrequencySweepRun
from exot.experi... | true | true |
f767f8a770f4e3423d57f988eff2f664eda58dec | 10,876 | py | Python | plugins/lfcmetrics/lfcmetrics.py | NDPF/nagios-plugins-lcgdm | 7c6bf205d71425c2d010b26f3780cab371fb46a6 | [
"Apache-2.0"
] | null | null | null | plugins/lfcmetrics/lfcmetrics.py | NDPF/nagios-plugins-lcgdm | 7c6bf205d71425c2d010b26f3780cab371fb46a6 | [
"Apache-2.0"
] | null | null | null | plugins/lfcmetrics/lfcmetrics.py | NDPF/nagios-plugins-lcgdm | 7c6bf205d71425c2d010b26f3780cab371fb46a6 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
#
# NAME: lfcmetrics.py
#
# FACILITY: SAM (Service Availability Monitoring)
#
# COPYRIGHT:
# Copyright (c) 2009, Members of the EGEE Collaboration.
# http://www.eu-egee.org/partners/
# Licensed under the Apa... | 35.197411 | 83 | 0.49007 |
import re
import os
import sys
import time
import signal
import commands
try:
from gridmon import probe
from gridmon import utils as samutils
from threadpool import ThreadPool
import lfc2 as lfc
except ImportError as e:
print("UNKNOWN: Error loading modules : %s" % (e))
sys.exit(3)
class LFC... | true | true |
f767f8ebf188d2bd2103da04da452e996cbc3b0d | 6,314 | py | Python | tools/coco_classifier.py | ryangoy/FRCNN | 4afe25c9369eb7bfcebc340f3168939f4349c94a | [
"BSD-2-Clause"
] | 4 | 2017-11-24T02:23:52.000Z | 2022-03-12T03:17:33.000Z | tools/coco_classifier.py | ryangoy/FRCNN | 4afe25c9369eb7bfcebc340f3168939f4349c94a | [
"BSD-2-Clause"
] | null | null | null | tools/coco_classifier.py | ryangoy/FRCNN | 4afe25c9369eb7bfcebc340f3168939f4349c94a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Demo script showing detections in sample i... | 39.217391 | 880 | 0.58204 |
"""
Demo script showing detections in sample images.
See README.md for installation instructions before running.
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test import im_detect
from fast_rcnn.nms_wrapper import nms
f... | false | true |
f767f9cd11bff32c4c19ceb48e0a1de8b03b9496 | 554 | py | Python | snail/utils/__init__.py | thomasvrussell/snlstm | 8d7f6e2fa03b2486b8297641a430e1ca8172e6df | [
"MIT"
] | 6 | 2021-11-05T16:01:46.000Z | 2021-11-10T06:06:15.000Z | snail/utils/__init__.py | thomasvrussell/snail | 8d7f6e2fa03b2486b8297641a430e1ca8172e6df | [
"MIT"
] | null | null | null | snail/utils/__init__.py | thomasvrussell/snail | 8d7f6e2fa03b2486b8297641a430e1ca8172e6df | [
"MIT"
] | 1 | 2021-11-07T01:44:29.000Z | 2021-11-07T01:44:29.000Z | """
Remarks on Internal Packages Imports:
from snail.utils.GPLightCurve import GP_Interpolator, PhotGP, PhotBVColor
from snail.utils.SpecFPCA import FPCA_Parameterize, FPCA_Reconstruct
from snail.utils.SpecGSmooth import GSmooth, AutoGSmooth
from snail.utils.SyntheticPhot import SynPhot, Calculate_BmVof... | 39.571429 | 77 | 0.826715 |
from .GPLightCurve import GP_Interpolator, PhotGP, PhotBVColor
from .SpecFPCA import FPCA_Parameterize, FPCA_Reconstruct
from .SpecGSmooth import GSmooth, AutoGSmooth
from .SyntheticPhot import SynPhot, Calculate_BmVoffset
| true | true |
f767fa165058bb19f63da9adb2aa123d5608cf13 | 3,449 | py | Python | PythonVirtEnv/Lib/site-packages/win32/lib/regcheck.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 64 | 2020-07-22T06:24:18.000Z | 2022-03-27T10:48:15.000Z | PythonVirtEnv/Lib/site-packages/win32/lib/regcheck.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | PythonVirtEnv/Lib/site-packages/win32/lib/regcheck.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 18 | 2021-11-12T03:15:45.000Z | 2022-03-25T05:29:00.000Z | # This module is very old and useless in this day and age! It will be
# removed in a few years (ie, 2009 or so...)
import warnings
warnings.warn("The regcheck module has been pending deprecation since build 210",
category=PendingDeprecationWarning)
import win32con
import regutil
import win32api
import os
impo... | 27.592 | 120 | 0.708611 |
import warnings
warnings.warn("The regcheck module has been pending deprecation since build 210",
category=PendingDeprecationWarning)
import win32con
import regutil
import win32api
import os
import sys
def CheckRegisteredExe(exename):
try:
os.stat(win32api.RegQueryValue(regutil.GetRootKey() , regutil.Get... | true | true |
f767fb297f579b4398ec7982809821bfc0c60d6e | 10,192 | py | Python | flink-python/pyflink/table/tests/test_pandas_conversion.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/table/tests/test_pandas_conversion.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/table/tests/test_pandas_conversion.py | klDen/flink | a2c737891afde0c63c1a453b1ee164b80b6a702c | [
"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... | 46.327273 | 92 | 0.590169 | import datetime
import decimal
from pandas.util.testing import assert_frame_equal
from pyflink.common import Row
from pyflink.table.types import DataTypes
from pyflink.testing import source_sink_utils
from pyflink.testing.test_case_utils import PyFlinkBlinkBatchTableTestCase, \
PyFlinkBlinkStreamTableTestCase, Py... | true | true |
f767fba4b03027fa20989a4588e5a75c3c688213 | 2,048 | py | Python | tensorflow_model_analysis/contrib/model_eval_lib.py | robertwb/model-analysis | e081016a1c81f17057ad3714f867832632899504 | [
"Apache-2.0"
] | 1 | 2019-03-24T15:09:56.000Z | 2019-03-24T15:09:56.000Z | tensorflow_model_analysis/contrib/model_eval_lib.py | robertwb/model-analysis | e081016a1c81f17057ad3714f867832632899504 | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/contrib/model_eval_lib.py | robertwb/model-analysis | e081016a1c81f17057ad3714f867832632899504 | [
"Apache-2.0"
] | 1 | 2020-04-12T14:29:27.000Z | 2020-04-12T14:29:27.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.929825 | 80 | 0.771973 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import apache_beam as beam
from tensorflow_model_analysis import types
from tensorflow_model_analysis.api.impl import evaluate
from tensorflow_model_analysis.types_compat import Optional
@beam.typehints.wi... | true | true |
f767fc00b5da61b5b6ca98304a04fabfc223ac2d | 624 | py | Python | examples/model-training/model_training/resources/__init__.py | roeap/flight-fusion | 14f73c99c5214277d0abcced633d83b37f1d5292 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-12-24T06:21:40.000Z | 2022-01-16T12:21:06.000Z | examples/model-training/model_training/resources/__init__.py | roeap/flight-fusion | 14f73c99c5214277d0abcced633d83b37f1d5292 | [
"Apache-2.0",
"MIT"
] | 66 | 2021-12-15T17:08:21.000Z | 2022-03-29T10:36:18.000Z | examples/model-training/model_training/resources/__init__.py | roeap/flight-fusion | 14f73c99c5214277d0abcced633d83b37f1d5292 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-02-08T21:07:08.000Z | 2022-02-08T21:07:08.000Z | from dagster_mlflow import mlflow_tracking
from dagster_fusion import flight_fusion_io_manager, flight_fusion_resource
from .dataset_spec import dataset_properties
RESOURCES_LOCAL = {
"fusion_io_manager": flight_fusion_io_manager,
"fusion_client": flight_fusion_resource.configured({"host": "127.0.0.1", "port... | 31.2 | 94 | 0.700321 | from dagster_mlflow import mlflow_tracking
from dagster_fusion import flight_fusion_io_manager, flight_fusion_resource
from .dataset_spec import dataset_properties
RESOURCES_LOCAL = {
"fusion_io_manager": flight_fusion_io_manager,
"fusion_client": flight_fusion_resource.configured({"host": "127.0.0.1", "port... | true | true |
f767fc179ce62571eb82287782f1d69c78d494fd | 1,028 | py | Python | 415-add-strings/add_strings.py | cnluocj/leetcode | 5b870a63ba1aab3db1e05421c91f404a9aabc489 | [
"MIT"
] | null | null | null | 415-add-strings/add_strings.py | cnluocj/leetcode | 5b870a63ba1aab3db1e05421c91f404a9aabc489 | [
"MIT"
] | null | null | null | 415-add-strings/add_strings.py | cnluocj/leetcode | 5b870a63ba1aab3db1e05421c91f404a9aabc489 | [
"MIT"
] | null | null | null | """
59.40%
其实是大数相加
"""
class Solution(object):
def addStrings(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
num1_index = len(num1) - 1
num2_index = len(num2) - 1
if num1_index < 0:
return num2
if num2_inde... | 23.906977 | 73 | 0.430934 |
class Solution(object):
def addStrings(self, num1, num2):
num1_index = len(num1) - 1
num2_index = len(num2) - 1
if num1_index < 0:
return num2
if num2_index < 0:
return num1
carry = 0
result = []
while True:
r = ''
... | true | true |
f767fc7686b2d96f3f32d549be1c696c44d6f726 | 1,303 | py | Python | useWord.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | 1 | 2021-07-07T21:07:56.000Z | 2021-07-07T21:07:56.000Z | useWord.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | null | null | null | useWord.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | null | null | null | import operator as op
import math
import random
import sys
def ncr(n, r):
r = min(r, n - r)
if r == 0:
return 1
numer = reduce(op.mul, xrange(n, n - r, -1))
denom = reduce(op.mul, xrange(1, r + 1))
return numer // denom
def run():
length = int(input("Length(-1 to quit): "))
if lengt... | 24.584906 | 83 | 0.511128 | import operator as op
import math
import random
import sys
def ncr(n, r):
r = min(r, n - r)
if r == 0:
return 1
numer = reduce(op.mul, xrange(n, n - r, -1))
denom = reduce(op.mul, xrange(1, r + 1))
return numer // denom
def run():
length = int(input("Length(-1 to quit): "))
if lengt... | true | true |
f767fcaaf705080693f243fbd905c93b6a1a3f9e | 1,912 | py | Python | models/diff_token/reg_cnn/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 6 | 2019-04-08T05:53:03.000Z | 2021-02-06T08:19:36.000Z | models/diff_token/reg_cnn/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 18 | 2019-03-13T20:19:02.000Z | 2019-07-30T18:53:03.000Z | models/diff_token/reg_cnn/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 2 | 2019-03-11T14:13:42.000Z | 2019-10-20T21:50:25.000Z | import os
import models.diff_token.args
def get_args():
parser = models.diff_token.args.get_args()
parser.add_argument('--dataset', type=str, default='ApacheDiffToken', choices=['ApacheDiffToken', 'SpringDiffToken'])
parser.add_argument('--mode', type=str, default='multichannel', choices=['rand', 'stati... | 51.675676 | 125 | 0.710774 | import os
import models.diff_token.args
def get_args():
parser = models.diff_token.args.get_args()
parser.add_argument('--dataset', type=str, default='ApacheDiffToken', choices=['ApacheDiffToken', 'SpringDiffToken'])
parser.add_argument('--mode', type=str, default='multichannel', choices=['rand', 'stati... | true | true |
f767fce5c4c6fe9bcfd0e749109fd30b670fca6e | 14,695 | py | Python | tools/etl/mapreduce.py | leo-at-rsmart/shiny-octo-batman | 1ee42abaab524e7a21aa4374248bf0639cb1e3bf | [
"Apache-2.0",
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-04-15T08:38:08.000Z | 2015-04-15T08:38:08.000Z | tools/etl/mapreduce.py | leo-at-rsmart/shiny-octo-batman | 1ee42abaab524e7a21aa4374248bf0639cb1e3bf | [
"Apache-2.0",
"BSD-2-Clause-FreeBSD"
] | null | null | null | tools/etl/mapreduce.py | leo-at-rsmart/shiny-octo-batman | 1ee42abaab524e7a21aa4374248bf0639cb1e3bf | [
"Apache-2.0",
"BSD-2-Clause-FreeBSD"
] | null | null | null | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.095128 | 80 | 0.608983 |
__author__ = [
'johncox@google.com (John Cox)',
'juliaoh@google.com (Julia Oh)',
]
import csv
import os
import sys
from xml.etree import ElementTree
from models import transforms
import mrs
from tools.etl import etl_lib
class MapReduceJob(etl_lib.Job):
MAPREDUCE_CLASS = None
def _configure... | true | true |
f7680107b3788061268943c7904794e8e8f7e204 | 6,233 | py | Python | venv/Lib/site-packages/folium/plugins/time_slider_choropleth.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 5,451 | 2015-01-03T01:36:01.000Z | 2022-03-30T16:14:33.000Z | venv/Lib/site-packages/folium/plugins/time_slider_choropleth.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 1,341 | 2015-01-01T16:01:49.000Z | 2022-03-31T10:08:11.000Z | venv/Lib/site-packages/folium/plugins/time_slider_choropleth.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 2,510 | 2015-01-04T09:56:20.000Z | 2022-03-31T03:12:45.000Z | # -*- coding: utf-8 -*-
from folium.elements import JSCSSMixin
from folium.features import GeoJson
from folium.map import Layer
from jinja2 import Template
class TimeSliderChoropleth(JSCSSMixin, Layer):
"""
Creates a TimeSliderChoropleth plugin to append into a map with Map.add_child.
Parameters
--... | 39.201258 | 109 | 0.502326 |
from folium.elements import JSCSSMixin
from folium.features import GeoJson
from folium.map import Layer
from jinja2 import Template
class TimeSliderChoropleth(JSCSSMixin, Layer):
_template = Template(u"""
{% macro script(this, kwargs) %}
var timestamps = {{ this.timestamps|tojson }};
... | true | true |
f7680108ca3438e83923112ecfd43ba022742dba | 23,486 | py | Python | sn_sq_pdf_converter.py | unfoldingWord-dev/uw_pdf_conversion_tools | 30b77ed5bb1eb61cb33815a9801c90ae0f7fc0c3 | [
"MIT"
] | null | null | null | sn_sq_pdf_converter.py | unfoldingWord-dev/uw_pdf_conversion_tools | 30b77ed5bb1eb61cb33815a9801c90ae0f7fc0c3 | [
"MIT"
] | 1 | 2021-06-08T21:52:10.000Z | 2021-06-08T21:52:10.000Z | sn_sq_pdf_converter.py | unfoldingWord-dev/uw-pdf-conversion-tools | 30b77ed5bb1eb61cb33815a9801c90ae0f7fc0c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2020 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# Contributors:
# Richard Mahn <rich.mahn@unfoldingword.org>
"""
This script generates the HTML and PDF SN-SQ documents
"""
import os
import re
import markdown2
import general_t... | 48.225873 | 189 | 0.568722 |
import os
import re
import markdown2
import general_tools.html_tools as html_tools
from collections import OrderedDict
from pdf_converter import RepresentsInt, run_converter
from tsv_pdf_converter import TsvPdfConverter, main
from general_tools.bible_books import BOOK_CHAPTER_VERSES
from general_tools.alignment_tools ... | true | true |
f768014f0584f52572d568dfca3d369617d6840a | 145 | py | Python | ceph/ceph_admin/ceph.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | 21 | 2019-04-22T07:12:37.000Z | 2022-03-11T09:34:24.000Z | ceph/ceph_admin/ceph.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | 601 | 2019-03-21T09:29:53.000Z | 2022-03-31T18:16:53.000Z | ceph/ceph_admin/ceph.py | julpark-rh/cephci | 3796668e8dcfc5851f387c47ff0b459d495a40c7 | [
"MIT"
] | 72 | 2019-02-20T22:23:55.000Z | 2022-03-31T13:59:25.000Z | """Interface to the base command ceph."""
from ceph.ceph_admin import CephAdmin
class CephCLI(CephAdmin):
"""Interface to the ceph CLI."""
| 20.714286 | 41 | 0.717241 | from ceph.ceph_admin import CephAdmin
class CephCLI(CephAdmin):
| true | true |
f768032193ff1f34143062e88cbe65d7f38847fe | 341 | py | Python | topCoder/srms/600s/srm623/div2/catch_the_beat_easy.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/600s/srm623/div2/catch_the_beat_easy.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/600s/srm623/div2/catch_the_beat_easy.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | from operator import itemgetter
class CatchTheBeatEasy:
def ableToCatchAll(self, x, y):
t, xx = 0, 0
for i, j in sorted(zip(x, y), key=itemgetter(1)):
if abs(i-xx) > j-t:
return 'Not able to catch'
else:
xx = i
t = j
re... | 26.230769 | 57 | 0.483871 | from operator import itemgetter
class CatchTheBeatEasy:
def ableToCatchAll(self, x, y):
t, xx = 0, 0
for i, j in sorted(zip(x, y), key=itemgetter(1)):
if abs(i-xx) > j-t:
return 'Not able to catch'
else:
xx = i
t = j
re... | true | true |
f7680324554212163f0cda57393948d7a011c836 | 1,576 | py | Python | gitz/git/save.py | rec/gitz | cbb07f99dd002c85b5ca95896b33d03150bf9282 | [
"MIT"
] | 24 | 2019-07-26T03:57:16.000Z | 2021-11-22T22:39:13.000Z | gitz/git/save.py | rec/gitz | cbb07f99dd002c85b5ca95896b33d03150bf9282 | [
"MIT"
] | 212 | 2019-06-13T13:44:26.000Z | 2020-06-02T17:59:51.000Z | gitz/git/save.py | rec/gitz | cbb07f99dd002c85b5ca95896b33d03150bf9282 | [
"MIT"
] | 2 | 2019-08-09T13:55:38.000Z | 2019-09-07T11:17:59.000Z | from . import GIT
from . import functions
from . import root
from pathlib import Path
import datetime
import os
NONE, STAGED, CHANGED, UNTRACKED = 'none', 'staged', 'changed', 'untracked'
PREFIX = '_gitz_'
SAVE_FILE = Path('._gitz_save_.txt')
@root.run_in_root
def save(untracked=False, stash=True):
timestamp = d... | 23.878788 | 75 | 0.585025 | from . import GIT
from . import functions
from . import root
from pathlib import Path
import datetime
import os
NONE, STAGED, CHANGED, UNTRACKED = 'none', 'staged', 'changed', 'untracked'
PREFIX = '_gitz_'
SAVE_FILE = Path('._gitz_save_.txt')
@root.run_in_root
def save(untracked=False, stash=True):
timestamp = d... | true | true |
f768040d99e60a8130a83aaae0d01a376df1facd | 48,889 | py | Python | mmdet/models/dense_heads/corner_head.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/corner_head.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/corner_head.py | sokunmin/mmdetection | 2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod
from math import ceil, log
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool, batched_nms
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from ..utils import ... | 43.72898 | 100 | 0.564524 | from abc import abstractmethod
from math import ceil, log
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool, batched_nms
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from ..utils import ... | true | true |
f7680463c9ce5145ceaceb2f54a19fc34cedcac2 | 1,122 | py | Python | src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/sdk/models/topic_paged.py | viananth/azure-cli | 4d23492ed03e946cfc11bae23b29acb971fb137d | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/sdk/models/topic_paged.py | viananth/azure-cli | 4d23492ed03e946cfc11bae23b29acb971fb137d | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/sdk/models/topic_paged.py | viananth/azure-cli | 4d23492ed03e946cfc11bae23b29acb971fb137d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 36.193548 | 109 | 0.469697 |
from msrest.paging import Paged
class TopicPaged(Paged):
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Topic]'}
}
def __init__(self, *args, **kwargs):
super(TopicPaged, self).__init__(*args, **kwargs)
| true | true |
f7680484eb01780c2d0c563f5afb2f55cece065f | 93 | py | Python | Employment_System/apps/verifications/constants.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | Employment_System/apps/verifications/constants.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | 6 | 2021-02-08T20:29:41.000Z | 2022-03-11T23:43:32.000Z | meiduo_mell/meiduo_mell/apps/verifications/constants.py | fader-zm/kong | 360e25a72dc95ca4cd4a6b461d65fdfbd28cf73e | [
"MIT"
] | null | null | null | SMS_CODE_REDIS_EXPIRES = 300 # 短信验证码有效期 300秒
SEND_SMS_CODE_INTERVAL = 60 # 短信是否发送过的标记 60秒 | 31 | 46 | 0.795699 | SMS_CODE_REDIS_EXPIRES = 300
SEND_SMS_CODE_INTERVAL = 60 | true | true |
f768053610a961d4bb82a8227559a64512bda5cb | 20,422 | py | Python | refactorings/extract_subclass.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | 1 | 2021-10-10T23:56:49.000Z | 2021-10-10T23:56:49.000Z | refactorings/extract_subclass.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | null | null | null | refactorings/extract_subclass.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | 1 | 2021-08-21T11:25:49.000Z | 2021-08-21T11:25:49.000Z | import os
from gen.javaLabeled.JavaLexer import JavaLexer
# try:
# import understand as und
# except ImportError as e:
# print(e)
from utilization.setup_understand import *
from antlr4 import *
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.javaLabeled.JavaParserLabeled import JavaParse... | 40.681275 | 141 | 0.611595 | import os
from gen.javaLabeled.JavaLexer import JavaLexer
from utilization.setup_understand import *
from antlr4 import *
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled
from gen.javaLabeled.JavaParserLabeledListener import JavaParserLabeled... | true | true |
f768055e5f3f7a4b7a2a7d9c6aa5504b07d73067 | 4,312 | py | Python | help_gen.py | persquare/tmBundleAutoHelp | 1da65f2fc81d3344327a188ee16f63fe19cfb7e9 | [
"MIT"
] | null | null | null | help_gen.py | persquare/tmBundleAutoHelp | 1da65f2fc81d3344327a188ee16f63fe19cfb7e9 | [
"MIT"
] | null | null | null | help_gen.py | persquare/tmBundleAutoHelp | 1da65f2fc81d3344327a188ee16f63fe19cfb7e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
This module generates documentation for a TextMate bundle by parsing the .tmCommand files.
FIXME: The formatting is slightly messed up (underlined links, extra table header, etc.)
FIXME: Also parse bash/ruby/perl scripts for docstring equivalents
FIXME: List tab-triggers
"""... | 25.975904 | 96 | 0.568646 |
import os
import re
import json
from subprocess import Popen, PIPE
class TableBuilder(object):
def __init__(self, *args):
super(TableBuilder, self).__init__()
self.headings = args
self.rows = []
def add_row(self, *args):
self.rows.append(args)
def render(self):
l... | true | true |
f76805a96e705e45927b2d3845a2e85d47c4adb3 | 8,801 | py | Python | train_ke.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 2,649 | 2018-08-03T14:18:00.000Z | 2022-03-31T08:08:17.000Z | train_ke.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 95 | 2018-08-13T01:46:03.000Z | 2022-03-13T08:38:14.000Z | train_ke.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 549 | 2018-08-06T08:09:22.000Z | 2022-03-31T08:08:21.000Z | """
Script for training model on Keras.
"""
import argparse
import time
import logging
import os
import numpy as np
import random
import keras
from keras.models import load_model
from keras.callbacks import ModelCheckpoint
import mxnet as mx
from common.logger_utils import initialize_logging
from keras_.utils impo... | 27.851266 | 118 | 0.609135 |
import argparse
import time
import logging
import os
import numpy as np
import random
import keras
from keras.models import load_model
from keras.callbacks import ModelCheckpoint
import mxnet as mx
from common.logger_utils import initialize_logging
from keras_.utils import prepare_ke_context, prepare_model, get_data_r... | true | true |
f7680682b9ed25a490e696dd6d662696fbd0a3f5 | 13,294 | py | Python | test_net.py | Flsahkong/faster-rcnn.pytorch | f2b4753f3ca86a19c2701d28aa135a81b2a21c25 | [
"MIT"
] | null | null | null | test_net.py | Flsahkong/faster-rcnn.pytorch | f2b4753f3ca86a19c2701d28aa135a81b2a21c25 | [
"MIT"
] | null | null | null | test_net.py | Flsahkong/faster-rcnn.pytorch | f2b4753f3ca86a19c2701d28aa135a81b2a21c25 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Pytorch Multi-GPU Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
... | 39.331361 | 116 | 0.595532 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import sys
import numpy as np
import argparse
import pprint
import pdb
import time
import cv2
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.o... | true | true |
f768072b4ac9dc98baf1aa409656e372fb0e0d43 | 835 | py | Python | kg_idg/transform_utils/reactome/uniprot2reactome.py | Knowledge-Graph-Hub/kg-idg | 7bd2054b19baec311412a00be141a76d04dc4ffb | [
"BSD-3-Clause"
] | null | null | null | kg_idg/transform_utils/reactome/uniprot2reactome.py | Knowledge-Graph-Hub/kg-idg | 7bd2054b19baec311412a00be141a76d04dc4ffb | [
"BSD-3-Clause"
] | 76 | 2021-08-18T17:52:02.000Z | 2022-03-28T15:11:12.000Z | kg_idg/transform_utils/reactome/uniprot2reactome.py | Knowledge-Graph-Hub/kg-idg | 7bd2054b19baec311412a00be141a76d04dc4ffb | [
"BSD-3-Clause"
] | null | null | null | import uuid
from biolink_model_pydantic.model import ( #type: ignore
Protein,
Pathway,
ChemicalToPathwayAssociation,
Predicate,
)
from koza.cli_runner import koza_app #type: ignore
source_name="uniprot2reactome"
full_source_name="Reactome"
row = koza_app.get_row(source_name)
# Entities
protein = Pr... | 24.558824 | 66 | 0.71497 | import uuid
from biolink_model_pydantic.model import ( Protein,
Pathway,
ChemicalToPathwayAssociation,
Predicate,
)
from koza.cli_runner import koza_app
source_name="uniprot2reactome"
full_source_name="Reactome"
row = koza_app.get_row(source_name)
protein = Protein(id='UniProtKB:' + row['UPID'])
pa... | true | true |
f76807df1ee44f2275514d8676ebb74cf0130a97 | 204,513 | py | Python | languages/pt.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 205 | 2015-01-20T08:26:09.000Z | 2022-03-27T19:59:33.000Z | languages/pt.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 249 | 2015-02-10T09:56:35.000Z | 2022-03-23T19:54:36.000Z | languages/pt.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 231 | 2015-02-10T09:33:17.000Z | 2022-02-18T19:56:05.000Z | # -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "Uma localização que especifica a área geográfica para esta região. Pode ser uma localização da hierarq... | 61.711829 | 991 | 0.743518 | {
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "Uma localização que especifica a área geográfica para esta região. Pode ser uma localização da hierarquia de localização, ou um... | true | true |
f768080d02945fa55902e810ef9b7adbbcad1d6f | 1,073 | py | Python | imageNet/urls.py | GOIT-Course-Project/data_science | d2afa2d106ee054267bf04aae2073440a9b30529 | [
"MIT"
] | null | null | null | imageNet/urls.py | GOIT-Course-Project/data_science | d2afa2d106ee054267bf04aae2073440a9b30529 | [
"MIT"
] | null | null | null | imageNet/urls.py | GOIT-Course-Project/data_science | d2afa2d106ee054267bf04aae2073440a9b30529 | [
"MIT"
] | null | null | null | """imageNet URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... | 37 | 78 | 0.705499 | from django.contrib import admin
from django.urls import path
from cnnapp import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.index, name = 'homepage'),
path('predictImage', views.predictImage, n... | true | true |
f7680815328c911f545648c7ea462705a5167fb0 | 1,277 | py | Python | python/572.subtree-of-another-tree.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 10 | 2019-09-15T00:23:57.000Z | 2022-01-05T12:53:42.000Z | python/572.subtree-of-another-tree.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 3 | 2021-06-30T00:39:26.000Z | 2021-08-01T07:13:59.000Z | python/572.subtree-of-another-tree.py | Zhenye-Na/leetcode | 95196a45f5709ccf7b970ee5ac84a4bf8fe2301e | [
"MIT"
] | 6 | 2020-02-08T02:55:22.000Z | 2022-01-02T22:48:18.000Z | #
# @lc app=leetcode id=572 lang=python3
#
# [572] Subtree of Another Tree
#
# https://leetcode.com/problems/subtree-of-another-tree/description/
#
# algorithms
# Easy (42.58%)
# Likes: 1444
# Dislikes: 55
# Total Accepted: 129.2K
# Total Submissions: 303.4K
# Testcase Example: '[3,4,5,1,2]\n[4,1,2]'
#
#
# Give... | 16.371795 | 78 | 0.572435 | # could also be considered as a subtree of itself.
#
#
# Example 1:
#
# Given tree s:
#
# 3
# / \
# 4 5
# / \
# 1 2
#
# Given tree t:
#
# 4
# / \
# 1 2
#
# Return true, because t has the same structure and node values with a subtree
# of s.
#
#
# Example 2:
#
# Given tree s:
#
# ... | false | true |
f76809be6510d2224726358af250aea09c174ecb | 1,471 | py | Python | src/sendMail.py | smrnjeet222/CertificateGenerator | 7567e3fc2b46c529d76e68e1be12921d8582fc35 | [
"MIT"
] | null | null | null | src/sendMail.py | smrnjeet222/CertificateGenerator | 7567e3fc2b46c529d76e68e1be12921d8582fc35 | [
"MIT"
] | null | null | null | src/sendMail.py | smrnjeet222/CertificateGenerator | 7567e3fc2b46c529d76e68e1be12921d8582fc35 | [
"MIT"
] | 2 | 2020-07-26T17:03:02.000Z | 2021-05-02T20:09:42.000Z | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import src.config as con
FROM = con.MAIL
def sendMail(name, toaddr):
# instance of MIMEMultipart
filename = name.replace(" ", "_").lower()+'.pdf'... | 22.984375 | 76 | 0.665534 | import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import src.config as con
FROM = con.MAIL
def sendMail(name, toaddr):
filename = name.replace(" ", "_").lower()+'.pdf'
file_path = f"output/{f... | true | true |
f76809d122adda7ca274996098bfd74c65b589fc | 343 | py | Python | loss/cross_entropy_prob.py | zwx8981/DBCNN-Pytorch | 16c3156054a30a3eabb45dffcf538f42452a14f3 | [
"MIT"
] | 150 | 2019-01-24T10:32:49.000Z | 2022-03-10T10:08:23.000Z | loss/cross_entropy_prob.py | lllllllllllll-llll/DBCNN-PyTorch | fa29f0307aa4533c4025c688ba5301cfddf9812f | [
"MIT"
] | 29 | 2019-03-06T06:54:53.000Z | 2022-03-29T12:00:41.000Z | loss/cross_entropy_prob.py | lllllllllllll-llll/DBCNN-PyTorch | fa29f0307aa4533c4025c688ba5301cfddf9812f | [
"MIT"
] | 31 | 2019-03-10T08:29:30.000Z | 2022-03-05T06:58:25.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class cross_entropy_prob(nn.Module):
def __init__(self):
super(cross_entropy_prob, self).__init__()
def forward(self, pred, soft_targets):
pred = F.log_softmax(pred)
loss = torch.mean(torch.sum(- soft_targets * pred, 1... | 24.5 | 62 | 0.6793 | import torch
import torch.nn as nn
import torch.nn.functional as F
class cross_entropy_prob(nn.Module):
def __init__(self):
super(cross_entropy_prob, self).__init__()
def forward(self, pred, soft_targets):
pred = F.log_softmax(pred)
loss = torch.mean(torch.sum(- soft_targets * pred, 1... | true | true |
f7680a8bd16d7c390e488e5859fa1a91a1b4725a | 7,391 | py | Python | magnum/api/controllers/v1/certificate.py | karasjoh000/magnum | dfc083d9f12df60dd64d273d1df2f7eb81d5ec07 | [
"Apache-2.0"
] | 1 | 2020-12-29T03:35:26.000Z | 2020-12-29T03:35:26.000Z | magnum/api/controllers/v1/certificate.py | karasjoh000/magnum | dfc083d9f12df60dd64d273d1df2f7eb81d5ec07 | [
"Apache-2.0"
] | null | null | null | magnum/api/controllers/v1/certificate.py | karasjoh000/magnum | dfc083d9f12df60dd64d273d1df2f7eb81d5ec07 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 37.328283 | 79 | 0.623055 |
from oslo_utils import timeutils
import pecan
import wsme
from wsme import types as wtypes
from magnum.api.controllers import base
from magnum.api.controllers import link
from magnum.api.controllers.v1 import types
from magnum.api import expose
from magnum.api import utils as api_utils
from magnum.common import excep... | true | true |
f7680ae817ef61910c9737373b5b39df9ed9f1e1 | 1,984 | py | Python | experiments/experiments_gdsc/cross_validation/icm_nmtf/greedysearch_xval_icm.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 16 | 2017-04-19T12:04:47.000Z | 2021-12-03T00:50:43.000Z | experiments/experiments_gdsc/cross_validation/icm_nmtf/greedysearch_xval_icm.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 1 | 2017-04-20T11:26:16.000Z | 2017-04-20T11:26:16.000Z | experiments/experiments_gdsc/cross_validation/icm_nmtf/greedysearch_xval_icm.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 8 | 2015-12-15T05:29:43.000Z | 2019-06-05T03:14:11.000Z | """
Run the cross validation with greedy search for model selection using ICM-NMTF
on the Sanger dataset.
"""
import sys, os
project_location = os.path.dirname(__file__)+"/../../../../../"
sys.path.append(project_location)
import numpy, random
from BNMTF.code.models.nmtf_icm import nmtf_icm
from BNMTF.code.cross_val... | 29.176471 | 209 | 0.752016 |
import sys, os
project_location = os.path.dirname(__file__)+"/../../../../../"
sys.path.append(project_location)
import numpy, random
from BNMTF.code.models.nmtf_icm import nmtf_icm
from BNMTF.code.cross_validation.greedy_search_cross_validation import GreedySearchCrossValidation
from BNMTF.data_drug_sensitivity.gdsc... | true | true |
f7680b9df6c08f886e08e58f79f2c552dbc2955e | 7,516 | py | Python | etalumacontrol/lumascope.py | jonasoh/etalumacontrol | 01998c8ba957c1ede0d8e5a8bdff86ea62699150 | [
"BSD-2-Clause"
] | null | null | null | etalumacontrol/lumascope.py | jonasoh/etalumacontrol | 01998c8ba957c1ede0d8e5a8bdff86ea62699150 | [
"BSD-2-Clause"
] | 1 | 2021-08-20T09:06:29.000Z | 2021-08-20T09:06:29.000Z | etalumacontrol/lumascope.py | jonasoh/etalumacontrol | 01998c8ba957c1ede0d8e5a8bdff86ea62699150 | [
"BSD-2-Clause"
] | null | null | null | # pyright: reportMissingImports=false
import os
import clr
import sys
import time
import platform
from PIL import Image
from .CypressFX import FX2
from .definitions import RSC_DIR, LIB_DIR, LED_WHITE
# load appropriate dll
(bits, linkage) = platform.architecture()
if bits == "64bit":
sys.path.append(os.path.join(... | 34.95814 | 104 | 0.631453 |
import os
import clr
import sys
import time
import platform
from PIL import Image
from .CypressFX import FX2
from .definitions import RSC_DIR, LIB_DIR, LED_WHITE
(bits, linkage) = platform.architecture()
if bits == "64bit":
sys.path.append(os.path.join(LIB_DIR, 'x64'))
else:
sys.path.append(os.path.join(LIB_D... | true | true |
f7680c450b41665e5d91bcace42229c7359e1c05 | 3,831 | py | Python | pq/cpubound.py | quantmind/pulsar-queue | 26ec8cbc291a830bd338c31f8a129cbd15f87a69 | [
"BSD-3-Clause"
] | 64 | 2015-09-25T19:28:17.000Z | 2022-02-15T20:52:03.000Z | pq/cpubound.py | quantmind/pulsar-queue | 26ec8cbc291a830bd338c31f8a129cbd15f87a69 | [
"BSD-3-Clause"
] | 16 | 2015-09-23T13:35:10.000Z | 2017-11-25T09:32:15.000Z | pq/cpubound.py | quantmind/pulsar-queue | 26ec8cbc291a830bd338c31f8a129cbd15f87a69 | [
"BSD-3-Clause"
] | 11 | 2015-10-01T14:39:36.000Z | 2021-12-31T06:57:49.000Z | import os
import json
import sys
import traceback
import asyncio
import logging
from asyncio import subprocess, streams
PQPATH = os.path.dirname(__file__)
PROCESS_FILE = os.path.join(PQPATH, "cpubound.py")
LOGGER = logging.getLogger('pulsar.queue.cpubound')
class Stream:
'''Modify stream for remote logging
... | 29.469231 | 67 | 0.566954 | import os
import json
import sys
import traceback
import asyncio
import logging
from asyncio import subprocess, streams
PQPATH = os.path.dirname(__file__)
PROCESS_FILE = os.path.join(PQPATH, "cpubound.py")
LOGGER = logging.getLogger('pulsar.queue.cpubound')
class Stream:
def __init__(self, stream):
self... | true | true |
f7680ca578db5abf3c41b1dfb7d427abb67878c8 | 6,231 | py | Python | pyiron/base/job/jobtype.py | srmnitc/pyiron | ea290206292d60f5ad0a67b171a9f2f71f043264 | [
"BSD-3-Clause"
] | null | null | null | pyiron/base/job/jobtype.py | srmnitc/pyiron | ea290206292d60f5ad0a67b171a9f2f71f043264 | [
"BSD-3-Clause"
] | null | null | null | pyiron/base/job/jobtype.py | srmnitc/pyiron | ea290206292d60f5ad0a67b171a9f2f71f043264 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
import importlib
import inspect
import pkgutil
from six import with_metaclass
from... | 35.20339 | 111 | 0.662975 |
from __future__ import print_function
import importlib
import inspect
import pkgutil
from six import with_metaclass
from pyiron.base.generic.util import static_isinstance
__author__ = "Joerg Neugebauer, Jan Janssen"
__copyright__ = (
"Copyright 2020, Max-Planck-Institut für Eisenforschung GmbH - "
"Computati... | true | true |
f7680ccdc8431a04ffa503d6c313251c503021b7 | 19,223 | py | Python | python/pyspark/sql/pandas/conversion.py | meraviverma/Spark | d4c6ec6ba77effeda78302e13a637e3fe4205e80 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-01-29T05:20:24.000Z | 2020-08-11T15:53:35.000Z | python/pyspark/sql/pandas/conversion.py | meraviverma/Spark | d4c6ec6ba77effeda78302e13a637e3fe4205e80 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2020-05-22T00:04:31.000Z | 2020-12-02T18:44:52.000Z | python/pyspark/sql/pandas/conversion.py | meraviverma/Spark | d4c6ec6ba77effeda78302e13a637e3fe4205e80 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 45.124413 | 100 | 0.612339 | import sys
import warnings
if sys.version >= '3':
basestring = unicode = str
xrange = range
else:
from itertools import izip as zip
from pyspark import since
from pyspark.rdd import _load_from_socket
from pyspark.sql.pandas.serializers import ArrowCollectSerializer
from pyspark.sql.types import IntegralTyp... | true | true |
f7680dd6227666cc605fcc7e0f28e0188fd5fbdc | 14,620 | py | Python | torchmm/models/retrieval/sgraf.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 42 | 2022-01-05T13:49:48.000Z | 2022-03-30T20:20:18.000Z | torchmm/models/retrieval/sgraf.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | null | null | null | torchmm/models/retrieval/sgraf.py | njustkmg/PaddleMM | 92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5 | [
"Apache-2.0"
] | 5 | 2022-01-19T00:27:24.000Z | 2022-03-23T08:29:50.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from .layers.contrastive import ContrastiveLoss
from .layers.utils import l1norm, l2norm
from .layers.img_enc import EncoderImage
from .layers.txt_enc import EncoderText
class VisualSA(nn.Module):
"""
Build global image re... | 36.55 | 100 | 0.590424 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from .layers.contrastive import ContrastiveLoss
from .layers.utils import l1norm, l2norm
from .layers.img_enc import EncoderImage
from .layers.txt_enc import EncoderText
class VisualSA(nn.Module):
def __init__(self, embed_dim,... | true | true |
f7680e0e0bf64206e17220d1326c2fd14975784c | 179 | py | Python | virtual/bin/django-admin.py | MichelAtieno/Neighbourhood | 52ca60f557d3a1412bebba089015e8b38714f891 | [
"Unlicense"
] | null | null | null | virtual/bin/django-admin.py | MichelAtieno/Neighbourhood | 52ca60f557d3a1412bebba089015e8b38714f891 | [
"Unlicense"
] | null | null | null | virtual/bin/django-admin.py | MichelAtieno/Neighbourhood | 52ca60f557d3a1412bebba089015e8b38714f891 | [
"Unlicense"
] | null | null | null | #!/home/michel/Desktop/Python-Django/Neighbourhood/virtual/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 29.833333 | 72 | 0.798883 | from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
f7681012e48debec1804db0e1b00b973bc9442bb | 7,269 | py | Python | gdal/swig/python/scripts/epsg_tr.py | dtusk/gdal1 | 30dcdc1eccbca2331674f6421f1c5013807da609 | [
"MIT"
] | 3 | 2017-01-12T10:18:56.000Z | 2020-03-21T16:42:55.000Z | gdal/swig/python/scripts/epsg_tr.py | ShinNoNoir/gdal-1.11.5-vs2015 | 5d544e176a4c11f9bcd12a0fe66f97fd157824e6 | [
"MIT"
] | null | null | null | gdal/swig/python/scripts/epsg_tr.py | ShinNoNoir/gdal-1.11.5-vs2015 | 5d544e176a4c11f9bcd12a0fe66f97fd157824e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#******************************************************************************
# $Id$
#
# Project: CFS OGC MapServer
# Purpose: Script to create WKT and PROJ.4 dictionaries for EPSG GCS/PCS
# codes.
# Author: Frank Warmerdam, warmerdam@pobox.com
#
#***************************... | 31.881579 | 150 | 0.507085 |
try:
from osgeo import osr
from osgeo import gdal
except ImportError:
import osr
import gdal
import sys
import string
def Usage():
print('Usage: epsg_tr.py [-wkt] [-pretty_wkt] [-proj4] [-xml] [-postgis]')
print(' [-skip] [-list filename] [start_code [end_code]]')
sys.ex... | true | true |
f76811ab2dda4df13847b25309e352053cb4b576 | 1,095 | py | Python | tests/test_magic_methods.py | GeeWee/django-recurrence | f56ca874755b91a4d3f2dc59d37f4c756fffcd41 | [
"BSD-3-Clause"
] | 251 | 2015-01-30T13:40:59.000Z | 2022-01-24T11:33:43.000Z | tests/test_magic_methods.py | GeeWee/django-recurrence | f56ca874755b91a4d3f2dc59d37f4c756fffcd41 | [
"BSD-3-Clause"
] | 154 | 2015-01-12T22:36:46.000Z | 2022-01-24T16:03:21.000Z | tests/test_magic_methods.py | GeeWee/django-recurrence | f56ca874755b91a4d3f2dc59d37f4c756fffcd41 | [
"BSD-3-Clause"
] | 158 | 2015-01-14T15:20:50.000Z | 2022-01-23T22:28:52.000Z | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_truthiness_with_single_rrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
rrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_exrule():
rule = Rule(
... | 17.109375 | 50 | 0.649315 | from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_truthiness_with_single_rrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
rrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_exrule():
rule = Rule(
... | true | true |
f768128ea88786185d9ff636216afe93896a7a05 | 1,233 | py | Python | tests/test_build_args.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_args.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_args.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | """Hardening Importer - Import IronBank Hardening Manifests for builds.
This module provides tests for the models building argument strings for build
executors.
"""
import pytest
from hardening_importer.models import HardeningManifest
from .conftest import VALID_MANIFESTS
def test_build_args():
"""Test valid ... | 35.228571 | 78 | 0.695053 |
import pytest
from hardening_importer.models import HardeningManifest
from .conftest import VALID_MANIFESTS
def test_build_args():
for manifest_file in VALID_MANIFESTS:
manifest = HardeningManifest.from_yaml(manifest_file)
assert manifest.name in ' '.join(manifest.build_args(context_dir='.'))
... | true | true |
f7681317356729e262947d77e4ff240336ef3659 | 272 | py | Python | src/cosmic_ray_spor_filter/cli.py | abingham/cosmic-ray-spor-filter | f7b8ecd93c033e5b29a7908eab8939af8f2f6e04 | [
"MIT"
] | null | null | null | src/cosmic_ray_spor_filter/cli.py | abingham/cosmic-ray-spor-filter | f7b8ecd93c033e5b29a7908eab8939af8f2f6e04 | [
"MIT"
] | 1 | 2020-06-21T10:15:50.000Z | 2020-06-21T10:15:50.000Z | src/cosmic_ray_spor_filter/cli.py | abingham/cosmic-ray-spor-filter | f7b8ecd93c033e5b29a7908eab8939af8f2f6e04 | [
"MIT"
] | null | null | null | import sys
from .filter import SporFilter
def main(argv=None):
"""Run spor filter with specified command line args.
Args:
argv: Command-line arguments to use.
"""
return SporFilter().main(argv)
if __name__ == '__main__':
sys.exit(main())
| 16 | 56 | 0.650735 | import sys
from .filter import SporFilter
def main(argv=None):
return SporFilter().main(argv)
if __name__ == '__main__':
sys.exit(main())
| true | true |
f7681516c5222cf0251336c95dd7c36cf43e2e9b | 10,946 | py | Python | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_usersonenotesectionspagesparentnotebooksectiongroupssections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_usersonenotesectionspagesparentnotebooksectiongroupssections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_usersonenotesectionspagesparentnotebooksectiongroupssections_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"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 ... | 53.921182 | 266 | 0.712589 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from .. import mod... | true | true |
f76815d86b2f5d876888ce997858fd80042ca96f | 680 | py | Python | justice/cli.py | it-matters-cz/justice | 7ab2e6ab1e09cbae041db36ccf9987b10d5c2b7d | [
"MIT"
] | null | null | null | justice/cli.py | it-matters-cz/justice | 7ab2e6ab1e09cbae041db36ccf9987b10d5c2b7d | [
"MIT"
] | 4 | 2021-03-17T01:26:32.000Z | 2021-03-17T03:23:09.000Z | justice/cli.py | it-matters-cz/justice | 7ab2e6ab1e09cbae041db36ccf9987b10d5c2b7d | [
"MIT"
] | null | null | null | """Console script for justice."""
import argparse
import pprint
import sys
from justice.justice import Justice
def main():
"""Console script for justice."""
pp = pprint.PrettyPrinter(indent=4)
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--get', type=str, nargs='*')
parser.add_a... | 24.285714 | 63 | 0.647059 | import argparse
import pprint
import sys
from justice.justice import Justice
def main():
pp = pprint.PrettyPrinter(indent=4)
parser = argparse.ArgumentParser()
parser.add_argument('-g', '--get', type=str, nargs='*')
parser.add_argument('-s', '--search', type=str, nargs='+')
args = parser.parse_a... | true | true |
f76815dfc04208648f6cd33fea89de887032993b | 323 | py | Python | Codes/Liam/561_array_partition_I.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 256 | 2017-10-25T13:02:15.000Z | 2022-02-25T13:47:59.000Z | Codes/Liam/561_array_partition_I.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 56 | 2017-10-27T01:34:20.000Z | 2022-03-01T00:20:55.000Z | Codes/Liam/561_array_partition_I.py | liuxiaohui1221/algorithm | d80e64185ceb4798ac5389bfbd226dc1d406f6b5 | [
"Apache-2.0"
] | 83 | 2017-10-25T12:51:53.000Z | 2022-02-15T08:27:03.000Z | # 执行用时 : 432 ms
# 内存消耗 : 15.7 MB
# 方案:排序后 相邻两个最小的就是奇数
class Solution:
def arrayPairSum(self, nums: List[int]) -> int:
"""
:type nums: List[int]
:rtype: int
"""
nums.sort()
sum = 0
for i in range(0, len(nums), 2):
sum += nums[i]
return s... | 17 | 51 | 0.470588 |
class Solution:
def arrayPairSum(self, nums: List[int]) -> int:
nums.sort()
sum = 0
for i in range(0, len(nums), 2):
sum += nums[i]
return sum
| true | true |
f76816ef5bc9a9a743b52f3e97e68c7e7cb2b162 | 830 | py | Python | test/test.py | odeke-em/restAssured | 72d5c3a3fe9fd090f067a4332f2a1df15370b1bb | [
"MIT"
] | 1 | 2016-11-20T17:54:02.000Z | 2016-11-20T17:54:02.000Z | test/test.py | odeke-em/restAssured | 72d5c3a3fe9fd090f067a4332f2a1df15370b1bb | [
"MIT"
] | null | null | null | test/test.py | odeke-em/restAssured | 72d5c3a3fe9fd090f067a4332f2a1df15370b1bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import urllib2
from threading import Thread
URL = 'http://localhost:8001'
class SiteRequest:
def __init__(self, x=10, suffixName='', tables=[]):
self.__x = x
self.__tables = tables
self.__suffixName = suffixName
def hit(self, hitCount):
for i in range(hi... | 25.9375 | 81 | 0.607229 |
import urllib2
from threading import Thread
URL = 'http://localhost:8001'
class SiteRequest:
def __init__(self, x=10, suffixName='', tables=[]):
self.__x = x
self.__tables = tables
self.__suffixName = suffixName
def hit(self, hitCount):
for i in range(hitCount):
f... | true | true |
f768172909efceb3d1a003d273b0a9193a4a7bec | 297,129 | py | Python | tests/admin_views/tests.py | yzuchenqiuyu/django | ccb1cfb64e919e163c51995ed99bff3c92d7d006 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2020-05-06T15:09:42.000Z | 2020-05-06T15:09:42.000Z | tests/admin_views/tests.py | yzuchenqiuyu/django | ccb1cfb64e919e163c51995ed99bff3c92d7d006 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | tests/admin_views/tests.py | yzuchenqiuyu/django | ccb1cfb64e919e163c51995ed99bff3c92d7d006 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | import datetime
import os
import re
import unittest
from unittest import mock
from urllib.parse import parse_qsl, urljoin, urlparse
import pytz
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETIO... | 47.125932 | 119 | 0.652 | import datetime
import os
import re
import unittest
from unittest import mock
from urllib.parse import parse_qsl, urljoin, urlparse
import pytz
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETIO... | true | true |
f768172cbaa5075d49a520052fcfbdd7747e37b1 | 3,341 | py | Python | contrib/packs/actions/pack_mgmt/get_installed.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | contrib/packs/actions/pack_mgmt/get_installed.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | contrib/packs/actions/pack_mgmt/get_installed.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 36.315217 | 94 | 0.611793 |
import os
import yaml
from git.repo import Repo
from git.exc import InvalidGitRepositoryError
from st2common.runners.base_action import Action
from st2common.content.utils import get_packs_base_paths
from st2common.constants.pack import MANIFEST_FILE_NAME
class GetInstalled(Action):
def run(self, pack):
... | true | true |
f7681896b7cb5e1de38b96c17d550ef801934701 | 37,112 | py | Python | google/apps/alertcenter/v1beta1/apps-alertcenter-v1beta1-py/google/apps/alertcenter_v1beta1/services/alert_center_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/apps/alertcenter/v1beta1/apps-alertcenter-v1beta1-py/google/apps/alertcenter_v1beta1/services/alert_center_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/apps/alertcenter/v1beta1/apps-alertcenter-v1beta1-py/google/apps/alertcenter_v1beta1/services/alert_center_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 42.077098 | 106 | 0.630901 | from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_cor... | true | true |
f7681947fd4ba410a8cae39e8006ec4e7a600fef | 7,533 | py | Python | code_28_GCN.py | aianaconda/pytorch-GNN-1st | 0c911e23fcc6cad07ac17cb16c1bb769f9cef63e | [
"Apache-2.0"
] | 6 | 2022-03-01T08:30:50.000Z | 2022-03-29T08:52:31.000Z | code_28_GCN.py | aianaconda/pytorch-GNN-1st | 0c911e23fcc6cad07ac17cb16c1bb769f9cef63e | [
"Apache-2.0"
] | null | null | null | code_28_GCN.py | aianaconda/pytorch-GNN-1st | 0c911e23fcc6cad07ac17cb16c1bb769f9cef63e | [
"Apache-2.0"
] | 3 | 2022-02-14T08:32:08.000Z | 2022-03-20T13:16:32.000Z | # -*- coding: utf-8 -*-
"""
@author: 代码医生工作室
@公众号:xiangyuejiqiren (内有更多优秀文章及学习资料)
@来源: <PyTorch深度学习和图神经网络(卷 1)——基础知识>配套代码
@配套代码技术支持:bbs.aianaconda.com
Created on Sat Oct 19 20:03:44 2019
"""
from pathlib import Path #提升路径的兼容性
#引入矩阵运算相关库
import numpy as np
import pandas as pd
from scipy.sparse import ... | 28.862069 | 103 | 0.638258 |
from pathlib import Path import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix,csr_matrix,diags,eye
import torch
from torch import nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
... | true | true |
f7681adf5c3a92dc85f321c2470189af8a01603a | 1,105 | py | Python | demo/test.py | tkerola/matrix_calculus | 21c4f262b501337996453280d75d06a47a9fd135 | [
"MIT"
] | 1 | 2019-04-18T03:48:08.000Z | 2019-04-18T03:48:08.000Z | demo/test.py | tkerola/matrix_calculus | 21c4f262b501337996453280d75d06a47a9fd135 | [
"MIT"
] | null | null | null | demo/test.py | tkerola/matrix_calculus | 21c4f262b501337996453280d75d06a47a9fd135 | [
"MIT"
] | null | null | null |
from matrix_calculus import *
from matrix_calculus.matrix_massage import massage2canonical
from matrix_calculus.show_latex import show_latex
def main():
A = Variable("A")
B = Variable("B")
C = Variable("C")
D = Variable("D")
Y = Variable("Y")
X = Variable("X")
expr = Tr(A*X*B)
wrt = ... | 21.25 | 60 | 0.60905 |
from matrix_calculus import *
from matrix_calculus.matrix_massage import massage2canonical
from matrix_calculus.show_latex import show_latex
def main():
A = Variable("A")
B = Variable("B")
C = Variable("C")
D = Variable("D")
Y = Variable("Y")
X = Variable("X")
expr = Tr(A*X*B)
wrt = ... | true | true |
f7681b62ba297acd5a3f2ebe8a4b2fe1169f3046 | 362 | py | Python | RoboticsLanguage/Inputs/Cpp/Parse.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 64 | 2018-05-15T14:36:44.000Z | 2022-03-09T05:00:31.000Z | RoboticsLanguage/Inputs/Cpp/Parse.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 9 | 2018-04-17T21:12:27.000Z | 2019-11-08T20:53:32.000Z | RoboticsLanguage/Inputs/Cpp/Parse.py | robotcaresystems/roboticslanguage | 3bb7a2bf64ab8e9068889713fbeb18a45cd5a3ed | [
"Apache-2.0"
] | 10 | 2018-03-27T12:09:12.000Z | 2021-02-16T08:07:26.000Z | #
# This is the Robotics Language compiler
#
# Parameters.py: Definition of the parameters for this package
#
# Created on: 19 September, 2018
# Author: Gabriel Lopes
# Licence: license
# Copyright: copyright
#
from lxml import etree
def parse(text, parameters):
code = etree.Element("cpp")
co... | 18.1 | 64 | 0.690608 | from lxml import etree
def parse(text, parameters):
code = etree.Element("cpp")
code.text = text
return code, parameters
| true | true |
f7681c4a940e1ad37b7fc70a05c3f9c59990874e | 1,878 | py | Python | splash.py | migrate2iaas/free-s3drive | df807b91540a3636b4f3465433072ff5c9a1e7a9 | [
"MIT"
] | 3 | 2020-10-14T07:29:24.000Z | 2021-03-04T13:34:27.000Z | splash.py | migrate2iaas/free-s3drive | df807b91540a3636b4f3465433072ff5c9a1e7a9 | [
"MIT"
] | 1 | 2018-07-18T09:31:40.000Z | 2019-07-10T13:59:55.000Z | splash.py | migrate2iaas/free-s3drive | df807b91540a3636b4f3465433072ff5c9a1e7a9 | [
"MIT"
] | 2 | 2019-07-15T16:12:38.000Z | 2019-10-15T10:03:34.000Z | """implements splash screen
taken from http://code.activestate.com/recipes/534124-elegant-tkinter-splash-screen/
"""
import time
try:
import tkinter.tix as Tix
except ImportError: # Python 2
import Tix
class SplashScreen( object ):
def __init__( self, tkRoot, imageFilename, minSplashTime=0 ):
self._r... | 29.34375 | 84 | 0.619276 |
import time
try:
import tkinter.tix as Tix
except ImportError: import Tix
class SplashScreen( object ):
def __init__( self, tkRoot, imageFilename, minSplashTime=0 ):
self._root = tkRoot
self._image = Tix.PhotoImage( file=imageFilename )
self._splash = N... | true | true |
f7681c668d50bf91a178437a1cbf969d68bf4531 | 19,710 | py | Python | atomate/qchem/tests/test_drones.py | rkingsbury/atomate | d26b65d5c46882d9585f14188514d9a65276336c | [
"BSD-3-Clause-LBNL"
] | 167 | 2017-01-26T00:14:19.000Z | 2022-03-18T20:47:58.000Z | atomate/qchem/tests/test_drones.py | rkingsbury/atomate | d26b65d5c46882d9585f14188514d9a65276336c | [
"BSD-3-Clause-LBNL"
] | 422 | 2016-12-16T18:21:15.000Z | 2022-03-23T22:13:19.000Z | atomate/qchem/tests/test_drones.py | rkingsbury/atomate | d26b65d5c46882d9585f14188514d9a65276336c | [
"BSD-3-Clause-LBNL"
] | 158 | 2016-12-16T18:28:00.000Z | 2022-03-28T11:40:03.000Z | # Copyright (c) Materials Virtual Lab.
# Distributed under the terms of the BSD License.
import os
import unittest
from monty.serialization import loadfn
from atomate.qchem.drones import QChemDrone
from pymatgen.core.structure import Molecule
import numpy as np
from pymatgen.analysis.local_env import OpenBabelNN
from ... | 39.898785 | 88 | 0.558752 |
import os
import unittest
from monty.serialization import loadfn
from atomate.qchem.drones import QChemDrone
from pymatgen.core.structure import Molecule
import numpy as np
from pymatgen.analysis.local_env import OpenBabelNN
from pymatgen.analysis.graphs import MoleculeGraph
__author__ = "Samuel Blau"
__copyright__ =... | true | true |
f76820070f8ce10e3e6a4355d520a305e4969bff | 1,374 | py | Python | scripts/vyatta-show-icmp-rate-limit.py | danos/vyatta-cfg-system | ea85439d3e0935bbbb824b085b892b4c45d1638f | [
"BSD-3-Clause"
] | null | null | null | scripts/vyatta-show-icmp-rate-limit.py | danos/vyatta-cfg-system | ea85439d3e0935bbbb824b085b892b4c45d1638f | [
"BSD-3-Clause"
] | null | null | null | scripts/vyatta-show-icmp-rate-limit.py | danos/vyatta-cfg-system | ea85439d3e0935bbbb824b085b892b4c45d1638f | [
"BSD-3-Clause"
] | 4 | 2020-02-05T01:49:10.000Z | 2021-11-06T14:51:14.000Z | #!/usr/bin/env python3
# Copyright (c) 2021, AT&T Intellectual Property.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-only
from argparse import ArgumentParser
from vplaned import Controller
from vyatta import configd
import sys
arg_parser = ArgumentParser()
arg_parser.add_argument('--af', required=Tr... | 26.423077 | 80 | 0.535662 |
from argparse import ArgumentParser
from vplaned import Controller
from vyatta import configd
import sys
arg_parser = ArgumentParser()
arg_parser.add_argument('--af', required=True)
args = arg_parser.parse_args()
cfg = configd.Client()
if args.af == 'v4':
node = "system ip icmp rate-limit state"
elif args.af ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.