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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c02824d98503e9e87da8331b9142cc370636b53 | 2,101 | py | Python | cycles/demo_plastic.py | HTDerekLiu/BlenderToolbox | 99b2e7009ecd49423b4043049de4c25c36b9a43f | [
"Apache-2.0"
] | 208 | 2019-02-28T21:02:07.000Z | 2022-03-29T17:17:50.000Z | cycles/demo_plastic.py | ANABUR920/BlenderToolbox | 99b2e7009ecd49423b4043049de4c25c36b9a43f | [
"Apache-2.0"
] | 1 | 2020-10-15T12:11:12.000Z | 2020-10-15T12:11:12.000Z | cycles/demo_plastic.py | ANABUR920/BlenderToolbox | 99b2e7009ecd49423b4043049de4c25c36b9a43f | [
"Apache-2.0"
] | 25 | 2019-03-01T01:46:33.000Z | 2022-03-12T09:42:30.000Z | # Copyright 2020 Hsueh-Ti Derek Liu
#
# 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 w... | 27.285714 | 74 | 0.735364 | import os
cwd = os.getcwd()
import sys
sys.path.append(cwd)
from include import *
import bpy
outputPath = './results/demo_plastic.png'
imgRes_x = 720 imgRes_y = 720 numSamples = 50 exposure = 1.0
blenderInit(imgRes_x, imgRes_y, numSamples, exposure)
meshPath = '../meshes/spot.ply'
location = (-0.3, 0.6, -0.04)
ro... | true | true |
1c028260546dae74a78f22b370b1a33c6d32bd71 | 13,387 | py | Python | virtual/lib/python3.8/site-packages/flask_script/__init__.py | MAKONJIO99/Pitch-hub | 947e4067ec8360a079b1a934c572a154f01765c7 | [
"MIT"
] | null | null | null | virtual/lib/python3.8/site-packages/flask_script/__init__.py | MAKONJIO99/Pitch-hub | 947e4067ec8360a079b1a934c572a154f01765c7 | [
"MIT"
] | null | null | null | virtual/lib/python3.8/site-packages/flask_script/__init__.py | MAKONJIO99/Pitch-hub | 947e4067ec8360a079b1a934c572a154f01765c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import re
import sys
import types
import warnings
from gettext import gettext as _
from collections import OrderedDict
import argparse
from flask import Flask
from flask_script._compat import text_type
from ._compat import iteritems
from .co... | 31.573113 | 108 | 0.586689 | from __future__ import absolute_import
import os
import re
import sys
import types
import warnings
from gettext import gettext as _
from collections import OrderedDict
import argparse
from flask import Flask
from flask_script._compat import text_type
from ._compat import iteritems
from .commands import Group, Opt... | true | true |
1c0284631c4684709b95e94c4bfb916c11e79393 | 531 | py | Python | tests/test_opensearch_cli.py | Hoboneer/surfraw-elvis-generator | 1170c524ad4f007e5e82b9d7efc0dd101f4d685d | [
"Apache-2.0"
] | 10 | 2020-06-13T13:09:49.000Z | 2021-01-21T15:09:07.000Z | tests/test_opensearch_cli.py | Hoboneer/surfraw-elvis-generator | 1170c524ad4f007e5e82b9d7efc0dd101f4d685d | [
"Apache-2.0"
] | 39 | 2020-06-28T05:03:24.000Z | 2021-02-28T04:42:55.000Z | tests/test_opensearch_cli.py | Hoboneer/surfraw-elvis-generator | 1170c524ad4f007e5e82b9d7efc0dd101f4d685d | [
"Apache-2.0"
] | 1 | 2020-12-07T02:01:06.000Z | 2020-12-07T02:01:06.000Z | from os import EX_UNAVAILABLE
from surfraw_tools.opensearch2elvis import main
def test_bad_url(caplog_cli_error, placeholder_elvis_name, placeholder_url):
exit_code = main(
[
placeholder_elvis_name,
placeholder_url,
]
)
assert (
exit_code == EX_UNAVAILABLE... | 24.136364 | 107 | 0.679849 | from os import EX_UNAVAILABLE
from surfraw_tools.opensearch2elvis import main
def test_bad_url(caplog_cli_error, placeholder_elvis_name, placeholder_url):
exit_code = main(
[
placeholder_elvis_name,
placeholder_url,
]
)
assert (
exit_code == EX_UNAVAILABLE... | true | true |
1c028542db04b005ab1d03d49e44bfc15f783eec | 5,287 | py | Python | benchmarks/benchmarks/bench_core.py | alexhenrie/numpy | 662f973ba58563b268d009e67806aa1150ca1cb2 | [
"BSD-3-Clause"
] | 1 | 2021-05-06T16:22:22.000Z | 2021-05-06T16:22:22.000Z | benchmarks/benchmarks/bench_core.py | alexhenrie/numpy | 662f973ba58563b268d009e67806aa1150ca1cb2 | [
"BSD-3-Clause"
] | 169 | 2020-12-25T07:10:57.000Z | 2022-03-29T22:12:31.000Z | benchmarks/benchmarks/bench_core.py | alexhenrie/numpy | 662f973ba58563b268d009e67806aa1150ca1cb2 | [
"BSD-3-Clause"
] | null | null | null | from .common import Benchmark
import numpy as np
class Core(Benchmark):
def setup(self):
self.l100 = range(100)
self.l50 = range(50)
self.float_l1000 = [float(i) for i in range(1000)]
self.float64_l1000 = [np.float64(i) for i in range(1000)]
self.int_l1000 = list(range(100... | 24.821596 | 66 | 0.608663 | from .common import Benchmark
import numpy as np
class Core(Benchmark):
def setup(self):
self.l100 = range(100)
self.l50 = range(50)
self.float_l1000 = [float(i) for i in range(1000)]
self.float64_l1000 = [np.float64(i) for i in range(1000)]
self.int_l1000 = list(range(100... | true | true |
1c02855cea248efd8bf61d44844208fe3b6ed5df | 7,219 | py | Python | resources/lib/basictypes/basic_types.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 22 | 2015-02-04T19:58:02.000Z | 2021-07-29T05:25:08.000Z | resources/lib/basictypes/basic_types.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 14 | 2015-01-07T00:08:28.000Z | 2019-10-24T00:27:48.000Z | resources/lib/basictypes/basic_types.py | torstehu/Transmission-XBMC | 10f319deb0d9e5839e62f86c8c6ed5a9175d26fc | [
"MIT"
] | 15 | 2015-02-26T15:01:04.000Z | 2020-12-02T09:14:44.000Z | """Stand-alone type-definition objects for basic data types
Rather than add class-methods to the built-in data types
module designs stand in datatypes which can be used to
define basicproperty property classes.
"""
from basictypes import latebind, datatypedefinition, registry, booleanfix
import types, traceback
class... | 26.250909 | 96 | 0.683059 | """Stand-alone type-definition objects for basic data types
Rather than add class-methods to the built-in data types
module designs stand in datatypes which can be used to
define basicproperty property classes.
"""
from basictypes import latebind, datatypedefinition, registry, booleanfix
import types, traceback
class... | false | true |
1c02876b25c65184f76a471689b21a7c71ca3aef | 121 | py | Python | monitoria-ilp/prova2/h1.py | gustavo-mendel/my-college-projects | ccc1285e1a6863312e275f973e728de231a9458a | [
"MIT"
] | 3 | 2021-08-18T01:59:50.000Z | 2021-08-28T00:19:07.000Z | monitoria-ilp/prova2/h1.py | gustavo-mendel/my-college-projects | ccc1285e1a6863312e275f973e728de231a9458a | [
"MIT"
] | 4 | 2021-03-09T18:39:47.000Z | 2021-03-26T00:01:56.000Z | monitoria-ilp/prova2/h1.py | gustavo-mendel/my-college-projects | ccc1285e1a6863312e275f973e728de231a9458a | [
"MIT"
] | 1 | 2022-03-20T14:54:09.000Z | 2022-03-20T14:54:09.000Z | tr, i, tn = [int(n) for n in input().split()]
if tn == 2:
print("VITORIA")
else:
print(9 - tr, 3 - i, 2 - tn)
| 15.125 | 46 | 0.487603 | tr, i, tn = [int(n) for n in input().split()]
if tn == 2:
print("VITORIA")
else:
print(9 - tr, 3 - i, 2 - tn)
| true | true |
1c02882bcdb0acbc6abcf3440fc049d6682bbffa | 4,171 | py | Python | Arena.py | keeeal/alpha-zero-ut3 | d6ff5e20b97cdd386ca27fa8be06334cc8afdb3d | [
"MIT"
] | 1 | 2021-12-23T09:08:22.000Z | 2021-12-23T09:08:22.000Z | Arena.py | keeeal/alpha-zero-ut3 | d6ff5e20b97cdd386ca27fa8be06334cc8afdb3d | [
"MIT"
] | null | null | null | Arena.py | keeeal/alpha-zero-ut3 | d6ff5e20b97cdd386ca27fa8be06334cc8afdb3d | [
"MIT"
] | null | null | null | import numpy as np
from pytorch_classification.utils import Bar, AverageMeter
import time
class Arena():
"""
An Arena class where any 2 agents can be pit against each other.
"""
def __init__(self, player1, player2, game, display=None):
"""
Input:
player 1,2: two functions th... | 35.649573 | 144 | 0.513786 | import numpy as np
from pytorch_classification.utils import Bar, AverageMeter
import time
class Arena():
def __init__(self, player1, player2, game, display=None):
self.player1 = player1
self.player2 = player2
self.game = game
self.display = display
def playGame(self, verbose=Fa... | true | true |
1c02883d9abd5d84271c66435b294095b4b8209b | 247 | py | Python | test/tkinterAfterTest.py | Lovestarni/Reinforcement-learning-with-tensorflow | 822a4ae812b044687c11138ef9c9db1e1190f98c | [
"MIT"
] | null | null | null | test/tkinterAfterTest.py | Lovestarni/Reinforcement-learning-with-tensorflow | 822a4ae812b044687c11138ef9c9db1e1190f98c | [
"MIT"
] | null | null | null | test/tkinterAfterTest.py | Lovestarni/Reinforcement-learning-with-tensorflow | 822a4ae812b044687c11138ef9c9db1e1190f98c | [
"MIT"
] | null | null | null | import time
import tkinter as tk
def __writeText():
text.insert(tk.END, str(time.time())+'\n')
# root.after(1000, __writeText) # again forever
root = tk.Tk()
text = tk.Text(root)
text.pack()
root.after(1000, __writeText)
root.mainloop() | 20.583333 | 52 | 0.688259 | import time
import tkinter as tk
def __writeText():
text.insert(tk.END, str(time.time())+'\n')
root = tk.Tk()
text = tk.Text(root)
text.pack()
root.after(1000, __writeText)
root.mainloop() | true | true |
1c02885fc6ec24fab53511d7480426c4a6ab922f | 529 | py | Python | appion/bin/makeDDParticleFLVMovie.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/bin/makeDDParticleFLVMovie.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | appion/bin/makeDDParticleFLVMovie.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/usr/bin/env python
#pythonlib
import os
import sys
import math
#appion
from appionlib import apDDParticleMovie
from appionlib import apMovie
class MakeDDParticleFLVMovieLoop(apDDParticleMovie.MakeDDParticleMovieLoop):
def preLoopFunctions(self):
super(MakeDDParticleFLVMovieLoop,self).preLoopFunctions()
self.m... | 21.16 | 76 | 0.809074 |
import os
import sys
import math
from appionlib import apDDParticleMovie
from appionlib import apMovie
class MakeDDParticleFLVMovieLoop(apDDParticleMovie.MakeDDParticleMovieLoop):
def preLoopFunctions(self):
super(MakeDDParticleFLVMovieLoop,self).preLoopFunctions()
self.movieformat = 'gif'
def makeMovie(self,f... | true | true |
1c0289ca917ed287fb3437b720da42a019888db1 | 3,182 | py | Python | tests_scripts/Sprint1-f19/Sprint1-f19/tests/campuspartnerpageui.py | uno-isqa-8950/uno-cpi | c8fa01eb253e6a56046009c551a84c36c28cd8da | [
"MIT"
] | 13 | 2018-08-30T16:03:18.000Z | 2019-11-25T07:08:43.000Z | tests_scripts/Sprint1-f19/Sprint1-f19/tests/campuspartnerpageui.py | uno-isqa-8950/uno-cpi | c8fa01eb253e6a56046009c551a84c36c28cd8da | [
"MIT"
] | 814 | 2018-08-30T02:28:55.000Z | 2022-03-11T23:31:45.000Z | tests_scripts/Sprint1-f19/Sprint1-f19/tests/campuspartnerpageui.py | uno-isqa-8950/uno-cpi | c8fa01eb253e6a56046009c551a84c36c28cd8da | [
"MIT"
] | 6 | 2018-09-16T05:35:49.000Z | 2019-10-17T02:44:19.000Z | from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
class CampusPartnersPageUi:
## URL
URL = 'https://uno-cpi-dev.herokuapp.com/'
##locators for Maps
Partners_Homepagelink = (By.XPATH, '//*[@id="target"]/ul/li[3]/a')
Partners_Registercampuspartnerlink = (B... | 41.868421 | 106 | 0.71653 | from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
class CampusPartnersPageUi:
URL = 'https://uno-cpi-dev.herokuapp.com/'
Partners_Homepagelink = (By.XPATH, '//*[@id="target"]/ul/li[3]/a')
Partners_Registercampuspartnerlink = (By.XPATH, '//*[@id="myButton1... | true | true |
1c028ac225d6250413fcdfb27a37a038bda6a49b | 2,909 | py | Python | Examples/basic_file_ops.py | Aarif1430/Python-Awesome-notes-and-exercises-list | c8ad7f90ebd973025f37d4e79c2f1229a8a2915c | [
"MIT"
] | 2 | 2021-01-13T21:20:57.000Z | 2021-08-18T17:53:53.000Z | Examples/basic_file_ops.py | Aarif1430/Python-Awesome-notes-and-exercises-list | c8ad7f90ebd973025f37d4e79c2f1229a8a2915c | [
"MIT"
] | null | null | null | Examples/basic_file_ops.py | Aarif1430/Python-Awesome-notes-and-exercises-list | c8ad7f90ebd973025f37d4e79c2f1229a8a2915c | [
"MIT"
] | 1 | 2020-11-05T09:56:55.000Z | 2020-11-05T09:56:55.000Z | import sys, os
def amiLinux():
platstr=sys.platform
platstr=platstr.lower()
if platstr.find('linu')>-1:
return 1
else:
return 0
def splittolist(pathstr):
listout = pathstr.split(os.sep)
while not listout[-1]:
listout.pop()
while not listout[0]:
listout.pop(0... | 23.844262 | 68 | 0.573049 | import sys, os
def amiLinux():
platstr=sys.platform
platstr=platstr.lower()
if platstr.find('linu')>-1:
return 1
else:
return 0
def splittolist(pathstr):
listout = pathstr.split(os.sep)
while not listout[-1]:
listout.pop()
while not listout[0]:
listout.pop(0... | true | true |
1c028acfc1a2a42430155f8925a1c27176535997 | 31,140 | py | Python | projectq/backends/_circuits/_to_latex.py | gavarela/ProjectQ | f2cec3cc1ea3775edd77c898ed8802af9f802533 | [
"Apache-2.0"
] | 2 | 2019-06-18T11:58:23.000Z | 2020-04-26T20:39:32.000Z | projectq/backends/_circuits/_to_latex.py | gavarela/ProjectQ | f2cec3cc1ea3775edd77c898ed8802af9f802533 | [
"Apache-2.0"
] | 8 | 2019-08-13T11:22:36.000Z | 2019-11-19T15:47:05.000Z | projectq/backends/_circuits/_to_latex.py | gavarela/ProjectQ | f2cec3cc1ea3775edd77c898ed8802af9f802533 | [
"Apache-2.0"
] | 1 | 2018-11-10T06:47:24.000Z | 2018-11-10T06:47:24.000Z | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.66879 | 79 | 0.504785 |
import json
from projectq.ops import (Allocate, Deallocate, DaggeredGate, get_inverse,
Measure, SqrtSwap, Swap, X, Z)
def to_latex(circuit):
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
try:
with open('settings.json') as settings... | true | true |
1c028b2de24b74487417246a6b4120e335e24362 | 43 | py | Python | src/lr_schedulers/__init__.py | data-sachez-2511/pl_classification | 637b85c58d723925ae4d3fce08db2842786c750a | [
"MIT"
] | 8 | 2021-11-13T19:21:36.000Z | 2021-12-14T15:00:16.000Z | src/lr_schedulers/__init__.py | data-sachez-2511/pl_classification | 637b85c58d723925ae4d3fce08db2842786c750a | [
"MIT"
] | 6 | 2021-11-11T13:05:21.000Z | 2021-12-13T09:59:05.000Z | src/lr_schedulers/__init__.py | data-sachez-2511/pl_classification | 637b85c58d723925ae4d3fce08db2842786c750a | [
"MIT"
] | null | null | null | from lr_schedulers.wrapper import Scheduler | 43 | 43 | 0.906977 | from lr_schedulers.wrapper import Scheduler | true | true |
1c028b301a84ec893f84f590ec68885e97288f7a | 10,723 | py | Python | modules/templates/BRCMS/RLP/rheaders.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | 205 | 2015-01-20T08:26:09.000Z | 2022-03-27T19:59:33.000Z | modules/templates/BRCMS/RLP/rheaders.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | 249 | 2015-02-10T09:56:35.000Z | 2022-03-23T19:54:36.000Z | modules/templates/BRCMS/RLP/rheaders.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | 231 | 2015-02-10T09:33:17.000Z | 2022-02-18T19:56:05.000Z | # -*- coding: utf-8 -*-
"""
Custom rheaders for RLPCM template
@license: MIT
"""
from gluon import current, URL, A, SPAN
from s3 import S3ResourceHeader, s3_rheader_resource, s3_fullname
# =============================================================================
def rlpcm_br_rheader(r, tabs=None):
... | 34.928339 | 93 | 0.439989 |
from gluon import current, URL, A, SPAN
from s3 import S3ResourceHeader, s3_rheader_resource, s3_fullname
def rlpcm_br_rheader(r, tabs=None):
if r.representation != "html":
return None
tablename, record = s3_rheader_resource(r)
if tablename != r.tablename:
resource = current.s3... | true | true |
1c028c5ba9f46d54600f5b223ecf9de9de08dcce | 2,072 | py | Python | Latest/venv/Lib/site-packages/pyface/ui/wx/system_metrics.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | 1 | 2022-01-09T20:04:31.000Z | 2022-01-09T20:04:31.000Z | Latest/venv/Lib/site-packages/pyface/ui/wx/system_metrics.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | 1 | 2022-02-15T12:01:57.000Z | 2022-03-24T19:48:47.000Z | Latest/venv/Lib/site-packages/pyface/ui/wx/system_metrics.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | null | null | null | #------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions d... | 30.470588 | 79 | 0.562741 |
import sys
import wx
from traits.api import HasTraits, Int, Property, provides, Tuple
from pyface.i_system_metrics import ISystemMetrics, MSystemMetrics
@provides(ISystemMetrics)
class SystemMetrics(MSystemMetrics, HasTraits):
screen_width = Property(Int)
screen_height = Property(Int)
dialog... | true | true |
1c028ff1693ab08500210663619f03a4a3ea92cb | 1,202 | py | Python | test/test_phones.py | Marat-github/python_training_1 | 494752ebcdab53d326cd3c80dec59703d82187cd | [
"Apache-2.0"
] | null | null | null | test/test_phones.py | Marat-github/python_training_1 | 494752ebcdab53d326cd3c80dec59703d82187cd | [
"Apache-2.0"
] | null | null | null | test/test_phones.py | Marat-github/python_training_1 | 494752ebcdab53d326cd3c80dec59703d82187cd | [
"Apache-2.0"
] | null | null | null | import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[1]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(1)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
def test_phone... | 42.928571 | 122 | 0.733777 | import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[1]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(1)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
def test_phone... | true | true |
1c029275a20d66f006a8fa6c83d2d95c41f0484b | 63,555 | py | Python | networking_calico/plugins/ml2/drivers/calico/mech_calico.py | tj90241/networking-calico | 2c83c92249d791791feb32b6d4da6c9be10cceaf | [
"Apache-2.0"
] | null | null | null | networking_calico/plugins/ml2/drivers/calico/mech_calico.py | tj90241/networking-calico | 2c83c92249d791791feb32b6d4da6c9be10cceaf | [
"Apache-2.0"
] | null | null | null | networking_calico/plugins/ml2/drivers/calico/mech_calico.py | tj90241/networking-calico | 2c83c92249d791791feb32b6d4da6c9be10cceaf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2014, 2015 Metaswitch Networks
# Copyright (c) 2013 OpenStack Foundation
# Copyright (c) 2018 Tigera, Inc. All rights reserved.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | 45.267094 | 79 | 0.620093 |
import contextlib
from functools import wraps
import inspect
import os
import re
import uuid
import eventlet
from eventlet.queue import PriorityQueue
from eventlet.semaphore import Semaphore
from neutron.agent import rpc as agent_rpc
try:
from neutron_lib.agent import topics
except ImportError:
from neut... | true | true |
1c02930a25db5134f9fbf55756b5b5909150dbe7 | 3,982 | py | Python | util/make_pipeline.py | celiolarcher/AUTOCVE | e87985d7e7dbd513304ac02360cd3320a28580d2 | [
"BSD-3-Clause"
] | 2 | 2022-02-16T23:39:29.000Z | 2022-02-20T13:46:16.000Z | util/make_pipeline.py | henryzord/AUTOCVE-star | b69e8d0a35d838a3ef5fd36516f9e4c61610ce53 | [
"BSD-3-Clause"
] | null | null | null | util/make_pipeline.py | henryzord/AUTOCVE-star | b69e8d0a35d838a3ef5fd36516f9e4c61610ce53 | [
"BSD-3-Clause"
] | 1 | 2019-11-25T19:06:59.000Z | 2019-11-25T19:06:59.000Z | import sklearn.pipeline as Pipeline
import importlib
import ast
from sklearn.ensemble import VotingClassifier
def make_pipeline_str(pipeline_str,verbose=1):
if pipeline_str is None:
return None
list_pip_string=split_methods_pip(pipeline_str)
list_pip_methods=[]
for method_str in list_pip_stri... | 28.647482 | 100 | 0.593672 | import sklearn.pipeline as Pipeline
import importlib
import ast
from sklearn.ensemble import VotingClassifier
def make_pipeline_str(pipeline_str,verbose=1):
if pipeline_str is None:
return None
list_pip_string=split_methods_pip(pipeline_str)
list_pip_methods=[]
for method_str in list_pip_stri... | true | true |
1c029497776e1078ed3aa1c78a37abe57e6e80f6 | 252 | py | Python | notification/utilities.py | RimoldRynold/CodingJobs-1 | 01103ba9c91d9b06a97656d014ce7c5755784093 | [
"MIT"
] | 17 | 2020-10-14T11:20:33.000Z | 2021-11-18T18:14:32.000Z | notification/utilities.py | RimoldRynold/CodingJobs-1 | 01103ba9c91d9b06a97656d014ce7c5755784093 | [
"MIT"
] | null | null | null | notification/utilities.py | RimoldRynold/CodingJobs-1 | 01103ba9c91d9b06a97656d014ce7c5755784093 | [
"MIT"
] | 12 | 2020-10-16T22:00:20.000Z | 2022-02-16T08:05:21.000Z | from .models import Notification
def create_notification(request, to_user, notification_type, extra_id=0):
notification = Notification.objects.create(to_user=to_user, notification_type=notification_type, created_by=request.user, extra_id=extra_id) | 63 | 144 | 0.84127 | from .models import Notification
def create_notification(request, to_user, notification_type, extra_id=0):
notification = Notification.objects.create(to_user=to_user, notification_type=notification_type, created_by=request.user, extra_id=extra_id) | true | true |
1c0295a40928006af6043c819a2f5cf62ebb5172 | 1,572 | py | Python | gpu_implementation/neuroevolution/models/simple.py | m4ta1l/deep-neuroevolution | 6ab22e190d3c0102a945dcce0c1d744eb610bdb9 | [
"MIT"
] | 883 | 2018-01-12T17:47:58.000Z | 2018-06-28T12:16:16.000Z | gpu_implementation/neuroevolution/models/simple.py | dmacd/deep-neuroevolution | 47f98d4c71ea6be0c63b2ab78c0814da137800d2 | [
"MIT"
] | 41 | 2018-07-11T10:45:02.000Z | 2022-02-09T23:29:01.000Z | gpu_implementation/neuroevolution/models/simple.py | dmacd/deep-neuroevolution | 47f98d4c71ea6be0c63b2ab78c0814da137800d2 | [
"MIT"
] | 199 | 2018-07-06T14:23:22.000Z | 2022-03-26T07:27:12.000Z | __copyright__ = """
Copyright (c) 2018 Uber Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | 43.666667 | 77 | 0.742366 | __copyright__ = """
Copyright (c) 2018 Uber Technologies, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | true | true |
1c029755320c03b5b20bde1098c06d45c76f037f | 2,682 | py | Python | budget.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | budget.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | budget.py | LosWochos76/haushalt_wetter_extractor | 1132c38ed3fd132262b7263368db7a7eebe6086d | [
"MIT"
] | null | null | null | import pdfplumber
import xlsxwriter
import sys
import os
import pandas as pd
from page import Page
class Budget:
def __init__(self, pdf_filename, year):
self.pdf_filename = pdf_filename
self.source_year = year
self.cache_dir = "page_cache_" + str(year)
self.pages = []
self.dataframe = pd.DataFrame(columns=[... | 33.949367 | 151 | 0.701342 | import pdfplumber
import xlsxwriter
import sys
import os
import pandas as pd
from page import Page
class Budget:
def __init__(self, pdf_filename, year):
self.pdf_filename = pdf_filename
self.source_year = year
self.cache_dir = "page_cache_" + str(year)
self.pages = []
self.dataframe = pd.DataFrame(columns=[... | true | true |
1c0297bccf4b9ba50540ee1481394f5fa8d5b5f1 | 5,402 | py | Python | userbot/plugins/afk.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | """AFK Plugin for Anonymous
Syntax: .afk REASON"""
import asyncio
import datetime
from telethon import events
from telethon.tl import functions, types
from userbot.utils import admin_cmd
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global last_afk_message # pylint:disable=E0602
USER... | 40.616541 | 126 | 0.596446 | import asyncio
import datetime
from telethon import events
from telethon.tl import functions, types
from userbot.utils import admin_cmd
global USER_AFK global afk_time global last_afk_message USER_AFK = {}
afk_time = None
last_afk_message = {}
@borg.on(events.NewMessage(outgoing=True)) async def set_not_afk(even... | true | true |
1c02983a9e355738d9780ca957edacfc89b65f85 | 892 | py | Python | 213.House-Robber-II.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 18 | 2018-07-14T12:45:37.000Z | 2022-03-26T14:51:04.000Z | 213.House-Robber-II.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | null | null | null | 213.House-Robber-II.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 3 | 2019-05-29T04:09:22.000Z | 2021-06-07T23:37:46.000Z | # https://leetcode.com/problems/house-robber-ii/
#
# algorithms
# Medium (35.09%)
# Total Accepted: 107,028
# Total Submissions: 304,983
# beats 100.0% of python submissions
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
length = l... | 25.485714 | 76 | 0.452915 |
class Solution(object):
def rob(self, nums):
length = len(nums)
if length == 0:
return 0
if length == 1:
return nums[0]
if length == 2:
return max(nums)
dp = [[0, 0] for _ in xrange(length + 1)]
dp[1][0]... | true | true |
1c0298454d91ad36ae25e96a5d0886f75be97faa | 2,909 | py | Python | python/hostconfig/machines/dtc.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/dtc.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/dtc.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Configuration for core Chaste machines
"""Copyright (c) 2005-2022, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistri... | 47.688525 | 107 | 0.764868 |
import os
petsc_2_3_path = '/usr/apps/chaste-plugins/petsc-2.3.2-p4/'
petsc_build_name = 'linux-gnu'
icpc='icpc'
other_includepaths = ['/usr/apps/chaste-plugins/hdf5/include']
other_libpaths = [os.path.join(petsc_2_3_path, 'externalpackages/f2cblaslapack/linux-gnu/'),
'/usr/apps/chaste-plugins/hdf... | true | true |
1c0298572be0d49d301a74d040e2e82376b1156d | 6,578 | py | Python | pysnmp-with-texts/TRAPEZE-NETWORKS-QOS-CONFIG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/TRAPEZE-NETWORKS-QOS-CONFIG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/TRAPEZE-NETWORKS-QOS-CONFIG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module TRAPEZE-NETWORKS-QOS-CONFIG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRAPEZE-NETWORKS-QOS-CONFIG-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:27:20 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Pytho... | 131.56 | 739 | 0.803436 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint = mibBuilder.impo... | true | true |
1c029a368662bbb9e74aed136534315cb5a00eb0 | 4,378 | py | Python | data/test/python/1c029a368662bbb9e74aed136534315cb5a00eb0jeenodes.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/1c029a368662bbb9e74aed136534315cb5a00eb0jeenodes.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/1c029a368662bbb9e74aed136534315cb5a00eb0jeenodes.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | #!/usr/bin/python -u
import time
import sys
import os
import optparse
import datetime
from threading import Thread
from system.core import Device, Broker, Clock, log, run_threads, kill_threads, get_device, on_new_device
from system.jeenet import JeeNodeDev, JeeNet, Gateway, message_info, Monitor
from system.jsonrpc i... | 24.734463 | 104 | 0.68593 |
import time
import sys
import os
import optparse
import datetime
from threading import Thread
from system.core import Device, Broker, Clock, log, run_threads, kill_threads, get_device, on_new_device
from system.jeenet import JeeNodeDev, JeeNet, Gateway, message_info, Monitor
from system.jsonrpc import JsonRpcServer
f... | false | true |
1c029b3cc233dea5af1f3a5084a4aadefbc3a9ef | 1,441 | py | Python | src/audio_slice.py | mohammedsuhail85/SpeechEmotionAnalyzer | 2c499a73f725e2d59357867b132ff58a17e96d2f | [
"MIT"
] | 2 | 2019-08-01T13:20:38.000Z | 2019-10-13T16:20:55.000Z | src/audio_slice.py | mohammedsuhail85/SpeechEmotionAnalyzer | 2c499a73f725e2d59357867b132ff58a17e96d2f | [
"MIT"
] | 10 | 2019-08-06T02:19:38.000Z | 2022-02-10T00:31:10.000Z | src/audio_slice.py | mohammedsuhail85/SpeechEmotionAnalyzer | 2c499a73f725e2d59357867b132ff58a17e96d2f | [
"MIT"
] | null | null | null | from pydub import AudioSegment
from pathlib import Path
TEMP_FOLDER = Path("temp")
def slice_audio(audio_path, session):
try:
# sound = AudioSegment.from_file_using_temporary_files("/home/suhail/Desktop/SpeechEmotionAnalyzer/test_vid.wav")
sound = AudioSegment.from_file(audio_path)
dura... | 27.188679 | 121 | 0.580847 | from pydub import AudioSegment
from pathlib import Path
TEMP_FOLDER = Path("temp")
def slice_audio(audio_path, session):
try:
sound = AudioSegment.from_file(audio_path)
duration = sound.duration_seconds
slicing_time = 4
print(duration)
count = (duration // slici... | true | true |
1c029e0b17b69ec53b125d60848c4ec61d2d4fb6 | 1,987 | py | Python | devday/talk/migrations/0034_remove_old_speaker_model_and_tighten_constraints.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 6 | 2018-09-30T20:18:01.000Z | 2020-03-12T09:03:38.000Z | devday/talk/migrations/0034_remove_old_speaker_model_and_tighten_constraints.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 260 | 2018-09-30T14:17:57.000Z | 2022-03-04T13:48:34.000Z | devday/talk/migrations/0034_remove_old_speaker_model_and_tighten_constraints.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 9 | 2018-09-30T13:17:21.000Z | 2020-10-03T12:55:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-20 11:54
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('talk', '0033_remove_talk_speaker'),
('event', '0006... | 31.539683 | 72 | 0.539507 | from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('talk', '0033_remove_talk_speaker'),
('event', '0006_auto_20181016_0051'),
]
operations = [
migrations.Remove... | true | true |
1c029ec866be819e6720872e5d20f2af7d746b13 | 6,690 | py | Python | myUrllib/httpUtils.py | Arithmeticjia/12306 | 1fa45c26b6d8da917b3c792d21a4ca771f59dacf | [
"MIT"
] | 8 | 2019-12-15T15:06:51.000Z | 2021-09-12T08:47:06.000Z | myUrllib/httpUtils.py | yu874721995/12306 | 7c9ad86b6c66a6a918cd58f33611d586100e9ca9 | [
"MIT"
] | 6 | 2020-01-28T23:12:16.000Z | 2022-02-10T00:30:51.000Z | myUrllib/httpUtils.py | yu874721995/12306 | 7c9ad86b6c66a6a918cd58f33611d586100e9ca9 | [
"MIT"
] | 1 | 2019-11-29T07:47:35.000Z | 2019-11-29T07:47:35.000Z | # -*- coding: utf8 -*-
import json
import random
import socket
from collections import OrderedDict
from time import sleep
import requests
from fake_useragent import UserAgent
import TickerConfig
from agency.agency_tools import proxy
from config import logger
def _set_header_default():
header_dict = OrderedDict()
... | 33.787879 | 123 | 0.521375 | import json
import random
import socket
from collections import OrderedDict
from time import sleep
import requests
from fake_useragent import UserAgent
import TickerConfig
from agency.agency_tools import proxy
from config import logger
def _set_header_default():
header_dict = OrderedDict()
header_dict["Ac... | true | true |
1c029f1a9c90e1137499e57c3fd9315c93b8e91d | 9,384 | py | Python | Source/classifiers.py | acdick/endangered_species_classification | cb022785a3dde20082c9c4ef18aa6d3e75f4ee1b | [
"MIT"
] | null | null | null | Source/classifiers.py | acdick/endangered_species_classification | cb022785a3dde20082c9c4ef18aa6d3e75f4ee1b | [
"MIT"
] | null | null | null | Source/classifiers.py | acdick/endangered_species_classification | cb022785a3dde20082c9c4ef18aa6d3e75f4ee1b | [
"MIT"
] | null | null | null | from sklearn.model_selection import GridSearchCV
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn... | 40.978166 | 123 | 0.512468 | from sklearn.model_selection import GridSearchCV
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn... | true | true |
1c029f390b8b101a418b4d010f81e4856ebec19c | 1,563 | py | Python | tests/client/test_queryparams.py | Colin-b/httpx | 3333152b54654a438d5a8f7d0c36890a282b8eae | [
"BSD-3-Clause"
] | null | null | null | tests/client/test_queryparams.py | Colin-b/httpx | 3333152b54654a438d5a8f7d0c36890a282b8eae | [
"BSD-3-Clause"
] | null | null | null | tests/client/test_queryparams.py | Colin-b/httpx | 3333152b54654a438d5a8f7d0c36890a282b8eae | [
"BSD-3-Clause"
] | null | null | null | import json
import pytest
from httpx import URL, AsyncClient, QueryParams, Request, Response
from httpx._config import CertTypes, TimeoutTypes, VerifyTypes
from httpx._dispatch.base import AsyncDispatcher
class MockDispatch(AsyncDispatcher):
async def send(
self,
request: Request,
verify... | 30.057692 | 76 | 0.68906 | import json
import pytest
from httpx import URL, AsyncClient, QueryParams, Request, Response
from httpx._config import CertTypes, TimeoutTypes, VerifyTypes
from httpx._dispatch.base import AsyncDispatcher
class MockDispatch(AsyncDispatcher):
async def send(
self,
request: Request,
verify... | true | true |
1c029fa042545bc5b4987ae5ab23c04868080570 | 11,685 | py | Python | third_party/typ/typ/expectations_parser.py | seasonhuang/catapult | b10687847f4a5f2f3349c2df2f605aec8abb3a20 | [
"BSD-3-Clause"
] | 1 | 2019-01-04T10:08:58.000Z | 2019-01-04T10:08:58.000Z | third_party/typ/typ/expectations_parser.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | null | null | null | third_party/typ/typ/expectations_parser.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(dpranke): Rename this to 'expectations.py' to remove the 'parser'
# part and make it a bit more generic. Consider if we can reword this to
# also not ... | 39.080268 | 84 | 0.565426 |
# that might not be possible.
import fnmatch
import re
from collections import OrderedDict
from collections import defaultdict
from typ.json_results import ResultType
_EXPECTATION_MAP = {
'Crash': ResultType.Crash,
'Failure': ResultType.Failure,
'Pass': ResultType.Pass,
'Timeout': ResultType.Timeou... | true | true |
1c029fbd03ab7666ebafb09f81364e5e8cf7155e | 47,947 | py | Python | scripts/automation/regression/stateless_tests/stl_rx_test.py | gwan-msft/trex-core | 98b9285e70fb20ae45674402e66bb780ea22aab0 | [
"Apache-2.0"
] | null | null | null | scripts/automation/regression/stateless_tests/stl_rx_test.py | gwan-msft/trex-core | 98b9285e70fb20ae45674402e66bb780ea22aab0 | [
"Apache-2.0"
] | null | null | null | scripts/automation/regression/stateless_tests/stl_rx_test.py | gwan-msft/trex-core | 98b9285e70fb20ae45674402e66bb780ea22aab0 | [
"Apache-2.0"
] | null | null | null | #!/router/bin/python
from .stl_general_test import CStlGeneral_Test, CTRexScenario
from functools import wraps
from trex_stl_lib.api import *
import os, sys
import copy
from nose.tools import assert_raises
from scapy.layers.vxlan import *
ERROR_LATENCY_TOO_HIGH = 1
ERROR_CNTR_NOT_0 = 2
class STLRX_Test(CStlGeneral_Te... | 42.206866 | 180 | 0.540409 | from .stl_general_test import CStlGeneral_Test, CTRexScenario
from functools import wraps
from trex_stl_lib.api import *
import os, sys
import copy
from nose.tools import assert_raises
from scapy.layers.vxlan import *
ERROR_LATENCY_TOO_HIGH = 1
ERROR_CNTR_NOT_0 = 2
class STLRX_Test(CStlGeneral_Test):
def setUp(s... | true | true |
1c02a037f8c6e7dd4780700420b71374ca0c70ab | 1,450 | py | Python | denoising_images/tmp.py | bigalex95/TecoGAN-PyTorch | 2bc58ccaa1fe935d429dc2c3cc8456ba3ddb3151 | [
"Apache-2.0"
] | null | null | null | denoising_images/tmp.py | bigalex95/TecoGAN-PyTorch | 2bc58ccaa1fe935d429dc2c3cc8456ba3ddb3151 | [
"Apache-2.0"
] | null | null | null | denoising_images/tmp.py | bigalex95/TecoGAN-PyTorch | 2bc58ccaa1fe935d429dc2c3cc8456ba3ddb3151 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
root_dir = './'
dest_dir = './test_scripts'
os.listdir(root_dir)
for folder in os.listdir(root_dir):
folder_path = os.path.join(root_dir, folder)
if os.path.isdir(folder_path):
# for subfolder in os.listdir(folder_path):
# if subfolder == 'test_results':
# su... | 42.647059 | 75 | 0.570345 | import os
import shutil
root_dir = './'
dest_dir = './test_scripts'
os.listdir(root_dir)
for folder in os.listdir(root_dir):
folder_path = os.path.join(root_dir, folder)
if os.path.isdir(folder_path):
... | true | true |
1c02a03d007c769a70c361e63f8f363ac83d1f9f | 1,309 | py | Python | setup.py | richmahn/tx-md2html | b8cea44873d562877a93e51000e8884368cb1e8a | [
"MIT"
] | null | null | null | setup.py | richmahn/tx-md2html | b8cea44873d562877a93e51000e8884368cb1e8a | [
"MIT"
] | null | null | null | setup.py | richmahn/tx-md2html | b8cea44873d562877a93e51000e8884368cb1e8a | [
"MIT"
] | null | null | null | import os
from setuptools import setup
from setuptools.command.install import install
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read... | 26.18 | 97 | 0.663866 | import os
from setuptools import setup
from setuptools.command.install import install
# README file and 2) it's easier to type in the README file than to put a raw
def read(f_name):
return open(os.path.join(os.path.dirname(__file__), f_name)).read()
class PostInstallCommand(install):
def run(self):
... | true | true |
1c02a0d61ae8ee73a6762b9255480a74bc5faf0e | 1,815 | py | Python | data/cloud/autogluon/run_gluon.py | luisferreira97/autoautoml | 501d2de8b2153748b57e5c8cb247058c587ce29c | [
"MIT"
] | 7 | 2020-05-15T23:10:26.000Z | 2022-01-21T10:36:50.000Z | data/cloud/autogluon/run_gluon.py | luisferreira97/autoautoml | 501d2de8b2153748b57e5c8cb247058c587ce29c | [
"MIT"
] | 13 | 2020-11-13T18:47:51.000Z | 2021-07-24T10:04:57.000Z | data/cloud/autogluon/run_gluon.py | luisferreira97/autoautoml | 501d2de8b2153748b57e5c8cb247058c587ce29c | [
"MIT"
] | null | null | null | import json
from datetime import datetime
import pandas as pd
from autogluon import TabularPrediction as task
data_path = "./data/cloud/cloud"
label_column = "TE"
fold1 = pd.read_csv(data_path + "-fold1.csv")
fold2 = pd.read_csv(data_path + "-fold2.csv")
fold3 = pd.read_csv(data_path + "-fold3.csv")
fold4 = pd.read... | 30.762712 | 79 | 0.663361 | import json
from datetime import datetime
import pandas as pd
from autogluon import TabularPrediction as task
data_path = "./data/cloud/cloud"
label_column = "TE"
fold1 = pd.read_csv(data_path + "-fold1.csv")
fold2 = pd.read_csv(data_path + "-fold2.csv")
fold3 = pd.read_csv(data_path + "-fold3.csv")
fold4 = pd.read... | true | true |
1c02a1274292d4c531f46966f77b774dc42e539f | 7,207 | py | Python | libcloud/common/worldwidedns.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | null | null | null | libcloud/common/worldwidedns.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | null | null | null | libcloud/common/worldwidedns.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 36.770408 | 79 | 0.615374 | import re
from libcloud.common.base import ConnectionUserAndKey
from libcloud.common.base import Response
from libcloud.common.types import ProviderError
OK_CODES = ['200', '211', '212', '213']
ERROR_CODES = ['401', '403', '405', '406', '407', '408', '409', '410', '411',
'412', '413', '414', '450', '4... | true | true |
1c02a18c55d6a11be5deca78b859a38426de94b2 | 450 | py | Python | aula62/cc.py | jessicsous/Curso_Python | 94c9b70ec03022b21ac23bf85918aa20ce4cfdd1 | [
"MIT"
] | 1 | 2021-09-21T01:50:10.000Z | 2021-09-21T01:50:10.000Z | aula62/cc.py | jessicsous/Curso_Python | 94c9b70ec03022b21ac23bf85918aa20ce4cfdd1 | [
"MIT"
] | null | null | null | aula62/cc.py | jessicsous/Curso_Python | 94c9b70ec03022b21ac23bf85918aa20ce4cfdd1 | [
"MIT"
] | 1 | 2021-10-04T19:49:04.000Z | 2021-10-04T19:49:04.000Z | from aula62.conta import Conta
class Contacorrente(Conta):
def __init__(self, agencia, conta, saldo, limite=100):
super().__int__(agencia, conta, saldo)
self._limite = limite
@property
def limite(self):
return self._limite
def sacar(self, valor):
if (self._saldo + self... | 23.684211 | 58 | 0.606667 | from aula62.conta import Conta
class Contacorrente(Conta):
def __init__(self, agencia, conta, saldo, limite=100):
super().__int__(agencia, conta, saldo)
self._limite = limite
@property
def limite(self):
return self._limite
def sacar(self, valor):
if (self._saldo + self... | false | true |
1c02a27afac52eb6f3e063314c60ded57ff74983 | 855 | py | Python | jp.atcoder/abc139/abc139_b/8507191.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc139/abc139_b/8507191.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc139/abc139_b/8507191.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | # 2019-11-17 20:44:23(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# import re
# import heapq
# import... | 21.375 | 63 | 0.622222 | import sys
def main():
a, b = [int(x) for x in sys.stdin.readline().split()]
extend = a - 1
total_sockets = 1
strips_count = 0
if b >= 2:
more_needed = True
else:
more_needed = False
while more_needed:
strips_count += 1
total_sockets += e... | true | true |
1c02a35792bed800ab07d92e612b3174fa576518 | 4,069 | py | Python | tests/components/script/test_blueprint.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | tests/components/script/test_blueprint.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/script/test_blueprint.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Test script blueprints."""
import asyncio
import contextlib
import pathlib
from typing import Iterator
from unittest.mock import patch
from homeassistant.components import script
from homeassistant.components.blueprint.models import Blueprint, DomainBlueprints
from homeassistant.core import Context, HomeAssistant, ... | 33.908333 | 89 | 0.584173 | import asyncio
import contextlib
import pathlib
from typing import Iterator
from unittest.mock import patch
from homeassistant.components import script
from homeassistant.components.blueprint.models import Blueprint, DomainBlueprints
from homeassistant.core import Context, HomeAssistant, callback
from homeassistant.he... | true | true |
1c02a3c114a7eb349233298b34b2aae467e2c064 | 290 | py | Python | 3. Strings/capitalize.py | kalpak92/HackerRank-Python_Solutions | 5461e719523377f5959114ff1daa7aff382aafc9 | [
"Unlicense"
] | null | null | null | 3. Strings/capitalize.py | kalpak92/HackerRank-Python_Solutions | 5461e719523377f5959114ff1daa7aff382aafc9 | [
"Unlicense"
] | null | null | null | 3. Strings/capitalize.py | kalpak92/HackerRank-Python_Solutions | 5461e719523377f5959114ff1daa7aff382aafc9 | [
"Unlicense"
] | null | null | null | '''
Title : Capitalize!
Subdomain : Strings
Domain : Python
Author : Kalpak Seal
Created : 29 September 2016
'''
s = raw_input()
s_list = s.split(' ')
final_list = []
space = ' '
for w in s_list:
final_list.append(w.capitalize())
print(space.join(final_list)) | 19.333333 | 38 | 0.624138 |
s = raw_input()
s_list = s.split(' ')
final_list = []
space = ' '
for w in s_list:
final_list.append(w.capitalize())
print(space.join(final_list)) | true | true |
1c02a53abf1626a880425bcfb968291dc789562f | 6,696 | py | Python | src/python/pants/backend/jvm/tasks/checkstyle.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/checkstyle.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/jvm/tasks/checkstyle.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from twitter.common.collections import OrderedSet
from pants.backend.jvm.subsystems.checkstyle import Checkstyle as CheckstyleSubsystem
from pants.backend.jvm.subsystems.shader... | 42.923077 | 100 | 0.662336 |
import os
from twitter.common.collections import OrderedSet
from pants.backend.jvm.subsystems.checkstyle import Checkstyle as CheckstyleSubsystem
from pants.backend.jvm.subsystems.shader import Shader
from pants.backend.jvm.tasks.nailgun_task import NailgunTask
from pants.base.deprecated import resolve_conflicting_o... | true | true |
1c02a552bcbb5b22027da7b9fd3286c8e02e2059 | 1,712 | py | Python | majora2/migrations/0082_coguk_biosourcesamplingprocesssupplement.py | CLIMB-COVID/majora2 | 46ea1809a61e4a768f8cbacaf54cba5c4d82e1f2 | [
"MIT"
] | 29 | 2019-04-04T18:03:43.000Z | 2022-02-09T12:47:30.000Z | majora2/migrations/0082_coguk_biosourcesamplingprocesssupplement.py | CLIMB-COVID/majora2 | 46ea1809a61e4a768f8cbacaf54cba5c4d82e1f2 | [
"MIT"
] | 66 | 2019-04-02T16:18:40.000Z | 2022-01-25T16:15:42.000Z | majora2/migrations/0082_coguk_biosourcesamplingprocesssupplement.py | CLIMB-COVID/majora2 | 46ea1809a61e4a768f8cbacaf54cba5c4d82e1f2 | [
"MIT"
] | 6 | 2020-04-10T14:15:32.000Z | 2022-01-18T13:08:35.000Z | # Generated by Django 2.2.10 on 2020-05-20 09:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('majora2', '0081_merge_20200520_0825'),
]
operations = [
migrations.CreateModel(
name='COGUK_Bi... | 50.352941 | 159 | 0.647196 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('majora2', '0081_merge_20200520_0825'),
]
operations = [
migrations.CreateModel(
name='COGUK_BiosourceSamplingProcessSupplement',
fi... | true | true |
1c02a683ff17ea48c1a2beccdaa091c9fff5345e | 2,501 | py | Python | tools/scons/scons-local-2.2.0/SCons/Tool/hplink.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | tools/scons/scons-local-2.2.0/SCons/Tool/hplink.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | tools/scons/scons-local-2.2.0/SCons/Tool/hplink.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | """SCons.Tool.hplink
Tool-specific initialization for the HP linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 201... | 32.064103 | 108 | 0.702919 |
__revision__ = "src/engine/SCons/Tool/hplink.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
import os
import os.path
import SCons.Util
import link
ccLinker = None
try:
dirs = os.listdir('/opt')
except (IOError, OSError):
# (IOError) or isn't readable (OSError) is okay.
... | true | true |
1c02a68ba8467ffa7656c5f8c7db5db570750197 | 355 | py | Python | setup.py | lukemerrett/SteamProgress | 32a2a067573c936940a9c281e63cf303b06cc851 | [
"MIT"
] | 2 | 2015-06-27T10:25:55.000Z | 2015-07-05T13:04:46.000Z | setup.py | lukemerrett/SteamProgress | 32a2a067573c936940a9c281e63cf303b06cc851 | [
"MIT"
] | null | null | null | setup.py | lukemerrett/SteamProgress | 32a2a067573c936940a9c281e63cf303b06cc851 | [
"MIT"
] | null | null | null | __author__ = 'Luke Merrett'
from setuptools import setup, find_packages
setup(
name="SteamProgress",
version="0.1",
packages=find_packages(),
install_requires=['peewee', 'pygal', 'Pillow'],
author="Luke Merrett",
author_email="lukeamerrett@gmail.com",
url='https://github.com/lukemerrett/St... | 23.666667 | 55 | 0.687324 | __author__ = 'Luke Merrett'
from setuptools import setup, find_packages
setup(
name="SteamProgress",
version="0.1",
packages=find_packages(),
install_requires=['peewee', 'pygal', 'Pillow'],
author="Luke Merrett",
author_email="lukeamerrett@gmail.com",
url='https://github.com/lukemerrett/St... | true | true |
1c02a78d97ef58b21af566aedf24bd0cc815e355 | 336 | py | Python | ai-engineer/course0_20190911/back_feature_engineer/2_feature_extend/5_OneHotEncoder.py | linksdl/meta-project-artificial_intelligence_projects | 3abe0dc59aa891717a661b3ad1e987c14536bd62 | [
"Apache-2.0"
] | null | null | null | ai-engineer/course0_20190911/back_feature_engineer/2_feature_extend/5_OneHotEncoder.py | linksdl/meta-project-artificial_intelligence_projects | 3abe0dc59aa891717a661b3ad1e987c14536bd62 | [
"Apache-2.0"
] | null | null | null | ai-engineer/course0_20190911/back_feature_engineer/2_feature_extend/5_OneHotEncoder.py | linksdl/meta-project-artificial_intelligence_projects | 3abe0dc59aa891717a661b3ad1e987c14536bd62 | [
"Apache-2.0"
] | null | null | null | #coding: UTF-8
# 信息利用率低:不同的机器学习算法和模型对数据中信息的利用是不同的,之前提到在线性模型中,使用对定性特征哑编码可以达到非线性的效果。类似地,对定量变量多项式化,或者进行其他的转换,都能达到非线性的效果。
from sklearn.preprocessing import OneHotEncoder
enc = OneHotEncoder()
enc.fit([[0, 0, 3], [1, 1, 0], [0, 2, 1], [1, 0, 2]])
print(enc.n_values_)
print(enc.feature_indices_)
print(enc.transform([[0, 1, ... | 33.6 | 102 | 0.735119 |
from sklearn.preprocessing import OneHotEncoder
enc = OneHotEncoder()
enc.fit([[0, 0, 3], [1, 1, 0], [0, 2, 1], [1, 0, 2]])
print(enc.n_values_)
print(enc.feature_indices_)
print(enc.transform([[0, 1, 1]]).toarray())
| true | true |
1c02a86ca428659cdb63b9f4c401154a85f9fb14 | 2,542 | py | Python | homeassistant/components/dexcom/__init__.py | jonasjeeliasson/core | 0301706fc631ad1f2cd2532667ba9dfe2f856198 | [
"Apache-2.0"
] | 4 | 2020-08-10T20:02:24.000Z | 2022-01-31T02:14:22.000Z | homeassistant/components/dexcom/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 78 | 2020-07-23T07:13:08.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/dexcom/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 3 | 2022-01-17T20:10:54.000Z | 2022-01-17T20:17:22.000Z | """The Dexcom integration."""
from datetime import timedelta
import logging
from pydexcom import AccountError, Dexcom, SessionError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
from homeassistant.core import HomeAssistant
f... | 29.218391 | 88 | 0.709284 | from datetime import timedelta
import logging
from pydexcom import AccountError, Dexcom, SessionError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.exceptions i... | true | true |
1c02a8cad3cfecdc725224a0b38381adad7eca42 | 3,558 | py | Python | setup.py | Immensa/wagtail | cb33259c0f2aefd2d6e6b605d3e9a14387dbd01e | [
"BSD-3-Clause"
] | null | null | null | setup.py | Immensa/wagtail | cb33259c0f2aefd2d6e6b605d3e9a14387dbd01e | [
"BSD-3-Clause"
] | 1 | 2020-07-01T09:25:23.000Z | 2020-07-01T09:25:23.000Z | setup.py | Immensa/wagtail | cb33259c0f2aefd2d6e6b605d3e9a14387dbd01e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
from wagtail import __version__
from wagtail.utils.setup import assets, sdist, check_bdist_egg
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
# Hack to prevent "TypeError: 'NoneType' object is not callable" error
# in m... | 28.693548 | 118 | 0.6276 |
import sys
from wagtail import __version__
from wagtail.utils.setup import assets, sdist, check_bdist_egg
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
try:
import multiprocessing
except ImportError:
pass
install_requires = [
"Django>=2.... | true | true |
1c02a8cf53ae26b6a757bbdb0b2d9d9dfbe49543 | 997 | py | Python | api/migrations/0001_initial.py | unrealkaii/tweeto-django-api | 96c95a149c40123ef747c49d5dde1d31044fbb8c | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | unrealkaii/tweeto-django-api | 96c95a149c40123ef747c49d5dde1d31044fbb8c | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | unrealkaii/tweeto-django-api | 96c95a149c40123ef747c49d5dde1d31044fbb8c | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-10-18 14:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 32.16129 | 120 | 0.59679 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c02aa727d50c4a95163caf2194b44938f9bd3b7 | 34,584 | py | Python | netbox/dcim/models/device_components.py | netfreak98/netbox | 0b1df1483fe19ed51f9cfc016bc901af1c4b82b8 | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/device_components.py | netfreak98/netbox | 0b1df1483fe19ed51f9cfc016bc901af1c4b82b8 | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/device_components.py | netfreak98/netbox | 0b1df1483fe19ed51f9cfc016bc901af1c4b82b8 | [
"Apache-2.0"
] | null | null | null | import logging
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.urls import reverse
from... | 30.961504 | 120 | 0.608085 | import logging
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.urls import reverse
from... | true | true |
1c02ac1fab59add3d741cabed33cac8c1ec16e53 | 7,433 | py | Python | eva_storage/baselines/indexing/external/ssd/open_images_downloader.py | jaehobang/Eva | e7f649990b8bca3bc29b3832c0ecf32efb402647 | [
"Apache-2.0"
] | null | null | null | eva_storage/baselines/indexing/external/ssd/open_images_downloader.py | jaehobang/Eva | e7f649990b8bca3bc29b3832c0ecf32efb402647 | [
"Apache-2.0"
] | null | null | null | eva_storage/baselines/indexing/external/ssd/open_images_downloader.py | jaehobang/Eva | e7f649990b8bca3bc29b3832c0ecf32efb402647 | [
"Apache-2.0"
] | null | null | null | import time
import boto3
from botocore import UNSIGNED
from botocore.config import Config
import botocore
import logging
from multiprocessing import Pool, Manager
import pandas as pd
import os
import argparse
import sys
import functools
from urllib import request
s3 = boto3.client('s3', config=Config(signature_versio... | 40.178378 | 134 | 0.617382 | import time
import boto3
from botocore import UNSIGNED
from botocore.config import Config
import botocore
import logging
from multiprocessing import Pool, Manager
import pandas as pd
import os
import argparse
import sys
import functools
from urllib import request
s3 = boto3.client('s3', config=Config(signature_versio... | true | true |
1c02ad150704ba25447007e98447d5ea0c422232 | 13,075 | py | Python | data_prep.py | keiserlab/consensus-learning-paper | 2d204362569489b9ab4c861b6cb6c5b819659ada | [
"MIT"
] | null | null | null | data_prep.py | keiserlab/consensus-learning-paper | 2d204362569489b9ab4c861b6cb6c5b819659ada | [
"MIT"
] | null | null | null | data_prep.py | keiserlab/consensus-learning-paper | 2d204362569489b9ab4c861b6cb6c5b819659ada | [
"MIT"
] | 1 | 2022-02-16T19:12:02.000Z | 2022-02-16T19:12:02.000Z | """
Script to generate various CSVs and get things ready for the deep learning pipeline
"""
import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import copy
from PIL import Image
import os
from sklearn.metrics import roc_curve, auc, precision_recall_curve, roc_auc_score
import shutil
fro... | 46.365248 | 172 | 0.580956 | import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import copy
from PIL import Image
import os
from sklearn.metrics import roc_curve, auc, precision_recall_curve, roc_auc_score
import shutil
from itertools import combinations
import socket
import random
import pickle
import matplotlib.p... | true | true |
1c02ad3da771ceab7b6cc7e0e6ee34ffc39d532e | 535 | py | Python | resources/lib/test_gui.py | eudyptes-pachyrynchus/plugin.video.media-ccc-de | 36f51726b6035b9beabdf8c1f4e8fae68820dc22 | [
"CC-BY-2.0"
] | 7 | 2018-12-11T22:39:02.000Z | 2021-12-19T09:59:58.000Z | resources/lib/test_gui.py | eudyptes-pachyrynchus/plugin.video.media-ccc-de | 36f51726b6035b9beabdf8c1f4e8fae68820dc22 | [
"CC-BY-2.0"
] | 15 | 2018-09-05T12:41:27.000Z | 2021-12-29T17:06:15.000Z | resources/lib/test_gui.py | eudyptes-pachyrynchus/plugin.video.media-ccc-de | 36f51726b6035b9beabdf8c1f4e8fae68820dc22 | [
"CC-BY-2.0"
] | 2 | 2019-11-15T18:36:36.000Z | 2020-12-30T14:32:26.000Z | # coding: utf-8
from __future__ import print_function, division, absolute_import
from . import gui
def test_err(recwarn):
gui.err("Some fatal error")
assert len(recwarn) == 1
w = recwarn.pop()
assert issubclass(w.category, UserWarning)
assert str(w.message) == "ERR: Some fatal error"
def test_i... | 25.47619 | 64 | 0.693458 | from __future__ import print_function, division, absolute_import
from . import gui
def test_err(recwarn):
gui.err("Some fatal error")
assert len(recwarn) == 1
w = recwarn.pop()
assert issubclass(w.category, UserWarning)
assert str(w.message) == "ERR: Some fatal error"
def test_info(recwarn):
... | true | true |
1c02ad5a52d2c4990d2a25a0e21ea1b3c36aecf9 | 2,425 | py | Python | scripts/peekpointers.py | ebubekirtrkr/gef-extras | 4869692c1c7255bc9eb1f29e772c033b5c3a1cda | [
"MIT"
] | null | null | null | scripts/peekpointers.py | ebubekirtrkr/gef-extras | 4869692c1c7255bc9eb1f29e772c033b5c3a1cda | [
"MIT"
] | null | null | null | scripts/peekpointers.py | ebubekirtrkr/gef-extras | 4869692c1c7255bc9eb1f29e772c033b5c3a1cda | [
"MIT"
] | null | null | null | @register_external_command
class PeekPointers(GenericCommand):
"""Command to help find pointers belonging to other memory regions helpful in case
of OOB Read when looking for specific pointers"""
_cmdline_ = "peek-pointers"
_syntax_ = "{:s} starting_address <object_name> <all>".format(_cmdline_)
@... | 41.101695 | 164 | 0.533196 | @register_external_command
class PeekPointers(GenericCommand):
_cmdline_ = "peek-pointers"
_syntax_ = "{:s} starting_address <object_name> <all>".format(_cmdline_)
@only_if_gdb_running
def do_invoke(self, argv):
argc = len(argv)
if argc not in (1, 2, 3):
self.usage()
... | true | true |
1c02ad7401c68efac508305ff77830af8198ae7b | 4,807 | py | Python | src/pymor/algorithms/sylvester.py | weslowrie/pymor | badb5078b2394162d04a1ebfefe9034b889dac64 | [
"Unlicense"
] | 1 | 2020-12-31T18:45:48.000Z | 2020-12-31T18:45:48.000Z | src/pymor/algorithms/sylvester.py | RahulSundar/pymor | 6e283d03b413db5bb58e6d67ef467456d3a2bbf2 | [
"Unlicense"
] | 4 | 2022-03-17T10:07:38.000Z | 2022-03-30T12:41:06.000Z | src/pymor/algorithms/sylvester.py | RahulSundar/pymor | 6e283d03b413db5bb58e6d67ef467456d3a2bbf2 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import scipy.linalg as spla
from pymor.algorithms.to_matrix import to_matrix
from pymor.operators... | 32.261745 | 102 | 0.590181 |
import scipy.linalg as spla
from pymor.algorithms.to_matrix import to_matrix
from pymor.operators.interface import Operator
from pymor.operators.constructions import IdentityOperator
def solve_sylv_schur(A, Ar, E=None, Er=None, B=None, Br=None, C=None, Cr=None):
assert isinstance(A, Operator) and A.linear a... | true | true |
1c02aef4210aa729d7545764732463fec1a0975e | 1,828 | py | Python | setup.py | ninech/django-netbox-graphql | 8383570bdf3a8ce8d9d912c5b8f7b053b31c7363 | [
"MIT"
] | 17 | 2017-08-17T02:38:09.000Z | 2022-01-05T15:36:20.000Z | setup.py | ninech/django-netbox-graphql | 8383570bdf3a8ce8d9d912c5b8f7b053b31c7363 | [
"MIT"
] | 2 | 2017-09-13T14:53:56.000Z | 2018-02-08T14:06:54.000Z | setup.py | ninech/django-netbox-graphql | 8383570bdf3a8ce8d9d912c5b8f7b053b31c7363 | [
"MIT"
] | 2 | 2020-03-04T11:51:10.000Z | 2021-03-11T19:24:37.000Z | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), 'r') as readme:
README = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'VERSION'), 'r') as version_file:
VERSION = version_file.read().replace('\n', '')
# allow setup.py to... | 33.236364 | 90 | 0.606674 | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), 'r') as readme:
README = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'VERSION'), 'r') as version_file:
VERSION = version_file.read().replace('\n', '')
os.chdir(os.path.no... | true | true |
1c02af1ddb81958ed432ee2b04268f64d236819b | 2,517 | py | Python | shop.py | IIOKEP/casino_bot | 502431fc89a84790c4aeaa8e857868f54d582220 | [
"MIT"
] | null | null | null | shop.py | IIOKEP/casino_bot | 502431fc89a84790c4aeaa8e857868f54d582220 | [
"MIT"
] | null | null | null | shop.py | IIOKEP/casino_bot | 502431fc89a84790c4aeaa8e857868f54d582220 | [
"MIT"
] | null | null | null | import discord
import json
import asyncio
from discord.ext import commands, tasks
import general
class Shop(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def create_user(self, user_id):
if str(user_id) not in general.users_info:
general.users_info[str(user_id)] = {"b... | 48.403846 | 200 | 0.68971 | import discord
import json
import asyncio
from discord.ext import commands, tasks
import general
class Shop(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def create_user(self, user_id):
if str(user_id) not in general.users_info:
general.users_info[str(user_id)] = {"b... | true | true |
1c02af24d51aaf4f633c428845cb9a62aa041910 | 5,541 | py | Python | predict_yolo3.py | RentadroneCL/model-definition | 9dab1f1a808a1efc54d64144745277396c145ff7 | [
"MIT"
] | 2 | 2020-01-22T19:54:16.000Z | 2020-02-07T12:20:17.000Z | predict_yolo3.py | RentadroneCL/model-definition | 9dab1f1a808a1efc54d64144745277396c145ff7 | [
"MIT"
] | 4 | 2020-06-03T00:27:22.000Z | 2020-07-15T17:15:23.000Z | predict_yolo3.py | RentadroneCL/model-definition | 9dab1f1a808a1efc54d64144745277396c145ff7 | [
"MIT"
] | 1 | 2020-01-21T22:38:22.000Z | 2020-01-21T22:38:22.000Z | #! /usr/bin/env python
import time
import os
import argparse
import json
import cv2
import sys
sys.path += [os.path.abspath('keras-yolo3-master')]
from utils.utils import get_yolo_boxes, makedirs
from utils.bbox import draw_boxes
from tensorflow.keras.models import load_model
from tqdm import tqdm
import numpy as np... | 36.695364 | 135 | 0.564339 |
import time
import os
import argparse
import json
import cv2
import sys
sys.path += [os.path.abspath('keras-yolo3-master')]
from utils.utils import get_yolo_boxes, makedirs
from utils.bbox import draw_boxes
from tensorflow.keras.models import load_model
from tqdm import tqdm
import numpy as np
def _main_(args):
... | true | true |
1c02afdad884e10612347f08f98599d6acf943aa | 3,148 | py | Python | perf-tests/clusterloader2/pkg/prometheus/manifests/dashboards/defaults.py | yb01/arktos | aebb312a32e8924b17d55cfd4217a3ceecd39f1e | [
"Apache-2.0"
] | 70 | 2020-11-12T11:16:29.000Z | 2022-03-30T10:58:01.000Z | perf-tests/clusterloader2/pkg/prometheus/manifests/dashboards/defaults.py | yb01/arktos | aebb312a32e8924b17d55cfd4217a3ceecd39f1e | [
"Apache-2.0"
] | 660 | 2020-11-08T21:22:16.000Z | 2022-03-29T21:11:52.000Z | perf-tests/clusterloader2/pkg/prometheus/manifests/dashboards/defaults.py | yb01/arktos | aebb312a32e8924b17d55cfd4217a3ceecd39f1e | [
"Apache-2.0"
] | 40 | 2020-10-08T22:24:20.000Z | 2021-05-03T18:02:04.000Z | #!/usr/bin/env python
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 28.36036 | 87 | 0.631194 |
import re
import attr
from grafanalib import core as g
DECREASING_ORDER_TOOLTIP = g.Tooltip(sort=g.SORT_DESC)
PANEL_HEIGHT = g.Pixels(300)
QUANTILES = [0.99, 0.9, 0.5]
SOURCE_TEMPLATE = g.Template(name="source", type="datasource", query="prometheus")
@attr.s
class Dashboard(g.Dashboard):
time = attr.ib(defaul... | true | true |
1c02b01bec7804540cdac10224fff387b14d6ebe | 12,466 | py | Python | staticgennan/utils/__init__.py | nandha1nks/Team4_EnergyEfficientStaticWebGen | 894093f369bb94c7f980aa7fb205593552bef8a6 | [
"BSD-2-Clause"
] | null | null | null | staticgennan/utils/__init__.py | nandha1nks/Team4_EnergyEfficientStaticWebGen | 894093f369bb94c7f980aa7fb205593552bef8a6 | [
"BSD-2-Clause"
] | null | null | null | staticgennan/utils/__init__.py | nandha1nks/Team4_EnergyEfficientStaticWebGen | 894093f369bb94c7f980aa7fb205593552bef8a6 | [
"BSD-2-Clause"
] | null | null | null | """
Standalone file utils.
Nothing in this module should have an knowledge of config or the layout
and structure of the site and pages in the site.
"""
import logging
import os
import pkg_resources
import shutil
import re
import yaml
import fnmatch
import posixpath
from urllib.parse import urlparse
from staticgenna... | 29.126168 | 96 | 0.630114 |
import logging
import os
import pkg_resources
import shutil
import re
import yaml
import fnmatch
import posixpath
from urllib.parse import urlparse
from staticgennan import exceptions
log = logging.getLogger(__name__)
markdown_extensions = [
'.markdown',
'.mdown',
'.mkdn',
'.mkd',
'.md'
]
def... | true | true |
1c02b0e7db7330dd50573d212dc9b26fc20c3bb1 | 5,593 | py | Python | infer.py | LauJames/QuestionMatching | 380e32ad4d884ecbf314fbb69b009f34a1f8f6a9 | [
"Apache-2.0"
] | 4 | 2019-02-22T00:30:44.000Z | 2021-03-29T09:15:18.000Z | infer.py | LauJames/QuestionMatching | 380e32ad4d884ecbf314fbb69b009f34a1f8f6a9 | [
"Apache-2.0"
] | null | null | null | infer.py | LauJames/QuestionMatching | 380e32ad4d884ecbf314fbb69b009f34a1f8f6a9 | [
"Apache-2.0"
] | 4 | 2019-03-03T06:39:41.000Z | 2019-10-09T09:00:49.000Z | #! /user/bin/evn python
# -*- coding:utf8 -*-
"""
@Author : Lau James
@Contact : LauJames2017@whu.edu.cn
@Project : MVLSTM
@File : infer.py
@Time : 18-11-27 下午9:52
@Software : PyCharm
@Copyright: "Copyright (c) 2018 Lau James. All Rights Reserved"
"""
import os
import sys
import time
import datetime
imp... | 35.852564 | 100 | 0.626855 |
import os
import sys
import time
import datetime
import argparse
import numpy as np
import tensorflow as tf
import tensorflow.contrib as tc
import logging
import jieba
import pickle
from models.MVLSTM import MVLSTM
curdir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(curdir))
def ... | true | true |
1c02b1ac8ec92774a65d404ca636710e7e1166aa | 6,490 | py | Python | core/models.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | core/models.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | core/models.py | majestylink/majestyAccencis | 41bdde6f9982980609f93a8b44bcaf06cc5f6ea6 | [
"MIT"
] | null | null | null | from django.db.models.signals import post_save
from django.conf import settings
from django.db import models
from django.db.models import Sum
from django.shortcuts import reverse
from django_countries.fields import CountryField
from ckeditor.fields import RichTextField
from tinymce.models import HTMLField
from core.hel... | 40.310559 | 145 | 0.714792 | from django.db.models.signals import post_save
from django.conf import settings
from django.db import models
from django.db.models import Sum
from django.shortcuts import reverse
from django_countries.fields import CountryField
from ckeditor.fields import RichTextField
from tinymce.models import HTMLField
from core.hel... | true | true |
1c02b1bdc78eba06c0916aee08b35f2c1f2a42c6 | 67 | py | Python | betahex/__init__.py | StarvingMarvin/betahex | 0626cf4d003e94423f34f3d83149702a5557ddb8 | [
"MIT"
] | 2 | 2019-03-17T07:09:14.000Z | 2020-05-04T17:40:51.000Z | betahex/__init__.py | StarvingMarvin/betahex | 0626cf4d003e94423f34f3d83149702a5557ddb8 | [
"MIT"
] | null | null | null | betahex/__init__.py | StarvingMarvin/betahex | 0626cf4d003e94423f34f3d83149702a5557ddb8 | [
"MIT"
] | null | null | null | from .features import Features
from .game import Game, Board, Move
| 22.333333 | 35 | 0.791045 | from .features import Features
from .game import Game, Board, Move
| true | true |
1c02b2274892e283540fa749aa5883ca32444af9 | 3,592 | py | Python | networkit/test/test_graph_traversal.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 366 | 2019-06-27T18:48:18.000Z | 2022-03-29T08:36:49.000Z | networkit/test/test_graph_traversal.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 387 | 2019-06-24T11:30:39.000Z | 2022-03-31T10:37:28.000Z | networkit/test/test_graph_traversal.py | angriman/network | 3a4c5fd32eb2be8d5b34eaee17f8fe4e6e141894 | [
"MIT"
] | 131 | 2019-07-04T15:40:13.000Z | 2022-03-29T12:34:23.000Z | #!/usr/bin/env python3
import networkit as nk
import random
import unittest
class TestTraversal(unittest.TestCase):
def getSmallGraph(self, weighted=False, directed=False):
G = nk.Graph(4, weighted, directed)
G.addEdge(0, 1, 1.0)
G.addEdge(0, 2, 2.0)
G.addEdge(3, 1, 4.0)
G.addEdge(3, 2, 5.0)
G.addEdge(1,... | 24.435374 | 74 | 0.636136 |
import networkit as nk
import random
import unittest
class TestTraversal(unittest.TestCase):
def getSmallGraph(self, weighted=False, directed=False):
G = nk.Graph(4, weighted, directed)
G.addEdge(0, 1, 1.0)
G.addEdge(0, 2, 2.0)
G.addEdge(3, 1, 4.0)
G.addEdge(3, 2, 5.0)
G.addEdge(1, 2, 3.0)
return G
... | true | true |
1c02b2aab989bb78c590a8c634a019c2bca087b8 | 15,627 | py | Python | tests/integration/views/account/test_share_surveys.py | ONSdigital/ras-frontstage | e8ff1931b49cb3ab47b421aed6780e9e944dceea | [
"MIT"
] | 8 | 2017-06-30T12:32:02.000Z | 2022-02-25T09:07:28.000Z | tests/integration/views/account/test_share_surveys.py | ONSdigital/ras-frontstage | e8ff1931b49cb3ab47b421aed6780e9e944dceea | [
"MIT"
] | 256 | 2017-05-16T09:38:09.000Z | 2022-03-28T13:38:42.000Z | tests/integration/views/account/test_share_surveys.py | ONSdigital/ras-frontstage | e8ff1931b49cb3ab47b421aed6780e9e944dceea | [
"MIT"
] | 4 | 2017-09-29T08:58:36.000Z | 2021-04-11T07:44:27.000Z | import unittest
from unittest.mock import patch
import requests_mock
from frontstage import app
from tests.integration.mocked_services import (
business_party,
encoded_jwt_token,
respondent_party,
survey,
url_banner_api,
url_get_respondent_party,
url_get_survey,
)
url_get_business_details... | 54.072664 | 120 | 0.699814 | import unittest
from unittest.mock import patch
import requests_mock
from frontstage import app
from tests.integration.mocked_services import (
business_party,
encoded_jwt_token,
respondent_party,
survey,
url_banner_api,
url_get_respondent_party,
url_get_survey,
)
url_get_business_details... | true | true |
1c02b40963cbe5d0828ce6f41c3307daca5156f8 | 2,941 | py | Python | num_guess.py | Sarthak2143/Advanced-Number-Guessing-Game | 47571ffc533306c2816638827b552d81ca8b51ec | [
"MIT"
] | 2 | 2021-12-08T03:56:48.000Z | 2022-01-20T20:35:17.000Z | num_guess.py | Sarthak2143/Advanced-Number-Guessing-Game | 47571ffc533306c2816638827b552d81ca8b51ec | [
"MIT"
] | null | null | null | num_guess.py | Sarthak2143/Advanced-Number-Guessing-Game | 47571ffc533306c2816638827b552d81ca8b51ec | [
"MIT"
] | 1 | 2021-12-13T06:21:31.000Z | 2021-12-13T06:21:31.000Z | from random import randint
import os
import time
os.system("clear")
print("""
_ _ _ _____ _
| \ | | | | / ____| (_)
| \| |_ _ _ __ ___ | |__ ___ _ __ | | __ _ _ ___ ___ ___ _ _... | 26.258929 | 83 | 0.455627 | from random import randint
import os
import time
os.system("clear")
print("""
_ _ _ _____ _
| \ | | | | / ____| (_)
| \| |_ _ _ __ ___ | |__ ___ _ __ | | __ _ _ ___ ___ ___ _ _... | true | true |
1c02b4f4b3562769dc45cc47127520fbe17f1530 | 1,546 | py | Python | flask-boggle/app.py | SteviBee/SpringBoard_Exercises | 5366390a2dad85b0a243f24a7f8536ff4a12bc7a | [
"Apache-2.0"
] | null | null | null | flask-boggle/app.py | SteviBee/SpringBoard_Exercises | 5366390a2dad85b0a243f24a7f8536ff4a12bc7a | [
"Apache-2.0"
] | null | null | null | flask-boggle/app.py | SteviBee/SpringBoard_Exercises | 5366390a2dad85b0a243f24a7f8536ff4a12bc7a | [
"Apache-2.0"
] | null | null | null | from flask.json import jsonify
from boggle import Boggle
from flask import Flask, request, render_template, redirect, session, make_response
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
boggle_game = Boggle()
app.config["SECRET_KEY"] = "4534gdghjk5d#$RGR^HDG"
debug = DebugToolbarExtensi... | 29.169811 | 102 | 0.670763 | from flask.json import jsonify
from boggle import Boggle
from flask import Flask, request, render_template, redirect, session, make_response
from flask_debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
boggle_game = Boggle()
app.config["SECRET_KEY"] = "4534gdghjk5d#$RGR^HDG"
debug = DebugToolbarExtensi... | true | true |
1c02b5a63672bf90f90baf442e6be9ac1eecb363 | 5,271 | py | Python | frappe/custom/doctype/custom_field/custom_field.py | marwand/frappe | 59691496375d64c8a8a579b69aeadd76e1326468 | [
"MIT"
] | null | null | null | frappe/custom/doctype/custom_field/custom_field.py | marwand/frappe | 59691496375d64c8a8a579b69aeadd76e1326468 | [
"MIT"
] | 50 | 2020-10-21T10:36:20.000Z | 2022-03-22T12:17:01.000Z | frappe/custom/doctype/custom_field/custom_field.py | marwand/frappe | 59691496375d64c8a8a579b69aeadd76e1326468 | [
"MIT"
] | 1 | 2021-02-06T10:38:18.000Z | 2021-02-06T10:38:18.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr
from frappe import _
from frappe.model.document import Document
from frappe.model.docfield import supports_translation
from... | 33.573248 | 136 | 0.727756 |
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr
from frappe import _
from frappe.model.document import Document
from frappe.model.docfield import supports_translation
from frappe.model import core_doctypes_list
class CustomField(Document):
def autoname(self):
self.se... | true | true |
1c02b695cf35ee921e5a922236c470348e5fd8b4 | 1,157 | py | Python | python/intro_exercises/standard-library-experimentation.py | dilayercelik/Atom | 75314b9df0a2c6d3a106f122052c5715ffe3803b | [
"MIT"
] | null | null | null | python/intro_exercises/standard-library-experimentation.py | dilayercelik/Atom | 75314b9df0a2c6d3a106f122052c5715ffe3803b | [
"MIT"
] | null | null | null | python/intro_exercises/standard-library-experimentation.py | dilayercelik/Atom | 75314b9df0a2c6d3a106f122052c5715ffe3803b | [
"MIT"
] | null | null | null | #experimentation with some modules of the standard library (basics)
#"math" module: exp() function
#print e to the power of 3 using the math module
import math
answer = math.exp(3)
print(answer) #prints e**3
###################
#"random" module: choice() function
#generate a random password
... | 28.219512 | 216 | 0.705272 |
import math
answer = math.exp(3)
print(answer)
import random
word_file = "words.txt"
word_list = []
with open(word_file,'r') as words:
for line in words:
word = line.strip().lower()
if 3 < len(word) < 8:
word_list.append(word)
# Add your function generate_password here
#... | true | true |
1c02b7487086987b9fe0038c84247fe40f673c72 | 2,421 | py | Python | franQ/Env/wrappers/common_image.py | llucid-97/FastDeepQLearning | 023d617ad86477763e424fd09fb496571083c50c | [
"MIT"
] | 5 | 2020-08-19T14:41:37.000Z | 2021-06-30T14:52:04.000Z | franQ/Env/wrappers/common_image.py | llucid-97/FastDeepQLearning | 023d617ad86477763e424fd09fb496571083c50c | [
"MIT"
] | 4 | 2021-08-04T11:53:47.000Z | 2021-08-28T15:45:24.000Z | franQ/Env/wrappers/common_image.py | llucid-97/FastDeepQLearning | 023d617ad86477763e424fd09fb496571083c50c | [
"MIT"
] | null | null | null | import gym
import numpy as np
import cv2
from .wrapper_base import ObservationWrapper
class Nhwc2Nchw(ObservationWrapper):
"""Move channel axis to front (for compliance with torch-style convolutions)"""
def __init__(self, env):
super(Nhwc2Nchw, self).__init__(env)
old_shape = self.observatio... | 36.134328 | 115 | 0.629492 | import gym
import numpy as np
import cv2
from .wrapper_base import ObservationWrapper
class Nhwc2Nchw(ObservationWrapper):
def __init__(self, env):
super(Nhwc2Nchw, self).__init__(env)
old_shape = self.observation_space.shape
self.observation_space = gym.spaces.Box(
low=0.0,
... | true | true |
1c02b77249a8d3dcab1409cc63993c69ce752ba7 | 5,802 | py | Python | latent_programmer/decomposition_transformer_attention/input_pipeline.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | latent_programmer/decomposition_transformer_attention/input_pipeline.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | latent_programmer/decomposition_transformer_attention/input_pipeline.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.037267 | 80 | 0.667011 |
import tensorflow.compat.v2 as tf
from latent_programmer.tasks.robust_fill import dsl as robust_fill_dsl
from latent_programmer.tasks.scan import scan_vocab
gfile = tf.io.gfile
def create_robust_fill_dataset_from_tf_record(
file_pattern, token_id_table, char_id_table, use_bos_separators, split_ios):
filena... | true | true |
1c02b7cd63c864f790f4e4f7dde27fbbf318d78e | 8,787 | py | Python | main.py | FormantIO/formant-onvif-adapter | d5c23d3b6780c5133230314d99587bdb6919bdb2 | [
"MIT"
] | null | null | null | main.py | FormantIO/formant-onvif-adapter | d5c23d3b6780c5133230314d99587bdb6919bdb2 | [
"MIT"
] | null | null | null | main.py | FormantIO/formant-onvif-adapter | d5c23d3b6780c5133230314d99587bdb6919bdb2 | [
"MIT"
] | null | null | null | import os
import time
import json
import pathlib
import isodate
import datetime
from onvif import ONVIFCamera
from formant.sdk.agent.v1 import Client as FormantClient
DEFAULT_ONVIF_IP = '192.168.1.110'
DEFAULT_ONVIF_PORT = 80
DEFAULT_ONVIF_USERNAME = 'admin'
DEFAULT_ONVIF_PASSWORD = '123456'
DEFAULT_PTZ_RATE = 1.0
D... | 38.709251 | 110 | 0.601684 | import os
import time
import json
import pathlib
import isodate
import datetime
from onvif import ONVIFCamera
from formant.sdk.agent.v1 import Client as FormantClient
DEFAULT_ONVIF_IP = '192.168.1.110'
DEFAULT_ONVIF_PORT = 80
DEFAULT_ONVIF_USERNAME = 'admin'
DEFAULT_ONVIF_PASSWORD = '123456'
DEFAULT_PTZ_RATE = 1.0
D... | true | true |
1c02b80907476ff4ce3491d4dbb59783fc951f20 | 25,909 | py | Python | app/hackney_law_data_client/apis/providers_api.py | tombull/hackneylawclassifier | 54cea27f77ec37317ca60a678805a528a1fc5a88 | [
"MIT"
] | null | null | null | app/hackney_law_data_client/apis/providers_api.py | tombull/hackneylawclassifier | 54cea27f77ec37317ca60a678805a528a1fc5a88 | [
"MIT"
] | null | null | null | app/hackney_law_data_client/apis/providers_api.py | tombull/hackneylawclassifier | 54cea27f77ec37317ca60a678805a528a1fc5a88 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
ProvidersApi.py
Copyright 2016 SmartBear Software
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... | 43.913559 | 197 | 0.57397 |
from __future__ import absolute_import
import sys
import os
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class ProvidersApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
self.api_cli... | true | true |
1c02b8d78c5036efe134d38235699a496c2e06f9 | 2,075 | py | Python | catalog/helpers.py | vivin-christy/ud-catalog | c90c6ff1e3ec28bb53b446fa0982746e6ac74cf3 | [
"MIT"
] | null | null | null | catalog/helpers.py | vivin-christy/ud-catalog | c90c6ff1e3ec28bb53b446fa0982746e6ac74cf3 | [
"MIT"
] | null | null | null | catalog/helpers.py | vivin-christy/ud-catalog | c90c6ff1e3ec28bb53b446fa0982746e6ac74cf3 | [
"MIT"
] | null | null | null | from requests_oauthlib import OAuth2Session
from flask_login import current_user
from config import Auth
from catalog.models import Category, Item
def get_google_auth(state=None, token=None):
"""
get_google_auth creates an oauth object for google oauth
Thanks http://bitwiser.in/2015/09/09/add-google-login... | 30.514706 | 78 | 0.653012 | from requests_oauthlib import OAuth2Session
from flask_login import current_user
from config import Auth
from catalog.models import Category, Item
def get_google_auth(state=None, token=None):
if token:
return OAuth2Session(Auth.CLIENT_ID, token=token)
if state:
return OAuth2Session... | true | true |
1c02b8e8eb606c46a0542315ca95078e6c9ed99f | 957 | py | Python | checkov/kubernetes/checks/PrivilegedContainers.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2020-07-26T17:56:20.000Z | 2020-07-26T17:56:20.000Z | checkov/kubernetes/checks/PrivilegedContainers.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2021-06-02T03:40:50.000Z | 2021-06-02T03:40:50.000Z | checkov/kubernetes/checks/PrivilegedContainers.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2021-11-28T09:51:01.000Z | 2021-11-28T09:51:01.000Z | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class PrivilegedContainers(BaseK8Check):
def __init__(self):
# CIS-1.3 1.7.1
# CIS-1.5 5.2.1
name = "Container should not be privileged"
id = "CKV_K8S_16... | 35.444444 | 100 | 0.671891 | from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class PrivilegedContainers(BaseK8Check):
def __init__(self):
name = "Container should not be privileged"
id = "CKV_K8S_16"
supported_kind... | true | true |
1c02b98ee92bd9da3832406eb150e2ace49fd66a | 707 | py | Python | question/q10_3_list_sosa.py | breeze-shared-inc/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | null | null | null | question/q10_3_list_sosa.py | breeze-shared-inc/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | 1 | 2020-05-11T04:59:04.000Z | 2020-05-11T05:29:08.000Z | question/q10_3_list_sosa.py | bzgwhite/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | null | null | null | """
<配列の追加、削除の関数>
末尾に追加 配列.append(値)
指定に追加 配列.insert(要素番号, 値)
末尾を削除 配列.pop()
指定を削除 配列.pop(要素番号)
<メソッドについて(関数との違い)>
関数:単体で呼び出し可能
print(),type(),range()
メソッド:値につけて呼び出す
配列.append(),配列.insert(),配列.pop()
文字列.format()
数字.bit_length()
値にピリオドをつなげると、、メソッド(命令)が呼び出せる
<問題:配列を扱って以下を出力せよ>
====要素追加===
['鈴木', '藤田', '佐藤', '山田'... | 14.729167 | 36 | 0.61669 |
name_list = ["鈴木", "佐藤", "山田"]
position = ["部長", "課長", "係長"]
print("====要素追加===")
print(name_list)
print(position)
print("====要素削除(末尾)===")
print(name_list)
print(position) | true | true |
1c02bc997da3e607efa6d785a741026a0e6f1347 | 3,249 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 ... | 47.779412 | 130 | 0.701139 |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
from azure.core.credentials_asyn... | true | true |
1c02bd11efcd9c5e3ebd6bd06f2bcff6a32529cd | 2,480 | py | Python | gs.py | leeight/Baidu-FE-Code-Style | bd9ec033a82a0824da790e20bf505811ff4252ce | [
"MIT"
] | 135 | 2015-01-04T11:14:46.000Z | 2021-10-05T06:00:23.000Z | gs.py | leeight/Baidu-FE-Code-Style | bd9ec033a82a0824da790e20bf505811ff4252ce | [
"MIT"
] | 41 | 2015-01-05T03:07:50.000Z | 2019-07-10T11:17:18.000Z | gs.py | leeight/Baidu-FE-Code-Style | bd9ec033a82a0824da790e20bf505811ff4252ce | [
"MIT"
] | 39 | 2015-01-07T03:34:02.000Z | 2018-08-30T09:10:11.000Z | import os
import sys
import traceback as tbck
import datetime
import threading
try:
import Queue as queue
except ImportError:
import queue
import sublime
PY3K = (sys.version_info[0] == 3)
def getwd():
if PY3K:
return os.getcwd()
return os.getcwdu()
def basedir_or_cwd(fn):
if fn and not fn.startswith(... | 18.787879 | 76 | 0.645161 | import os
import sys
import traceback as tbck
import datetime
import threading
try:
import Queue as queue
except ImportError:
import queue
import sublime
PY3K = (sys.version_info[0] == 3)
def getwd():
if PY3K:
return os.getcwd()
return os.getcwdu()
def basedir_or_cwd(fn):
if fn and not fn.startswith(... | true | true |
1c02bd22bf6a1d6502edd9709ab9ded6691e7fd2 | 5,411 | py | Python | log_utils.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 16 | 2020-10-16T16:21:50.000Z | 2021-12-15T06:45:12.000Z | log_utils.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | null | null | null | log_utils.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 4 | 2020-10-27T12:32:28.000Z | 2021-04-25T04:43:45.000Z | from collections import OrderedDict, defaultdict
import numpy as np
from tensorboardX import SummaryWriter
import time
import torch
import os
class TBXWrapper(object):
def configure(self, logger_name, flush_secs=5, opt=None):
self.writer = SummaryWriter(logger_name, flush_secs=flush_secs)
self.log... | 28.036269 | 75 | 0.552393 | from collections import OrderedDict, defaultdict
import numpy as np
from tensorboardX import SummaryWriter
import time
import torch
import os
class TBXWrapper(object):
def configure(self, logger_name, flush_secs=5, opt=None):
self.writer = SummaryWriter(logger_name, flush_secs=flush_secs)
self.log... | true | true |
1c02bd6b51396d62449c610ca2345d4c833ba61f | 37,836 | py | Python | wb/main/dataset_utils/dataset_adapters.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | null | null | null | wb/main/dataset_utils/dataset_adapters.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | null | null | null | wb/main/dataset_utils/dataset_adapters.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | null | null | null | """
OpenVINO DL Workbench
Dataset adapter classes.
Copyright (c) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | 37.057786 | 120 | 0.689449 | import json
import os
import re
from pathlib import Path
from typing import ClassVar, Optional, Tuple, Union, Callable, List, Dict, Any, Iterator, Type, Generator, TextIO
import pandas
from pandas import DataFrame
from config.constants import (LFW_PAIRS_LENGTH, LNDREID_LANDMARK_LENGTH, VGGFACE2_BBOX_LENGTH, VOC_ANNO... | true | true |
1c02be1a8f898d60d230534d65ab1eb7832e5282 | 1,200 | py | Python | cartpole/args/tf_static_args.py | brandontrabucco/cartpole-dqn | c60d05e995495e8c77bfba1378297f02ff7ac06b | [
"MIT"
] | null | null | null | cartpole/args/tf_static_args.py | brandontrabucco/cartpole-dqn | c60d05e995495e8c77bfba1378297f02ff7ac06b | [
"MIT"
] | null | null | null | cartpole/args/tf_static_args.py | brandontrabucco/cartpole-dqn | c60d05e995495e8c77bfba1378297f02ff7ac06b | [
"MIT"
] | null | null | null | ###########################
# Reset working directory #
###########################
from os import chdir
chdir("G:\\My Drive\\Academic\\Research\\Cartpole Simulation")
###########################
# Cartpole Package....... #
###########################
from collections import namedtuple
import argparse
cla... | 30 | 64 | 0.520833 | from os import chdir
chdir("G:\\My Drive\\Academic\\Research\\Cartpole Simulation")
from collections import namedtuple
import argparse
class TFStaticArgs(object):
StaticArg = namedtuple("StaticArg", "sname stype sdefault")
static_args = []
parsed_args = None
@staticmethod
def add_st... | true | true |
1c02bf0c82c3004492c5ad31161383b7951d4c35 | 30,805 | py | Python | descarteslabs/scenes/tests/test_scene.py | carderne/descarteslabs-python | 757b480efb8d58474a3bf07f1dbd90652b46ed64 | [
"Apache-2.0"
] | null | null | null | descarteslabs/scenes/tests/test_scene.py | carderne/descarteslabs-python | 757b480efb8d58474a3bf07f1dbd90652b46ed64 | [
"Apache-2.0"
] | null | null | null | descarteslabs/scenes/tests/test_scene.py | carderne/descarteslabs-python | 757b480efb8d58474a3bf07f1dbd90652b46ed64 | [
"Apache-2.0"
] | null | null | null | import pytest
import unittest
import mock
import datetime
import collections
import textwrap
import warnings
import shapely.geometry
import numpy as np
from descarteslabs.common.dotdict import DotDict
from descarteslabs.scenes import Scene, geocontext
from descarteslabs.scenes.scene import _strptime_helper
from desca... | 38.699749 | 113 | 0.567862 | import pytest
import unittest
import mock
import datetime
import collections
import textwrap
import warnings
import shapely.geometry
import numpy as np
from descarteslabs.common.dotdict import DotDict
from descarteslabs.scenes import Scene, geocontext
from descarteslabs.scenes.scene import _strptime_helper
from desca... | true | true |
1c02bf59a2526a6572a4e8f4528753c15ad14785 | 2,227 | py | Python | meiduo_34/mall/apps/goods/admin.py | codedaliu/meiduo-store | 4654ff9737b941ce9945a0c92187beea27bb0fc3 | [
"MIT"
] | null | null | null | meiduo_34/mall/apps/goods/admin.py | codedaliu/meiduo-store | 4654ff9737b941ce9945a0c92187beea27bb0fc3 | [
"MIT"
] | null | null | null | meiduo_34/mall/apps/goods/admin.py | codedaliu/meiduo-store | 4654ff9737b941ce9945a0c92187beea27bb0fc3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
# Register your models here.
from clery_tasks.html.tasks import generate_static_list_search_html
class GoodsCategoryAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
obj.save()
generate_static_list_search_html.delay()
... | 32.75 | 74 | 0.735968 | from django.contrib import admin
from . import models
from clery_tasks.html.tasks import generate_static_list_search_html
class GoodsCategoryAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
obj.save()
generate_static_list_search_html.delay()
def delete_model(self, r... | true | true |
1c02bfaf11cc162ab4d3cb566dae8598491d6074 | 4,387 | py | Python | src/azure-cli/azure/cli/command_modules/acr/run.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/acr/run.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/acr/run.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 36.256198 | 105 | 0.632779 |
from knack.log import get_logger
from knack.util import CLIError
from azure.cli.core.commands import LongRunningOperation
from ._constants import ACR_TASK_YAML_DEFAULT_NAME
from ._stream_utils import stream_logs
from ._utils import (
validate_managed_registry,
get_validate_platform,
get_custom_registry_cr... | true | true |
1c02c0dc6d1f00ad78e1513291a66cbf59432b25 | 4,345 | py | Python | mlrun/api/api/endpoints/runs.py | katyakats/mlrun | e0cacad73113f616eeb5c0297628b87244957ab0 | [
"Apache-2.0"
] | null | null | null | mlrun/api/api/endpoints/runs.py | katyakats/mlrun | e0cacad73113f616eeb5c0297628b87244957ab0 | [
"Apache-2.0"
] | null | null | null | mlrun/api/api/endpoints/runs.py | katyakats/mlrun | e0cacad73113f616eeb5c0297628b87244957ab0 | [
"Apache-2.0"
] | null | null | null | from http import HTTPStatus
from typing import List
from fastapi import APIRouter, Depends, Query, Request
from fastapi.concurrency import run_in_threadpool
from sqlalchemy.orm import Session
import mlrun.api.crud
from mlrun.api.api import deps
from mlrun.api.api.utils import log_and_raise
from mlrun.utils import log... | 27.15625 | 83 | 0.655926 | from http import HTTPStatus
from typing import List
from fastapi import APIRouter, Depends, Query, Request
from fastapi.concurrency import run_in_threadpool
from sqlalchemy.orm import Session
import mlrun.api.crud
from mlrun.api.api import deps
from mlrun.api.api.utils import log_and_raise
from mlrun.utils import log... | true | true |
1c02c1ca332925e2ca21de46fb6a780eaed5edd0 | 6,746 | py | Python | ebcli/objects/environmentsettings.py | jbinto/awsebcli-3.14.1-pyyaml-patch | 6ce0c727f3f1f290d8bf91c57ba1a5db6cc289be | [
"Apache-2.0"
] | 2 | 2017-11-16T15:02:43.000Z | 2017-11-20T17:41:16.000Z | ebcli/objects/environmentsettings.py | jbinto/awsebcli-3.14.1-pyyaml-patch | 6ce0c727f3f1f290d8bf91c57ba1a5db6cc289be | [
"Apache-2.0"
] | 10 | 2020-01-28T22:12:06.000Z | 2022-03-11T23:16:53.000Z | ebcli/objects/environmentsettings.py | jbinto/awsebcli-3.14.1-pyyaml-patch | 6ce0c727f3f1f290d8bf91c57ba1a5db6cc289be | [
"Apache-2.0"
] | 2 | 2017-11-16T14:59:03.000Z | 2017-11-16T23:52:13.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 38.329545 | 83 | 0.586422 |
from botocore.compat import six
from ebcli.objects.conversionconfiguration import ConversionConfiguration
from ebcli.objects.exceptions import InvalidSyntaxError
from ebcli.resources.strings import prompts
ENVIRONMENT_VAR_NAMESPACE = 'aws:elasticbeanstalk:application:environment'
CLOUDFORMATION_TEMPLATE = 'aws:cloud... | true | true |
1c02c1eac6643dd0b0243d53b71f7c381a2801a4 | 48,406 | py | Python | ena-dts/framework/etgen.py | amzn/amzn-ec2-ena-utilities | 99502ff5bb025dc71727d4991ea5e29a4e9388c6 | [
"MIT-0"
] | 7 | 2021-04-29T05:23:56.000Z | 2022-03-23T02:26:55.000Z | ena-dts/framework/etgen.py | amzn/amzn-ec2-ena-utilities | 99502ff5bb025dc71727d4991ea5e29a4e9388c6 | [
"MIT-0"
] | null | null | null | ena-dts/framework/etgen.py | amzn/amzn-ec2-ena-utilities | 99502ff5bb025dc71727d4991ea5e29a4e9388c6 | [
"MIT-0"
] | 4 | 2021-06-10T19:02:57.000Z | 2021-12-06T01:31:06.000Z | # BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 copy... | 38.7248 | 174 | 0.589142 |
from __future__ import unicode_literals
import re
import string
import time
from config import IxiaConf
from ssh_connection import SSHConnection
from settings import SCAPY2IXIA, latency_echo, latency_send, latency_app
from settings import load_global_setting, HOST_DRIVER_SETTING
from settings import HOST_DRIVER_MODE_... | true | true |
1c02c236f2ba7a9d417154aab9c77c3f7a1e37fc | 703 | py | Python | code/criterion.py | meghbhalerao/cnnormaliztion | 90cf80d4de5cf86dd8bba625bd757c9540cded48 | [
"MIT"
] | null | null | null | code/criterion.py | meghbhalerao/cnnormaliztion | 90cf80d4de5cf86dd8bba625bd757c9540cded48 | [
"MIT"
] | null | null | null | code/criterion.py | meghbhalerao/cnnormaliztion | 90cf80d4de5cf86dd8bba625bd757c9540cded48 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
def marginal_loss(score,labels):
"""
args:
score:batch * top_k
labels: batch * top_k
"""
predict = F.softmax(score, dim=-1)
loss = predict * labels #element-wise
loss = loss.sum(dim=-1) # sum all positive scores
l... | 31.954545 | 87 | 0.549075 | import torch
import torch.nn.functional as F
def marginal_loss(score,labels):
predict = F.softmax(score, dim=-1)
loss = predict * labels loss = loss.sum(dim=-1) loss = loss[loss > 0] loss = torch.clamp(loss, min=1e-9, max=1) loss = -torch.log(loss) ... | true | true |
1c02c30cf0bcebcc3dd1ec30179dd025eceef41a | 34,606 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/vplatform.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 177 | 2016-03-15T17:03:51.000Z | 2022-03-18T16:48:44.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/vplatform.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 18 | 2016-03-30T10:45:22.000Z | 2020-07-14T16:28:13.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/vplatform.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 85 | 2016-03-16T20:38:57.000Z | 2022-02-22T04:26:02.000Z | """ vplatform
This module contains definitions
for the Calvados model objects.
Copyright (c) 2012\-2018 by Cisco Systems, Inc.
All rights reserved.
"""
import sys
from collections import OrderedDict
from ydk.types import Entity as _Entity_
from ydk.types import EntityPath, Identity, Enum, YType, YLeaf, YLeafList, ... | 33.960746 | 373 | 0.523088 | import sys
from collections import OrderedDict
from ydk.types import Entity as _Entity_
from ydk.types import EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Em... | true | true |
1c02c320ccf890f7e42b8f490fe9bdf1cb805bfd | 7,787 | py | Python | tests/test_introspection_auth.py | SpencerjCarroll/django-oauth-toolkit | b6aa34349c9c1b0087c4d6a833f1723d363b7e37 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_introspection_auth.py | SpencerjCarroll/django-oauth-toolkit | b6aa34349c9c1b0087c4d6a833f1723d363b7e37 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_introspection_auth.py | SpencerjCarroll/django-oauth-toolkit | b6aa34349c9c1b0087c4d6a833f1723d363b7e37 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from __future__ import unicode_literals
import calendar
import datetime
from django.conf.urls import include, url
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils import timezone
from oauthlib.common import Reques... | 39.130653 | 101 | 0.685245 | from __future__ import unicode_literals
import calendar
import datetime
from django.conf.urls import include, url
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils import timezone
from oauthlib.common import Reques... | true | true |
1c02c3d73d74a9fefe8a44133dc8e132261b19bd | 16,139 | py | Python | src/prism-fruit/Games-DQL/examples/games/car/networkx/drawing/layout.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/drawing/layout.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/drawing/layout.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | """
******
Layout
******
Node positioning algorithms for graph drawing.
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """Aric ... | 30.508507 | 95 | 0.591548 | import networkx as nx
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nDan Schult(dschult@colgate.edu)"""
__all__ = ['circular_layout',
'random_layout',
'shell_layout',
'spring_layout',
'spectral_layout',
'fruchterman_reingold_layout']
def random_layout(G... | true | true |
1c02c4590591d38084bd44b450684e8fb165272e | 2,380 | py | Python | setup.py | matthuisman/polib | 1fffc37cdccb6ff3c638510b0f45286b04547961 | [
"MIT"
] | 42 | 2020-09-23T17:29:30.000Z | 2022-03-17T14:28:53.000Z | setup.py | matthuisman/polib | 1fffc37cdccb6ff3c638510b0f45286b04547961 | [
"MIT"
] | 34 | 2017-11-27T23:06:57.000Z | 2022-03-09T15:50:05.000Z | setup.py | matthuisman/polib | 1fffc37cdccb6ff3c638510b0f45286b04547961 | [
"MIT"
] | 20 | 2020-09-07T10:20:42.000Z | 2022-02-21T15:10:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# License: MIT (see LICENSE file provided)
# vim600: fdm=marker tabstop=4 shiftwidth=4 expandtab ai
"""
polib setup script.
"""
__author__ = 'David Jean Louis <izimobil@gmail.com>'
try:
from setuptools import setup
except ImportError:
from distutils.core import... | 31.315789 | 107 | 0.597479 |
__author__ = 'David Jean Louis <izimobil@gmail.com>'
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import codecs
import polib
author_data = __author__.split(' ')
maintainer = ' '.join(author_data[0:-1])
maintainer_email = author_data[-1][1:-1]
desc = 'A library to ma... | true | true |
1c02c461cd4a46c88f54fbc2773e3c0ba843db42 | 858 | py | Python | docs/examples/userguide/language_basics/casting_python.py | johannes-mueller/cython | b75af38ce5c309cd84c1835220932e53e9a9adb6 | [
"Apache-2.0"
] | 6,663 | 2015-01-02T06:06:43.000Z | 2022-03-31T10:35:02.000Z | docs/examples/userguide/language_basics/casting_python.py | johannes-mueller/cython | b75af38ce5c309cd84c1835220932e53e9a9adb6 | [
"Apache-2.0"
] | 3,094 | 2015-01-01T15:44:13.000Z | 2022-03-31T19:49:57.000Z | docs/examples/userguide/language_basics/casting_python.py | scoder/cython | ddaaa7b8bfe9885b7bed432cd0a5ab8191d112cd | [
"Apache-2.0"
] | 1,425 | 2015-01-12T07:21:27.000Z | 2022-03-30T14:10:40.000Z | from cython.cimports.cpython.ref import PyObject
def main():
python_string = "foo"
# Note that the variables below are automatically inferred
# as the correct pointer type that is assigned to them.
# They do not need to be typed explicitly.
ptr = cython.cast(cython.p_void, python_string)
adr... | 37.304348 | 82 | 0.69697 | from cython.cimports.cpython.ref import PyObject
def main():
python_string = "foo"
ptr = cython.cast(cython.p_void, python_string)
adress_in_c = cython.cast(Py_intptr_t, ptr)
address_from_void = adress_in_c
ptr2 = cython.cast(cython.pointer(PyObject), python_string)
addre... | true | true |
1c02c4bba44ba3f1f21ad6c6b2bd9ffb6cc5f055 | 1,617 | py | Python | examples/demo/urls.py | atkinson/satchless | 6fe1ab4f1222cb71327f3879df42870266d93a9d | [
"BSD-4-Clause"
] | 1 | 2015-11-05T10:26:46.000Z | 2015-11-05T10:26:46.000Z | examples/demo/urls.py | atkinson/satchless | 6fe1ab4f1222cb71327f3879df42870266d93a9d | [
"BSD-4-Clause"
] | null | null | null | examples/demo/urls.py | atkinson/satchless | 6fe1ab4f1222cb71327f3879df42870266d93a9d | [
"BSD-4-Clause"
] | null | null | null | from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from core.admin import demo_shop_admin
from carts.app import cart_app, wishlist_app
from categories.app import product_app
from orders.app import order_app
#from satchless.contrib.productset.app import productset_app
from che... | 42.552632 | 101 | 0.682746 | from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from core.admin import demo_shop_admin
from carts.app import cart_app, wishlist_app
from categories.app import product_app
from orders.app import order_app
from checkouts.app import checkout_app
import core.views
urlpatterns... | true | true |
1c02c6b0ea03481fc6743f14110b49d8381922d2 | 25,527 | py | Python | sympy/printing/octave.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 8,323 | 2015-01-02T15:51:43.000Z | 2022-03-31T13:13:19.000Z | sympy/printing/octave.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 15,102 | 2015-01-01T01:33:17.000Z | 2022-03-31T22:53:13.000Z | sympy/printing/octave.py | shilpiprd/sympy | 556e9c61b31d0d5f101cd56b43e843fbf3bcf121 | [
"BSD-3-Clause"
] | 4,490 | 2015-01-01T17:48:07.000Z | 2022-03-31T17:24:05.000Z | """
Octave (and Matlab) code printer
The `OctaveCodePrinter` converts SymPy expressions into Octave expressions.
It uses a subset of the Octave language for Matlab compatibility.
A complete code generator, which uses `octave_code` extensively, can be found
in `sympy.utilities.codegen`. The `codegen` module can be us... | 35.552925 | 118 | 0.566616 |
from typing import Any, Dict
from sympy.core import Mul, Pow, S, Rational
from sympy.core.mul import _keep_coeff
from sympy.printing.codeprinter import CodePrinter
from sympy.printing.precedence import precedence, PRECEDENCE
from re import search
known_fcns_src1 = ["sin", "cos", "tan", "cot", "sec", "csc",
... | true | true |
1c02c73b4e2897de91e753f987e92ec123ac96e1 | 19,120 | py | Python | doit/task.py | lelit/doit | 5355788de54f199cb0ddf1be6a434298fb0cc164 | [
"MIT"
] | null | null | null | doit/task.py | lelit/doit | 5355788de54f199cb0ddf1be6a434298fb0cc164 | [
"MIT"
] | null | null | null | doit/task.py | lelit/doit | 5355788de54f199cb0ddf1be6a434298fb0cc164 | [
"MIT"
] | null | null | null |
"""Tasks are the main abstractions managed by doit"""
import types
import os
import sys
import inspect
import six
from .cmdparse import CmdOption, TaskParse
from .exceptions import CatchedException, InvalidTask
from .action import create_action, PythonAction
from .dependency import UptodateCalculator
def first_lin... | 36.419048 | 84 | 0.581328 |
import types
import os
import sys
import inspect
import six
from .cmdparse import CmdOption, TaskParse
from .exceptions import CatchedException, InvalidTask
from .action import create_action, PythonAction
from .dependency import UptodateCalculator
def first_line(doc):
if doc is not None:
for line in do... | true | true |
1c02c7883092f624d2cdef0d8da8ed3e4655a5ed | 93,124 | py | Python | python/ccxt/base/exchange.py | RusEu/ccxt | d6d2b3e2f54a59d102102ee2858eca4d6702fecc | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | RusEu/ccxt | d6d2b3e2f54a59d102102ee2858eca4d6702fecc | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | RusEu/ccxt | d6d2b3e2f54a59d102102ee2858eca4d6702fecc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.48.37'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkEr... | 39.881799 | 208 | 0.592264 |
__version__ = '1.48.37'
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkError
from ccxt.base.errors import NotSupported
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import DDoSProtection
from ccxt.base.errors import RequestTimeout
from ccxt.base.errors impor... | true | true |
1c02c9c689454dbca538be0783efb43b20dcc2af | 1,580 | py | Python | api/controllers/auth_controller.py | santiagovj22/Backend-Traveler | 84036ba03e9e1618dd153c4e7af2895614286622 | [
"MIT"
] | null | null | null | api/controllers/auth_controller.py | santiagovj22/Backend-Traveler | 84036ba03e9e1618dd153c4e7af2895614286622 | [
"MIT"
] | null | null | null | api/controllers/auth_controller.py | santiagovj22/Backend-Traveler | 84036ba03e9e1618dd153c4e7af2895614286622 | [
"MIT"
] | null | null | null | import logging
from flask_restx import Resource
from flask import request
from flask_jwt_extended import decode_token
from models.models import auth_model
from services.auth_service import init_service, register_user
LOG = logging.getLogger('Auth Controller')
def init_auth_controller(main_app, api):
''' Configu... | 32.244898 | 78 | 0.576582 | import logging
from flask_restx import Resource
from flask import request
from flask_jwt_extended import decode_token
from models.models import auth_model
from services.auth_service import init_service, register_user
LOG = logging.getLogger('Auth Controller')
def init_auth_controller(main_app, api):
LOG.info('S... | true | true |
1c02ca6bbdcf3a8e5bb082b443aa4edc1468e78a | 14,016 | py | Python | fairseq_cli/train.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | null | null | null | fairseq_cli/train.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | null | null | null | fairseq_cli/train.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import argparse
import logging
import pickle
import math
i... | 37.677419 | 177 | 0.678154 |
import argparse
import logging
import pickle
import math
import os
import sys
from typing import Dict, Optional, Any, List, Tuple, Callable
import numpy as np
import torch
from fairseq import (
checkpoint_utils,
distributed_utils,
options,
quantization_utils,
tasks,
utils,
)
from fairseq.data... | true | true |
1c02cafb98e10cacb53edcc804c9f89abe5efd50 | 1,196 | py | Python | test_filter_based_on_strand.py | hall-lab/1kg_sv_comparison | 9c9b84b2477be08ffc9308073d8554cf39b1ad52 | [
"MIT"
] | 2 | 2019-07-22T07:09:04.000Z | 2020-07-07T12:39:49.000Z | test_filter_based_on_strand.py | hall-lab/1kg_sv_comparison | 9c9b84b2477be08ffc9308073d8554cf39b1ad52 | [
"MIT"
] | null | null | null | test_filter_based_on_strand.py | hall-lab/1kg_sv_comparison | 9c9b84b2477be08ffc9308073d8554cf39b1ad52 | [
"MIT"
] | 1 | 2020-07-07T12:39:47.000Z | 2020-07-07T12:39:47.000Z | import operator
from unittest import TestCase
from filter_based_on_strand import StrandFilter, OneThousandGenomesIntersect
class TestStrandFilter(TestCase):
def test_init(self):
obj = StrandFilter([(1, 1), (1, 1)])
self.assertEqual(obj.allowable_strands, set([(1, 1)]))
def test_call(self):
... | 33.222222 | 76 | 0.593645 | import operator
from unittest import TestCase
from filter_based_on_strand import StrandFilter, OneThousandGenomesIntersect
class TestStrandFilter(TestCase):
def test_init(self):
obj = StrandFilter([(1, 1), (1, 1)])
self.assertEqual(obj.allowable_strands, set([(1, 1)]))
def test_call(self):
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.