hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f723fbc0745a9cea8325676af39c388286cf6b75 | 10,985 | py | Python | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | search/skip_list_search.py | AstiaSun/Search-Engine | 2c04031f1c21d7ea78e6ce61a53349d538905cbe | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from enum import Enum
from typing import Optional
from common.constants import PATH_TO_LIST_OF_FILES, SPLIT
OPERATION_CODES = Enum('OPERATION_CODES', 'AND OR NOT')
ALL = '*'
@dataclass
class DocumentNode:
"""
Data structure used to implement skip list. Contains a reference
... | 35.665584 | 83 | 0.570505 | from dataclasses import dataclass
from enum import Enum
from typing import Optional
from common.constants import PATH_TO_LIST_OF_FILES, SPLIT
OPERATION_CODES = Enum('OPERATION_CODES', 'AND OR NOT')
ALL = '*'
@dataclass
class DocumentNode:
id: int
next_id_index: Optional[int]
def __eq__(s... | true | true |
f723fc45ed2a21c26e65c590692824efb0148cf6 | 395 | py | Python | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | 1 | 2020-03-29T06:10:04.000Z | 2020-03-29T06:10:04.000Z | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | 8 | 2020-03-29T01:47:47.000Z | 2022-02-27T12:43:08.000Z | backend/main.py | SwiftWinds/LAHacks | 2bfeb7e073e6624ab5bd91ce9feceb3eab7965e7 | [
"MIT"
] | null | null | null | from flask import Flask, session, request
app = Flask(__name__)
@app.route('/upload', methods=['GET', 'POST'])
def hello_world():
if request.method == 'POST':
session['audio_data'] = request.form['audio_data']
print(session['audio_data'])
# abc = vars(request)
# for i in abc:
... | 30.384615 | 58 | 0.594937 | from flask import Flask, session, request
app = Flask(__name__)
@app.route('/upload', methods=['GET', 'POST'])
def hello_world():
if request.method == 'POST':
session['audio_data'] = request.form['audio_data']
print(session['audio_data'])
return "Uploaded Audio"
... | true | true |
f723fcc14afc0f2cce14de94db3fff3d2351f6e1 | 1,122 | py | Python | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/chrony/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Chrony(AutotoolsPackage):
"""chrony is a versatile implementation of the Network Time
... | 41.555556 | 95 | 0.757576 |
from spack import *
class Chrony(AutotoolsPackage):
homepage = "https://chrony.tuxfamily.org/"
url = "https://github.com/mlichvar/chrony/archive/3.5.1.tar.gz"
version('3.5.1', sha256='881085b944a14853402e1c5cff4de5d815ff104ec6e12eea51c12e42f32f71bd')
version('3.5', sha256='145a270fe4df42... | true | true |
f723fdf48d7b23a6b7b5b3707c12e799fe8951e0 | 45 | py | Python | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 394 | 2017-11-25T13:26:27.000Z | 2022-03-28T07:19:05.000Z | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 25 | 2017-11-30T04:26:32.000Z | 2022-03-10T10:27:54.000Z | sbody/alignment/mesh_distance/__init__.py | Rubikplayer/flame-fitting | db3d622547b83ab158dceb46a5d049781e6e6c3a | [
"AAL"
] | 84 | 2017-11-27T05:42:43.000Z | 2022-03-30T02:56:48.000Z | from sbody.alignment.mesh_distance import *
| 22.5 | 44 | 0.822222 | from sbody.alignment.mesh_distance import *
| true | true |
f723ff274099a624e2dce58b9a204bbe4255d1c3 | 67,751 | py | Python | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | mindspore/nn/optim/thor.py | mindspore-ai/mindspore | a9fbb25530a2874166ff0045ddcdfc73207bf5eb | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 51.678871 | 120 | 0.615061 |
import numpy as np
from mindspore.ops import functional as F, composite as C, operations as P
from mindspore.common.initializer import initializer
from mindspore.common.parameter import Parameter, ParameterTuple
from mindspore.common.tensor import Tensor
import mindspore.nn as nn
import mindspore.common.d... | true | true |
f724002fa49e096c91bf4ad7fbf5255ed93e8e91 | 10,946 | py | Python | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/register/message.py | marcofavorito/agents-aea | e520f2f5d076a193514e194d94aa76c6423ac5bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 fetchai
#
# 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
#
#... | 38.272727 | 115 | 0.504659 |
import logging
from typing import Dict, Set, Tuple, cast
from aea.configurations.base import PublicId
from aea.exceptions import AEAEnforceError, enforce
from aea.protocols.base import Message
_default_logger = logging.getLogger("aea.packages.fetchai.protocols.register.message")
DEFAULT_BODY_SIZ... | true | true |
f72400b1078101ea758b0e655b5076476f1d0bd0 | 1,995 | py | Python | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 36 | 2015-01-03T07:57:07.000Z | 2019-12-09T10:48:08.000Z | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 4 | 2015-01-08T20:18:49.000Z | 2015-08-12T18:09:21.000Z | dbops_venv/lib/python3.5/site-packages/alembic/templates/generic/env.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 11 | 2015-02-07T01:03:23.000Z | 2021-09-24T07:13:38.000Z | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | 27.708333 | 69 | 0.704261 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
config = context.config
fileConfig(config.config_file_name)
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
t... | true | true |
f72400dd434d64329eb589b199f10dc4c9c14be1 | 14,518 | py | Python | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | 2 | 2019-06-26T21:31:03.000Z | 2019-06-27T16:59:58.000Z | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | null | null | null | shapSD/pysubgroup/nominal_target.py | XiaoqiMa/shapSD | 545f61c9e8329c7271051f22f99ba32508ba74a1 | [
"MIT"
] | null | null | null | '''
Created on 29.09.2017
@author: lemmerfn
'''
import numpy as np
import scipy.stats
from functools import total_ordering
from .measures import AbstractInterestingnessMeasure, BoundedInterestingnessMeasure
from .utils import effective_sample_size, powerset
from .subgroup import SubgroupDescription, Subgroup, Nominal... | 49.549488 | 134 | 0.694655 | import numpy as np
import scipy.stats
from functools import total_ordering
from .measures import AbstractInterestingnessMeasure, BoundedInterestingnessMeasure
from .utils import effective_sample_size, powerset
from .subgroup import SubgroupDescription, Subgroup, NominalSelector
@total_ordering
class NominalTarget(ob... | true | true |
f724016dd1c040c5547f313a4d9c94947563f287 | 37 | py | Python | cushead/generator/__init__.py | mrsantos321/customhead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 3 | 2019-10-08T06:02:23.000Z | 2020-01-22T09:14:35.000Z | cushead/generator/__init__.py | mrsantos321/cushead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 297 | 2019-08-22T19:45:23.000Z | 2022-03-26T02:30:25.000Z | cushead/generator/__init__.py | mrsantos321/cushead | bb70867afc34abe7a2ef76bb0f92c08d7ff38214 | [
"MIT"
] | 5 | 2019-09-25T02:35:04.000Z | 2021-03-31T04:23:47.000Z | """
Handle the files generation.
"""
| 9.25 | 28 | 0.648649 | true | true | |
f724019f2879e58a1cc31e046087322927173612 | 21,423 | py | Python | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 14 | 2017-07-21T18:31:21.000Z | 2022-01-21T11:39:45.000Z | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 3 | 2019-06-02T13:00:58.000Z | 2020-04-24T14:40:50.000Z | train.py | designer357/MSLSTM | 923f29f5a274ae41dbfe79d99e1ea28bb0cf5109 | [
"MIT"
] | 6 | 2018-02-22T08:26:11.000Z | 2022-03-08T23:32:06.000Z | # -*- coding:utf-8 -*-
"""
mincheng:mc.cheng@my.cityu.edu.hk
"""
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorf... | 46.170259 | 333 | 0.586986 |
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorflow as tf
import mslstm
import config
import loaddata
import num... | true | true |
f72402f269dd0023b44f39c7340a56de50e067b1 | 1,835 | py | Python | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | bot.py | HeitorDJAk47Gamer/B0TPYbeta | e2c6707bcd74161bfb8b75a044833d23e66ed26b | [
"MIT"
] | null | null | null | import json
import os
import discord
import asyncio
import datetime
from discord.ext import commands, tasks
with open('config.json') as e:
infos = json.load(e)
token = infos['token']
prefix = infos['prefix']
lara = commands.Bot(command_prefix=prefix, case_insensitive=True, intents=discord.Intents.all())
... | 29.126984 | 129 | 0.681744 | import json
import os
import discord
import asyncio
import datetime
from discord.ext import commands, tasks
with open('config.json') as e:
infos = json.load(e)
token = infos['token']
prefix = infos['prefix']
lara = commands.Bot(command_prefix=prefix, case_insensitive=True, intents=discord.Intents.all())
... | true | true |
f72403e3633318d3eef4d9f59835f9dbf420aea9 | 3,080 | py | Python | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | addon/resources/community/livetvcaptcha.py | mar9a7louwa/marga | f20d815e14190d6ec95b24d52cf97ef4173079ef | [
"MIT"
] | null | null | null | from PIL import Image
import hashlib
import time
import os
import xbmcaddon
addonPath = xbmcaddon.Addon().getAddonInfo("path")
communityStreamPath = os.path.join(addonPath,'resources')
communityStreamPath = os.path.join(communityStreamPath,'community')
#print 'path is ',communityStreamPath
import math
class VectorCom... | 25.245902 | 162 | 0.599351 | from PIL import Image
import hashlib
import time
import os
import xbmcaddon
addonPath = xbmcaddon.Addon().getAddonInfo("path")
communityStreamPath = os.path.join(addonPath,'resources')
communityStreamPath = os.path.join(communityStreamPath,'community')
import math
class VectorCompare:
def magnitude(self,concordanc... | true | true |
f7240418d759063b2c79292315a9b4fb2bce2595 | 1,854 | py | Python | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | leetcode/0-250/175-15. 3Sum.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # 15. 3Sum
from collections import defaultdict
class Solution:
# TLE at test # 312 out of 313
def threeSum(self, nums):
n = len(nums)
dic = defaultdict(set)
nums.sort()
mini = nums[0]
# d = {}
for i in range(n):
dic[nums[i]].add(i)
# d.setd... | 30.393443 | 59 | 0.342503 |
from collections import defaultdict
class Solution:
m(self, nums):
n = len(nums)
dic = defaultdict(set)
nums.sort()
mini = nums[0]
for i in range(n):
dic[nums[i]].add(i)
ans = []
table = set()
for i in range(n):
... | true | true |
f724041b5d2e83411bc60f733f4a4170bc7d026e | 7,763 | py | Python | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | erinfolami/ZazuML | 8dbe934c06612dd7917f38090701e3ead0337fb8 | [
"MIT"
] | 1 | 2020-12-31T18:02:41.000Z | 2020-12-31T18:02:41.000Z | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | null | null | null | ObjectDetNet/retinanet/dataloaders/custom_transforms.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | 1 | 2020-08-09T09:23:25.000Z | 2020-08-09T09:23:25.000Z | import math
import torch
import random
import numpy as np
import torch.nn as nn
from numpy import int64 as int64
import torchvision.transforms as transforms
from PIL import Image, ImageOps, ImageFilter
class Normalize(object):
"""Normalize a tensor image with mean and standard deviation.
Args:
mean (... | 31.176707 | 109 | 0.556744 | import math
import torch
import random
import numpy as np
import torch.nn as nn
from numpy import int64 as int64
import torchvision.transforms as transforms
from PIL import Image, ImageOps, ImageFilter
class Normalize(object):
def __init__(self, mean=(0., 0., 0.), std=(1., 1., 1.)):
self.mean = mean
... | true | true |
f7240423341243823327a6a3db2d9cd1d055c4df | 4,407 | py | Python | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | models/resnet.py | DwaraknathT/sparsify | bbe3b6e492c2bc8fdd9dd37d87ffc5f51f520792 | [
"MIT"
] | null | null | null | '''
Properly implemented ResNet-s for CIFAR10 as described in paper [1].
The implementation and structure of this file is hugely influenced by [2]
which is implemented for ImageNet and doesn't have option A for identity.
Moreover, most of the implementations on the web is copy-paste from
torchvision's resnet and has w... | 30.604167 | 99 | 0.701157 | import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from layers.layers import MaskedConv
__all__ = ['ResNet', 'resnet20', 'resnet32', 'resnet44', 'resnet56', 'resnet110', 'resnet1202']
def _weights_init(m):
classname = m.__class__.__name__
if isinstance(m, nn.Linear) or isinsta... | true | true |
f72404dd1d78fb904526c04c15ecc01bbd1e1401 | 1,392 | py | Python | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | 1 | 2021-12-22T06:10:01.000Z | 2021-12-22T06:10:01.000Z | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | api/kiveapi/endpoint_manager.py | dmacmillan/Kive | 76bc8f289f66fb133f78cb6d5689568b7d015915 | [
"BSD-3-Clause"
] | null | null | null | import re
class EndpointManager(object):
def __init__(self, session):
self.session = session
def __getattr__(self, name):
return SessionContext(self.session, name)
class SessionContext(object):
def __init__(self, session, name):
self.session = session
self.prefix = '/api... | 30.26087 | 78 | 0.591954 | import re
class EndpointManager(object):
def __init__(self, session):
self.session = session
def __getattr__(self, name):
return SessionContext(self.session, name)
class SessionContext(object):
def __init__(self, session, name):
self.session = session
self.prefix = '/api... | true | true |
f724061c6d8dbec2acb290ec23c12a1f23882924 | 2,260 | py | Python | scripts/quickstart_tooling_dpg/template/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | scripts/quickstart_tooling_dpg/template/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | scripts/quickstart_tooling_dpg/template/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------... | 35.3125 | 109 | 0.592035 |
import os
import re
from setuptools import setup, find_packages
PACKAGE_NAME = "{{ package_name }}"
PACKAGE_PPRINT_NAME = "{{ package_pprint_name }}"
package_folder_path = PACKAGE_NAME.replace("-", "/")
with open(os.path.join(package_folder_path, "_version.py"), "r") as fd:
version = re.search(
... | true | true |
f72406b04989bee31f7efd503e2851a5ff5375e6 | 3,344 | py | Python | recommendation_system_demos/Basic-CMN-Demo/util/gmf.py | sweetpand/tensorflow_mri | 7a483cbbbe515ad395928311759505707bd72503 | [
"MIT"
] | 2 | 2021-02-06T11:27:17.000Z | 2021-05-29T10:45:22.000Z | recommendation_system_demos/Basic-CMN-Demo/util/gmf.py | sweetpand/tensorflow_mri | 7a483cbbbe515ad395928311759505707bd72503 | [
"MIT"
] | null | null | null | recommendation_system_demos/Basic-CMN-Demo/util/gmf.py | sweetpand/tensorflow_mri | 7a483cbbbe515ad395928311759505707bd72503 | [
"MIT"
] | 1 | 2020-10-23T20:26:36.000Z | 2020-10-23T20:26:36.000Z | import sonnet as snt
import tensorflow as tf
from util.helper import GraphKeys, add_to_collection
from util.layers import DenseLayer, LossLayer, OptimizerLayer, ModelBase
class PairwiseGMF(ModelBase):
def __init__(self, config):
"""
:param config:
"""
# super(PairwiseGMF, self)._... | 39.809524 | 97 | 0.592105 | import sonnet as snt
import tensorflow as tf
from util.helper import GraphKeys, add_to_collection
from util.layers import DenseLayer, LossLayer, OptimizerLayer, ModelBase
class PairwiseGMF(ModelBase):
def __init__(self, config):
self.config = config
self._activation_fn = tf.nn.relu
... | true | true |
f724082117396a7bfcfccb74e93f50fbf7372564 | 1,382 | py | Python | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/task_definition_reference.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/task_definition_reference.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/task_definition_reference.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 40.647059 | 95 | 0.523155 |
from msrest.serialization import Model
class TaskDefinitionReference(Model):
_attribute_map = {
'definition_type': {'key': 'definitionType', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'version_spec': {'key': 'versionSpec', 'type': 'str'}
}
def __init_... | true | true |
f72409de32069ee9ca6e49c33f64c6ae4fe101a4 | 1,177 | py | Python | google/cloud/ids/v1/ids-v1-py/google/cloud/ids_v1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/ids/v1/ids-v1-py/google/cloud/ids_v1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/ids/v1/ids-v1-py/google/cloud/ids_v1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 30.179487 | 74 | 0.782498 |
from .services.ids import IDSClient
from .services.ids import IDSAsyncClient
from .types.ids import CreateEndpointRequest
from .types.ids import DeleteEndpointRequest
from .types.ids import Endpoint
from .types.ids import GetEndpointRequest
from .types.ids import ListEndpointsRequest
from .types.ids im... | true | true |
f7240a4dd4cae9e22522251b2018d0cd567af902 | 5,982 | py | Python | test/integration/ggrc_basic_permissions/test_permissions_loading.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc_basic_permissions/test_permissions_loading.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc_basic_permissions/test_permissions_loading.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test user permissions loading and caching."""
import mock
from appengine import base
from ggrc.models import all_models
from ggrc.cache import utils as cache_utils
from integration.ggrc import TestCase,... | 33.049724 | 78 | 0.726847 |
import mock
from appengine import base
from ggrc.models import all_models
from ggrc.cache import utils as cache_utils
from integration.ggrc import TestCase, generator
from integration.ggrc.api_helper import Api
from integration.ggrc.models import factories
ggrc_basic_permissions = None
def _lazy_load_modul... | true | true |
f7240b0b0e4e09e2288ea3093f1886aef31b452b | 2,852 | py | Python | xlsxwriter/test/worksheet/test_write_sheet_views9.py | DeltaEpsilon7787/XlsxWriter | 550b9c5bd678c861dcc9f6f4072b33a69566e065 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/worksheet/test_write_sheet_views9.py | DeltaEpsilon7787/XlsxWriter | 550b9c5bd678c861dcc9f6f4072b33a69566e065 | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/worksheet/test_write_sheet_views9.py | jmcnamara/test_py_github_actions | d445d5d98b038b63453dd70c9c1a9ca1b325cb47 | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from ...worksheet import Worksheet
class TestWriteSheetViews(unittest.TestCase):
"""
Test the Wor... | 33.952381 | 220 | 0.650421 | true | true | |
f7240b10674288a6a9ebc3b398c4ef8d48a1ea1a | 1,044 | py | Python | psppi/users/migrations/0002_auto_20160901_0144.py | the-fool/psppi | a280cfc6f294c85119b0b5a326d2930300d6ab93 | [
"MIT"
] | null | null | null | psppi/users/migrations/0002_auto_20160901_0144.py | the-fool/psppi | a280cfc6f294c85119b0b5a326d2930300d6ab93 | [
"MIT"
] | null | null | null | psppi/users/migrations/0002_auto_20160901_0144.py | the-fool/psppi | a280cfc6f294c85119b0b5a326d2930300d6ab93 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-01 01:44
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
... | 36 | 409 | 0.632184 |
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
... | true | true |
f7240b979131fa5354ce144e34961d7ca82c0818 | 575 | py | Python | sagas/tests/langs/jieba_procs.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | sagas/tests/langs/jieba_procs.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | sagas/tests/langs/jieba_procs.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | import jieba
import jieba.posseg as pseg
def user_dict():
from sagas.conf import resource_path
dictf = resource_path('dict_zh.txt')
jieba.load_userdict(dictf)
seg_list = jieba.cut("列出所有的采购订单") # 默认是精确模式
print(", ".join(seg_list))
def user_words():
jieba.add_word('寄账单地址', tag='typ')
jieba... | 23.958333 | 49 | 0.64 | import jieba
import jieba.posseg as pseg
def user_dict():
from sagas.conf import resource_path
dictf = resource_path('dict_zh.txt')
jieba.load_userdict(dictf)
seg_list = jieba.cut("列出所有的采购订单")
print(", ".join(seg_list))
def user_words():
jieba.add_word('寄账单地址', tag='typ')
jieba.add_word... | true | true |
f7240cd9df0ce707381f54c94daa94f450f5129e | 2,240 | py | Python | DBUIScripts/db_update.py | chaoannricardo/NTU_CARDO_Database | 5fbfa1383f2e65a04fabd863c68373f45bbf05fd | [
"Apache-2.0"
] | 1 | 2020-07-04T22:30:41.000Z | 2020-07-04T22:30:41.000Z | DBUIScripts/db_update.py | chaoannricardo/NTU_CARDO_Database | 5fbfa1383f2e65a04fabd863c68373f45bbf05fd | [
"Apache-2.0"
] | null | null | null | DBUIScripts/db_update.py | chaoannricardo/NTU_CARDO_Database | 5fbfa1383f2e65a04fabd863c68373f45bbf05fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
import pandas as pd
import pymysql
# import configuration in parent dir
import os, sys, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import configuration as conf
# import ... | 36.129032 | 142 | 0.663839 |
import pandas as pd
import pymysql
import os, sys, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import configuration as conf
from models import data_processing, database_management, file_mana... | true | true |
f7240ced4c53690a554d2dbce71a2e069cae8b3f | 39,598 | py | Python | charmhelpers/core/host.py | mhilton/juju-charm-helpers | 1156b9dc5023adbe5571cc57038e648d5ce20d0e | [
"Apache-2.0"
] | null | null | null | charmhelpers/core/host.py | mhilton/juju-charm-helpers | 1156b9dc5023adbe5571cc57038e648d5ce20d0e | [
"Apache-2.0"
] | null | null | null | charmhelpers/core/host.py | mhilton/juju-charm-helpers | 1156b9dc5023adbe5571cc57038e648d5ce20d0e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2015 Canonical Limited.
#
# 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 ... | 36.904007 | 108 | 0.638593 |
import os
import re
import pwd
import glob
import grp
import random
import string
import subprocess
import hashlib
import functools
import itertools
import six
from contextlib import contextmanager
from collections import OrderedDict
from .hookenv import log, INFO, DEBUG, local_unit, charm_name
fro... | true | true |
f724118e7121e1f8fe2af50681d24ff9abbe8300 | 1,883 | py | Python | tests/lib/bes/git/test_git_head_info.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | tests/lib/bes/git/test_git_head_info.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | tests/lib/bes/git/test_git_head_info.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from bes.testing.unit_test import unit_test
from bes.git.git_head_info import git_head_info
class test_git_head_info(unit_test):
def test_parse_head_info(self):
f = git_head_info.parse_head_info
... | 40.06383 | 146 | 0.643654 |
from bes.testing.unit_test import unit_test
from bes.git.git_head_info import git_head_info
class test_git_head_info(unit_test):
def test_parse_head_info(self):
f = git_head_info.parse_head_info
self.assertEqual( ( 'branch', 'release-beta-14-studio-fixes', None, '9038154f', 'track branch release-beta-14-... | true | true |
f72411af795e09599f066f6a31cfbfe8c8e43847 | 12 | py | Python | networks/ResNet.py | kmmnjng528/2021-StatsML-Project | cefee97d04a72ba942da42005807971ac3d41c81 | [
"MIT"
] | 1 | 2021-11-02T05:14:50.000Z | 2021-11-02T05:14:50.000Z | networks/ResNet.py | kmmnjng528/2021-StatsML-Project | cefee97d04a72ba942da42005807971ac3d41c81 | [
"MIT"
] | null | null | null | networks/ResNet.py | kmmnjng528/2021-StatsML-Project | cefee97d04a72ba942da42005807971ac3d41c81 | [
"MIT"
] | 2 | 2021-11-07T12:23:38.000Z | 2021-12-02T02:08:26.000Z | class ResNet | 12 | 12 | 0.916667 | class ResNet | false | true |
f72411bd9a0c9ff6c92d514d19b08bf1e792e642 | 6,001 | py | Python | PointCNN/pointcnn_geom+i+ms.py | hellwue/TreeSpeciesClassification | 8fd8dc6496d8317923c6112d3da46844d419e49f | [
"MIT"
] | null | null | null | PointCNN/pointcnn_geom+i+ms.py | hellwue/TreeSpeciesClassification | 8fd8dc6496d8317923c6112d3da46844d419e49f | [
"MIT"
] | null | null | null | PointCNN/pointcnn_geom+i+ms.py | hellwue/TreeSpeciesClassification | 8fd8dc6496d8317923c6112d3da46844d419e49f | [
"MIT"
] | null | null | null | import pickle
from myutils import load_dataset, call_home, CMDisplay
from itertools import chain
import torch
import torch.nn.functional as F
from torch.nn import Linear as Lin
from torch.optim import Adam
from torch_geometric.nn import XConv, fps, global_mean_pool
import pytorch_lightning as pl
from pytorch_lightni... | 34.096591 | 94 | 0.622396 | import pickle
from myutils import load_dataset, call_home, CMDisplay
from itertools import chain
import torch
import torch.nn.functional as F
from torch.nn import Linear as Lin
from torch.optim import Adam
from torch_geometric.nn import XConv, fps, global_mean_pool
import pytorch_lightning as pl
from pytorch_lightni... | true | true |
f72412097759e980fabb5c2844782e9a1daa33f2 | 3,307 | py | Python | example_distributed.py | EricSteinberger/Neural-Fictitous-Self-Play | 4462845f159554b9a9812e3af43d07c2b5cd2059 | [
"MIT"
] | 52 | 2019-06-22T10:21:17.000Z | 2022-03-29T04:57:12.000Z | example_distributed.py | jsanderink/tue | 4462845f159554b9a9812e3af43d07c2b5cd2059 | [
"MIT"
] | 1 | 2020-04-24T22:45:22.000Z | 2020-04-30T02:20:37.000Z | example_distributed.py | jsanderink/tue | 4462845f159554b9a9812e3af43d07c2b5cd2059 | [
"MIT"
] | 14 | 2019-06-27T02:02:31.000Z | 2022-01-05T13:14:12.000Z | from NFSP.TrainingProfile import TrainingProfile
from NFSP.workers.driver.Driver import Driver
from PokerRL import DiscretizedNLHoldem, Poker
from PokerRL.eval.lbr import LBRArgs
from PokerRL.game import bet_sets
if __name__ == '__main__':
# Agent processes: 1 Chief, 2 Parameter-servers, 11 LAs
# Eval processe... | 47.242857 | 118 | 0.408225 | from NFSP.TrainingProfile import TrainingProfile
from NFSP.workers.driver.Driver import Driver
from PokerRL import DiscretizedNLHoldem, Poker
from PokerRL.eval.lbr import LBRArgs
from PokerRL.game import bet_sets
if __name__ == '__main__':
N_WORKERS = 16
N_LBR_WORKERS = 3
ct... | true | true |
f724126c40a1dd924cae490241b2e28d84ddf8e2 | 408 | py | Python | signalrcore/messages/base_message.py | smiddle/signalrcore | 7b5f0fb6913ba2dacbe514724b62f1eab7097d91 | [
"MIT"
] | null | null | null | signalrcore/messages/base_message.py | smiddle/signalrcore | 7b5f0fb6913ba2dacbe514724b62f1eab7097d91 | [
"MIT"
] | null | null | null | signalrcore/messages/base_message.py | smiddle/signalrcore | 7b5f0fb6913ba2dacbe514724b62f1eab7097d91 | [
"MIT"
] | null | null | null | from .message_type import MessageType
class BaseMessage(object):
def __init__(self, message_type):
self.type = MessageType(message_type)
class BaseHeadersMessage(BaseMessage):
"""
All messages expct ping can carry aditional headers
"""
def __init__(self, message_type, headers):
... | 27.2 | 62 | 0.710784 | from .message_type import MessageType
class BaseMessage(object):
def __init__(self, message_type):
self.type = MessageType(message_type)
class BaseHeadersMessage(BaseMessage):
def __init__(self, message_type, headers):
super(BaseHeadersMessage, self).__init__(message_type)
self.header... | true | true |
f7241292437ffed3ee5268d11c2657d9fb0bc4ff | 27,712 | py | Python | ow_lander/scripts/arm_action_servers.py | thewindsofwinter/ow_simulator | a92698a1cc7e80ac6aec17d74bcbac81edf726f7 | [
"NASA-1.3"
] | null | null | null | ow_lander/scripts/arm_action_servers.py | thewindsofwinter/ow_simulator | a92698a1cc7e80ac6aec17d74bcbac81edf726f7 | [
"NASA-1.3"
] | null | null | null | ow_lander/scripts/arm_action_servers.py | thewindsofwinter/ow_simulator | a92698a1cc7e80ac6aec17d74bcbac81edf726f7 | [
"NASA-1.3"
] | null | null | null | #!/usr/bin/env python3
# The Notices and Disclaimers for Ocean Worlds Autonomy Testbed for Exploration
# Research and Simulation can be found in README.md in the root directory of
# this repository.
import rospy
import actionlib
from ow_lander.msg import *
from LanderInterface import MoveItInterface
from LanderInterf... | 42.243902 | 120 | 0.612081 |
import rospy
import actionlib
from ow_lander.msg import *
from LanderInterface import MoveItInterface
from LanderInterface import LinkStateSubscriber
from trajectory_async_execution import TrajectoryAsyncExecuter
import all_action_trajectories
from moveit_msgs.msg import RobotTrajectory
from controller_manager_ms... | true | true |
f724145bd3a999c57b36d90294098b99246dd929 | 1,012 | py | Python | identipy_app/migrations/0004_auto_20171222_0206.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | identipy_app/migrations/0004_auto_20171222_0206.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | identipy_app/migrations/0004_auto_20171222_0206.py | levitsky/identipy_server | 6dd04d929fadce01eec1ffd800cd3cd17da614b9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-12-21 23:06
from __future__ import unicode_literals
from django.db import migrations, models
from identipy_app.models import SearchRun
def define_runs(apps, schema_editor):
PepXMLFile = apps.get_model('identipy_app', 'PepXMLFile')
SearchRun = apps.g... | 33.733333 | 129 | 0.66996 |
from __future__ import unicode_literals
from django.db import migrations, models
from identipy_app.models import SearchRun
def define_runs(apps, schema_editor):
PepXMLFile = apps.get_model('identipy_app', 'PepXMLFile')
SearchRun = apps.get_model('identipy_app', 'SearchRun')
f2r = {}
for run in Searc... | true | true |
f72414b5e3cce6d71f11dcd8001bbbd3832c1183 | 803 | py | Python | osc-sender.py | zarquin/ASCII-Simple-Video-Synth | ea755a20141880affecb779fdb94eed1ead15245 | [
"MIT"
] | 11 | 2020-05-22T02:51:30.000Z | 2021-02-21T20:57:41.000Z | osc-sender.py | zarquin/ASCII-Simple-Video-Synth | ea755a20141880affecb779fdb94eed1ead15245 | [
"MIT"
] | 1 | 2020-05-23T17:37:41.000Z | 2020-05-23T17:37:41.000Z | osc-sender.py | zarquin/ASCII-Simple-Video-Synth | ea755a20141880affecb779fdb94eed1ead15245 | [
"MIT"
] | 3 | 2019-08-11T15:14:48.000Z | 2020-08-08T09:46:29.000Z | import random
import time
from pythonosc import osc_message_builder
from pythonosc import udp_client
client=udp_client.SimpleUDPClient("127.0.0.1",8000)
dest = [
"/red/scale",
"/red/offset",
"/red/speed",
"/green/scale",
"/green/offset",
"/green/speed",
"/blue/scale",
"/blue/offset",
... | 19.119048 | 51 | 0.617684 | import random
import time
from pythonosc import osc_message_builder
from pythonosc import udp_client
client=udp_client.SimpleUDPClient("127.0.0.1",8000)
dest = [
"/red/scale",
"/red/offset",
"/red/speed",
"/green/scale",
"/green/offset",
"/green/speed",
"/blue/scale",
"/blue/offset",
... | true | true |
f72416537976a13d7e99ccfa536d47805df1b886 | 12,699 | py | Python | intel_extension_for_pytorch/optim/_functional.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | null | null | null | intel_extension_for_pytorch/optim/_functional.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | null | null | null | intel_extension_for_pytorch/optim/_functional.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | null | null | null | r"""Functional interface, port from torch/optim/_function.py"""
import torch
from torch import Tensor
from typing import List, Optional
def is_master_weight(param, params_attr):
return (
param.dtype == torch.float and
param in params_attr and
'bf16_param' in params_attr[param]
)
def g... | 30.307876 | 106 | 0.554059 | import torch
from torch import Tensor
from typing import List, Optional
def is_master_weight(param, params_attr):
return (
param.dtype == torch.float and
param in params_attr and
'bf16_param' in params_attr[param]
)
def get_bf16_grad(param, params_attr):
assert is_master_weight(pa... | true | true |
f72416f7c7f270568985bd86ba257f577de01834 | 6,721 | py | Python | pydeps/cli.py | AvenzaOleg/pydeps | 1e6715b7bea47a40e8042821b57937deaaa0fdc3 | [
"BSD-2-Clause"
] | null | null | null | pydeps/cli.py | AvenzaOleg/pydeps | 1e6715b7bea47a40e8042821b57937deaaa0fdc3 | [
"BSD-2-Clause"
] | null | null | null | pydeps/cli.py | AvenzaOleg/pydeps | 1e6715b7bea47a40e8042821b57937deaaa0fdc3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
command line interface (cli) code.
"""
# pylint: disable=line-too-long
from __future__ import print_function
import argparse
from .arguments import Arguments
import json
from .pycompat import configparser
import logging
import os
import sys
import textwrap
from . import __version__
def err... | 41.487654 | 167 | 0.654813 |
from __future__ import print_function
import argparse
from .arguments import Arguments
import json
from .pycompat import configparser
import logging
import os
import sys
import textwrap
from . import __version__
def error(*args, **kwargs):
kwargs['file'] = sys.stderr
print("\n\tERROR:", *args, **kwargs)
... | true | true |
f72417aee10d13ecdc4e318b757fa478538c2057 | 4,421 | py | Python | TicTacToe/TicTacToe.py | Chandra-MP/Python-Projects | 68bb705416f1ad2ce1bd2ca6203e794794209ccf | [
"Unlicense"
] | null | null | null | TicTacToe/TicTacToe.py | Chandra-MP/Python-Projects | 68bb705416f1ad2ce1bd2ca6203e794794209ccf | [
"Unlicense"
] | null | null | null | TicTacToe/TicTacToe.py | Chandra-MP/Python-Projects | 68bb705416f1ad2ce1bd2ca6203e794794209ccf | [
"Unlicense"
] | null | null | null | #Implementation of Two Player Tic-Tac-Toe game in Python.
''' We will make the board using dictionary
in which keys will be the location(i.e : top-left,mid-right,etc.)
and initialliy it's values will be empty space and then after every move
we will change the value according to player's choice of mo... | 39.828829 | 95 | 0.43972 |
''' We will make the board using dictionary
in which keys will be the location(i.e : top-left,mid-right,etc.)
and initialliy it's values will be empty space and then after every move
we will change the value according to player's choice of move. '''
theBoard = {'7': ' ' , '8': ' ' , '9': ' ' ,
... | false | true |
f72418161d72c045ee191193724c0fad0d98ece9 | 17,698 | py | Python | AFQ/api/bundle_dict.py | arokem/pyAFQ | 3aa15db49d5e50cbe9df0a5a9bc24f15f44bd758 | [
"BSD-2-Clause"
] | 28 | 2016-09-10T01:25:41.000Z | 2022-03-22T21:05:11.000Z | AFQ/api/bundle_dict.py | arokem/pyAFQ | 3aa15db49d5e50cbe9df0a5a9bc24f15f44bd758 | [
"BSD-2-Clause"
] | 688 | 2016-02-03T19:56:37.000Z | 2022-03-16T21:21:18.000Z | AFQ/api/bundle_dict.py | arokem/pyAFQ | 3aa15db49d5e50cbe9df0a5a9bc24f15f44bd758 | [
"BSD-2-Clause"
] | 21 | 2016-02-03T18:47:22.000Z | 2022-01-27T15:38:05.000Z | import logging
from collections.abc import MutableMapping
import AFQ.data as afd
logging.basicConfig(level=logging.INFO)
__all__ = ["PediatricBundleDict", "BundleDict"]
def do_preprocessing():
raise NotImplementedError
BUNDLES = ["ATR", "CGC", "CST", "IFO", "ILF", "SLF", "ARC", "UNC",
"FA", "FP"]... | 42.238663 | 96 | 0.469262 | import logging
from collections.abc import MutableMapping
import AFQ.data as afd
logging.basicConfig(level=logging.INFO)
__all__ = ["PediatricBundleDict", "BundleDict"]
def do_preprocessing():
raise NotImplementedError
BUNDLES = ["ATR", "CGC", "CST", "IFO", "ILF", "SLF", "ARC", "UNC",
"FA", "FP"]... | true | true |
f72418223eb83a65ed2fe842913ad03107f2ab2b | 105 | py | Python | routes.py | joejcollins/david-kano | 73bc09494ed3fc1fb1707fcc6c9fa37f19221cec | [
"MIT"
] | null | null | null | routes.py | joejcollins/david-kano | 73bc09494ed3fc1fb1707fcc6c9fa37f19221cec | [
"MIT"
] | null | null | null | routes.py | joejcollins/david-kano | 73bc09494ed3fc1fb1707fcc6c9fa37f19221cec | [
"MIT"
] | null | null | null | from controllers import pages
wsgi_routes = [
(r'/', pages.home),
(r'/(\w+)', pages.template),
] | 17.5 | 32 | 0.590476 | from controllers import pages
wsgi_routes = [
(r'/', pages.home),
(r'/(\w+)', pages.template),
] | true | true |
f724182d4906b622c0647bd68f97712a4a05e149 | 10,622 | py | Python | tests/flow/test_path_filter.py | jeffreylovitz/RedisGraph | 257cdccd0575a940004a23c7795b2bd139ff11b7 | [
"Ruby",
"ISC",
"MIT"
] | null | null | null | tests/flow/test_path_filter.py | jeffreylovitz/RedisGraph | 257cdccd0575a940004a23c7795b2bd139ff11b7 | [
"Ruby",
"ISC",
"MIT"
] | null | null | null | tests/flow/test_path_filter.py | jeffreylovitz/RedisGraph | 257cdccd0575a940004a23c7795b2bd139ff11b7 | [
"Ruby",
"ISC",
"MIT"
] | null | null | null | import os
import sys
from RLTest import Env
from redisgraph import Graph, Node, Edge
from collections import Counter
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from base import FlowTestsBase
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from demo import QueryInfo
GRAPH_I... | 47.208889 | 159 | 0.656091 | import os
import sys
from RLTest import Env
from redisgraph import Graph, Node, Edge
from collections import Counter
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from base import FlowTestsBase
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from demo import QueryInfo
GRAPH_I... | true | true |
f72418cebb9a25071d43c6dff652515ba3da8366 | 3,382 | py | Python | python/GafferDispatchUI/PythonCommandUI.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | 1 | 2019-08-02T16:49:59.000Z | 2019-08-02T16:49:59.000Z | python/GafferDispatchUI/PythonCommandUI.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | 2 | 2017-08-23T21:35:45.000Z | 2018-01-29T08:59:33.000Z | python/GafferDispatchUI/PythonCommandUI.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | 1 | 2020-02-15T16:15:54.000Z | 2020-02-15T16:15:54.000Z | ##########################################################################
#
# Copyright (c) 2015, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | 29.666667 | 77 | 0.674157 | true | true | |
f724190ad19bba7a7fd84b44f59bcfd9044949ad | 12,110 | py | Python | seld.py | sedurCode/seld-dcase2021 | f8e09dbbbb5ac7d6ae0b82083f1a11b013c5dd51 | [
"MIT"
] | 23 | 2021-02-28T21:58:06.000Z | 2022-03-29T03:19:59.000Z | seld.py | sedurCode/seld-dcase2021 | f8e09dbbbb5ac7d6ae0b82083f1a11b013c5dd51 | [
"MIT"
] | 10 | 2021-04-06T17:20:41.000Z | 2022-03-23T13:19:42.000Z | seld.py | sedurCode/seld-dcase2021 | f8e09dbbbb5ac7d6ae0b82083f1a11b013c5dd51 | [
"MIT"
] | 13 | 2021-04-01T02:23:46.000Z | 2022-01-16T03:29:54.000Z | #
# A wrapper script that trains the SELDnet. The training stops when the early stopping metric - SELD error stops improving.
#
import os
import sys
import numpy as np
import cls_feature_class
import cls_data_generator
from cls_compute_seld_results import ComputeSELDResults, reshape_3Dto2D
import keras_model
import pa... | 48.830645 | 176 | 0.606689 |
import os
import sys
import numpy as np
import cls_feature_class
import cls_data_generator
from cls_compute_seld_results import ComputeSELDResults, reshape_3Dto2D
import keras_model
import parameter
import time
def dump_DCASE2021_results(_data_gen, _feat_cls, _dcase_output_folder, _sed_pred, _doa_pred):
... | true | true |
f7241af30cfe709d69f072a6a9b64ee91c4729f2 | 6,083 | py | Python | tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 249 | 2015-01-15T16:50:53.000Z | 2022-03-24T13:23:34.000Z | tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 2,917 | 2015-01-12T16:17:49.000Z | 2022-03-31T11:57:47.000Z | tools/InterfaceGenerator/generator/generators/SmartFactoryJSONRPC.py | Sohei-Suzuki-Nexty/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | [
"BSD-3-Clause"
] | 306 | 2015-01-12T09:23:20.000Z | 2022-01-28T18:06:30.000Z | """SmartFactory code generator for JSONRPC format.
Defines JSONRPC format specific code generation rules.
"""
import string
from generator.generators import SmartFactoryBase
from model.enum_element import EnumElement
class CodeGenerator(SmartFactoryBase.CodeGenerator):
"""JSONRPC SmartFactory generator.
... | 38.01875 | 96 | 0.640309 | import string
from generator.generators import SmartFactoryBase
from model.enum_element import EnumElement
class CodeGenerator(SmartFactoryBase.CodeGenerator):
def __init__(self):
SmartFactoryBase.CodeGenerator.__init__(self)
def _gen_pre_function_schemas(self, functions):
code = u""
... | true | true |
f7241b0aa473034d8cb366bc0b2c1baf700088b7 | 2,724 | py | Python | tests/test_exceptions.py | wgarlock/prelaunch | 827b4520441fce537c4618421a3e815c933ab907 | [
"BSD-2-Clause"
] | 13 | 2017-06-15T07:35:39.000Z | 2020-08-06T13:25:47.000Z | tests/test_exceptions.py | suutari-ai/pip-requ | 93adbd63691cff1003cdc88868b20b2ad0c766cc | [
"BSD-2-Clause"
] | 28 | 2017-06-18T12:02:50.000Z | 2020-02-19T08:26:36.000Z | tests/test_exceptions.py | suutari-ai/pip-requ | 93adbd63691cff1003cdc88868b20b2ad0c766cc | [
"BSD-2-Clause"
] | 4 | 2018-04-28T11:14:51.000Z | 2020-12-27T16:01:16.000Z | import os
from prequ._pip_compat import (
create_package_finder, install_req_from_editable, install_req_from_line)
from prequ.exceptions import (
IncompatibleRequirements, NoCandidateFound, UnsupportedConstraint)
from .dirs import FAKE_PYPI_WHEELS_DIR
from .test_repositories import get_pypi_repository
try:
... | 36.810811 | 76 | 0.715859 | import os
from prequ._pip_compat import (
create_package_finder, install_req_from_editable, install_req_from_line)
from prequ.exceptions import (
IncompatibleRequirements, NoCandidateFound, UnsupportedConstraint)
from .dirs import FAKE_PYPI_WHEELS_DIR
from .test_repositories import get_pypi_repository
try:
... | true | true |
f7241bb68ff3065f7846b4e98897be67ff1b21a7 | 8,733 | py | Python | core/dbt/linker.py | pushpay/dbt | 8b96de893af692bd77fe9eb9a8104317be7b5413 | [
"Apache-2.0"
] | null | null | null | core/dbt/linker.py | pushpay/dbt | 8b96de893af692bd77fe9eb9a8104317be7b5413 | [
"Apache-2.0"
] | null | null | null | core/dbt/linker.py | pushpay/dbt | 8b96de893af692bd77fe9eb9a8104317be7b5413 | [
"Apache-2.0"
] | null | null | null | import networkx as nx
import threading
from dbt.compat import PriorityQueue
from dbt.node_types import NodeType
GRAPH_SERIALIZE_BLACKLIST = [
'agate_table'
]
def from_file(graph_file):
linker = Linker()
linker.read_graph(graph_file)
return linker
def is_blocking_dependency(node):
return node... | 31.989011 | 79 | 0.624986 | import networkx as nx
import threading
from dbt.compat import PriorityQueue
from dbt.node_types import NodeType
GRAPH_SERIALIZE_BLACKLIST = [
'agate_table'
]
def from_file(graph_file):
linker = Linker()
linker.read_graph(graph_file)
return linker
def is_blocking_dependency(node):
return node... | true | true |
f7241bfc54141abb811285ad6654b872e3b97148 | 18,771 | bzl | Python | third_party/js.bzl | wdirons/tensorboard | 605842dbe7857ae435fab6ff21e285ef77cb1323 | [
"Apache-2.0"
] | null | null | null | third_party/js.bzl | wdirons/tensorboard | 605842dbe7857ae435fab6ff21e285ef77cb1323 | [
"Apache-2.0"
] | null | null | null | third_party/js.bzl | wdirons/tensorboard | 605842dbe7857ae435fab6ff21e285ef77cb1323 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.37246 | 159 | 0.623408 |
load("@io_bazel_rules_closure//closure:defs.bzl", "filegroup_external")
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library_external")
def tensorboard_js_workspace():
"https://raw.githubusercontent.com/Microsoft/TypeScript/v2.9.2/lib/lib.dom.d.ts",
],
},
extra_... | true | true |
f7241cb443d374973211d2521ea063e08ac1cacc | 9,374 | py | Python | model/librarian.py | jbrew/wikiwords | 269803b7f4b5e18caf2a1d4544f066200d04d982 | [
"MIT"
] | null | null | null | model/librarian.py | jbrew/wikiwords | 269803b7f4b5e18caf2a1d4544f066200d04d982 | [
"MIT"
] | null | null | null | model/librarian.py | jbrew/wikiwords | 269803b7f4b5e18caf2a1d4544f066200d04d982 | [
"MIT"
] | null | null | null | import csv
import os
import math
from . import dictionary
from . import texthandler
from itertools import islice
import string
punctuation = ['.', ',', '!', '?', '(', ')', '$', ':', ';', '{', '}', '[', ']', '•', '|']
def text_from_path(path):
with open(path) as f:
return f.read()
def text_from_directory(dirpath)... | 26.555241 | 114 | 0.717943 | import csv
import os
import math
from . import dictionary
from . import texthandler
from itertools import islice
import string
punctuation = ['.', ',', '!', '?', '(', ')', '$', ':', ';', '{', '}', '[', ']', '•', '|']
def text_from_path(path):
with open(path) as f:
return f.read()
def text_from_directory(dirpath)... | true | true |
f7241cd61a0bf8e14920dbf630f13d68b111a34c | 30,616 | py | Python | flow/scenarios/base_scenario.py | nathanlct/flow | 5ca98bbf095293c54d2840770cc3f93608c0680e | [
"MIT"
] | null | null | null | flow/scenarios/base_scenario.py | nathanlct/flow | 5ca98bbf095293c54d2840770cc3f93608c0680e | [
"MIT"
] | null | null | null | flow/scenarios/base_scenario.py | nathanlct/flow | 5ca98bbf095293c54d2840770cc3f93608c0680e | [
"MIT"
] | null | null | null | """Contains the base scenario class."""
from flow.core.params import InitialConfig
from flow.core.params import TrafficLightParams
from flow.core.params import SumoCarFollowingParams
from flow.core.params import SumoLaneChangeParams
import time
import xml.etree.ElementTree as ElementTree
from lxml import etree
from co... | 40.930481 | 108 | 0.595179 |
from flow.core.params import InitialConfig
from flow.core.params import TrafficLightParams
from flow.core.params import SumoCarFollowingParams
from flow.core.params import SumoLaneChangeParams
import time
import xml.etree.ElementTree as ElementTree
from lxml import etree
from collections import defaultdict
try:
... | true | true |
f7241d76045fd1214f48d0e54f8255fdc59b914f | 7,786 | py | Python | iotbx/data_manager/model.py | dermen/cctbx_project | 43bd136e4edce123ecc62197024f2e9b85d6b446 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-02-01T14:25:48.000Z | 2021-09-15T16:36:29.000Z | iotbx/data_manager/model.py | dermen/cctbx_project | 43bd136e4edce123ecc62197024f2e9b85d6b446 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-06-14T17:04:17.000Z | 2019-06-24T20:54:12.000Z | iotbx/data_manager/model.py | dermen/cctbx_project | 43bd136e4edce123ecc62197024f2e9b85d6b446 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import absolute_import, division, print_function
'''
'''
import iotbx.pdb
import mmtbx.model
from iotbx.file_reader import any_file
from iotbx.data_manager import DataManagerBase
from libtbx import Auto
from libtbx.utils import Sorry
# =================================================================... | 35.230769 | 159 | 0.666581 | from __future__ import absolute_import, division, print_function
import iotbx.pdb
import mmtbx.model
from iotbx.file_reader import any_file
from iotbx.data_manager import DataManagerBase
from libtbx import Auto
from libtbx.utils import Sorry
class ModelDataManager(DataManagerBase):
datatype = 'model'
de... | true | true |
f7241dd029a49d81d312da3966adf13ebafac0c7 | 2,779 | py | Python | tests/test_issues/output/issue_113.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | null | null | null | tests/test_issues/output/issue_113.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | null | null | null | tests/test_issues/output/issue_113.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | null | null | null | # Auto generated from issue_113.yaml by pythongen.py version: 0.4.0
# Generation date: 2020-08-04 09:37
# Schema: schema
#
# id: https://microbiomedata/schema
# description:
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
from typing import Optional, List, Union, Dict, Class... | 37.554054 | 127 | 0.766103 |
import dataclasses
import sys
from typing import Optional, List, Union, Dict, ClassVar, Any
from dataclasses import dataclass
from biolinkml.utils.slot import Slot
from biolinkml.utils.metamodelcore import empty_list, empty_dict, bnode
from biolinkml.utils.yamlutils import YAMLRoot, extended_str, extended_float... | true | true |
f72420fba96513d94ff7d9c9661f5608d4400556 | 125,643 | py | Python | mrcnn/model.py | jongwookyi/Mask_RCNN | 9a26fa067a2087dbdf07f21a43dc2aa872ffe059 | [
"MIT"
] | null | null | null | mrcnn/model.py | jongwookyi/Mask_RCNN | 9a26fa067a2087dbdf07f21a43dc2aa872ffe059 | [
"MIT"
] | null | null | null | mrcnn/model.py | jongwookyi/Mask_RCNN | 9a26fa067a2087dbdf07f21a43dc2aa872ffe059 | [
"MIT"
] | null | null | null | """
Mask R-CNN
The main Mask R-CNN model implementation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import os
import datetime
import re
import math
from collections import OrderedDict
import multiprocessing
import numpy as np
import tenso... | 44.256076 | 115 | 0.612203 |
import os
import datetime
import re
import math
from collections import OrderedDict
import multiprocessing
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.backend as K
import tensorflow.keras.layers as KL
import tensorflow.keras.layers as KE
import tensorflow.keras.u... | true | true |
f72422d21c721489ea30f17fc3c39c216a26c7fe | 295 | py | Python | pyrism/tests/test_pyrism.py | 2AUK/pyrism | 7067fa7a261adc2faabcffbcb2d40d395e42a3c8 | [
"MIT"
] | 4 | 2020-10-26T14:32:08.000Z | 2021-03-26T01:23:37.000Z | pyrism/tests/test_pyrism.py | 2AUK/pyrism | 7067fa7a261adc2faabcffbcb2d40d395e42a3c8 | [
"MIT"
] | 1 | 2021-09-17T18:21:19.000Z | 2021-11-22T00:01:46.000Z | pyrism/tests/test_pyrism.py | 2AUK/pyrism | 7067fa7a261adc2faabcffbcb2d40d395e42a3c8 | [
"MIT"
] | 1 | 2022-03-08T12:00:35.000Z | 2022-03-08T12:00:35.000Z | """
Unit and regression test for the pyrism package.
"""
# Import package, test suite, and other packages as needed
import pyrism
import pytest
import sys
def test_pyrism_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "pyrism" in sys.modules
| 22.692308 | 74 | 0.742373 |
import pyrism
import pytest
import sys
def test_pyrism_imported():
assert "pyrism" in sys.modules
| true | true |
f72422e7430720064ce9521dd3b750947c119390 | 4,013 | py | Python | examples/simultaneous_translation/utils/functions.py | ictnlp/Dual-Path | 8c4577236908797ede1d971c11c2b3ef247e3469 | [
"MIT"
] | 3 | 2022-03-22T09:02:02.000Z | 2022-03-28T14:16:37.000Z | examples/simultaneous_translation/utils/functions.py | ictnlp/Dual-Path | 8c4577236908797ede1d971c11c2b3ef247e3469 | [
"MIT"
] | null | null | null | examples/simultaneous_translation/utils/functions.py | ictnlp/Dual-Path | 8c4577236908797ede1d971c11c2b3ef247e3469 | [
"MIT"
] | 1 | 2022-03-11T08:00:17.000Z | 2022-03-11T08:00:17.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
def exclusive_cumprod(tensor, dim: int, eps: float = 1e-10):
"""
Implementing exclusive cumprod.
There is cumprod i... | 25.890323 | 86 | 0.554448 |
import torch
def exclusive_cumprod(tensor, dim: int, eps: float = 1e-10):
tensor_size = list(tensor.size())
tensor_size[dim] = 1
return_tensor = safe_cumprod(
torch.cat([torch.ones(tensor_size, device=tensor.device), tensor], dim=dim),
dim=dim,
eps=eps,
)
if dim == 0:... | true | true |
f72423086a36f87912c69f9ab0d75e652edb58d3 | 7,080 | py | Python | train.py | uclyyu/over9000 | 42db9fa6ac5a9a2e177f1f9a9a660bee9cd5d587 | [
"Apache-2.0"
] | null | null | null | train.py | uclyyu/over9000 | 42db9fa6ac5a9a2e177f1f9a9a660bee9cd5d587 | [
"Apache-2.0"
] | null | null | null | train.py | uclyyu/over9000 | 42db9fa6ac5a9a2e177f1f9a9a660bee9cd5d587 | [
"Apache-2.0"
] | null | null | null | # the code mostly from https://github.com/sdoria/SimpleSelfAttention
# adapted from https://github.com/fastai/fastai/blob/master/examples/train_imagenette.py
# added self attention parameter
# changed per gpu bs for bs_rat
from fastai.script import *
from fastai.vision import *
from fastai.callbacks import *
from fa... | 42.142857 | 117 | 0.644068 |
from fastai.script import *
from fastai.vision import *
from fastai.callbacks import *
from fastai.distributed import *
from fastprogress import fastprogress
from torchvision.models import *
from xresnet import *
from functools import partial
import statsmodels.stats.api as sms
torch.backends.cudnn.benchmark... | true | true |
f724235889b40ee1930afc3bdbdf76d3255df0ce | 664 | py | Python | manage.py | aryanicosa/ppdb_mvt | cb4674fba6cb6663e7a5710f9a4b695c3bd574be | [
"MIT"
] | null | null | null | manage.py | aryanicosa/ppdb_mvt | cb4674fba6cb6663e7a5710f9a4b695c3bd574be | [
"MIT"
] | null | null | null | manage.py | aryanicosa/ppdb_mvt | cb4674fba6cb6663e7a5710f9a4b695c3bd574be | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ppdb_mvt.settings')
try:
from django.core.management import execute_from_command_line
except Imp... | 28.869565 | 73 | 0.679217 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ppdb_mvt.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7242487ac92a8fd05d59314d185adfdc7c880fd | 6,226 | py | Python | lexis/Lib/site-packages/oauth2_provider/settings.py | ALEXIS2ES/sherom-Serve | d63bc023f7cf45898f32dcce5d808aef944bc741 | [
"MIT"
] | null | null | null | lexis/Lib/site-packages/oauth2_provider/settings.py | ALEXIS2ES/sherom-Serve | d63bc023f7cf45898f32dcce5d808aef944bc741 | [
"MIT"
] | 7 | 2020-06-05T18:33:09.000Z | 2021-09-20T23:07:52.000Z | lexis/Lib/site-packages/oauth2_provider/settings.py | ALEXIS2ES/sherom-Serve | d63bc023f7cf45898f32dcce5d808aef944bc741 | [
"MIT"
] | null | null | null | """
This module is largely inspired by django-rest-framework settings.
Settings for the OAuth2 Provider are all namespaced in the OAUTH2_PROVIDER setting.
For example your project's `settings.py` file might look like this:
OAUTH2_PROVIDER = {
"CLIENT_ID_GENERATOR_CLASS":
"oauth2_provider.generators.Client... | 36.197674 | 107 | 0.694346 | from __future__ import unicode_literals
import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
USER_SETTINGS = getattr(settings, "OAUTH2_PROVIDER", None)
APPLICATION_MODEL = getattr(settings, "OAUTH2_PROVIDER_APPLICATION_MODEL", "oauth2_provider.Application")
ACCE... | true | true |
f72424ec1fa1a589ada062442ccfe87c8521630e | 8,530 | py | Python | stable_baselines3/dqn/policies.py | LucasAlegre/stable-baselines3 | 6b598323ae070bb0a998d25230f6e11eca4cbe61 | [
"MIT"
] | 26 | 2021-11-05T08:46:06.000Z | 2022-03-22T05:53:57.000Z | stable_baselines3/dqn/policies.py | LucasAlegre/stable-baselines3 | 6b598323ae070bb0a998d25230f6e11eca4cbe61 | [
"MIT"
] | 1 | 2021-11-19T11:13:37.000Z | 2021-11-30T09:08:04.000Z | stable_baselines3/dqn/policies.py | LucasAlegre/stable-baselines3 | 6b598323ae070bb0a998d25230f6e11eca4cbe61 | [
"MIT"
] | 5 | 2021-11-05T08:46:12.000Z | 2022-03-25T21:56:58.000Z | from typing import Any, Dict, List, Optional, Type
import gym
import torch as th
from torch import nn
from stable_baselines3.common.policies import BasePolicy, register_policy
from stable_baselines3.common.torch_layers import BaseFeaturesExtractor, FlattenExtractor, NatureCNN, create_mlp
from stable_baselines3.common... | 35.690377 | 112 | 0.654513 | from typing import Any, Dict, List, Optional, Type
import gym
import torch as th
from torch import nn
from stable_baselines3.common.policies import BasePolicy, register_policy
from stable_baselines3.common.torch_layers import BaseFeaturesExtractor, FlattenExtractor, NatureCNN, create_mlp
from stable_baselines3.common... | true | true |
f72425164382860b69a51927940bdfcff668687c | 454 | py | Python | env/Lib/site-packages/plotly/validators/histogram2d/_zauto.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/histogram2d/_zauto.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/histogram2d/_zauto.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ZautoValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="zauto", parent_name="histogram2d", **kwargs):
super(ZautoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 34.923077 | 81 | 0.662996 | import _plotly_utils.basevalidators
class ZautoValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="zauto", parent_name="histogram2d", **kwargs):
super(ZautoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f724265fd36867b631d89c00e4ac1e68ed8f44ba | 6,317 | py | Python | nameshark_vcard/nameshark_vcard.py | proinsias/nameshark-vcard | 3bd82201db34fb370c9b646f1adcce15e31c6137 | [
"MIT"
] | 1 | 2017-11-03T21:35:36.000Z | 2017-11-03T21:35:36.000Z | nameshark_vcard/nameshark_vcard.py | proinsias/nameshark-vcard | 3bd82201db34fb370c9b646f1adcce15e31c6137 | [
"MIT"
] | 336 | 2016-11-05T00:37:38.000Z | 2022-03-31T20:34:38.000Z | nameshark_vcard/nameshark_vcard.py | proinsias/nameshark-vcard | 3bd82201db34fb370c9b646f1adcce15e31c6137 | [
"MIT"
] | 1 | 2016-11-18T19:00:27.000Z | 2016-11-18T19:00:27.000Z | # The MIT License (MIT)
#
# Copyright (c) 2016 Francis T. O'Donovan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, co... | 30.370192 | 79 | 0.678012 |
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#... | true | true |
f72427339dc0e06167064cbaba2854f7fa43b88f | 1,949 | py | Python | huskyai/scraper/bing-image-search.py | wunderwuzzi23/ai | e71e971026a5d010d00a97022cfe376eafc386aa | [
"MIT"
] | 4 | 2020-09-06T06:52:35.000Z | 2021-08-16T11:21:44.000Z | huskyai/scraper/bing-image-search.py | wunderwuzzi23/ai | e71e971026a5d010d00a97022cfe376eafc386aa | [
"MIT"
] | null | null | null | huskyai/scraper/bing-image-search.py | wunderwuzzi23/ai | e71e971026a5d010d00a97022cfe376eafc386aa | [
"MIT"
] | 2 | 2020-09-06T06:54:10.000Z | 2021-03-03T15:50:02.000Z | import os
import requests
import matplotlib.pyplot as plt
from PIL import Image
from io import BytesIO, StringIO
import uuid
#config
download_folder = "data/huskies"
search_term = "siberian husky"
bing_api_key = os.path.join(os.getenv('HOME'), ".bingimagessearchkey")
subscription_key = open(bing_api_key,"rt").readlin... | 29.089552 | 109 | 0.662391 | import os
import requests
import matplotlib.pyplot as plt
from PIL import Image
from io import BytesIO, StringIO
import uuid
download_folder = "data/huskies"
search_term = "siberian husky"
bing_api_key = os.path.join(os.getenv('HOME'), ".bingimagessearchkey")
subscription_key = open(bing_api_key,"rt").readline().rst... | true | true |
f72427b5389f11ffe77ef095d0500e9eae4c2a4c | 3,622 | py | Python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/network/v2016_09_01/models/virtual_network.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure/mgmt/network/v2016_09_01/models/virtual_network.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.170732 | 198 | 0.650469 |
from .resource import Resource
class VirtualNetwork(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type... | true | true |
f7242804448ff4b2f473b97c4a2b021f1d175c50 | 227 | py | Python | examples/multi_file_cli/api.py | pnijhara/hug | 95e2f66baa57494b8751b43ad3da6c2d0e2d535d | [
"MIT"
] | 6,045 | 2015-08-12T11:11:39.000Z | 2019-04-07T16:42:28.000Z | examples/multi_file_cli/api.py | Warlockk/hug | 95e2f66baa57494b8751b43ad3da6c2d0e2d535d | [
"MIT"
] | 623 | 2015-08-12T16:08:45.000Z | 2019-04-07T23:07:47.000Z | examples/multi_file_cli/api.py | Warlockk/hug | 95e2f66baa57494b8751b43ad3da6c2d0e2d535d | [
"MIT"
] | 426 | 2015-08-13T04:23:01.000Z | 2019-04-07T20:46:41.000Z | import hug
import sub_api
@hug.cli()
def echo(text: hug.types.text):
return text
@hug.extend_api(sub_command="sub_api")
def extend_with():
return (sub_api,)
if __name__ == "__main__":
hug.API(__name__).cli()
| 12.611111 | 38 | 0.678414 | import hug
import sub_api
@hug.cli()
def echo(text: hug.types.text):
return text
@hug.extend_api(sub_command="sub_api")
def extend_with():
return (sub_api,)
if __name__ == "__main__":
hug.API(__name__).cli()
| true | true |
f72429427d8a34e18ac30aab9d42a7b0aef4b528 | 858 | py | Python | adain/learning_rate_schedule.py | srihari-humbarwadi/adain-tensorflow2.x | c0da16e4d39d5316683ed0988787aedbb1c9768c | [
"MIT"
] | 6 | 2020-12-27T08:20:19.000Z | 2021-07-03T10:28:21.000Z | adain/learning_rate_schedule.py | srihari-humbarwadi/adain-tensorflow2.x | c0da16e4d39d5316683ed0988787aedbb1c9768c | [
"MIT"
] | null | null | null | adain/learning_rate_schedule.py | srihari-humbarwadi/adain-tensorflow2.x | c0da16e4d39d5316683ed0988787aedbb1c9768c | [
"MIT"
] | null | null | null | import tensorflow as tf
class InverseDecay(tf.optimizers.schedules.LearningRateSchedule):
def __init__(self, initial_learning_rate, decay_rate):
super(InverseDecay, self).__init__()
self.initial_learning_rate = initial_learning_rate
self.decay_rate = decay_rate
def __call__... | 34.32 | 71 | 0.62704 | import tensorflow as tf
class InverseDecay(tf.optimizers.schedules.LearningRateSchedule):
def __init__(self, initial_learning_rate, decay_rate):
super(InverseDecay, self).__init__()
self.initial_learning_rate = initial_learning_rate
self.decay_rate = decay_rate
def __call__... | true | true |
f7242a2472438688a5b39ecd9f960bcbed390c2b | 3,144 | py | Python | Code/stack.py | StephanieCherubin/core-data-structures | ad0cdf204871d4fece225fe7bdcbc2dc39214ea4 | [
"MIT"
] | null | null | null | Code/stack.py | StephanieCherubin/core-data-structures | ad0cdf204871d4fece225fe7bdcbc2dc39214ea4 | [
"MIT"
] | 5 | 2019-06-16T21:01:43.000Z | 2019-07-04T21:51:09.000Z | Code/stack.py | StephanieCherubin/core-data-structures | ad0cdf204871d4fece225fe7bdcbc2dc39214ea4 | [
"MIT"
] | null | null | null | #!python
from linkedlist import LinkedList
class LinkedStack(object):
def __init__(self, iterable=None):
"""Initialize this stack and push the given items, if any."""
# Initialize a new linked list to store the items
self.list = LinkedList()
if iterable is not None:
f... | 31.128713 | 85 | 0.588422 |
from linkedlist import LinkedList
class LinkedStack(object):
def __init__(self, iterable=None):
self.list = LinkedList()
if iterable is not None:
for item in iterable:
self.push(item)
def __repr__(self):
return 'Stack({} items, top={})'.format(s... | true | true |
f7242b61df16023c351969eeec311557005a9a87 | 7,795 | py | Python | grove/main.py | andrewgryan/bokeh-playground | aeab70627a5ccd7f210c354098d30bdf92bb553f | [
"BSD-3-Clause"
] | 3 | 2018-10-01T18:37:44.000Z | 2019-11-15T10:56:28.000Z | grove/main.py | andrewgryan/bokeh-playground | aeab70627a5ccd7f210c354098d30bdf92bb553f | [
"BSD-3-Clause"
] | null | null | null | grove/main.py | andrewgryan/bokeh-playground | aeab70627a5ccd7f210c354098d30bdf92bb553f | [
"BSD-3-Clause"
] | 1 | 2019-01-17T07:21:48.000Z | 2019-01-17T07:21:48.000Z | import argparse
import bokeh.plotting
import bokeh.models
import bokeh.palettes
import bokeh.colors
import cartopy
import numpy as np
import netCDF4
GOOGLE = cartopy.crs.Mercator.GOOGLE
PLATE_CARREE = cartopy.crs.PlateCarree()
def parse_args(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument... | 31.305221 | 77 | 0.585888 | import argparse
import bokeh.plotting
import bokeh.models
import bokeh.palettes
import bokeh.colors
import cartopy
import numpy as np
import netCDF4
GOOGLE = cartopy.crs.Mercator.GOOGLE
PLATE_CARREE = cartopy.crs.PlateCarree()
def parse_args(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument... | true | true |
f7242c3e7e8f72ec6c4c08c81dda4862d59be050 | 3,976 | py | Python | JURISM-EXTRACT.py | zuphilip/legal-resource-registry | 310bea8d17e07e9818015a3c04aae81214de9f9c | [
"BSD-2-Clause"
] | null | null | null | JURISM-EXTRACT.py | zuphilip/legal-resource-registry | 310bea8d17e07e9818015a3c04aae81214de9f9c | [
"BSD-2-Clause"
] | null | null | null | JURISM-EXTRACT.py | zuphilip/legal-resource-registry | 310bea8d17e07e9818015a3c04aae81214de9f9c | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
import os,sys,re,json
TESTING = ['ca', 'un.int']
def sortInfo(a, b):
if a[0] > b[0]:
return -1
elif a[0] < b[0]:
return 1
else:
return 0
class Courts():
def __init__(self, opt):
self.opt = opt
self.walk()
def checkFile(self, dirname... | 32.590164 | 95 | 0.502012 |
import os,sys,re,json
TESTING = ['ca', 'un.int']
def sortInfo(a, b):
if a[0] > b[0]:
return -1
elif a[0] < b[0]:
return 1
else:
return 0
class Courts():
def __init__(self, opt):
self.opt = opt
self.walk()
def checkFile(self, dirname):
ifh = ... | true | true |
f7242c909ddbbc02190ea1c52b9234a5504cda6f | 2,892 | py | Python | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_check/Opengauss_Function_Tools_gs_check_Case0378.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_check/Opengauss_Function_Tools_gs_check_Case0378.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_check/Opengauss_Function_Tools_gs_check_Case0378.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.15 | 84 | 0.629322 |
import os
import unittest
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
from yat.test import Node
from yat.test import macro
class Tools(unittest.TestCase):
def setUp(self):
self.log = Logger()
self.log.info('---Opengauss_Function_Tools_gs_check_Case0378_开... | true | true |
f7242d7d37bde296d9898568e1954e17602cae9c | 294 | py | Python | src/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.py | lyphui/Just-Code | e0c3c3ecb67cb805080ff686e88522b2bffe7741 | [
"MIT"
] | 782 | 2019-11-19T08:20:49.000Z | 2022-03-25T06:59:09.000Z | src/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 1 | 2021-03-04T12:21:01.000Z | 2021-03-05T01:23:54.000Z | src/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 155 | 2019-11-20T08:20:42.000Z | 2022-03-19T07:28:09.000Z | class Solution:
def maxEqualRowsAfterFlips(self, matrix: List[List[int]]) -> int:
pattern = collections.defaultdict(int)
for row in matrix:
pattern[tuple(row)] += 1
pattern[tuple(1 - c for c in row)] += 1
return max(pattern.values()) | 36.75 | 69 | 0.578231 | class Solution:
def maxEqualRowsAfterFlips(self, matrix: List[List[int]]) -> int:
pattern = collections.defaultdict(int)
for row in matrix:
pattern[tuple(row)] += 1
pattern[tuple(1 - c for c in row)] += 1
return max(pattern.values()) | true | true |
f7242e4d28fb291868f594740866678de4dde987 | 775 | py | Python | main_hub/migrations/0005_auto_20190717_1512.py | emiledelmas/vkshub | 214cc35985573654e3b81c6ab674049bd93262b8 | [
"MIT"
] | 1 | 2020-03-31T14:26:55.000Z | 2020-03-31T14:26:55.000Z | main_hub/migrations/0005_auto_20190717_1512.py | emiledelmas/vkshub | 214cc35985573654e3b81c6ab674049bd93262b8 | [
"MIT"
] | null | null | null | main_hub/migrations/0005_auto_20190717_1512.py | emiledelmas/vkshub | 214cc35985573654e3b81c6ab674049bd93262b8 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-17 13:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_hub', '0004_auto_20190717_1154'),
]
operations = [
migrations.RemoveField(
model_name='document',
name='file',
... | 24.21875 | 83 | 0.547097 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_hub', '0004_auto_20190717_1154'),
]
operations = [
migrations.RemoveField(
model_name='document',
name='file',
),
migrations.RemoveField(
... | true | true |
f7242e88b17192c50c5629365da85996632cd697 | 5,633 | py | Python | fastweb/loader.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 123 | 2017-06-06T04:59:07.000Z | 2019-07-11T10:20:35.000Z | fastweb/loader.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | null | null | null | fastweb/loader.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 2 | 2017-06-28T05:58:39.000Z | 2018-09-25T00:18:33.000Z | # coding:utf8
"""系统全局加载模块
外部调用想要影响fastweb行为,必须通过改模块中的方法
所有工作都是在启动前完成,外部导入全部使用全路径引用,防止错误的引入
"""
import json
from .accesspoint import ioloop
import fastweb.manager
from fastweb.util.tool import timing
from fastweb.accesspoint import AsyncHTTPClient
from fastweb.util.configuration import ConfigurationParser
from fastw... | 34.347561 | 116 | 0.59968 |
import json
from .accesspoint import ioloop
import fastweb.manager
from fastweb.util.tool import timing
from fastweb.accesspoint import AsyncHTTPClient
from fastweb.util.configuration import ConfigurationParser
from fastweb.util.log import setup_logging, getLogger, recorder, check_logging_level, set_record_color
... | true | true |
f7242f0f2b5f3d7eb503d60928904f226091cf0f | 4,284 | py | Python | circuitgraph/tests/test_analysis.py | ncasti/circuitgraph | 9fe129d6ba64b4254d2d27d16ae69b7dce5ce957 | [
"MIT"
] | 35 | 2020-07-17T21:02:31.000Z | 2022-03-22T20:48:30.000Z | circuitgraph/tests/test_analysis.py | ncasti/circuitgraph | 9fe129d6ba64b4254d2d27d16ae69b7dce5ce957 | [
"MIT"
] | 23 | 2020-07-30T17:58:33.000Z | 2021-09-24T16:41:34.000Z | circuitgraph/tests/test_analysis.py | ncasti/circuitgraph | 9fe129d6ba64b4254d2d27d16ae69b7dce5ce957 | [
"MIT"
] | 6 | 2020-07-31T18:27:14.000Z | 2021-11-11T19:32:47.000Z | import unittest
import circuitgraph as cg
from circuitgraph.analysis import *
from circuitgraph.sat import sat
from random import choice, randint
from itertools import product
class TestAnalysis(unittest.TestCase):
def setUp(self):
self.s27 = cg.strip_blackboxes(cg.from_lib("s27"))
def test_avg_sens... | 31.970149 | 85 | 0.516106 | import unittest
import circuitgraph as cg
from circuitgraph.analysis import *
from circuitgraph.sat import sat
from random import choice, randint
from itertools import product
class TestAnalysis(unittest.TestCase):
def setUp(self):
self.s27 = cg.strip_blackboxes(cg.from_lib("s27"))
def test_avg_sens... | true | true |
f7242faaca258f687d6365a02303dbefc35f6202 | 2,619 | py | Python | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_workload_sap_hana_restore_request.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_workload_sap_hana_restore_request.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_workload_sap_hana_restore_request.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41.571429 | 121 | 0.670485 |
from .restore_request import RestoreRequest
class AzureWorkloadSAPHanaRestoreRequest(RestoreRequest):
_validation = {
'object_type': {'required': True},
}
_attribute_map = {
'object_type': {'key': 'objectType', 'type': 'str'},
'target_info': {'key': 'targetInfo', 'type... | true | true |
f7242fe5b59041f8406448a3ea74883747eb45c6 | 19,164 | py | Python | f5_openstack_agent/lbaasv2/drivers/bigip/listener_service.py | F5K-Jayson/f5-openstack-agent | f98f48266f029a719a2d446a06c741f0ed6653ff | [
"Apache-2.0"
] | null | null | null | f5_openstack_agent/lbaasv2/drivers/bigip/listener_service.py | F5K-Jayson/f5-openstack-agent | f98f48266f029a719a2d446a06c741f0ed6653ff | [
"Apache-2.0"
] | null | null | null | f5_openstack_agent/lbaasv2/drivers/bigip/listener_service.py | F5K-Jayson/f5-openstack-agent | f98f48266f029a719a2d446a06c741f0ed6653ff | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014-2016 F5 Networks 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 o... | 41.212903 | 79 | 0.605615 |
from oslo_log import log as logging
from f5_openstack_agent.lbaasv2.drivers.bigip.disconnected_service import \
DisconnectedService
from f5_openstack_agent.lbaasv2.drivers.bigip import resource_helper
from f5_openstack_agent.lbaasv2.drivers.bigip import ssl_profile
from neutron_lbaas.services.loadb... | true | true |
f7243021c6bc2b2b7e4fce423c5f1bc7c762d9c5 | 4,057 | bzl | Python | build_defs/kotlin_native/build_defs.bzl | bayesianmind/arcs | 2808acd1a30b77142c8c75c62880cb36930743c5 | [
"BSD-Source-Code"
] | null | null | null | build_defs/kotlin_native/build_defs.bzl | bayesianmind/arcs | 2808acd1a30b77142c8c75c62880cb36930743c5 | [
"BSD-Source-Code"
] | null | null | null | build_defs/kotlin_native/build_defs.bzl | bayesianmind/arcs | 2808acd1a30b77142c8c75c62880cb36930743c5 | [
"BSD-Source-Code"
] | null | null | null | load("//build_defs/kotlin_native:repo.bzl", "get_dependencies")
KtNativeInfo = provider(
doc = "The minimum info about a Kotlin/Native dependency",
fields = dict(
klibraries = "Depset of klib files to compile against.",
),
)
def _common_args(ctx, klibs):
args = ctx.actions.args()
# Pass d... | 29.398551 | 117 | 0.585408 | load("//build_defs/kotlin_native:repo.bzl", "get_dependencies")
KtNativeInfo = provider(
doc = "The minimum info about a Kotlin/Native dependency",
fields = dict(
klibraries = "Depset of klib files to compile against.",
),
)
def _common_args(ctx, klibs):
args = ctx.actions.args()
arg... | true | true |
f7243050540f676f74a71bf7c7821524843a1e15 | 25,625 | py | Python | experiments/tmhmm3/tm_models.py | PTPeraire/openprotein | 3f6ede8c63d18f14e938bd47935001a82c4d6897 | [
"MIT"
] | null | null | null | experiments/tmhmm3/tm_models.py | PTPeraire/openprotein | 3f6ede8c63d18f14e938bd47935001a82c4d6897 | [
"MIT"
] | null | null | null | experiments/tmhmm3/tm_models.py | PTPeraire/openprotein | 3f6ede8c63d18f14e938bd47935001a82c4d6897 | [
"MIT"
] | null | null | null | """
This file is part of the OpenProtein project.
For license information, please see the LICENSE file in the root directory.
"""
import sys
from enum import Enum
import glob
import pickle
import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
import openprotein
from experiments.tmhmm... | 48.258004 | 100 | 0.561639 |
import sys
from enum import Enum
import glob
import pickle
import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
import openprotein
from experiments.tmhmm3.tm_util import label_list_to_topology
from experiments.tmhmm3.tm_util import get_predicted_type_from_labels
from experiments.tmhm... | true | true |
f724310ed89a048b1602d1084baca21f8eecd141 | 1,427 | py | Python | examples/PsyNeuLink/SimpleLinear-conditional.reconstructed.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | 12 | 2021-01-18T20:38:21.000Z | 2022-03-29T15:01:10.000Z | examples/PsyNeuLink/SimpleLinear-conditional.reconstructed.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | 101 | 2020-12-14T15:23:07.000Z | 2022-03-31T17:06:19.000Z | examples/PsyNeuLink/SimpleLinear-conditional.reconstructed.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | 15 | 2020-12-04T22:37:14.000Z | 2022-03-31T09:48:03.000Z | import psyneulink as pnl
comp = pnl.Composition(name="comp")
A = pnl.TransferMechanism(
name="A",
function=pnl.Linear(default_variable=[[0]]),
termination_measure=pnl.Distance(
metric=pnl.MAX_ABS_DIFF, default_variable=[[[0]], [[0]]]
),
)
B = pnl.TransferMechanism(
name="B",
function=p... | 25.482143 | 66 | 0.669236 | import psyneulink as pnl
comp = pnl.Composition(name="comp")
A = pnl.TransferMechanism(
name="A",
function=pnl.Linear(default_variable=[[0]]),
termination_measure=pnl.Distance(
metric=pnl.MAX_ABS_DIFF, default_variable=[[[0]], [[0]]]
),
)
B = pnl.TransferMechanism(
name="B",
function=p... | true | true |
f724311b8aa29b6d723ea5b6061ce5d9ef2b7e24 | 58,123 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 55.620096 | 297 | 0.687525 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Asyn... | true | true |
f72432220e47112d35c216df1584e2f8fc4a4e9c | 2,059 | py | Python | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_i_renyi.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | 5 | 2021-01-06T16:49:22.000Z | 2021-02-19T05:34:27.000Z | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_i_renyi.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_i_renyi.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Demo for Renyi mutual information estimators.
Analytical vs estimated value is illustrated for normal random variables.
"""
from numpy.random import rand, multivariate_normal
from numpy import arange, zeros, dot, ones
import matplotlib.pyplot as plt
from ite.cost.x_factory import co_fact... | 30.279412 | 75 | 0.643031 |
from numpy.random import rand, multivariate_normal
from numpy import arange, zeros, dot, ones
import matplotlib.pyplot as plt
from ite.cost.x_factory import co_factory
from ite.cost.x_analytical_values import analytical_value_i_renyi
def main():
alpha = 0.7
dim = 2
num_of_samples_v = arange(1... | true | true |
f724339a771fde8c1bbb61d0248adbfa3b022d68 | 1,873 | py | Python | Nemea/backend/Reporters.py | Akhady/Nemea-GUI | 34820f13a588ed18529200d31c7d16d3f53f2020 | [
"BSD-3-Clause"
] | null | null | null | Nemea/backend/Reporters.py | Akhady/Nemea-GUI | 34820f13a588ed18529200d31c7d16d3f53f2020 | [
"BSD-3-Clause"
] | null | null | null | Nemea/backend/Reporters.py | Akhady/Nemea-GUI | 34820f13a588ed18529200d31c7d16d3f53f2020 | [
"BSD-3-Clause"
] | 1 | 2019-06-05T08:04:04.000Z | 2019-06-05T08:04:04.000Z | """
Advanced reporter configuration module
This module retrieves configuration in YAML format and converts it to JSON
There is only PUT method for editing the configuration
Path to configuration is specified in config.ini in this folder.
"""
from liberouterapi import config
from liberouterapi.error import ApiExcepti... | 30.209677 | 106 | 0.698879 | from liberouterapi import config
from liberouterapi.error import ApiException
from bson import json_util as json
import yaml
from flask import request
import os
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
class ReporterError(ApiException):
status_code = 500
if 'reporters_config'... | true | true |
f72433dd66be88aac1eb531a991f3b9501a547f9 | 890 | py | Python | scripts/hash_value.py | kemysr/cloud-run-sample-flask | c9e7c71a2671f06ec9948e43f57aad69d6074f79 | [
"Apache-2.0"
] | 6 | 2020-06-03T19:48:28.000Z | 2022-03-13T13:35:23.000Z | scripts/hash_value.py | kemysr/cloud-run-sample-flask | c9e7c71a2671f06ec9948e43f57aad69d6074f79 | [
"Apache-2.0"
] | null | null | null | scripts/hash_value.py | kemysr/cloud-run-sample-flask | c9e7c71a2671f06ec9948e43f57aad69d6074f79 | [
"Apache-2.0"
] | 21 | 2020-06-03T19:59:37.000Z | 2022-03-29T21:44:19.000Z | #!/usr/bin/env python3
import argparse
import hashlib
# This script reads the --value argument from the command
# line and outputs its SHA 512 hash.
# In this tutorial, we use this for generating the value
# that the application uses for its basic authentication.
# We do this, so the basic auth secret is not stored i... | 28.709677 | 75 | 0.71573 |
import argparse
import hashlib
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument('--value', help='The value to hash', required=True)
args = parser.parse_args()
if ... | true | true |
f72433f9b152958ddcdfd7ecaa36b8bc22aec097 | 71 | py | Python | aiida_orca/workchains/__init__.py | pzarabadip/aiida-orca | 5b2cba2b518837c35179b52ac1141eda27609f4b | [
"MIT"
] | 3 | 2021-03-24T08:29:07.000Z | 2021-06-26T20:53:03.000Z | aiida_orca/workchains/__init__.py | pzarabadip/aiida-orca | 5b2cba2b518837c35179b52ac1141eda27609f4b | [
"MIT"
] | 25 | 2020-03-13T23:18:48.000Z | 2021-12-06T19:07:41.000Z | aiida_orca/workchains/__init__.py | pzarabadip/aiida-orca | 5b2cba2b518837c35179b52ac1141eda27609f4b | [
"MIT"
] | 2 | 2020-03-19T19:54:32.000Z | 2021-07-05T18:41:09.000Z | """Initialize OrcaBaseWorkChain"""
from .base import OrcaBaseWorkChain
| 23.666667 | 35 | 0.816901 | from .base import OrcaBaseWorkChain
| true | true |
f72437e9ba479ba40bff626aedeb17230a9014ce | 247 | py | Python | mongoapi/hotline_database/hotline_model.py | 133794m3r/i_am_not_forgotten | f70d117fa2f36aacd335575c6932840c8a3f8204 | [
"MIT"
] | null | null | null | mongoapi/hotline_database/hotline_model.py | 133794m3r/i_am_not_forgotten | f70d117fa2f36aacd335575c6932840c8a3f8204 | [
"MIT"
] | null | null | null | mongoapi/hotline_database/hotline_model.py | 133794m3r/i_am_not_forgotten | f70d117fa2f36aacd335575c6932840c8a3f8204 | [
"MIT"
] | 2 | 2020-06-14T11:27:04.000Z | 2020-06-15T23:09:29.000Z | from .hotline_db import hotline_db
class crisis_numbers(hotline_db.Document):
country = hotline_db.StringField(required=True, unique=True)
numbers = hotline_db.StringField(required=True)
website = hotline_db.StringField(required=True) | 41.166667 | 64 | 0.797571 | from .hotline_db import hotline_db
class crisis_numbers(hotline_db.Document):
country = hotline_db.StringField(required=True, unique=True)
numbers = hotline_db.StringField(required=True)
website = hotline_db.StringField(required=True) | true | true |
f7243801a587811168765ed7f35e7bc015e97c4f | 621 | py | Python | bag_serdes_ec-master/scripts_test/passives/ctle.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | bag_serdes_ec-master/scripts_test/passives/ctle.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | bag_serdes_ec-master/scripts_test/passives/ctle.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 1 | 2020-01-07T04:53:53.000Z | 2020-01-07T04:53:53.000Z | # -*- coding: utf-8 -*-
import yaml
from bag.core import BagProject
from serdes_ec.layout.analog.passives import PassiveCTLE
if __name__ == '__main__':
with open('specs_test/serdes_ec/passives/ctle.yaml', 'r') as f:
block_specs = yaml.load(f)
local_dict = locals()
if 'bprj' not in local_dict:
... | 24.84 | 90 | 0.673108 |
import yaml
from bag.core import BagProject
from serdes_ec.layout.analog.passives import PassiveCTLE
if __name__ == '__main__':
with open('specs_test/serdes_ec/passives/ctle.yaml', 'r') as f:
block_specs = yaml.load(f)
local_dict = locals()
if 'bprj' not in local_dict:
print('creating... | true | true |
f72438931987b95f573f3d0f7e0d72e2f7f4286b | 255 | py | Python | config.py | Yupps00/Addarr | 8e5edccbd02484eacadce3c1301199849d5c24e5 | [
"MIT"
] | null | null | null | config.py | Yupps00/Addarr | 8e5edccbd02484eacadce3c1301199849d5c24e5 | [
"MIT"
] | null | null | null | config.py | Yupps00/Addarr | 8e5edccbd02484eacadce3c1301199849d5c24e5 | [
"MIT"
] | null | null | null | import yaml
from definitions import CONFIG_PATH, DEFAULT_SETTINGS
config = yaml.safe_load(open(CONFIG_PATH, encoding="utf8"))
for setting, default_value in DEFAULT_SETTINGS.items():
if setting not in config:
config[setting] = default_value
| 25.5 | 59 | 0.768627 | import yaml
from definitions import CONFIG_PATH, DEFAULT_SETTINGS
config = yaml.safe_load(open(CONFIG_PATH, encoding="utf8"))
for setting, default_value in DEFAULT_SETTINGS.items():
if setting not in config:
config[setting] = default_value
| true | true |
f7243924de59d376bd6df8d43b9f799febe44bf6 | 1,861 | py | Python | src/installer/src/tortuga/node/types.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 33 | 2018-03-02T17:07:39.000Z | 2021-05-21T18:02:51.000Z | src/installer/src/tortuga/node/types.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 201 | 2018-03-05T14:28:24.000Z | 2020-11-23T19:58:27.000Z | src/installer/src/tortuga/node/types.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 23 | 2018-03-02T17:21:59.000Z | 2020-11-18T14:52:38.000Z | from typing import Dict, Optional
from marshmallow import fields, validate
from tortuga.node.state import ALLOWED_NODE_STATES
from tortuga.types.base import BaseType, BaseTypeSchema
NodeStateValidator = validate.OneOf(
choices=ALLOWED_NODE_STATES,
error="Invalid node state '{input}'; must be one of {choices... | 32.086207 | 73 | 0.681891 | from typing import Dict, Optional
from marshmallow import fields, validate
from tortuga.node.state import ALLOWED_NODE_STATES
from tortuga.types.base import BaseType, BaseTypeSchema
NodeStateValidator = validate.OneOf(
choices=ALLOWED_NODE_STATES,
error="Invalid node state '{input}'; must be one of {choices... | true | true |
f72439a2484b51b9b7304a2216a642943331134b | 1,769 | py | Python | tests/util/key_tool.py | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 7 | 2021-12-26T11:05:19.000Z | 2022-02-24T10:42:45.000Z | tests/util/key_tool.py | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 8 | 2021-12-14T17:27:29.000Z | 2022-03-29T18:18:22.000Z | tests/util/key_tool.py | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 1 | 2021-12-09T23:51:12.000Z | 2021-12-09T23:51:12.000Z | from typing import List
from blspy import AugSchemeMPL, G2Element, PrivateKey
from chives.types.blockchain_format.sized_bytes import bytes32
from chives.types.coin_spend import CoinSpend
from chives.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict
from tests.cor... | 43.146341 | 116 | 0.734878 | from typing import List
from blspy import AugSchemeMPL, G2Element, PrivateKey
from chives.types.blockchain_format.sized_bytes import bytes32
from chives.types.coin_spend import CoinSpend
from chives.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict
from tests.cor... | true | true |
f7243b01372fbdcb620be6192d4501a32b4cd452 | 89 | py | Python | apps/credito/apps.py | andipandiber/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | null | null | null | apps/credito/apps.py | andipandiber/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | 8 | 2021-03-30T13:39:24.000Z | 2022-03-12T00:36:15.000Z | apps/credito/apps.py | andresbermeoq/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CreditoConfig(AppConfig):
name = 'credito'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class CreditoConfig(AppConfig):
name = 'credito'
| true | true |
f7243b66f9c1cefc6724cfff38cd884d864c2db8 | 531 | py | Python | university_entities.py | kozlovsky/ponymodules | 4b123ca31cfe48bdb314e41eb21b842ae0825554 | [
"MIT"
] | 3 | 2015-02-03T12:05:23.000Z | 2018-02-14T12:37:30.000Z | university_entities.py | kozlovsky/ponymodules | 4b123ca31cfe48bdb314e41eb21b842ae0825554 | [
"MIT"
] | null | null | null | university_entities.py | kozlovsky/ponymodules | 4b123ca31cfe48bdb314e41eb21b842ae0825554 | [
"MIT"
] | null | null | null | # This module contains entities for some specific application domain,
# namely - for the university
from pony.orm import *
from base_entities import db
class Teacher(db.User):
degree = Required(str)
courses = Set("Course")
class Student(db.User):
group = Required("Group")
courses = Set("Course")
... | 22.125 | 69 | 0.689266 |
from pony.orm import *
from base_entities import db
class Teacher(db.User):
degree = Required(str)
courses = Set("Course")
class Student(db.User):
group = Required("Group")
courses = Set("Course")
gpa = Required(float)
class Group(db.Entity):
number = PrimaryKey(int)
students = Set(Stu... | true | true |
f7243c0f06670ed1457b934c4914d2983fea2179 | 2,951 | py | Python | src/cobra/templatetags/organization_tags.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | 1 | 2015-01-27T08:56:46.000Z | 2015-01-27T08:56:46.000Z | src/cobra/templatetags/organization_tags.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | null | null | null | src/cobra/templatetags/organization_tags.py | lyoniionly/django-cobra | 2427e5cf74b7739115b1224da3306986b3ee345c | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from django import template
from django.db.models import Q
from django.utils.safestring import SafeString
from cobra.apps.accounts.utils import get_user_info
from cobra.core.loading import get_model
from cobra.core.permissions import is_organization_admin, can_manage_org
from cobra.c... | 29.808081 | 97 | 0.73941 | from collections import defaultdict
from django import template
from django.db.models import Q
from django.utils.safestring import SafeString
from cobra.apps.accounts.utils import get_user_info
from cobra.core.loading import get_model
from cobra.core.permissions import is_organization_admin, can_manage_org
from cobra.c... | true | true |
f7243c65f64be321b1681b267b99023e62712fa4 | 2,300 | py | Python | app/main/forms/ab_1.py | spetrovic450/ksvotes.org | 1fa25a4098657b5f2f89e345332a26b92b993ecd | [
"MIT"
] | 10 | 2018-08-28T13:35:27.000Z | 2021-07-17T18:01:04.000Z | app/main/forms/ab_1.py | spetrovic450/ksvotes.org | 1fa25a4098657b5f2f89e345332a26b92b993ecd | [
"MIT"
] | 253 | 2018-05-14T14:51:35.000Z | 2021-07-23T00:49:04.000Z | app/main/forms/ab_1.py | lukecivantos/flvotes | ace6fbee9d6cfaa9e4e69e266e321d041ad65da4 | [
"MIT"
] | 5 | 2019-09-05T15:10:32.000Z | 2021-09-30T23:37:04.000Z | import datetime
from flask_wtf import FlaskForm
from wtforms import SelectField, SelectMultipleField, widgets, StringField
from wtforms.validators import DataRequired
from flask_babel import lazy_gettext
from app.main.helpers import is_even_year
class MultiCheckboxField(SelectMultipleField):
widget = widgets.Lis... | 34.848485 | 118 | 0.68087 | import datetime
from flask_wtf import FlaskForm
from wtforms import SelectField, SelectMultipleField, widgets, StringField
from wtforms.validators import DataRequired
from flask_babel import lazy_gettext
from app.main.helpers import is_even_year
class MultiCheckboxField(SelectMultipleField):
widget = widgets.Lis... | true | true |
f7243cbe297538fda22473a8806395c5effa6634 | 255 | py | Python | server/apps/accounts/api/urls.py | supercooledcreations/djangular-seed | 6f73c7d91cd510ff03548a578a06730b4c351274 | [
"MIT"
] | null | null | null | server/apps/accounts/api/urls.py | supercooledcreations/djangular-seed | 6f73c7d91cd510ff03548a578a06730b4c351274 | [
"MIT"
] | 2 | 2020-06-05T18:23:13.000Z | 2021-06-10T20:30:24.000Z | server/apps/accounts/api/urls.py | supercooledcreations/djangular-seed | 6f73c7d91cd510ff03548a578a06730b4c351274 | [
"MIT"
] | null | null | null | from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
from .views import RegisterAPIView
urlpatterns = [
# JWT
path('register/', RegisterAPIView.as_view()),
path('login/', obtain_jwt_token),
] | 23.181818 | 72 | 0.756863 | from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token
from .views import RegisterAPIView
urlpatterns = [
path('register/', RegisterAPIView.as_view()),
path('login/', obtain_jwt_token),
] | true | true |
f7243cc1b5a9ed4a6cee6275399bb27e7e0e4cac | 2,145 | py | Python | python/src/nnabla/context.py | syoyo/nnabla | b776b68dcdffe894cac1233dfd07c301415cc0fb | [
"Apache-2.0"
] | 1 | 2020-08-03T12:49:19.000Z | 2020-08-03T12:49:19.000Z | python/src/nnabla/context.py | langbin2014/nnabla | e94bac5bed65337010e2ac07a5937fb862ab2dd8 | [
"Apache-2.0"
] | 1 | 2020-11-09T07:33:29.000Z | 2020-11-09T07:33:29.000Z | python/src/nnabla/context.py | langbin2014/nnabla | e94bac5bed65337010e2ac07a5937fb862ab2dd8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 24.375 | 92 | 0.663403 |
from __future__ import absolute_import
from contextlib import contextmanager
from .variable import Context
current_ctx = Context()
context_level = 0
@contextmanager
def context_scope(ctx):
global current_ctx
global context_level
context_level += 1
prev_context = current_ctx
curren... | true | true |
f7243dae5379fe7773261511200764ad59342d37 | 10,478 | py | Python | GTSRB/train_standard_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 14 | 2020-11-16T03:57:19.000Z | 2022-03-30T01:44:53.000Z | GTSRB/train_standard_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | null | null | null | GTSRB/train_standard_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 5 | 2020-11-16T03:56:00.000Z | 2022-03-19T06:37:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This is the implement of standard training on GTSRB dataset.
Copyright (c) Yiming Li, 2020
'''
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
impor... | 33.691318 | 176 | 0.617293 |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import gt... | true | true |
f7243ece8fee42902951221c8ca46e1a47204344 | 1,686 | py | Python | examples/certificate_authority.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | examples/certificate_authority.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | examples/certificate_authority.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 30.654545 | 75 | 0.771649 |
rom pprint import pprint
from config_loader import try_load_from_file
from hpOneView.oneview_client import OneViewClient
config = {
"ip": "",
"credentials": {
"userName": "",
"password": ""
}
}
config = try_load_from_file(config)
oneview_client = OneViewClient(config)
prin... | true | true |
f7243f26df4b059080a9f14f425e1616dfe8271f | 8,598 | py | Python | tests/broker/test_publish_sandbox.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 7 | 2015-07-31T05:57:30.000Z | 2021-09-07T15:18:56.000Z | tests/broker/test_publish_sandbox.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 115 | 2015-03-03T13:11:46.000Z | 2021-09-20T12:42:24.000Z | tests/broker/test_publish_sandbox.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 13 | 2015-03-03T11:17:59.000Z | 2021-09-09T09:16:41.000Z | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 43.867347 | 78 | 0.585485 |
import os
from shutil import copy, rmtree
from subprocess import Popen, PIPE
import unittest
from brokertest import TestBrokerCommand
if __name__ == "__main__":
import utils
utils.import_depends()
class TestPublishSandbox(TestBrokerCommand):
@classmethod
def setUpClass(cls):
... | true | true |
f72442631484d92c7dcede95d1d98e464d00507c | 3,779 | py | Python | Fancy_aggregations/moderate_deviations.py | iosurodri/Fancy_aggregations | 647019452a074767706893ecdd431a3ee503b554 | [
"MIT"
] | 1 | 2021-03-25T11:48:20.000Z | 2021-03-25T11:48:20.000Z | Fancy_aggregations/moderate_deviations.py | iosurodri/Fancy_aggregations | 647019452a074767706893ecdd431a3ee503b554 | [
"MIT"
] | null | null | null | Fancy_aggregations/moderate_deviations.py | iosurodri/Fancy_aggregations | 647019452a074767706893ecdd431a3ee503b554 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
File containing different functions to aggregate data using Moderate Deviations. The expressions have been obtained from the following paper:
A.H. Altalhi, J.I. Forcén, M. Pagola, E. Barrenechea, H. Bustince, Zdenko Takáč,
Moderate deviation and restricted equivalence functions for measurin... | 24.861842 | 141 | 0.546705 |
import numpy as np
def custom_distance(x, y, Mp, Mn, R1, R2):
if x <= y:
return Mp - Mp*R1(x, y)
else:
return Mn*R2(x,y) - Mn
def custom_distance_morphs(x, y, Mp, Mn, F1, F2, T1, T2):
pass
def distance_f1(x, y, Mp, Mn):
if x <= y:
return Mp*(y - x)*(y - x)
else:
... | true | true |
f724427f59fd29bc59e03a5db29564b0e3328b9b | 175 | py | Python | Python/tryexcept.py | Brabec/Hacktoberfest2020 | d3a85850a462ab24abf59d68b5142e0b61b5ce37 | [
"MIT"
] | null | null | null | Python/tryexcept.py | Brabec/Hacktoberfest2020 | d3a85850a462ab24abf59d68b5142e0b61b5ce37 | [
"MIT"
] | null | null | null | Python/tryexcept.py | Brabec/Hacktoberfest2020 | d3a85850a462ab24abf59d68b5142e0b61b5ce37 | [
"MIT"
] | null | null | null | astr = 'HelloThere'
try:
istr = int(astr)
except:
istr = -1
print('First', istr)
astr = '123'
try:
istr = int(astr)
except:
istr = -1
print('Second', istr)
| 10.9375 | 21 | 0.571429 | astr = 'HelloThere'
try:
istr = int(astr)
except:
istr = -1
print('First', istr)
astr = '123'
try:
istr = int(astr)
except:
istr = -1
print('Second', istr)
| true | true |
f72443010052cb77f3bdfe74d89bbae4433a5376 | 1,195 | py | Python | hrflow/hrflow/profile/embedding.py | Riminder/python-hrflow-api | 5457c138c12689a1af08b243c15f3cbe898edf65 | [
"MIT"
] | 4 | 2020-04-01T15:16:04.000Z | 2021-01-18T03:52:39.000Z | hrflow/hrflow/profile/embedding.py | Riminder/python-hrflow-api | 5457c138c12689a1af08b243c15f3cbe898edf65 | [
"MIT"
] | null | null | null | hrflow/hrflow/profile/embedding.py | Riminder/python-hrflow-api | 5457c138c12689a1af08b243c15f3cbe898edf65 | [
"MIT"
] | null | null | null | import json
from ..utils import format_item_payload, validate_response
class ProfileEmbedding():
"""Manage embedding related profile calls."""
def __init__(self, api):
"""Init."""
self.client = api
def get(self, source_key, key=None, reference=None, email=None, fields={}):
"""
... | 31.447368 | 88 | 0.488703 | import json
from ..utils import format_item_payload, validate_response
class ProfileEmbedding():
def __init__(self, api):
self.client = api
def get(self, source_key, key=None, reference=None, email=None, fields={}):
query_params = format_item_payload("profile", source_key, key, reference, e... | true | true |
f72445e12e327cd9cce5c3c3f16c18095280f308 | 206 | py | Python | damstagram/notifications/urls.py | DaMacho/damstagram | 9c3a7074df82ecc76ef035b9ac52b464fc60734b | [
"MIT"
] | 1 | 2019-05-01T04:22:38.000Z | 2019-05-01T04:22:38.000Z | damstagram/notifications/urls.py | DaMacho/damstagram | 9c3a7074df82ecc76ef035b9ac52b464fc60734b | [
"MIT"
] | null | null | null | damstagram/notifications/urls.py | DaMacho/damstagram | 9c3a7074df82ecc76ef035b9ac52b464fc60734b | [
"MIT"
] | 1 | 2019-10-16T13:24:23.000Z | 2019-10-16T13:24:23.000Z | from django.conf.urls import url
from . import views
app_name = "users"
urlpatterns = [
url(
regex=r'^$',
view=views.Notifications.as_view(),
name='notifications'
),
] | 15.846154 | 43 | 0.587379 | from django.conf.urls import url
from . import views
app_name = "users"
urlpatterns = [
url(
regex=r'^$',
view=views.Notifications.as_view(),
name='notifications'
),
] | true | true |
f72445f45a378bb85e5fd435692975c53e5449b6 | 766 | py | Python | examples/FreeCAD/Ex001_Simple_Block.py | asukiaaa/cadquery | 1b5d8d91fdae54aadf92af82de935e34a0cc062e | [
"Apache-2.0"
] | 403 | 2015-01-20T07:55:43.000Z | 2022-02-06T03:47:56.000Z | examples/FreeCAD/Ex001_Simple_Block.py | asukiaaa/cadquery | 1b5d8d91fdae54aadf92af82de935e34a0cc062e | [
"Apache-2.0"
] | 242 | 2015-01-01T00:37:27.000Z | 2021-02-08T20:25:27.000Z | examples/FreeCAD/Ex001_Simple_Block.py | asukiaaa/cadquery | 1b5d8d91fdae54aadf92af82de935e34a0cc062e | [
"Apache-2.0"
] | 65 | 2015-01-01T00:24:54.000Z | 2021-12-10T15:42:29.000Z | import cadquery as cq
# These can be modified rather than hardcoding values for each dimension.
length = 80.0 # Length of the block
height = 60.0 # Height of the block
thickness = 10.0 # Thickness of the block
# Create a 3D block based on the dimension variables above.
# 1. Establishes a workplane tha... | 38.3 | 76 | 0.736292 | import cadquery as cq
length = 80.0
height = 60.0
thickness = 10.0
result = cq.Workplane("XY").box(length, height, thickness)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.