hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7571e04ac8ca85cd53068ab3e54b8dd6a8e7028 | 1,069 | py | Python | problems/center_inpainting.py | 11BP11/inverse_problems_GAN | 1d8ece55f7de1610b5481d39945b083a4ed3fcc0 | [
"MIT"
] | null | null | null | problems/center_inpainting.py | 11BP11/inverse_problems_GAN | 1d8ece55f7de1610b5481d39945b083a4ed3fcc0 | [
"MIT"
] | null | null | null | problems/center_inpainting.py | 11BP11/inverse_problems_GAN | 1d8ece55f7de1610b5481d39945b083a4ed3fcc0 | [
"MIT"
] | null | null | null |
import tensorflow as tf
import numpy as np
from problems.problem import *
name = "center inpainting"
g_tf_info_placeholder = tf.placeholder(tf.float32, [None], name='g_transform_info')
def problem_loss(x_tformed, g_tformed):
return tf.reduce_mean(tf.abs(x_tformed-g_tformed),[1,2,3])
def m... | 26.073171 | 84 | 0.663237 |
import tensorflow as tf
import numpy as np
from problems.problem import *
name = "center inpainting"
g_tf_info_placeholder = tf.placeholder(tf.float32, [None], name='g_transform_info')
def problem_loss(x_tformed, g_tformed):
return tf.reduce_mean(tf.abs(x_tformed-g_tformed),[1,2,3])
def m... | true | true |
f7571e6e5eed99afa89ff300dae22708d5cd6a6f | 971 | py | Python | src/lib/scrape/src/ArticleMetadata/arxiv.py | fausecteam/faustctf-2020-marsu | 8ad6892dc76b79b0e508fd6a39ff2825dba1c4f4 | [
"0BSD"
] | null | null | null | src/lib/scrape/src/ArticleMetadata/arxiv.py | fausecteam/faustctf-2020-marsu | 8ad6892dc76b79b0e508fd6a39ff2825dba1c4f4 | [
"0BSD"
] | null | null | null | src/lib/scrape/src/ArticleMetadata/arxiv.py | fausecteam/faustctf-2020-marsu | 8ad6892dc76b79b0e508fd6a39ff2825dba1c4f4 | [
"0BSD"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from .handler import add_handler
@add_handler(r'https://arxiv.org/abs/(\d+.\d+)')
def download(url):
metadata = dict()
metadata['importer'] = 'arxiv'
data = requests.get(url)
soup = BeautifulSoup(data.text, "lxml")
authortags = soup.find_all("meta", a... | 40.458333 | 100 | 0.646756 | import requests
from bs4 import BeautifulSoup
from .handler import add_handler
@add_handler(r'https://arxiv.org/abs/(\d+.\d+)')
def download(url):
metadata = dict()
metadata['importer'] = 'arxiv'
data = requests.get(url)
soup = BeautifulSoup(data.text, "lxml")
authortags = soup.find_all("meta", a... | true | true |
f7572092aeb8947b3740f66e397f54baea9bd8b5 | 379 | py | Python | onmt/modules/__init__.py | isl-mt/NMTGMinor | 573504d0ed2e40240e4186eb4af28275f0e3f422 | [
"MIT"
] | null | null | null | onmt/modules/__init__.py | isl-mt/NMTGMinor | 573504d0ed2e40240e4186eb4af28275f0e3f422 | [
"MIT"
] | null | null | null | onmt/modules/__init__.py | isl-mt/NMTGMinor | 573504d0ed2e40240e4186eb4af28275f0e3f422 | [
"MIT"
] | 1 | 2018-10-27T10:28:05.000Z | 2018-10-27T10:28:05.000Z | from onmt.modules.GlobalAttention import GlobalAttention
from onmt.modules.ImageEncoder import ImageEncoder
from onmt.modules.BaseModel import Generator, NMTModel
from onmt.modules.LayerNorm import LayerNorm
from onmt.modules.StaticDropout import StaticDropout
# For flake8 compatibility.
__all__ = [GlobalAttention, Im... | 42.111111 | 88 | 0.854881 | from onmt.modules.GlobalAttention import GlobalAttention
from onmt.modules.ImageEncoder import ImageEncoder
from onmt.modules.BaseModel import Generator, NMTModel
from onmt.modules.LayerNorm import LayerNorm
from onmt.modules.StaticDropout import StaticDropout
__all__ = [GlobalAttention, ImageEncoder, Generator, NMTM... | true | true |
f75721d3789a1ab469f5e1d4feca269eb287d244 | 3,190 | py | Python | config/presets/Modes/Python/S - Perspective Lines LFO/main.py | The-XOR/EYESY_OS | 6a5e3d0bc5574ba2311e0c7e81c600c3af7a3e34 | [
"BSD-3-Clause"
] | 18 | 2021-03-06T05:39:30.000Z | 2022-03-25T17:59:23.000Z | presets/Modes/Python/S - Perspective Lines LFO/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | null | null | null | presets/Modes/Python/S - Perspective Lines LFO/main.py | jqrsound/EYESY_OS_for_RasPiSound | ac117b91cd84ad4c0566bd1a7d4c7b1ccc01cf62 | [
"BSD-3-Clause"
] | 4 | 2021-03-14T18:38:42.000Z | 2021-07-11T14:31:18.000Z | import os
import pygame
import time
import random
import glob
import math
last_point = []
class LFO : #uses three arguments: start point, max, and how far each step is.
def __init__(self, start, max, step):
self.start = start
self.max = max
self.step = step
self.current = 0
... | 32.886598 | 94 | 0.52069 | import os
import pygame
import time
import random
import glob
import math
last_point = []
class LFO :
def __init__(self, start, max, step):
self.start = start
self.max = max
self.step = step
self.current = 0
self.direction = 1
def update(self):
... | true | true |
f757221b321d0c889f2ef9e6a804df3d56dbfec3 | 2,870 | py | Python | leibnizgym/envs/trifinger/sample.py | nicoguertler/leibnizgym | 2c1cb14fbfece09644445d58fe7ac28c41611e5f | [
"BSD-3-Clause"
] | 27 | 2021-07-12T20:58:05.000Z | 2022-03-19T20:29:08.000Z | leibnizgym/envs/trifinger/sample.py | nicoguertler/leibnizgym | 2c1cb14fbfece09644445d58fe7ac28c41611e5f | [
"BSD-3-Clause"
] | 3 | 2021-11-16T15:28:27.000Z | 2022-02-28T21:34:39.000Z | leibnizgym/envs/trifinger/sample.py | nicoguertler/leibnizgym | 2c1cb14fbfece09644445d58fe7ac28c41611e5f | [
"BSD-3-Clause"
] | 5 | 2021-07-09T21:19:12.000Z | 2022-03-14T13:36:42.000Z | """
@author Mayank Mittal
@email mittalma@ethz.ch
@brief Defines sampling stratergies.
# TODO: These functions are generic. Can put in leibnizgym.utils.torch_utils module.
"""
# leibnizgym
from leibnizgym.utils.torch_utils import quaternion_from_euler_xyz
# python
from typing import Union, List, Tuple
i... | 32.988506 | 109 | 0.703833 |
from leibnizgym.utils.torch_utils import quaternion_from_euler_xyz
from typing import Union, List, Tuple
import numpy as np
import torch
import torch.nn.functional
@torch.jit.script
def random_xy(num: int, max_com_distance_to_center: float, device: str) -> Tuple[torch.Tensor, torch.Tensor]:
radius = torc... | true | true |
f757228012d38800acba6e1a2a4704a79774bb66 | 4,078 | py | Python | commands/build_legend.py | furti/FreeCAD-Toolbox | c1ef60463d844e254e9bfd07cbf7795af8bdcd78 | [
"MIT"
] | 3 | 2020-04-22T13:00:27.000Z | 2020-08-27T20:13:14.000Z | commands/build_legend.py | furti/FreeCAD-Toolbox | c1ef60463d844e254e9bfd07cbf7795af8bdcd78 | [
"MIT"
] | null | null | null | commands/build_legend.py | furti/FreeCAD-Toolbox | c1ef60463d844e254e9bfd07cbf7795af8bdcd78 | [
"MIT"
] | null | null | null | import FreeCAD
import FreeCADGui
from app import section_vector_renderer
from PySide2 import QtGui, QtCore, QtWidgets
SVG_TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www... | 30.432836 | 148 | 0.636341 | import FreeCAD
import FreeCADGui
from app import section_vector_renderer
from PySide2 import QtGui, QtCore, QtWidgets
SVG_TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www... | true | true |
f757228d5fea5b3bf2061f502391aec8ace89643 | 11,937 | py | Python | lale/expressions.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | lale/expressions.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | lale/expressions.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 28.833333 | 88 | 0.626623 |
import ast
import pprint
import typing
from copy import deepcopy
from io import StringIO
from typing import Any, Dict, Optional, Union
import astunparse
AstLits = (ast.Num, ast.Str, ast.List, ast.Tuple, ast.Set, ast.Dict)
AstLit = Union[ast.Num, ast.Str, ast.List, ast.Tuple, ast.Set, ast.Dict]
AstExpr... | true | true |
f75723549b46c0f30f2ab70c0c6d2ec2f2113717 | 99 | py | Python | MeetingScheduler/meetingsched/apps.py | joseph-njogu/meeting-scheduler | 07ebc4a72466b167e6e447dd8c93d66e0a3e5a7c | [
"MIT"
] | null | null | null | MeetingScheduler/meetingsched/apps.py | joseph-njogu/meeting-scheduler | 07ebc4a72466b167e6e447dd8c93d66e0a3e5a7c | [
"MIT"
] | 2 | 2022-02-12T13:38:05.000Z | 2022-02-12T13:39:30.000Z | MeetingScheduler/meetingsched/apps.py | joseph-njogu/meeting-scheduler | 07ebc4a72466b167e6e447dd8c93d66e0a3e5a7c | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MeetingschedConfig(AppConfig):
name = 'meetingsched'
| 16.5 | 36 | 0.777778 | from django.apps import AppConfig
class MeetingschedConfig(AppConfig):
name = 'meetingsched'
| true | true |
f757248e9261017e719975d34bbac09380be7da2 | 7,120 | py | Python | zipline/pipeline/loaders/events.py | magne-max/zipline | 41172cd3a320806c4116bcfafa6a607fa300acde | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/loaders/events.py | magne-max/zipline | 41172cd3a320806c4116bcfafa6a607fa300acde | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/loaders/events.py | magne-max/zipline | 41172cd3a320806c4116bcfafa6a607fa300acde | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from six import viewvalues
from toolz import groupby, merge
from .base import PipelineLoader
from .frame import DataFrameLoader
from zipline.pipeline.common import (
EVENT_DATE_FIELD_NAME,
SID_FIELD_NAME,
TS_FIELD_NAME,
)
from zipline.pipeline.loaders.utils import (
... | 32.511416 | 79 | 0.620506 | import numpy as np
import pandas as pd
from six import viewvalues
from toolz import groupby, merge
from .base import PipelineLoader
from .frame import DataFrameLoader
from zipline.pipeline.common import (
EVENT_DATE_FIELD_NAME,
SID_FIELD_NAME,
TS_FIELD_NAME,
)
from zipline.pipeline.loaders.utils import (
... | true | true |
f757262f3ac0b41dbe636c37c369f8dbd42c7f42 | 5,893 | py | Python | lib/stolgo/nasdaq.py | gmtpritam/stolgo | 8ced9b4c3ea2b0a89c929c2d2765ebc8593d00b2 | [
"MIT"
] | 125 | 2020-05-24T19:37:25.000Z | 2022-03-10T10:15:20.000Z | lib/stolgo/nasdaq.py | gmtpritam/stolgo | 8ced9b4c3ea2b0a89c929c2d2765ebc8593d00b2 | [
"MIT"
] | 84 | 2020-05-05T13:04:38.000Z | 2021-12-21T01:51:42.000Z | lib/stolgo/nasdaq.py | gmtpritam/stolgo | 8ced9b4c3ea2b0a89c929c2d2765ebc8593d00b2 | [
"MIT"
] | 38 | 2020-05-05T17:05:26.000Z | 2022-02-25T15:30:16.000Z | import requests
import io
from datetime import timedelta
import pandas as pd
from stolgo.helper import get_date_range,get_formated_dateframe
from stolgo.request import RequestUrl,Curl
#default params for url connection
DEFAULT_TIMEOUT = 5 # seconds
MAX_RETRIES = 2
#default periods
DEFAULT_DAYS = 250
class NasdaqUrl... | 41.5 | 148 | 0.594095 | import requests
import io
from datetime import timedelta
import pandas as pd
from stolgo.helper import get_date_range,get_formated_dateframe
from stolgo.request import RequestUrl,Curl
DEFAULT_TIMEOUT = 5
MAX_RETRIES = 2
DEFAULT_DAYS = 250
class NasdaqUrls:
def __init__(self):
self.STK_DATA_PRE_URL = ... | true | true |
f75726a12c85e8679e2649421358d8f464cf5a0e | 12,688 | py | Python | qiskit/qasm3/ast.py | snsunx/qiskit-terra | 48916d887f4bf39d4e99da7da0dda759efc98a37 | [
"Apache-2.0"
] | null | null | null | qiskit/qasm3/ast.py | snsunx/qiskit-terra | 48916d887f4bf39d4e99da7da0dda759efc98a37 | [
"Apache-2.0"
] | null | null | null | qiskit/qasm3/ast.py | snsunx/qiskit-terra | 48916d887f4bf39d4e99da7da0dda759efc98a37 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 23.715888 | 101 | 0.653452 |
import enum
from typing import Optional, List, Union
class ASTNode:
class Statement(ASTNode):
pass
class Pragma(ASTNode):
def __init__(self, content):
self.content = content
class CalibrationGrammarDeclaration(Statement):
def __init__(self, name):
self.name = name
... | true | true |
f757273018dc461b989d3eb8ad62e80f91c3d8df | 96,147 | py | Python | angr/analyses/reassembler.py | MarSoft/angr | c46e848d4921dafca8d4c304bfadcad4d043bda9 | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/reassembler.py | MarSoft/angr | c46e848d4921dafca8d4c304bfadcad4d043bda9 | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/reassembler.py | MarSoft/angr | c46e848d4921dafca8d4c304bfadcad4d043bda9 | [
"BSD-2-Clause"
] | null | null | null |
import logging
import re
import string
import struct
from collections import defaultdict
from itertools import count
import capstone
import cffi
import cle
import networkx
import pyvex
from . import Analysis
from ..knowledge_base import KnowledgeBase
from ..sim_variable import SimMemoryVariable, SimTemporaryVariable... | 34.167377 | 135 | 0.54321 |
import logging
import re
import string
import struct
from collections import defaultdict
from itertools import count
import capstone
import cffi
import cle
import networkx
import pyvex
from . import Analysis
from ..knowledge_base import KnowledgeBase
from ..sim_variable import SimMemoryVariable, SimTemporaryVariable... | true | true |
f757282a3989322f0fd4ecdee2c6e1a2dc60426e | 19,548 | py | Python | tschartslib/enthistoryextra/enthistoryextra.py | DaleProctor/tscharts | 5447395e0aef0b949bef8426febdec2093cf37ef | [
"Apache-2.0"
] | 16 | 2016-08-17T21:39:10.000Z | 2021-11-24T12:14:28.000Z | tschartslib/enthistoryextra/enthistoryextra.py | DaleProctor/tscharts | 5447395e0aef0b949bef8426febdec2093cf37ef | [
"Apache-2.0"
] | 55 | 2017-04-23T18:12:04.000Z | 2021-08-08T08:25:18.000Z | tschartslib/enthistoryextra/enthistoryextra.py | DaleProctor/tscharts | 5447395e0aef0b949bef8426febdec2093cf37ef | [
"Apache-2.0"
] | 8 | 2017-08-11T02:11:46.000Z | 2021-07-06T22:58:42.000Z | #(C) Copyright Syd Logan 2020
#(C) Copyright Thousand Smiles Foundation 2020
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#
#You may obtain a copy of the License at
#http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by a... | 31.993453 | 83 | 0.572897 |
import unittest
import getopt, sys
import json
from tschartslib.service.serviceapi import ServiceAPI
from tschartslib.tscharts.tscharts import Login, Logout
from tschartslib.patient.patient import CreatePatient, DeletePatient
from tschartslib.enthistory.enthistory import CreateENTHistory, DeleteENTHist... | true | true |
f75729632bbd54a6cb3c5abfe3a098bd36c7a8f0 | 5,142 | py | Python | docs/conf.py | gabephun/MolSSI_geometry_analysis | da382c3d69e543935b888968c43eada526033b8e | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | gabephun/MolSSI_geometry_analysis | da382c3d69e543935b888968c43eada526033b8e | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | gabephun/MolSSI_geometry_analysis | da382c3d69e543935b888968c43eada526033b8e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.975904 | 79 | 0.655776 |
project = 'geometry_analysis'
copyright = ("2019, Gabe. Project structure based on the "
"Computational Molecular Science Python Cookiecutter version 1.0")
author = 'Gabe'
version = ''
release = ''
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sp... | true | true |
f7572b9436ba7e251ee5f16016857384e6d3549e | 909 | py | Python | jmetal/operator/__init__.py | Amgroot-w/jMetalPy | fcfc5bf436734c6318c89dde0e543fbfd8551ba0 | [
"MIT"
] | null | null | null | jmetal/operator/__init__.py | Amgroot-w/jMetalPy | fcfc5bf436734c6318c89dde0e543fbfd8551ba0 | [
"MIT"
] | null | null | null | jmetal/operator/__init__.py | Amgroot-w/jMetalPy | fcfc5bf436734c6318c89dde0e543fbfd8551ba0 | [
"MIT"
] | null | null | null | from .crossover import NullCrossover, SBXCrossover, SPXCrossover, DifferentialEvolutionCrossover, IntegerSBXCrossover
from .mutation import NullMutation, BitFlipMutation, PolynomialMutation, IntegerPolynomialMutation, UniformMutation, \
SimpleRandomMutation
from .selection import BestSolutionSelection, BinaryTourna... | 64.928571 | 118 | 0.834983 | from .crossover import NullCrossover, SBXCrossover, SPXCrossover, DifferentialEvolutionCrossover, IntegerSBXCrossover
from .mutation import NullMutation, BitFlipMutation, PolynomialMutation, IntegerPolynomialMutation, UniformMutation, \
SimpleRandomMutation
from .selection import BestSolutionSelection, BinaryTourna... | true | true |
f7572c8d67c545ac5ac6a3f5d491e139fbeaa55a | 222 | py | Python | bootstrap_message/urls.py | aronysidoro/django-boostrap-messages | 8b1a9ef638b35abf76b0823d4acc38da7d562c6e | [
"MIT"
] | null | null | null | bootstrap_message/urls.py | aronysidoro/django-boostrap-messages | 8b1a9ef638b35abf76b0823d4acc38da7d562c6e | [
"MIT"
] | null | null | null | bootstrap_message/urls.py | aronysidoro/django-boostrap-messages | 8b1a9ef638b35abf76b0823d4acc38da7d562c6e | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from bootstrap_message import views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$', views.index, name='index'),
]
| 20.181818 | 46 | 0.707207 | from django.conf.urls import include, url
from django.contrib import admin
from bootstrap_message import views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$', views.index, name='index'),
]
| true | true |
f7572db8ffe731808bd84ef6466985a06394f11c | 704 | py | Python | dynamic_programming/kadane_algorithm.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | 3 | 2021-08-23T21:40:01.000Z | 2022-02-24T10:55:25.000Z | dynamic_programming/kadane_algorithm.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | null | null | null | dynamic_programming/kadane_algorithm.py | bharathikannann/Python-Data-Structures-and-Algorithms | 61aca26940e486a00cd293fae36c1391b7ef3864 | [
"MIT"
] | null | null | null | # Largest sub array problem
def kadane_algorithm(arr: list) -> int:
l = len(arr)
maxhere = arr[0]
maxoutput = 0 # For getting the max subarray value
for i in range(1,l):
# If adding the element to prev max is greater or the current number is greater
maxhere = max(arr[i], arr[i] +... | 35.2 | 87 | 0.53267 |
def kadane_algorithm(arr: list) -> int:
l = len(arr)
maxhere = arr[0]
maxoutput = 0
for i in range(1,l):
maxhere = max(arr[i], arr[i] + maxhere)
maxoutput = max(maxhere, maxoutput)
return maxoutput
if __name__ == '__main__':
print(kadane_algorithm([-... | true | true |
f7572e19d0a6dacc260e59acdd774272079c0d16 | 1,160 | py | Python | datasets/mnist.py | guoyang328/pytorch-dann | 21ad0622ce948002fdc90d5e8a2b498c94429218 | [
"MIT"
] | 1 | 2020-08-06T02:00:50.000Z | 2020-08-06T02:00:50.000Z | datasets/mnist.py | Richard456/Dann | 1971cf1a7b9ecadc17932a8ecb3f0c34609751a3 | [
"MIT"
] | null | null | null | datasets/mnist.py | Richard456/Dann | 1971cf1a7b9ecadc17932a8ecb3f0c34609751a3 | [
"MIT"
] | null | null | null | """Dataset setting and data loader for MNIST."""
import torch
from torchvision import datasets, transforms
import os
def get_mnist(dataset_root, batch_size, train):
"""Get MNIST datasets loader."""
# image pre-processing
pre_process = transforms.Compose([transforms.Resize(28), # different img size settin... | 36.25 | 128 | 0.530172 |
import torch
from torchvision import datasets, transforms
import os
def get_mnist(dataset_root, batch_size, train):
pre_process = transforms.Compose([transforms.Resize(28),
transforms.ToTensor(),
transforms.Normalize(
... | true | true |
f7572e46cf84f9f71326eba212a7083feb98b102 | 391 | py | Python | smcpy/utils/progress_bar.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | 1 | 2020-02-11T22:37:43.000Z | 2020-02-11T22:37:43.000Z | smcpy/utils/progress_bar.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | null | null | null | smcpy/utils/progress_bar.py | HarshilShrivastava/SMCPy | e3c958023aab3f3143e70de5a52e3c195e536dd1 | [
"NASA-1.3"
] | null | null | null | def set_bar(pbar, t, last_ess, ess, acceptance_ratio, resample_status):
pbar.set_description("Step number: {:2d} | Last ess: {:8.2f} | "
"Current ess: {:8.2f} | Samples accepted: "
"{:.1%} | {} |"
.format(t + 1, last_ess, ess, acceptance_rat... | 48.875 | 72 | 0.478261 | def set_bar(pbar, t, last_ess, ess, acceptance_ratio, resample_status):
pbar.set_description("Step number: {:2d} | Last ess: {:8.2f} | "
"Current ess: {:8.2f} | Samples accepted: "
"{:.1%} | {} |"
.format(t + 1, last_ess, ess, acceptance_rat... | true | true |
f7572e78639f3bb43b7242bb214ecc0eedd092e0 | 1,379 | py | Python | ooobuild/dyn/rendering/x_bitmap_palette.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/rendering/x_bitmap_palette.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/rendering/x_bitmap_palette.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 37.27027 | 87 | 0.771574 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.rendering import XBitmapPalette as XBitmapPalette
... | true | true |
f7572f400a07fec537b19f54dfe9870c2ed97c9d | 1,228 | py | Python | attendees/occasions/views/api/assembly_meet_gatherings.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | null | null | null | attendees/occasions/views/api/assembly_meet_gatherings.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | 5 | 2022-01-21T03:26:40.000Z | 2022-02-04T17:32:16.000Z | attendees/occasions/views/api/assembly_meet_gatherings.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | null | null | null | import time
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from rest_framework import viewsets
from rest_framework.exceptions import AuthenticationFailed
from attendees.occasions.serializers import GatheringSerializer
from attendees.occasions.services im... | 34.111111 | 85 | 0.728827 | import time
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from rest_framework import viewsets
from rest_framework.exceptions import AuthenticationFailed
from attendees.occasions.serializers import GatheringSerializer
from attendees.occasions.services im... | true | true |
f7572f5a4f9eca9d287dd9d5d6494abca5b71ef2 | 703 | py | Python | silver/models/billing_entities/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 222 | 2017-01-15T10:30:57.000Z | 2022-03-08T20:34:46.000Z | silver/models/billing_entities/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 141 | 2017-01-11T10:56:49.000Z | 2021-10-12T11:51:00.000Z | silver/models/billing_entities/__init__.py | DocTocToc/silver | f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5 | [
"Apache-2.0"
] | 76 | 2017-01-10T13:50:27.000Z | 2022-03-25T21:37:00.000Z | # Copyright (c) 2016 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 41.352941 | 74 | 0.782361 |
from silver.models.billing_entities.customer import Customer
from silver.models.billing_entities.provider import Provider
| true | true |
f757307eeb866a0bac043fab7f488011e6470c5e | 7,817 | py | Python | examples/text/news_topic_classification.py | heiseApple/learn2learn | d726b10c8139a19057ecf1a034d33477b410a1c5 | [
"MIT"
] | 1 | 2022-03-16T09:42:08.000Z | 2022-03-16T09:42:08.000Z | examples/text/news_topic_classification.py | OliverWang-Au/learn2learn | df3c3291b4681440a80a69a7815090a4bd3cd661 | [
"MIT"
] | null | null | null | examples/text/news_topic_classification.py | OliverWang-Au/learn2learn | df3c3291b4681440a80a69a7815090a4bd3cd661 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import random
import torch
from torch import nn, optim
from torch.nn import functional as F
from tqdm import tqdm
import learn2learn as l2l
class Net(nn.Module):
"""Head for sentence-level classification tasks."""
def __init__(self, num_classes, input_dim=768, inner_... | 37.401914 | 114 | 0.618396 |
import argparse
import random
import torch
from torch import nn, optim
from torch.nn import functional as F
from tqdm import tqdm
import learn2learn as l2l
class Net(nn.Module):
def __init__(self, num_classes, input_dim=768, inner_dim=200, pooler_dropout=0.3):
super().__init__()
self.dense = ... | true | true |
f7573264d13032c6f74c2e0bf65df45235c25f71 | 1,889 | py | Python | user-test.py | obewas/PasswordLocker | 1476c09d5d317e9b24cef3c414fc75c292256a08 | [
"Unlicense"
] | null | null | null | user-test.py | obewas/PasswordLocker | 1476c09d5d317e9b24cef3c414fc75c292256a08 | [
"Unlicense"
] | null | null | null | user-test.py | obewas/PasswordLocker | 1476c09d5d317e9b24cef3c414fc75c292256a08 | [
"Unlicense"
] | null | null | null | import unittest
from User import User
class TestUser(unittest.TestCase):
def setUp(self):
self.new_user = User("John","Paul")
def tearDown(self):
'''
clean up after each test to prevent errors
'''
User.userList = []
#2nd test
def test__init(self):
... | 24.855263 | 60 | 0.586554 | import unittest
from User import User
class TestUser(unittest.TestCase):
def setUp(self):
self.new_user = User("John","Paul")
def tearDown(self):
User.userList = []
def test__init(self):
self.assertEqual(self.new_user.username, "John")
self.assertEqual(self.new_u... | true | true |
f757327f2d9e3c820a2c1079c7eefe52b824c5c5 | 789 | py | Python | packages/tool_util/tests/util.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 2 | 2017-03-28T12:11:41.000Z | 2017-04-22T02:58:25.000Z | packages/tool_util/tests/util.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | packages/tool_util/tests/util.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2019-01-16T22:21:54.000Z | 2019-01-16T22:21:54.000Z | from contextlib import contextmanager
from os import environ
import pytest
external_dependency_management = pytest.mark.skipif(
not environ.get('GALAXY_TEST_INCLUDE_SLOW'),
reason="GALAXY_TEST_INCLUDE_SLOW not set"
)
@contextmanager
def modify_environ(values, keys_to_remove=None):
"""
Modify the env... | 26.3 | 82 | 0.667934 | from contextlib import contextmanager
from os import environ
import pytest
external_dependency_management = pytest.mark.skipif(
not environ.get('GALAXY_TEST_INCLUDE_SLOW'),
reason="GALAXY_TEST_INCLUDE_SLOW not set"
)
@contextmanager
def modify_environ(values, keys_to_remove=None):
old_environ = environ.... | true | true |
f7573388ca354885ad72ae5acad19821b233e44c | 1,357 | py | Python | setup.py | erdogant/imagesc | 55b0248d1de297c9ea71044b16efac35b07b6af9 | [
"MIT"
] | 2 | 2020-08-15T07:00:55.000Z | 2020-08-18T11:56:35.000Z | setup.py | erdogant/imagesc | 55b0248d1de297c9ea71044b16efac35b07b6af9 | [
"MIT"
] | 1 | 2020-08-18T11:50:19.000Z | 2021-03-23T12:09:55.000Z | setup.py | erdogant/imagesc | 55b0248d1de297c9ea71044b16efac35b07b6af9 | [
"MIT"
] | 2 | 2020-08-15T07:01:00.000Z | 2022-01-05T00:14:33.000Z | import setuptools
import re
# Version control --------
VERSIONFILE="imagesc/__init__.py"
getversion = re.search( r"^__version__ = ['\"]([^'\"]*)['\"]", open(VERSIONFILE, "rt").read(), re.M)
if getversion:
new_version = getversion.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSI... | 37.694444 | 101 | 0.674282 | import setuptools
import re
VERSIONFILE="imagesc/__init__.py"
getversion = re.search( r"^__version__ = ['\"]([^'\"]*)['\"]", open(VERSIONFILE, "rt").read(), re.M)
if getversion:
new_version = getversion.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
# Setup file --... | true | true |
f75733d8865854e3cd9e156db0282a391bb41dc0 | 2,148 | py | Python | tests/sentry/rules/test_processor.py | Ali-Tahir/sentry | aa7b306c5ea671ac002a3524982563679557cb31 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/rules/test_processor.py | Ali-Tahir/sentry | aa7b306c5ea671ac002a3524982563679557cb31 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/rules/test_processor.py | Ali-Tahir/sentry | aa7b306c5ea671ac002a3524982563679557cb31 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import GroupRuleStatus, Rule
from sentry.plugins.base import plugins
from sentry.testutils import TestCase
from sentry.rules.processor import EventCompatibilityProxy, Rul... | 33.046154 | 98 | 0.643855 |
from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import GroupRuleStatus, Rule
from sentry.plugins.base import plugins
from sentry.testutils import TestCase
from sentry.rules.processor import EventCompatibilityProxy, RuleProcessor
class Rule... | true | true |
f757347ab18029f3153f4ff4845c89c4bd17925a | 1,921 | py | Python | fractalis/data/etls/ada/handler_ada.py | LCSB-BioCore/Fractalis | a9f7f8da7675b55c5996d2f32d7baa7313b0350e | [
"Apache-2.0"
] | 7 | 2018-06-01T12:17:26.000Z | 2019-08-23T13:15:34.000Z | fractalis/data/etls/ada/handler_ada.py | LCSB-BioCore/Fractalis | a9f7f8da7675b55c5996d2f32d7baa7313b0350e | [
"Apache-2.0"
] | 2 | 2018-10-23T14:12:27.000Z | 2018-11-15T09:11:25.000Z | fractalis/data/etls/ada/handler_ada.py | LCSB-BioCore/Fractalis | a9f7f8da7675b55c5996d2f32d7baa7313b0350e | [
"Apache-2.0"
] | 3 | 2018-08-02T16:42:50.000Z | 2018-12-14T18:16:22.000Z | """This module provides AdaHandler, an implementation of ETLHandler for ADA."""
import logging
import requests
from fractalis.data.etlhandler import ETLHandler
logger = logging.getLogger(__name__)
class AdaHandler(ETLHandler):
"""This ETLHandler provides integration with ADA.
'Ada provides key infrastru... | 35.574074 | 79 | 0.580427 |
import logging
import requests
from fractalis.data.etlhandler import ETLHandler
logger = logging.getLogger(__name__)
class AdaHandler(ETLHandler):
_handler = 'ada'
@staticmethod
def make_label(descriptor: dict) -> str:
return '{} ({})'.format(descriptor['dictionary']['label'],
... | true | true |
f7573541179084eade9f41cc88a354012c0200ea | 8,729 | py | Python | pymarket/bids/demand_curves.py | taqtiqa-mark/pymarket | 2f8db92010d5f9407a72941788500351e92cbe81 | [
"MIT"
] | null | null | null | pymarket/bids/demand_curves.py | taqtiqa-mark/pymarket | 2f8db92010d5f9407a72941788500351e92cbe81 | [
"MIT"
] | null | null | null | pymarket/bids/demand_curves.py | taqtiqa-mark/pymarket | 2f8db92010d5f9407a72941788500351e92cbe81 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from typing import Tuple, Union
from pymarket.bids import BidManager
def demand_curve_from_bids(
bids: pd.DataFrame) -> Tuple[np.ndarray, np.ndarray]:
"""
Creates a demand curve from a set of buying bids.
It is the inverse cumulative distribution of quantity
... | 28.903974 | 79 | 0.582541 | import numpy as np
import pandas as pd
from typing import Tuple, Union
from pymarket.bids import BidManager
def demand_curve_from_bids(
bids: pd.DataFrame) -> Tuple[np.ndarray, np.ndarray]:
buying = bids[bids.buying]
buying = buying.sort_values('price', ascending=False)
buying['acum'] = buying.qua... | true | true |
f7573674d0f0e365c393e7337c3c2c7c84ff858c | 723 | py | Python | app/__init__.py | towa/acab_gen | f974d4f709e0d592344f9d2144648089f5b48bf0 | [
"MIT"
] | null | null | null | app/__init__.py | towa/acab_gen | f974d4f709e0d592344f9d2144648089f5b48bf0 | [
"MIT"
] | null | null | null | app/__init__.py | towa/acab_gen | f974d4f709e0d592344f9d2144648089f5b48bf0 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, request
from flask_limiter import Limiter
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_restful import Api
from flask_cors import CORS
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///acab.db'
db = SQLAlchemy(app)
... | 31.434783 | 77 | 0.77455 | from flask import Flask, jsonify, request
from flask_limiter import Limiter
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_restful import Api
from flask_cors import CORS
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///acab.db'
db = SQLAlchemy(app)
... | true | true |
f757372be2396ac72bc00a97d601503c1778969d | 3,225 | py | Python | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_ssd_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_ssd_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_ssd_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_0.models.compati... | 28.043478 | 125 | 0.587597 |
import pprint
import re
import six
from isi_sdk_8_2_0.models.compatibilities_ssd_active_active_item import CompatibilitiesSsdActiveActiveItem
class CompatibilitiesSsdActive(object):
swagger_types = {
'active': 'list[CompatibilitiesSsdActiveActiveItem]'
}
attribute_map = {
'acti... | true | true |
f75737fccb2e228e6db13846619546a8aa81ea8f | 1,102 | py | Python | Video/Shotcut.app/Resources/askpass.py | alphamodh0/Utilities | d02caf12728bd2aa74eeed0952975798c7ac7cd1 | [
"BSD-2-Clause"
] | 19 | 2021-01-07T12:56:40.000Z | 2022-01-25T18:58:44.000Z | Video/Shotcut.app/Resources/askpass.py | alphamodh0/Utilities | d02caf12728bd2aa74eeed0952975798c7ac7cd1 | [
"BSD-2-Clause"
] | 129 | 2020-11-29T13:15:45.000Z | 2022-03-31T18:29:37.000Z | Video/Shotcut.app/Resources/askpass.py | alphamodh0/Utilities | d02caf12728bd2aa74eeed0952975798c7ac7cd1 | [
"BSD-2-Clause"
] | 24 | 2021-01-07T12:55:16.000Z | 2022-01-23T18:08:39.000Z | #!/usr/bin/env python3
# man sudo(8)
# -A, --askpass
# Normally, if sudo requires a password, it will read it from
# the user's terminal. If the -A (askpass) option is
# specified, a (possibly graphical) helper program is executed
# to read the... | 39.357143 | 101 | 0.595281 |
# specified, a (possibly graphical) helper program is executed
# to read the user's password and output the password to the
ts
app = QtWidgets.QApplication([])
password, ok = QtWidgets.QInputDialog.getText(None, "sudo", "Password", QtWidgets.QLineEdit.Password)
if ok:
... | true | true |
f7573808afb448369591143f95251ddd64abfba1 | 3,714 | py | Python | routes/user.py | ivanjrju/backend | 2b8ac8300096f4909743c6917f30779f4efcd890 | [
"MIT"
] | null | null | null | routes/user.py | ivanjrju/backend | 2b8ac8300096f4909743c6917f30779f4efcd890 | [
"MIT"
] | null | null | null | routes/user.py | ivanjrju/backend | 2b8ac8300096f4909743c6917f30779f4efcd890 | [
"MIT"
] | null | null | null | from models.main import *
from models.appendix import *
from flask import Blueprint, request, render_template
from flask_jwt_extended import (jwt_required, get_jwt_identity)
from flask_jwt_extended import create_access_token, decode_token
from .utils import tryCommit
from datetime import datetime, timedelta
from sqlalc... | 32.867257 | 108 | 0.656166 | from models.main import *
from models.appendix import *
from flask import Blueprint, request, render_template
from flask_jwt_extended import (jwt_required, get_jwt_identity)
from flask_jwt_extended import create_access_token, decode_token
from .utils import tryCommit
from datetime import datetime, timedelta
from sqlalc... | true | true |
f757386e8da2e22eb92bcafe51154793b89adec6 | 43,873 | py | Python | saleor/order/tests/test_order.py | TGalioAutomation/web-saleor | 2936aea6267b23e038828eef11795dce9fd04f93 | [
"CC-BY-4.0"
] | null | null | null | saleor/order/tests/test_order.py | TGalioAutomation/web-saleor | 2936aea6267b23e038828eef11795dce9fd04f93 | [
"CC-BY-4.0"
] | 1 | 2022-01-06T19:01:21.000Z | 2022-01-06T19:01:21.000Z | saleor/order/tests/test_order.py | TGalioAutomation/web-saleor | 2936aea6267b23e038828eef11795dce9fd04f93 | [
"CC-BY-4.0"
] | null | null | null | from decimal import Decimal
from unittest.mock import MagicMock, Mock, patch
import pytest
from prices import Money, TaxedMoney
from ...core.weight import zero_weight
from ...discount import OrderDiscountType
from ...discount.models import (
DiscountValueType,
NotApplicable,
Voucher,
VoucherChannelLis... | 33.465294 | 88 | 0.726962 | from decimal import Decimal
from unittest.mock import MagicMock, Mock, patch
import pytest
from prices import Money, TaxedMoney
from ...core.weight import zero_weight
from ...discount import OrderDiscountType
from ...discount.models import (
DiscountValueType,
NotApplicable,
Voucher,
VoucherChannelLis... | true | true |
f757389f30d1e57fe17c843b84e12138938dbdae | 6,299 | py | Python | official/transformer/utils/tokenizer_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 357 | 2019-01-23T23:54:30.000Z | 2022-03-31T05:32:25.000Z | official/transformer/utils/tokenizer_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 65 | 2019-02-06T15:35:35.000Z | 2022-03-25T09:56:48.000Z | official/transformer/utils/tokenizer_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 164 | 2019-02-06T15:05:57.000Z | 2022-03-31T11:48:14.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.420765 | 80 | 0.67598 |
import collections
import tempfile
import tensorflow as tf
from official.transformer.utils import tokenizer
class SubtokenizerTest(tf.test.TestCase):
def _init_subtokenizer(self, vocab_list):
temp_file = tempfile.NamedTemporaryFile(delete=False)
with tf.io.gfile.GFile(temp_file.name, "w"... | true | true |
f7573977f4b946b41467326a21959bbfded2b458 | 735 | py | Python | bluebottle/cms/migrations/0032_migrate_projects_3.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/cms/migrations/0032_migrate_projects_3.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/cms/migrations/0032_migrate_projects_3.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-10 15:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0031_migrate_projects_2'),
]
operations = [
migrations.RemoveField(
... | 22.272727 | 48 | 0.563265 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0031_migrate_projects_2'),
]
operations = [
migrations.RemoveField(
model_name='projects',
name='projects',
),
... | true | true |
f75739a9d3341380bad816fb37c329f8be9eb961 | 1,084 | py | Python | test/unittests/test_NRUNCON.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_NRUNCON.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_NRUNCON.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.BMPs.AgAnimal import NRUNCON
class TestNRUNCON(VariableUnitTest):
def test_NRUNCON(self):
z = self.z
np.testing.assert_array_almost_equal(
NRUNCON.NRUNCON_f(z.NYrs, z.GrazingAnimal_0, z.NumAnimals, z.AvgAnima... | 49.272727 | 116 | 0.592251 | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.BMPs.AgAnimal import NRUNCON
class TestNRUNCON(VariableUnitTest):
def test_NRUNCON(self):
z = self.z
np.testing.assert_array_almost_equal(
NRUNCON.NRUNCON_f(z.NYrs, z.GrazingAnimal_0, z.NumAnimals, z.AvgAnima... | true | true |
f75739dbd26bd2aeb75bc5c7e7ef371585bfbb6e | 28,992 | py | Python | lhrhost/robot/axes.py | ethanjli/liquid-handling-robotics | 999ab03c225b4c5382ab9fcac6a4988d0c232c67 | [
"BSD-3-Clause"
] | null | null | null | lhrhost/robot/axes.py | ethanjli/liquid-handling-robotics | 999ab03c225b4c5382ab9fcac6a4988d0c232c67 | [
"BSD-3-Clause"
] | null | null | null | lhrhost/robot/axes.py | ethanjli/liquid-handling-robotics | 999ab03c225b4c5382ab9fcac6a4988d0c232c67 | [
"BSD-3-Clause"
] | 1 | 2018-08-03T17:17:31.000Z | 2018-08-03T17:17:31.000Z | """Abstractions for the axes of a liquid-handling robot."""
# Standard imports
import logging
from abc import abstractmethod
# Local package imiports
from lhrhost.protocol.linear_actuator import Receiver as LinearActuatorReceiver
from lhrhost.util.containers import add_to_tree, get_from_tree
from lhrhost.util.files i... | 40.661992 | 92 | 0.654146 |
import logging
from abc import abstractmethod
from lhrhost.protocol.linear_actuator import Receiver as LinearActuatorReceiver
from lhrhost.util.containers import add_to_tree, get_from_tree
from lhrhost.util.files import load_from_json, save_to_json
from lhrhost.util.interfaces import InterfaceClass
import scipy.s... | true | true |
f7573a1a64c0edb0400ef640f024435b62eda62a | 8,643 | py | Python | djangosige/apps/compras/forms/compras.py | lafitehhq/djangoSIGE | b88d36d04871a28a7adea8edecf7173d3e0ae759 | [
"MIT"
] | 7 | 2018-07-22T08:15:34.000Z | 2022-01-30T20:41:14.000Z | djangosige/apps/compras/forms/compras.py | lafitehhq/djangoSIGE | b88d36d04871a28a7adea8edecf7173d3e0ae759 | [
"MIT"
] | 8 | 2020-06-05T18:29:57.000Z | 2022-03-11T23:25:47.000Z | djangosige/apps/compras/forms/compras.py | lafitehhq/djangoSIGE | b88d36d04871a28a7adea8edecf7173d3e0ae759 | [
"MIT"
] | 4 | 2018-12-06T18:07:53.000Z | 2020-11-24T09:16:10.000Z | # -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms import inlineformset_factory
from djangosige.apps.compras.models import OrcamentoCompra, PedidoCompra, ItensCompra, Compra
class CompraForm(forms.ModelForm):
def __init__(self, *args, **kw... | 45.251309 | 126 | 0.599098 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms import inlineformset_factory
from djangosige.apps.compras.models import OrcamentoCompra, PedidoCompra, ItensCompra, Compra
class CompraForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Co... | true | true |
f7573aa8c6854a34fece4c4335733a8aeb897ac1 | 594 | py | Python | course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py | vvmar/machine-learning-engineering-for-production-public | 0350e2e79eebc1dc2edb9e7b5e6f582b40fa74be | [
"Apache-2.0"
] | null | null | null | course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py | vvmar/machine-learning-engineering-for-production-public | 0350e2e79eebc1dc2edb9e7b5e6f582b40fa74be | [
"Apache-2.0"
] | null | null | null | course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py | vvmar/machine-learning-engineering-for-production-public | 0350e2e79eebc1dc2edb9e7b5e6f582b40fa74be | [
"Apache-2.0"
] | null | null | null | import pickle
import numpy as np
from typing import List
from fastapi import FastAPI
from pydantic import BaseModel, conlist
# rev 1
app = FastAPI(title="Predicting Wine Class with batching")
# Open classifier in global scope
with open("models/wine-95-fixed.pkl", "rb") as file:
clf = pickle.load(file)
class Wi... | 22.846154 | 71 | 0.725589 | import pickle
import numpy as np
from typing import List
from fastapi import FastAPI
from pydantic import BaseModel, conlist
app = FastAPI(title="Predicting Wine Class with batching")
with open("models/wine-95-fixed.pkl", "rb") as file:
clf = pickle.load(file)
class Wine(BaseModel):
batches: List[conlist... | true | true |
f7573b2e315c776022911d6eaf3b6dbd5aa61707 | 7,927 | py | Python | lib/django-1.4/django/core/cache/backends/base.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.4/django/core/cache/backends/base.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.4/django/core/cache/backends/base.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | "Base Cache class."
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.encoding import smart_str
from django.utils.importlib import import_module
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
... | 35.388393 | 87 | 0.621168 |
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.encoding import smart_str
from django.utils.importlib import import_module
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
pass
MEMCACHE_M... | true | true |
f7573be600041cd0a815a92c65e1ae26ffe0fa5f | 3,350 | py | Python | yang2rest/json2yang.py | fortinet-solutions-cse/netconf-rest | 2147cc5d37eda848d9d87a8d74b26df9bc487384 | [
"Apache-2.0"
] | 7 | 2018-04-13T17:57:22.000Z | 2022-02-08T11:49:18.000Z | yang2rest/json2yang.py | fortinet-solutions-cse/netconf-rest | 2147cc5d37eda848d9d87a8d74b26df9bc487384 | [
"Apache-2.0"
] | null | null | null | yang2rest/json2yang.py | fortinet-solutions-cse/netconf-rest | 2147cc5d37eda848d9d87a8d74b26df9bc487384 | [
"Apache-2.0"
] | 2 | 2020-01-18T19:20:37.000Z | 2021-05-21T18:55:33.000Z | #!/usr/bin/env python
# coding=utf-8
"""
#************************************************
# Copyright 2018 Fortinet, Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apa... | 29.130435 | 75 | 0.582388 |
import json
try:
from lxml import etree
except ImportError:
from xml.etree import ElementTree as etree
__author__ = "Miguel Angel Muñoz González (magonzalez at fortinet.com)"
__copyright__ = "Copyright 2018, Fortinet, Inc."
__credits__ = "Miguel Angel Muñoz"
__license__ = "Apache 2.0"
__version__ = "0.6"
... | true | true |
f7573c21e54bfdac65987331bc2cac9667ced39d | 7,776 | py | Python | docs/conf.py | BrianHicks/em | 19a86c2392b136c9e857000798ccaa525aa0ed84 | [
"MIT"
] | 6 | 2015-05-10T14:09:54.000Z | 2021-01-04T10:09:38.000Z | docs/conf.py | techdragon/emit | 19a86c2392b136c9e857000798ccaa525aa0ed84 | [
"MIT"
] | null | null | null | docs/conf.py | techdragon/emit | 19a86c2392b136c9e857000798ccaa525aa0ed84 | [
"MIT"
] | 3 | 2015-04-04T15:37:55.000Z | 2015-08-21T08:08:45.000Z | # -*- coding: utf-8 -*-
#
# Emit documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 3 19:10:48 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | 31.738776 | 80 | 0.712191 |
import sys, os
sys.path.append(os.path.abspath('..'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Emit'
copyright = u'2013, Brian Hicks'
# |version| and |release|, also used in ... | true | true |
f7573e8c8a724bbc65c2f3314b29997c792fc0e8 | 3,507 | py | Python | museosMadrid/models.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | museosMadrid/models.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | museosMadrid/models.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Datos de cada museo:
# ID-ENTIDAD (PK), NOMBRE, DESCRIPCION-ENTIDAD, HORARIO, TRANSPORTE, ACCESIBILIDAD, CONTENT-URL, LOCALIZACION{NOMBRE-VIA, CLASE-VIAL, TIPO-NUM, NUM, LOCALIDAD, PROVINCIA, CODIGO-POSTAL, BARRIO,... | 45.545455 | 273 | 0.738523 | from django.db import models
from django.contrib.auth.models import User
class Museo(models.Model):
museo_id = models.PositiveIntegerField(primary_key=True)
nombre = models.CharField(max_length=200)
descripcion = models.TextField()
horario = models.TextField(blank=True, null=True)
equ... | true | true |
f7573f6045dce2178d9c780df6717663f40a0871 | 8,379 | py | Python | python/paddle/fluid/trainer_factory.py | jiansowa/Paddle | 488152a6d076eac91ef0921ff6e16c65777f814d | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/fluid/trainer_factory.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/fluid/trainer_factory.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 43.414508 | 90 | 0.573457 |
import threading
import time
import logging
import numpy as np
from paddle.fluid.log_helper import get_logger
local_logger = get_logger(
__name__, logging.INFO, fmt='%(asctime)s-%(levelname)s: %(message)s')
from .trainer_desc import MultiTrainer, DistMultiTrainer, PipelineTrainer, HeterXpuTrainer
fr... | true | true |
f7573fb67e439587611e8fd6fd426d611f9a5809 | 577 | py | Python | logger.py | RollLife/automation_webhard | bbc5756dac85c3cefeca8b94947ca3cf6246a649 | [
"MIT"
] | null | null | null | logger.py | RollLife/automation_webhard | bbc5756dac85c3cefeca8b94947ca3cf6246a649 | [
"MIT"
] | null | null | null | logger.py | RollLife/automation_webhard | bbc5756dac85c3cefeca8b94947ca3cf6246a649 | [
"MIT"
] | null | null | null | import logging
# 로그 생성
logger = logging.getLogger()
# 로그의 출력 기준 설정
logger.setLevel(logging.INFO)
# log 출력 형식
formatter = logging.Formatter('[%(asctime)s][%(filename)s-%(funcName)s:%(lineno)d][%(levelname)s] - %(message)s')
# log 출력
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(formatter)
logg... | 25.086957 | 113 | 0.715771 | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
formatter = logging.Formatter('[%(asctime)s][%(filename)s-%(funcName)s:%(lineno)d][%(levelname)s] - %(message)s')
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(formatter)
logger.addHandler(stream_handler)
if __name... | true | true |
f7573fe0ba7996b6fb1038a88e8dec09e69eb3c9 | 929 | py | Python | tests/invalid_mode_test.py | karlch/vimiv | acbb83e003805e5304131be1f73d7f66528606d6 | [
"MIT"
] | 268 | 2015-11-15T22:41:27.000Z | 2022-02-07T21:54:52.000Z | tests/invalid_mode_test.py | karlch/vimiv | acbb83e003805e5304131be1f73d7f66528606d6 | [
"MIT"
] | 92 | 2015-12-12T00:35:54.000Z | 2021-04-26T16:16:30.000Z | tests/invalid_mode_test.py | karlch/vimiv | acbb83e003805e5304131be1f73d7f66528606d6 | [
"MIT"
] | 15 | 2015-12-11T19:42:15.000Z | 2020-09-24T13:00:36.000Z | # vim: ft=python fileencoding=utf-8 sw=4 et sts=4
"""Fail functions because called from wrong mode test for vimiv's test suite."""
from unittest import main
from vimiv_testcase import VimivTestCase
class FailingModeTest(VimivTestCase):
"""Failing Mode Tests."""
@classmethod
def setUpClass(cls):
... | 29.03125 | 80 | 0.679225 |
from unittest import main
from vimiv_testcase import VimivTestCase
class FailingModeTest(VimivTestCase):
@classmethod
def setUpClass(cls):
cls.init_test(cls)
cls.cmdline = cls.vimiv["commandline"]
def test_fail_focus_slider(self):
self.vimiv["manipulate"].focus_slider("bri")
... | true | true |
f757411b853bacb9e03fc42fa2ef6593c3cde00f | 3,583 | py | Python | python/paddle/fluid/__init__.py | ghevinn/Paddle | 544159c3de2f74a38a5795c635a2f1bda170379f | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2019-04-28T13:29:41.000Z | 2022-01-09T16:54:20.000Z | python/paddle/fluid/__init__.py | ghevinn/Paddle | 544159c3de2f74a38a5795c635a2f1bda170379f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | python/paddle/fluid/__init__.py | ghevinn/Paddle | 544159c3de2f74a38a5795c635a2f1bda170379f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-04-25T03:44:51.000Z | 2018-04-25T03:44:51.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 29.130081 | 78 | 0.715043 |
from __future__ import print_function
import framework
from framework import *
import executor
from executor import *
import io
import evaluator
import initializer
import layers
import nets
import optimizer
import backward
import regularizer
import average
import metrics
from param_attr import ParamAtt... | true | true |
f757437446e421adec36d64b88c6cc0664060a8c | 6,179 | py | Python | demo/main.py | clevermindgames/KivMob27 | 4d92d394b21962cf2ee7cae9427d96cdf5605e6a | [
"MIT"
] | null | null | null | demo/main.py | clevermindgames/KivMob27 | 4d92d394b21962cf2ee7cae9427d96cdf5605e6a | [
"MIT"
] | null | null | null | demo/main.py | clevermindgames/KivMob27 | 4d92d394b21962cf2ee7cae9427d96cdf5605e6a | [
"MIT"
] | null | null | null | from kivmob import KivMob
import kivy.utils
from kivy.app import App
from kivy.lang import Builder
from kivy.config import Config
from kivy.properties import ListProperty
from kivy.utils import platform
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout ... | 32.521053 | 73 | 0.574527 | from kivmob import KivMob
import kivy.utils
from kivy.app import App
from kivy.lang import Builder
from kivy.config import Config
from kivy.properties import ListProperty
from kivy.utils import platform
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout ... | true | true |
f757441117b1a65b44f2c07c7608a809f155273f | 577 | py | Python | src/main/python/wrappers/camera/CameraStream.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | 1 | 2017-11-08T15:20:09.000Z | 2017-11-08T15:20:09.000Z | src/main/python/wrappers/camera/CameraStream.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | null | null | null | src/main/python/wrappers/camera/CameraStream.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | null | null | null | from Camera import CameraController
import time
import cv2
class CameraStream:
def __init__(self, resolution=(320,240), framerate=32):
self.stream = CameraController()
def start(self):
return self.stream.start()
def stop(self):
return self.stream.stop()
def display(self):
end_time = time.time() + 10
... | 19.896552 | 57 | 0.710572 | from Camera import CameraController
import time
import cv2
class CameraStream:
def __init__(self, resolution=(320,240), framerate=32):
self.stream = CameraController()
def start(self):
return self.stream.start()
def stop(self):
return self.stream.stop()
def display(self):
end_time = time.time() + 10
... | true | true |
f757446d7b889ac60cf234b0b6ebcc278aefa883 | 1,668 | py | Python | pictures/migrations/0001_initial.py | FestusMutie/photo-gallery | 60e7f9fac1f0077c45b578a3e8a12aaeff6818f4 | [
"MIT"
] | null | null | null | pictures/migrations/0001_initial.py | FestusMutie/photo-gallery | 60e7f9fac1f0077c45b578a3e8a12aaeff6818f4 | [
"MIT"
] | null | null | null | pictures/migrations/0001_initial.py | FestusMutie/photo-gallery | 60e7f9fac1f0077c45b578a3e8a12aaeff6818f4 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-06 18:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 36.26087 | 117 | 0.559353 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_creat... | true | true |
f7574558dd2fd4ac691ebe55b613a9713e8d419b | 5,148 | py | Python | model.py | rishikksh20/TalkNet2-pytorch | baa6bf90c054634185932ed4b17a6ce8866feaba | [
"MIT"
] | 53 | 2021-04-19T08:00:50.000Z | 2022-03-24T02:28:23.000Z | model.py | rishikksh20/TalkNet2-pytorch | baa6bf90c054634185932ed4b17a6ce8866feaba | [
"MIT"
] | 3 | 2021-04-21T17:48:58.000Z | 2022-01-20T21:11:49.000Z | model.py | rishikksh20/TalkNet2-pytorch | baa6bf90c054634185932ed4b17a6ce8866feaba | [
"MIT"
] | 2 | 2021-11-15T15:02:18.000Z | 2022-02-01T08:00:22.000Z |
import torch.nn as nn
from torch.nn import functional as F
from utils import get_mask_from_lengths
from embedding import GaussianEmbedding
from quartznet import QuartzNet5x5, QuartzNet9x5
from module import MaskedInstanceNorm1d, StyleResidual, Postnet
class GraphemeDuration(nn.Module):
def __init__(self, idim,... | 35.260274 | 115 | 0.61014 |
import torch.nn as nn
from torch.nn import functional as F
from utils import get_mask_from_lengths
from embedding import GaussianEmbedding
from quartznet import QuartzNet5x5, QuartzNet9x5
from module import MaskedInstanceNorm1d, StyleResidual, Postnet
class GraphemeDuration(nn.Module):
def __init__(self, idim,... | true | true |
f7574566da3572fd06d533da827885b8420e3ec0 | 199,917 | py | Python | tests/hwsim/test_dpp.py | kimocoder/dragonslayer | 818d7761442cfc0dd32fbf220a750d87676d8d31 | [
"Unlicense"
] | 106 | 2019-04-11T03:18:10.000Z | 2022-02-11T10:48:47.000Z | tests/hwsim/test_dpp.py | kimocoder/dragonslayer | 818d7761442cfc0dd32fbf220a750d87676d8d31 | [
"Unlicense"
] | 2 | 2019-04-11T14:07:38.000Z | 2020-06-04T14:03:38.000Z | tests/hwsim/test_dpp.py | kimocoder/dragonslayer | 818d7761442cfc0dd32fbf220a750d87676d8d31 | [
"Unlicense"
] | 31 | 2019-04-11T05:21:41.000Z | 2021-08-10T17:55:36.000Z | # Test cases for Device Provisioning Protocol (DPP)
# Copyright (c) 2017, Qualcomm Atheros, Inc.
# Copyright (c) 2018-2019, The Linux Foundation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import base64
import binascii
import hashlib
import logging
logger = l... | 45.559936 | 1,038 | 0.675305 |
import base64
import binascii
import hashlib
import logging
logger = logging.getLogger()
import os
import struct
import subprocess
import time
import hostapd
import hwsim_utils
from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
from wpasupplicant import WpaSupplicant
try:
import OpenSSL
... | true | true |
f7574669b6820d8579f41aa08745e182422dfe97 | 16,581 | py | Python | tests/test_octodns_manager.py | patcon/octodns | ade8d54df34a93becad70239c7f1f5a2f7126020 | [
"MIT"
] | null | null | null | tests/test_octodns_manager.py | patcon/octodns | ade8d54df34a93becad70239c7f1f5a2f7126020 | [
"MIT"
] | null | null | null | tests/test_octodns_manager.py | patcon/octodns | ade8d54df34a93becad70239c7f1f5a2f7126020 | [
"MIT"
] | null | null | null | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os import environ
from os.path import dirname, join
from six import text_type
from unittest import TestCase
from octodns.record import Record
from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, ... | 40.940741 | 79 | 0.613594 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from os import environ
from os.path import dirname, join
from six import text_type
from unittest import TestCase
from octodns.record import Record
from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \
... | true | true |
f7574693e630b36cb620ec5066447ff15cfa974b | 7,144 | py | Python | sdk/python/pulumi_azure_nextgen/web/latest/web_app_domain_ownership_identifier_slot.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/web/latest/web_app_domain_ownership_identifier_slot.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/web/latest/web_app_domain_ownership_identifier_slot.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 47.946309 | 739 | 0.674132 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = ['WebAppDomainOwnershipIdentifierSlot']
warnings.warn("""The 'latest' version is deprecated. Please migrate to the resource in the top-... | true | true |
f75746a88819a06eb3a28cc45d815dd54c02ec93 | 496 | py | Python | meraki_sdk/models/type_5_enum.py | meraki/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 37 | 2019-04-24T14:01:33.000Z | 2022-01-28T01:37:21.000Z | meraki_sdk/models/type_5_enum.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 10 | 2019-07-09T16:35:11.000Z | 2021-12-07T03:47:53.000Z | meraki_sdk/models/type_5_enum.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 17 | 2019-04-30T23:53:21.000Z | 2022-02-07T22:57:44.000Z | # -*- coding: utf-8 -*-
"""
meraki_sdk
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
class Type5Enum(object):
"""Implementation of the 'Type5' enum.
One of "delete" or "restrict processing"
Attributes:
DELETE: TODO: type d... | 19.84 | 95 | 0.620968 |
class Type5Enum(object):
DELETE = 'delete'
ENUM_RESTRICT_PROCESSING = 'restrict processing'
| true | true |
f75746e9afba189e6890295fcbdf9fd790401f61 | 1,071 | py | Python | vmc/python/SGD_alphas.py | kmaasrud/vmc-fys4411 | e96e2f6b1403118ee48ad5b5ff38582310ba4d2a | [
"MIT"
] | 2 | 2021-01-23T22:44:35.000Z | 2021-06-03T00:34:43.000Z | vmc/python/SGD_alphas.py | kmaasrud/vmc-fys4411 | e96e2f6b1403118ee48ad5b5ff38582310ba4d2a | [
"MIT"
] | 47 | 2021-01-14T14:13:32.000Z | 2021-04-05T10:32:02.000Z | vmc/python/SGD_alphas.py | kmaasrud/vmc-fys4411 | e96e2f6b1403118ee48ad5b5ff38582310ba4d2a | [
"MIT"
] | null | null | null | import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as np
#location for files and plots
PLOT_DIR = "../plots/"
DATA_DIR = "../data"
FILENAME_PLOT = 'SGD_alphas'
PLOT_DIR = "./"
#figure size and resolution
fig = plt.figure()
plt.style.use("seaborn")
#colour, linewith, linestyle
#boundaries
... | 19.125 | 86 | 0.650794 | import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as np
PLOT_DIR = "../plots/"
DATA_DIR = "../data"
FILENAME_PLOT = 'SGD_alphas'
PLOT_DIR = "./"
fig = plt.figure()
plt.style.use("seaborn")
plt.ylim(0.15, 0.95)
plt.legend(loc = 'best', prop = {'size':14}, frameon = False)
plt.rc('fo... | true | true |
f757477857d753bd2a8206380aafdea94fbe01e1 | 30,453 | py | Python | cime/scripts/lib/CIME/hist_utils.py | jingxianwen/E3SM | bced6ba5e9247d6db6c8445b5fb828772a929b1b | [
"zlib-acknowledgement",
"RSA-MD",
"FTL"
] | 3 | 2020-02-24T21:58:57.000Z | 2020-09-29T23:06:45.000Z | cime/scripts/lib/CIME/hist_utils.py | jingxianwen/E3SM | bced6ba5e9247d6db6c8445b5fb828772a929b1b | [
"zlib-acknowledgement",
"RSA-MD",
"FTL"
] | 16 | 2019-09-27T02:16:37.000Z | 2020-08-01T17:51:12.000Z | cime/scripts/lib/CIME/hist_utils.py | jingxianwen/E3SM | bced6ba5e9247d6db6c8445b5fb828772a929b1b | [
"zlib-acknowledgement",
"RSA-MD",
"FTL"
] | 2 | 2020-12-09T07:30:20.000Z | 2022-03-18T04:22:25.000Z | """
Functions for actions pertaining to history files.
"""
from CIME.XML.standard_module_setup import *
from CIME.test_status import TEST_NO_BASELINES_COMMENT, TEST_STATUS_FILENAME
from CIME.utils import get_current_commit, get_timestamp, get_model, safe_copy, SharedArea, parse_test_name
import logging, os, re, filecm... | 46.210926 | 178 | 0.632483 | from CIME.XML.standard_module_setup import *
from CIME.test_status import TEST_NO_BASELINES_COMMENT, TEST_STATUS_FILENAME
from CIME.utils import get_current_commit, get_timestamp, get_model, safe_copy, SharedArea, parse_test_name
import logging, os, re, filecmp
logger = logging.getLogger(__name__)
BLESS_LOG_NAME = "b... | true | true |
f75747c1d3308cba1df8363344bb61c7bbc3939c | 11,690 | py | Python | appdaemon/apps/device_monitor.py | snjoetw/appdaemon_apps | bfc318fac142e324e730d47b008167f738dd411d | [
"MIT"
] | null | null | null | appdaemon/apps/device_monitor.py | snjoetw/appdaemon_apps | bfc318fac142e324e730d47b008167f738dd411d | [
"MIT"
] | null | null | null | appdaemon/apps/device_monitor.py | snjoetw/appdaemon_apps | bfc318fac142e324e730d47b008167f738dd411d | [
"MIT"
] | null | null | null | import re
from datetime import datetime
from enum import Enum
from typing import List
from configurable_automation import ConfigurableAutomation
from lib.actions import Action
from lib.core.component import Component
from lib.helper import to_float, to_datetime
CHECKER_RESULT_CACHE = {}
class Checker(Component):
... | 29.594937 | 98 | 0.635843 | import re
from datetime import datetime
from enum import Enum
from typing import List
from configurable_automation import ConfigurableAutomation
from lib.actions import Action
from lib.core.component import Component
from lib.helper import to_float, to_datetime
CHECKER_RESULT_CACHE = {}
class Checker(Component):
... | true | true |
f757480ae4fd1c291985e17ac7399b560c17c310 | 9,366 | py | Python | example.py | labscript-suite-temp-2-archive/fanyangphy-labscript--forked-from--labscript_suite-labscript | f708a6e709b9c8ec192c42fa0c0bfccae7c42b88 | [
"BSD-2-Clause"
] | null | null | null | example.py | labscript-suite-temp-2-archive/fanyangphy-labscript--forked-from--labscript_suite-labscript | f708a6e709b9c8ec192c42fa0c0bfccae7c42b88 | [
"BSD-2-Clause"
] | null | null | null | example.py | labscript-suite-temp-2-archive/fanyangphy-labscript--forked-from--labscript_suite-labscript | f708a6e709b9c8ec192c42fa0c0bfccae7c42b88 | [
"BSD-2-Clause"
] | null | null | null | #####################################################################
# #
# /example.py #
# #
# Copyright 2013, Monash University ... | 51.180328 | 198 | 0.721332 | tphase(t, 0.7)
# Set some values for dds2 at t=1s. They will have value '0' before this
# time unless otherwise set
dds2.setamp(t+1, 0.9)
dds2.setfreq(t+1, 1.0)
dds2.setphase(t+1, 1.1)
# dds5 is a "static" DDS. This means its value can only be set once, and
# will be set just before the experiment begins
dds5.setfreq... | true | true |
f757497c16d282569cd63012e90390d36fa1ca26 | 1,909 | py | Python | py/plot_slices.py | idies/RMHDConverter | 24ff6e5ae2767b3aac4d24e9d6f1a116ef002eba | [
"Apache-2.0"
] | null | null | null | py/plot_slices.py | idies/RMHDConverter | 24ff6e5ae2767b3aac4d24e9d6f1a116ef002eba | [
"Apache-2.0"
] | null | null | null | py/plot_slices.py | idies/RMHDConverter | 24ff6e5ae2767b3aac4d24e9d6f1a116ef002eba | [
"Apache-2.0"
] | null | null | null | ########################################################################
#
# Copyright 2015 Johns Hopkins University
#
# 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... | 30.301587 | 90 | 0.545836 | true | true | |
f7574a127871a41af9a90b30ed866fbd120b62f4 | 317 | py | Python | serpent/package.py | phr34k/serpent | b19e6475fa87bca581cb081882deaceaf55bb5d4 | [
"MIT"
] | 1 | 2016-03-22T19:06:21.000Z | 2016-03-22T19:06:21.000Z | serpent/package.py | phr34k/serpent | b19e6475fa87bca581cb081882deaceaf55bb5d4 | [
"MIT"
] | null | null | null | serpent/package.py | phr34k/serpent | b19e6475fa87bca581cb081882deaceaf55bb5d4 | [
"MIT"
] | null | null | null | import binascii
print("#include <string>");
print("unsigned char rawData[] = {");
with open('serpent.py', 'rb') as f:
for chunk in iter(lambda: f.read(1), b''):
print("0x" + str(binascii.hexlify(chunk),'ascii') + ",");
print("};");
print("std::string data((char*)&rawData[0], sizeof(rawData));"); | 35.222222 | 66 | 0.59306 | import binascii
print("#include <string>");
print("unsigned char rawData[] = {");
with open('serpent.py', 'rb') as f:
for chunk in iter(lambda: f.read(1), b''):
print("0x" + str(binascii.hexlify(chunk),'ascii') + ",");
print("};");
print("std::string data((char*)&rawData[0], sizeof(rawData));"); | true | true |
f7574b276e84a64b9805b1d94aa1160ba7e20840 | 15,670 | py | Python | ocs_ci/cleanup/aws/cleanup.py | agarwal-mudit/ocs-ci | a27583a4aa6283850e1a5678e684701fd932ccda | [
"MIT"
] | null | null | null | ocs_ci/cleanup/aws/cleanup.py | agarwal-mudit/ocs-ci | a27583a4aa6283850e1a5678e684701fd932ccda | [
"MIT"
] | null | null | null | ocs_ci/cleanup/aws/cleanup.py | agarwal-mudit/ocs-ci | a27583a4aa6283850e1a5678e684701fd932ccda | [
"MIT"
] | 1 | 2020-07-28T07:32:09.000Z | 2020-07-28T07:32:09.000Z | import tempfile
import argparse
import logging
import datetime
import threading
import os
import re
from botocore.exceptions import ClientError
from ocs_ci.framework import config
from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR
from ocs_ci.ocs.exceptions import CommandFailed
from ocs_ci.utility.u... | 35.213483 | 105 | 0.604084 | import tempfile
import argparse
import logging
import datetime
import threading
import os
import re
from botocore.exceptions import ClientError
from ocs_ci.framework import config
from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR
from ocs_ci.ocs.exceptions import CommandFailed
from ocs_ci.utility.u... | true | true |
f7574b824f2e74680e87050cf8ce276607f96678 | 1,766 | py | Python | trainer/dataset.py | jessica-dl/2XB3-ML-Training | aa82d64c7b8b35eb79060a7bd7d22d09323b1c06 | [
"MIT"
] | null | null | null | trainer/dataset.py | jessica-dl/2XB3-ML-Training | aa82d64c7b8b35eb79060a7bd7d22d09323b1c06 | [
"MIT"
] | null | null | null | trainer/dataset.py | jessica-dl/2XB3-ML-Training | aa82d64c7b8b35eb79060a7bd7d22d09323b1c06 | [
"MIT"
] | null | null | null | from tensorflow.python.lib.io import file_io
import h5py
import numpy as np
class Dataset:
def __init__(self, path, local):
"""
Initialize the dataset
:param path: Path to the hdf5 dataset file
:param local: True if the path is to a local file, False otherwise
"""
... | 27.169231 | 82 | 0.511891 | from tensorflow.python.lib.io import file_io
import h5py
import numpy as np
class Dataset:
def __init__(self, path, local):
self.path = path
self.local = local
if not local:
with file_io.FileIO(path, mode='rb') as dataset_f:
with open('dataset.h5', 'wb') as lo... | true | true |
f7574d91b66fa57cbd33d7c1cd898389edb971b5 | 4,062 | py | Python | python/tests/test_ambassador_module_validation.py | Ashokm96/ambassador | f368059b34f682107facff1f0e6bcdf001b5197d | [
"Apache-2.0"
] | null | null | null | python/tests/test_ambassador_module_validation.py | Ashokm96/ambassador | f368059b34f682107facff1f0e6bcdf001b5197d | [
"Apache-2.0"
] | 1 | 2021-03-04T10:33:23.000Z | 2021-05-03T12:27:51.000Z | python/tests/test_ambassador_module_validation.py | Ashokm96/ambassador | f368059b34f682107facff1f0e6bcdf001b5197d | [
"Apache-2.0"
] | 1 | 2021-12-13T08:40:18.000Z | 2021-12-13T08:40:18.000Z | from typing import List, Tuple
import logging
import pytest
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s test %(levelname)s: %(message)s",
datefmt='%Y-%m-%d %H:%M:%S'
)
logger = logging.getLogger("ambassador")
from ambassador import Cache, IR
from ambassador.compile import Compile
def ... | 26.900662 | 208 | 0.6871 | from typing import List, Tuple
import logging
import pytest
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s test %(levelname)s: %(message)s",
datefmt='%Y-%m-%d %H:%M:%S'
)
logger = logging.getLogger("ambassador")
from ambassador import Cache, IR
from ambassador.compile import Compile
def ... | true | true |
f7574e750bc07746a6cce995f0c41a9c5ad80745 | 4,337 | py | Python | tests/hikari/test_embeds.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | 8 | 2020-08-15T09:14:39.000Z | 2020-09-03T22:39:35.000Z | tests/hikari/test_embeds.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | 228 | 2020-08-16T15:52:42.000Z | 2020-10-11T09:45:40.000Z | tests/hikari/test_embeds.py | 81CuongVn/hikaki | 5e4ccffaccf411ea5c13fd64264cadda72d197fb | [
"MIT"
] | 9 | 2020-08-15T09:29:24.000Z | 2020-09-30T11:59:33.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... | 39.072072 | 111 | 0.73092 |
import mock
import pytest
from hikari import embeds
class TestEmbedResource:
@pytest.fixture()
def resource(self):
return embeds.EmbedResource(resource=mock.Mock())
def test_url(self, resource):
assert resource.url is resource.resource.url
def test_filename(self... | true | true |
f757501183e3b196e6ea398903434857dba07fb5 | 2,046 | py | Python | fasttest_selenium/runner/test_case.py | zym27187/fasttest_selenium | 607160eada1826401dfc79daf767179f92f93ba3 | [
"MIT"
] | 1 | 2021-02-13T10:56:51.000Z | 2021-02-13T10:56:51.000Z | fasttest_selenium/runner/test_case.py | zym27187/fasttest_selenium | 607160eada1826401dfc79daf767179f92f93ba3 | [
"MIT"
] | null | null | null | fasttest_selenium/runner/test_case.py | zym27187/fasttest_selenium | 607160eada1826401dfc79daf767179f92f93ba3 | [
"MIT"
] | 1 | 2021-02-13T10:56:46.000Z | 2021-02-13T10:56:46.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import unittest
import traceback
from fasttest_selenium.common import *
class TestCase(unittest.TestCase):
def __getattr__(self, item):
try:
return self.__getattribute__(item)
except:
attrvalue = None
... | 40.92 | 140 | 0.542522 |
import os
import re
import unittest
import traceback
from fasttest_selenium.common import *
class TestCase(unittest.TestCase):
def __getattr__(self, item):
try:
return self.__getattribute__(item)
except:
attrvalue = None
self.__setattr__(item, attrvalue)
... | true | true |
f75750161d286a62f8000c5d915a870879e0afa0 | 2,060 | py | Python | Solutions/Q0005_Smallest_Evenly_Divisible_Number.py | SigfriedHache/euler-project | 7c38deee65a793a441830a6d0916da61e86b8cf7 | [
"Apache-2.0"
] | null | null | null | Solutions/Q0005_Smallest_Evenly_Divisible_Number.py | SigfriedHache/euler-project | 7c38deee65a793a441830a6d0916da61e86b8cf7 | [
"Apache-2.0"
] | null | null | null | Solutions/Q0005_Smallest_Evenly_Divisible_Number.py | SigfriedHache/euler-project | 7c38deee65a793a441830a6d0916da61e86b8cf7 | [
"Apache-2.0"
] | null | null | null | """
https://projecteuler.net/problem=5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
"""
from numpy import prod
from Common.Logger import get_logger, init_logg... | 37.454545 | 120 | 0.737864 | from numpy import prod
from Common.Logger import get_logger, init_logger
from Common.Numbers import prime_factorization
from Common.Utilities import performance_run
PERFORMANCE_RUNS = 100_000
UPPER_BOUND = 20
def fastest(ceiling: int = UPPER_BOUND) -> int:
return prime_tally(ceiling)
def prime_tally(ceiling: ... | true | true |
f757503fbd3021164a9441bb77e883165d80e053 | 647 | py | Python | projects/graph/util.py | Nolanole/Graphs | fedfb61d81794c5a0e10e59ae67f447947c8d43c | [
"MIT"
] | null | null | null | projects/graph/util.py | Nolanole/Graphs | fedfb61d81794c5a0e10e59ae67f447947c8d43c | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/06_graphs/sprint_challenge/util.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null |
# Note: This Queue class is sub-optimal. Why?
class Queue():
def __init__(self):
self.queue = []
def enqueue(self, value):
self.queue.append(value)
def dequeue(self):
if self.size() > 0:
return self.queue.pop(0)
else:
return None
def size(self):
... | 22.310345 | 45 | 0.53323 |
class Queue():
def __init__(self):
self.queue = []
def enqueue(self, value):
self.queue.append(value)
def dequeue(self):
if self.size() > 0:
return self.queue.pop(0)
else:
return None
def size(self):
return len(self.queue)
class Stack():... | true | true |
f757509944dd5d08594b54482eca702d1c59c898 | 4,759 | py | Python | sortingview/helpers/prepare_snippets_h5_old.py | garrettmflynn/sortingview | 0bb3df40d5d031ec651c4821f928787bbee71fbb | [
"Apache-2.0"
] | 2 | 2021-11-19T04:51:42.000Z | 2022-03-12T23:36:19.000Z | sortingview/helpers/prepare_snippets_h5_old.py | magland/sortingview | 0b1be9d55048cd4b8a0b6b6733bd7d35cb440aa7 | [
"Apache-2.0"
] | 172 | 2021-05-10T17:39:15.000Z | 2022-03-18T21:46:15.000Z | sortingview/helpers/prepare_snippets_h5_old.py | garrettmflynn/sortingview | 0bb3df40d5d031ec651c4821f928787bbee71fbb | [
"Apache-2.0"
] | 2 | 2021-08-29T20:13:57.000Z | 2022-03-12T23:36:34.000Z | from typing import Dict, Union
import os
import hither2 as hi
import kachery_client as kc
import numpy as np
import spikeextractors as se
from sortingview.extractors import LabboxEphysSortingExtractor, LabboxEphysRecordingExtractor
from .SubsampledSortingExtractor import SubsampledSortingExtractor
from .find_unit_peak... | 43.66055 | 161 | 0.73713 | from typing import Dict, Union
import os
import hither2 as hi
import kachery_client as kc
import numpy as np
import spikeextractors as se
from sortingview.extractors import LabboxEphysSortingExtractor, LabboxEphysRecordingExtractor
from .SubsampledSortingExtractor import SubsampledSortingExtractor
from .find_unit_peak... | true | true |
f75750b3348d7b3f4e6929e0e6ca136fb2a8cdcc | 2,237 | py | Python | tests/test_session.py | KOLANICH-tools/https-everywhere-py | b25084a2edd875689e4da8876cde611dc7f61a7c | [
"Apache-2.0"
] | 7 | 2020-02-26T00:40:44.000Z | 2022-02-11T01:24:55.000Z | tests/test_session.py | KOLANICH-tools/https-everywhere-py | b25084a2edd875689e4da8876cde611dc7f61a7c | [
"Apache-2.0"
] | 39 | 2020-02-25T18:04:22.000Z | 2021-04-06T09:57:57.000Z | tests/test_session.py | KOLANICH-tools/https-everywhere-py | b25084a2edd875689e4da8876cde611dc7f61a7c | [
"Apache-2.0"
] | 3 | 2021-04-06T09:50:42.000Z | 2021-12-11T22:51:27.000Z | from __future__ import unicode_literals
import unittest
from https_everywhere.session import HTTPSEverywhereSession
class TestRequestsSession(unittest.TestCase):
def test_freerangekitten_com(self):
url = "http://freerangekitten.com/"
s = HTTPSEverywhereSession()
r = s.get(url)
r.... | 36.672131 | 80 | 0.637014 | from __future__ import unicode_literals
import unittest
from https_everywhere.session import HTTPSEverywhereSession
class TestRequestsSession(unittest.TestCase):
def test_freerangekitten_com(self):
url = "http://freerangekitten.com/"
s = HTTPSEverywhereSession()
r = s.get(url)
r.... | true | true |
f75753da28d44c0037e864cd7566388422d547c2 | 6,321 | py | Python | tools/ports/cocos2d.py | mehdisadeghi/emscripten | a3e96c3bd4751632de6e9d1d57172ac9429fcb2d | [
"MIT"
] | 32 | 2021-05-03T09:03:57.000Z | 2022-03-17T09:18:59.000Z | tools/ports/cocos2d.py | mehdisadeghi/emscripten | a3e96c3bd4751632de6e9d1d57172ac9429fcb2d | [
"MIT"
] | 4 | 2021-05-29T20:42:52.000Z | 2022-03-16T03:01:12.000Z | tools/ports/cocos2d.py | mehdisadeghi/emscripten | a3e96c3bd4751632de6e9d1d57172ac9429fcb2d | [
"MIT"
] | 1 | 2021-12-01T18:33:25.000Z | 2021-12-01T18:33:25.000Z | # Copyright 2017 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os
import shutil
import logging
import re
TAG = 'version_3_3'... | 39.50625 | 137 | 0.639614 |
import os
import shutil
import logging
import re
TAG = 'version_3_3'
HASH = 'd7b22660036c684f09754fcbbc7562984f02aa955eef2b76555270c63a717e6672c4fe695afb16280822e8b7c75d4b99ae21975a01a4ed51cad957f7783722cd'
deps = ['libpng', 'zlib']
def needed(settings):
return settings.USE_COCOS2D == 3
def get(ports, sett... | true | true |
f75754cadeeb00213f22b2fdc1a61ebcb5b4c185 | 573 | py | Python | fib.py | gabrieldocs/data-structures-python | 5ac4ada715730529b575775ebf37eceeb0a5449a | [
"Apache-2.0"
] | null | null | null | fib.py | gabrieldocs/data-structures-python | 5ac4ada715730529b575775ebf37eceeb0a5449a | [
"Apache-2.0"
] | 3 | 2021-04-11T19:38:01.000Z | 2021-09-23T19:16:43.000Z | fib.py | gabrieldocs/data-structures-python | 5ac4ada715730529b575775ebf37eceeb0a5449a | [
"Apache-2.0"
] | null | null | null | # Testando as funções com otimização para as chamadas recursivas
# Realizei uma pequena mudança na estrutura do projeto, adicionando as funções de fibonacci para o formato de módulo
from functions.fib_cache import fib_cache
from functions.fib_memo import fib_memo
if __name__ == "__main__":
print("# Fibonacci ... | 35.8125 | 117 | 0.69808 |
from functions.fib_cache import fib_cache
from functions.fib_memo import fib_memo
if __name__ == "__main__":
print("# Fibonacci using cache")
print(fib_cache(4))
print(fib_cache(8))
print(fib_cache(20))
print(fib_cache(49))
print("# Fibonacci using memoizations")
print(... | true | true |
f757552e01816e29353f4382a9416167b8155912 | 13,382 | py | Python | scrapy/crawler.py | ZhiShiMao/scrapy | 04dd29257a81be0b1291db61dd880ef3dd96127d | [
"BSD-3-Clause"
] | null | null | null | scrapy/crawler.py | ZhiShiMao/scrapy | 04dd29257a81be0b1291db61dd880ef3dd96127d | [
"BSD-3-Clause"
] | null | null | null | scrapy/crawler.py | ZhiShiMao/scrapy | 04dd29257a81be0b1291db61dd880ef3dd96127d | [
"BSD-3-Clause"
] | null | null | null | import logging
import pprint
import signal
import warnings
from twisted.internet import defer
from zope.interface.exceptions import DoesNotImplement
try:
# zope >= 5.0 only supports MultipleInvalid
from zope.interface.exceptions import MultipleInvalid
except ImportError:
MultipleInvalid = None
from zope.... | 36.966851 | 88 | 0.667688 | import logging
import pprint
import signal
import warnings
from twisted.internet import defer
from zope.interface.exceptions import DoesNotImplement
try:
from zope.interface.exceptions import MultipleInvalid
except ImportError:
MultipleInvalid = None
from zope.interface.verify import verifyClass
from s... | true | true |
f75755498bf70a5337b510d17a0b3d3dc45238f3 | 6,773 | py | Python | fusion_mujoco_py/export.py | bjnortier/fusion-mujoco-py | 5df0a0acc72f91a669ee7c7d4d98c5e426b11d56 | [
"MIT"
] | null | null | null | fusion_mujoco_py/export.py | bjnortier/fusion-mujoco-py | 5df0a0acc72f91a669ee7c7d4d98c5e426b11d56 | [
"MIT"
] | null | null | null | fusion_mujoco_py/export.py | bjnortier/fusion-mujoco-py | 5df0a0acc72f91a669ee7c7d4d98c5e426b11d56 | [
"MIT"
] | 1 | 2021-06-29T02:22:49.000Z | 2021-06-29T02:22:49.000Z | # -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import os.path
import xml.dom.minidom
import re
XML_TEMPLATE = """<?xml version="1.0" ?>
<mujoco>
<compiler angle="radian" coordinate="local" inertiafromgeom="true" settotalmass="14"/>
<default>
<joint armature=".1" damping=".01" limited="true" solimpl... | 43.696774 | 163 | 0.627934 |
import xml.etree.ElementTree as ET
import os.path
import xml.dom.minidom
import re
XML_TEMPLATE = """<?xml version="1.0" ?>
<mujoco>
<compiler angle="radian" coordinate="local" inertiafromgeom="true" settotalmass="14"/>
<default>
<joint armature=".1" damping=".01" limited="true" solimplimit="0 .8 .03" solrefl... | true | true |
f757561a83f5298ba3adadc0e5c83a0e67aefad5 | 5,070 | py | Python | models/preresnet.py | YimiaoSun/network-slimming | 8ab3e6932fc3febd893faf83e23bee1aeb28be13 | [
"MIT"
] | null | null | null | models/preresnet.py | YimiaoSun/network-slimming | 8ab3e6932fc3febd893faf83e23bee1aeb28be13 | [
"MIT"
] | null | null | null | models/preresnet.py | YimiaoSun/network-slimming | 8ab3e6932fc3febd893faf83e23bee1aeb28be13 | [
"MIT"
] | null | null | null | # 本resnet结构选自:https://arxiv.org/pdf/1603.05027.pdf
# 是原作者在resnet上的更新版本(实际用的没有原始版本广,认可度有质疑)
from __future__ import absolute_import
import math
import torch.nn as nn
from .channel_selection import channel_selection
__all__ = ['resnet']
"""
preactivation resnet with bottleneck design.
"""
class Bottleneck(nn.Module):... | 34.965517 | 130 | 0.569625 |
from __future__ import absolute_import
import math
import torch.nn as nn
from .channel_selection import channel_selection
__all__ = ['resnet']
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, cfg, stride=1, downsample=None):
super(Bottleneck, self).__... | true | true |
f75756daa5a05c95293c94734c303dfc3b414775 | 6,694 | py | Python | PyProj10_main.py | dknight2/Python | 3054e12f2a497d8c5501cd1d86864d5c55a51ded | [
"MIT"
] | null | null | null | PyProj10_main.py | dknight2/Python | 3054e12f2a497d8c5501cd1d86864d5c55a51ded | [
"MIT"
] | null | null | null | PyProj10_main.py | dknight2/Python | 3054e12f2a497d8c5501cd1d86864d5c55a51ded | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The purpose of this script is to launch a GUI that prompts the user to select
either an option to APPEND or SPLIT a database. The user will then be prompted
with what inputs and outputs they desire. No data has been provided for this script,
but the user can still run this script to se... | 45.22973 | 177 | 0.603376 |
import arcpy
import os, sys
import PyProj10_gui
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox
def runTool():
activeTab = ui.tabWidget.currentWidget()
tabHandler[activeTab]()
def selectAppendTo(self):
global appendTo
appendTo = QFileDialog.getExist... | true | true |
f75757888cf2b8bae4822e3dda03faeb735f8fc4 | 2,204 | py | Python | configs/lane_detection/scnn/resnet50_tusimple.py | voldemortX/DeeplabV3_PyTorch1.3_Codebase | d22d23e74800fafb58eeb61d6649008745c1a287 | [
"BSD-3-Clause"
] | 1 | 2020-09-17T06:21:39.000Z | 2020-09-17T06:21:39.000Z | configs/lane_detection/scnn/resnet50_tusimple.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | configs/lane_detection/scnn/resnet50_tusimple.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.tusimple_seg import dataset
from configs.lane_detection.common.datasets.train_level0_360 import train_augmentation
from configs.lane_detection.common.datasets.test_360 import test_a... | 25.627907 | 90 | 0.673775 | from importmagician import import_from
with import_from('./'):
from configs.lane_detection.common.datasets.tusimple_seg import dataset
from configs.lane_detection.common.datasets.train_level0_360 import train_augmentation
from configs.lane_detection.common.datasets.test_360 import test_augmentation
... | true | true |
f75758488b41bb35d6f4648d866924906035af77 | 5,807 | py | Python | connector/fixups/probe_bluestacks_hyperv.py | kooWZ/ArknightsAutoHelper | 4ccde7e4661b727c20e2df20a2213746a32b1a40 | [
"MIT"
] | 2 | 2021-04-12T05:50:05.000Z | 2021-04-12T05:50:47.000Z | connector/fixups/probe_bluestacks_hyperv.py | Ketven/ArknightsAutoHelper | 0d528b515877ce3b8322d3f9293e5971681d52ba | [
"MIT"
] | null | null | null | connector/fixups/probe_bluestacks_hyperv.py | Ketven/ArknightsAutoHelper | 0d528b515877ce3b8322d3f9293e5971681d52ba | [
"MIT"
] | null | null | null | import contextlib
import ctypes
from rotypes.types import GUID, REFGUID, check_hresult
import json
# import pprint
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logger.addHandler(logging.StreamHandler(__import__('sys').stderr))
logger.setLevel(logging.DEBUG)
try:... | 45.724409 | 144 | 0.687963 | import contextlib
import ctypes
from rotypes.types import GUID, REFGUID, check_hresult
import json
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logger.addHandler(logging.StreamHandler(__import__('sys').stderr))
logger.setLevel(logging.DEBUG)
try:
HCS_SYSTEM... | true | true |
f757598fe8fa114b4193f16a2a1b26ed6b5bf22c | 3,578 | py | Python | lib/surface/ai_platform/models/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/ai_platform/models/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/ai_platform/models/create.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 37.663158 | 80 | 0.71716 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.ml_engine import models
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.ml_engine import flag... | true | true |
f7575a56dde0eee34dc5d84ed1be592842d8e174 | 2,135 | py | Python | examples/baselines/rl_discrete/helpers.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | examples/baselines/rl_discrete/helpers.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | examples/baselines/rl_discrete/helpers.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 32.348485 | 76 | 0.740047 |
import functools
from acme import specs
from acme import wrappers
from acme.jax import networks
from acme.jax import utils
import dm_env
import gym
import haiku as hk
def make_atari_environment(
level: str = 'Pong',
sticky_actions: bool = True,
zero_discount_on_life_loss: bool = False) -> ... | true | true |
f7575ae367b8e9b729a7ae27d055c0ff406abe8e | 1,979 | py | Python | python-threatexchange/threatexchange/fetcher/apis/static_sample.py | dxdc/ThreatExchange | f9aff6dd0c90e6c47ffe4151bced4de1676d84f6 | [
"BSD-3-Clause"
] | 1 | 2022-02-08T01:32:58.000Z | 2022-02-08T01:32:58.000Z | python-threatexchange/threatexchange/fetcher/apis/static_sample.py | Samyakk123/ThreatExchange | 447b5e9738aff5d1cc895f6208a0d3bc15a14ebc | [
"BSD-3-Clause"
] | null | null | null | python-threatexchange/threatexchange/fetcher/apis/static_sample.py | Samyakk123/ThreatExchange | 447b5e9738aff5d1cc895f6208a0d3bc15a14ebc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
The fetcher is the component that talks to external APIs to get and put signals
@see SignalExchangeAPI
"""
import typing as t
from threatexchange.signal_type.pdq import PdqSignal
from threatexchange.signal_type.pdq_ocr import PdqOcrSignal
f... | 29.984848 | 86 | 0.734715 |
import typing as t
from threatexchange.signal_type.pdq import PdqSignal
from threatexchange.signal_type.pdq_ocr import PdqOcrSignal
from threatexchange.signal_type.md5 import VideoMD5Signal
from threatexchange.signal_type.raw_text import RawTextSignal
from threatexchange.signal_type.signal_base import SignalType
f... | true | true |
f7575b26f8d8c9b9ee566a8e14b492ca1e602018 | 4,672 | py | Python | scripts/unification/can_i_move_out.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/unification/can_i_move_out.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/unification/can_i_move_out.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import subprocess
import sys
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
FUCHSIA_ROOT = os.pa... | 32 | 78 | 0.5625 |
import argparse
import os
import subprocess
import sys
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
FUCHSIA_ROOT = os.path.dirname(
os.path.dirname(
SCRIPT_DIR))
class Finder(object):
def __init__(self, gn_binary, zircon_dir, build_dir):
self._zir... | true | true |
f7575bbe28e20ba73f97efc68353c5a8dba48ffe | 52,003 | bzl | Python | third_party/toolchains/preconfig/ubuntu14.04/gcc-nvcc-cuda10.0/cc_toolchain_config.bzl | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | third_party/toolchains/preconfig/ubuntu14.04/gcc-nvcc-cuda10.0/cc_toolchain_config.bzl | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | third_party/toolchains/preconfig/ubuntu14.04/gcc-nvcc-cuda10.0/cc_toolchain_config.bzl | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | """cc_toolchain_config rule for configuring CUDA toolchains on Linux, Mac, and Windows."""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"tool",
"tool_path",
"variable... | 34.995289 | 106 | 0.482318 |
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"tool",
"tool_path",
"variable_with_value",
)
load(
"@bazel_tools//tools/build_defs/cc:action_names.bzl",
"ASSEMB... | true | true |
f7575bd94fddb51c40faad1830b7cf92b7683827 | 10,972 | py | Python | src/datamigration/azext_datamigration/manual/custom.py | Caoxuyang/azure-cli-extensions | d2011261f29033cb31a1064256727d87049ab423 | [
"MIT"
] | null | null | null | src/datamigration/azext_datamigration/manual/custom.py | Caoxuyang/azure-cli-extensions | d2011261f29033cb31a1064256727d87049ab423 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/datamigration/azext_datamigration/manual/custom.py | Caoxuyang/azure-cli-extensions | d2011261f29033cb31a1064256727d87049ab423 | [
"MIT"
] | 1 | 2022-02-14T21:43:29.000Z | 2022-02-14T21:43:29.000Z | # --------------------------------------------------------------------------
# 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 cause incor... | 46.491525 | 208 | 0.545024 |
import os
import signal
import subprocess
from azure.cli.core.azclierror import MutuallyExclusiveArgumentError
from azure.cli.core.azclierror import RequiredArgumentMissingError
from azure.cli.core.azclierror import UnclassifiedUserFault
from azext_datamigration.manual import helper
def datamigration_... | true | true |
f7575c788756d97bd8f3c7a75876c6bff1237851 | 343 | py | Python | botoless/__init__.py | beaucronin/botoless | 29fc63c3aac799c4f392b90b352d9e50f18748ba | [
"MIT"
] | null | null | null | botoless/__init__.py | beaucronin/botoless | 29fc63c3aac799c4f392b90b352d9e50f18748ba | [
"MIT"
] | null | null | null | botoless/__init__.py | beaucronin/botoless | 29fc63c3aac799c4f392b90b352d9e50f18748ba | [
"MIT"
] | null | null | null |
from .core import resource, client
from .util import full_name
from .sqs import (
get_queue as sqs_get_queue
)
from .s3 import (
get_bucket as s3_get_bucket,
get_object as s3_get_object,
put_object as s3_put_object
)
from .dynamodb import (
put_item as dynamodb_put_item,
increment_field as dyna... | 21.4375 | 47 | 0.760933 |
from .core import resource, client
from .util import full_name
from .sqs import (
get_queue as sqs_get_queue
)
from .s3 import (
get_bucket as s3_get_bucket,
get_object as s3_get_object,
put_object as s3_put_object
)
from .dynamodb import (
put_item as dynamodb_put_item,
increment_field as dyna... | true | true |
f7575cd4abeaf7b6f4feaf0e229126ba2a2ab585 | 1,132 | py | Python | context_managers.py | Stihotvor/python3_magic_method_examples | a23940833480eb08f25452062717a7ef9fe39911 | [
"MIT"
] | null | null | null | context_managers.py | Stihotvor/python3_magic_method_examples | a23940833480eb08f25452062717a7ef9fe39911 | [
"MIT"
] | null | null | null | context_managers.py | Stihotvor/python3_magic_method_examples | a23940833480eb08f25452062717a7ef9fe39911 | [
"MIT"
] | null | null | null | class Vessel:
def __init__(self, name: str):
"""
Initializing class instance with vessel name
:param name:
"""
self.name = name
self.fuel = 0.0
# list of dicts with passenger attributes
self.passengers = []
def __enter__(self):
"""
... | 24.085106 | 116 | 0.578622 | class Vessel:
def __init__(self, name: str):
self.name = name
self.fuel = 0.0
self.passengers = []
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
pass
def pump_in_fuel(self, quantity: float):
self.fuel += ... | true | true |
f7575d591b3304fc14ca1b2d86b279640a95ab41 | 42,953 | py | Python | ibis/expr/tests/test_value_exprs.py | amroid/ibis | e156a05e0069d0c9763539874c4064973c320063 | [
"Apache-2.0"
] | null | null | null | ibis/expr/tests/test_value_exprs.py | amroid/ibis | e156a05e0069d0c9763539874c4064973c320063 | [
"Apache-2.0"
] | 1 | 2019-08-30T16:10:24.000Z | 2019-08-30T17:51:01.000Z | ibis/expr/tests/test_value_exprs.py | costrouc/ibis | 9df27958f305a901728b540200bd8fa2820d4625 | [
"Apache-2.0"
] | null | null | null | import functools
import operator
import os
from collections import OrderedDict
from datetime import date, datetime, time
from operator import methodcaller
import numpy as np
import pandas as pd
import pytest
import toolz
import ibis
import ibis.common.exceptions as com
import ibis.expr.analysis as L
import ibis.expr.... | 27.289072 | 79 | 0.60962 | import functools
import operator
import os
from collections import OrderedDict
from datetime import date, datetime, time
from operator import methodcaller
import numpy as np
import pandas as pd
import pytest
import toolz
import ibis
import ibis.common.exceptions as com
import ibis.expr.analysis as L
import ibis.expr.... | true | true |
f7575d95889fb58b2e8b450528f6fe3e21b3de3f | 1,563 | py | Python | Task1/module/classifier.py | KKowalewski24/ADZ | 8a04570a1f6f08506572386b2312a259a8308f56 | [
"MIT"
] | null | null | null | Task1/module/classifier.py | KKowalewski24/ADZ | 8a04570a1f6f08506572386b2312a259a8308f56 | [
"MIT"
] | null | null | null | Task1/module/classifier.py | KKowalewski24/ADZ | 8a04570a1f6f08506572386b2312a259a8308f56 | [
"MIT"
] | null | null | null | from typing import List, Tuple
from skmultiflow.data import FileStream
from skmultiflow.drift_detection.base_drift_detector import BaseDriftDetector
from skmultiflow.lazy import KNNClassifier
from tqdm import tqdm
def classify(
detector: BaseDriftDetector, dataset: FileStream, window_size: int
) -> Tuple[Lis... | 33.255319 | 89 | 0.641075 | from typing import List, Tuple
from skmultiflow.data import FileStream
from skmultiflow.drift_detection.base_drift_detector import BaseDriftDetector
from skmultiflow.lazy import KNNClassifier
from tqdm import tqdm
def classify(
detector: BaseDriftDetector, dataset: FileStream, window_size: int
) -> Tuple[Lis... | true | true |
f757606c2f660f7cc0fd142ce5bb9fdf1b23e8e7 | 13,570 | py | Python | code/generator/Model_new.py | NamiKaze7/FinQA | cf61ae2611ae205b62574e2b4264cb0318dd7202 | [
"MIT"
] | 69 | 2021-05-13T22:36:26.000Z | 2022-03-29T11:02:07.000Z | code/generator/Model_new.py | NamiKaze7/FinQA | cf61ae2611ae205b62574e2b4264cb0318dd7202 | [
"MIT"
] | 1 | 2022-02-15T03:07:08.000Z | 2022-02-15T03:07:08.000Z | code/generator/Model_new.py | NamiKaze7/FinQA | cf61ae2611ae205b62574e2b4264cb0318dd7202 | [
"MIT"
] | 3 | 2021-09-08T03:05:21.000Z | 2021-11-15T03:10:38.000Z | import torch
from torch import nn
import torch.optim as optim
import torch.nn.functional as F
import math
import numpy as np
from config import parameters as conf
if conf.pretrained_model == "bert":
from transformers import BertModel
elif conf.pretrained_model == "roberta":
from transformers import RobertaMode... | 42.012384 | 119 | 0.624024 | import torch
from torch import nn
import torch.optim as optim
import torch.nn.functional as F
import math
import numpy as np
from config import parameters as conf
if conf.pretrained_model == "bert":
from transformers import BertModel
elif conf.pretrained_model == "roberta":
from transformers import RobertaMode... | true | true |
f757615000ce327046ccbf239a27a106cdf6b0d2 | 2,096 | py | Python | encryption/src/pkcs1_c/exceptions.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2016-10-30T09:51:06.000Z | 2016-10-30T09:51:06.000Z | encryption/src/pkcs1_c/exceptions.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2015-12-29T18:51:07.000Z | 2015-12-29T18:51:07.000Z | encryption/src/pkcs1_c/exceptions.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2018-01-26T12:54:13.000Z | 2018-01-26T12:54:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Colony Framework
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Colony Framework.
#
# Hive Colony Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | 27.946667 | 80 | 0.65458 |
__author__ = "João Magalhães <joamag@hive.pt>"
__version__ = "1.0.0"
__revision__ = "$LastChangedRevision$"
__date__ = "$LastChangedDate$"
__copyright__ = "Copyright (c) 2008-2020 Hive Solutions Lda."
__license__ = "Apache License, Version 2.0"
import colony
class PKCS1Except... | true | true |
f75762765570ec5d69d369ffd0448170d4ee0092 | 2,910 | py | Python | tests/integration/api/v2010/account/available_phone_number/test_machine_to_machine.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | tests/integration/api/v2010/account/available_phone_number/test_machine_to_machine.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | tests/integration/api/v2010/account/available_phone_number/test_machine_to_machine.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class MachineToMachineTestCase(... | 35.060241 | 139 | 0.489347 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class MachineToMachineTestCase(IntegrationTestCase):
def test_list_request(self):
self.holodeck.mock(Response(500, ''))
with sel... | true | true |
f7576299c5cb220dd414ef593b2311930d25e152 | 3,939 | py | Python | model_inception_v2_67class.py | anishvaidya/MIT-Indoor-Scene-Recognition | 04b2c35b25996d420c6fe90c480b86635f3baffd | [
"MIT"
] | 4 | 2019-10-30T01:44:04.000Z | 2020-07-09T15:28:37.000Z | model_inception_v2_67class.py | anishvaidya/MIT-Indoor-Scene-Recognition | 04b2c35b25996d420c6fe90c480b86635f3baffd | [
"MIT"
] | 1 | 2020-08-04T08:33:22.000Z | 2020-08-04T08:33:22.000Z | model_inception_v2_67class.py | anishvaidya/MIT-Indoor-Scene-Recognition | 04b2c35b25996d420c6fe90c480b86635f3baffd | [
"MIT"
] | 1 | 2019-10-30T02:06:13.000Z | 2019-10-30T02:06:13.000Z | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import imageio
import skimage
import skimage.io
import skimage.transform
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.lay... | 32.825 | 204 | 0.761361 |
import numpy as np
import pandas as pd
import imageio
import skimage
import skimage.io
import skimage.transform
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.layers import Dropout
from... | true | true |
f75762b924521525f4021f3b763ca69aadc65607 | 178 | py | Python | src/Python/01_Interakcja_z_konsola/Zad1.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | 3 | 2020-09-19T21:38:30.000Z | 2022-03-30T11:02:26.000Z | src/Python/01_Interakcja_z_konsola/Zad1.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | null | null | null | src/Python/01_Interakcja_z_konsola/Zad1.py | djeada/Nauka-programowania | b1eb6840c15b830acf552f0a0fc5cc692759152f | [
"MIT"
] | 1 | 2022-02-04T09:13:20.000Z | 2022-02-04T09:13:20.000Z | if __name__ == "__main__":
"""
Wypisz na konsole swoje inicjaly.
"""
print("A.D.")
"""
Wypisz na konsole "witaj swiecie"
"""
print("Witaj swiecie")
| 12.714286 | 37 | 0.544944 | if __name__ == "__main__":
print("A.D.")
print("Witaj swiecie")
| true | true |
f75763117fc9b7e39b63662a1e2293e166bb5cff | 8,324 | py | Python | pyleecan/Classes/OptiSolver.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | 2 | 2019-06-08T15:04:39.000Z | 2020-09-07T13:32:22.000Z | pyleecan/Classes/OptiSolver.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/OptiSolver.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Optimization/OptiSolver.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Optimization/OptiSolver
"""
from os import linesep
from logging import... | 32.901186 | 114 | 0.606439 |
from os import linesep
from logging import getLogger
from ._check import check_var, raise_
from ..Functions.get_logger import get_logger
from ..Functions.save import save
from ._frozen import FrozenClass
from ._check import InitUnKnowClassError
from .OptiProblem import OptiProblem
from .XOutput import XOutput
cl... | true | true |
f7576313bc6cb36305816228de43cb5c3d7d8985 | 15,663 | py | Python | topdown_coco_tiny_dataset.py | veritaass/pig_mmdet | 6bb348a002695e83b2f16b84173ce0aebbb20e60 | [
"Apache-2.0"
] | null | null | null | topdown_coco_tiny_dataset.py | veritaass/pig_mmdet | 6bb348a002695e83b2f16b84173ce0aebbb20e60 | [
"Apache-2.0"
] | null | null | null | topdown_coco_tiny_dataset.py | veritaass/pig_mmdet | 6bb348a002695e83b2f16b84173ce0aebbb20e60 | [
"Apache-2.0"
] | null | null | null | import json
import os
import os.path as osp
#from collections import OrderedDict
import tempfile
import numpy as np
from mmpose.core.evaluation.top_down_eval import (keypoint_nme,
keypoint_pck_accuracy)
from mmpose.datasets.builder import DATASETS
from mmpose.datasets... | 35.678815 | 106 | 0.546447 | import json
import os
import os.path as osp
import tempfile
import numpy as np
from mmpose.core.evaluation.top_down_eval import (keypoint_nme,
keypoint_pck_accuracy)
from mmpose.datasets.builder import DATASETS
from mmpose.datasets.datasets.base import Kpt2dSviewRgbI... | true | true |
f757663a3ef34b8fd343b2fdc97e825418c77e4f | 112 | py | Python | poolink_backend/apps/category/apps.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | poolink_backend/apps/category/apps.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | poolink_backend/apps/category/apps.py | jaethewiederholen/Poolink_backend | 3a1b28856bc8916aedb7735de8b64fef3269ef1b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CategoryConfig(AppConfig):
name = 'poolink_backend.apps.category'
| 18.666667 | 42 | 0.785714 | from django.apps import AppConfig
class CategoryConfig(AppConfig):
name = 'poolink_backend.apps.category'
| true | true |
f757669e152dc4012cbc51e8e194e9bdb24e216f | 281 | py | Python | tests/parse/test_get_sprite_names.py | GSE-CCL/scratch-tools | 4c17e671cf7f3493f04981a468b0afe9489bf403 | [
"MIT"
] | null | null | null | tests/parse/test_get_sprite_names.py | GSE-CCL/scratch-tools | 4c17e671cf7f3493f04981a468b0afe9489bf403 | [
"MIT"
] | 9 | 2020-04-17T02:41:49.000Z | 2020-07-07T15:38:27.000Z | tests/parse/test_get_sprite_names.py | GSE-CCL/scratch-scrape | 4c17e671cf7f3493f04981a468b0afe9489bf403 | [
"MIT"
] | null | null | null | import pytest
def test_get_sprite_names_nodata(parser):
result = parser.get_sprite_names(dict())
assert result == False
def test_get_sprite(parser, full_sb3):
result = parser.get_sprite_names(full_sb3)
assert type(result) == list
assert result == ["Scratch"]
| 25.545455 | 46 | 0.729537 | import pytest
def test_get_sprite_names_nodata(parser):
result = parser.get_sprite_names(dict())
assert result == False
def test_get_sprite(parser, full_sb3):
result = parser.get_sprite_names(full_sb3)
assert type(result) == list
assert result == ["Scratch"]
| true | true |
f75766e51819af6fef05c1bd1c21c32fef49cd50 | 152 | py | Python | rq/version.py | mdawar/rq | 0dd9ff0ec9a91e5a81cd5a30651287cad32f8ab0 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | rq/version.py | mdawar/rq | 0dd9ff0ec9a91e5a81cd5a30651287cad32f8ab0 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | rq/version.py | mdawar/rq | 0dd9ff0ec9a91e5a81cd5a30651287cad32f8ab0 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
VERSION = '1.3.0'
| 25.333333 | 66 | 0.611842 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
VERSION = '1.3.0'
| true | true |
f75767910da0c05da7dc64eb872127a0f93717d6 | 15,761 | py | Python | internals/processes.py | liamnewmarch/chromium-dashboard | 0e10b98554a85bd8edb7c61f8fa0494821fe005f | [
"Apache-2.0"
] | 450 | 2015-01-31T03:16:15.000Z | 2022-03-25T14:03:26.000Z | internals/processes.py | nirajbhutada/chromium-dashboard | 6fcec787cad34350b50806f7ffde4238942d7ec3 | [
"Apache-2.0"
] | 1,336 | 2015-01-16T21:41:33.000Z | 2022-03-30T16:28:24.000Z | internals/processes.py | prashantpandey9/chromium-dashboard | 0aa2b3cfc9c44a6f19dec7657346809369569b17 | [
"Apache-2.0"
] | 314 | 2015-01-28T00:17:45.000Z | 2022-03-28T05:09:46.000Z |
# -*- coding: utf-8 -*-
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.904858 | 79 | 0.664615 |
import collections
from internals import approval_defs
from internals import models
Process = collections.namedtuple(
'Process',
'name, description, applicability, stages')
ProcessStage = collections.namedtuple(
'ProcessStage',
'name, description, progress_items, actions, appr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.